Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2cb2b81
refactor: non standard component; avatar
MrMuzyk Jun 29, 2026
6e07fc7
refactor: banner
MrMuzyk Jun 29, 2026
63d431e
refactor: data table
MrMuzyk Jun 29, 2026
ae2ecfc
fix: respect animation scale in Banner
MikitasK Aug 20, 2026
e384ae1
fix: respect animation scale in DataTable title
MikitasK Aug 25, 2026
2f0e874
feat: sync main into refactor/non-standard-components
MikitasK Sep 4, 2026
b318fad
fix: simplify Avatar custom color handling
MikitasK Sep 21, 2026
57c8321
fix: forward DataTable theme overrides
MikitasK Sep 21, 2026
6f2d053
test: clean up animation regression tests
MikitasK Sep 21, 2026
44b95c1
feat: sync main into refactor/non-standard-components
MikitasK Sep 21, 2026
628f67c
feat: sync main into refactor/non-standard-components
MikitasK Oct 15, 2026
6a4b814
fix: simplify Avatar color handling and forward theme overrides
MikitasK Oct 26, 2026
5887bf1
fix: inline Banner icon size
MikitasK Oct 26, 2026
e409fdb
docs: tidy Avatar migration diff
MikitasK Oct 26, 2026
29e1632
Merge remote-tracking branch 'upstream/main' into refactor/non-standa…
MrMuzyk Nov 18, 2026
7546df0
Merge branch 'main' into refactor/non-standard-components
MrMuzyk Nov 18, 2026
54ea206
Merge branch 'main' into refactor/non-standard-components
MrMuzyk Nov 19, 2026
95df1fa
Merge branch 'main' into refactor/non-standard-components
MrMuzyk Nov 23, 2026
44b6772
Merge branch 'main' into refactor/non-standard-components
MrMuzyk Nov 23, 2026
662a51d
fix: another CR
MrMuzyk Nov 23, 2026
98a6ad9
fix: copilot comments
MrMuzyk Nov 23, 2026
bd8e5e8
Merge branch 'main' into refactor/non-standard-components
MrMuzyk Nov 24, 2026
691eaf8
fix: addressed new batch of review comments
MrMuzyk Nov 24, 2026
0a5ccd6
Refactor typography and border styles in DataTable
MrMuzyk Nov 24, 2026
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
20 changes: 19 additions & 1 deletion docs/6.x/docs/guides/migration.md
Comment thread
MrMuzyk marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,9 @@ Using `Appbar` as a bottom bar is deprecated. Material Design 3 moves the bottom

### Avatar

The `style` prop for `Avatar.Icon`, `Avatar.Image` and `Avatar.Text` no longer configures the background color. Use the `backgroundColor` prop instead. The text or icon color is still derived from the background color unless `color` is specified.
The `style` prop for `Avatar.Icon`, `Avatar.Image` and `Avatar.Text` no longer configures the background color. Use the `backgroundColor` prop instead.

The default background color is now `theme.colors.primaryContainer`, and the default icon or text color is `theme.colors.onPrimaryContainer`. `Avatar.Icon` and `Avatar.Text` no longer derive their icon or text color from the background color. Pass a matching `color` when you set a custom `backgroundColor`.
Comment thread
Doberjohn marked this conversation as resolved.
Resolved
Comment thread
MrMuzyk marked this conversation as resolved.
Resolved

e.g.:

