Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: Add IconDirectionProvider to FluentProvider",
"packageName": "@fluentui/react-provider",
"email": "ololubek@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

```ts

/// <reference types="react" />

import { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import type { CustomStyleHooksContextValue_unstable } from '@fluentui/react-shared-contexts';
import type { IconDirectionContextValue } from '@fluentui/react-icons';
import { OverridesContextValue_unstable } from '@fluentui/react-shared-contexts';
import type { PartialTheme } from '@fluentui/react-theme';
import type { ProviderContextValue_unstable } from '@fluentui/react-shared-contexts';
Expand Down Expand Up @@ -125,6 +128,7 @@ export type FluentProviderContextValues = Pick<FluentProviderState, 'customStyle
provider: ProviderContextValue_unstable;
themeClassName: ThemeClassNameContextValue_unstable;
textDirection: 'ltr' | 'rtl';
iconDirection: IconDirectionContextValue;
tooltip: TooltipVisibilityContextValue_unstable;
};

Expand Down
1 change: 1 addition & 0 deletions packages/react-components/react-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@fluentui/scripts-tasks": "*"
},
"dependencies": {
"@fluentui/react-icons": "^2.0.207",
"@fluentui/react-shared-contexts": "^9.7.2",
"@fluentui/react-tabster": "^9.12.2",
"@fluentui/react-theme": "^9.1.11",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { IconDirectionContextValue } from '@fluentui/react-icons';
import type {
OverridesContextValue_unstable as OverridesContextValue,
ProviderContextValue_unstable as ProviderContextValue,
Expand Down Expand Up @@ -70,5 +71,6 @@ export type FluentProviderContextValues = Pick<
provider: ProviderContextValue;
themeClassName: ThemeClassNameContextValue;
textDirection: 'ltr' | 'rtl';
iconDirection: IconDirectionContextValue;
tooltip: TooltipVisibilityContextValue;
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
CustomStyleHooksContextValue_unstable as CustomStyleHooksContextValue,
} from '@fluentui/react-shared-contexts';
import type { FluentProviderContextValues, FluentProviderState, FluentProviderSlots } from './FluentProvider.types';
import { IconDirectionContextProvider } from '@fluentui/react-icons';

/**
* Render the final JSX of FluentProvider
Expand All @@ -37,21 +38,23 @@ export const renderFluentProvider_unstable = (
>
<TooltipVisibilityProvider value={contextValues.tooltip}>
<TextDirectionProvider dir={contextValues.textDirection}>
<OverridesProvider value={contextValues.overrides_unstable}>
<state.root>
{canUseDOM() ? null : (
<style
// Using dangerous HTML because react can escape characters
// which can lead to invalid CSS.
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: state.serverStyleProps.cssRule }}
{...state.serverStyleProps.attributes}
/>
)}
<IconDirectionContextProvider value={contextValues.iconDirection}>
<OverridesProvider value={contextValues.overrides_unstable}>
<state.root>
{canUseDOM() ? null : (
<style
// Using dangerous HTML because react can escape characters
// which can lead to invalid CSS.
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: state.serverStyleProps.cssRule }}
{...state.serverStyleProps.attributes}
/>
)}

{state.root.children}
</state.root>
</OverridesProvider>
{state.root.children}
</state.root>
</OverridesProvider>
</IconDirectionContextProvider>
</TextDirectionProvider>
</TooltipVisibilityProvider>
</CustomStyleHooksProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function useFluentProviderContextValues_unstable(state: FluentProviderSta
overrides_unstable,
provider,
textDirection: dir,
iconDirection: {},
Comment thread
tomi-msft marked this conversation as resolved.
Outdated
tooltip,
theme,
themeClassName: applyStylesToPortals ? root.className! : themeClassName,
Expand Down