diff --git a/change/@fluentui-react-tabs-aee3094c-fa22-4bff-b07d-c5c045be5b5e.json b/change/@fluentui-react-tabs-aee3094c-fa22-4bff-b07d-c5c045be5b5e.json new file mode 100644 index 0000000000000..6647a82ff98f6 --- /dev/null +++ b/change/@fluentui-react-tabs-aee3094c-fa22-4bff-b07d-c5c045be5b5e.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Updating TypeScript type-only imports/exports to use import/export type syntax.", + "packageName": "@fluentui/react-tabs", + "email": "dzearing@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-tabster-ddb53570-32f9-497c-9ce2-017f41eeb13a.json b/change/@fluentui-react-tabster-ddb53570-32f9-497c-9ce2-017f41eeb13a.json new file mode 100644 index 0000000000000..02e9e861945fa --- /dev/null +++ b/change/@fluentui-react-tabster-ddb53570-32f9-497c-9ce2-017f41eeb13a.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Updating TypeScript type-only imports/exports to use import/export type syntax.", + "packageName": "@fluentui/react-tabster", + "email": "dzearing@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-text-c96287d9-97aa-49cb-a523-e1596542c4d9.json b/change/@fluentui-react-text-c96287d9-97aa-49cb-a523-e1596542c4d9.json new file mode 100644 index 0000000000000..8b86fd510551d --- /dev/null +++ b/change/@fluentui-react-text-c96287d9-97aa-49cb-a523-e1596542c4d9.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Updating TypeScript type-only imports/exports to use import/export type syntax.", + "packageName": "@fluentui/react-text", + "email": "dzearing@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-theme-32c2edaa-b060-466b-a2fe-5af7b07eb52d.json b/change/@fluentui-react-theme-32c2edaa-b060-466b-a2fe-5af7b07eb52d.json new file mode 100644 index 0000000000000..8ffe680b7768d --- /dev/null +++ b/change/@fluentui-react-theme-32c2edaa-b060-466b-a2fe-5af7b07eb52d.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Updating TypeScript type-only imports/exports to use import/export type syntax.", + "packageName": "@fluentui/react-theme", + "email": "dzearing@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-tooltip-b8a5b256-fa1a-4ef9-bbd9-9e9a7e43649b.json b/change/@fluentui-react-tooltip-b8a5b256-fa1a-4ef9-bbd9-9e9a7e43649b.json new file mode 100644 index 0000000000000..cd1f73886cdf7 --- /dev/null +++ b/change/@fluentui-react-tooltip-b8a5b256-fa1a-4ef9-bbd9-9e9a7e43649b.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Updating TypeScript type-only imports/exports to use import/export type syntax.", + "packageName": "@fluentui/react-tooltip", + "email": "dzearing@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-utilities-6821555d-e60a-4a8f-995b-16bba6673d52.json b/change/@fluentui-react-utilities-6821555d-e60a-4a8f-995b-16bba6673d52.json new file mode 100644 index 0000000000000..1d2ad9bbf1964 --- /dev/null +++ b/change/@fluentui-react-utilities-6821555d-e60a-4a8f-995b-16bba6673d52.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Updating TypeScript type-only imports/exports to use import/export type syntax.", + "packageName": "@fluentui/react-utilities", + "email": "dzearing@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-scheme-utilities-f8016815-15f7-4a89-8fef-1497078f6da2.json b/change/@fluentui-scheme-utilities-f8016815-15f7-4a89-8fef-1497078f6da2.json new file mode 100644 index 0000000000000..9764593163c70 --- /dev/null +++ b/change/@fluentui-scheme-utilities-f8016815-15f7-4a89-8fef-1497078f6da2.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Updating TypeScript type-only imports/exports to use import/export type syntax.", + "packageName": "@fluentui/scheme-utilities", + "email": "dzearing@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-theme-90b9379a-c813-457e-b347-85c45386a1bf.json b/change/@fluentui-theme-90b9379a-c813-457e-b347-85c45386a1bf.json new file mode 100644 index 0000000000000..2b629c56bd6ba --- /dev/null +++ b/change/@fluentui-theme-90b9379a-c813-457e-b347-85c45386a1bf.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Updating TypeScript type-only imports/exports to use import/export type syntax.", + "packageName": "@fluentui/theme", + "email": "dzearing@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-theme-samples-0916303e-d15b-4590-9722-e94c7fb12686.json b/change/@fluentui-theme-samples-0916303e-d15b-4590-9722-e94c7fb12686.json new file mode 100644 index 0000000000000..4d93298333e9c --- /dev/null +++ b/change/@fluentui-theme-samples-0916303e-d15b-4590-9722-e94c7fb12686.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Updating TypeScript type-only imports/exports to use import/export type syntax.", + "packageName": "@fluentui/theme-samples", + "email": "dzearing@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-switch/etc/react-switch.api.md b/packages/react-switch/etc/react-switch.api.md index 3e3f4a6de73ab..9f8e78fc373ef 100644 --- a/packages/react-switch/etc/react-switch.api.md +++ b/packages/react-switch/etc/react-switch.api.md @@ -4,8 +4,8 @@ ```ts -import { ComponentProps } from '@fluentui/react-utilities'; -import { ComponentState } from '@fluentui/react-utilities'; +import type { ComponentProps } from '@fluentui/react-utilities'; +import type { ComponentState } from '@fluentui/react-utilities'; import * as React_2 from 'react'; // @public diff --git a/packages/react-switch/src/common/isConformant.ts b/packages/react-switch/src/common/isConformant.ts index 20b3e37e97d44..4a6e72abc32c2 100644 --- a/packages/react-switch/src/common/isConformant.ts +++ b/packages/react-switch/src/common/isConformant.ts @@ -1,4 +1,5 @@ -import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance'; +import { isConformant as baseIsConformant } from '@fluentui/react-conformance'; +import type { IsConformantOptions } from '@fluentui/react-conformance'; export function isConformant( testInfo: Omit, 'componentPath'> & { componentPath?: string }, diff --git a/packages/react-switch/src/components/Switch/Switch.tsx b/packages/react-switch/src/components/Switch/Switch.tsx index 7a7cc421a7ff0..2955903f61005 100644 --- a/packages/react-switch/src/components/Switch/Switch.tsx +++ b/packages/react-switch/src/components/Switch/Switch.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { useSwitch } from './useSwitch'; -import { SwitchProps } from './Switch.types'; import { renderSwitch } from './renderSwitch'; import { useSwitchStyles } from './useSwitchStyles'; +import type { SwitchProps } from './Switch.types'; /** * Switch component diff --git a/packages/react-switch/src/components/Switch/Switch.types.ts b/packages/react-switch/src/components/Switch/Switch.types.ts index 13063e2cb7660..5e0fb0f64406e 100644 --- a/packages/react-switch/src/components/Switch/Switch.types.ts +++ b/packages/react-switch/src/components/Switch/Switch.types.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { ComponentProps, ComponentState } from '@fluentui/react-utilities'; +import type { ComponentProps, ComponentState } from '@fluentui/react-utilities'; /** * Names of the shorthand properties in SwitchProps diff --git a/packages/react-switch/src/components/Switch/renderSwitch.tsx b/packages/react-switch/src/components/Switch/renderSwitch.tsx index 61163467591a7..2395c21e66c3d 100644 --- a/packages/react-switch/src/components/Switch/renderSwitch.tsx +++ b/packages/react-switch/src/components/Switch/renderSwitch.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { getSlots } from '@fluentui/react-utilities'; -import { SwitchSlots, SwitchState } from './Switch.types'; import { switchShorthandProps } from './useSwitch'; +import type { SwitchSlots, SwitchState } from './Switch.types'; /** * Render the final JSX of Switch diff --git a/packages/react-switch/src/components/Switch/useSwitch.ts b/packages/react-switch/src/components/Switch/useSwitch.ts index 3b646f175bcd3..02aaff1f9926a 100644 --- a/packages/react-switch/src/components/Switch/useSwitch.ts +++ b/packages/react-switch/src/components/Switch/useSwitch.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { SwitchProps, SwitchSlots, SwitchState } from './Switch.types'; import { useSwitchState } from './useSwitchState'; +import type { SwitchProps, SwitchSlots, SwitchState } from './Switch.types'; /** * Array of all shorthand properties listed in SwitchShorthandProps diff --git a/packages/react-switch/src/components/Switch/useSwitchState.ts b/packages/react-switch/src/components/Switch/useSwitchState.ts index 9fffe93d735de..58b1a00cce014 100644 --- a/packages/react-switch/src/components/Switch/useSwitchState.ts +++ b/packages/react-switch/src/components/Switch/useSwitchState.ts @@ -1,4 +1,4 @@ -import { SwitchSlots, SwitchState, SwitchCommon } from './Switch.types'; +import type { SwitchSlots, SwitchState, SwitchCommon } from './Switch.types'; export const useSwitchState = (state: Pick) => { return state; diff --git a/packages/react-switch/src/components/Switch/useSwitchStyles.ts b/packages/react-switch/src/components/Switch/useSwitchStyles.ts index 3812d940e322f..17699e48dd619 100644 --- a/packages/react-switch/src/components/Switch/useSwitchStyles.ts +++ b/packages/react-switch/src/components/Switch/useSwitchStyles.ts @@ -1,5 +1,5 @@ import { makeStyles, mergeClasses } from '@fluentui/react-make-styles'; -import { SwitchState } from './Switch.types'; +import type { SwitchState } from './Switch.types'; /** * Styles for the root slot diff --git a/packages/react-switch/tsconfig.json b/packages/react-switch/tsconfig.json index 6bf6c152b1398..ac19b88cdc295 100644 --- a/packages/react-switch/tsconfig.json +++ b/packages/react-switch/tsconfig.json @@ -12,6 +12,7 @@ "importHelpers": true, "noUnusedLocals": true, "preserveConstEnums": true, - "types": ["jest", "custom-global", "inline-style-expand-shorthand", "storybook__addons"] + "types": ["jest", "custom-global", "inline-style-expand-shorthand", "storybook__addons"], + "isolatedModules": true } } diff --git a/packages/react-tabs/etc/react-tabs.api.md b/packages/react-tabs/etc/react-tabs.api.md index f251cae88885a..01b43b4995332 100644 --- a/packages/react-tabs/etc/react-tabs.api.md +++ b/packages/react-tabs/etc/react-tabs.api.md @@ -4,13 +4,13 @@ ```ts -import { IButtonProps } from '@fluentui/react/lib/Button'; -import { IKeytipProps } from '@fluentui/react'; -import { IRefObject } from '@fluentui/utilities'; -import { IRenderFunction } from '@fluentui/utilities'; -import { IStyle } from '@fluentui/style-utilities'; -import { IStyleFunctionOrObject } from '@fluentui/utilities'; -import { ITheme } from '@fluentui/style-utilities'; +import type { IButtonProps } from '@fluentui/react/lib/Button'; +import type { IKeytipProps } from '@fluentui/react'; +import type { IRefObject } from '@fluentui/utilities'; +import type { IRenderFunction } from '@fluentui/utilities'; +import type { IStyle } from '@fluentui/style-utilities'; +import type { IStyleFunctionOrObject } from '@fluentui/utilities'; +import type { ITheme } from '@fluentui/style-utilities'; import * as React_2 from 'react'; // @public @@ -98,7 +98,6 @@ export interface TabsStyles { text: IStyle; } - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/react-tabs/src/common/isConformant.ts b/packages/react-tabs/src/common/isConformant.ts index 61d1dca5948fc..05fdcbf6c3c4e 100644 --- a/packages/react-tabs/src/common/isConformant.ts +++ b/packages/react-tabs/src/common/isConformant.ts @@ -1,4 +1,5 @@ -import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance'; +import { isConformant as baseIsConformant } from '@fluentui/react-conformance'; +import type { IsConformantOptions } from '@fluentui/react-conformance'; export function isConformant( testInfo: Omit, 'componentPath'> & { componentPath?: string }, diff --git a/packages/react-tabs/src/components/Tabs/TabItem.tsx b/packages/react-tabs/src/components/Tabs/TabItem.tsx index fc76077a62910..de621e2e7dbe0 100644 --- a/packages/react-tabs/src/components/Tabs/TabItem.tsx +++ b/packages/react-tabs/src/components/Tabs/TabItem.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { getNativeProps, divProperties, initializeComponentRef } from '@fluentui/utilities'; -import { TabItemProps } from './TabItem.types'; +import type { TabItemProps } from './TabItem.types'; // const COMPONENT_NAME = 'TabItem'; diff --git a/packages/react-tabs/src/components/Tabs/TabItem.types.ts b/packages/react-tabs/src/components/Tabs/TabItem.types.ts index 75e7f4ec0ffe3..d7c26f5802874 100644 --- a/packages/react-tabs/src/components/Tabs/TabItem.types.ts +++ b/packages/react-tabs/src/components/Tabs/TabItem.types.ts @@ -1,7 +1,7 @@ import * as React from 'react'; -import { IKeytipProps } from '@fluentui/react'; -import { IButtonProps } from '@fluentui/react/lib/Button'; -import { IRefObject, IRenderFunction } from '@fluentui/utilities'; +import type { IKeytipProps } from '@fluentui/react'; +import type { IButtonProps } from '@fluentui/react/lib/Button'; +import type { IRefObject, IRenderFunction } from '@fluentui/utilities'; /** * {@docCategory Tabs} diff --git a/packages/react-tabs/src/components/Tabs/Tabs.base.tsx b/packages/react-tabs/src/components/Tabs/Tabs.base.tsx index d6e8a853255ed..9b1aed8427348 100644 --- a/packages/react-tabs/src/components/Tabs/Tabs.base.tsx +++ b/packages/react-tabs/src/components/Tabs/Tabs.base.tsx @@ -1,17 +1,13 @@ import * as React from 'react'; import { useControllableValue, useId } from '@fluentui/react-hooks'; import { classNamesFunction, css, divProperties, getNativeProps, getRTL, KeyCodes, warn } from '@fluentui/utilities'; -import { - DirectionalHint, - FocusZone, - FocusZoneDirection, - Icon, - IContextualMenuProps, - IFocusZone, -} from '@fluentui/react'; -import { CommandButton, IButton } from '@fluentui/react/lib/Button'; -import { TabsImperativeHandle, TabItemProps, TabsProps, TabsStyleProps, TabsStyles, TabItem } from './index'; +import { DirectionalHint, FocusZone, FocusZoneDirection, Icon } from '@fluentui/react'; +import { CommandButton } from '@fluentui/react/lib/Button'; +import { TabItem } from './index'; import { useOverflow } from '../../utilities/useOverflow'; +import type { IContextualMenuProps, IFocusZone } from '@fluentui/react'; +import type { IButton } from '@fluentui/react/lib/Button'; +import type { TabsImperativeHandle, TabItemProps, TabsProps, TabsStyleProps, TabsStyles } from './index'; const getClassNames = classNamesFunction(); diff --git a/packages/react-tabs/src/components/Tabs/Tabs.styles.ts b/packages/react-tabs/src/components/Tabs/Tabs.styles.ts index 6e0b28615a911..2c962e9326c59 100644 --- a/packages/react-tabs/src/components/Tabs/Tabs.styles.ts +++ b/packages/react-tabs/src/components/Tabs/Tabs.styles.ts @@ -1,14 +1,14 @@ -import { TabsStyleProps, TabsStyles } from './Tabs.types'; import { AnimationVariables, getGlobalClassNames, HighContrastSelector, - IStyle, normalize, FontWeights, getHighContrastNoAdjustStyle, } from '@fluentui/style-utilities'; import { IsFocusVisibleClassName } from '@fluentui/utilities'; +import type { TabsStyleProps, TabsStyles } from './Tabs.types'; +import type { IStyle } from '@fluentui/style-utilities'; const globalClassNames = { count: 'ms-Tabs-count', diff --git a/packages/react-tabs/src/components/Tabs/Tabs.test.tsx b/packages/react-tabs/src/components/Tabs/Tabs.test.tsx index 8fd3208efaddc..0e9f7d2cdfcf7 100644 --- a/packages/react-tabs/src/components/Tabs/Tabs.test.tsx +++ b/packages/react-tabs/src/components/Tabs/Tabs.test.tsx @@ -2,8 +2,9 @@ import * as React from 'react'; import { create } from '@fluentui/utilities/lib/test'; import { mount } from 'enzyme'; import { resetIds } from '@fluentui/utilities'; -import { Tabs, TabItem, TabsImperativeHandle } from './index'; +import { Tabs, TabItem } from './index'; import { isConformant } from '../../common/isConformant'; +import type { TabsImperativeHandle } from './index'; describe('Tabs', () => { beforeEach(() => { diff --git a/packages/react-tabs/src/components/Tabs/Tabs.tsx b/packages/react-tabs/src/components/Tabs/Tabs.tsx index 55fd0a0e0c494..e2cca195d9227 100644 --- a/packages/react-tabs/src/components/Tabs/Tabs.tsx +++ b/packages/react-tabs/src/components/Tabs/Tabs.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { styled } from '@fluentui/utilities'; -import { TabsProps, TabsStyleProps, TabsStyles } from './Tabs.types'; import { TabsBase } from './Tabs.base'; import { getStyles } from './Tabs.styles'; +import type { TabsProps, TabsStyleProps, TabsStyles } from './Tabs.types'; /** * The Tabs control and related tabs pattern are used for navigating frequently accessed, diff --git a/packages/react-tabs/src/components/Tabs/Tabs.types.ts b/packages/react-tabs/src/components/Tabs/Tabs.types.ts index 74232657f6f87..66736b09565a4 100644 --- a/packages/react-tabs/src/components/Tabs/Tabs.types.ts +++ b/packages/react-tabs/src/components/Tabs/Tabs.types.ts @@ -1,7 +1,7 @@ import * as React from 'react'; -import { IStyle, ITheme } from '@fluentui/style-utilities'; -import { IStyleFunctionOrObject } from '@fluentui/utilities'; import { TabItem } from './TabItem'; +import type { IStyle, ITheme } from '@fluentui/style-utilities'; +import type { IStyleFunctionOrObject } from '@fluentui/utilities'; /** * {@docCategory Tabs} diff --git a/packages/react-tabs/src/utilities/useOverflow.ts b/packages/react-tabs/src/utilities/useOverflow.ts index a516db000867f..5a76f674f4a13 100644 --- a/packages/react-tabs/src/utilities/useOverflow.ts +++ b/packages/react-tabs/src/utilities/useOverflow.ts @@ -1,7 +1,8 @@ import * as React from 'react'; -import { useRefEffect, RefCallback } from '@fluentui/react-hooks'; +import { useRefEffect } from '@fluentui/react-hooks'; import { getWindow } from '@fluentui/utilities'; import { observeResize } from './observeResize'; +import type { RefCallback } from '@fluentui/react-hooks'; /** * Callback to notify the user that the items in the overflow have changed. This should ensure that the overflow menu diff --git a/packages/react-tabster/etc/react-tabster.api.md b/packages/react-tabster/etc/react-tabster.api.md index e33713d7de83a..f074f2792276f 100644 --- a/packages/react-tabster/etc/react-tabster.api.md +++ b/packages/react-tabster/etc/react-tabster.api.md @@ -5,7 +5,7 @@ ```ts import type { MakeStylesStyleRule } from '@fluentui/make-styles'; -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import type { Theme } from '@fluentui/react-theme'; import { Types } from 'tabster'; @@ -54,7 +54,6 @@ export interface UseModalAttributesOptions { // @public export const useTabsterAttributes: (props: Types.TabsterAttributeProps) => Types.TabsterDOMAttribute; - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/react-tabster/src/hooks/useKeyboardNavAttribute.ts b/packages/react-tabster/src/hooks/useKeyboardNavAttribute.ts index f62fa3dbbed91..f699993cd9626 100644 --- a/packages/react-tabster/src/hooks/useKeyboardNavAttribute.ts +++ b/packages/react-tabster/src/hooks/useKeyboardNavAttribute.ts @@ -1,8 +1,9 @@ import { createKeyborg } from 'keyborg'; -import { KeyborgCallback } from 'keyborg/dist/Keyborg'; -import { RefObject, useEffect, useMemo, useRef } from 'react'; +import { useEffect, useMemo, useRef } from 'react'; import { KEYBOARD_NAV_ATTRIBUTE } from '../symbols'; import { useFluent } from '@fluentui/react-shared-contexts'; +import type { KeyborgCallback } from 'keyborg/dist/Keyborg'; +import type { RefObject } from 'react'; /** * instantiates keyborg and add attribute to ensure focus indicator synced to keyborg logic diff --git a/packages/react-tabster/tsconfig.json b/packages/react-tabster/tsconfig.json index 32cf3b5e8163a..0a0f117f8af80 100644 --- a/packages/react-tabster/tsconfig.json +++ b/packages/react-tabster/tsconfig.json @@ -12,6 +12,7 @@ "importHelpers": true, "noUnusedLocals": true, "preserveConstEnums": true, - "types": ["jest", "custom-global", "inline-style-expand-shorthand"] + "types": ["jest", "custom-global", "inline-style-expand-shorthand"], + "isolatedModules": true } } diff --git a/packages/react-text/etc/react-text.api.md b/packages/react-text/etc/react-text.api.md index 7630c7e197bff..569f4abc1e6ca 100644 --- a/packages/react-text/etc/react-text.api.md +++ b/packages/react-text/etc/react-text.api.md @@ -4,8 +4,8 @@ ```ts -import { ComponentPropsCompat } from '@fluentui/react-utilities'; -import { ComponentStateCompat } from '@fluentui/react-utilities'; +import type { ComponentPropsCompat } from '@fluentui/react-utilities'; +import type { ComponentStateCompat } from '@fluentui/react-utilities'; import { ForwardRefExoticComponent } from 'react'; import * as React_2 from 'react'; import { RefAttributes } from 'react'; diff --git a/packages/react-text/src/Text.stories.tsx b/packages/react-text/src/Text.stories.tsx index 344c0f18dae45..5af5949185db0 100644 --- a/packages/react-text/src/Text.stories.tsx +++ b/packages/react-text/src/Text.stories.tsx @@ -1,6 +1,7 @@ import { makeStyles } from '@fluentui/react-make-styles'; import * as React from 'react'; -import { Text, TextProps } from './Text'; +import { Text } from './Text'; +import type { TextProps } from './Text'; const useStyles = makeStyles({ container: { diff --git a/packages/react-text/src/common/isConformant.ts b/packages/react-text/src/common/isConformant.ts index 20b3e37e97d44..4a6e72abc32c2 100644 --- a/packages/react-text/src/common/isConformant.ts +++ b/packages/react-text/src/common/isConformant.ts @@ -1,4 +1,5 @@ -import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance'; +import { isConformant as baseIsConformant } from '@fluentui/react-conformance'; +import type { IsConformantOptions } from '@fluentui/react-conformance'; export function isConformant( testInfo: Omit, 'componentPath'> & { componentPath?: string }, diff --git a/packages/react-text/src/components/Text/Text.tsx b/packages/react-text/src/components/Text/Text.tsx index 49e9aca62a021..6854bb6fc5a4f 100644 --- a/packages/react-text/src/components/Text/Text.tsx +++ b/packages/react-text/src/components/Text/Text.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { useText } from './useText'; -import { TextProps } from './Text.types'; import { renderText } from './renderText'; import { useTextStyles } from './useTextStyles'; +import type { TextProps } from './Text.types'; /** * Typography and styling abstraction component used to ensure consistency of text. diff --git a/packages/react-text/src/components/Text/Text.types.ts b/packages/react-text/src/components/Text/Text.types.ts index ef315d146fefe..c1a092b0c7582 100644 --- a/packages/react-text/src/components/Text/Text.types.ts +++ b/packages/react-text/src/components/Text/Text.types.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { ComponentPropsCompat, ComponentStateCompat } from '@fluentui/react-utilities'; +import type { ComponentPropsCompat, ComponentStateCompat } from '@fluentui/react-utilities'; /** * Text Props diff --git a/packages/react-text/src/components/Text/renderText.tsx b/packages/react-text/src/components/Text/renderText.tsx index 1215860f8f6ff..fca08d03d8252 100644 --- a/packages/react-text/src/components/Text/renderText.tsx +++ b/packages/react-text/src/components/Text/renderText.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { getSlotsCompat } from '@fluentui/react-utilities'; -import { TextState } from './Text.types'; +import type { TextState } from './Text.types'; /** * Render the final JSX of Text diff --git a/packages/react-text/src/components/Text/useText.ts b/packages/react-text/src/components/Text/useText.ts index 433d2a276100c..cc48d3aeccbec 100644 --- a/packages/react-text/src/components/Text/useText.ts +++ b/packages/react-text/src/components/Text/useText.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeMergeProps } from '@fluentui/react-utilities'; -import { TextProps, TextState } from './Text.types'; +import type { TextProps, TextState } from './Text.types'; const mergeProps = makeMergeProps(); diff --git a/packages/react-text/src/components/Text/useTextStyles.ts b/packages/react-text/src/components/Text/useTextStyles.ts index 6b3fec7c8bc69..d278405edcfb8 100644 --- a/packages/react-text/src/components/Text/useTextStyles.ts +++ b/packages/react-text/src/components/Text/useTextStyles.ts @@ -1,5 +1,5 @@ import { makeStyles, mergeClasses } from '@fluentui/react-make-styles'; -import { TextState } from './Text.types'; +import type { TextState } from './Text.types'; /** * Styles for the root slot diff --git a/packages/react-text/src/components/wrapper.tsx b/packages/react-text/src/components/wrapper.tsx index f9525099a248c..8060e7c334598 100644 --- a/packages/react-text/src/components/wrapper.tsx +++ b/packages/react-text/src/components/wrapper.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { mergeClasses } from '@fluentui/react-make-styles'; -import { renderText, TextProps, useText, useTextStyles } from '../Text'; +import { renderText, useText, useTextStyles } from '../Text'; +import type { TextProps } from '../Text'; export interface Props extends Omit {} diff --git a/packages/react-text/src/typographyStyles/typographyStyles.test.ts b/packages/react-text/src/typographyStyles/typographyStyles.test.ts index b4f128648a913..d27c0084b9258 100644 --- a/packages/react-text/src/typographyStyles/typographyStyles.test.ts +++ b/packages/react-text/src/typographyStyles/typographyStyles.test.ts @@ -1,5 +1,5 @@ -import { Theme } from '@fluentui/react-theme'; import { typographyStyles } from './index'; +import type { Theme } from '@fluentui/react-theme'; const weightsMock = { regular: 1, diff --git a/packages/react-text/src/typographyStyles/typographyStyles.ts b/packages/react-text/src/typographyStyles/typographyStyles.ts index f949ab56fbabd..e8e6b22de2c6c 100644 --- a/packages/react-text/src/typographyStyles/typographyStyles.ts +++ b/packages/react-text/src/typographyStyles/typographyStyles.ts @@ -1,5 +1,5 @@ -import { MakeStylesStyleFunctionRule } from '@fluentui/make-styles'; -import { Theme } from '@fluentui/react-theme'; +import type { MakeStylesStyleFunctionRule } from '@fluentui/make-styles'; +import type { Theme } from '@fluentui/react-theme'; /** * Make-styles rules for the typography variants diff --git a/packages/react-text/tsconfig.json b/packages/react-text/tsconfig.json index 291c39ef2cbef..ae87ea05d7f64 100644 --- a/packages/react-text/tsconfig.json +++ b/packages/react-text/tsconfig.json @@ -12,6 +12,7 @@ "importHelpers": true, "noUnusedLocals": true, "preserveConstEnums": true, - "types": ["jest", "custom-global", "inline-style-expand-shorthand", "@testing-library/jest-dom"] + "types": ["jest", "custom-global", "inline-style-expand-shorthand", "@testing-library/jest-dom"], + "isolatedModules": true } } diff --git a/packages/react-theme/src/alias/dark.ts b/packages/react-theme/src/alias/dark.ts index a040d6d28e694..f1f2c93b8f7ad 100644 --- a/packages/react-theme/src/alias/dark.ts +++ b/packages/react-theme/src/alias/dark.ts @@ -1,4 +1,4 @@ -import { GlobalSharedColors, NeutralColorTokens, SharedColorTokens } from '../types'; +import type { GlobalSharedColors, NeutralColorTokens, SharedColorTokens } from '../types'; export const neutralColorTokens: NeutralColorTokens = { neutralForeground1: 'var(--global-color-white)', // #ffffff Global.Color.White diff --git a/packages/react-theme/src/alias/highContrast.ts b/packages/react-theme/src/alias/highContrast.ts index ad1dfd81de9bc..3d7b2cbf1c1d5 100644 --- a/packages/react-theme/src/alias/highContrast.ts +++ b/packages/react-theme/src/alias/highContrast.ts @@ -1,4 +1,4 @@ -import { GlobalSharedColors, NeutralColorTokens, SharedColorTokens } from '../types'; +import type { GlobalSharedColors, NeutralColorTokens, SharedColorTokens } from '../types'; export const neutralColorTokens: NeutralColorTokens = { neutralForeground1: 'var(--global-color-hcCanvasText)', // #ffffff Global.Color.hcCanvasText diff --git a/packages/react-theme/src/alias/light.ts b/packages/react-theme/src/alias/light.ts index 749d65037a4a2..a5758585e4872 100644 --- a/packages/react-theme/src/alias/light.ts +++ b/packages/react-theme/src/alias/light.ts @@ -1,4 +1,4 @@ -import { GlobalSharedColors, NeutralColorTokens, SharedColorTokens } from '../types'; +import type { GlobalSharedColors, NeutralColorTokens, SharedColorTokens } from '../types'; export const neutralColorTokens: NeutralColorTokens = { neutralForeground1: 'var(--global-palette-grey-14)', // #242424 Global.Color.Grey.14 diff --git a/packages/react-theme/src/alias/teamsDark.ts b/packages/react-theme/src/alias/teamsDark.ts index 52be4f4d709ce..f72f9b0c9a72e 100644 --- a/packages/react-theme/src/alias/teamsDark.ts +++ b/packages/react-theme/src/alias/teamsDark.ts @@ -1,4 +1,4 @@ -import { GlobalSharedColors, NeutralColorTokens, SharedColorTokens } from '../types'; +import type { GlobalSharedColors, NeutralColorTokens, SharedColorTokens } from '../types'; export const neutralColorTokens: NeutralColorTokens = { neutralForeground1: 'var(--global-color-white)', // #ffffff Global.Color.White diff --git a/packages/react-theme/src/global/borderRadius.ts b/packages/react-theme/src/global/borderRadius.ts index 2bae79f30d409..703870b0a9aae 100644 --- a/packages/react-theme/src/global/borderRadius.ts +++ b/packages/react-theme/src/global/borderRadius.ts @@ -1,4 +1,4 @@ -import { BorderRadius } from '../types'; +import type { BorderRadius } from '../types'; export const borderRadius: BorderRadius = { none: '0', diff --git a/packages/react-theme/src/global/brandColors.ts b/packages/react-theme/src/global/brandColors.ts index 3320cc7429c90..922a8614f06c0 100644 --- a/packages/react-theme/src/global/brandColors.ts +++ b/packages/react-theme/src/global/brandColors.ts @@ -1,4 +1,4 @@ -import { BrandVariants, ProductBrandColors } from '../types'; +import type { BrandVariants, ProductBrandColors } from '../types'; // TODO: values should be set per product theme export const brandWeb: BrandVariants = { diff --git a/packages/react-theme/src/global/colors.ts b/packages/react-theme/src/global/colors.ts index 8b1a5c6a3ab41..de6d2304cc56d 100644 --- a/packages/react-theme/src/global/colors.ts +++ b/packages/react-theme/src/global/colors.ts @@ -1,4 +1,4 @@ -import { GlobalSharedColors, ColorVariants, Greys, AlphaColors } from '../types'; +import type { GlobalSharedColors, ColorVariants, Greys, AlphaColors } from '../types'; export const grey: Record = { '0': '#000000', diff --git a/packages/react-theme/src/global/fonts.ts b/packages/react-theme/src/global/fonts.ts index 496bdced43f2b..e4b10d467ef38 100644 --- a/packages/react-theme/src/global/fonts.ts +++ b/packages/react-theme/src/global/fonts.ts @@ -1,4 +1,4 @@ -import { FontFamilies, FontSizes, FontWeights, LineHeights, TextAlignments } from '../types'; +import type { FontFamilies, FontSizes, FontWeights, LineHeights, TextAlignments } from '../types'; export const fontSizes: FontSizes = { base: { diff --git a/packages/react-theme/src/global/strokeWidths.ts b/packages/react-theme/src/global/strokeWidths.ts index 8e016d483d582..7c4e0e9200914 100644 --- a/packages/react-theme/src/global/strokeWidths.ts +++ b/packages/react-theme/src/global/strokeWidths.ts @@ -1,4 +1,4 @@ -import { StrokeWidths } from '../types'; +import type { StrokeWidths } from '../types'; export const strokeWidths: StrokeWidths = { thin: '1px', diff --git a/packages/react-theme/src/global/utils.ts b/packages/react-theme/src/global/utils.ts index 110d99f1e951f..89bc935ad8da1 100644 --- a/packages/react-theme/src/global/utils.ts +++ b/packages/react-theme/src/global/utils.ts @@ -17,7 +17,7 @@ import { } from './colors'; import { textAlignments, fontFamilies, fontWeights, fontSizes, lineHeights } from './fonts'; import { strokeWidths } from './strokeWidths'; -import { Theme, BrandVariants } from '../types'; +import type { Theme, BrandVariants } from '../types'; export const createGlobalTheme = (brand: BrandVariants): Theme['global'] => { return { diff --git a/packages/react-theme/src/themes/AliasColor.stories.tsx b/packages/react-theme/src/themes/AliasColor.stories.tsx index 81633a7b50981..cd216d6377e6a 100644 --- a/packages/react-theme/src/themes/AliasColor.stories.tsx +++ b/packages/react-theme/src/themes/AliasColor.stories.tsx @@ -7,18 +7,9 @@ import * as React from 'react'; import { TinyColor } from '@ctrl/tinycolor'; -import { - BackgroundColorTokens, - BrandColorTokens, - NeutralColorTokens, - SharedColorTokens, - teamsDarkTheme, - teamsHighContrastTheme, - teamsLightTheme, - webDarkTheme, - Theme, -} from '../index'; +import { teamsDarkTheme, teamsHighContrastTheme, teamsLightTheme, webDarkTheme } from '../index'; import { ColorRampItem } from './ColorRamp.stories'; +import type { BackgroundColorTokens, BrandColorTokens, NeutralColorTokens, SharedColorTokens, Theme } from '../index'; // FIXME: hardcoded theme const theme = { diff --git a/packages/react-theme/src/themes/AliasShadow.stories.tsx b/packages/react-theme/src/themes/AliasShadow.stories.tsx index 02b973e4c86a9..f7d6cc1454705 100644 --- a/packages/react-theme/src/themes/AliasShadow.stories.tsx +++ b/packages/react-theme/src/themes/AliasShadow.stories.tsx @@ -6,7 +6,8 @@ // @ts-nocheck import * as React from 'react'; -import { ShadowLevelTokens, teamsDarkTheme, teamsHighContrastTheme, teamsLightTheme } from '../index'; +import { teamsDarkTheme, teamsHighContrastTheme, teamsLightTheme } from '../index'; +import type { ShadowLevelTokens } from '../index'; export default { title: 'Theme/Alias/Shadows', diff --git a/packages/react-theme/src/themes/GlobalBorderRadius.stories.tsx b/packages/react-theme/src/themes/GlobalBorderRadius.stories.tsx index 5c3c771d8baf0..020918d06b309 100644 --- a/packages/react-theme/src/themes/GlobalBorderRadius.stories.tsx +++ b/packages/react-theme/src/themes/GlobalBorderRadius.stories.tsx @@ -6,7 +6,8 @@ // @ts-nocheck import * as React from 'react'; -import { teamsLightTheme, BorderRadius as BorderRadiusType } from '../index'; +import { teamsLightTheme } from '../index'; +import type { BorderRadius as BorderRadiusType } from '../index'; export default { title: 'Theme/Global/Border Radius', diff --git a/packages/react-theme/src/themes/GlobalStrokeWidth.stories.tsx b/packages/react-theme/src/themes/GlobalStrokeWidth.stories.tsx index a9450ca17c7b3..4559d5ea9d1e4 100644 --- a/packages/react-theme/src/themes/GlobalStrokeWidth.stories.tsx +++ b/packages/react-theme/src/themes/GlobalStrokeWidth.stories.tsx @@ -6,7 +6,8 @@ // @ts-nocheck import * as React from 'react'; -import { StrokeWidths, teamsLightTheme } from '../index'; +import { teamsLightTheme } from '../index'; +import type { StrokeWidths } from '../index'; export default { title: 'Theme/Global/Stroke Width', diff --git a/packages/react-theme/src/themes/GlobalType.stories.tsx b/packages/react-theme/src/themes/GlobalType.stories.tsx index 24c2f19d009d7..befdf2b341333 100644 --- a/packages/react-theme/src/themes/GlobalType.stories.tsx +++ b/packages/react-theme/src/themes/GlobalType.stories.tsx @@ -6,7 +6,8 @@ // @ts-nocheck import * as React from 'react'; -import { FontFamilies, FontSizes, LineHeights, FontWeights, TextAlignments, teamsLightTheme } from '../index'; +import { teamsLightTheme } from '../index'; +import type { FontFamilies, FontSizes, LineHeights, FontWeights, TextAlignments } from '../index'; export default { title: 'Theme/Global/Type', diff --git a/packages/react-theme/src/themes/teams/darkTheme.ts b/packages/react-theme/src/themes/teams/darkTheme.ts index 2fc8c9efcfb05..abe33d8bb47da 100644 --- a/packages/react-theme/src/themes/teams/darkTheme.ts +++ b/packages/react-theme/src/themes/teams/darkTheme.ts @@ -1,5 +1,5 @@ import { createTeamsDarkTheme } from '../../utils/createTeamsDarkTheme'; import { brandTeams } from '../../global/brandColors'; -import { Theme } from '../../types'; +import type { Theme } from '../../types'; export const teamsDarkTheme: Theme = createTeamsDarkTheme(brandTeams); diff --git a/packages/react-theme/src/themes/teams/highContrastTheme.ts b/packages/react-theme/src/themes/teams/highContrastTheme.ts index 45b635e2ba78d..253ecb300fcc2 100644 --- a/packages/react-theme/src/themes/teams/highContrastTheme.ts +++ b/packages/react-theme/src/themes/teams/highContrastTheme.ts @@ -1,5 +1,5 @@ import { createHighContrastTheme } from '../../utils/createHighContrastTheme'; import { brandTeams } from '../../global/brandColors'; -import { Theme } from '../../types'; +import type { Theme } from '../../types'; export const teamsHighContrastTheme: Theme = createHighContrastTheme(brandTeams); diff --git a/packages/react-theme/src/themes/teams/lightTheme.ts b/packages/react-theme/src/themes/teams/lightTheme.ts index ae9a86bdb730c..e40bc4ce3bcd3 100644 --- a/packages/react-theme/src/themes/teams/lightTheme.ts +++ b/packages/react-theme/src/themes/teams/lightTheme.ts @@ -1,5 +1,5 @@ import { createLightTheme } from '../../utils/createLightTheme'; import { brandTeams } from '../../global/brandColors'; -import { Theme } from '../../types'; +import type { Theme } from '../../types'; export const teamsLightTheme: Theme = createLightTheme(brandTeams); diff --git a/packages/react-theme/src/themes/web/darkTheme.ts b/packages/react-theme/src/themes/web/darkTheme.ts index 9bb685b9775c2..9e2b10f33b0f9 100644 --- a/packages/react-theme/src/themes/web/darkTheme.ts +++ b/packages/react-theme/src/themes/web/darkTheme.ts @@ -1,5 +1,5 @@ import { createDarkTheme } from '../../utils/createDarkTheme'; import { brandWeb } from '../../global/brandColors'; -import { Theme } from '../../types'; +import type { Theme } from '../../types'; export const webDarkTheme: Theme = createDarkTheme(brandWeb); diff --git a/packages/react-theme/src/themes/web/highContrastTheme.ts b/packages/react-theme/src/themes/web/highContrastTheme.ts index 92955fdd60f2a..284101ba0eee9 100644 --- a/packages/react-theme/src/themes/web/highContrastTheme.ts +++ b/packages/react-theme/src/themes/web/highContrastTheme.ts @@ -1,5 +1,5 @@ import { createHighContrastTheme } from '../../utils/createHighContrastTheme'; import { brandWeb } from '../../global/brandColors'; -import { Theme } from '../../types'; +import type { Theme } from '../../types'; export const webHighContrastTheme: Theme = createHighContrastTheme(brandWeb); diff --git a/packages/react-theme/src/themes/web/lightTheme.ts b/packages/react-theme/src/themes/web/lightTheme.ts index d983b0074af42..b1b1b5fe106b9 100644 --- a/packages/react-theme/src/themes/web/lightTheme.ts +++ b/packages/react-theme/src/themes/web/lightTheme.ts @@ -1,5 +1,5 @@ import { createLightTheme } from '../../utils/createLightTheme'; import { brandWeb } from '../../global/brandColors'; -import { Theme } from '../../types'; +import type { Theme } from '../../types'; export const webLightTheme: Theme = createLightTheme(brandWeb); diff --git a/packages/react-theme/src/utils/createDarkTheme.ts b/packages/react-theme/src/utils/createDarkTheme.ts index 4d850d77b7869..2a269e12ae8ed 100644 --- a/packages/react-theme/src/utils/createDarkTheme.ts +++ b/packages/react-theme/src/utils/createDarkTheme.ts @@ -1,7 +1,7 @@ -import { BrandVariants, Theme } from '../types'; import { createShadowLevelTokens } from './shadows'; import { generateSharedColorTokens, neutralColorTokens } from '../alias/dark'; import { createGlobalTheme } from '../global/utils'; +import type { BrandVariants, Theme } from '../types'; export const createDarkTheme: (brand: BrandVariants) => Theme = brand => { const global = createGlobalTheme(brand); diff --git a/packages/react-theme/src/utils/createHighContrastTheme.ts b/packages/react-theme/src/utils/createHighContrastTheme.ts index 625df3f5ca396..4c8d64fae69dc 100644 --- a/packages/react-theme/src/utils/createHighContrastTheme.ts +++ b/packages/react-theme/src/utils/createHighContrastTheme.ts @@ -1,7 +1,7 @@ -import { BrandVariants, Theme } from '../types'; import { createShadowLevelTokens } from './shadows'; import { generateSharedColorTokens, neutralColorTokens } from '../alias/highContrast'; import { createGlobalTheme } from '../global/utils'; +import type { BrandVariants, Theme } from '../types'; export const createHighContrastTheme: (brand: BrandVariants) => Theme = brand => { const global = createGlobalTheme(brand); diff --git a/packages/react-theme/src/utils/createLightTheme.ts b/packages/react-theme/src/utils/createLightTheme.ts index b40a36f7d6dcd..bd790658af6c5 100644 --- a/packages/react-theme/src/utils/createLightTheme.ts +++ b/packages/react-theme/src/utils/createLightTheme.ts @@ -1,7 +1,7 @@ -import { BrandVariants, Theme } from '../types'; import { createShadowLevelTokens } from './shadows'; import { generateSharedColorTokens, neutralColorTokens } from '../alias/light'; import { createGlobalTheme } from '../global/utils'; +import type { BrandVariants, Theme } from '../types'; export const createLightTheme: (brand: BrandVariants) => Theme = brand => { const global = createGlobalTheme(brand); diff --git a/packages/react-theme/src/utils/createTeamsDarkTheme.ts b/packages/react-theme/src/utils/createTeamsDarkTheme.ts index 90a7addfb6e66..7e33e039f1ab3 100644 --- a/packages/react-theme/src/utils/createTeamsDarkTheme.ts +++ b/packages/react-theme/src/utils/createTeamsDarkTheme.ts @@ -1,7 +1,7 @@ -import { BrandVariants, Theme } from '../types'; import { createShadowLevelTokens } from './shadows'; import { generateSharedColorTokens, neutralColorTokens } from '../alias/teamsDark'; import { createGlobalTheme } from '../global/utils'; +import type { BrandVariants, Theme } from '../types'; export const createTeamsDarkTheme: (brand: BrandVariants) => Theme = brand => { const global = createGlobalTheme(brand); diff --git a/packages/react-theme/src/utils/mergeThemes.test.ts b/packages/react-theme/src/utils/mergeThemes.test.ts index a3f85a1f05f8b..d6fbbf78c2010 100644 --- a/packages/react-theme/src/utils/mergeThemes.test.ts +++ b/packages/react-theme/src/utils/mergeThemes.test.ts @@ -1,6 +1,6 @@ -import { PartialTheme, Theme } from '../types'; import { teamsLightTheme } from '../themes'; import { mergeThemes } from './mergeThemes'; +import type { PartialTheme, Theme } from '../types'; describe('mergeThemes', () => { it('performs a merge of themes', () => { diff --git a/packages/react-theme/src/utils/mergeThemes.ts b/packages/react-theme/src/utils/mergeThemes.ts index 96ddef0b564c6..f25f5c02f0c94 100644 --- a/packages/react-theme/src/utils/mergeThemes.ts +++ b/packages/react-theme/src/utils/mergeThemes.ts @@ -1,4 +1,4 @@ -import { PartialTheme, Theme } from '../types'; +import type { PartialTheme, Theme } from '../types'; // TODO // We should consider removal merge() function from this file, ideally it should not be required diff --git a/packages/react-theme/src/utils/shadows.ts b/packages/react-theme/src/utils/shadows.ts index cb2b31129dd40..7bfbee639c68f 100644 --- a/packages/react-theme/src/utils/shadows.ts +++ b/packages/react-theme/src/utils/shadows.ts @@ -1,4 +1,4 @@ -import { ShadowLevelTokens } from '../types'; +import type { ShadowLevelTokens } from '../types'; export function createShadowLevelTokens(ambientColor: string, keyColor: string): ShadowLevelTokens { return { diff --git a/packages/react-theme/src/utils/themeToCSSVariables.ts b/packages/react-theme/src/utils/themeToCSSVariables.ts index 2eb1468fee499..c1a0378047489 100644 --- a/packages/react-theme/src/utils/themeToCSSVariables.ts +++ b/packages/react-theme/src/utils/themeToCSSVariables.ts @@ -1,4 +1,4 @@ -import { Theme } from '../types'; +import type { Theme } from '../types'; function flattenThemeToCSSVariables( // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/react-theme/tsconfig.json b/packages/react-theme/tsconfig.json index 1259d048631bd..851c909e1eadf 100644 --- a/packages/react-theme/tsconfig.json +++ b/packages/react-theme/tsconfig.json @@ -12,6 +12,7 @@ "importHelpers": true, "noUnusedLocals": true, "preserveConstEnums": true, - "types": ["jest", "custom-global", "inline-style-expand-shorthand"] + "types": ["jest", "custom-global", "inline-style-expand-shorthand"], + "isolatedModules": true } } diff --git a/packages/react-tooltip/etc/react-tooltip.api.md b/packages/react-tooltip/etc/react-tooltip.api.md index acbf8e0265f30..b9e5c8a5be403 100644 --- a/packages/react-tooltip/etc/react-tooltip.api.md +++ b/packages/react-tooltip/etc/react-tooltip.api.md @@ -4,11 +4,11 @@ ```ts -import { ComponentPropsCompat } from '@fluentui/react-utilities'; -import { ComponentStateCompat } from '@fluentui/react-utilities'; -import { PositioningShorthand } from '@fluentui/react-positioning'; +import type { ComponentPropsCompat } from '@fluentui/react-utilities'; +import type { ComponentStateCompat } from '@fluentui/react-utilities'; +import type { PositioningShorthand } from '@fluentui/react-positioning'; import * as React_2 from 'react'; -import { ShorthandPropsCompat } from '@fluentui/react-utilities'; +import type { ShorthandPropsCompat } from '@fluentui/react-utilities'; // @public export interface OnVisibleChangeData { diff --git a/packages/react-tooltip/src/common/isConformant.ts b/packages/react-tooltip/src/common/isConformant.ts index 20b3e37e97d44..4a6e72abc32c2 100644 --- a/packages/react-tooltip/src/common/isConformant.ts +++ b/packages/react-tooltip/src/common/isConformant.ts @@ -1,4 +1,5 @@ -import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance'; +import { isConformant as baseIsConformant } from '@fluentui/react-conformance'; +import type { IsConformantOptions } from '@fluentui/react-conformance'; export function isConformant( testInfo: Omit, 'componentPath'> & { componentPath?: string }, diff --git a/packages/react-tooltip/src/components/Tooltip/Tooltip.tsx b/packages/react-tooltip/src/components/Tooltip/Tooltip.tsx index a9590d33f350c..b8d4affcfc143 100644 --- a/packages/react-tooltip/src/components/Tooltip/Tooltip.tsx +++ b/packages/react-tooltip/src/components/Tooltip/Tooltip.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { useTooltip } from './useTooltip'; -import { TooltipProps } from './Tooltip.types'; import { renderTooltip } from './renderTooltip'; import { useTooltipStyles } from './useTooltipStyles'; +import type { TooltipProps } from './Tooltip.types'; /** * A tooltip provides light weight contextual information on top of its target element. diff --git a/packages/react-tooltip/src/components/Tooltip/Tooltip.types.ts b/packages/react-tooltip/src/components/Tooltip/Tooltip.types.ts index 51544d3cf8651..7dd200c28e93b 100644 --- a/packages/react-tooltip/src/components/Tooltip/Tooltip.types.ts +++ b/packages/react-tooltip/src/components/Tooltip/Tooltip.types.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { PositioningShorthand } from '@fluentui/react-positioning'; -import { ComponentPropsCompat, ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities'; +import type { PositioningShorthand } from '@fluentui/react-positioning'; +import type { ComponentPropsCompat, ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities'; /** * Properties for the Tooltip component diff --git a/packages/react-tooltip/src/components/Tooltip/renderTooltip.tsx b/packages/react-tooltip/src/components/Tooltip/renderTooltip.tsx index bd774ae4e8b01..3553a535909f0 100644 --- a/packages/react-tooltip/src/components/Tooltip/renderTooltip.tsx +++ b/packages/react-tooltip/src/components/Tooltip/renderTooltip.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { Portal } from '@fluentui/react-portal'; import { getSlotsCompat } from '@fluentui/react-utilities'; -import { TooltipState } from './Tooltip.types'; import { tooltipShorthandProps } from './useTooltip'; +import type { TooltipState } from './Tooltip.types'; /** * Render the final JSX of Tooltip diff --git a/packages/react-tooltip/src/components/Tooltip/useTooltip.tsx b/packages/react-tooltip/src/components/Tooltip/useTooltip.tsx index d5ea6dcb7a947..5291ddff52b7f 100644 --- a/packages/react-tooltip/src/components/Tooltip/useTooltip.tsx +++ b/packages/react-tooltip/src/components/Tooltip/useTooltip.tsx @@ -12,7 +12,7 @@ import { useMergedRefs, useTimeout, } from '@fluentui/react-utilities'; -import { TooltipProps, TooltipShorthandProps, TooltipState, TooltipTriggerProps } from './Tooltip.types'; +import type { TooltipProps, TooltipShorthandProps, TooltipState, TooltipTriggerProps } from './Tooltip.types'; /** * Names of the shorthand properties in TooltipProps diff --git a/packages/react-tooltip/src/components/Tooltip/useTooltipStyles.ts b/packages/react-tooltip/src/components/Tooltip/useTooltipStyles.ts index 1c50c7c3094fb..71811d7f58ecb 100644 --- a/packages/react-tooltip/src/components/Tooltip/useTooltipStyles.ts +++ b/packages/react-tooltip/src/components/Tooltip/useTooltipStyles.ts @@ -1,5 +1,5 @@ import { makeStyles, mergeClasses } from '@fluentui/react-make-styles'; -import { TooltipState } from './Tooltip.types'; +import type { TooltipState } from './Tooltip.types'; /** * Styles for the tooltip diff --git a/packages/react-tooltip/tsconfig.json b/packages/react-tooltip/tsconfig.json index 5a977f51e4d87..d8f1d5a1e7de3 100644 --- a/packages/react-tooltip/tsconfig.json +++ b/packages/react-tooltip/tsconfig.json @@ -12,6 +12,7 @@ "importHelpers": true, "noUnusedLocals": true, "preserveConstEnums": true, - "types": ["jest", "custom-global", "inline-style-expand-shorthand", "storybook__addons"] + "types": ["jest", "custom-global", "inline-style-expand-shorthand", "storybook__addons"], + "isolatedModules": true } } diff --git a/packages/react-utilities/src/compose/getSlots.test.tsx b/packages/react-utilities/src/compose/getSlots.test.tsx index e5a85ec86453d..e620bc4ecb4b9 100644 --- a/packages/react-utilities/src/compose/getSlots.test.tsx +++ b/packages/react-utilities/src/compose/getSlots.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { getSlots } from './getSlots'; import { nullRender } from './nullRender'; -import { ComponentState } from './types'; +import type { ComponentState } from './types'; describe('getSlots', () => { const Foo = (props: { id?: string }) =>
; diff --git a/packages/react-utilities/src/compose/getSlots.ts b/packages/react-utilities/src/compose/getSlots.ts index 5fb5894fa13d0..c9a2dd5077779 100644 --- a/packages/react-utilities/src/compose/getSlots.ts +++ b/packages/react-utilities/src/compose/getSlots.ts @@ -1,9 +1,8 @@ import * as React from 'react'; - -import { ComponentState, ShorthandRenderFunction, SlotPropsRecord } from './types'; import { nullRender } from './nullRender'; import { getNativeElementProps } from '../utils/getNativeElementProps'; import { omit } from '../utils/omit'; +import type { ComponentState, ShorthandRenderFunction, SlotPropsRecord } from './types'; // eslint-disable-next-line @typescript-eslint/no-explicit-any function getRootSlot(state: ComponentState) { diff --git a/packages/react-utilities/src/compose/makeMergePropsCompat.ts b/packages/react-utilities/src/compose/makeMergePropsCompat.ts index 7171f9cbb83bd..dfb06a50f0fff 100644 --- a/packages/react-utilities/src/compose/makeMergePropsCompat.ts +++ b/packages/react-utilities/src/compose/makeMergePropsCompat.ts @@ -1,4 +1,5 @@ -import { makeMergeProps, MergePropsOptions } from './makeMergeProps'; +import { makeMergeProps } from './makeMergeProps'; +import type { MergePropsOptions } from './makeMergeProps'; // eslint-disable-next-line @typescript-eslint/no-explicit-any type GenericDictionary = Record; diff --git a/packages/react-utilities/src/compose/resolveShorthand.test.tsx b/packages/react-utilities/src/compose/resolveShorthand.test.tsx index c62402ee6e5f3..a1d021f3f8cc1 100644 --- a/packages/react-utilities/src/compose/resolveShorthand.test.tsx +++ b/packages/react-utilities/src/compose/resolveShorthand.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { resolveShorthand } from './resolveShorthand'; -import { ShorthandProps } from './types'; +import type { ShorthandProps } from './types'; type TestProps = { slotA?: ShorthandProps>; diff --git a/packages/react-utilities/src/compose/resolveShorthand.ts b/packages/react-utilities/src/compose/resolveShorthand.ts index cef1b677c3555..bde91d7c11f04 100644 --- a/packages/react-utilities/src/compose/resolveShorthand.ts +++ b/packages/react-utilities/src/compose/resolveShorthand.ts @@ -1,5 +1,5 @@ import { isValidElement } from 'react'; -import { ObjectShorthandProps, ShorthandProps } from './types'; +import type { ObjectShorthandProps, ShorthandProps } from './types'; // eslint-disable-next-line @typescript-eslint/no-explicit-any export interface ResolveShorthandOptions, Required extends boolean = false> { diff --git a/packages/react-utilities/src/compose/resolveShorthandProps.test.tsx b/packages/react-utilities/src/compose/resolveShorthandProps.test.tsx index 0b204a247bc47..251df58df946a 100644 --- a/packages/react-utilities/src/compose/resolveShorthandProps.test.tsx +++ b/packages/react-utilities/src/compose/resolveShorthandProps.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { resolveShorthandProps } from './resolveShorthandProps'; -import { ShorthandPropsCompat } from './types'; +import type { ShorthandPropsCompat } from './types'; type TestProps = { slotA?: ShorthandPropsCompat>; diff --git a/packages/react-utilities/src/compose/resolveShorthandProps.tsx b/packages/react-utilities/src/compose/resolveShorthandProps.tsx index 0c6281ca0bd22..034a2bbbefdcd 100644 --- a/packages/react-utilities/src/compose/resolveShorthandProps.tsx +++ b/packages/react-utilities/src/compose/resolveShorthandProps.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { ObjectShorthandPropsCompat, ResolvedShorthandPropsCompat } from './types'; +import type { ObjectShorthandPropsCompat, ResolvedShorthandPropsCompat } from './types'; /** * Ensures that the given slots are represented using object syntax. This ensures that diff --git a/packages/react-utilities/src/hooks/useBoolean.test.tsx b/packages/react-utilities/src/hooks/useBoolean.test.tsx index 60de4683be5e2..d918fe22d88dd 100644 --- a/packages/react-utilities/src/hooks/useBoolean.test.tsx +++ b/packages/react-utilities/src/hooks/useBoolean.test.tsx @@ -1,5 +1,6 @@ -import { useBoolean, UseBooleanCallbacks } from './useBoolean'; +import { useBoolean } from './useBoolean'; import { renderHook, act } from '@testing-library/react-hooks'; +import type { UseBooleanCallbacks } from './useBoolean'; describe('useBoolean', () => { it.each([true, false])('respects initial value of %s', (initialValue: boolean) => { diff --git a/packages/react-utilities/src/hooks/useOnScrollOutside.ts b/packages/react-utilities/src/hooks/useOnScrollOutside.ts index 9defcbef413d3..4a38e992cf61a 100644 --- a/packages/react-utilities/src/hooks/useOnScrollOutside.ts +++ b/packages/react-utilities/src/hooks/useOnScrollOutside.ts @@ -1,6 +1,6 @@ import * as React from 'react'; import { useEventCallback } from './useEventCallback'; -import { UseOnClickOrScrollOutsideOptions } from './useOnClickOutside'; +import type { UseOnClickOrScrollOutsideOptions } from './useOnClickOutside'; /** * Utility to perform checks where a click/touch event was made outside a component diff --git a/packages/react-utilities/tsconfig.json b/packages/react-utilities/tsconfig.json index 1f004e68f3a4e..306201642cb22 100644 --- a/packages/react-utilities/tsconfig.json +++ b/packages/react-utilities/tsconfig.json @@ -12,6 +12,7 @@ "importHelpers": true, "noUnusedLocals": true, "preserveConstEnums": true, - "types": ["jest", "custom-global", "inline-style-expand-shorthand"] + "types": ["jest", "custom-global", "inline-style-expand-shorthand"], + "isolatedModules": true } } diff --git a/packages/scheme-utilities/src/utilities.ts b/packages/scheme-utilities/src/utilities.ts index 7c379ef38d6a4..abf195bf5e899 100644 --- a/packages/scheme-utilities/src/utilities.ts +++ b/packages/scheme-utilities/src/utilities.ts @@ -1,5 +1,5 @@ -import { ITheme } from '@fluentui/theme'; import { getNeutralVariant, getSoftVariant, getStrongVariant } from './variants'; +import type { ITheme } from '@fluentui/theme'; /** * Add all variants to provided theme as elements of the theme's scheme property. diff --git a/packages/scheme-utilities/src/variants.ts b/packages/scheme-utilities/src/variants.ts index 02948b29e560b..c4e04a41e76c0 100644 --- a/packages/scheme-utilities/src/variants.ts +++ b/packages/scheme-utilities/src/variants.ts @@ -1,5 +1,6 @@ -import { IPalette, ISemanticColors, ITheme, IPartialTheme, createTheme } from '@fluentui/theme'; +import { createTheme } from '@fluentui/theme'; import { VariantThemeType } from './variantThemeType'; +import type { IPalette, ISemanticColors, ITheme, IPartialTheme } from '@fluentui/theme'; function makeThemeFromPartials( originalTheme: ITheme, diff --git a/packages/scheme-utilities/tsconfig.json b/packages/scheme-utilities/tsconfig.json index 74d73ae59ee67..410a1111d7887 100644 --- a/packages/scheme-utilities/tsconfig.json +++ b/packages/scheme-utilities/tsconfig.json @@ -13,7 +13,8 @@ "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "moduleResolution": "node", - "preserveConstEnums": true + "preserveConstEnums": true, + "isolatedModules": true }, "include": ["src"] } diff --git a/packages/storybook/src/themes/v7/AzureDarkTheme.ts b/packages/storybook/src/themes/v7/AzureDarkTheme.ts index 2c9e991dbe8f8..62248b1daa4b3 100644 --- a/packages/storybook/src/themes/v7/AzureDarkTheme.ts +++ b/packages/storybook/src/themes/v7/AzureDarkTheme.ts @@ -1,4 +1,4 @@ import { AzureCustomizationsDark } from '@fluentui/azure-themes'; -import { Theme } from '@fluentui/theme'; +import type { Theme } from '@fluentui/theme'; export const AzureDarkTheme: Theme = AzureCustomizationsDark.settings.theme; diff --git a/packages/storybook/src/themes/v7/AzureLightTheme.ts b/packages/storybook/src/themes/v7/AzureLightTheme.ts index 5129630f8006d..59617989b043f 100644 --- a/packages/storybook/src/themes/v7/AzureLightTheme.ts +++ b/packages/storybook/src/themes/v7/AzureLightTheme.ts @@ -1,4 +1,4 @@ import { AzureCustomizationsLight } from '@fluentui/azure-themes'; -import { Theme } from '@fluentui/theme'; +import type { Theme } from '@fluentui/theme'; export const AzureLightTheme: Theme = AzureCustomizationsLight.settings.theme; diff --git a/packages/storybook/src/themes/v7/DarkTheme.ts b/packages/storybook/src/themes/v7/DarkTheme.ts index 26c078f1951d4..11e34a2fee0f2 100644 --- a/packages/storybook/src/themes/v7/DarkTheme.ts +++ b/packages/storybook/src/themes/v7/DarkTheme.ts @@ -1,4 +1,4 @@ import { DarkCustomizations } from '@fluentui/theme-samples'; -import { Theme } from '@fluentui/theme'; +import type { Theme } from '@fluentui/theme'; export const DarkTheme: Theme = DarkCustomizations.settings.theme; diff --git a/packages/storybook/src/themes/v7/FluentTheme.ts b/packages/storybook/src/themes/v7/FluentTheme.ts index 35c3865bce84a..eeacb2ee78d38 100644 --- a/packages/storybook/src/themes/v7/FluentTheme.ts +++ b/packages/storybook/src/themes/v7/FluentTheme.ts @@ -1,4 +1,4 @@ import { DefaultCustomizations } from '@fluentui/theme-samples'; -import { Theme } from '@fluentui/theme'; +import type { Theme } from '@fluentui/theme'; export const FluentTheme: Theme = DefaultCustomizations.settings.theme; diff --git a/packages/storybook/src/themes/v7/TeamsTheme.ts b/packages/storybook/src/themes/v7/TeamsTheme.ts index d6fcafa0750d6..ab388cf5aaf12 100644 --- a/packages/storybook/src/themes/v7/TeamsTheme.ts +++ b/packages/storybook/src/themes/v7/TeamsTheme.ts @@ -1,4 +1,4 @@ import { TeamsCustomizations } from '@fluentui/theme-samples'; -import { Theme } from '@fluentui/theme'; +import type { Theme } from '@fluentui/theme'; export const TeamsTheme: Theme = TeamsCustomizations.settings.theme; diff --git a/packages/storybook/src/themes/v7/WordTheme.ts b/packages/storybook/src/themes/v7/WordTheme.ts index 62dd7142754fe..29e87dd722f68 100644 --- a/packages/storybook/src/themes/v7/WordTheme.ts +++ b/packages/storybook/src/themes/v7/WordTheme.ts @@ -1,4 +1,4 @@ import { WordCustomizations } from '@fluentui/theme-samples'; -import { Theme } from '@fluentui/theme'; +import type { Theme } from '@fluentui/theme'; export const WordTheme: Theme = WordCustomizations.settings.theme; diff --git a/packages/theme-samples/src/DarkCustomizations/DarkCustomizations.ts b/packages/theme-samples/src/DarkCustomizations/DarkCustomizations.ts index 328eac5bfd858..4b8f23427a637 100644 --- a/packages/theme-samples/src/DarkCustomizations/DarkCustomizations.ts +++ b/packages/theme-samples/src/DarkCustomizations/DarkCustomizations.ts @@ -1,14 +1,8 @@ -import { - createTheme, - ICustomizations, - IPalette, - Theme, - IPersonaCoinStyleProps, - IPersonaCoinStyles, -} from '@fluentui/react'; +import { createTheme } from '@fluentui/react'; import { DatePickerStyles } from './styles/DatePickerStyles'; import { PeoplePickerItemStyles } from './styles/PeoplePickerStyles'; import { addVariants } from '@fluentui/scheme-utilities'; +import type { ICustomizations, IPalette, Theme, IPersonaCoinStyleProps, IPersonaCoinStyles } from '@fluentui/react'; const DarkDefaultPalette: Partial = { themeDarker: '#82c7ff', diff --git a/packages/theme-samples/src/DarkCustomizations/styles/DatePickerStyles.ts b/packages/theme-samples/src/DarkCustomizations/styles/DatePickerStyles.ts index f68978dd5c96b..d7bcf12e0ae42 100644 --- a/packages/theme-samples/src/DarkCustomizations/styles/DatePickerStyles.ts +++ b/packages/theme-samples/src/DarkCustomizations/styles/DatePickerStyles.ts @@ -1,5 +1,5 @@ -import { IDatePickerStyleProps, IDatePickerStyles } from '@fluentui/react'; import { DarkTheme } from '../DarkCustomizations'; +import type { IDatePickerStyleProps, IDatePickerStyles } from '@fluentui/react'; export const DatePickerStyles = (props: IDatePickerStyleProps): Partial => { const { disabled } = props; diff --git a/packages/theme-samples/src/DarkCustomizations/styles/PeoplePickerStyles.ts b/packages/theme-samples/src/DarkCustomizations/styles/PeoplePickerStyles.ts index 3d713396cb9d7..3be5698f3d003 100644 --- a/packages/theme-samples/src/DarkCustomizations/styles/PeoplePickerStyles.ts +++ b/packages/theme-samples/src/DarkCustomizations/styles/PeoplePickerStyles.ts @@ -1,5 +1,5 @@ -import { IPeoplePickerItemSelectedStyleProps, IPeoplePickerItemSelectedStyles } from '@fluentui/react'; import { DarkTheme } from '../DarkCustomizations'; +import type { IPeoplePickerItemSelectedStyleProps, IPeoplePickerItemSelectedStyles } from '@fluentui/react'; export const PeoplePickerItemStyles = ( props: IPeoplePickerItemSelectedStyleProps, diff --git a/packages/theme-samples/src/DefaultCustomizations.ts b/packages/theme-samples/src/DefaultCustomizations.ts index 4ddc40a4f5734..0f5d189d1d12f 100644 --- a/packages/theme-samples/src/DefaultCustomizations.ts +++ b/packages/theme-samples/src/DefaultCustomizations.ts @@ -1,5 +1,6 @@ -import { createTheme, ICustomizations } from '@fluentui/react'; +import { createTheme } from '@fluentui/react'; import { addVariants } from '@fluentui/scheme-utilities'; +import type { ICustomizations } from '@fluentui/react'; export const DefaultTheme = createTheme(); addVariants(DefaultTheme); diff --git a/packages/theme-samples/src/TeamsCustomizations.ts b/packages/theme-samples/src/TeamsCustomizations.ts index d1888bfa0ebc3..22594f70ab1da 100644 --- a/packages/theme-samples/src/TeamsCustomizations.ts +++ b/packages/theme-samples/src/TeamsCustomizations.ts @@ -1,6 +1,6 @@ -import { createTheme, ICustomizations } from '@fluentui/react'; +import { createTheme } from '@fluentui/react'; import { addVariants } from '@fluentui/scheme-utilities'; -import { Theme } from '@fluentui/react'; +import type { ICustomizations, Theme } from '@fluentui/react'; export const TeamsTheme: Theme = createTheme({ palette: { diff --git a/packages/theme-samples/src/WordCustomizations.ts b/packages/theme-samples/src/WordCustomizations.ts index 91682be867ed7..e28216e6b4df6 100644 --- a/packages/theme-samples/src/WordCustomizations.ts +++ b/packages/theme-samples/src/WordCustomizations.ts @@ -1,6 +1,6 @@ -import { createTheme, ICustomizations } from '@fluentui/react'; +import { createTheme } from '@fluentui/react'; import { addVariants } from '@fluentui/scheme-utilities'; -import { Theme } from '@fluentui/react'; +import type { ICustomizations, Theme } from '@fluentui/react'; export const WordTheme: Theme = createTheme({ palette: { diff --git a/packages/theme-samples/tsconfig.json b/packages/theme-samples/tsconfig.json index a9073bc27690f..0ca4c2c334031 100644 --- a/packages/theme-samples/tsconfig.json +++ b/packages/theme-samples/tsconfig.json @@ -16,7 +16,8 @@ "moduleResolution": "node", "skipLibCheck": true, "preserveConstEnums": true, - "lib": ["es5", "dom"] + "lib": ["es5", "dom"], + "isolatedModules": true }, "include": ["src"] } diff --git a/packages/theme/etc/theme.api.md b/packages/theme/etc/theme.api.md index 2e0d5c550fba5..b71f2564ce7ab 100644 --- a/packages/theme/etc/theme.api.md +++ b/packages/theme/etc/theme.api.md @@ -4,9 +4,9 @@ ```ts -import { IFontWeight } from '@fluentui/merge-styles'; -import { IRawStyle } from '@fluentui/merge-styles'; -import { IStyleFunctionOrObject } from '@fluentui/utilities'; +import type { IFontWeight } from '@fluentui/merge-styles'; +import type { IRawStyle } from '@fluentui/merge-styles'; +import type { IStyleFunctionOrObject } from '@fluentui/utilities'; // @public export const AnimationStyles: IAnimationStyles; @@ -802,7 +802,6 @@ export interface Theme extends IScheme { }; } - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/theme/src/FluentTheme.ts b/packages/theme/src/FluentTheme.ts index e62e5e59578a0..1a7ae8c079b07 100644 --- a/packages/theme/src/FluentTheme.ts +++ b/packages/theme/src/FluentTheme.ts @@ -1,4 +1,4 @@ import { createTheme } from './createTheme'; -import { ITheme } from './types/ITheme'; +import type { ITheme } from './types/ITheme'; export const FluentTheme: ITheme = createTheme({}); diff --git a/packages/theme/src/colors/DefaultPalette.ts b/packages/theme/src/colors/DefaultPalette.ts index 7106c70086dc4..9d9090fb6f624 100644 --- a/packages/theme/src/colors/DefaultPalette.ts +++ b/packages/theme/src/colors/DefaultPalette.ts @@ -1,4 +1,4 @@ -import { IPalette } from '../types/index'; +import type { IPalette } from '../types/index'; // When adding or removing a color, make sure you keep this consistent with IColorClassNames // by adding the color variants. diff --git a/packages/theme/src/createTheme.test.ts b/packages/theme/src/createTheme.test.ts index 5940623a3b185..229c767e57e85 100644 --- a/packages/theme/src/createTheme.test.ts +++ b/packages/theme/src/createTheme.test.ts @@ -1,6 +1,6 @@ -import { IRawStyle } from '@fluentui/merge-styles'; import { createTheme } from './createTheme'; import { DefaultFontStyles } from './fonts/index'; +import type { IRawStyle } from '@fluentui/merge-styles'; describe('createTheme', () => { it('create default theme', () => { diff --git a/packages/theme/src/createTheme.ts b/packages/theme/src/createTheme.ts index d270ec53996be..f305c7e5aac5f 100644 --- a/packages/theme/src/createTheme.ts +++ b/packages/theme/src/createTheme.ts @@ -3,8 +3,8 @@ import { DefaultEffects } from './effects/index'; import { DefaultFontStyles } from './fonts/index'; import { mergeThemes } from './mergeThemes'; import { DefaultSpacing } from './spacing/index'; -import { PartialTheme, Theme } from './types/index'; import { makeSemanticColors } from './utilities/makeSemanticColors'; +import type { PartialTheme, Theme } from './types/index'; /** * Creates a custom theme definition. diff --git a/packages/theme/src/effects/DefaultEffects.ts b/packages/theme/src/effects/DefaultEffects.ts index 689592cff3c14..ddbf259abc56c 100644 --- a/packages/theme/src/effects/DefaultEffects.ts +++ b/packages/theme/src/effects/DefaultEffects.ts @@ -1,5 +1,5 @@ -import { IEffects } from '../types/index'; import { Depths } from './FluentDepths'; +import type { IEffects } from '../types/index'; export const DefaultEffects: IEffects = { elevation4: Depths.depth4, diff --git a/packages/theme/src/fonts/DefaultFontStyles.ts b/packages/theme/src/fonts/DefaultFontStyles.ts index 1e2e090ddc681..aa90a28f018b1 100644 --- a/packages/theme/src/fonts/DefaultFontStyles.ts +++ b/packages/theme/src/fonts/DefaultFontStyles.ts @@ -1,9 +1,10 @@ -import { fontFace, IFontWeight } from '@fluentui/merge-styles'; +import { fontFace } from '@fluentui/merge-styles'; import { FontWeights, LocalizedFontFamilies, LocalizedFontNames } from './FluentFonts'; import { createFontStyles } from './createFontStyles'; import { getLanguage, getWindow } from '@fluentui/utilities'; -import { IFontStyles } from '../types/IFontStyles'; -import { IFabricConfig } from '../types/IFabricConfig'; +import type { IFontWeight } from '@fluentui/merge-styles'; +import type { IFontStyles } from '../types/IFontStyles'; +import type { IFabricConfig } from '../types/IFabricConfig'; // Default urls. const DefaultBaseUrl = 'https://static2.sharepointonline.com/files/fabric/assets'; diff --git a/packages/theme/src/fonts/FluentFonts.ts b/packages/theme/src/fonts/FluentFonts.ts index 8bfacee500423..4181669515247 100644 --- a/packages/theme/src/fonts/FluentFonts.ts +++ b/packages/theme/src/fonts/FluentFonts.ts @@ -1,4 +1,4 @@ -import { IFontWeight } from '@fluentui/merge-styles'; +import type { IFontWeight } from '@fluentui/merge-styles'; // Font face names to be registered. export namespace LocalizedFontNames { diff --git a/packages/theme/src/fonts/createFontStyles.ts b/packages/theme/src/fonts/createFontStyles.ts index e6b8a10bd23f9..110f20d5a14a2 100644 --- a/packages/theme/src/fonts/createFontStyles.ts +++ b/packages/theme/src/fonts/createFontStyles.ts @@ -1,6 +1,6 @@ -import { IFontWeight, IRawStyle } from '@fluentui/merge-styles'; -import { IFontStyles } from '../types/IFontStyles'; import { FontSizes, FontWeights, LocalizedFontFamilies, LocalizedFontNames } from './FluentFonts'; +import type { IFontWeight, IRawStyle } from '@fluentui/merge-styles'; +import type { IFontStyles } from '../types/IFontStyles'; // Fallback fonts, if specified system or web fonts are unavailable. const FontFamilyFallbacks = `'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif`; diff --git a/packages/theme/src/mergeThemes.ts b/packages/theme/src/mergeThemes.ts index 0b3dc138734c9..eaac7ee4a4b0e 100644 --- a/packages/theme/src/mergeThemes.ts +++ b/packages/theme/src/mergeThemes.ts @@ -1,6 +1,6 @@ import { merge } from '@fluentui/utilities'; -import { IFontStyles, PartialTheme, Theme } from './types/index'; import { getSemanticColors } from './utilities/makeSemanticColors'; +import type { IFontStyles, PartialTheme, Theme } from './types/index'; /** * Merge a partial/full theme into a full theme and returns a merged full theme. diff --git a/packages/theme/src/motion/AnimationStyles.ts b/packages/theme/src/motion/AnimationStyles.ts index 842155fabd03e..52ffdcb18e806 100644 --- a/packages/theme/src/motion/AnimationStyles.ts +++ b/packages/theme/src/motion/AnimationStyles.ts @@ -1,5 +1,6 @@ -import { IAnimationStyles, IAnimationVariables } from '../types/IAnimationStyles'; -import { IRawStyle, keyframes } from '@fluentui/merge-styles'; +import { keyframes } from '@fluentui/merge-styles'; +import type { IAnimationStyles, IAnimationVariables } from '../types/IAnimationStyles'; +import type { IRawStyle } from '@fluentui/merge-styles'; /* Register the keyframes */ diff --git a/packages/theme/src/spacing/DefaultSpacing.ts b/packages/theme/src/spacing/DefaultSpacing.ts index e14f21b631613..2001e61ecf7b2 100644 --- a/packages/theme/src/spacing/DefaultSpacing.ts +++ b/packages/theme/src/spacing/DefaultSpacing.ts @@ -1,4 +1,4 @@ -import { ISpacing } from '../types/index'; +import type { ISpacing } from '../types/index'; export const DefaultSpacing: ISpacing = { s2: '4px', diff --git a/packages/theme/src/types/IAnimationStyles.ts b/packages/theme/src/types/IAnimationStyles.ts index b60506bb88c3c..0d75a99a96eb1 100644 --- a/packages/theme/src/types/IAnimationStyles.ts +++ b/packages/theme/src/types/IAnimationStyles.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { IRawStyle } from '@fluentui/merge-styles'; +import type { IRawStyle } from '@fluentui/merge-styles'; /** * All Fabric standard animations, exposed as json objects referencing predefined diff --git a/packages/theme/src/types/IFabricConfig.ts b/packages/theme/src/types/IFabricConfig.ts index a70b6f2eebb5c..f1fe010f1cbc5 100644 --- a/packages/theme/src/types/IFabricConfig.ts +++ b/packages/theme/src/types/IFabricConfig.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { IStyleSheetConfig } from '@fluentui/merge-styles'; +import type { IStyleSheetConfig } from '@fluentui/merge-styles'; // TODO: figure out a better place (e.g a shared typing package) for this interface. diff --git a/packages/theme/src/types/IFontStyles.ts b/packages/theme/src/types/IFontStyles.ts index ac71f7baaf1b8..b92560e601780 100644 --- a/packages/theme/src/types/IFontStyles.ts +++ b/packages/theme/src/types/IFontStyles.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ - -import { IRawStyle } from '@fluentui/merge-styles'; +import type { IRawStyle } from '@fluentui/merge-styles'; /** * Fluent UI font set. diff --git a/packages/theme/src/types/IScheme.ts b/packages/theme/src/types/IScheme.ts index 799ae6e289376..9ce0346fd5006 100644 --- a/packages/theme/src/types/IScheme.ts +++ b/packages/theme/src/types/IScheme.ts @@ -1,10 +1,9 @@ /* eslint-disable @typescript-eslint/naming-convention */ - -import { IPalette } from './IPalette'; -import { IFontStyles } from './IFontStyles'; -import { ISemanticColors } from './ISemanticColors'; -import { ISpacing } from './ISpacing'; -import { IEffects } from './IEffects'; +import type { IPalette } from './IPalette'; +import type { IFontStyles } from './IFontStyles'; +import type { ISemanticColors } from './ISemanticColors'; +import type { ISpacing } from './ISpacing'; +import type { IEffects } from './IEffects'; /** * @internal diff --git a/packages/theme/src/types/ISemanticColors.ts b/packages/theme/src/types/ISemanticColors.ts index 8eb2ec6e932cd..8b3e5f8c5551f 100644 --- a/packages/theme/src/types/ISemanticColors.ts +++ b/packages/theme/src/types/ISemanticColors.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ - -import { ISemanticTextColors } from './ISemanticTextColors'; +import type { ISemanticTextColors } from './ISemanticTextColors'; // WARNING: The comment below must use valid markdown, or it will break the website. // Headings must start at h4 to be appropriate for the website. diff --git a/packages/theme/src/types/ITheme.ts b/packages/theme/src/types/ITheme.ts index a803065961c51..ecd05b4ae72a3 100644 --- a/packages/theme/src/types/ITheme.ts +++ b/packages/theme/src/types/ITheme.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { Theme, PartialTheme } from './Theme'; -export { ISchemeNames, IScheme } from './IScheme'; +import type { Theme, PartialTheme } from './Theme'; /** * {@docCategory ITheme} @@ -11,3 +10,5 @@ export interface ITheme extends Theme {} * {@docCategory ITheme} */ export interface IPartialTheme extends PartialTheme {} + +export type { ISchemeNames, IScheme } from './IScheme'; diff --git a/packages/theme/src/types/Theme.ts b/packages/theme/src/types/Theme.ts index 3f6ff271d8f84..0e6212456b4d7 100644 --- a/packages/theme/src/types/Theme.ts +++ b/packages/theme/src/types/Theme.ts @@ -1,11 +1,11 @@ -import { IRawStyle } from '@fluentui/merge-styles'; -import { IStyleFunctionOrObject } from '@fluentui/utilities'; -import { IPalette } from './IPalette'; -import { IFontStyles } from './IFontStyles'; -import { ISemanticColors } from './ISemanticColors'; -import { ISpacing } from './ISpacing'; -import { IEffects } from './IEffects'; -import { IScheme, ISchemeNames } from './IScheme'; +import type { IRawStyle } from '@fluentui/merge-styles'; +import type { IStyleFunctionOrObject } from '@fluentui/utilities'; +import type { IPalette } from './IPalette'; +import type { IFontStyles } from './IFontStyles'; +import type { ISemanticColors } from './ISemanticColors'; +import type { ISpacing } from './ISpacing'; +import type { IEffects } from './IEffects'; +import type { IScheme, ISchemeNames } from './IScheme'; /** * {@docCategory Theme} diff --git a/packages/theme/src/types/index.ts b/packages/theme/src/types/index.ts index 7ac1522aa29f1..97e5a3bad18ca 100644 --- a/packages/theme/src/types/index.ts +++ b/packages/theme/src/types/index.ts @@ -1,10 +1,10 @@ -export { IEffects } from './IEffects'; -export { IFontStyles } from './IFontStyles'; -export { IPalette } from './IPalette'; -export { ISemanticColors } from './ISemanticColors'; -export { ISemanticTextColors } from './ISemanticTextColors'; -export { ISpacing } from './ISpacing'; -export { IAnimationStyles, IAnimationVariables } from './IAnimationStyles'; -export { IScheme, ISchemeNames } from './IScheme'; -export { ITheme, IPartialTheme } from './ITheme'; export * from './Theme'; +export type { IEffects } from './IEffects'; +export type { IFontStyles } from './IFontStyles'; +export type { IPalette } from './IPalette'; +export type { ISemanticColors } from './ISemanticColors'; +export type { ISemanticTextColors } from './ISemanticTextColors'; +export type { ISpacing } from './ISpacing'; +export type { IAnimationStyles, IAnimationVariables } from './IAnimationStyles'; +export type { IScheme, ISchemeNames } from './IScheme'; +export type { ITheme, IPartialTheme } from './ITheme'; diff --git a/packages/theme/src/utilities/makeSemanticColors.ts b/packages/theme/src/utilities/makeSemanticColors.ts index 4c120e8744ee4..b9924ec0d7afa 100644 --- a/packages/theme/src/utilities/makeSemanticColors.ts +++ b/packages/theme/src/utilities/makeSemanticColors.ts @@ -1,4 +1,4 @@ -import { IEffects, IPalette, ISemanticColors } from '../types/index'; +import type { IEffects, IPalette, ISemanticColors } from '../types/index'; /** Generates all the semantic slot colors based on the theme so far * We'll use these as fallbacks for semantic slots that the passed in theme did not define.