Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tighten up typing for framework, fixing the resulting errors",
"packageName": "@fluentui-react-native/button",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tighten up typing for framework, fixing the resulting errors",
"packageName": "@fluentui-react-native/composition",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix use-slot to use new rendering patterns",
"packageName": "@fluentui-react-native/dropdown",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tighten up typing for framework, fixing the resulting errors",
"packageName": "@fluentui-react-native/experimental-checkbox",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tighten up typing for framework, fixing the resulting errors",
"packageName": "@fluentui-react-native/experimental-expander",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tighten up typing for framework, fixing the resulting errors",
"packageName": "@fluentui-react-native/experimental-menu-button",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update phasedComponent pattern and switch direct stagedComponent callers to use it",
"packageName": "@fluentui-react-native/experimental-shadow",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update phasedComponent pattern and switch direct stagedComponent callers to use it",
"packageName": "@fluentui-react-native/framework-base",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update phasedComponent pattern and switch direct stagedComponent callers to use it",
"packageName": "@fluentui-react-native/icon",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update phasedComponent pattern and switch direct stagedComponent callers to use it",
"packageName": "@fluentui-react-native/menu",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update phasedComponent pattern and switch direct stagedComponent callers to use it",
"packageName": "@fluentui-react-native/notification",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update phasedComponent pattern and switch direct stagedComponent callers to use it",
"packageName": "@fluentui-react-native/overflow",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tighten up typing for framework, fixing the resulting errors",
"packageName": "@fluentui-react-native/switch",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update phasedComponent pattern and switch direct stagedComponent callers to use it",
"packageName": "@fluentui-react-native/tablist",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "update phasedComponent pattern and switch direct stagedComponent callers to use it",
"packageName": "@fluentui-react-native/tooltip",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix use-slot to use new rendering patterns",
"packageName": "@fluentui-react-native/use-slot",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tighten up typing for framework, fixing the resulting errors",
"packageName": "@fluentui-react-native/use-slots",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "tighten up typing for framework, fixing the resulting errors",
"packageName": "@fluentui-react-native/use-styling",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
/** @jsxImportSource @fluentui-react-native/framework-base */
import { View } from 'react-native';
import { View, type ViewProps } from 'react-native';

import { compose } from '@fluentui-react-native/framework';
import { Icon } from '@fluentui-react-native/icon';
import { TextV1 as Text } from '@fluentui-react-native/text';

import type { CompoundButtonType } from './CompoundButton.types';
import type { CompoundButtonSlotProps, CompoundButtonType } from './CompoundButton.types';
import { compoundButtonName } from './CompoundButton.types';

