*

@@ -1119,7 +1119,7 @@ BottomNavigation.SceneMap = (scenes: {
);
};
-export default withTheme(BottomNavigation);
+export default withInternalTheme(BottomNavigation);
const styles = StyleSheet.create({
container: {
diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx
index d7145b87b3..4c89d8fd25 100644
--- a/src/components/Button/Button.tsx
+++ b/src/components/Button/Button.tsx
@@ -1,17 +1,17 @@
import * as React from 'react';
import {
Animated,
- View,
- ViewStyle,
- StyleSheet,
StyleProp,
+ StyleSheet,
TextStyle,
+ View,
+ ViewStyle,
} from 'react-native';
import color from 'color';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import ActivityIndicator from '../ActivityIndicator';
import Icon, { IconSource } from '../Icon';
import Surface from '../Surface';
@@ -113,7 +113,7 @@ export type Props = React.ComponentProps
& {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -426,4 +426,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(Button);
+export default withInternalTheme(Button);
diff --git a/src/components/Button/utils.tsx b/src/components/Button/utils.tsx
index ec4446ec4e..afc8f505b6 100644
--- a/src/components/Button/utils.tsx
+++ b/src/components/Button/utils.tsx
@@ -3,7 +3,7 @@ import { StyleSheet } from 'react-native';
import color from 'color';
import { black, white } from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
export type ButtonMode =
| 'text'
@@ -14,7 +14,7 @@ export type ButtonMode =
type BaseProps = {
isMode: (mode: ButtonMode) => boolean;
- theme: Theme;
+ theme: InternalTheme;
disabled?: boolean;
};
@@ -192,7 +192,7 @@ export const getButtonColors = ({
disabled,
dark,
}: {
- theme: Theme;
+ theme: InternalTheme;
mode: ButtonMode;
customButtonColor?: string;
customTextColor?: string;
diff --git a/src/components/Card/Card.tsx b/src/components/Card/Card.tsx
index 72b64fe83c..fd5030796d 100644
--- a/src/components/Card/Card.tsx
+++ b/src/components/Card/Card.tsx
@@ -1,22 +1,22 @@
import * as React from 'react';
import {
+ Animated,
StyleProp,
StyleSheet,
- Animated,
TouchableWithoutFeedback,
View,
ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import Surface from '../Surface';
import CardActions from './CardActions';
import CardContent from './CardContent';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-import CardCover, { CardCover as _CardCover } from './CardCover';
+import CardCover from './CardCover';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-import CardTitle, { CardTitle as _CardTitle } from './CardTitle';
+import CardTitle from './CardTitle';
import { getCardColors } from './utils';
type OutlinedCardProps = {
@@ -66,7 +66,7 @@ export type Props = React.ComponentProps & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* Pass down testID from card props to touchable
*/
@@ -302,4 +302,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(Card);
+export default withInternalTheme(Card);
diff --git a/src/components/Card/CardActions.tsx b/src/components/Card/CardActions.tsx
index d43743cca2..8118e178bb 100644
--- a/src/components/Card/CardActions.tsx
+++ b/src/components/Card/CardActions.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
-import { StyleSheet, StyleProp, View, ViewStyle } from 'react-native';
+import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
-import { useTheme } from '../../core/theming';
+import { useInternalTheme } from '../../core/theming';
export type Props = React.ComponentPropsWithRef & {
/**
@@ -38,7 +38,7 @@ export type Props = React.ComponentPropsWithRef & {
* ```
*/
const CardActions = (props: Props) => {
- const { isV3 } = useTheme();
+ const { isV3 } = useInternalTheme();
const justifyContent = isV3 ? 'flex-end' : 'flex-start';
return (
diff --git a/src/components/Card/CardContent.tsx b/src/components/Card/CardContent.tsx
index 557b06d7f3..6be45ce267 100644
--- a/src/components/Card/CardContent.tsx
+++ b/src/components/Card/CardContent.tsx
@@ -49,8 +49,8 @@ export type Props = React.ComponentPropsWithRef & {
* ```
*/
const CardContent = ({ index, total, siblings, style, ...rest }: Props) => {
- const cover = 'withTheme(CardCover)';
- const title = 'withTheme(CardTitle)';
+ const cover = 'withInternalTheme(CardCover)';
+ const title = 'withInternalTheme(CardTitle)';
let contentStyle, prev, next;
diff --git a/src/components/Card/CardCover.tsx b/src/components/Card/CardCover.tsx
index 7657059d6f..a62377d2ac 100644
--- a/src/components/Card/CardCover.tsx
+++ b/src/components/Card/CardCover.tsx
@@ -1,9 +1,9 @@
import * as React from 'react';
-import { StyleSheet, View, ViewStyle, Image, StyleProp } from 'react-native';
+import { Image, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
-import { withTheme } from '../../core/theming';
+import { withInternalTheme } from '../../core/theming';
import { grey200 } from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
import { getCardCoverStyle } from './utils';
export type Props = React.ComponentPropsWithRef & {
@@ -19,7 +19,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -77,7 +77,7 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(CardCover);
+export default withInternalTheme(CardCover);
// @component-docs ignore-next-line
export { CardCover };
diff --git a/src/components/Card/CardTitle.tsx b/src/components/Card/CardTitle.tsx
index 1fd738dd42..0a450d6a0c 100644
--- a/src/components/Card/CardTitle.tsx
+++ b/src/components/Card/CardTitle.tsx
@@ -7,8 +7,8 @@ import {
ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { MD3TypescaleKey, Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme, MD3TypescaleKey } from '../../types';
import Text from '../Typography/Text';
import Caption from '../Typography/v2/Caption';
import Title from '../Typography/v2/Title';
@@ -100,7 +100,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
const LEFT_SIZE = 40;
@@ -236,7 +236,7 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(CardTitle);
+export default withInternalTheme(CardTitle);
// @component-docs ignore-next-line
export { CardTitle };
diff --git a/src/components/Card/utils.tsx b/src/components/Card/utils.tsx
index 92a79569cb..43fc6e5ac9 100644
--- a/src/components/Card/utils.tsx
+++ b/src/components/Card/utils.tsx
@@ -1,7 +1,7 @@
import color from 'color';
import { black, white } from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
type CardMode = 'elevated' | 'outlined' | 'contained';
@@ -10,7 +10,7 @@ export const getCardCoverStyle = ({
index,
total,
}: {
- theme: Theme;
+ theme: InternalTheme;
index?: number;
total?: number;
}) => {
@@ -44,7 +44,7 @@ export const getCardCoverStyle = ({
return undefined;
};
-const getBorderColor = ({ theme }: { theme: Theme }) => {
+const getBorderColor = ({ theme }: { theme: InternalTheme }) => {
if (theme.isV3) {
return theme.colors.outline;
}
@@ -59,7 +59,7 @@ const getBackgroundColor = ({
theme,
isMode,
}: {
- theme: Theme;
+ theme: InternalTheme;
isMode: (mode: CardMode) => boolean;
}) => {
if (theme.isV3) {
@@ -75,7 +75,7 @@ export const getCardColors = ({
theme,
mode,
}: {
- theme: Theme;
+ theme: InternalTheme;
mode: CardMode;
}) => {
const isMode = (modeToCompare: CardMode) => {
diff --git a/src/components/Checkbox/Checkbox.tsx b/src/components/Checkbox/Checkbox.tsx
index 99dad52823..c05b02b92b 100644
--- a/src/components/Checkbox/Checkbox.tsx
+++ b/src/components/Checkbox/Checkbox.tsx
@@ -1,8 +1,8 @@
import * as React from 'react';
import { Platform } from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import CheckboxAndroid from './CheckboxAndroid';
import CheckboxIOS from './CheckboxIOS';
@@ -30,7 +30,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -87,9 +87,9 @@ const Checkbox = (props: Props) =>
);
-export default withTheme(Checkbox);
+export default withInternalTheme(Checkbox);
// @component-docs ignore-next-line
-const CheckboxWithTheme = withTheme(Checkbox);
+const CheckboxWithTheme = withInternalTheme(Checkbox);
// @component-docs ignore-next-line
export { CheckboxWithTheme as Checkbox };
diff --git a/src/components/Checkbox/CheckboxAndroid.tsx b/src/components/Checkbox/CheckboxAndroid.tsx
index a8cde77f8c..caa98d627c 100644
--- a/src/components/Checkbox/CheckboxAndroid.tsx
+++ b/src/components/Checkbox/CheckboxAndroid.tsx
@@ -1,8 +1,8 @@
import * as React from 'react';
-import { Animated, View, StyleSheet } from 'react-native';
+import { Animated, StyleSheet, View } from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { $RemoveChildren, Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { $RemoveChildren, InternalTheme } from '../../types';
import MaterialCommunityIcon from '../MaterialCommunityIcon';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import { getAndroidSelectionControlColor } from './utils';
@@ -31,7 +31,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -176,9 +176,9 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(CheckboxAndroid);
+export default withInternalTheme(CheckboxAndroid);
// @component-docs ignore-next-line
-const CheckboxAndroidWithTheme = withTheme(CheckboxAndroid);
+const CheckboxAndroidWithTheme = withInternalTheme(CheckboxAndroid);
// @component-docs ignore-next-line
export { CheckboxAndroidWithTheme as CheckboxAndroid };
diff --git a/src/components/Checkbox/CheckboxIOS.tsx b/src/components/Checkbox/CheckboxIOS.tsx
index ca9d05a4d3..08c6801144 100644
--- a/src/components/Checkbox/CheckboxIOS.tsx
+++ b/src/components/Checkbox/CheckboxIOS.tsx
@@ -1,8 +1,8 @@
import * as React from 'react';
import { StyleSheet, View } from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { $RemoveChildren, Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { $RemoveChildren, InternalTheme } from '../../types';
import MaterialCommunityIcon from '../MaterialCommunityIcon';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import { getSelectionControlIOSColor } from './utils';
@@ -27,7 +27,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -104,9 +104,9 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(CheckboxIOS);
+export default withInternalTheme(CheckboxIOS);
// @component-docs ignore-next-line
-const CheckboxIOSWithTheme = withTheme(CheckboxIOS);
+const CheckboxIOSWithTheme = withInternalTheme(CheckboxIOS);
// @component-docs ignore-next-line
export { CheckboxIOSWithTheme as CheckboxIOS };
diff --git a/src/components/Checkbox/CheckboxItem.tsx b/src/components/Checkbox/CheckboxItem.tsx
index 121a274dd1..f705c9b722 100644
--- a/src/components/Checkbox/CheckboxItem.tsx
+++ b/src/components/Checkbox/CheckboxItem.tsx
@@ -7,8 +7,8 @@ import {
ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { MD3TypescaleKey, Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme, MD3TypescaleKey } from '../../types';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import Text from '../Typography/Text';
import Checkbox from './Checkbox';
@@ -72,7 +72,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -182,10 +182,10 @@ const CheckboxItem = ({
CheckboxItem.displayName = 'Checkbox.Item';
-export default withTheme(CheckboxItem);
+export default withInternalTheme(CheckboxItem);
// @component-docs ignore-next-line
-const CheckboxItemWithTheme = withTheme(CheckboxItem);
+const CheckboxItemWithTheme = withInternalTheme(CheckboxItem);
// @component-docs ignore-next-line
export { CheckboxItemWithTheme as CheckboxItem };
diff --git a/src/components/Checkbox/utils.ts b/src/components/Checkbox/utils.ts
index dd96bf66e9..a0ae79a1dc 100644
--- a/src/components/Checkbox/utils.ts
+++ b/src/components/Checkbox/utils.ts
@@ -1,12 +1,12 @@
import color from 'color';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
const getAndroidCheckedColor = ({
theme,
customColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
customColor?: string;
}) => {
if (customColor) {
@@ -24,7 +24,7 @@ const getAndroidUncheckedColor = ({
theme,
customUncheckedColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
customUncheckedColor?: string;
}) => {
if (customUncheckedColor) {
@@ -47,7 +47,7 @@ const getAndroidRippleColor = ({
checkedColor,
disabled,
}: {
- theme: Theme;
+ theme: InternalTheme;
checkedColor: string;
disabled?: boolean;
}) => {
@@ -68,7 +68,7 @@ const getAndroidControlColor = ({
checkedColor,
uncheckedColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
checked: boolean;
checkedColor: string;
uncheckedColor: string;
@@ -94,7 +94,7 @@ export const getAndroidSelectionControlColor = ({
customColor,
customUncheckedColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
checked: boolean;
disabled?: boolean;
customColor?: string;
@@ -122,7 +122,7 @@ const getIOSCheckedColor = ({
disabled,
customColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
customColor?: string;
disabled?: boolean;
}) => {
@@ -149,7 +149,7 @@ const getIOSRippleColor = ({
checkedColor,
disabled,
}: {
- theme: Theme;
+ theme: InternalTheme;
checkedColor: string;
disabled?: boolean;
}) => {
@@ -167,7 +167,7 @@ export const getSelectionControlIOSColor = ({
disabled,
customColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
disabled?: boolean;
customColor?: string;
}) => {
diff --git a/src/components/Chip/Chip.tsx b/src/components/Chip/Chip.tsx
index d0b3d3d0bd..fb6945b845 100644
--- a/src/components/Chip/Chip.tsx
+++ b/src/components/Chip/Chip.tsx
@@ -11,9 +11,9 @@ import {
ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
+import { withInternalTheme } from '../../core/theming';
import { white } from '../../styles/themes/v2/colors';
-import type { EllipsizeProp, Theme } from '../../types';
+import type { EllipsizeProp, InternalTheme } from '../../types';
import type { IconSource } from '../Icon';
import Icon from '../Icon';
import MaterialCommunityIcon from '../MaterialCommunityIcon';
@@ -101,7 +101,7 @@ export type Props = React.ComponentProps & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* Pass down testID from chip props to touchable for Detox tests.
*/
@@ -450,4 +450,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(Chip);
+export default withInternalTheme(Chip);
diff --git a/src/components/Chip/helpers.tsx b/src/components/Chip/helpers.tsx
index fda43cc191..4022f8541e 100644
--- a/src/components/Chip/helpers.tsx
+++ b/src/components/Chip/helpers.tsx
@@ -3,10 +3,10 @@ import type { ColorValue } from 'react-native';
import color from 'color';
import { black, white } from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
type BaseProps = {
- theme: Theme;
+ theme: InternalTheme;
isOutlined: boolean;
disabled?: boolean;
};
diff --git a/src/components/CrossFadeIcon.tsx b/src/components/CrossFadeIcon.tsx
index 2cc2246984..c7f7bc073e 100644
--- a/src/components/CrossFadeIcon.tsx
+++ b/src/components/CrossFadeIcon.tsx
@@ -1,9 +1,9 @@
import * as React from 'react';
import { Animated, StyleSheet, View } from 'react-native';
-import { withTheme } from '../core/theming';
-import type { Theme } from '../types';
-import Icon, { isValidIcon, IconSource, isEqualIcon } from './Icon';
+import { withInternalTheme } from '../core/theming';
+import type { InternalTheme } from '../types';
+import Icon, { IconSource, isEqualIcon, isValidIcon } from './Icon';
type Props = {
/**
@@ -21,7 +21,7 @@ type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
const CrossFadeIcon = ({ color, size, source, theme }: Props) => {
@@ -110,7 +110,7 @@ const CrossFadeIcon = ({ color, size, source, theme }: Props) => {
);
};
-export default withTheme(CrossFadeIcon);
+export default withInternalTheme(CrossFadeIcon);
const styles = StyleSheet.create({
content: {
diff --git a/src/components/DataTable/DataTableHeader.tsx b/src/components/DataTable/DataTableHeader.tsx
index 49e93cda23..19960448ce 100644
--- a/src/components/DataTable/DataTableHeader.tsx
+++ b/src/components/DataTable/DataTableHeader.tsx
@@ -1,11 +1,11 @@
import * as React from 'react';
-import { StyleSheet, StyleProp, View, ViewStyle } from 'react-native';
+import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
import color from 'color';
-import { withTheme } from '../../core/theming';
+import { withInternalTheme } from '../../core/theming';
import { black, white } from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
export type Props = React.ComponentPropsWithRef & {
/**
@@ -16,7 +16,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -78,7 +78,7 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(DataTableHeader);
+export default withInternalTheme(DataTableHeader);
// @component-docs ignore-next-line
export { DataTableHeader };
diff --git a/src/components/DataTable/DataTablePagination.tsx b/src/components/DataTable/DataTablePagination.tsx
index d9db0b5dd8..1fdb288e93 100644
--- a/src/components/DataTable/DataTablePagination.tsx
+++ b/src/components/DataTable/DataTablePagination.tsx
@@ -1,16 +1,16 @@
import * as React from 'react';
import {
- StyleSheet,
+ I18nManager,
StyleProp,
+ StyleSheet,
View,
ViewStyle,
- I18nManager,
} from 'react-native';
import color from 'color';
+import type { InternalTheme } from 'src/types';
-import { withTheme, useTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { useInternalTheme, withInternalTheme } from '../../core/theming';
import Button from '../Button/Button';
import IconButton from '../IconButton/IconButton';
import MaterialCommunityIcon from '../MaterialCommunityIcon';
@@ -40,7 +40,7 @@ export type Props = React.ComponentPropsWithRef &
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
type PaginationDropdownProps = {
@@ -83,7 +83,7 @@ const PaginationControls = ({
onPageChange,
showFastPaginationControls,
}: PaginationControlsProps) => {
- const theme = useTheme();
+ const theme = useInternalTheme();
const textColor = theme.isV3 ? theme.colors.onSurface : theme.colors.text;
@@ -158,7 +158,7 @@ const PaginationDropdown = ({
numberOfItemsPerPage,
onItemsPerPageChange,
}: PaginationDropdownProps) => {
- const { colors } = useTheme();
+ const { colors } = useInternalTheme();
const [showSelect, toggleSelect] = React.useState(false);
return (
@@ -361,7 +361,7 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(DataTablePagination);
+export default withInternalTheme(DataTablePagination);
// @component-docs ignore-next-line
export { DataTablePagination };
diff --git a/src/components/DataTable/DataTableRow.tsx b/src/components/DataTable/DataTableRow.tsx
index d08d738cd4..d64a712abb 100644
--- a/src/components/DataTable/DataTableRow.tsx
+++ b/src/components/DataTable/DataTableRow.tsx
@@ -1,17 +1,17 @@
import * as React from 'react';
import {
- StyleSheet,
StyleProp,
+ StyleSheet,
View,
- ViewStyle,
ViewProps,
+ ViewStyle,
} from 'react-native';
import color from 'color';
-import { withTheme } from '../../core/theming';
+import { withInternalTheme } from '../../core/theming';
import { black, white } from '../../styles/themes/v2/colors';
-import type { $RemoveChildren, Theme } from '../../types';
+import type { $RemoveChildren, InternalTheme } from '../../types';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
export type Props = $RemoveChildren & {
@@ -27,7 +27,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* `pointerEvents` passed to the `View` container, which is wrapping children within `TouchableRipple`.
*/
@@ -105,7 +105,7 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(DataTableRow);
+export default withInternalTheme(DataTableRow);
// @component-docs ignore-next-line
export { DataTableRow };
diff --git a/src/components/DataTable/DataTableTitle.tsx b/src/components/DataTable/DataTableTitle.tsx
index 5b23cfd681..a81a4d212f 100644
--- a/src/components/DataTable/DataTableTitle.tsx
+++ b/src/components/DataTable/DataTableTitle.tsx
@@ -1,19 +1,19 @@
import * as React from 'react';
import {
Animated,
+ I18nManager,
StyleProp,
StyleSheet,
+ TextStyle,
TouchableWithoutFeedback,
View,
ViewStyle,
- I18nManager,
- TextStyle,
} from 'react-native';
import color from 'color';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import MaterialCommunityIcon from '../MaterialCommunityIcon';
import Text from '../Typography/Text';
@@ -48,7 +48,7 @@ export type Props = React.ComponentPropsWithRef<
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -200,7 +200,7 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(DataTableTitle);
+export default withInternalTheme(DataTableTitle);
// @component-docs ignore-next-line
export { DataTableTitle };
diff --git a/src/components/Dialog/Dialog.tsx b/src/components/Dialog/Dialog.tsx
index f1da264a81..59b398e24a 100644
--- a/src/components/Dialog/Dialog.tsx
+++ b/src/components/Dialog/Dialog.tsx
@@ -1,9 +1,9 @@
import * as React from 'react';
-import { StyleSheet, Platform, StyleProp, ViewStyle } from 'react-native';
+import { Platform, StyleProp, StyleSheet, ViewStyle } from 'react-native';
-import { withTheme } from '../../core/theming';
+import { withInternalTheme } from '../../core/theming';
import overlay from '../../styles/overlay';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
import Modal from '../Modal';
import DialogActions from './DialogActions';
import DialogContent from './DialogContent';
@@ -32,7 +32,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
const DIALOG_ELEVATION: number = 24;
@@ -172,4 +172,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(Dialog);
+export default withInternalTheme(Dialog);
diff --git a/src/components/Dialog/DialogActions.tsx b/src/components/Dialog/DialogActions.tsx
index ddd5aaa619..6ee14be435 100644
--- a/src/components/Dialog/DialogActions.tsx
+++ b/src/components/Dialog/DialogActions.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
-import { StyleSheet, StyleProp, View, ViewStyle } from 'react-native';
+import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
-import { useTheme } from '../../core/theming';
+import { useInternalTheme } from '../../core/theming';
export type Props = React.ComponentPropsWithRef & {
/**
@@ -46,7 +46,7 @@ export type Props = React.ComponentPropsWithRef & {
* ```
*/
const DialogActions = (props: Props) => {
- const { isV3 } = useTheme();
+ const { isV3 } = useInternalTheme();
const actionsLength = React.Children.toArray(props.children).length;
return (
diff --git a/src/components/Dialog/DialogIcon.tsx b/src/components/Dialog/DialogIcon.tsx
index 589e787558..84e0ae2ab9 100644
--- a/src/components/Dialog/DialogIcon.tsx
+++ b/src/components/Dialog/DialogIcon.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import { StyleSheet, View } from 'react-native';
-import { useTheme } from '../../core/theming';
+import { useInternalTheme } from '../../core/theming';
import Icon, { IconSource } from '../Icon';
export type Props = {
@@ -61,7 +61,7 @@ export type Props = {
* ```
*/
const DialogIcon = ({ size = 24, color, icon }: Props) => {
- const theme = useTheme();
+ const theme = useInternalTheme();
if (!theme.isV3) {
return null;
diff --git a/src/components/Dialog/DialogScrollArea.tsx b/src/components/Dialog/DialogScrollArea.tsx
index c76266ba9b..be26ce8770 100644
--- a/src/components/Dialog/DialogScrollArea.tsx
+++ b/src/components/Dialog/DialogScrollArea.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
-import { View, ViewStyle, StyleSheet, StyleProp } from 'react-native';
+import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
-import { useTheme } from '../../core/theming';
+import { useInternalTheme } from '../../core/theming';
export type Props = React.ComponentPropsWithRef & {
/**
@@ -49,7 +49,7 @@ export type Props = React.ComponentPropsWithRef & {
* ```
*/
const DialogScrollArea = (props: Props) => {
- const theme = useTheme();
+ const theme = useInternalTheme();
const borderStyles = {
borderColor: theme.isV3
? theme.colors.surfaceVariant
diff --git a/src/components/Dialog/DialogTitle.tsx b/src/components/Dialog/DialogTitle.tsx
index 7ce0fae4ec..20d1a7cbb9 100644
--- a/src/components/Dialog/DialogTitle.tsx
+++ b/src/components/Dialog/DialogTitle.tsx
@@ -1,8 +1,8 @@
import * as React from 'react';
-import { StyleSheet, StyleProp, TextStyle } from 'react-native';
+import { StyleProp, StyleSheet, TextStyle } from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import Text from '../Typography/Text';
import Title from '../Typography/v2/Title';
@@ -15,7 +15,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -88,7 +88,7 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(DialogTitle);
+export default withInternalTheme(DialogTitle);
// @component-docs ignore-next-line
export { DialogTitle };
diff --git a/src/components/Divider.tsx b/src/components/Divider.tsx
index cb0ae0f581..001f5112b7 100644
--- a/src/components/Divider.tsx
+++ b/src/components/Divider.tsx
@@ -1,11 +1,11 @@
import * as React from 'react';
-import { StyleSheet, View, ViewStyle, StyleProp } from 'react-native';
+import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
import color from 'color';
-import { withTheme } from '../core/theming';
+import { withInternalTheme } from '../core/theming';
import { black, white } from '../styles/themes/v2/colors';
-import type { $RemoveChildren, Theme } from '../types';
+import type { $RemoveChildren, InternalTheme } from '../types';
export type Props = $RemoveChildren & {
/**
@@ -27,7 +27,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -101,4 +101,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(Divider);
+export default withInternalTheme(Divider);
diff --git a/src/components/Drawer/DrawerCollapsedItem.tsx b/src/components/Drawer/DrawerCollapsedItem.tsx
index 158a922e49..6e4a18c6c8 100644
--- a/src/components/Drawer/DrawerCollapsedItem.tsx
+++ b/src/components/Drawer/DrawerCollapsedItem.tsx
@@ -1,18 +1,18 @@
import * as React from 'react';
import {
- View,
- StyleSheet,
- StyleProp,
- ViewStyle,
Animated,
- TouchableWithoutFeedback,
NativeSyntheticEvent,
- TextLayoutEventData,
Platform,
+ StyleProp,
+ StyleSheet,
+ TextLayoutEventData,
+ TouchableWithoutFeedback,
+ View,
+ ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import Badge from '../Badge';
import Icon, { IconSource } from '../Icon';
import Text from '../Typography/Text';
@@ -42,7 +42,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* Badge to show on the icon, can be `true` to show a dot, `string` or `number` to show text.
*/
@@ -248,4 +248,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(DrawerCollapsedItem);
+export default withInternalTheme(DrawerCollapsedItem);
diff --git a/src/components/Drawer/DrawerItem.tsx b/src/components/Drawer/DrawerItem.tsx
index 4e7713549a..f1cb65e875 100644
--- a/src/components/Drawer/DrawerItem.tsx
+++ b/src/components/Drawer/DrawerItem.tsx
@@ -1,10 +1,10 @@
import * as React from 'react';
-import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
+import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
import color from 'color';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import Icon, { IconSource } from '../Icon';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import Text from '../Typography/Text';
@@ -38,7 +38,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -181,4 +181,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(DrawerItem);
+export default withInternalTheme(DrawerItem);
diff --git a/src/components/Drawer/DrawerSection.tsx b/src/components/Drawer/DrawerSection.tsx
index 05b1b4b81f..04fcd846c0 100644
--- a/src/components/Drawer/DrawerSection.tsx
+++ b/src/components/Drawer/DrawerSection.tsx
@@ -1,11 +1,11 @@
import * as React from 'react';
-import { View, ViewStyle, StyleSheet, StyleProp } from 'react-native';
+import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
import color from 'color';
-import { withTheme } from '../../core/theming';
+import { withInternalTheme } from '../../core/theming';
import { MD3Colors } from '../../styles/themes/v3/tokens';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
import Divider from '../Divider';
import Text from '../Typography/Text';
@@ -22,7 +22,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -120,4 +120,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(DrawerSection);
+export default withInternalTheme(DrawerSection);
diff --git a/src/components/FAB/AnimatedFAB.tsx b/src/components/FAB/AnimatedFAB.tsx
index 6eedf21e3a..da8640b952 100644
--- a/src/components/FAB/AnimatedFAB.tsx
+++ b/src/components/FAB/AnimatedFAB.tsx
@@ -1,28 +1,28 @@
import * as React from 'react';
+import type {
+ AccessibilityState,
+ NativeSyntheticEvent,
+ TextLayoutEventData,
+} from 'react-native';
import {
Animated,
- View,
- ViewStyle,
- StyleSheet,
- StyleProp,
Easing,
+ I18nManager,
+ Platform,
ScrollView,
+ StyleProp,
+ StyleSheet,
Text,
- Platform,
- I18nManager,
-} from 'react-native';
-import type {
- AccessibilityState,
- NativeSyntheticEvent,
- TextLayoutEventData,
+ View,
+ ViewStyle,
} from 'react-native';
import color from 'color';
-import { withTheme } from '../../core/theming';
-import type { $RemoveChildren, Theme } from '../../types';
-import Icon from '../Icon';
+import { withInternalTheme } from '../../core/theming';
+import type { $RemoveChildren, InternalTheme } from '../../types';
import type { IconSource } from '../Icon';
+import Icon from '../Icon';
import Surface from '../Surface';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import AnimatedText from '../Typography/AnimatedText';
@@ -95,7 +95,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
testID?: string;
};
@@ -521,4 +521,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(AnimatedFAB);
+export default withInternalTheme(AnimatedFAB);
diff --git a/src/components/FAB/FAB.tsx b/src/components/FAB/FAB.tsx
index 31b9dbc84b..88867e2719 100644
--- a/src/components/FAB/FAB.tsx
+++ b/src/components/FAB/FAB.tsx
@@ -1,15 +1,15 @@
import * as React from 'react';
import {
+ AccessibilityState,
Animated,
+ StyleProp,
+ StyleSheet,
View,
ViewStyle,
- StyleSheet,
- StyleProp,
- AccessibilityState,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { $RemoveChildren, Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { $RemoveChildren, InternalTheme } from '../../types';
import ActivityIndicator from '../ActivityIndicator';
import CrossFadeIcon from '../CrossFadeIcon';
import Icon, { IconSource } from '../Icon';
@@ -111,7 +111,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
testID?: string;
};
@@ -320,9 +320,9 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(FAB);
+export default withInternalTheme(FAB);
// @component-docs ignore-next-line
-const FABWithTheme = withTheme(FAB);
+const FABWithTheme = withInternalTheme(FAB);
// @component-docs ignore-next-line
export { FABWithTheme as FAB };
diff --git a/src/components/FAB/FABGroup.tsx b/src/components/FAB/FABGroup.tsx
index 60c8244b9a..fcd9149f98 100644
--- a/src/components/FAB/FABGroup.tsx
+++ b/src/components/FAB/FABGroup.tsx
@@ -1,17 +1,17 @@
import * as React from 'react';
import {
- StyleProp,
- StyleSheet,
Animated,
SafeAreaView,
+ StyleProp,
+ StyleSheet,
+ TextStyle,
TouchableWithoutFeedback,
View,
ViewStyle,
- TextStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import Card from '../Card/Card';
import type { IconSource } from '../Icon';
import Text from '../Typography/Text';
@@ -101,7 +101,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* Pass down testID from Group props to FAB.
*/
@@ -419,10 +419,10 @@ const FABGroup = ({
FABGroup.displayName = 'FAB.Group';
-export default withTheme(FABGroup);
+export default withInternalTheme(FABGroup);
// @component-docs ignore-next-line
-const FABGroupWithTheme = withTheme(FABGroup);
+const FABGroupWithTheme = withInternalTheme(FABGroup);
// @component-docs ignore-next-line
export { FABGroupWithTheme as FABGroup };
diff --git a/src/components/FAB/utils.ts b/src/components/FAB/utils.ts
index 761441db17..308e11faec 100644
--- a/src/components/FAB/utils.ts
+++ b/src/components/FAB/utils.ts
@@ -2,14 +2,14 @@ import {
Animated,
I18nManager,
StyleProp,
- ViewStyle,
StyleSheet,
+ ViewStyle,
} from 'react-native';
import color from 'color';
-import { white, black } from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import { black, white } from '../../styles/themes/v2/colors';
+import type { InternalTheme } from '../../types';
import getContrastingColor from '../../utils/getContrastingColor';
type GetCombinedStylesProps = {
@@ -29,7 +29,7 @@ type Variant = 'primary' | 'secondary' | 'tertiary' | 'surface';
type BaseProps = {
isVariant: (variant: Variant) => boolean;
- theme: Theme;
+ theme: InternalTheme;
disabled?: boolean;
};
@@ -265,7 +265,7 @@ export const getFABColors = ({
customColor,
style,
}: {
- theme: Theme;
+ theme: InternalTheme;
variant: string;
disabled?: boolean;
customColor?: string;
@@ -295,7 +295,7 @@ export const getFABColors = ({
};
};
-const getLabelColor = ({ theme }: { theme: Theme }) => {
+const getLabelColor = ({ theme }: { theme: InternalTheme }) => {
if (theme.isV3) {
return theme.colors.onSurface;
}
@@ -311,7 +311,7 @@ const getBackdropColor = ({
theme,
customBackdropColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
customBackdropColor?: string;
}) => {
if (customBackdropColor) {
@@ -323,7 +323,7 @@ const getBackdropColor = ({
return theme.colors?.backdrop;
};
-const getStackedFABBackgroundColor = ({ theme }: { theme: Theme }) => {
+const getStackedFABBackgroundColor = ({ theme }: { theme: InternalTheme }) => {
if (theme.isV3) {
return theme.colors.elevation.level3;
}
@@ -334,7 +334,7 @@ export const getFABGroupColors = ({
theme,
customBackdropColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
customBackdropColor?: string;
}) => {
return {
@@ -380,7 +380,7 @@ export const getFabStyle = ({
}: {
customSize?: number;
size: 'small' | 'medium' | 'large';
- theme: Theme;
+ theme: InternalTheme;
}) => {
const { isV3, roundness } = theme;
@@ -424,7 +424,7 @@ export const getExtendedFabStyle = ({
theme,
}: {
customSize?: number;
- theme: Theme;
+ theme: InternalTheme;
}) => {
if (customSize) return getExtendedFabDimensions(customSize);
diff --git a/src/components/HelperText.tsx b/src/components/HelperText.tsx
index cb88d2d510..a4d80899ac 100644
--- a/src/components/HelperText.tsx
+++ b/src/components/HelperText.tsx
@@ -1,16 +1,16 @@
import * as React from 'react';
import {
Animated,
- StyleSheet,
+ LayoutChangeEvent,
StyleProp,
+ StyleSheet,
TextStyle,
- LayoutChangeEvent,
} from 'react-native';
import color from 'color';
-import { withTheme } from '../core/theming';
-import type { $Omit, Theme } from '../types';
+import { withInternalTheme } from '../core/theming';
+import type { $Omit, InternalTheme } from '../types';
import AnimatedText from './Typography/AnimatedText';
export type Props = $Omit<
@@ -37,7 +37,7 @@ export type Props = $Omit<
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* TestID used for testing purposes
*/
@@ -172,4 +172,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(HelperText);
+export default withInternalTheme(HelperText);
diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx
index b21f80b2f6..4e39b98904 100644
--- a/src/components/Icon.tsx
+++ b/src/components/Icon.tsx
@@ -1,14 +1,14 @@
import * as React from 'react';
import {
- Image,
I18nManager,
- Platform,
+ Image,
ImageSourcePropType,
+ Platform,
} from 'react-native';
import { Consumer as SettingsConsumer } from '../core/settings';
-import { withTheme } from '../core/theming';
-import type { Theme } from '../types';
+import { withInternalTheme } from '../core/theming';
+import type { InternalTheme } from '../types';
import { accessibilityProps } from './MaterialCommunityIcon';
type IconSourceBase = string | ImageSourcePropType;
@@ -29,7 +29,7 @@ type Props = IconProps & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
const isImageSource = (source: any) =>
@@ -123,4 +123,4 @@ const Icon = ({ source, color, size, theme, ...rest }: Props) => {
return null;
};
-export default withTheme(Icon);
+export default withInternalTheme(Icon);
diff --git a/src/components/IconButton/IconButton.tsx b/src/components/IconButton/IconButton.tsx
index e45fd8eb1b..082aa00910 100644
--- a/src/components/IconButton/IconButton.tsx
+++ b/src/components/IconButton/IconButton.tsx
@@ -1,14 +1,14 @@
import * as React from 'react';
import {
- ViewStyle,
- StyleSheet,
- StyleProp,
GestureResponderEvent,
+ StyleProp,
+ StyleSheet,
TouchableWithoutFeedback,
+ ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { $RemoveChildren, Theme } from '../../types';
+import { useInternalTheme } from '../../core/theming';
+import type { $RemoveChildren, ThemeProp } from '../../types';
import CrossFadeIcon from '../CrossFadeIcon';
import Icon, { IconSource } from '../Icon';
import Surface from '../Surface';
@@ -69,7 +69,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme?: ThemeProp;
};
/**
@@ -124,11 +124,12 @@ const IconButton = ({
selected = false,
animated = false,
mode,
- theme,
style,
...rest
}: Props) => {
+ const theme = useInternalTheme();
const { isV3 } = theme;
+
const IconComponent = animated ? CrossFadeIcon : Icon;
const { iconColor, rippleColor, backgroundColor, borderColor } =
@@ -208,4 +209,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(IconButton);
+export default IconButton;
diff --git a/src/components/IconButton/utils.ts b/src/components/IconButton/utils.ts
index b5664a7846..e564e09b1b 100644
--- a/src/components/IconButton/utils.ts
+++ b/src/components/IconButton/utils.ts
@@ -1,11 +1,11 @@
import color from 'color';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
type IconButtonMode = 'outlined' | 'contained' | 'contained-tonal';
type BaseProps = {
- theme: Theme;
+ theme: InternalTheme;
isMode: (mode: IconButtonMode) => boolean;
disabled?: boolean;
selected?: boolean;
@@ -15,7 +15,7 @@ const getBorderColor = ({
theme,
disabled,
}: {
- theme: Theme;
+ theme: InternalTheme;
disabled?: boolean;
}) => {
if (theme.isV3) {
@@ -129,7 +129,7 @@ const getRippleColor = ({
theme,
iconColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
iconColor: string;
}) => {
if (theme.isV3) {
@@ -146,7 +146,7 @@ export const getIconButtonColor = ({
customIconColor,
customContainerColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
disabled?: boolean;
selected?: boolean;
mode?: IconButtonMode;
diff --git a/src/components/List/ListAccordion.tsx b/src/components/List/ListAccordion.tsx
index f59a1000fc..f7ca4b89e1 100644
--- a/src/components/List/ListAccordion.tsx
+++ b/src/components/List/ListAccordion.tsx
@@ -1,18 +1,18 @@
import * as React from 'react';
import {
- View,
- ViewStyle,
- StyleSheet,
+ GestureResponderEvent,
+ I18nManager,
StyleProp,
+ StyleSheet,
TextStyle,
- I18nManager,
- GestureResponderEvent,
+ View,
+ ViewStyle,
} from 'react-native';
import color from 'color';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import MaterialCommunityIcon from '../MaterialCommunityIcon';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import Text from '../Typography/Text';
@@ -56,7 +56,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* Style that is passed to the wrapping TouchableRipple element.
*/
@@ -313,4 +313,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(ListAccordion);
+export default withInternalTheme(ListAccordion);
diff --git a/src/components/List/ListItem.tsx b/src/components/List/ListItem.tsx
index 5f054d71f6..5a85d04609 100644
--- a/src/components/List/ListItem.tsx
+++ b/src/components/List/ListItem.tsx
@@ -9,9 +9,12 @@ import {
import color from 'color';
-import { withTheme } from '../../core/theming';
-import type { $RemoveChildren, EllipsizeProp } from '../../types';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type {
+ $RemoveChildren,
+ EllipsizeProp,
+ InternalTheme,
+} from '../../types';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import Text from '../Typography/Text';
@@ -70,7 +73,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* Style that is passed to the wrapping TouchableRipple element.
*/
@@ -274,4 +277,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(ListItem);
+export default withInternalTheme(ListItem);
diff --git a/src/components/List/ListSection.tsx b/src/components/List/ListSection.tsx
index 74d095dc92..9ab1eb856c 100644
--- a/src/components/List/ListSection.tsx
+++ b/src/components/List/ListSection.tsx
@@ -1,14 +1,14 @@
import * as React from 'react';
import {
- View,
- ViewStyle,
- StyleSheet,
StyleProp,
+ StyleSheet,
TextStyle,
+ View,
+ ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import ListSubheader from './ListSubheader';
export type Props = React.ComponentPropsWithRef & {
@@ -23,7 +23,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* Style that is passed to Title element.
*/
@@ -78,4 +78,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(ListSection);
+export default withInternalTheme(ListSection);
diff --git a/src/components/List/ListSubheader.tsx b/src/components/List/ListSubheader.tsx
index cbff5b4e2b..b1ddad3eba 100644
--- a/src/components/List/ListSubheader.tsx
+++ b/src/components/List/ListSubheader.tsx
@@ -1,17 +1,17 @@
import * as React from 'react';
-import { StyleSheet, StyleProp, TextStyle } from 'react-native';
+import { StyleProp, StyleSheet, TextStyle } from 'react-native';
import color from 'color';
+import type { InternalTheme } from 'src/types';
-import { useTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { useInternalTheme } from '../../core/theming';
import Text from '../Typography/Text';
export type Props = React.ComponentProps & {
/**
* @optional
*/
- theme?: Theme;
+ theme?: InternalTheme;
/**
* Style that is passed to Text element.
*/
@@ -32,7 +32,7 @@ export type Props = React.ComponentProps & {
* ```
*/
const ListSubheader = ({ style, theme: overrideTheme, ...rest }: Props) => {
- const theme = useTheme(overrideTheme);
+ const theme = useInternalTheme(overrideTheme);
const textColor = theme.isV3
? theme.colors.onSurfaceVariant
diff --git a/src/components/Menu/Menu.tsx b/src/components/Menu/Menu.tsx
index 675d0860b9..5fd6e8969c 100644
--- a/src/components/Menu/Menu.tsx
+++ b/src/components/Menu/Menu.tsx
@@ -1,28 +1,27 @@
import * as React from 'react';
import {
- Platform,
- StyleProp,
- StyleSheet,
Animated,
BackHandler,
Dimensions,
Easing,
+ findNodeHandle,
I18nManager,
LayoutRectangle,
+ NativeEventSubscription,
+ Platform,
+ ScrollView,
+ StyleProp,
+ StyleSheet,
TouchableWithoutFeedback,
View,
ViewStyle,
- ScrollView,
- findNodeHandle,
- NativeEventSubscription,
} from 'react-native';
import color from 'color';
import { APPROX_STATUSBAR_HEIGHT } from '../../constants';
-import { withTheme } from '../../core/theming';
-import type { $Omit } from '../../types';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { $Omit, InternalTheme } from '../../types';
import { addEventListener } from '../../utils/addEventListener';
import Portal from '../Portal/Portal';
import Surface from '../Surface';
@@ -64,7 +63,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
type Layout = $Omit<$Omit, 'y'>;
@@ -608,4 +607,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(Menu);
+export default withInternalTheme(Menu);
diff --git a/src/components/Menu/MenuItem.tsx b/src/components/Menu/MenuItem.tsx
index 8944aa1ff1..7c9eeb6c0c 100644
--- a/src/components/Menu/MenuItem.tsx
+++ b/src/components/Menu/MenuItem.tsx
@@ -7,8 +7,8 @@ import {
ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import Icon, { IconSource } from '../Icon';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import Text from '../Typography/Text';
@@ -59,7 +59,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* TestID used for testing purposes
*/
@@ -228,4 +228,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(MenuItem);
+export default withInternalTheme(MenuItem);
diff --git a/src/components/Menu/utils.ts b/src/components/Menu/utils.ts
index 90d5f82bdb..b023f63329 100644
--- a/src/components/Menu/utils.ts
+++ b/src/components/Menu/utils.ts
@@ -1,7 +1,7 @@
import color from 'color';
-import { white, black } from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import { black, white } from '../../styles/themes/v2/colors';
+import type { InternalTheme } from '../../types';
import type { IconSource } from '../Icon';
export const MIN_WIDTH = 112;
@@ -15,11 +15,11 @@ type ContentProps = {
};
type ColorProps = {
- theme: Theme;
+ theme: InternalTheme;
disabled?: boolean;
};
-const getDisabledColor = (theme: Theme) => {
+const getDisabledColor = (theme: InternalTheme) => {
if (theme.isV3) {
return theme.colors.onSurfaceDisabled;
}
diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx
index 93f66848b7..b2afd53f7d 100644
--- a/src/components/Modal.tsx
+++ b/src/components/Modal.tsx
@@ -3,20 +3,21 @@ import {
Animated,
BackHandler,
Easing,
+ NativeEventSubscription,
StyleProp,
StyleSheet,
TouchableWithoutFeedback,
- ViewStyle,
View,
- NativeEventSubscription,
+ ViewStyle,
} from 'react-native';
import {
- getStatusBarHeight,
getBottomSpace,
+ getStatusBarHeight,
} from 'react-native-iphone-x-helper';
+import type { InternalTheme } from 'src/types';
-import { withTheme } from '../core/theming';
+import { withInternalTheme } from '../core/theming';
import { addEventListener } from '../utils/addEventListener';
import useAnimatedValue from '../utils/useAnimatedValue';
import Surface from './Surface';
@@ -54,7 +55,7 @@ export type Props = {
/**
* @optional
*/
- theme: ReactNativePaper.Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -261,7 +262,7 @@ function Modal({
);
}
-export default withTheme(Modal);
+export default withInternalTheme(Modal);
const styles = StyleSheet.create({
backdrop: {
diff --git a/src/components/Portal/Portal.tsx b/src/components/Portal/Portal.tsx
index 5680da35e7..67392d3d8f 100644
--- a/src/components/Portal/Portal.tsx
+++ b/src/components/Portal/Portal.tsx
@@ -1,11 +1,12 @@
import * as React from 'react';
+import type { InternalTheme } from 'src/types';
+
import {
- Provider as SettingsProvider,
Consumer as SettingsConsumer,
+ Provider as SettingsProvider,
} from '../../core/settings';
-import { ThemeProvider, withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { ThemeProvider, withInternalTheme } from '../../core/theming';
import PortalConsumer from './PortalConsumer';
import PortalHost, { PortalContext, PortalMethods } from './PortalHost';
@@ -17,7 +18,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -65,4 +66,4 @@ class Portal extends React.Component {
}
}
-export default withTheme(Portal);
+export default withInternalTheme(Portal);
diff --git a/src/components/ProgressBar.tsx b/src/components/ProgressBar.tsx
index 6b4f6cf40f..50f1a19505 100644
--- a/src/components/ProgressBar.tsx
+++ b/src/components/ProgressBar.tsx
@@ -1,19 +1,19 @@
import * as React from 'react';
import {
Animated,
+ I18nManager,
+ LayoutChangeEvent,
Platform,
+ StyleProp,
StyleSheet,
View,
ViewStyle,
- StyleProp,
- LayoutChangeEvent,
- I18nManager,
} from 'react-native';
import setColor from 'color';
-import { withTheme } from '../core/theming';
-import type { Theme } from '../types';
+import { withInternalTheme } from '../core/theming';
+import type { InternalTheme } from '../types';
export type Props = React.ComponentPropsWithRef & {
/**
@@ -42,7 +42,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
const INDETERMINATE_DURATION = 2000;
@@ -260,4 +260,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(ProgressBar);
+export default withInternalTheme(ProgressBar);
diff --git a/src/components/RadioButton/RadioButton.tsx b/src/components/RadioButton/RadioButton.tsx
index 9abece7113..03d004516d 100644
--- a/src/components/RadioButton/RadioButton.tsx
+++ b/src/components/RadioButton/RadioButton.tsx
@@ -1,8 +1,8 @@
import * as React from 'react';
import { Platform } from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import RadioButtonAndroid from './RadioButtonAndroid';
import RadioButtonIOS from './RadioButtonIOS';
@@ -34,7 +34,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -100,9 +100,4 @@ const RadioButton = (props: Props) => {
return ;
};
-export default withTheme(RadioButton);
-
-// @component-docs ignore-next-line
-const RadioButtonWithTheme = withTheme(RadioButton);
-// @component-docs ignore-next-line
-export { RadioButtonWithTheme as RadioButton };
+export default withInternalTheme(RadioButton);
diff --git a/src/components/RadioButton/RadioButtonAndroid.tsx b/src/components/RadioButton/RadioButtonAndroid.tsx
index d153c8e15e..8a8002d97e 100644
--- a/src/components/RadioButton/RadioButtonAndroid.tsx
+++ b/src/components/RadioButton/RadioButtonAndroid.tsx
@@ -1,8 +1,8 @@
import * as React from 'react';
-import { Animated, View, StyleSheet } from 'react-native';
+import { Animated, StyleSheet, View } from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { $RemoveChildren, Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { $RemoveChildren, InternalTheme } from '../../types';
import { getAndroidSelectionControlColor } from '../Checkbox/utils';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import { RadioButtonContext, RadioButtonContextType } from './RadioButtonGroup';
@@ -36,7 +36,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -202,9 +202,9 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(RadioButtonAndroid);
+export default withInternalTheme(RadioButtonAndroid);
// @component-docs ignore-next-line
-const RadioButtonAndroidWithTheme = withTheme(RadioButtonAndroid);
+const RadioButtonAndroidWithTheme = withInternalTheme(RadioButtonAndroid);
// @component-docs ignore-next-line
export { RadioButtonAndroidWithTheme as RadioButtonAndroid };
diff --git a/src/components/RadioButton/RadioButtonIOS.tsx b/src/components/RadioButton/RadioButtonIOS.tsx
index d6f4161acb..48f540326a 100644
--- a/src/components/RadioButton/RadioButtonIOS.tsx
+++ b/src/components/RadioButton/RadioButtonIOS.tsx
@@ -1,8 +1,8 @@
import * as React from 'react';
import { StyleSheet, View } from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { $RemoveChildren, Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { $RemoveChildren, InternalTheme } from '../../types';
import { getSelectionControlIOSColor } from '../Checkbox/utils';
import MaterialCommunityIcon from '../MaterialCommunityIcon';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
@@ -33,7 +33,7 @@ export type Props = $RemoveChildren & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -128,9 +128,9 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(RadioButtonIOS);
+export default withInternalTheme(RadioButtonIOS);
// @component-docs ignore-next-line
-const RadioButtonIOSWithTheme = withTheme(RadioButtonIOS);
+const RadioButtonIOSWithTheme = withInternalTheme(RadioButtonIOS);
// @component-docs ignore-next-line
export { RadioButtonIOSWithTheme as RadioButtonIOS };
diff --git a/src/components/RadioButton/RadioButtonItem.tsx b/src/components/RadioButton/RadioButtonItem.tsx
index 5095de2b25..11e58659ae 100644
--- a/src/components/RadioButton/RadioButtonItem.tsx
+++ b/src/components/RadioButton/RadioButtonItem.tsx
@@ -1,14 +1,14 @@
import * as React from 'react';
import {
- View,
- StyleSheet,
StyleProp,
- ViewStyle,
+ StyleSheet,
TextStyle,
+ View,
+ ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { MD3TypescaleKey, Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme, MD3TypescaleKey } from '../../types';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
import Text from '../Typography/Text';
import RadioButton from './RadioButton';
@@ -78,7 +78,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -214,10 +214,10 @@ const RadioButtonItem = ({
RadioButtonItem.displayName = 'RadioButton.Item';
-export default withTheme(RadioButtonItem);
+export default withInternalTheme(RadioButtonItem);
// @component-docs ignore-next-line
-const RadioButtonItemWithTheme = withTheme(RadioButtonItem);
+const RadioButtonItemWithTheme = withInternalTheme(RadioButtonItem);
// @component-docs ignore-next-line
export { RadioButtonItemWithTheme as RadioButtonItem };
diff --git a/src/components/Searchbar.tsx b/src/components/Searchbar.tsx
index cc559d2f2b..01a6f558de 100644
--- a/src/components/Searchbar.tsx
+++ b/src/components/Searchbar.tsx
@@ -1,21 +1,21 @@
import * as React from 'react';
import {
+ Animated,
+ I18nManager,
Platform,
- StyleSheet,
StyleProp,
+ StyleSheet,
TextInput,
- I18nManager,
TextInputProps,
- ViewStyle,
TextStyle,
- Animated,
View,
+ ViewStyle,
} from 'react-native';
import color from 'color';
-import { withTheme } from '../core/theming';
-import type { Theme } from '../types';
+import { withInternalTheme } from '../core/theming';
+import type { InternalTheme } from '../types';
import ActivityIndicator from './ActivityIndicator';
import type { IconSource } from './Icon';
import IconButton from './IconButton/IconButton';
@@ -81,7 +81,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
type TextInputHandles = Pick<
@@ -294,4 +294,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(Searchbar);
+export default withInternalTheme(Searchbar);
diff --git a/src/components/SegmentedButtons/SegmentedButtonItem.tsx b/src/components/SegmentedButtons/SegmentedButtonItem.tsx
index dcac15cf06..f292c129e3 100644
--- a/src/components/SegmentedButtons/SegmentedButtonItem.tsx
+++ b/src/components/SegmentedButtons/SegmentedButtonItem.tsx
@@ -1,17 +1,17 @@
import * as React from 'react';
import {
- StyleProp,
- ViewStyle,
+ Animated,
GestureResponderEvent,
+ StyleProp,
StyleSheet,
- View,
TextStyle,
- Animated,
+ View,
+ ViewStyle,
} from 'react-native';
import color from 'color';
-import { useTheme } from '../../core/theming';
+import { useInternalTheme } from '../../core/theming';
import type { IconSource } from '../Icon';
import Icon from '../Icon';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
@@ -83,7 +83,7 @@ const SegmentedButtonItem = ({
segment,
density = 'regular',
}: Props) => {
- const theme = useTheme();
+ const theme = useInternalTheme();
const checkScale = React.useRef(new Animated.Value(0)).current;
diff --git a/src/components/SegmentedButtons/utils.ts b/src/components/SegmentedButtons/utils.ts
index 7752ab8660..701fb90a84 100644
--- a/src/components/SegmentedButtons/utils.ts
+++ b/src/components/SegmentedButtons/utils.ts
@@ -3,10 +3,10 @@ import { StyleSheet, ViewStyle } from 'react-native';
import color from 'color';
import { black, white } from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
type BaseProps = {
- theme: Theme;
+ theme: InternalTheme;
disabled?: boolean;
checked: boolean;
};
@@ -37,7 +37,7 @@ export const getDisabledSegmentedButtonStyle = ({
index,
buttons,
}: {
- theme: Theme;
+ theme: InternalTheme;
buttons: { disabled?: boolean }[];
index: number;
}): ViewStyle => {
@@ -57,7 +57,7 @@ export const getSegmentedButtonBorderRadius = ({
segment,
theme,
}: {
- theme: Theme;
+ theme: InternalTheme;
segment?: 'first' | 'last';
}): ViewStyle => {
if (segment === 'first') {
diff --git a/src/components/Snackbar.tsx b/src/components/Snackbar.tsx
index 59525b6f46..04f86bdbb4 100644
--- a/src/components/Snackbar.tsx
+++ b/src/components/Snackbar.tsx
@@ -1,16 +1,16 @@
import * as React from 'react';
import {
Animated,
+ Easing,
SafeAreaView,
StyleProp,
StyleSheet,
- ViewStyle,
View,
- Easing,
+ ViewStyle,
} from 'react-native';
-import { withTheme } from '../core/theming';
-import type { Theme } from '../types';
+import { withInternalTheme } from '../core/theming';
+import type { InternalTheme } from '../types';
import Button from './Button/Button';
import Surface from './Surface';
import Text from './Typography/Text';
@@ -54,7 +54,7 @@ export type Props = React.ComponentProps & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
const DURATION_SHORT = 4000;
@@ -304,4 +304,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(Snackbar);
+export default withInternalTheme(Snackbar);
diff --git a/src/components/Surface.tsx b/src/components/Surface.tsx
index 3378747853..4825a76948 100644
--- a/src/components/Surface.tsx
+++ b/src/components/Surface.tsx
@@ -1,17 +1,17 @@
import * as React from 'react';
import {
Animated,
+ Platform,
+ StyleProp,
StyleSheet,
View,
- StyleProp,
ViewStyle,
- Platform,
} from 'react-native';
-import { useTheme } from '../core/theming';
+import { useInternalTheme } from '../core/theming';
import overlay, { isAnimatedValue } from '../styles/overlay';
import shadow from '../styles/shadow';
-import type { MD3Elevation, Theme } from '../types';
+import type { InternalTheme, MD3Elevation } from '../types';
export type Props = React.ComponentPropsWithRef & {
/**
@@ -31,7 +31,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme?: Theme;
+ theme?: InternalTheme;
/**
* TestID used for testing purposes
*/
@@ -44,7 +44,7 @@ const MD2Surface = ({
...rest
}: Omit) => {
const { elevation = 4 } = (StyleSheet.flatten(style) || {}) as ViewStyle;
- const { dark: isDarkTheme, mode, colors } = useTheme(overrideTheme);
+ const { dark: isDarkTheme, mode, colors } = useInternalTheme(overrideTheme);
return (
@@ -113,7 +113,7 @@ const Surface = ({
testID,
...props
}: Props) => {
- const theme = useTheme(overridenTheme);
+ const theme = useInternalTheme(overridenTheme);
if (!theme.isV3)
return (
diff --git a/src/components/Switch/Switch.tsx b/src/components/Switch/Switch.tsx
index 5c38748116..78da661da8 100644
--- a/src/components/Switch/Switch.tsx
+++ b/src/components/Switch/Switch.tsx
@@ -7,8 +7,8 @@ import {
ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import { getSwitchColor } from './utils';
const version = NativeModules.PlatformConstants
@@ -36,7 +36,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -123,4 +123,4 @@ const Switch = ({
);
};
-export default withTheme(Switch);
+export default withInternalTheme(Switch);
diff --git a/src/components/Switch/utils.ts b/src/components/Switch/utils.ts
index 43856c7877..2994495af9 100644
--- a/src/components/Switch/utils.ts
+++ b/src/components/Switch/utils.ts
@@ -10,10 +10,10 @@ import {
white,
black,
} from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
type BaseProps = {
- theme: Theme;
+ theme: InternalTheme;
disabled?: boolean;
value?: boolean;
};
@@ -22,7 +22,7 @@ const getCheckedColor = ({
theme,
color,
}: {
- theme: Theme;
+ theme: InternalTheme;
color?: string;
}) => {
if (color) {
diff --git a/src/components/TextInput/Adornment/TextInputAffix.tsx b/src/components/TextInput/Adornment/TextInputAffix.tsx
index 2d0be03d67..9eff8cb362 100644
--- a/src/components/TextInput/Adornment/TextInputAffix.tsx
+++ b/src/components/TextInput/Adornment/TextInputAffix.tsx
@@ -1,18 +1,18 @@
import React from 'react';
import {
- Text,
- StyleSheet,
+ Animated,
+ LayoutChangeEvent,
StyleProp,
+ StyleSheet,
+ Text,
TextStyle,
- LayoutChangeEvent,
- Animated,
ViewStyle,
} from 'react-native';
import color from 'color';
-import { withTheme } from '../../../core/theming';
-import type { Theme } from '../../../types';
+import { withInternalTheme } from '../../../core/theming';
+import type { InternalTheme } from '../../../types';
import { getConstants } from '../helpers';
import { AdornmentSide } from './enums';
@@ -29,7 +29,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
type ContextState = {
@@ -178,7 +178,7 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(TextInputAffix);
+export default withInternalTheme(TextInputAffix);
// @component-docs ignore-next-line
export { TextInputAffix, AffixAdornment };
diff --git a/src/components/TextInput/Adornment/TextInputIcon.tsx b/src/components/TextInput/Adornment/TextInputIcon.tsx
index b215959f8c..a6adb634d2 100644
--- a/src/components/TextInput/Adornment/TextInputIcon.tsx
+++ b/src/components/TextInput/Adornment/TextInputIcon.tsx
@@ -1,8 +1,8 @@
import React from 'react';
-import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
+import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
-import { useTheme } from '../../../core/theming';
-import type { $Omit, Theme } from '../../../types';
+import { useInternalTheme } from '../../../core/theming';
+import type { $Omit, ThemeProp } from '../../../types';
import type { IconSource } from '../../Icon';
import IconButton from '../../IconButton/IconButton';
import { ICON_SIZE } from '../constants';
@@ -33,7 +33,7 @@ export type Props = $Omit<
/**
* @optional
*/
- theme?: Theme;
+ theme?: ThemeProp;
};
type StyleContextType = {
@@ -58,7 +58,7 @@ const IconAdornment: React.FunctionComponent<
side: 'left' | 'right';
} & Omit
> = ({ icon, topPosition, side, isTextInputFocused, forceFocus, testID }) => {
- const { isV3 } = useTheme();
+ const { isV3 } = useInternalTheme();
const { ICON_OFFSET } = getConstants(isV3);
const style = {
@@ -119,7 +119,7 @@ const TextInputIcon = ({
onPress?.();
}, [forceTextInputFocus, forceFocus, isTextInputFocused, onPress]);
- const theme = useTheme();
+ const theme = useInternalTheme();
let iconColor = color;
diff --git a/src/components/TextInput/Label/LabelBackground.tsx b/src/components/TextInput/Label/LabelBackground.tsx
index 76cbb014ae..d350f91d64 100644
--- a/src/components/TextInput/Label/LabelBackground.tsx
+++ b/src/components/TextInput/Label/LabelBackground.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import { Animated, StyleSheet } from 'react-native';
-import { useTheme } from '../../../core/theming';
+import { useInternalTheme } from '../../../core/theming';
import AnimatedText from '../../Typography/AnimatedText';
import type { LabelBackgroundProps } from '../types';
@@ -25,7 +25,7 @@ const LabelBackground = ({
outputRange: [hasFocus ? 1 : 0, 0],
});
- const { isV3 } = useTheme();
+ const { isV3 } = useInternalTheme();
const labelTranslationX = {
translateX: parentState.labeled.interpolate({
diff --git a/src/components/TextInput/TextInput.tsx b/src/components/TextInput/TextInput.tsx
index 8aa6921ff1..c62686cfea 100644
--- a/src/components/TextInput/TextInput.tsx
+++ b/src/components/TextInput/TextInput.tsx
@@ -1,14 +1,14 @@
import * as React from 'react';
import {
Animated,
- TextInput as NativeTextInput,
LayoutChangeEvent,
StyleProp,
+ TextInput as NativeTextInput,
TextStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import TextInputAffix, {
Props as TextInputAffixProps,
} from './Adornment/TextInputAffix';
@@ -137,7 +137,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
/**
* testID to be used on tests.
*/
@@ -488,4 +488,4 @@ TextInput.Icon = TextInputIcon;
// @ts-ignore Types of property 'theme' are incompatible.
TextInput.Affix = TextInputAffix;
-export default withTheme(TextInput);
+export default withInternalTheme(TextInput);
diff --git a/src/components/TextInput/TextInputFlat.tsx b/src/components/TextInput/TextInputFlat.tsx
index 5fa886af97..5a51dde4e6 100644
--- a/src/components/TextInput/TextInputFlat.tsx
+++ b/src/components/TextInput/TextInputFlat.tsx
@@ -1,15 +1,15 @@
import * as React from 'react';
import {
- View,
Animated,
- TextInput as NativeTextInput,
- StyleSheet,
I18nManager,
Platform,
+ StyleSheet,
+ TextInput as NativeTextInput,
TextStyle,
+ View,
} from 'react-native';
-import { useTheme } from '../../core/theming';
+import { useInternalTheme } from '../../core/theming';
import { AdornmentSide, AdornmentType, InputMode } from './Adornment/enums';
import TextInputAdornment, {
TextInputAdornmentProps,
@@ -19,29 +19,29 @@ import {
getAdornmentStyleAdjustmentForNativeInput,
} from './Adornment/TextInputAdornment';
import {
+ ADORNMENT_SIZE,
+ LABEL_PADDING_TOP_DENSE,
+ LABEL_WIGGLE_X_OFFSET,
MAXIMIZED_LABEL_FONT_SIZE,
MINIMIZED_LABEL_FONT_SIZE,
- LABEL_WIGGLE_X_OFFSET,
- ADORNMENT_SIZE,
MINIMIZED_LABEL_Y_OFFSET,
- LABEL_PADDING_TOP_DENSE,
- MIN_DENSE_HEIGHT_WL,
MIN_DENSE_HEIGHT,
+ MIN_DENSE_HEIGHT_WL,
} from './constants';
import {
- calculateLabelTopPosition,
- calculateInputHeight,
- calculatePadding,
adjustPaddingFlat,
- Padding,
- interpolatePlaceholder,
calculateFlatAffixTopPosition,
calculateFlatInputHorizontalPadding,
- getFlatInputColors,
+ calculateInputHeight,
+ calculateLabelTopPosition,
+ calculatePadding,
getConstants,
+ getFlatInputColors,
+ interpolatePlaceholder,
+ Padding,
} from './helpers';
import InputLabel from './Label/InputLabel';
-import type { RenderProps, ChildTextInputProps } from './types';
+import type { ChildTextInputProps, RenderProps } from './types';
const TextInputFlat = ({
disabled = false,
@@ -407,7 +407,7 @@ const Underline = ({
underlineColorCustom,
hasActiveOutline,
}: UnderlineProps) => {
- const { isV3 } = useTheme();
+ const { isV3 } = useInternalTheme();
let backgroundColor = parentState.focused
? activeColor
diff --git a/src/components/TextInput/helpers.tsx b/src/components/TextInput/helpers.tsx
index 07d8411d09..aeaaae38e6 100644
--- a/src/components/TextInput/helpers.tsx
+++ b/src/components/TextInput/helpers.tsx
@@ -3,29 +3,29 @@ import type { Animated } from 'react-native';
import color from 'color';
import { MD3LightTheme } from '../../styles/themes';
-import type { Theme } from '../../types';
-import { AdornmentType, AdornmentSide } from './Adornment/enums';
+import type { InternalTheme } from '../../types';
+import { AdornmentSide, AdornmentType } from './Adornment/enums';
import type { AdornmentConfig } from './Adornment/types';
import {
ADORNMENT_SIZE,
- MD3_LABEL_PADDING_HORIZONTAL,
- MD2_LABEL_PADDING_HORIZONTAL,
- MD3_ADORNMENT_OFFSET,
MD2_ADORNMENT_OFFSET,
- MD3_FLAT_INPUT_OFFSET,
- MD2_FLAT_INPUT_OFFSET,
- MD3_AFFIX_OFFSET,
MD2_AFFIX_OFFSET,
- MD3_ICON_OFFSET,
+ MD2_FLAT_INPUT_OFFSET,
MD2_ICON_OFFSET,
- MD3_LABEL_PADDING_TOP,
+ MD2_INPUT_PADDING_HORIZONTAL,
+ MD2_LABEL_PADDING_HORIZONTAL,
MD2_LABEL_PADDING_TOP,
- MD3_MIN_HEIGHT,
MD2_MIN_HEIGHT,
+ MD2_OUTLINED_INPUT_OFFSET,
+ MD3_ADORNMENT_OFFSET,
+ MD3_AFFIX_OFFSET,
+ MD3_FLAT_INPUT_OFFSET,
+ MD3_ICON_OFFSET,
MD3_INPUT_PADDING_HORIZONTAL,
- MD2_INPUT_PADDING_HORIZONTAL,
+ MD3_LABEL_PADDING_HORIZONTAL,
+ MD3_LABEL_PADDING_TOP,
+ MD3_MIN_HEIGHT,
MD3_OUTLINED_INPUT_OFFSET,
- MD2_OUTLINED_INPUT_OFFSET,
} from './constants';
import type { TextInputLabelProp } from './types';
@@ -314,7 +314,7 @@ export const calculateFlatInputHorizontalPadding = ({
};
type BaseProps = {
- theme: Theme;
+ theme: InternalTheme;
disabled?: boolean;
};
@@ -491,7 +491,7 @@ export const getFlatInputColors = ({
textColor?: string;
disabled?: boolean;
error?: boolean;
- theme: Theme;
+ theme: InternalTheme;
}) => {
const baseFlatColorProps = { theme, disabled };
return {
@@ -529,7 +529,7 @@ export const getOutlinedInputColors = ({
textColor?: string;
disabled?: boolean;
error?: boolean;
- theme: Theme;
+ theme: InternalTheme;
}) => {
const baseOutlinedColorProps = { theme, disabled };
diff --git a/src/components/ToggleButton/ToggleButton.tsx b/src/components/ToggleButton/ToggleButton.tsx
index 38690e5d53..5e3e18b261 100644
--- a/src/components/ToggleButton/ToggleButton.tsx
+++ b/src/components/ToggleButton/ToggleButton.tsx
@@ -1,16 +1,16 @@
import * as React from 'react';
import {
- StyleSheet,
+ GestureResponderEvent,
StyleProp,
+ StyleSheet,
ViewStyle,
- GestureResponderEvent,
} from 'react-native';
import color from 'color';
-import { withTheme } from '../../core/theming';
+import { withInternalTheme } from '../../core/theming';
import { black, white } from '../../styles/themes/v2/colors';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
import type { IconSource } from '../Icon';
import IconButton from '../IconButton/IconButton';
import { ToggleButtonGroupContext } from './ToggleButtonGroup';
@@ -53,7 +53,7 @@ export type Props = {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -160,9 +160,9 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(ToggleButton);
+export default withInternalTheme(ToggleButton);
// @component-docs ignore-next-line
-const ToggleButtonWithTheme = withTheme(ToggleButton);
+const ToggleButtonWithTheme = withInternalTheme(ToggleButton);
// @component-docs ignore-next-line
export { ToggleButtonWithTheme as ToggleButton };
diff --git a/src/components/ToggleButton/utils.ts b/src/components/ToggleButton/utils.ts
index d971c7702a..79c22665ad 100644
--- a/src/components/ToggleButton/utils.ts
+++ b/src/components/ToggleButton/utils.ts
@@ -1,13 +1,13 @@
import color from 'color';
import { tokens } from '../../styles/themes/v3/tokens';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
export const getToggleButtonColor = ({
theme,
checked,
}: {
- theme: Theme;
+ theme: InternalTheme;
checked: boolean | null;
}) => {
if (checked) {
diff --git a/src/components/TouchableRipple/TouchableRipple.native.tsx b/src/components/TouchableRipple/TouchableRipple.native.tsx
index d49b083614..c76e6ab174 100644
--- a/src/components/TouchableRipple/TouchableRipple.native.tsx
+++ b/src/components/TouchableRipple/TouchableRipple.native.tsx
@@ -9,8 +9,8 @@ import {
GestureResponderEvent,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import { getTouchableRippleColors } from './utils';
const ANDROID_VERSION_LOLLIPOP = 21;
@@ -25,7 +25,7 @@ type Props = React.ComponentProps & {
underlayColor?: string;
children: React.ReactNode;
style?: StyleProp;
- theme: Theme;
+ theme: InternalTheme;
};
const TouchableRipple = ({
@@ -113,4 +113,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(TouchableRipple);
+export default withInternalTheme(TouchableRipple);
diff --git a/src/components/TouchableRipple/TouchableRipple.tsx b/src/components/TouchableRipple/TouchableRipple.tsx
index 52b0eac94f..b9f883df65 100644
--- a/src/components/TouchableRipple/TouchableRipple.tsx
+++ b/src/components/TouchableRipple/TouchableRipple.tsx
@@ -1,15 +1,15 @@
import * as React from 'react';
import {
- ViewStyle,
- StyleSheet,
- StyleProp,
GestureResponderEvent,
Platform,
Pressable,
+ StyleProp,
+ StyleSheet,
+ ViewStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import type { Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import type { InternalTheme } from '../../types';
import { getTouchableRippleColors } from './utils';
export type Props = React.ComponentPropsWithRef & {
@@ -54,7 +54,7 @@ export type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -257,4 +257,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(TouchableRipple);
+export default withInternalTheme(TouchableRipple);
diff --git a/src/components/TouchableRipple/utils.ts b/src/components/TouchableRipple/utils.ts
index 6244df6803..6595515691 100644
--- a/src/components/TouchableRipple/utils.ts
+++ b/src/components/TouchableRipple/utils.ts
@@ -1,13 +1,13 @@
import color from 'color';
-import type { Theme } from '../../types';
+import type { InternalTheme } from '../../types';
const getUnderlayColor = ({
theme,
calculatedRippleColor,
underlayColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
calculatedRippleColor: string;
underlayColor?: string;
}) => {
@@ -26,7 +26,7 @@ const getRippleColor = ({
theme,
rippleColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
rippleColor?: string;
}) => {
if (rippleColor) {
@@ -48,7 +48,7 @@ export const getTouchableRippleColors = ({
rippleColor,
underlayColor,
}: {
- theme: Theme;
+ theme: InternalTheme;
rippleColor?: string;
underlayColor?: string;
}) => {
diff --git a/src/components/Typography/AnimatedText.tsx b/src/components/Typography/AnimatedText.tsx
index c755b1b49e..1da015549b 100644
--- a/src/components/Typography/AnimatedText.tsx
+++ b/src/components/Typography/AnimatedText.tsx
@@ -1,14 +1,14 @@
import * as React from 'react';
import {
Animated,
- TextStyle,
I18nManager,
StyleProp,
StyleSheet,
+ TextStyle,
} from 'react-native';
-import { withTheme } from '../../core/theming';
-import { Font, MD3TypescaleKey, Theme } from '../../types';
+import { withInternalTheme } from '../../core/theming';
+import { Font, InternalTheme, MD3TypescaleKey } from '../../types';
type Props = React.ComponentPropsWithRef & {
/**
@@ -30,7 +30,7 @@ type Props = React.ComponentPropsWithRef & {
/**
* @optional
*/
- theme: Theme;
+ theme: InternalTheme;
};
/**
@@ -105,4 +105,4 @@ const styles = StyleSheet.create({
},
});
-export default withTheme(AnimatedText);
+export default withInternalTheme(AnimatedText);
diff --git a/src/components/Typography/Text.tsx b/src/components/Typography/Text.tsx
index dd1914a836..f3fa6234e0 100644
--- a/src/components/Typography/Text.tsx
+++ b/src/components/Typography/Text.tsx
@@ -1,13 +1,13 @@
import * as React from 'react';
import {
- Text as NativeText,
- TextStyle,
+ I18nManager,
StyleProp,
StyleSheet,
- I18nManager,
+ Text as NativeText,
+ TextStyle,
} from 'react-native';
-import { useTheme } from '../../core/theming';
+import { useInternalTheme } from '../../core/theming';
import { tokens } from '../../styles/themes/v3/tokens';
import { Font, MD3TypescaleKey, ThemeProp } from '../../types';
@@ -84,7 +84,7 @@ const Text: React.ForwardRefRenderFunction<{}, Props> = (
) => {
const root = React.useRef(null);
// FIXME: destructure it in TS 4.6+
- const theme = useTheme(initialTheme);
+ const theme = useInternalTheme(initialTheme);
const writingDirection = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr';
React.useImperativeHandle(ref, () => ({
diff --git a/src/components/Typography/v2/StyledText.tsx b/src/components/Typography/v2/StyledText.tsx
index fee06b29d4..2147679021 100644
--- a/src/components/Typography/v2/StyledText.tsx
+++ b/src/components/Typography/v2/StyledText.tsx
@@ -1,19 +1,27 @@
import * as React from 'react';
-import { I18nManager, StyleProp, TextStyle, StyleSheet } from 'react-native';
+import { I18nManager, StyleProp, StyleSheet, TextStyle } from 'react-native';
import color from 'color';
+import type { ThemeProp } from 'src/types';
-import { useTheme } from '../../../core/theming';
+import { useInternalTheme } from '../../../core/theming';
import Text from './Text';
type Props = React.ComponentProps & {
alpha?: number;
family: 'regular' | 'medium' | 'light' | 'thin';
style?: StyleProp;
+ theme?: ThemeProp;
};
-const StyledText = ({ alpha = 1, family, style, ...rest }: Props) => {
- const theme = useTheme();
+const StyledText = ({
+ alpha = 1,
+ family,
+ style,
+ theme: themeOverrides,
+ ...rest
+}: Props) => {
+ const theme = useInternalTheme(themeOverrides);
const textColor = color(
theme.isV3 ? theme.colors.onSurface : theme.colors?.text
diff --git a/src/components/Typography/v2/Text.tsx b/src/components/Typography/v2/Text.tsx
index 88ac8c91c1..eeae7d06f6 100644
--- a/src/components/Typography/v2/Text.tsx
+++ b/src/components/Typography/v2/Text.tsx
@@ -1,20 +1,21 @@
import * as React from 'react';
import {
- Text as NativeText,
- TextStyle,
StyleProp,
StyleSheet,
+ Text as NativeText,
+ TextStyle,
} from 'react-native';
-import { useTheme } from '../../../core/theming';
-import type { Theme } from '../../../types';
+import type { MD2Theme } from 'src/types';
+
+import { useInternalTheme } from '../../../core/theming';
type Props = React.ComponentProps & {
style?: StyleProp;
/**
* @optional
*/
- theme?: Theme;
+ theme?: MD2Theme;
};
// @component-group Typography
@@ -29,7 +30,7 @@ const Text: React.ForwardRefRenderFunction<{}, Props> = (
ref
) => {
const root = React.useRef(null);
- const theme = useTheme(overrideTheme);
+ const theme = useInternalTheme(overrideTheme);
React.useImperativeHandle(ref, () => ({
setNativeProps: (args: Object) => root.current?.setNativeProps(args),
diff --git a/src/core/Provider.tsx b/src/core/Provider.tsx
index 94879255eb..2e23de76d0 100644
--- a/src/core/Provider.tsx
+++ b/src/core/Provider.tsx
@@ -91,7 +91,7 @@ const Provider = (props: Props) => {
return {
...extendedThemeBase,
isV3: extendedThemeBase.version === 3,
- } as ReactNativePaper.Theme;
+ };
};
const { children, settings } = props;
diff --git a/src/core/theming.tsx b/src/core/theming.tsx
index ce6c2bae0b..75d26d0924 100644
--- a/src/core/theming.tsx
+++ b/src/core/theming.tsx
@@ -1,6 +1,7 @@
+import type { ComponentType } from 'react';
import type { ColorValue } from 'react-native';
-import { createTheming } from '@callstack/react-theme-provider';
+import { $DeepPartial, createTheming } from '@callstack/react-theme-provider';
import {
argbFromHex,
themeFromSourceColor,
@@ -15,8 +16,7 @@ import {
} from '../styles/themes';
import { tokens } from '../styles/themes/v3/tokens';
import type {
- Theme,
- MD2Theme,
+ InternalTheme,
MD3Theme,
MD3Colors,
MD3AndroidColors,
@@ -25,16 +25,23 @@ import type {
export const DefaultTheme = MD3LightTheme;
-const {
+export const {
ThemeProvider,
withTheme,
- useTheme: useThemeProviderTheme,
-} = createTheming(DefaultTheme);
+ useTheme: useAppTheme,
+} = createTheming(MD3LightTheme);
-const useTheme = (overrides?: Parameters[0]) =>
- useThemeProviderTheme(overrides);
+export function useTheme(overrides?: $DeepPartial) {
+ return useAppTheme(overrides);
+}
+
+export const useInternalTheme = (
+ themeOverrides?: $DeepPartial
+) => useAppTheme(themeOverrides);
-export { ThemeProvider, withTheme, useTheme };
+export const withInternalTheme = (
+ WrappedComponent: ComponentType & C
+) => withTheme(WrappedComponent);
export const defaultThemesByVersion = {
2: {
@@ -206,4 +213,4 @@ export const createDynamicThemeColors = ({ sourceColor }: Config): Schemes => {
);
return { lightScheme: light, darkScheme: dark };
-};
+};
\ No newline at end of file
diff --git a/src/index.tsx b/src/index.tsx
index aad6a6d74b..67341b71eb 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -147,10 +147,4 @@ export type { Props as TitleProps } from './components/Typography/v2/Title';
export type { Props as TextProps } from './components/Typography/Text';
export type { Props as SegmentedButtonsProps } from './components/SegmentedButtons/SegmentedButtons';
-export type {
- MD2Theme,
- MD3Theme,
- ThemeBase,
- MD3Elevation,
- Theme,
-} from './types';
+export type { MD2Theme, MD3Theme, ThemeBase, MD3Elevation } from './types';
diff --git a/src/types.tsx b/src/types.tsx
index 679a94a8e5..73f407b4cf 100644
--- a/src/types.tsx
+++ b/src/types.tsx
@@ -111,7 +111,7 @@ export type MD3AndroidColors = {
export type MD3Palette = {};
-export type ThemeProp = $DeepPartial;
+export type ThemeProp = $DeepPartial;
export type ThemeBase = {
dark: boolean;
@@ -136,7 +136,7 @@ export type MD2Theme = ThemeBase & {
fonts: Fonts;
};
-export type Theme = MD2Theme | MD3Theme;
+export type InternalTheme = MD2Theme | MD3Theme;
// MD3 types
export enum MD3TypescaleKey {
diff --git a/yarn.lock b/yarn.lock
index fdcb29cfc6..93b44a9ece 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1233,7 +1233,7 @@
eslint-restricted-globals "^0.2.0"
prettier "^2.4.1"
-"@callstack/react-theme-provider@^3.0.7":
+"@callstack/react-theme-provider@^3.0.8":
version "3.0.8"
resolved "https://registry.yarnpkg.com/@callstack/react-theme-provider/-/react-theme-provider-3.0.8.tgz#d0d7ac71e422133c5f7b78f4c4aa1bc57f156f50"
integrity sha512-5U231sYY2sqQOaELX0WBCn+iluV8bFaXIS7em03k4W5Xz0AhGvKlnpLIhDGFP8im/SvNW7/2XoR0BsClhn9t6Q==