Skip to content

Commit 3b741bd

Browse files
authored
[CAP-Theme] Update CAPThemeProvider props structure (#575)
1 parent c615611 commit 3b741bd

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "update CAPThemeProvider props structure",
4+
"packageName": "@fluentui-contrib/react-cap-theme",
5+
"email": "dimasteite@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react-cap-theme/src/theme/CAPThemeProvider.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,27 @@ const customStyleHooks: NonNullable<
3333
useInputStyles_unstable: (state) => useInputStylesHook(state as InputState),
3434
};
3535

36+
type CAPThemeProviderProps = Omit<
37+
FluentProviderProps,
38+
'theme' | 'customStyleHooks_unstable'
39+
> & {
40+
theme: Partial<Theme> & Partial<CAPTheme>;
41+
};
3642
export const CAPThemeProvider = ({
3743
children,
3844
theme: _theme,
39-
}: {
40-
children: React.ReactNode;
41-
theme: Partial<Theme> & Partial<CAPTheme>;
42-
}): React.ReactElement => {
45+
...rest
46+
}: CAPThemeProviderProps): React.ReactElement => {
4347
const theme: Record<string, string | number | null> = {};
4448
for (const [key, value] of Object.entries(_theme)) {
4549
theme[formatCAPTokenCssVar(key)] = value;
4650
}
4751
return (
48-
<FluentProvider theme={theme} customStyleHooks_unstable={customStyleHooks}>
52+
<FluentProvider
53+
theme={theme}
54+
customStyleHooks_unstable={customStyleHooks}
55+
{...rest}
56+
>
4957
{children}
5058
</FluentProvider>
5159
);

0 commit comments

Comments
 (0)