Expand All @@ -538,9 +540,25 @@ e.g.:
label="XD"
- style={{ backgroundColor: 'red' }}
+ backgroundColor="red"
+ color="white"
/>
```

`Avatar.Text` uses the `titleMedium` type style: a font weight of 500 and a letter spacing of 0.15. Its font size and line height still scale with `size`.

### Banner

Showing and hiding use the `standardDecelerate` and `standardAccelerate` easing curves instead of ease-in-out.

### DataTable

- `DataTable.Title` text has a letter spacing of 0.5, and its sort icon rotates with the `standard` easing curve instead of ease-in-out.
- `DataTable.Pagination` labels use the `bodySmall` type style: a line height of 16 and a letter spacing of 0.4.
- `DataTable.Cell` text uses the `bodyMedium` type style: a line height of 20 and a letter spacing of 0.25.
- `DataTable.Header` and `DataTable.Row` draw their bottom border with `theme.colors.outlineVariant` instead of `theme.colors.surfaceVariant`.

`Avatar.Text`, `DataTable.Title`, `DataTable.Cell` and `DataTable.Pagination` now read `theme.fonts.titleMedium`, `theme.fonts.labelMedium`, `theme.fonts.bodyMedium` and `theme.fonts.bodySmall`, respectively, instead of `theme.fonts.default`. These variants use the plain font family by default. Customizing only `theme.fonts.default` no longer affects these texts; customize the corresponding variants instead. A font family applied to all variants with `configureFonts({ config: { fontFamily: 'YourFont' } })` still applies to these components.

### Tooltip

`Tooltip` no longer reads positioning styles such as `position: 'absolute'` from the `style` of the wrapped element. Apply them to a parent `View` wrapping the `Tooltip` instead.
Expand Down
28 changes: 15 additions & 13 deletions src/components/Avatar/AvatarIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { StyleSheet, View } from 'react-native';
import type { ColorValue, StyleProp, ViewProps, ViewStyle } from 'react-native';

import { DEFAULT_SIZE } from './utils';
import { useInternalTheme } from '../../core/theming';
import { white } from '../../theme/colors';
import { cornerFull } from '../../theme/tokens/sys/shape';
import type { ThemeProp } from '../../theme/types';
import getContrastingColor from '../../utils/getContrastingColor';
import Icon from '../Icon';
import type { IconSource } from '../Icon';

const defaultSize = 64;

export type Props = Omit<ViewProps, 'style'> & {
/**
* Icon to display for the `Avatar`.
Expand All @@ -22,7 +20,7 @@ export type Props = Omit<ViewProps, 'style'> & {
/**
* Custom color for the icon.
*/
color?: string;
color?: ColorValue;
/**
* Background color of the avatar.
*/
Expand Down Expand Up @@ -54,33 +52,37 @@ export type Props = Omit<ViewProps, 'style'> & {
*/
const Avatar = ({
icon,
size = defaultSize,
size = DEFAULT_SIZE,
style,
backgroundColor: customBackgroundColor,
theme: themeOverrides,
color: customColor,
...rest
}: Props) => {
const theme = useInternalTheme(themeOverrides);
const backgroundColor = customBackgroundColor ?? theme.colors.primary;
const textColor =
rest.color ??
getContrastingColor(backgroundColor, white, 'rgba(0, 0, 0, .54)');

return (
<View
style={[
{
width: size,
height: size,
borderRadius: size / 2,
borderRadius: cornerFull,
},
styles.container,
style,
{ backgroundColor },
{
backgroundColor:
customBackgroundColor ?? theme.colors.primaryContainer,
},
]}
{...rest}
>
<Icon source={icon} color={textColor} size={size * 0.6} />
<Icon
source={icon}
color={customColor ?? theme.colors.onPrimaryContainer}
Comment thread
Doberjohn marked this conversation as resolved.
Resolved
size={size * 0.6}
/>
Comment thread
MrMuzyk marked this conversation as resolved.
Resolved
</View>
);
};
Expand Down
18 changes: 10 additions & 8 deletions src/components/Avatar/AvatarImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import type {
ViewStyle,
} from 'react-native';

import { DEFAULT_SIZE } from './utils';
import { useInternalTheme } from '../../core/theming';
import { cornerFull } from '../../theme/tokens/sys/shape';
import type { ThemeProp } from '../../theme/types';

const defaultSize = 64;

export type AvatarImageSource =
| ImageSourcePropType
| ((props: { size: number }) => React.ReactNode);
Expand Down Expand Up @@ -84,7 +84,7 @@ export type Props = Omit<ViewProps, 'style'> & {
* ```
*/
const AvatarImage = ({
size = defaultSize,
size = DEFAULT_SIZE,
source,
style,
onError,
Expand All @@ -98,19 +98,21 @@ const AvatarImage = ({
testID,
...rest
}: Props) => {
const { colors } = useInternalTheme(themeOverrides);
const backgroundColor = customBackgroundColor ?? colors.primary;
const theme = useInternalTheme(themeOverrides);

return (
<View
style={[
{
width: size,
height: size,
borderRadius: size / 2,
borderRadius: cornerFull,
},
style,
{ backgroundColor },
{
backgroundColor:
customBackgroundColor ?? theme.colors.primaryContainer,
},
]}
{...rest}
>
Expand All @@ -119,7 +121,7 @@ const AvatarImage = ({
<Image
testID={testID}
source={source}
style={{ width: size, height: size, borderRadius: size / 2 }}
style={{ width: size, height: size, borderRadius: cornerFull }}
onError={onError}
onLayout={onLayout}
onLoad={onLoad}
Expand Down
27 changes: 13 additions & 14 deletions src/components/Avatar/AvatarText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import type {
ViewStyle,
} from 'react-native';

import { DEFAULT_SIZE } from './utils';
import { useInternalTheme } from '../../core/theming';
import { white } from '../../theme/colors';
import { cornerFull } from '../../theme/tokens/sys/shape';
import type { ThemeProp } from '../../theme/types';
import getContrastingColor from '../../utils/getContrastingColor';
import Text from '../Typography/Text';

const defaultSize = 64;

export type Props = Omit<ViewProps, 'style'> & {
/**
* Initials to show as the text in the `Avatar`.
Expand All @@ -27,13 +25,13 @@ export type Props = Omit<ViewProps, 'style'> & {
/**
* Custom color for the text.
*/
color?: string;
color?: ColorValue;
/**
* Background color of the avatar.
*/
backgroundColor?: ColorValue;
/**
* Style for text container
* Style for the text container.
*
* Background color should be specified via the `backgroundColor` prop instead.
*/
Expand Down Expand Up @@ -67,7 +65,7 @@ export type Props = Omit<ViewProps, 'style'> & {
*/
const AvatarText = ({
label,
size = defaultSize,
size = DEFAULT_SIZE,
style,
labelStyle,
color: customColor,
Expand All @@ -77,10 +75,6 @@ const AvatarText = ({
...rest
}: Props) => {
const theme = useInternalTheme(themeOverrides);
const backgroundColor = customBackgroundColor ?? theme.colors.primary;
const textColor =
customColor ??
getContrastingColor(backgroundColor, white, 'rgba(0, 0, 0, .54)');
const { fontScale } = useWindowDimensions();

return (
Expand All @@ -89,19 +83,24 @@ const AvatarText = ({
{
width: size,
height: size,
borderRadius: size / 2,
borderRadius: cornerFull,
},
styles.container,
style,
{ backgroundColor },
{
backgroundColor:
customBackgroundColor ?? theme.colors.primaryContainer,
},
]}
{...rest}
>
<Text
variant="titleMedium"
theme={themeOverrides}
style={[
styles.text,
{
color: textColor,
color: customColor ?? theme.colors.onPrimaryContainer,
fontSize: size / 2,
lineHeight: size / fontScale,
},
Comment thread
MrMuzyk marked this conversation as resolved.
Resolved
Expand Down
1 change: 1 addition & 0 deletions src/components/Avatar/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const DEFAULT_SIZE = 64;
21 changes: 18 additions & 3 deletions src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,35 @@ const Banner = ({
const hideCallback = useLatestCallback(onHideAnimationFinished);

const getDuration = useMotionDuration();
const { medium1: showDuration, short4: hideDuration } = theme.motion.duration;
const { standardDecelerate, standardAccelerate } = theme.motion.easing;
const [x1, y1, x2, y2] = visible ? standardDecelerate : standardAccelerate;

React.useEffect(() => {
const callback = visible ? showCallback : hideCallback;

position.value = withTiming(
visible ? 1 : 0,
{
duration: getDuration(visible ? 250 : 200),
easing: Easing.inOut(Easing.ease),
duration: getDuration(visible ? showDuration : hideDuration),
easing: Easing.bezier(x1, y1, x2, y2),
reduceMotion: ReduceMotion.Never,
},
(finished) => scheduleOnRN(callback, { finished: finished ?? false })
);
}, [getDuration, hideCallback, position, showCallback, visible]);
}, [
getDuration,
hideCallback,
hideDuration,
position,
showCallback,
showDuration,
visible,
x1,
x2,
y1,
y2,
]);

const surfaceStyle = useAnimatedStyle(() => ({
opacity: interpolate(position.value, [0, 0.1, 1], [0, 1, 1]),
Expand Down
11 changes: 10 additions & 1 deletion src/components/DataTable/DataTableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const DataTableCell = ({
numeric,
maxFontSizeMultiplier,
testID,
theme: themeOverrides,
...rest
}: Props) => {
return (
Expand All @@ -83,11 +84,13 @@ const DataTableCell = ({
focusRing="inward"
{...rest}
testID={testID}
theme={themeOverrides}
style={[styles.container, numeric && styles.right, style]}
>
<CellContent
textStyle={textStyle}
maxFontSizeMultiplier={maxFontSizeMultiplier}
theme={themeOverrides}
>
{children}
</CellContent>
Expand All @@ -99,16 +102,22 @@ const CellContent = ({
children,
textStyle,
maxFontSizeMultiplier,
}: Pick<Props, 'children' | 'textStyle' | 'maxFontSizeMultiplier'>) => {
theme,
}: Pick<
Props,
'children' | 'textStyle' | 'maxFontSizeMultiplier' | 'theme'
>) => {
if (React.isValidElement(children)) {
return children;
}

return (
<Text
variant="bodyMedium"
Comment thread
MrMuzyk marked this conversation as resolved.
Resolved
style={textStyle}
numberOfLines={1}
maxFontSizeMultiplier={maxFontSizeMultiplier}
theme={theme}
>
{children}
</Text>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataTable/DataTableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const DataTableHeader = ({
...rest
}: Props) => {
const theme = useInternalTheme(themeOverrides);
const borderBottomColor = theme.colors.surfaceVariant;
const borderBottomColor = theme.colors.outlineVariant;

return (
<View {...rest} style={[styles.header, { borderBottomColor }, style]}>
Expand Down
5 changes: 4 additions & 1 deletion src/components/DataTable/DataTablePagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ const DataTablePagination = ({
onItemsPerPageChange && (
<View aria-label="Options Select" style={styles.optionsContainer}>
<Text
variant="bodySmall"
Comment thread
MrMuzyk marked this conversation as resolved.
Resolved
theme={themeOverrides}
style={[styles.label, { color: labelColor }]}
numberOfLines={3}
aria-label={
Expand All @@ -312,6 +314,8 @@ const DataTablePagination = ({
</View>
)}
<Text
variant="bodySmall"
Comment thread
MrMuzyk marked this conversation as resolved.
Resolved
theme={themeOverrides}
style={[styles.label, { color: labelColor }]}
numberOfLines={3}
aria-label={accessibilityLabel || 'label'}
Expand Down Expand Up @@ -347,7 +351,6 @@ const styles = StyleSheet.create({
marginVertical: 6,
},
label: {
fontSize: 12,
marginRight: 16,
},
button: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataTable/DataTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const DataTableRow = ({
...rest
}: Props) => {
const theme = useInternalTheme(themeOverrides);
const borderBottomColor = theme.colors.surfaceVariant;
const borderBottomColor = theme.colors.outlineVariant;

return (
<TouchableRipple
Expand Down
Loading
Loading