diff --git a/example/storybook/stories/components/Wrapper.tsx b/example/storybook/stories/components/Wrapper.tsx index 6d89912da..3e0536367 100644 --- a/example/storybook/stories/components/Wrapper.tsx +++ b/example/storybook/stories/components/Wrapper.tsx @@ -123,7 +123,7 @@ function MyWrapper({ children }: any) { bg={bgColor} safeAreaY > - {/* : } size="lg" /> - */} + {children} ); diff --git a/example/storybook/stories/components/primitives/Input/Addons.tsx b/example/storybook/stories/components/primitives/Input/Addons.tsx index 617783165..006e6a1fe 100644 --- a/example/storybook/stories/components/primitives/Input/Addons.tsx +++ b/example/storybook/stories/components/primitives/Input/Addons.tsx @@ -10,8 +10,8 @@ import { export const Example = () => { return ( - - + + diff --git a/example/storybook/stories/components/primitives/Select/FormControlled.tsx b/example/storybook/stories/components/primitives/Select/FormControlled.tsx index 74b74a4aa..240d6f2da 100644 --- a/example/storybook/stories/components/primitives/Select/FormControlled.tsx +++ b/example/storybook/stories/components/primitives/Select/FormControlled.tsx @@ -10,7 +10,7 @@ import { export const Example = () => { return (
- + Choose service { diff --git a/package.json b/package.json index 201a5d9ad..51f73cff4 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "prettier --write" ] }, - "version": "3.4.20", + "version": "3.4.21", "license": "MIT", "private": false, "main": "lib/commonjs/index", diff --git a/src/components/composites/Avatar/Group.tsx b/src/components/composites/Avatar/Group.tsx index dd9acc091..89fc891a8 100644 --- a/src/components/composites/Avatar/Group.tsx +++ b/src/components/composites/Avatar/Group.tsx @@ -22,7 +22,6 @@ const getAvatarGroupChildren = ( plusAvatars = childrenArray.length - max; childrenArray = childrenArray.slice(0, max); } - const trailingChildren = childrenArray.slice(1); const spacingProps = { ml: isVertical ? 0 : space, mt: isVertical ? space : 0, @@ -38,29 +37,18 @@ const getAvatarGroupChildren = ( {'+ ' + plusAvatars} ) : null, - React.Children.map( - trailingChildren.reverse(), - (child: any, index: number) => { - return React.cloneElement( - child, - { - key: `avatar-group-child-${index}`, - ..._avatar, - ...spacingProps, - ...child.props, - }, - child.props.children - ); - } - ), - React.cloneElement( - childrenArray[0], - { - ..._avatar, - ...childrenArray[0].props, - }, - childrenArray[0].props.children - ), + React.Children.map(childrenArray.reverse(), (child: any, index: number) => { + return React.cloneElement( + child, + { + key: `avatar-group-child-${index}`, + ..._avatar, + ...spacingProps, + ...child.props, + }, + child.props.children + ); + }), ]; }; diff --git a/src/components/composites/Popover/Popover.tsx b/src/components/composites/Popover/Popover.tsx index 7f6e05858..32b5120c3 100644 --- a/src/components/composites/Popover/Popover.tsx +++ b/src/components/composites/Popover/Popover.tsx @@ -27,6 +27,7 @@ const Popover = ( finalFocusRef, useRNModal, trapFocus = true, + _backdrop, ...props }: IPopoverProps, ref: any @@ -101,7 +102,7 @@ const Popover = ( style={StyleSheet.absoluteFill} > - + ( componentTheme?: ComponentTheme ) { return React.forwardRef( - ({ children, ...props }: P & FactoryComponentProps, ref: any) => { + ({ children, _state, ...props }: P & FactoryComponentProps, ref: any) => { const StyledComponent = useMemo(() => makeStyledComponent(Component), []); const calculatedProps = usePropsWithComponentTheme( componentTheme ?? {}, - props + props, + _state ); return ( diff --git a/src/factory/types.ts b/src/factory/types.ts index 3d24405f6..723ae9d63 100644 --- a/src/factory/types.ts +++ b/src/factory/types.ts @@ -1,7 +1,9 @@ import type { PlatformProps } from '../components/types'; import type { StyledProps } from '../theme/types'; +import type { IStateProps } from '../hooks/useThemeProps/propsFlattener'; export type FactoryComponentProps = StyledProps & PlatformProps & { children?: string | JSX.Element | JSX.Element[]; + _state?: IStateProps; }; diff --git a/src/hooks/useThemeProps/usePropsWithComponentTheme.ts b/src/hooks/useThemeProps/usePropsWithComponentTheme.ts index a029a7432..0f4f48d49 100644 --- a/src/hooks/useThemeProps/usePropsWithComponentTheme.ts +++ b/src/hooks/useThemeProps/usePropsWithComponentTheme.ts @@ -1,9 +1,15 @@ import { usePropsResolutionWithComponentTheme } from './usePropsResolution'; import type { ComponentTheme } from '../../theme'; +import type { IStateProps } from './propsFlattener'; export function usePropsWithComponentTheme( localTheme: ComponentTheme, - propsReceived: any + propsReceived: any, + _state?: IStateProps ) { - return usePropsResolutionWithComponentTheme(localTheme, propsReceived); + return usePropsResolutionWithComponentTheme( + localTheme, + propsReceived, + _state + ); } diff --git a/src/theme/components/actionsheet.ts b/src/theme/components/actionsheet.ts index e6761336a..90f9686e6 100644 --- a/src/theme/components/actionsheet.ts +++ b/src/theme/components/actionsheet.ts @@ -15,6 +15,9 @@ export const ActionsheetContent = { py: 2, borderRadius: 'none', roundedTop: 20, + _web: { + userSelect: 'none', + }, _dragIndicator: { height: 1, width: 10, diff --git a/src/theme/styled-system.ts b/src/theme/styled-system.ts index 8aabb52a7..200db4c2b 100644 --- a/src/theme/styled-system.ts +++ b/src/theme/styled-system.ts @@ -114,6 +114,7 @@ export const flexbox = { flexDirection: true, flexDir: { property: 'flexDirection', + scale: 'flexDirection', }, // item flex: true,