export const CompoundButton = compose<CompoundButtonType>({
export interface MobileSlotProps extends CompoundButtonSlotProps {
root: ViewProps;
}
export interface CompoundButtonMobileType extends CompoundButtonType {
slotProps: MobileSlotProps;
}

export const CompoundButton = compose<CompoundButtonMobileType>({
displayName: compoundButtonName,
slots: {
root: View,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
/** @jsxImportSource @fluentui-react-native/framework-base */
import { View } from 'react-native';
import { View, type ViewProps } from 'react-native';

import { compose } from '@fluentui-react-native/framework';
import { Icon } from '@fluentui-react-native/icon';
import { TextV1 as Text } from '@fluentui-react-native/text';

import type { ToggleButtonType } from './ToggleButton.types';
import type { ToggleButtonSlotProps, ToggleButtonType } from './ToggleButton.types';
import { toggleButtonName } from './ToggleButton.types';

export const ToggleButton = compose<ToggleButtonType>({
interface ToggleButtonSlotPropsAndroid extends ToggleButtonSlotProps {
root: ViewProps;
}

interface ToggleButtonAndroidType extends ToggleButtonType {
slotProps: ToggleButtonSlotPropsAndroid;
}

export const ToggleButton = compose<ToggleButtonAndroidType>({
displayName: toggleButtonName,
slots: {
root: View,
Expand Down
1 change: 1 addition & 0 deletions packages/components/Icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"dependencies": {
"@fluentui-react-native/adapters": "workspace:*",
"@fluentui-react-native/framework": "workspace:*",
"@fluentui-react-native/framework-base": "workspace:*",
"@fluentui-react-native/text": "workspace:*"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/Icon/src/FontIcon/FontIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Text } from 'react-native';

import { mergeProps, stagedComponent } from '@fluentui-react-native/framework';
import { mergeProps, phasedComponent } from '@fluentui-react-native/framework-base';

import type { FontIconProps } from './FontIcon.types';
import { fontIconName } from './FontIcon.types';
import { useFontIcon } from './useFontIcon';

export const FontIcon = stagedComponent((props: FontIconProps) => {
export const FontIcon = phasedComponent((props: FontIconProps) => {
const fontIconProps = useFontIcon(props);
return (final: FontIconProps) => {
const newProps = mergeProps<FontIconProps>(fontIconProps, final);
Expand Down
4 changes: 2 additions & 2 deletions packages/components/Icon/src/SvgIcon/SvgIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Platform, View } from 'react-native';

import { mergeProps, stagedComponent } from '@fluentui-react-native/framework';
import { mergeProps, phasedComponent } from '@fluentui-react-native/framework-base';
import { SvgUri } from 'react-native-svg';

import type { SvgIconProps } from './SvgIcon.types';
import { svgIconName } from './SvgIcon.types';
import { useSvgIcon } from './useSvgIcon';

export const SvgIcon = stagedComponent((props: SvgIconProps) => {
export const SvgIcon = phasedComponent((props: SvgIconProps) => {
const svgProps = useSvgIcon(props);
return (final: SvgIconProps) => {
const { style, height, width, src, uri, viewBox, color, ...rest } = mergeProps<SvgIconProps>(svgProps, final);
Expand Down
4 changes: 2 additions & 2 deletions packages/components/Icon/src/legacy/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Image, Platform, View } from 'react-native';
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';

import { mergeStyles, useFluentTheme } from '@fluentui-react-native/framework';
import { stagedComponent, mergeProps, getMemoCache, getTypedMemoCache } from '@fluentui-react-native/framework';
import { phasedComponent, mergeProps, getMemoCache, getTypedMemoCache } from '@fluentui-react-native/framework-base';
import { Text } from '@fluentui-react-native/text';
import type { SvgProps } from 'react-native-svg';
import { SvgUri } from 'react-native-svg';
Expand Down Expand Up @@ -92,7 +92,7 @@ function renderSvg(iconProps: IconProps) {
}
}

export const Icon = stagedComponent((props: IconProps) => {
export const Icon = phasedComponent((props: IconProps) => {
const theme = useFluentTheme();

return (rest: IconProps) => {
Expand Down
8 changes: 4 additions & 4 deletions packages/components/Menu/src/Menu/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React from 'react';

import { stagedComponent } from '@fluentui-react-native/framework';
import { phasedComponent } from '@fluentui-react-native/framework-base';

import type { MenuProps } from './Menu.types';
import { menuName } from './Menu.types';
import { renderFinalMenu } from './renderMenu';
import { useMenu } from './useMenu';
import { useMenuContextValue } from './useMenuContextValue';

export const Menu = stagedComponent((props: MenuProps) => {
export const Menu = phasedComponent((props: MenuProps) => {
const state = useMenu(props);
const contextValue = useMenuContextValue(state);

return (_rest: MenuProps, children: React.ReactNode) => {
const childrenArray = React.Children.toArray(children) as React.ReactElement[];
return (rest: MenuProps) => {
const childrenArray = React.Children.toArray(rest.children) as React.ReactElement[];

if (__DEV__) {
if (childrenArray.length !== 2) {
Expand Down
11 changes: 5 additions & 6 deletions packages/components/Menu/src/MenuCallout/MenuCallout.android.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import React from 'react';
import { Animated, Modal, TouchableWithoutFeedback, View, StyleSheet, ScrollView } from 'react-native';

import { stagedComponent } from '@fluentui-react-native/framework';
import { mergeProps } from '@fluentui-react-native/framework';
import { mergeProps, phasedComponent } from '@fluentui-react-native/framework-base';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a bunch of docs around stagedComponent.. we may need to update those later


import type { MenuCalloutProps } from './MenuCallout.types';
import { menuCalloutName } from './MenuCallout.types';
import { useMenuContext } from '../context';

const AnimatedScrollView = Animated.createAnimatedComponent(ScrollView);

export const MenuCallout = stagedComponent((props: MenuCalloutProps) => {
export const MenuCallout = phasedComponent((props: MenuCalloutProps) => {
const context = useMenuContext();

return (_rest: MenuCalloutProps, children: React.ReactNode) => {
const mergedProps = mergeProps(props, _rest);
return (innerProps: MenuCalloutProps) => {
const { children, ...rest } = mergeProps<MenuCalloutProps>(props, innerProps);
const mergedProps = mergeProps(props, rest);
const tokens = props.tokens;

return (
Expand Down
12 changes: 5 additions & 7 deletions packages/components/Menu/src/MenuCallout/MenuCallout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React from 'react';

import { Callout } from '@fluentui-react-native/callout';
import { stagedComponent } from '@fluentui-react-native/framework';
import { mergeProps } from '@fluentui-react-native/framework';
import { mergeProps, phasedComponent } from '@fluentui-react-native/framework-base';

import type { MenuCalloutProps } from './MenuCallout.types';
import { menuCalloutName } from './MenuCallout.types';

export const MenuCallout = stagedComponent((props: MenuCalloutProps) => {
return (_rest: MenuCalloutProps, children: React.ReactNode) => {
const mergedProps = mergeProps(props, _rest);
export const MenuCallout = phasedComponent((props: MenuCalloutProps) => {
return (innerProps: MenuCalloutProps) => {
const { children, ...rest } = innerProps;
const mergedProps = mergeProps(props, rest);

return <Callout {...mergedProps}>{children}</Callout>;
};
Expand Down
57 changes: 31 additions & 26 deletions packages/components/Notification/src/Notification.helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import type { ButtonProps, ButtonTokens } from '@fluentui-react-native/button';
import { ButtonV1 as Button } from '@fluentui-react-native/button';
import { mergeProps, stagedComponent } from '@fluentui-react-native/framework';
import { mergeProps, phasedComponent } from '@fluentui-react-native/framework-base';
import type { SvgIconProps } from '@fluentui-react-native/icon';
import { createIconProps } from '@fluentui-react-native/icon';
import { globalTokens } from '@fluentui-react-native/theme-tokens';
Expand Down Expand Up @@ -59,31 +59,36 @@ export function createNotificationButtonProps(userProps: NotificationProps) {
* (e.g. setting color in Notification.styling.ts will not apply to the action button text)
* This helper component is used to customize tokens via props.
*/
export const NotificationButton = stagedComponent((props: NotificationButtonProps) => {
const CustomizedButton = Button.customize({
subtle: {
backgroundColor: 'transparent',
color: props.color,
iconColor: props.color,
disabled: {
color: props.disabledColor,
},
pressed: {
color: props.pressedColor,
},
},
medium: {
hasContent: {
minWidth: 0,
padding: globalTokens.sizeNone,
paddingHorizontal: globalTokens.sizeNone,
variant: 'body2Strong',
},
},
});
export const NotificationButton = phasedComponent((props: NotificationButtonProps) => {
const CustomizedButton = React.useMemo(
() =>
Button.customize({
subtle: {
backgroundColor: 'transparent',
color: props.color,
iconColor: props.color,
disabled: {
color: props.disabledColor,
},
pressed: {
color: props.pressedColor,
},
},
medium: {
hasContent: {
minWidth: 0,
padding: globalTokens.sizeNone,
paddingHorizontal: globalTokens.sizeNone,
variant: 'body2Strong',
},
},
}),
[props.color, props.disabledColor, props.pressedColor],
);

return (final: NotificationButtonProps, children: React.ReactNode) => {
const mergedProps = mergeProps(props, final);
return (final: NotificationButtonProps) => {
const { children, ...rest } = final;
const mergedProps = mergeProps(props, rest);
return <CustomizedButton {...mergedProps}>{children}</CustomizedButton>;
};
}, true);
});
Loading
Loading