docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
sequencelengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
{InputRightElement || rightElement ? InputRightElement || rightElement : null}
<mask> onBlur={(e) => { <mask> handleFocus(false, onBlur ? () => onBlur(e) : () => {}); <mask> }} <mask> /> <mask> {InputRightElement ? InputRightElement : null} <mask> </Box> <mask> ); <mask> }; <mask> <mask> export default memo(forwardRef(InputAdvance)); </s> fix: added readonly pseudo prop and alias to props </s> remove {...(isDisabled && _disabled)} </s> add {...(isReadOnly && _readOnly)} </s> remove {InputLeftElement ? InputLeftElement : null} </s> add {InputLeftElement || leftElement ? InputLeftElement || leftElement : null} </s> remove {...(isDisabled && _disabled)} </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cce5a63b8eb023d33522f678b97686a7f464759a
src/components/primitives/Input/InputAdvanced.tsx
_readOnly,
<mask> _focus, <mask> _disabled, <mask> _invalid, <mask> fontFamily, <mask> fontWeight, <mask> fontStyle, </s> fix: added readonly pseudo prop and alias to props
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cce5a63b8eb023d33522f678b97686a7f464759a
src/components/primitives/Input/InputBase.tsx
{...(isReadOnly && _readOnly)}
<mask> w={isFullWidth ? '100%' : undefined} <mask> {...themedProps} <mask> {...(isHovered && _hover)} <mask> {...(isFocused && _focus)} <mask> {...(isDisabled && _disabled)} <mask> {...(isInvalid && _invalid)} <mask> placeholderTextColor={useToken('colors', placeholderTextColor)} <mask> selectionColor={useToken('colors', selectionColor)} <mask> underlineColorAndroid={useToken('colors', underlineColorAndroid)} <mask> onKeyPress={(e: any) => { </s> fix: added readonly pseudo prop and alias to props </s> remove {...(isDisabled && _disabled)} </s> add </s> remove {InputLeftElement ? InputLeftElement : null} </s> add {InputLeftElement || leftElement ? InputLeftElement || leftElement : null} </s> remove {InputRightElement ? InputRightElement : null} </s> add {InputRightElement || rightElement ? InputRightElement || rightElement : null}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cce5a63b8eb023d33522f678b97686a7f464759a
src/components/primitives/Input/InputBase.tsx
{...(isDisabled && _disabled)}
<mask> {...(isReadOnly && _readOnly)} <mask> {...(isInvalid && _invalid)} <mask> placeholderTextColor={useToken('colors', placeholderTextColor)} <mask> selectionColor={useToken('colors', selectionColor)} <mask> underlineColorAndroid={useToken('colors', underlineColorAndroid)} <mask> onKeyPress={(e: any) => { <mask> e.persist(); </s> fix: added readonly pseudo prop and alias to props </s> remove {...(isDisabled && _disabled)} </s> add {...(isReadOnly && _readOnly)} </s> remove {...(isDisabled && _disabled)} </s> add </s> remove {InputLeftElement ? InputLeftElement : null} </s> add {InputLeftElement || leftElement ? InputLeftElement || leftElement : null}
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cce5a63b8eb023d33522f678b97686a7f464759a
src/components/primitives/Input/InputBase.tsx
* This will set aria-required="true" on web when passed in formcontrol.
<mask> * @default <code>md</code> <mask> */ <mask> size?: string; <mask> /** <mask> * <mask> */ <mask> isRequired?: boolean; <mask> /** <mask> * If true, prevents the value of the input from being edited. <mask> */ </s> fix: added readonly pseudo prop and alias to props </s> remove {...(isDisabled && _disabled)} </s> add {...(isReadOnly && _readOnly)}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cce5a63b8eb023d33522f678b97686a7f464759a
src/components/primitives/Input/types.ts
/** * If given, adds the provided element to the left of the input. */ leftElement?: JSX.Element | JSX.Element[];
<mask> /** <mask> * If given, adds the provided element to the left of the input. <mask> */ <mask> InputLeftElement?: JSX.Element | JSX.Element[]; <mask> /** <mask> * If given, adds the provided element to the right of the input. <mask> */ <mask> InputRightElement?: JSX.Element | JSX.Element[]; <mask> /** </s> fix: added readonly pseudo prop and alias to props </s> remove * </s> add * This will set aria-required="true" on web when passed in formcontrol. </s> remove {...(isDisabled && _disabled)} </s> add {...(isReadOnly && _readOnly)}
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cce5a63b8eb023d33522f678b97686a7f464759a
src/components/primitives/Input/types.ts
/** * If given, adds the provided element to the right of the input. */ rightElement?: JSX.Element | JSX.Element[];
<mask> /** <mask> * If given, adds the provided element to the right of the input. <mask> */ <mask> InputRightElement?: JSX.Element | JSX.Element[]; <mask> /** <mask> * Using the type password, user can mask the input. <mask> */ <mask> type?: 'text' | 'password' | string; <mask> /** </s> fix: added readonly pseudo prop and alias to props </s> remove * </s> add * This will set aria-required="true" on web when passed in formcontrol. </s> remove {...(isDisabled && _disabled)} </s> add {...(isReadOnly && _readOnly)}
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cce5a63b8eb023d33522f678b97686a7f464759a
src/components/primitives/Input/types.ts
/** * Passed props will be applied on readOnly state. */ _readOnly?: IInputProps;
<mask> /** <mask> * Passed props will be applied on disabled state. <mask> */ <mask> _disabled?: IInputProps; <mask> /** <mask> * Passed props will be applied on invalid state. <mask> */ <mask> _invalid?: IInputProps; <mask> // These porps are currently on hold </s> fix: added readonly pseudo prop and alias to props </s> remove * </s> add * This will set aria-required="true" on web when passed in formcontrol. </s> remove {...(isDisabled && _disabled)} </s> add {...(isReadOnly && _readOnly)}
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cce5a63b8eb023d33522f678b97686a7f464759a
src/components/primitives/Input/types.ts
import Spinner from '../Spinner';
<mask> import React from 'react'; <mask> import { <mask> TouchableOpacity, <mask> TouchableOpacityProps, <mask> Platform, <mask> } from 'react-native'; <mask> import styled from 'styled-components/native'; <mask> import { border, color, flexbox, layout, position, space } from 'styled-system'; <mask> import { useThemeProps } from '../../../hooks'; <mask> import { themeTools } from '../../../theme'; <mask> import { <mask> customBackground, <mask> customBorder, </s> fix: v3 change touchable opacity in button to pressable </s> remove import { themeTools } from '../../../theme'; import { customBackground, customBorder, customExtra, customLayout, customOutline, customPosition, customShadow, } from '../../../utils/customProps'; import Text from '../../primitives/Text'; </s> add </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box'; </s> remove const StyledButton = styled(TouchableOpacity)< IButtonProps & TouchableOpacityProps >( color, space, layout, flexbox, border, position, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customLayout ); </s> add </s> remove import { mergeRefs } from './mergeRefs'; </s> add import { mergeRefs, composeEventHandlers } from './mergeRefs';
[ "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
<mask> } from 'react-native'; <mask> import styled from 'styled-components/native'; <mask> import { border, color, flexbox, layout, position, space } from 'styled-system'; <mask> import { useThemeProps } from '../../../hooks'; <mask> import { themeTools } from '../../../theme'; <mask> import { <mask> customBackground, <mask> customBorder, <mask> customExtra, <mask> customLayout, <mask> customOutline, <mask> customPosition, <mask> customShadow, <mask> } from '../../../utils/customProps'; <mask> import Text from '../../primitives/Text'; <mask> import { default as Box, IBoxProps } from '../Box'; <mask> import Flex from '../Flex'; <mask> import Spinner from '../Spinner'; <mask> import type { IButtonGroupProps, IButtonProps } from './types'; <mask> </s> fix: v3 change touchable opacity in button to pressable </s> remove import { TouchableOpacity, TouchableOpacityProps, Platform, } from 'react-native'; import styled from 'styled-components/native'; import { border, color, flexbox, layout, position, space } from 'styled-system'; </s> add import Spinner from '../Spinner'; </s> remove import Flex from '../Flex'; import Spinner from '../Spinner'; </s> add import HStack from '../Stack/HStack'; import Pressable from '../Pressable'; </s> remove const StyledButton = styled(TouchableOpacity)< IButtonProps & TouchableOpacityProps >( color, space, layout, flexbox, border, position, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customLayout ); </s> add </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box';
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
import HStack from '../Stack/HStack'; import Pressable from '../Pressable';
<mask> customShadow, <mask> } from '../../../utils/customProps'; <mask> import Text from '../../primitives/Text'; <mask> import { default as Box, IBoxProps } from '../Box'; <mask> import Flex from '../Flex'; <mask> import Spinner from '../Spinner'; <mask> import type { IButtonGroupProps, IButtonProps } from './types'; <mask> <mask> const StyledButton = styled(TouchableOpacity)< <mask> IButtonProps & TouchableOpacityProps <mask> >( </s> fix: v3 change touchable opacity in button to pressable </s> remove import { themeTools } from '../../../theme'; import { customBackground, customBorder, customExtra, customLayout, customOutline, customPosition, customShadow, } from '../../../utils/customProps'; import Text from '../../primitives/Text'; </s> add </s> remove const StyledButton = styled(TouchableOpacity)< IButtonProps & TouchableOpacityProps >( color, space, layout, flexbox, border, position, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customLayout ); </s> add </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box'; </s> remove import { TouchableOpacity, TouchableOpacityProps, Platform, } from 'react-native'; import styled from 'styled-components/native'; import { border, color, flexbox, layout, position, space } from 'styled-system'; </s> add import Spinner from '../Spinner';
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
<mask> import Flex from '../Flex'; <mask> import Spinner from '../Spinner'; <mask> import type { IButtonGroupProps, IButtonProps } from './types'; <mask> <mask> const StyledButton = styled(TouchableOpacity)< <mask> IButtonProps & TouchableOpacityProps <mask> >( <mask> color, <mask> space, <mask> layout, <mask> flexbox, <mask> border, <mask> position, <mask> customPosition, <mask> customBorder, <mask> customBackground, <mask> customOutline, <mask> customShadow, <mask> customExtra, <mask> customLayout <mask> ); <mask> const Button = ( <mask> { <mask> style, <mask> children, <mask> highlight, </s> fix: v3 change touchable opacity in button to pressable </s> remove import { themeTools } from '../../../theme'; import { customBackground, customBorder, customExtra, customLayout, customOutline, customPosition, customShadow, } from '../../../utils/customProps'; import Text from '../../primitives/Text'; </s> add </s> remove import Flex from '../Flex'; import Spinner from '../Spinner'; </s> add import HStack from '../Stack/HStack'; import Pressable from '../Pressable'; </s> remove import { TouchableOpacity, TouchableOpacityProps, Platform, } from 'react-native'; import styled from 'styled-components/native'; import { border, color, flexbox, layout, position, space } from 'styled-system'; </s> add import Spinner from '../Spinner'; </s> remove style, </s> add </s> remove highlight, </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
<mask> customLayout <mask> ); <mask> const Button = ( <mask> { <mask> style, <mask> children, <mask> highlight, <mask> isLoading, <mask> isLoadingText, <mask> size, </s> fix: v3 change touchable opacity in button to pressable </s> remove highlight, </s> add </s> remove const StyledButton = styled(TouchableOpacity)< IButtonProps & TouchableOpacityProps >( color, space, layout, flexbox, border, position, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customLayout ); </s> add </s> remove const { _text, ...newProps } = useThemeProps('Button', { </s> add const { _text, _hover, _pressed, ...newProps } = useThemeProps('Button', {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
<mask> const Button = ( <mask> { <mask> style, <mask> children, <mask> highlight, <mask> isLoading, <mask> isLoadingText, <mask> size, <mask> startIcon, <mask> endIcon, </s> fix: v3 change touchable opacity in button to pressable </s> remove style, </s> add </s> remove const StyledButton = styled(TouchableOpacity)< IButtonProps & TouchableOpacityProps >( color, space, layout, flexbox, border, position, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customLayout ); </s> add </s> remove const { _text, ...newProps } = useThemeProps('Button', { </s> add const { _text, _hover, _pressed, ...newProps } = useThemeProps('Button', {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
accessibilityLabel, accessibilityHint, accessibilityState, accessibilityRole,
<mask> isLoading, <mask> isLoadingText, <mask> size, <mask> startIcon, <mask> onPress, <mask> onLongPress, <mask> onPressIn, <mask> onPressOut, </s> fix: v3 change touchable opacity in button to pressable </s> remove highlight, </s> add </s> remove style, </s> add </s> remove const { _text, ...newProps } = useThemeProps('Button', { </s> add const { _text, _hover, _pressed, ...newProps } = useThemeProps('Button', { </s> remove const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ 'm', 'margin', 'mt', 'marginTop', 'mr', 'marginRight', 'mb', 'marginBottom', 'ml', 'marginLeft', 'mx', 'marginX', 'my', 'marginY', 'left', 'top', 'bottom', 'right', 'position', 'zIndex', 'minH', 'minHeight', 'minWidth', 'minW', 'h', 'height', 'w', 'width', 'opacity', ]); const [commonProps] = themeTools.extractInObject(layoutProps, [ 'minH', 'minHeight', 'minWidth', 'minW', 'height', 'width', ]); const [ accessibilityProps, innerButtonProps, ] = themeTools.extractInObject(viewProps, [ 'accessible', 'accessibilityRole', 'accessibilityState', 'accessibilityLabel', 'accessibilityHint', 'isDisabled', 'onPress', ]); accessibilityProps.isDisabled = accessibilityProps.isDisabled || isLoading; const innerButton = ( <Box {...innerButtonProps} {...commonProps}> {startIcon ? ( <Box mr={Math.floor(innerButtonProps.px / 2) || 2}>{startIcon}</Box> ) : null} {isLoading ? ( <Flex direction="row"> {spinner ? spinner : <Spinner color={_text?.color} size="sm" />} <Text {..._text}>{isLoadingText ? ' ' + isLoadingText : ''}</Text> </Flex> ) : React.Children.count(children) > 1 || typeof children !== 'string' ? ( children ) : ( <Text {..._text}>{children}</Text> )} {endIcon ? ( <Box ml={Math.floor(innerButtonProps.px / 2) || 2}>{endIcon}</Box> ) : null} </Box> ); </s> add const { isDisabled } = props; const { pressableProps, isHovered } = useHover(); const { pressableProps: isPressedProps, isPressed } = useIsPressed(); const themeProps = { ...newProps, ...(isHovered && _hover), ...(isPressed && _pressed), }; // const shadowProps = useToken('shadows', themeProps.shadow); const theme = useTheme(); const shadowProps = theme.shadows()[themeProps.shadow]; themeProps.shadow = undefined;
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
onPress, onLongPress, onPressIn, onPressOut, onHoverIn, onHoverOut,
<mask> accessibilityState, <mask> accessibilityRole, <mask> size, <mask> startIcon, <mask> endIcon, <mask> spinner, <mask> ...props <mask> }: IButtonProps & IBoxProps, <mask> ref: any <mask> ) => { </s> fix: v3 change touchable opacity in button to pressable </s> remove const { _text, ...newProps } = useThemeProps('Button', { </s> add const { _text, _hover, _pressed, ...newProps } = useThemeProps('Button', { </s> remove highlight, </s> add </s> remove const StyledButton = styled(TouchableOpacity)< IButtonProps & TouchableOpacityProps >( color, space, layout, flexbox, border, position, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customLayout ); </s> add </s> remove import Flex from '../Flex'; import Spinner from '../Spinner'; </s> add import HStack from '../Stack/HStack'; import Pressable from '../Pressable';
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
const { _text, _hover, _pressed, ...newProps } = useThemeProps('Button', {
<mask> ...props <mask> }: IButtonProps & IBoxProps, <mask> ref: any <mask> ) => { <mask> const { _text, ...newProps } = useThemeProps('Button', { <mask> ...props, <mask> size, <mask> }); <mask> <mask> const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ </s> fix: v3 change touchable opacity in button to pressable </s> remove const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ 'm', 'margin', 'mt', 'marginTop', 'mr', 'marginRight', 'mb', 'marginBottom', 'ml', 'marginLeft', 'mx', 'marginX', 'my', 'marginY', 'left', 'top', 'bottom', 'right', 'position', 'zIndex', 'minH', 'minHeight', 'minWidth', 'minW', 'h', 'height', 'w', 'width', 'opacity', ]); const [commonProps] = themeTools.extractInObject(layoutProps, [ 'minH', 'minHeight', 'minWidth', 'minW', 'height', 'width', ]); const [ accessibilityProps, innerButtonProps, ] = themeTools.extractInObject(viewProps, [ 'accessible', 'accessibilityRole', 'accessibilityState', 'accessibilityLabel', 'accessibilityHint', 'isDisabled', 'onPress', ]); accessibilityProps.isDisabled = accessibilityProps.isDisabled || isLoading; const innerButton = ( <Box {...innerButtonProps} {...commonProps}> {startIcon ? ( <Box mr={Math.floor(innerButtonProps.px / 2) || 2}>{startIcon}</Box> ) : null} {isLoading ? ( <Flex direction="row"> {spinner ? spinner : <Spinner color={_text?.color} size="sm" />} <Text {..._text}>{isLoadingText ? ' ' + isLoadingText : ''}</Text> </Flex> ) : React.Children.count(children) > 1 || typeof children !== 'string' ? ( children ) : ( <Text {..._text}>{children}</Text> )} {endIcon ? ( <Box ml={Math.floor(innerButtonProps.px / 2) || 2}>{endIcon}</Box> ) : null} </Box> ); </s> add const { isDisabled } = props; const { pressableProps, isHovered } = useHover(); const { pressableProps: isPressedProps, isPressed } = useIsPressed(); const themeProps = { ...newProps, ...(isHovered && _hover), ...(isPressed && _pressed), }; // const shadowProps = useToken('shadows', themeProps.shadow); const theme = useTheme(); const shadowProps = theme.shadows()[themeProps.shadow]; themeProps.shadow = undefined; </s> remove const StyledButton = styled(TouchableOpacity)< IButtonProps & TouchableOpacityProps >( color, space, layout, flexbox, border, position, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customLayout ); </s> add </s> remove import Flex from '../Flex'; import Spinner from '../Spinner'; </s> add import HStack from '../Stack/HStack'; import Pressable from '../Pressable'; </s> remove const StyledStack = styled(View)<IStackProps>({}); export type IStackProps = IViewProps & { children: JSX.Element[] | JSX.Element; </s> add export type IStackProps = IBoxProps & { children: React.ReactNode[];
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
const { isDisabled } = props; const { pressableProps, isHovered } = useHover(); const { pressableProps: isPressedProps, isPressed } = useIsPressed(); const themeProps = { ...newProps, ...(isHovered && _hover), ...(isPressed && _pressed), }; // const shadowProps = useToken('shadows', themeProps.shadow); const theme = useTheme(); const shadowProps = theme.shadows()[themeProps.shadow]; themeProps.shadow = undefined;
<mask> ...props, <mask> size, <mask> }); <mask> <mask> const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ <mask> 'm', <mask> 'margin', <mask> 'mt', <mask> 'marginTop', <mask> 'mr', <mask> 'marginRight', <mask> 'mb', <mask> 'marginBottom', <mask> 'ml', <mask> 'marginLeft', <mask> 'mx', <mask> 'marginX', <mask> 'my', <mask> 'marginY', <mask> 'left', <mask> 'top', <mask> 'bottom', <mask> 'right', <mask> 'position', <mask> 'zIndex', <mask> 'minH', <mask> 'minHeight', <mask> 'minWidth', <mask> 'minW', <mask> 'h', <mask> 'height', <mask> 'w', <mask> 'width', <mask> 'opacity', <mask> ]); <mask> const [commonProps] = themeTools.extractInObject(layoutProps, [ <mask> 'minH', <mask> 'minHeight', <mask> 'minWidth', <mask> 'minW', <mask> 'height', <mask> 'width', <mask> ]); <mask> const [ <mask> accessibilityProps, <mask> innerButtonProps, <mask> ] = themeTools.extractInObject(viewProps, [ <mask> 'accessible', <mask> 'accessibilityRole', <mask> 'accessibilityState', <mask> 'accessibilityLabel', <mask> 'accessibilityHint', <mask> 'isDisabled', <mask> 'onPress', <mask> ]); <mask> accessibilityProps.isDisabled = accessibilityProps.isDisabled || isLoading; <mask> const innerButton = ( <mask> <Box {...innerButtonProps} {...commonProps}> <mask> {startIcon ? ( <mask> <Box mr={Math.floor(innerButtonProps.px / 2) || 2}>{startIcon}</Box> <mask> ) : null} <mask> {isLoading ? ( <mask> <Flex direction="row"> <mask> {spinner ? spinner : <Spinner color={_text?.color} size="sm" />} <mask> <Text {..._text}>{isLoadingText ? ' ' + isLoadingText : ''}</Text> <mask> </Flex> <mask> ) : React.Children.count(children) > 1 || typeof children !== 'string' ? ( <mask> children <mask> ) : ( <mask> <Text {..._text}>{children}</Text> <mask> )} <mask> {endIcon ? ( <mask> <Box ml={Math.floor(innerButtonProps.px / 2) || 2}>{endIcon}</Box> <mask> ) : null} <mask> </Box> <mask> ); <mask> <mask> return ( <mask> <StyledButton <mask> activeOpacity={highlight ? highlight : 0.2} <mask> ref={ref} </s> fix: v3 change touchable opacity in button to pressable </s> remove {innerButton} </StyledButton> </s> add <HStack opacity={isDisabled ? 0.7 : undefined} space={2}> {startIcon && !isLoading ? startIcon : null} {isLoading ? ( spinner ? ( spinner ) : ( <Spinner color={_text?.color} size="sm" /> ) ) : null} <Box _text={_text}> {isLoading && isLoadingText ? isLoadingText : children} </Box> {endIcon && !isLoading ? endIcon : null} </HStack> </Pressable> </s> remove <StyledButton activeOpacity={highlight ? highlight : 0.2} </s> add <Pressable onPress={onPress} onLongPress={onLongPress} onPressIn={composeEventHandlers(onPressIn, isPressedProps.onPressIn)} onPressOut={composeEventHandlers(onPressOut, isPressedProps.onPressOut)} disabled={isDisabled} </s> remove style={style} accessibilityRole="button" disabled={accessibilityProps.isDisabled} opacity={isLoading ? 0.8 : accessibilityProps.isDisabled ? 0.5 : 1} {...accessibilityProps} {...layoutProps} {...(Platform.OS === 'web' ? { cursor: accessibilityProps.isDisabled ? 'not-allowed' : 'auto', } : {})} </s> add accessibilityHint={accessibilityHint} accessibilityRole={accessibilityRole ?? 'button'} accessibilityState={accessibilityState} accessibilityLabel={accessibilityLabel} // @ts-ignore - web only onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)} // @ts-ignore - web only onHoverOut={composeEventHandlers(onHoverOut, pressableProps.onHoverOut)} {...themeProps} style={{ ...shadowProps }} </s> remove const { _text, ...newProps } = useThemeProps('Button', { </s> add const { _text, _hover, _pressed, ...newProps } = useThemeProps('Button', { </s> remove <StyledStack flexDirection={direction} {...newProps} ref={ref}> </s> add <Box flexDirection={direction} {...newProps} ref={ref}>
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
<Pressable onPress={onPress} onLongPress={onLongPress} onPressIn={composeEventHandlers(onPressIn, isPressedProps.onPressIn)} onPressOut={composeEventHandlers(onPressOut, isPressedProps.onPressOut)} disabled={isDisabled}
<mask> </Box> <mask> ); <mask> <mask> return ( <mask> <StyledButton <mask> activeOpacity={highlight ? highlight : 0.2} <mask> ref={ref} <mask> style={style} <mask> accessibilityRole="button" <mask> disabled={accessibilityProps.isDisabled} <mask> opacity={isLoading ? 0.8 : accessibilityProps.isDisabled ? 0.5 : 1} </s> fix: v3 change touchable opacity in button to pressable </s> remove style={style} accessibilityRole="button" disabled={accessibilityProps.isDisabled} opacity={isLoading ? 0.8 : accessibilityProps.isDisabled ? 0.5 : 1} {...accessibilityProps} {...layoutProps} {...(Platform.OS === 'web' ? { cursor: accessibilityProps.isDisabled ? 'not-allowed' : 'auto', } : {})} </s> add accessibilityHint={accessibilityHint} accessibilityRole={accessibilityRole ?? 'button'} accessibilityState={accessibilityState} accessibilityLabel={accessibilityLabel} // @ts-ignore - web only onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)} // @ts-ignore - web only onHoverOut={composeEventHandlers(onHoverOut, pressableProps.onHoverOut)} {...themeProps} style={{ ...shadowProps }} </s> remove const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ 'm', 'margin', 'mt', 'marginTop', 'mr', 'marginRight', 'mb', 'marginBottom', 'ml', 'marginLeft', 'mx', 'marginX', 'my', 'marginY', 'left', 'top', 'bottom', 'right', 'position', 'zIndex', 'minH', 'minHeight', 'minWidth', 'minW', 'h', 'height', 'w', 'width', 'opacity', ]); const [commonProps] = themeTools.extractInObject(layoutProps, [ 'minH', 'minHeight', 'minWidth', 'minW', 'height', 'width', ]); const [ accessibilityProps, innerButtonProps, ] = themeTools.extractInObject(viewProps, [ 'accessible', 'accessibilityRole', 'accessibilityState', 'accessibilityLabel', 'accessibilityHint', 'isDisabled', 'onPress', ]); accessibilityProps.isDisabled = accessibilityProps.isDisabled || isLoading; const innerButton = ( <Box {...innerButtonProps} {...commonProps}> {startIcon ? ( <Box mr={Math.floor(innerButtonProps.px / 2) || 2}>{startIcon}</Box> ) : null} {isLoading ? ( <Flex direction="row"> {spinner ? spinner : <Spinner color={_text?.color} size="sm" />} <Text {..._text}>{isLoadingText ? ' ' + isLoadingText : ''}</Text> </Flex> ) : React.Children.count(children) > 1 || typeof children !== 'string' ? ( children ) : ( <Text {..._text}>{children}</Text> )} {endIcon ? ( <Box ml={Math.floor(innerButtonProps.px / 2) || 2}>{endIcon}</Box> ) : null} </Box> ); </s> add const { isDisabled } = props; const { pressableProps, isHovered } = useHover(); const { pressableProps: isPressedProps, isPressed } = useIsPressed(); const themeProps = { ...newProps, ...(isHovered && _hover), ...(isPressed && _pressed), }; // const shadowProps = useToken('shadows', themeProps.shadow); const theme = useTheme(); const shadowProps = theme.shadows()[themeProps.shadow]; themeProps.shadow = undefined; </s> remove {innerButton} </StyledButton> </s> add <HStack opacity={isDisabled ? 0.7 : undefined} space={2}> {startIcon && !isLoading ? startIcon : null} {isLoading ? ( spinner ? ( spinner ) : ( <Spinner color={_text?.color} size="sm" /> ) ) : null} <Box _text={_text}> {isLoading && isLoadingText ? isLoadingText : children} </Box> {endIcon && !isLoading ? endIcon : null} </HStack> </Pressable> </s> remove </StyledStack> </s> add </Box> </s> remove <StyledStack flexDirection={direction} {...newProps} ref={ref}> </s> add <Box flexDirection={direction} {...newProps} ref={ref}>
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
accessibilityHint={accessibilityHint} accessibilityRole={accessibilityRole ?? 'button'} accessibilityState={accessibilityState} accessibilityLabel={accessibilityLabel} // @ts-ignore - web only onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)} // @ts-ignore - web only onHoverOut={composeEventHandlers(onHoverOut, pressableProps.onHoverOut)} {...themeProps} style={{ ...shadowProps }}
<mask> return ( <mask> <StyledButton <mask> activeOpacity={highlight ? highlight : 0.2} <mask> ref={ref} <mask> style={style} <mask> accessibilityRole="button" <mask> disabled={accessibilityProps.isDisabled} <mask> opacity={isLoading ? 0.8 : accessibilityProps.isDisabled ? 0.5 : 1} <mask> {...accessibilityProps} <mask> {...layoutProps} <mask> {...(Platform.OS === 'web' <mask> ? { <mask> cursor: accessibilityProps.isDisabled ? 'not-allowed' : 'auto', <mask> } <mask> : {})} <mask> > <mask> {innerButton} <mask> </StyledButton> <mask> ); <mask> }; </s> fix: v3 change touchable opacity in button to pressable </s> remove <StyledButton activeOpacity={highlight ? highlight : 0.2} </s> add <Pressable onPress={onPress} onLongPress={onLongPress} onPressIn={composeEventHandlers(onPressIn, isPressedProps.onPressIn)} onPressOut={composeEventHandlers(onPressOut, isPressedProps.onPressOut)} disabled={isDisabled} </s> remove {innerButton} </StyledButton> </s> add <HStack opacity={isDisabled ? 0.7 : undefined} space={2}> {startIcon && !isLoading ? startIcon : null} {isLoading ? ( spinner ? ( spinner ) : ( <Spinner color={_text?.color} size="sm" /> ) ) : null} <Box _text={_text}> {isLoading && isLoadingText ? isLoadingText : children} </Box> {endIcon && !isLoading ? endIcon : null} </HStack> </Pressable> </s> remove const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ 'm', 'margin', 'mt', 'marginTop', 'mr', 'marginRight', 'mb', 'marginBottom', 'ml', 'marginLeft', 'mx', 'marginX', 'my', 'marginY', 'left', 'top', 'bottom', 'right', 'position', 'zIndex', 'minH', 'minHeight', 'minWidth', 'minW', 'h', 'height', 'w', 'width', 'opacity', ]); const [commonProps] = themeTools.extractInObject(layoutProps, [ 'minH', 'minHeight', 'minWidth', 'minW', 'height', 'width', ]); const [ accessibilityProps, innerButtonProps, ] = themeTools.extractInObject(viewProps, [ 'accessible', 'accessibilityRole', 'accessibilityState', 'accessibilityLabel', 'accessibilityHint', 'isDisabled', 'onPress', ]); accessibilityProps.isDisabled = accessibilityProps.isDisabled || isLoading; const innerButton = ( <Box {...innerButtonProps} {...commonProps}> {startIcon ? ( <Box mr={Math.floor(innerButtonProps.px / 2) || 2}>{startIcon}</Box> ) : null} {isLoading ? ( <Flex direction="row"> {spinner ? spinner : <Spinner color={_text?.color} size="sm" />} <Text {..._text}>{isLoadingText ? ' ' + isLoadingText : ''}</Text> </Flex> ) : React.Children.count(children) > 1 || typeof children !== 'string' ? ( children ) : ( <Text {..._text}>{children}</Text> )} {endIcon ? ( <Box ml={Math.floor(innerButtonProps.px / 2) || 2}>{endIcon}</Box> ) : null} </Box> ); </s> add const { isDisabled } = props; const { pressableProps, isHovered } = useHover(); const { pressableProps: isPressedProps, isPressed } = useIsPressed(); const themeProps = { ...newProps, ...(isHovered && _hover), ...(isPressed && _pressed), }; // const shadowProps = useToken('shadows', themeProps.shadow); const theme = useTheme(); const shadowProps = theme.shadows()[themeProps.shadow]; themeProps.shadow = undefined; </s> remove </StyledStack> </s> add </Box> </s> remove <StyledStack flexDirection={direction} {...newProps} ref={ref}> </s> add <Box flexDirection={direction} {...newProps} ref={ref}>
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
<HStack opacity={isDisabled ? 0.7 : undefined} space={2}> {startIcon && !isLoading ? startIcon : null} {isLoading ? ( spinner ? ( spinner ) : ( <Spinner color={_text?.color} size="sm" /> ) ) : null} <Box _text={_text}> {isLoading && isLoadingText ? isLoadingText : children} </Box> {endIcon && !isLoading ? endIcon : null} </HStack> </Pressable>
<mask> cursor: accessibilityProps.isDisabled ? 'not-allowed' : 'auto', <mask> } <mask> : {})} <mask> > <mask> {innerButton} <mask> </StyledButton> <mask> ); <mask> }; <mask> <mask> // TODO: Move this to Button.Group <mask> export { ButtonGroup } from './ButtonGroup'; </s> fix: v3 change touchable opacity in button to pressable </s> remove style={style} accessibilityRole="button" disabled={accessibilityProps.isDisabled} opacity={isLoading ? 0.8 : accessibilityProps.isDisabled ? 0.5 : 1} {...accessibilityProps} {...layoutProps} {...(Platform.OS === 'web' ? { cursor: accessibilityProps.isDisabled ? 'not-allowed' : 'auto', } : {})} </s> add accessibilityHint={accessibilityHint} accessibilityRole={accessibilityRole ?? 'button'} accessibilityState={accessibilityState} accessibilityLabel={accessibilityLabel} // @ts-ignore - web only onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)} // @ts-ignore - web only onHoverOut={composeEventHandlers(onHoverOut, pressableProps.onHoverOut)} {...themeProps} style={{ ...shadowProps }} </s> remove </StyledStack> </s> add </Box> </s> remove const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ 'm', 'margin', 'mt', 'marginTop', 'mr', 'marginRight', 'mb', 'marginBottom', 'ml', 'marginLeft', 'mx', 'marginX', 'my', 'marginY', 'left', 'top', 'bottom', 'right', 'position', 'zIndex', 'minH', 'minHeight', 'minWidth', 'minW', 'h', 'height', 'w', 'width', 'opacity', ]); const [commonProps] = themeTools.extractInObject(layoutProps, [ 'minH', 'minHeight', 'minWidth', 'minW', 'height', 'width', ]); const [ accessibilityProps, innerButtonProps, ] = themeTools.extractInObject(viewProps, [ 'accessible', 'accessibilityRole', 'accessibilityState', 'accessibilityLabel', 'accessibilityHint', 'isDisabled', 'onPress', ]); accessibilityProps.isDisabled = accessibilityProps.isDisabled || isLoading; const innerButton = ( <Box {...innerButtonProps} {...commonProps}> {startIcon ? ( <Box mr={Math.floor(innerButtonProps.px / 2) || 2}>{startIcon}</Box> ) : null} {isLoading ? ( <Flex direction="row"> {spinner ? spinner : <Spinner color={_text?.color} size="sm" />} <Text {..._text}>{isLoadingText ? ' ' + isLoadingText : ''}</Text> </Flex> ) : React.Children.count(children) > 1 || typeof children !== 'string' ? ( children ) : ( <Text {..._text}>{children}</Text> )} {endIcon ? ( <Box ml={Math.floor(innerButtonProps.px / 2) || 2}>{endIcon}</Box> ) : null} </Box> ); </s> add const { isDisabled } = props; const { pressableProps, isHovered } = useHover(); const { pressableProps: isPressedProps, isPressed } = useIsPressed(); const themeProps = { ...newProps, ...(isHovered && _hover), ...(isPressed && _pressed), }; // const shadowProps = useToken('shadows', themeProps.shadow); const theme = useTheme(); const shadowProps = theme.shadows()[themeProps.shadow]; themeProps.shadow = undefined; </s> remove <StyledButton activeOpacity={highlight ? highlight : 0.2} </s> add <Pressable onPress={onPress} onLongPress={onLongPress} onPressIn={composeEventHandlers(onPressIn, isPressedProps.onPressIn)} onPressOut={composeEventHandlers(onPressOut, isPressedProps.onPressOut)} disabled={isDisabled}
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/index.tsx
<mask> customBackgroundProps & <mask> IAccessibilityProps & { <mask> style?: ViewStyle; <mask> children?: any; <mask> highlight?: number | 0 | 1 | 0.5 | 0.25 | 0.75; <mask> colorScheme?: string; <mask> variant?: string; <mask> isLoading?: any; <mask> size?: 'xs' | 'sm' | 'md' | 'lg'; <mask> onPress?: any; </s> fix: v3 change touchable opacity in button to pressable </s> remove const StyledStack = styled(View)<IStackProps>({}); export type IStackProps = IViewProps & { children: JSX.Element[] | JSX.Element; </s> add export type IStackProps = IBoxProps & { children: React.ReactNode[]; </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/types.ts
onLongPress?: any; onPressIn?: any; onPressOut?: any; onHoverIn?: any; onHoverOut?: any;
<mask> variant?: string; <mask> isLoading?: any; <mask> size?: 'xs' | 'sm' | 'md' | 'lg'; <mask> onPress?: any; <mask> shadow?: number; <mask> startIcon?: JSX.Element | Array<JSX.Element>; <mask> endIcon?: JSX.Element | Array<JSX.Element>; <mask> isLoadingText?: string; <mask> spinner?: JSX.Element; </s> fix: v3 change touchable opacity in button to pressable </s> remove highlight?: number | 0 | 1 | 0.5 | 0.25 | 0.75; </s> add </s> remove const StyledStack = styled(View)<IStackProps>({}); export type IStackProps = IViewProps & { children: JSX.Element[] | JSX.Element; </s> add export type IStackProps = IBoxProps & { children: React.ReactNode[]; </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box';
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Button/types.ts
import { default as Box } from '../Box';
<mask> import React from 'react'; <mask> import styled from 'styled-components/native'; <mask> import { IViewProps, default as View } from '../View'; <mask> import { getSpacedChildren } from '../../../utils'; <mask> import { useThemeProps } from '../../../hooks'; <mask> <mask> type SpaceType = 'gutter' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; <mask> </s> fix: v3 change touchable opacity in button to pressable </s> remove const StyledStack = styled(View)<IStackProps>({}); export type IStackProps = IViewProps & { children: JSX.Element[] | JSX.Element; </s> add export type IStackProps = IBoxProps & { children: React.ReactNode[]; </s> remove import { TouchableOpacity, TouchableOpacityProps, Platform, } from 'react-native'; import styled from 'styled-components/native'; import { border, color, flexbox, layout, position, space } from 'styled-system'; </s> add import Spinner from '../Spinner'; </s> remove highlight?: number | 0 | 1 | 0.5 | 0.25 | 0.75; </s> add </s> remove import { themeTools } from '../../../theme'; import { customBackground, customBorder, customExtra, customLayout, customOutline, customPosition, customShadow, } from '../../../utils/customProps'; import Text from '../../primitives/Text'; </s> add
[ "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Stack/Stack.tsx
import type { IBoxProps } from '../Box';
<mask> import { default as Box } from '../Box'; <mask> import { getSpacedChildren } from '../../../utils'; <mask> import { useThemeProps } from '../../../hooks'; <mask> <mask> type SpaceType = 'gutter' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; <mask> <mask> export type IStackProps = IBoxProps & { <mask> children: React.ReactNode[]; </s> fix: v3 change touchable opacity in button to pressable </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box'; </s> remove const StyledStack = styled(View)<IStackProps>({}); export type IStackProps = IViewProps & { children: JSX.Element[] | JSX.Element; </s> add export type IStackProps = IBoxProps & { children: React.ReactNode[]; </s> remove highlight?: number | 0 | 1 | 0.5 | 0.25 | 0.75; </s> add </s> remove import { themeTools } from '../../../theme'; import { customBackground, customBorder, customExtra, customLayout, customOutline, customPosition, customShadow, } from '../../../utils/customProps'; import Text from '../../primitives/Text'; </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Stack/Stack.tsx
export type IStackProps = IBoxProps & { children: React.ReactNode[];
<mask> import { useThemeProps } from '../../../hooks'; <mask> <mask> type SpaceType = 'gutter' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; <mask> <mask> const StyledStack = styled(View)<IStackProps>({}); <mask> export type IStackProps = IViewProps & { <mask> children: JSX.Element[] | JSX.Element; <mask> divider?: JSX.Element; <mask> space?: number | SpaceType; <mask> reversed?: boolean; <mask> }; <mask> const Stack = ( </s> fix: v3 change touchable opacity in button to pressable </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box'; </s> remove highlight?: number | 0 | 1 | 0.5 | 0.25 | 0.75; </s> add </s> remove const StyledButton = styled(TouchableOpacity)< IButtonProps & TouchableOpacityProps >( color, space, layout, flexbox, border, position, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customLayout ); </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Stack/Stack.tsx
console.log('mancn', newProps);
<mask> } = props; <mask> const newProps: any = useThemeProps('Stack', remainingProps); <mask> <mask> return ( <mask> <Box flexDirection={direction} {...newProps} ref={ref}> <mask> {getSpacedChildren( <mask> children, <mask> space, </s> fix: v3 change touchable opacity in button to pressable </s> remove <StyledStack flexDirection={direction} {...newProps} ref={ref}> </s> add <Box flexDirection={direction} {...newProps} ref={ref}> </s> remove const StyledButton = styled(TouchableOpacity)< IButtonProps & TouchableOpacityProps >( color, space, layout, flexbox, border, position, customPosition, customBorder, customBackground, customOutline, customShadow, customExtra, customLayout ); </s> add </s> remove const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ 'm', 'margin', 'mt', 'marginTop', 'mr', 'marginRight', 'mb', 'marginBottom', 'ml', 'marginLeft', 'mx', 'marginX', 'my', 'marginY', 'left', 'top', 'bottom', 'right', 'position', 'zIndex', 'minH', 'minHeight', 'minWidth', 'minW', 'h', 'height', 'w', 'width', 'opacity', ]); const [commonProps] = themeTools.extractInObject(layoutProps, [ 'minH', 'minHeight', 'minWidth', 'minW', 'height', 'width', ]); const [ accessibilityProps, innerButtonProps, ] = themeTools.extractInObject(viewProps, [ 'accessible', 'accessibilityRole', 'accessibilityState', 'accessibilityLabel', 'accessibilityHint', 'isDisabled', 'onPress', ]); accessibilityProps.isDisabled = accessibilityProps.isDisabled || isLoading; const innerButton = ( <Box {...innerButtonProps} {...commonProps}> {startIcon ? ( <Box mr={Math.floor(innerButtonProps.px / 2) || 2}>{startIcon}</Box> ) : null} {isLoading ? ( <Flex direction="row"> {spinner ? spinner : <Spinner color={_text?.color} size="sm" />} <Text {..._text}>{isLoadingText ? ' ' + isLoadingText : ''}</Text> </Flex> ) : React.Children.count(children) > 1 || typeof children !== 'string' ? ( children ) : ( <Text {..._text}>{children}</Text> )} {endIcon ? ( <Box ml={Math.floor(innerButtonProps.px / 2) || 2}>{endIcon}</Box> ) : null} </Box> ); </s> add const { isDisabled } = props; const { pressableProps, isHovered } = useHover(); const { pressableProps: isPressedProps, isPressed } = useIsPressed(); const themeProps = { ...newProps, ...(isHovered && _hover), ...(isPressed && _pressed), }; // const shadowProps = useToken('shadows', themeProps.shadow); const theme = useTheme(); const shadowProps = theme.shadows()[themeProps.shadow]; themeProps.shadow = undefined; </s> remove const { _text, ...newProps } = useThemeProps('Button', { </s> add const { _text, _hover, _pressed, ...newProps } = useThemeProps('Button', { </s> remove style, </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Stack/Stack.tsx
<Box flexDirection={direction} {...newProps} ref={ref}>
<mask> } = props; <mask> const newProps: any = useThemeProps('Stack', remainingProps); <mask> <mask> return ( <mask> <StyledStack flexDirection={direction} {...newProps} ref={ref}> <mask> {getSpacedChildren( <mask> children, <mask> space, <mask> direction === 'row' ? 'X' : 'Y', <mask> reversed ? 'reverse' : 'normal', </s> fix: v3 change touchable opacity in button to pressable </s> remove </StyledStack> </s> add </Box> </s> remove const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ 'm', 'margin', 'mt', 'marginTop', 'mr', 'marginRight', 'mb', 'marginBottom', 'ml', 'marginLeft', 'mx', 'marginX', 'my', 'marginY', 'left', 'top', 'bottom', 'right', 'position', 'zIndex', 'minH', 'minHeight', 'minWidth', 'minW', 'h', 'height', 'w', 'width', 'opacity', ]); const [commonProps] = themeTools.extractInObject(layoutProps, [ 'minH', 'minHeight', 'minWidth', 'minW', 'height', 'width', ]); const [ accessibilityProps, innerButtonProps, ] = themeTools.extractInObject(viewProps, [ 'accessible', 'accessibilityRole', 'accessibilityState', 'accessibilityLabel', 'accessibilityHint', 'isDisabled', 'onPress', ]); accessibilityProps.isDisabled = accessibilityProps.isDisabled || isLoading; const innerButton = ( <Box {...innerButtonProps} {...commonProps}> {startIcon ? ( <Box mr={Math.floor(innerButtonProps.px / 2) || 2}>{startIcon}</Box> ) : null} {isLoading ? ( <Flex direction="row"> {spinner ? spinner : <Spinner color={_text?.color} size="sm" />} <Text {..._text}>{isLoadingText ? ' ' + isLoadingText : ''}</Text> </Flex> ) : React.Children.count(children) > 1 || typeof children !== 'string' ? ( children ) : ( <Text {..._text}>{children}</Text> )} {endIcon ? ( <Box ml={Math.floor(innerButtonProps.px / 2) || 2}>{endIcon}</Box> ) : null} </Box> ); </s> add const { isDisabled } = props; const { pressableProps, isHovered } = useHover(); const { pressableProps: isPressedProps, isPressed } = useIsPressed(); const themeProps = { ...newProps, ...(isHovered && _hover), ...(isPressed && _pressed), }; // const shadowProps = useToken('shadows', themeProps.shadow); const theme = useTheme(); const shadowProps = theme.shadows()[themeProps.shadow]; themeProps.shadow = undefined; </s> remove style={style} accessibilityRole="button" disabled={accessibilityProps.isDisabled} opacity={isLoading ? 0.8 : accessibilityProps.isDisabled ? 0.5 : 1} {...accessibilityProps} {...layoutProps} {...(Platform.OS === 'web' ? { cursor: accessibilityProps.isDisabled ? 'not-allowed' : 'auto', } : {})} </s> add accessibilityHint={accessibilityHint} accessibilityRole={accessibilityRole ?? 'button'} accessibilityState={accessibilityState} accessibilityLabel={accessibilityLabel} // @ts-ignore - web only onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)} // @ts-ignore - web only onHoverOut={composeEventHandlers(onHoverOut, pressableProps.onHoverOut)} {...themeProps} style={{ ...shadowProps }} </s> remove <StyledButton activeOpacity={highlight ? highlight : 0.2} </s> add <Pressable onPress={onPress} onLongPress={onLongPress} onPressIn={composeEventHandlers(onPressIn, isPressedProps.onPressIn)} onPressOut={composeEventHandlers(onPressOut, isPressedProps.onPressOut)} disabled={isDisabled}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Stack/Stack.tsx
</Box>
<mask> direction === 'row' ? 'X' : 'Y', <mask> reversed ? 'reverse' : 'normal', <mask> divider <mask> )} <mask> </StyledStack> <mask> ); <mask> }; <mask> <mask> // Exporting this to use it inside HStack and VStack only, <mask> export { Stack as StackMain }; </s> fix: v3 change touchable opacity in button to pressable </s> remove <StyledStack flexDirection={direction} {...newProps} ref={ref}> </s> add <Box flexDirection={direction} {...newProps} ref={ref}> </s> remove {innerButton} </StyledButton> </s> add <HStack opacity={isDisabled ? 0.7 : undefined} space={2}> {startIcon && !isLoading ? startIcon : null} {isLoading ? ( spinner ? ( spinner ) : ( <Spinner color={_text?.color} size="sm" /> ) ) : null} <Box _text={_text}> {isLoading && isLoadingText ? isLoadingText : children} </Box> {endIcon && !isLoading ? endIcon : null} </HStack> </Pressable> </s> remove style={style} accessibilityRole="button" disabled={accessibilityProps.isDisabled} opacity={isLoading ? 0.8 : accessibilityProps.isDisabled ? 0.5 : 1} {...accessibilityProps} {...layoutProps} {...(Platform.OS === 'web' ? { cursor: accessibilityProps.isDisabled ? 'not-allowed' : 'auto', } : {})} </s> add accessibilityHint={accessibilityHint} accessibilityRole={accessibilityRole ?? 'button'} accessibilityState={accessibilityState} accessibilityLabel={accessibilityLabel} // @ts-ignore - web only onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)} // @ts-ignore - web only onHoverOut={composeEventHandlers(onHoverOut, pressableProps.onHoverOut)} {...themeProps} style={{ ...shadowProps }} </s> remove const [layoutProps, viewProps] = themeTools.extractInObject(newProps, [ 'm', 'margin', 'mt', 'marginTop', 'mr', 'marginRight', 'mb', 'marginBottom', 'ml', 'marginLeft', 'mx', 'marginX', 'my', 'marginY', 'left', 'top', 'bottom', 'right', 'position', 'zIndex', 'minH', 'minHeight', 'minWidth', 'minW', 'h', 'height', 'w', 'width', 'opacity', ]); const [commonProps] = themeTools.extractInObject(layoutProps, [ 'minH', 'minHeight', 'minWidth', 'minW', 'height', 'width', ]); const [ accessibilityProps, innerButtonProps, ] = themeTools.extractInObject(viewProps, [ 'accessible', 'accessibilityRole', 'accessibilityState', 'accessibilityLabel', 'accessibilityHint', 'isDisabled', 'onPress', ]); accessibilityProps.isDisabled = accessibilityProps.isDisabled || isLoading; const innerButton = ( <Box {...innerButtonProps} {...commonProps}> {startIcon ? ( <Box mr={Math.floor(innerButtonProps.px / 2) || 2}>{startIcon}</Box> ) : null} {isLoading ? ( <Flex direction="row"> {spinner ? spinner : <Spinner color={_text?.color} size="sm" />} <Text {..._text}>{isLoadingText ? ' ' + isLoadingText : ''}</Text> </Flex> ) : React.Children.count(children) > 1 || typeof children !== 'string' ? ( children ) : ( <Text {..._text}>{children}</Text> )} {endIcon ? ( <Box ml={Math.floor(innerButtonProps.px / 2) || 2}>{endIcon}</Box> ) : null} </Box> ); </s> add const { isDisabled } = props; const { pressableProps, isHovered } = useHover(); const { pressableProps: isPressedProps, isPressed } = useIsPressed(); const themeProps = { ...newProps, ...(isHovered && _hover), ...(isPressed && _pressed), }; // const shadowProps = useToken('shadows', themeProps.shadow); const theme = useTheme(); const shadowProps = theme.shadows()[themeProps.shadow]; themeProps.shadow = undefined;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/components/primitives/Stack/Stack.tsx
import { Dict, mode, transparentize } from './../tools';
<mask> import { Dict, mode } from './../tools'; <mask> <mask> const baseStyle = { <mask> borderRadius: 'md', <mask> display: 'flex', <mask> flexDirection: 'row', </s> fix: v3 change touchable opacity in button to pressable </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box'; </s> remove import Flex from '../Flex'; import Spinner from '../Spinner'; </s> add import HStack from '../Stack/HStack'; import Pressable from '../Pressable'; </s> remove import { mergeRefs } from './mergeRefs'; </s> add import { mergeRefs, composeEventHandlers } from './mergeRefs'; </s> remove import { TouchableOpacity, TouchableOpacityProps, Platform, } from 'react-native'; import styled from 'styled-components/native'; import { border, color, flexbox, layout, position, space } from 'styled-system'; </s> add import Spinner from '../Spinner';
[ "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/theme/components/button.ts
_hover: { backgroundColor: transparentize(`${c}.100`, 0.5)(props.theme), },
<mask> borderColor: <mask> c === 'muted' ? borderColor : mode(`${c}.500`, `${c}.200`)(props), <mask> ...variantGhost(props), <mask> }; <mask> } <mask> <mask> type AccessibleColor = { <mask> bg?: string; <mask> color?: string; </s> fix: v3 change touchable opacity in button to pressable </s> remove </StyledStack> </s> add </Box> </s> remove highlight?: number | 0 | 1 | 0.5 | 0.25 | 0.75; </s> add </s> remove <StyledStack flexDirection={direction} {...newProps} ref={ref}> </s> add <Box flexDirection={direction} {...newProps} ref={ref}> </s> remove style={style} accessibilityRole="button" disabled={accessibilityProps.isDisabled} opacity={isLoading ? 0.8 : accessibilityProps.isDisabled ? 0.5 : 1} {...accessibilityProps} {...layoutProps} {...(Platform.OS === 'web' ? { cursor: accessibilityProps.isDisabled ? 'not-allowed' : 'auto', } : {})} </s> add accessibilityHint={accessibilityHint} accessibilityRole={accessibilityRole ?? 'button'} accessibilityState={accessibilityState} accessibilityLabel={accessibilityLabel} // @ts-ignore - web only onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)} // @ts-ignore - web only onHoverOut={composeEventHandlers(onHoverOut, pressableProps.onHoverOut)} {...themeProps} style={{ ...shadowProps }}
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/theme/components/button.ts
_hover: { backgroundColor: `${c}.600`, }, _pressed: { backgroundColor: `${c}.700`, },
<mask> color: mode('white', 'black')(props), <mask> }, <mask> }; <mask> } <mask> <mask> function variantLink(props: Dict) { <mask> const { colorScheme: c } = props; </s> fix: v3 change touchable opacity in button to pressable </s> remove const { _text, ...newProps } = useThemeProps('Button', { </s> add const { _text, _hover, _pressed, ...newProps } = useThemeProps('Button', { </s> remove import { Dict, mode } from './../tools'; </s> add import { Dict, mode, transparentize } from './../tools';
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/theme/components/button.ts
import { mergeRefs, composeEventHandlers } from './mergeRefs';
<mask> import getAbsoluteChildren from './getAbsoluteChildren'; <mask> import getAttachedChildren from './getAttachedChildren'; <mask> import { addTextAndPropsToStrings } from './addTextAndPropsToStrings'; <mask> import { canUseDom } from './canUseDom'; <mask> import { mergeRefs } from './mergeRefs'; <mask> export { <mask> getSpacedChildren, <mask> getAbsoluteChildren, <mask> getAttachedChildren, <mask> addTextAndPropsToStrings, </s> fix: v3 change touchable opacity in button to pressable </s> remove import { TouchableOpacity, TouchableOpacityProps, Platform, } from 'react-native'; import styled from 'styled-components/native'; import { border, color, flexbox, layout, position, space } from 'styled-system'; </s> add import Spinner from '../Spinner'; </s> remove import { themeTools } from '../../../theme'; import { customBackground, customBorder, customExtra, customLayout, customOutline, customPosition, customShadow, } from '../../../utils/customProps'; import Text from '../../primitives/Text'; </s> add </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/utils/index.ts
composeEventHandlers,
<mask> getAttachedChildren, <mask> addTextAndPropsToStrings, <mask> canUseDom, <mask> mergeRefs, <mask> }; <mask> export type { IAccessibilityProps } from './accessibilityTypes'; <mask> export { ariaAttr } from './accessibilityUtils'; </s> fix: v3 change touchable opacity in button to pressable </s> remove import { mergeRefs } from './mergeRefs'; </s> add import { mergeRefs, composeEventHandlers } from './mergeRefs'; </s> remove const StyledStack = styled(View)<IStackProps>({}); export type IStackProps = IViewProps & { children: JSX.Element[] | JSX.Element; </s> add export type IStackProps = IBoxProps & { children: React.ReactNode[]; </s> remove import { themeTools } from '../../../theme'; import { customBackground, customBorder, customExtra, customLayout, customOutline, customPosition, customShadow, } from '../../../utils/customProps'; import Text from '../../primitives/Text'; </s> add </s> remove import styled from 'styled-components/native'; import { IViewProps, default as View } from '../View'; </s> add import { default as Box } from '../Box';
[ "keep", "keep", "keep", "add", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cda1a2811e4b83d469633f9988b678299c32e580
src/utils/index.ts
const { _wrap, ...resolvedProps } = usePropsResolution('Slider', props, {
<mask> props.onChangeEnd && props.onChangeEnd(val[0]); <mask> }, <mask> }); <mask> <mask> const resolvedProps = usePropsResolution('Slider', props, { <mask> isDisabled, <mask> isReadOnly, <mask> }); <mask> <mask> const { trackProps } = useSlider( </s> feat: adding pesudo internal Props in Slider </s> remove <Box {...wrapperStyle} ref={ref} {...resolvedProps}> </s> add <Box {..._wrap} ref={ref} {...resolvedProps}> </s> remove const wrapperStyle = { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }; </s> add </s> remove baseStyle: { alignItems: 'center', justifyContent: 'center', </s> add baseStyle: (props: any) => { return { alignItems: 'center', justifyContent: 'center', _wrap: { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }, }; </s> remove _wrap: { alignItems: 'center', justifyContent: 'center' }, </s> add _wrap: { alignItems: 'center', justifyContent: 'center', paddingY: props.orientation !== 'vertical' ? '3' : undefined, paddingX: props.orientation === 'vertical' ? '3' : undefined, },
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdc84de3ea0b4ce6e6250753f157367e9c68363b
src/components/primitives/Slider/Slider.tsx
<mask> state, <mask> trackLayout <mask> ); <mask> <mask> const wrapperStyle = { <mask> height: props.orientation === 'vertical' ? '100%' : undefined, <mask> width: props.orientation !== 'vertical' ? '100%' : undefined, <mask> }; <mask> const contextValue = React.useMemo(() => { <mask> return { <mask> trackLayout, <mask> state, <mask> orientation: props.orientation, </s> feat: adding pesudo internal Props in Slider </s> remove baseStyle: { alignItems: 'center', justifyContent: 'center', </s> add baseStyle: (props: any) => { return { alignItems: 'center', justifyContent: 'center', _wrap: { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }, }; </s> remove _wrap: { alignItems: 'center', justifyContent: 'center' }, </s> add _wrap: { alignItems: 'center', justifyContent: 'center', paddingY: props.orientation !== 'vertical' ? '3' : undefined, paddingX: props.orientation === 'vertical' ? '3' : undefined, }, </s> remove const resolvedProps = usePropsResolution('Slider', props, { </s> add const { _wrap, ...resolvedProps } = usePropsResolution('Slider', props, { </s> remove <Box {...wrapperStyle} ref={ref} {...resolvedProps}> </s> add <Box {..._wrap} ref={ref} {...resolvedProps}> </s> remove paddingY={!isVertical ? '3' : undefined} paddingX={isVertical ? '3' : undefined} alignItems={_wrap.alignItems} justifyContent={_wrap.justifyContent} </s> add {..._wrap}
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdc84de3ea0b4ce6e6250753f157367e9c68363b
src/components/primitives/Slider/Slider.tsx
<Box {..._wrap} ref={ref} {...resolvedProps}>
<mask> } <mask> <mask> return ( <mask> <SliderContext.Provider value={contextValue}> <mask> <Box {...wrapperStyle} ref={ref} {...resolvedProps}> <mask> {React.Children.map(props.children, (child, index) => { <mask> if (child.displayName === 'SliderThumb') { <mask> return React.cloneElement(child as React.ReactElement, { <mask> index, <mask> }); </s> feat: adding pesudo internal Props in Slider </s> remove const resolvedProps = usePropsResolution('Slider', props, { </s> add const { _wrap, ...resolvedProps } = usePropsResolution('Slider', props, { </s> remove const wrapperStyle = { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }; </s> add </s> remove baseStyle: { alignItems: 'center', justifyContent: 'center', </s> add baseStyle: (props: any) => { return { alignItems: 'center', justifyContent: 'center', _wrap: { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }, }; </s> remove _wrap: { alignItems: 'center', justifyContent: 'center' }, </s> add _wrap: { alignItems: 'center', justifyContent: 'center', paddingY: props.orientation !== 'vertical' ? '3' : undefined, paddingX: props.orientation === 'vertical' ? '3' : undefined, },
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdc84de3ea0b4ce6e6250753f157367e9c68363b
src/components/primitives/Slider/Slider.tsx
{..._wrap}
<mask> onLayout={onTrackLayout} <mask> ref={ref} <mask> {...trackProps} <mask> {...trackStyle} <mask> paddingY={!isVertical ? '3' : undefined} <mask> paddingX={isVertical ? '3' : undefined} <mask> alignItems={_wrap.alignItems} <mask> justifyContent={_wrap.justifyContent} <mask> > <mask> <Box {...resolvedProps} style={trackStyle}> <mask> {children} <mask> </Box> <mask> </Pressable> </s> feat: adding pesudo internal Props in Slider </s> remove _wrap: { alignItems: 'center', justifyContent: 'center' }, </s> add _wrap: { alignItems: 'center', justifyContent: 'center', paddingY: props.orientation !== 'vertical' ? '3' : undefined, paddingX: props.orientation === 'vertical' ? '3' : undefined, }, </s> remove <Box {...wrapperStyle} ref={ref} {...resolvedProps}> </s> add <Box {..._wrap} ref={ref} {...resolvedProps}> </s> remove const wrapperStyle = { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }; </s> add </s> remove baseStyle: { alignItems: 'center', justifyContent: 'center', </s> add baseStyle: (props: any) => { return { alignItems: 'center', justifyContent: 'center', _wrap: { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }, };
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdc84de3ea0b4ce6e6250753f157367e9c68363b
src/components/primitives/Slider/SliderTrack.tsx
/** Wrapper style for SliderTrack */ _wrap?: {};
<mask> /** Props applied if isDisabled is true. */ <mask> _disabled?: any; <mask> /** Props applied if isReadOnly is true. */ <mask> _readOnly?: any; <mask> } <mask> <mask> export interface ISliderTrackProps extends IBoxProps<ISliderTrackProps> { <mask> /** Whether the whole Slider is readonly. */ <mask> isReadOnly?: boolean; </s> feat: adding pesudo internal Props in Slider </s> remove <Box {...wrapperStyle} ref={ref} {...resolvedProps}> </s> add <Box {..._wrap} ref={ref} {...resolvedProps}> </s> remove baseStyle: { alignItems: 'center', justifyContent: 'center', </s> add baseStyle: (props: any) => { return { alignItems: 'center', justifyContent: 'center', _wrap: { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }, }; </s> remove const resolvedProps = usePropsResolution('Slider', props, { </s> add const { _wrap, ...resolvedProps } = usePropsResolution('Slider', props, { </s> remove _wrap: { alignItems: 'center', justifyContent: 'center' }, </s> add _wrap: { alignItems: 'center', justifyContent: 'center', paddingY: props.orientation !== 'vertical' ? '3' : undefined, paddingX: props.orientation === 'vertical' ? '3' : undefined, }, </s> remove const wrapperStyle = { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }; </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdc84de3ea0b4ce6e6250753f157367e9c68363b
src/components/primitives/Slider/types.tsx
_wrap: { alignItems: 'center', justifyContent: 'center', paddingY: props.orientation !== 'vertical' ? '3' : undefined, paddingX: props.orientation === 'vertical' ? '3' : undefined, },
<mask> return { <mask> bg: `${simplifiedColorScheme}.100`, <mask> borderRadius: 'lg', <mask> overflow: 'hidden', <mask> _wrap: { alignItems: 'center', justifyContent: 'center' }, <mask> }; <mask> }, <mask> }; <mask> <mask> export const SliderThumb = { </s> feat: adding pesudo internal Props in Slider </s> remove baseStyle: { alignItems: 'center', justifyContent: 'center', </s> add baseStyle: (props: any) => { return { alignItems: 'center', justifyContent: 'center', _wrap: { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }, }; </s> remove const resolvedProps = usePropsResolution('Slider', props, { </s> add const { _wrap, ...resolvedProps } = usePropsResolution('Slider', props, { </s> remove const wrapperStyle = { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }; </s> add </s> remove <Box {...wrapperStyle} ref={ref} {...resolvedProps}> </s> add <Box {..._wrap} ref={ref} {...resolvedProps}>
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdc84de3ea0b4ce6e6250753f157367e9c68363b
src/theme/components/slider.ts
baseStyle: (props: any) => { return { alignItems: 'center', justifyContent: 'center', _wrap: { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }, };
<mask> sm: { thumbSize: 4, sliderSize: 4 }, <mask> }; <mask> <mask> export const Slider = { <mask> baseStyle: { <mask> alignItems: 'center', <mask> justifyContent: 'center', <mask> }, <mask> defaultProps: { <mask> size: 'sm', <mask> }, <mask> sizes, </s> feat: adding pesudo internal Props in Slider </s> remove _wrap: { alignItems: 'center', justifyContent: 'center' }, </s> add _wrap: { alignItems: 'center', justifyContent: 'center', paddingY: props.orientation !== 'vertical' ? '3' : undefined, paddingX: props.orientation === 'vertical' ? '3' : undefined, }, </s> remove const resolvedProps = usePropsResolution('Slider', props, { </s> add const { _wrap, ...resolvedProps } = usePropsResolution('Slider', props, { </s> remove const wrapperStyle = { height: props.orientation === 'vertical' ? '100%' : undefined, width: props.orientation !== 'vertical' ? '100%' : undefined, }; </s> add </s> remove <Box {...wrapperStyle} ref={ref} {...resolvedProps}> </s> add <Box {..._wrap} ref={ref} {...resolvedProps}>
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdc84de3ea0b4ce6e6250753f157367e9c68363b
src/theme/components/slider.ts
<mask> reverse === 'reverse' ? [...childrenArray].reverse() : childrenArray; <mask> <mask> const orientation = axis === 'X' ? 'vertical' : 'horizontal'; <mask> <mask> let spaceValue; <mask> if (typeof space === 'string') { <mask> switch (space) { <mask> case 'gutter': <mask> spaceValue = 0; <mask> break; <mask> case '2xs': <mask> spaceValue = 1; <mask> break; <mask> case 'xs': <mask> spaceValue = 2; <mask> break; <mask> case 'sm': <mask> spaceValue = 3; <mask> break; <mask> case 'md': <mask> spaceValue = 4; <mask> break; <mask> case 'lg': <mask> spaceValue = 6; <mask> break; <mask> case 'xl': <mask> spaceValue = 7; <mask> break; <mask> case '2xl': <mask> spaceValue = 8; <mask> break; <mask> <mask> default: <mask> spaceValue = 1; <mask> break; <mask> } <mask> } else { <mask> spaceValue = space; <mask> } <mask> // If there's a divider, we wrap it with a Box and apply vertical and horizontal margins else we add a spacer Box with height or width <mask> if (divider) { <mask> const spacingProp: object = { <mask> ...(axis === 'X' ? { mx: spaceValue } : { my: spaceValue }), <mask> }; </s> fix: stack space extend issue </s> remove ...(axis === 'X' ? { width: spaceValue } : { height: spaceValue }), </s> add ...(axis === 'X' ? { width: space } : { height: space }), </s> remove ...(axis === 'X' ? { mx: spaceValue } : { my: spaceValue }), </s> add ...(axis === 'X' ? { mx: space } : { my: space }),
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdf669077f375f545b7c2f9c2b0521c0b6b95916
src/utils/getSpacedChildren.tsx
...(axis === 'X' ? { mx: space } : { my: space }),
<mask> } <mask> // If there's a divider, we wrap it with a Box and apply vertical and horizontal margins else we add a spacer Box with height or width <mask> if (divider) { <mask> const spacingProp: object = { <mask> ...(axis === 'X' ? { mx: spaceValue } : { my: spaceValue }), <mask> }; <mask> <mask> divider = React.cloneElement(divider, { <mask> orientation, <mask> ...spacingProp, </s> fix: stack space extend issue </s> remove ...(axis === 'X' ? { width: spaceValue } : { height: spaceValue }), </s> add ...(axis === 'X' ? { width: space } : { height: space }), </s> remove let spaceValue; if (typeof space === 'string') { switch (space) { case 'gutter': spaceValue = 0; break; case '2xs': spaceValue = 1; break; case 'xs': spaceValue = 2; break; case 'sm': spaceValue = 3; break; case 'md': spaceValue = 4; break; case 'lg': spaceValue = 6; break; case 'xl': spaceValue = 7; break; case '2xl': spaceValue = 8; break; default: spaceValue = 1; break; } } else { spaceValue = space; } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdf669077f375f545b7c2f9c2b0521c0b6b95916
src/utils/getSpacedChildren.tsx
...(axis === 'X' ? { width: space } : { height: space }),
<mask> ); <mask> }); <mask> } else { <mask> const spacingProp: object = { <mask> ...(axis === 'X' ? { width: spaceValue } : { height: spaceValue }), <mask> }; <mask> childrenArray = childrenArray.map((child: any, index: number) => { <mask> return ( <mask> <React.Fragment key={child.key ?? `spaced-child-${index}`}> <mask> {child} </s> fix: stack space extend issue </s> remove let spaceValue; if (typeof space === 'string') { switch (space) { case 'gutter': spaceValue = 0; break; case '2xs': spaceValue = 1; break; case 'xs': spaceValue = 2; break; case 'sm': spaceValue = 3; break; case 'md': spaceValue = 4; break; case 'lg': spaceValue = 6; break; case 'xl': spaceValue = 7; break; case '2xl': spaceValue = 8; break; default: spaceValue = 1; break; } } else { spaceValue = space; } </s> add </s> remove ...(axis === 'X' ? { mx: spaceValue } : { my: spaceValue }), </s> add ...(axis === 'X' ? { mx: space } : { my: space }),
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cdf669077f375f545b7c2f9c2b0521c0b6b95916
src/utils/getSpacedChildren.tsx
<Slider defaultValue={70} colorScheme="orange">
<mask> <mask> export default function () { <mask> return ( <mask> <Box mx={5} width="80%"> <mask> <Slider defaultValue={70} colorScheme="purple"> <mask> <SliderTrack bg="orange.100"> <mask> <SliderFilledTrack bg="orange.400" /> <mask> </SliderTrack> <mask> <SliderThumb> <mask> <Icon name="circle" type="MaterialIcons" /> </s> fix: updated slider customised example </s> remove <Icon name="circle" type="MaterialIcons" /> </s> add <Icon name="park" type="MaterialIcons" color="green.500" /> </s> remove <SliderFilledTrack bg="orange.400" /> </s> add <SliderFilledTrack bg="green.400" />
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea62e719cbfc340468bada54e5580679af1f7a5
example/storybook/stories/components/primitives/Slider/Customized.tsx
<SliderFilledTrack bg="green.400" />
<mask> return ( <mask> <Box mx={5} width="80%"> <mask> <Slider defaultValue={70} colorScheme="purple"> <mask> <SliderTrack bg="orange.100"> <mask> <SliderFilledTrack bg="orange.400" /> <mask> </SliderTrack> <mask> <SliderThumb> <mask> <Icon name="circle" type="MaterialIcons" /> <mask> </SliderThumb> <mask> </Slider> </s> fix: updated slider customised example </s> remove <Icon name="circle" type="MaterialIcons" /> </s> add <Icon name="park" type="MaterialIcons" color="green.500" /> </s> remove <Slider defaultValue={70} colorScheme="purple"> </s> add <Slider defaultValue={70} colorScheme="orange">
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea62e719cbfc340468bada54e5580679af1f7a5
example/storybook/stories/components/primitives/Slider/Customized.tsx
<Icon name="park" type="MaterialIcons" color="green.500" />
<mask> <SliderTrack bg="orange.100"> <mask> <SliderFilledTrack bg="orange.400" /> <mask> </SliderTrack> <mask> <SliderThumb> <mask> <Icon name="circle" type="MaterialIcons" /> <mask> </SliderThumb> <mask> </Slider> <mask> </Box> <mask> ); <mask> } </s> fix: updated slider customised example </s> remove <Slider defaultValue={70} colorScheme="purple"> </s> add <Slider defaultValue={70} colorScheme="orange"> </s> remove <SliderFilledTrack bg="orange.400" /> </s> add <SliderFilledTrack bg="green.400" />
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea62e719cbfc340468bada54e5580679af1f7a5
example/storybook/stories/components/primitives/Slider/Customized.tsx
ViewPropTypes, FlatList
<mask> Modal, <mask> Platform, <mask> ActionSheetIOS, <mask> TouchableOpacity, <mask> ViewPropTypes <mask> } from "react-native"; <mask> import { connectStyle } from "native-base-shoutem-theme"; <mask> import { Text } from "./Text"; <mask> import { Button } from "./Button"; <mask> import { ViewNB } from "./View"; </s> Replaced ListView with FlatList in ActionSheet </s> remove import { List } from "./List"; </s> add </s> remove items: [] </s> add items: [], dataArray: [] </s> remove callback: callback </s> add callback: callback, dataArray </s> remove dataArray={this.state.items} renderRow={(data, i, id) => { </s> add data={this.state.dataArray} keyExtractor={(item, index) => item.id} renderItem={({ item }) => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
<mask> import { Icon } from "./Icon"; <mask> import { Left } from "./Left"; <mask> import { Right } from "./Right"; <mask> import { Body } from "./Body"; <mask> import { List } from "./List"; <mask> import { ListItem } from "./ListItem"; <mask> import mapPropsToStyleNames from "../Utils/mapPropsToStyleNames"; <mask> <mask> class ActionSheetContainer extends Component { <mask> constructor(props) { </s> Replaced ListView with FlatList in ActionSheet </s> remove ViewPropTypes </s> add ViewPropTypes, FlatList </s> remove items: [] </s> add items: [], dataArray: [] </s> remove callback: callback </s> add callback: callback, dataArray </s> remove dataArray={this.state.items} renderRow={(data, i, id) => { </s> add data={this.state.dataArray} keyExtractor={(item, index) => item.id} renderItem={({ item }) => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
items: [], dataArray: []
<mask> constructor(props) { <mask> super(props); <mask> this.state = { <mask> modalVisible: false, <mask> items: [] <mask> }; <mask> } <mask> static actionsheetInstance; <mask> static show(config, callback) { <mask> this.actionsheetInstance._root.showActionSheet(config, callback); </s> Replaced ListView with FlatList in ActionSheet </s> remove import { List } from "./List"; </s> add </s> remove callback: callback </s> add callback: callback, dataArray </s> remove style={{ borderColor: "transparent" }} > <Text>{data}</Text> </s> add style={{ borderColor: "transparent" }}> <Text>{item.value}</Text> </s> remove this.state.callback(parseInt(id)); </s> add this.state.callback(parseInt(item.id));
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
let dataArray = config.options.map((item, index) => { return { id: index, value: item } })
<mask> } else { <mask> ActionSheetIOS.showActionSheetWithOptions(config, callback); <mask> } <mask> } else { <mask> this.setState({ <mask> items: config.options, <mask> title: config.title, <mask> message: config.message, <mask> destructiveButtonIndex: config.destructiveButtonIndex, <mask> cancelButtonIndex: config.cancelButtonIndex, </s> Replaced ListView with FlatList in ActionSheet </s> remove callback: callback </s> add callback: callback, dataArray </s> remove items: [] </s> add items: [], dataArray: [] </s> remove import { List } from "./List"; </s> add </s> remove ViewPropTypes </s> add ViewPropTypes, FlatList </s> remove dataArray={this.state.items} renderRow={(data, i, id) => { </s> add data={this.state.dataArray} keyExtractor={(item, index) => item.id} renderItem={({ item }) => {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
callback: callback, dataArray
<mask> message: config.message, <mask> destructiveButtonIndex: config.destructiveButtonIndex, <mask> cancelButtonIndex: config.cancelButtonIndex, <mask> modalVisible: true, <mask> callback: callback <mask> }); <mask> } <mask> } <mask> componentDidMount() { <mask> if (!this.props.autoHide && this.props.duration) { </s> Replaced ListView with FlatList in ActionSheet </s> remove items: [] </s> add items: [], dataArray: [] </s> remove style={{ borderColor: "transparent" }} > <Text>{data}</Text> </s> add style={{ borderColor: "transparent" }}> <Text>{item.value}</Text> </s> remove this.state.callback(parseInt(id)); </s> add this.state.callback(parseInt(item.id)); </s> remove dataArray={this.state.items} renderRow={(data, i, id) => { </s> add data={this.state.dataArray} keyExtractor={(item, index) => item.id} renderItem={({ item }) => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
<FlatList
<mask> elevation: 4 <mask> }} <mask> > <mask> <Text style={{ color: "#757575" }}>{this.state.title}</Text> <mask> <List <mask> style={{ marginHorizontal: -15, marginTop: 15 }} <mask> dataArray={this.state.items} <mask> renderRow={(data, i, id) => { <mask> return typeof this.state.items[0] === "string" ? ( <mask> <ListItem </s> Replaced ListView with FlatList in ActionSheet </s> remove dataArray={this.state.items} renderRow={(data, i, id) => { </s> add data={this.state.dataArray} keyExtractor={(item, index) => item.id} renderItem={({ item }) => { </s> remove this.state.callback(parseInt(id)); </s> add this.state.callback(parseInt(item.id)); </s> remove <ListItem onPress={() => { this.state.callback(parseInt(id)); this.setState({ modalVisible: false }); }} style={{ borderColor: "transparent" }} icon > <Left> <Icon name={data.icon} style={{ color: data.iconColor ? data.iconColor : undefined }} /> </Left> <Body style={{ borderColor: "transparent" }}> <Text>{data.text}</Text> </Body> <Right /> </ListItem> ); </s> add <ListItem onPress={() => { this.state.callback(parseInt(item.id)); this.setState({ modalVisible: false }); }} style={{ borderColor: "transparent" }} icon > <Left> <Icon name={item.value.icon} style={{ color: item.value.iconColor ? item.value.iconColor : undefined }} /> </Left> <Body style={{ borderColor: "transparent" }}> <Text>{item.value.text}</Text> </Body> <Right /> </ListItem> ) </s> remove style={{ borderColor: "transparent" }} > <Text>{data}</Text> </s> add style={{ borderColor: "transparent" }}> <Text>{item.value}</Text>
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
data={this.state.dataArray} keyExtractor={(item, index) => item.id} renderItem={({ item }) => {
<mask> > <mask> <Text style={{ color: "#757575" }}>{this.state.title}</Text> <mask> <List <mask> style={{ marginHorizontal: -15, marginTop: 15 }} <mask> dataArray={this.state.items} <mask> renderRow={(data, i, id) => { <mask> return typeof this.state.items[0] === "string" ? ( <mask> <ListItem <mask> onPress={() => { <mask> this.state.callback(parseInt(id)); <mask> this.setState({ modalVisible: false }); </s> Replaced ListView with FlatList in ActionSheet </s> remove <List </s> add <FlatList </s> remove this.state.callback(parseInt(id)); </s> add this.state.callback(parseInt(item.id)); </s> remove style={{ borderColor: "transparent" }} > <Text>{data}</Text> </s> add style={{ borderColor: "transparent" }}> <Text>{item.value}</Text> </s> remove <ListItem onPress={() => { this.state.callback(parseInt(id)); this.setState({ modalVisible: false }); }} style={{ borderColor: "transparent" }} icon > <Left> <Icon name={data.icon} style={{ color: data.iconColor ? data.iconColor : undefined }} /> </Left> <Body style={{ borderColor: "transparent" }}> <Text>{data.text}</Text> </Body> <Right /> </ListItem> ); </s> add <ListItem onPress={() => { this.state.callback(parseInt(item.id)); this.setState({ modalVisible: false }); }} style={{ borderColor: "transparent" }} icon > <Left> <Icon name={item.value.icon} style={{ color: item.value.iconColor ? item.value.iconColor : undefined }} /> </Left> <Body style={{ borderColor: "transparent" }}> <Text>{item.value.text}</Text> </Body> <Right /> </ListItem> )
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
this.state.callback(parseInt(item.id));
<mask> renderRow={(data, i, id) => { <mask> return typeof this.state.items[0] === "string" ? ( <mask> <ListItem <mask> onPress={() => { <mask> this.state.callback(parseInt(id)); <mask> this.setState({ modalVisible: false }); <mask> }} <mask> style={{ borderColor: "transparent" }} <mask> > <mask> <Text>{data}</Text> </s> Replaced ListView with FlatList in ActionSheet </s> remove dataArray={this.state.items} renderRow={(data, i, id) => { </s> add data={this.state.dataArray} keyExtractor={(item, index) => item.id} renderItem={({ item }) => { </s> remove <List </s> add <FlatList </s> remove style={{ borderColor: "transparent" }} > <Text>{data}</Text> </s> add style={{ borderColor: "transparent" }}> <Text>{item.value}</Text> </s> remove <ListItem onPress={() => { this.state.callback(parseInt(id)); this.setState({ modalVisible: false }); }} style={{ borderColor: "transparent" }} icon > <Left> <Icon name={data.icon} style={{ color: data.iconColor ? data.iconColor : undefined }} /> </Left> <Body style={{ borderColor: "transparent" }}> <Text>{data.text}</Text> </Body> <Right /> </ListItem> ); </s> add <ListItem onPress={() => { this.state.callback(parseInt(item.id)); this.setState({ modalVisible: false }); }} style={{ borderColor: "transparent" }} icon > <Left> <Icon name={item.value.icon} style={{ color: item.value.iconColor ? item.value.iconColor : undefined }} /> </Left> <Body style={{ borderColor: "transparent" }}> <Text>{item.value.text}</Text> </Body> <Right /> </ListItem> )
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
style={{ borderColor: "transparent" }}> <Text>{item.value}</Text>
<mask> onPress={() => { <mask> this.state.callback(parseInt(id)); <mask> this.setState({ modalVisible: false }); <mask> }} <mask> style={{ borderColor: "transparent" }} <mask> > <mask> <Text>{data}</Text> <mask> </ListItem> <mask> ) : ( <mask> <ListItem <mask> onPress={() => { <mask> this.state.callback(parseInt(id)); </s> Replaced ListView with FlatList in ActionSheet </s> remove <ListItem onPress={() => { this.state.callback(parseInt(id)); this.setState({ modalVisible: false }); }} style={{ borderColor: "transparent" }} icon > <Left> <Icon name={data.icon} style={{ color: data.iconColor ? data.iconColor : undefined }} /> </Left> <Body style={{ borderColor: "transparent" }}> <Text>{data.text}</Text> </Body> <Right /> </ListItem> ); </s> add <ListItem onPress={() => { this.state.callback(parseInt(item.id)); this.setState({ modalVisible: false }); }} style={{ borderColor: "transparent" }} icon > <Left> <Icon name={item.value.icon} style={{ color: item.value.iconColor ? item.value.iconColor : undefined }} /> </Left> <Body style={{ borderColor: "transparent" }}> <Text>{item.value.text}</Text> </Body> <Right /> </ListItem> ) </s> remove this.state.callback(parseInt(id)); </s> add this.state.callback(parseInt(item.id)); </s> remove dataArray={this.state.items} renderRow={(data, i, id) => { </s> add data={this.state.dataArray} keyExtractor={(item, index) => item.id} renderItem={({ item }) => { </s> remove items: [] </s> add items: [], dataArray: []
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
<ListItem onPress={() => { this.state.callback(parseInt(item.id)); this.setState({ modalVisible: false }); }} style={{ borderColor: "transparent" }} icon > <Left> <Icon name={item.value.icon} style={{ color: item.value.iconColor ? item.value.iconColor : undefined }} /> </Left> <Body style={{ borderColor: "transparent" }}> <Text>{item.value.text}</Text> </Body> <Right /> </ListItem> )
<mask> > <mask> <Text>{data}</Text> <mask> </ListItem> <mask> ) : ( <mask> <ListItem <mask> onPress={() => { <mask> this.state.callback(parseInt(id)); <mask> this.setState({ modalVisible: false }); <mask> }} <mask> style={{ borderColor: "transparent" }} <mask> icon <mask> > <mask> <Left> <mask> <Icon <mask> name={data.icon} <mask> style={{ <mask> color: data.iconColor ? data.iconColor : undefined <mask> }} <mask> /> <mask> </Left> <mask> <Body style={{ borderColor: "transparent" }}> <mask> <Text>{data.text}</Text> <mask> </Body> <mask> <Right /> <mask> </ListItem> <mask> ); <mask> }} <mask> /> <mask> </TouchableOpacity> <mask> </TouchableOpacity> <mask> </Modal> </s> Replaced ListView with FlatList in ActionSheet </s> remove style={{ borderColor: "transparent" }} > <Text>{data}</Text> </s> add style={{ borderColor: "transparent" }}> <Text>{item.value}</Text> </s> remove this.state.callback(parseInt(id)); </s> add this.state.callback(parseInt(item.id)); </s> remove dataArray={this.state.items} renderRow={(data, i, id) => { </s> add data={this.state.dataArray} keyExtractor={(item, index) => item.id} renderItem={({ item }) => { </s> remove <List </s> add <FlatList </s> remove items: [] </s> add items: [], dataArray: []
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/cea6aed7a2167f97cd17933f6307c2c3c4ab3a25
src/basic/Actionsheet.js
<Button colorScheme="teal" endIcon={<Badge ml={2}>10</Badge>}>
<mask> <mask> export default function () { <mask> return ( <mask> <HStack> <mask> <Button colorScheme="teal"> <mask> Notifications <mask> <Badge ml={2}>10</Badge> <mask> </Button> <mask> </HStack> <mask> ); </s> fix: select api and design changes </s> remove <Badge ml={2}>10</Badge> </s> add </s> remove import { Select, VStack, Switch, HStack, Text } from 'native-base'; </s> add import { Select, VStack, Switch, HStack, Text, Icon } from 'native-base'; </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext); </s> remove </s> add const [, selectedProps] = extractInObject(_selectedItem, [ '_label', 'icon', ]); const [, itemProps] = extractInObject(_item, ['_label', 'icon']);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
example/storybook/stories/components/composites/Badge/composition.tsx
<mask> return ( <mask> <HStack> <mask> <Button colorScheme="teal"> <mask> Notifications <mask> <Badge ml={2}>10</Badge> <mask> </Button> <mask> </HStack> <mask> ); <mask> } </s> fix: select api and design changes </s> remove <Button colorScheme="teal"> </s> add <Button colorScheme="teal" endIcon={<Badge ml={2}>10</Badge>}> </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext); </s> remove </s> add const [, selectedProps] = extractInObject(_selectedItem, [ '_label', 'icon', ]); const [, itemProps] = extractInObject(_item, ['_label', 'icon']);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
example/storybook/stories/components/composites/Badge/composition.tsx
import { Select, VStack, Switch, HStack, Text, Icon } from 'native-base';
<mask> import React from 'react'; <mask> import { Select, VStack, Switch, HStack, Text } from 'native-base'; <mask> <mask> export default function () { <mask> let [language, setLanguage] = React.useState<string>(''); <mask> let [type, setType] = React.useState<'custom' | 'native' | undefined>( <mask> 'custom' </s> fix: select api and design changes </s> remove import { Platform, View, Pressable } from 'react-native'; </s> add import { Platform, View, Pressable, ScrollView } from 'react-native'; </s> remove import Icon from '../Icon'; </s> add </s> remove <Button colorScheme="teal"> </s> add <Button colorScheme="teal" endIcon={<Badge ml={2}>10</Badge>}>
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
example/storybook/stories/components/primitives/Select/Basic.tsx
_selectedItem={{ stackProps: { reversed: true }, bg: 'primary.200', icon: <Icon name="check" size={5} />, }}
<mask> placeholder="Select your favorite programming language" <mask> onValueChange={(itemValue: string) => setLanguage(itemValue)} <mask> > <mask> <Select.Item label="JavaScript" value="js" /> <mask> <Select.Item label="TypeScript" value="ts" /> <mask> <Select.Item label="C" value="c" /> <mask> <Select.Item label="Python" value="py" /> <mask> <Select.Item label="Java" value="java" /> </s> fix: select api and design changes </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove // endIcon={ // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> // } </s> add </s> remove <Actionsheet.Content> <SelectContext.Provider value={{ onValueChange: setValue, selectedValue: value, }} > {children} </SelectContext.Provider> </s> add <Actionsheet.Content {..._actionSheetContent}> <ScrollView style={{ width: '100%' }}> <SelectContext.Provider value={{ onValueChange: setValue, selectedValue: value, _selectedItem: _selectedItem, _item: _item, }} > {children} </SelectContext.Provider> </ScrollView> </s> remove _item?: ITextProps; </s> add _item?: any; // only for custom Variant takes object of props that needs to be passed to item by default _selectedItem?: any; // only for custom Variant takes object of props that needs to be passed to item when its selected
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
example/storybook/stories/components/primitives/Select/Basic.tsx
variant?: 'outline' | 'filled' | 'underlined' | 'unstyled' | 'rounded';
<mask> style?: TextStyle; <mask> children?: string | JSX.Element[] | JSX.Element; <mask> placeholder?: string; <mask> isInvalid?: boolean; <mask> variant?: string; <mask> isDisabled?: boolean; <mask> size?: string; <mask> isRequired?: boolean; <mask> isReadOnly?: boolean; <mask> isFullWidth?: boolean; </s> fix: select api and design changes </s> remove variant?: string; </s> add variant?: 'outline' | 'filled' | 'underlined' | 'unstyled' | 'rounded'; </s> remove _item?: ITextProps; </s> add _item?: any; // only for custom Variant takes object of props that needs to be passed to item by default _selectedItem?: any; // only for custom Variant takes object of props that needs to be passed to item when its selected </s> remove import { Select, VStack, Switch, HStack, Text } from 'native-base'; </s> add import { Select, VStack, Switch, HStack, Text, Icon } from 'native-base';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Input/types.ts
import { Platform, View, Pressable, ScrollView } from 'react-native';
<mask> import React from 'react'; <mask> import type { ISelectProps } from './types'; <mask> import { Platform, View, Pressable } from 'react-native'; <mask> import { Actionsheet } from '../../composites/Actionsheet'; <mask> import Icon from '../Icon'; <mask> import Box from '../Box'; <mask> import { Input } from '../Input'; <mask> import { useFocusRing } from '@react-native-aria/focus'; </s> fix: select api and design changes </s> remove import Icon from '../Icon'; </s> add </s> remove import { Select, VStack, Switch, HStack, Text } from 'native-base'; </s> add import { Select, VStack, Switch, HStack, Text, Icon } from 'native-base'; </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext);
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
_selectedItem: null as any, _item: null as any,
<mask> <mask> export const SelectContext = React.createContext({ <mask> onValueChange: (() => {}) as any, <mask> selectedValue: null as any, <mask> }); <mask> <mask> const Select = ( <mask> { </s> fix: select api and design changes </s> remove <Actionsheet.Content> <SelectContext.Provider value={{ onValueChange: setValue, selectedValue: value, }} > {children} </SelectContext.Provider> </s> add <Actionsheet.Content {..._actionSheetContent}> <ScrollView style={{ width: '100%' }}> <SelectContext.Provider value={{ onValueChange: setValue, selectedValue: value, _selectedItem: _selectedItem, _item: _item, }} > {children} </SelectContext.Provider> </ScrollView> </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext); </s> remove import Icon from '../Icon'; </s> add </s> remove const themeProps = useThemeProps('Input', props); </s> add const themeProps = useThemeProps('Input', { ...props, size });
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
size, _item, _selectedItem,
<mask> defaultValue, <mask> type, <mask> ...props <mask> }: ISelectProps, <mask> ref: any <mask> ) => { <mask> const selectProps = useFormControl({ </s> fix: select api and design changes </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext); </s> remove </s> add const [, selectedProps] = extractInObject(_selectedItem, [ '_label', 'icon', ]); const [, itemProps] = extractInObject(_item, ['_label', 'icon']); </s> remove import Icon from '../Icon'; </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
const themeProps = useThemeProps('Input', { ...props, size });
<mask> <mask> const isDisabled = selectProps.disabled; <mask> <mask> const _ref = React.useRef(null); <mask> const themeProps = useThemeProps('Input', props); <mask> let [isOpen, setIsOpen] = React.useState<boolean>(false); <mask> <mask> const { focusProps, isFocusVisible } = useFocusRing(); <mask> const { hoverProps, isHovered } = useHover({ isDisabled }, _ref); <mask> </s> fix: select api and design changes </s> remove _item, </s> add </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext); </s> remove </s> add const [, selectedProps] = extractInObject(_selectedItem, [ '_label', 'icon', ]); const [, itemProps] = extractInObject(_item, ['_label', 'icon']); </s> remove import { Select, VStack, Switch, HStack, Text } from 'native-base'; </s> add import { Select, VStack, Switch, HStack, Text, Icon } from 'native-base';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
<mask> selectedItemArray && selectedItemArray.length ? selectedItemArray[0] : null; <mask> const selectThemeProps = useThemeProps('Select', props); <mask> <mask> const { <mask> _item, <mask> _ios, <mask> _web, <mask> _android, <mask> _hover, <mask> isInvalid, </s> fix: select api and design changes </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove const themeProps = useThemeProps('Input', props); </s> add const themeProps = useThemeProps('Input', { ...props, size });
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
itemStyle,
<mask> const { <mask> _ios, <mask> _web, <mask> _android, <mask> _hover, <mask> isInvalid, <mask> _isInvalid, <mask> _isDisabled, <mask> color, </s> fix: select api and design changes </s> remove _item, </s> add </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext); </s> remove </s> add const [, selectedProps] = extractInObject(_selectedItem, [ '_label', 'icon', ]); const [, itemProps] = extractInObject(_item, ['_label', 'icon']); </s> remove const themeProps = useThemeProps('Input', props); </s> add const themeProps = useThemeProps('Input', { ...props, size });
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
_actionSheetContent,
<mask> androidPrompt, <mask> customDropdownIconProps, <mask> ...newProps <mask> } = useThemeProps(type === 'native' ? 'NativeSelect' : 'CustomSelect', props); <mask> const [borderProps, remainingProps] = extractInObject(newProps, [ <mask> ...stylingProps.border, <mask> ]); </s> fix: select api and design changes </s> remove </s> add const [, selectedProps] = extractInObject(_selectedItem, [ '_label', 'icon', ]); const [, itemProps] = extractInObject(_item, ['_label', 'icon']); </s> remove _item, </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
size={size}
<mask> placeholder={placeholder} <mask> editable={false} <mask> focusable={false} <mask> variant={selectThemeProps.variant} <mask> InputRightElement={ <mask> dropdownIcon ? dropdownIcon : <Icon {...customDropdownIconProps} /> <mask> } <mask> {...(isHovered ? themeProps._hover : {})} </s> fix: select api and design changes </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove // endIcon={ // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> // } </s> add </s> remove _item, </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
...itemStyle,
<mask> prompt={androidPrompt} <mask> dropdownIconColor={themeAndroidIconColor} <mask> itemStyle={{ <mask> color: themeItemStyleColor, <mask> ..._item, <mask> }} <mask> {...selectProps} <mask> {...(Platform.OS === 'ios' && _ios)} <mask> {...(Platform.OS === 'android' && _android)} <mask> {...(isDisabled && _isDisabled)} </s> fix: select api and design changes </s> remove ..._item, </s> add ...itemStyle, </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove _item, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
...itemStyle,
<mask> onValueChange={onValueChange} <mask> selectedValue={selectedValue} <mask> itemStyle={{ <mask> color: themeItemStyleColor, <mask> ..._item, <mask> }} <mask> {...selectProps} <mask> {...(Platform.OS === 'web' && _web)} <mask> {...(isDisabled && _isDisabled)} <mask> {...(isInvalid && _isInvalid)} </s> fix: select api and design changes </s> remove ..._item, </s> add ...itemStyle, </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove _item, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
borderWidth={1} borderColor="transparent"
<mask> <mask> const StyledSelect = ( <mask> <Box <mask> {...layoutProps} <mask> borderRadius={themeProps.borderRadius} <mask> {...(isFocusVisible ? themeProps._focus : {})} <mask> > <mask> {Platform.OS === 'web' ? ( </s> fix: select api and design changes </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove // endIcon={ // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> // } </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
<Actionsheet.Content {..._actionSheetContent}> <ScrollView style={{ width: '100%' }}> <SelectContext.Provider value={{ onValueChange: setValue, selectedValue: value, _selectedItem: _selectedItem, _item: _item, }} > {children} </SelectContext.Provider> </ScrollView>
<mask> > <mask> <View pointerEvents="none">{commonInput}</View> <mask> </Pressable> <mask> <Actionsheet isOpen={isOpen} onClose={() => setIsOpen(false)}> <mask> <Actionsheet.Content> <mask> <SelectContext.Provider <mask> value={{ <mask> onValueChange: setValue, <mask> selectedValue: value, <mask> }} <mask> > <mask> {children} <mask> </SelectContext.Provider> <mask> </Actionsheet.Content> <mask> </Actionsheet> <mask> </> <mask> )} <mask> </Box> </s> fix: select api and design changes </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove // endIcon={ // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> // } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/Select.tsx
<mask> import type { ISelectItemProps } from './types'; <mask> import { Platform } from 'react-native'; <mask> import { Actionsheet } from '../../composites/Actionsheet'; <mask> import { SelectContext } from './Select'; <mask> import Icon from '../Icon'; <mask> import HStack from '../Stack/HStack'; <mask> import Box from '../Box'; <mask> <mask> export const Item = ( <mask> { isDisabled, label, value, ...props }: ISelectItemProps, </s> fix: select api and design changes </s> remove import { Platform, View, Pressable } from 'react-native'; </s> add import { Platform, View, Pressable, ScrollView } from 'react-native'; </s> remove import { Select, VStack, Switch, HStack, Text } from 'native-base'; </s> add import { Select, VStack, Switch, HStack, Text, Icon } from 'native-base'; </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/SelectItem.tsx
import { extractInObject } from '../../../theme/tools';
<mask> import { Actionsheet } from '../../composites/Actionsheet'; <mask> import { SelectContext } from './Select'; <mask> import HStack from '../Stack/HStack'; <mask> import Box from '../Box'; <mask> <mask> export const Item = ( <mask> { isDisabled, label, value, ...props }: ISelectItemProps, <mask> ref?: any <mask> ) => { </s> fix: select api and design changes </s> remove import Icon from '../Icon'; </s> add </s> remove import { Platform, View, Pressable } from 'react-native'; </s> add import { Platform, View, Pressable, ScrollView } from 'react-native'; </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext); </s> remove import { Select, VStack, Switch, HStack, Text } from 'native-base'; </s> add import { Select, VStack, Switch, HStack, Text, Icon } from 'native-base';
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/SelectItem.tsx
const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext);
<mask> export const Item = ( <mask> { isDisabled, label, value, ...props }: ISelectItemProps, <mask> ref?: any <mask> ) => { <mask> const { onValueChange, selectedValue } = React.useContext(SelectContext); <mask> if (Platform.OS !== 'web') { <mask> const isSelected = selectedValue === value; <mask> <mask> return ( <mask> <Actionsheet.Item </s> fix: select api and design changes </s> remove </s> add const [, selectedProps] = extractInObject(_selectedItem, [ '_label', 'icon', ]); const [, itemProps] = extractInObject(_item, ['_label', 'icon']); </s> remove import Icon from '../Icon'; </s> add </s> remove <Button colorScheme="teal"> </s> add <Button colorScheme="teal" endIcon={<Badge ml={2}>10</Badge>}>
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/SelectItem.tsx
const [, selectedProps] = extractInObject(_selectedItem, [ '_label', 'icon', ]); const [, itemProps] = extractInObject(_item, ['_label', 'icon']);
<mask> ) => { <mask> const { onValueChange, selectedValue } = React.useContext(SelectContext); <mask> if (Platform.OS !== 'web') { <mask> const isSelected = selectedValue === value; <mask> <mask> return ( <mask> <Actionsheet.Item <mask> {...props} <mask> ref={ref} <mask> onPress={() => { </s> fix: select api and design changes </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext); </s> remove // endIcon={ // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> // } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/SelectItem.tsx
<mask> if (!isDisabled) { <mask> onValueChange(value); <mask> } <mask> }} <mask> // endIcon={ <mask> // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> <mask> // } <mask> accessibilityState={{ selected: isSelected }} <mask> > <mask> <HStack space={4} alignItems="center"> <mask> <Box>{label}</Box> <mask> <Box> </s> fix: select api and design changes </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label}
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/SelectItem.tsx
{...itemProps} {...(isSelected && selectedProps)}
<mask> }} <mask> accessibilityState={{ selected: isSelected }} <mask> > <mask> <HStack <mask> space={4} <mask> alignItems="center" <mask> {...itemProps?.stackProps} </s> fix: select api and design changes </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove // endIcon={ // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> // } </s> add </s> remove <Actionsheet.Content> <SelectContext.Provider value={{ onValueChange: setValue, selectedValue: value, }} > {children} </SelectContext.Provider> </s> add <Actionsheet.Content {..._actionSheetContent}> <ScrollView style={{ width: '100%' }}> <SelectContext.Provider value={{ onValueChange: setValue, selectedValue: value, _selectedItem: _selectedItem, _item: _item, }} > {children} </SelectContext.Provider> </ScrollView>
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/SelectItem.tsx
<HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label}
<mask> // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> <mask> // } <mask> accessibilityState={{ selected: isSelected }} <mask> > <mask> <HStack space={4} alignItems="center"> <mask> <Box>{label}</Box> <mask> <Box> <mask> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} <mask> </Box> <mask> </HStack> <mask> </Actionsheet.Item> <mask> ); <mask> } else { </s> fix: select api and design changes </s> remove // endIcon={ // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> // } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/SelectItem.tsx
{isSelected ? _selectedItem?.icon : _item?.icon}
<mask> }} <mask> > <mask> {label} <mask> </Box> <mask> </HStack> <mask> </Actionsheet.Item> <mask> ); <mask> } else { </s> fix: select api and design changes </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label} </s> remove <Badge ml={2}>10</Badge> </s> add </s> remove <Button colorScheme="teal"> </s> add <Button colorScheme="teal" endIcon={<Badge ml={2}>10</Badge>}> </s> remove <Actionsheet.Content> <SelectContext.Provider value={{ onValueChange: setValue, selectedValue: value, }} > {children} </SelectContext.Provider> </s> add <Actionsheet.Content {..._actionSheetContent}> <ScrollView style={{ width: '100%' }}> <SelectContext.Provider value={{ onValueChange: setValue, selectedValue: value, _selectedItem: _selectedItem, _item: _item, }} > {children} </SelectContext.Provider> </ScrollView> </s> remove // endIcon={ // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> // } </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/SelectItem.tsx
import type { IActionsheetContentProps } from '../../composites/Actionsheet/types';
<mask> import type { ITextProps } from '../Text'; <mask> import type { TextStyle } from 'react-native'; <mask> <mask> export type ISelectProps = IBoxProps & { <mask> placeholder?: string; <mask> selectedValue?: string; <mask> placeholderTextColor?: string; </s> fix: select api and design changes </s> remove import { Platform, View, Pressable } from 'react-native'; </s> add import { Platform, View, Pressable, ScrollView } from 'react-native'; </s> remove import Icon from '../Icon'; </s> add </s> remove _item?: ITextProps; </s> add _item?: any; // only for custom Variant takes object of props that needs to be passed to item by default _selectedItem?: any; // only for custom Variant takes object of props that needs to be passed to item when its selected
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/types.ts
_item?: any; // only for custom Variant takes object of props that needs to be passed to item by default _selectedItem?: any; // only for custom Variant takes object of props that needs to be passed to item when its selected
<mask> export type ISelectProps = IBoxProps & { <mask> placeholder?: string; <mask> selectedValue?: string; <mask> placeholderTextColor?: string; <mask> _item?: ITextProps; <mask> defaultValue?: string; <mask> onValueChange?: (itemValue: string) => void; <mask> isDisabled?: boolean; <mask> dropdownIcon?: JSX.Element; <mask> dropdownOpenIcon?: JSX.Element; </s> fix: select api and design changes </s> remove variant?: string; </s> add variant?: 'outline' | 'filled' | 'underlined' | 'unstyled' | 'rounded'; </s> remove variant?: string; </s> add variant?: 'outline' | 'filled' | 'underlined' | 'unstyled' | 'rounded'; </s> remove import { Platform, View, Pressable } from 'react-native'; </s> add import { Platform, View, Pressable, ScrollView } from 'react-native';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/types.ts
variant?: 'outline' | 'filled' | 'underlined' | 'unstyled' | 'rounded';
<mask> isDisabled?: boolean; <mask> dropdownIcon?: JSX.Element; <mask> dropdownOpenIcon?: JSX.Element; <mask> dropdownCloseIcon?: JSX.Element; <mask> variant?: string; <mask> _ios?: any; <mask> _android?: any; <mask> _web?: any; <mask> itemStyle?: TextStyle; // only on Native variant (ios and Windows) <mask> androidMode?: 'dialog' | 'dropdown'; // only on Native variant (android) </s> fix: select api and design changes </s> remove _item?: ITextProps; </s> add _item?: any; // only for custom Variant takes object of props that needs to be passed to item by default _selectedItem?: any; // only for custom Variant takes object of props that needs to be passed to item when its selected </s> remove variant?: string; </s> add variant?: 'outline' | 'filled' | 'underlined' | 'unstyled' | 'rounded'; </s> remove // endIcon={ // isSelected ? <Icon type="MaterialIcons" name="check" /> : <></> // } </s> add </s> remove <HStack space={4} alignItems="center"> <Box>{label}</Box> <Box> {isSelected ? <Icon type="MaterialIcons" name="check" /> : <></>} </s> add <HStack space={4} alignItems="center" {...itemProps?.stackProps} {...(isSelected && _selectedItem?.stackProps)} > <Box _text={{ ..._item?._label, ...(isSelected && _selectedItem?._label), }} > {label}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/types.ts
_actionSheetContent?: IActionsheetContentProps;
<mask> androidPrompt?: string; <mask> type?: 'native' | 'custom'; <mask> }; <mask> <mask> export type ISelectItemProps = IButtonProps & { <mask> label: string; </s> fix: select api and design changes </s> remove variant?: string; </s> add variant?: 'outline' | 'filled' | 'underlined' | 'unstyled' | 'rounded'; </s> remove _item?: ITextProps; </s> add _item?: any; // only for custom Variant takes object of props that needs to be passed to item by default _selectedItem?: any; // only for custom Variant takes object of props that needs to be passed to item when its selected </s> remove variant?: string; </s> add variant?: 'outline' | 'filled' | 'underlined' | 'unstyled' | 'rounded';
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/components/primitives/Select/types.ts
_actionSheetContent: { maxHeight: '50%', pb: 6, },
<mask> mr: 2, <mask> }, <mask> }; <mask> }; <mask> export const CustomSelect = { <mask> baseStyle: customSelectBaseStyle, </s> fix: select api and design changes </s> remove const themeProps = useThemeProps('Input', props); </s> add const themeProps = useThemeProps('Input', { ...props, size }); </s> remove const { onValueChange, selectedValue } = React.useContext(SelectContext); </s> add const { onValueChange, selectedValue, _selectedItem, _item, } = React.useContext(SelectContext);
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/ceb4979af03f204ac7c0067ddce4a42c519ba6a9
src/theme/components/select.ts
.addDecorator((getStory: any) => <Wrapper>{getStory()}</Wrapper>)
<mask> import Composition from './Composition'; <mask> <mask> storiesOf('Breadcrumb', module) <mask> .addDecorator(withKnobs) <mask> .add('Composition', () => <Composition />) <mask> .add('Basic', () => <Basic />) <mask> .add('Separators', () => <Separators />) <mask> .add('ComponentSeparator', () => <ComponentSeparator />) <mask> .addDecorator((getStory: any) => <Wrapper>{getStory()}</Wrapper>); </s> Fixes for irregular icon size and modal crash </s> remove .addDecorator((getStory: any) => <Wrapper>{getStory()}</Wrapper>); </s> add .add('Composition', () => <Composition />); </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove minW: 6, minH: 6, px: 'auto', </s> add py: 0, px: 0, </s> remove minW: 8, minH: 8, px: 'auto', </s> add py: 0, px: 0,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
example/storybook/stories/components/composites/Breadcrumb/index.tsx
.add('Composition', () => <Composition />);
<mask> .add('Composition', () => <Composition />) <mask> .add('Basic', () => <Basic />) <mask> .add('Separators', () => <Separators />) <mask> .add('ComponentSeparator', () => <ComponentSeparator />) <mask> .addDecorator((getStory: any) => <Wrapper>{getStory()}</Wrapper>); </s> Fixes for irregular icon size and modal crash </s> remove .add('Composition', () => <Composition />) </s> add .addDecorator((getStory: any) => <Wrapper>{getStory()}</Wrapper>) </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove minW: 6, minH: 6, px: 'auto', </s> add py: 0, px: 0, </s> remove minW: 8, minH: 8, px: 'auto', </s> add py: 0, px: 0,
[ "keep", "keep", "keep", "keep", "replace" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
example/storybook/stories/components/composites/Breadcrumb/index.tsx
const iconSize: any = { xs: 6, sm: 8, md: 10, lg: 12 };
<mask> export type ICloseButtonProps = IIconButtonProps; <mask> <mask> const CloseButton = (props: ICloseButtonProps) => { <mask> return ( <mask> <IconButton <mask> {...props} <mask> icon={ <mask> <Icon name={'close'} size={props.size ? iconSize[props.size] : 8} /> </s> Fixes for irregular icon size and modal crash </s> remove <IconButton {...props} icon={<Icon name={'close'} size={props.size} />} /> </s> add <IconButton {...props} icon={ <Icon name={'close'} size={props.size ? iconSize[props.size] : 8} /> } /> </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove accessibilityLabel="Close dialog" </s> add // accessibilityLabel="Close dialog" </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove minW: 10, minH: 10, px: 'auto', </s> add py: 0, px: 0,
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
src/components/composites/CloseButton/index.tsx
<IconButton {...props} icon={ <Icon name={'close'} size={props.size ? iconSize[props.size] : 8} /> } />
<mask> export type ICloseButtonProps = IIconButtonProps; <mask> <mask> const CloseButton = (props: ICloseButtonProps) => { <mask> return ( <mask> <IconButton {...props} icon={<Icon name={'close'} size={props.size} />} /> <mask> ); <mask> }; <mask> <mask> export default React.memo(CloseButton); </s> Fixes for irregular icon size and modal crash </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove accessibilityLabel="Close dialog" </s> add // accessibilityLabel="Close dialog" </s> remove minW: 10, minH: 10, px: 'auto', </s> add py: 0, px: 0,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
src/components/composites/CloseButton/index.tsx
// accessibilityLabel="Close dialog"
<mask> <View style={newProps.modalCloseButtonStyle}> <mask> <CloseButton <mask> {...newProps.modalCloseButtonProps} <mask> {...props} <mask> accessibilityLabel="Close dialog" <mask> onPress={() => { <mask> toggleVisible(false); <mask> toggleOnClose(false); <mask> }} <mask> /> </s> Fixes for irregular icon size and modal crash </s> remove <IconButton {...props} icon={<Icon name={'close'} size={props.size} />} /> </s> add <IconButton {...props} icon={ <Icon name={'close'} size={props.size ? iconSize[props.size] : 8} /> } /> </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove minW: 10, minH: 10, px: 'auto', </s> add py: 0, px: 0, </s> remove fontSize: 'sm', </s> add fontSize: 14,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
src/components/composites/Modal/index.tsx
py: 0, px: 0,
<mask> }; <mask> <mask> const sizes = { <mask> lg: { <mask> minW: 10, <mask> minH: 10, <mask> px: 'auto', <mask> fontSize: '3xl', <mask> }, <mask> md: { <mask> minW: 8, <mask> minH: 8, </s> Fixes for irregular icon size and modal crash </s> remove minW: 8, minH: 8, px: 'auto', </s> add py: 0, px: 0, </s> remove minW: 6, minH: 6, px: 'auto', </s> add py: 0, px: 0, </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove fontSize: 'sm', </s> add fontSize: 14,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
src/theme/components/icon-button.ts
py: 0, px: 0,
<mask> px: 'auto', <mask> fontSize: '3xl', <mask> }, <mask> md: { <mask> minW: 8, <mask> minH: 8, <mask> px: 'auto', <mask> fontSize: '2xl', <mask> }, <mask> sm: { <mask> minW: 6, <mask> minH: 6, </s> Fixes for irregular icon size and modal crash </s> remove minW: 10, minH: 10, px: 'auto', </s> add py: 0, px: 0, </s> remove minW: 6, minH: 6, px: 'auto', </s> add py: 0, px: 0, </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove fontSize: 'sm', </s> add fontSize: 14,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
src/theme/components/icon-button.ts
py: 0, px: 0,
<mask> px: 'auto', <mask> fontSize: '2xl', <mask> }, <mask> sm: { <mask> minW: 6, <mask> minH: 6, <mask> px: 'auto', <mask> fontSize: 'xl', <mask> }, <mask> }; <mask> <mask> const defaultProps = { </s> Fixes for irregular icon size and modal crash </s> remove minW: 8, minH: 8, px: 'auto', </s> add py: 0, px: 0, </s> remove minW: 10, minH: 10, px: 'auto', </s> add py: 0, px: 0, </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove fontSize: 'sm', </s> add fontSize: 14,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
src/theme/components/icon-button.ts
fontSize: 14,
<mask> }; <mask> <mask> export const MenuGroup = { <mask> baseStyle: { <mask> fontSize: 'sm', <mask> fontWeight: 'semibold', <mask> p: 2, <mask> }, <mask> }; <mask> export const MenuItem = { </s> Fixes for irregular icon size and modal crash </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove <IconButton {...props} icon={<Icon name={'close'} size={props.size} />} /> </s> add <IconButton {...props} icon={ <Icon name={'close'} size={props.size ? iconSize[props.size] : 8} /> } /> </s> remove minW: 10, minH: 10, px: 'auto', </s> add py: 0, px: 0, </s> remove minW: 6, minH: 6, px: 'auto', </s> add py: 0, px: 0,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
src/theme/components/menu.ts
fontSize: 14,
<mask> }, <mask> }; <mask> export const MenuItem = { <mask> baseStyle: { <mask> fontSize: 'sm', <mask> fontWeight: 'normal', <mask> textAlign: 'left', <mask> maxWidth: 64, <mask> minWidth: 32, <mask> py: 2, </s> Fixes for irregular icon size and modal crash </s> remove fontSize: 'sm', </s> add fontSize: 14, </s> remove minW: 10, minH: 10, px: 'auto', </s> add py: 0, px: 0, </s> remove minW: 6, minH: 6, px: 'auto', </s> add py: 0, px: 0, </s> remove <IconButton {...props} icon={<Icon name={'close'} size={props.size} />} /> </s> add <IconButton {...props} icon={ <Icon name={'close'} size={props.size ? iconSize[props.size] : 8} /> } />
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d15d7ec52a5994bb44310d12e28575aea6363d07
src/theme/components/menu.ts
<Text fontWeight={400}>
<mask> > <mask> The Silicon Valley of India. <mask> </Heading> <mask> </Stack> <mask> <Text lineHeight={6} fontWeight={400}> <mask> Bengaluru (also called Bangalore) is the center of India's high-tech <mask> industry. The city is also known for its parks and nightlife. <mask> </Text> <mask> <HStack alignItems="center" space={4} justifyContent="space-between"> <mask> <HStack alignItems="center"> </s> fix: broken uis and component theme integrations </s> remove lineHeight: 6, // Todo: Move to _web inside size so that sm and xs don't have this much height </s> add lineHeight: 'lg', // Todo: Move to _web inside size so that sm and xs don't have this much height </s> remove type IUseResolvedFontFamily = { fontFamily: string; fontStyle: string; fontWeight: string | number; }; // Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead. function useResolvedFontFamily(props: IUseResolvedFontFamily) { const { fontFamily, fontStyle, fontWeight } = props; const { fontConfig, fontWeights, fonts } = useTheme(); const fontToken = fonts[fontFamily]; if (fontConfig && fontConfig[fontToken]) { // fontWeights are also specified using "400" const parsedFontWeight = parseInt(fontWeight as any); let fontWeightNumber = Number.isNaN(parsedFontWeight) ? fontWeights[fontWeight] : fontWeight; let fontVariants = fontConfig[fontToken][fontWeightNumber]; if (typeof fontVariants === 'object') { if (fontVariants[fontStyle]) return fontVariants[fontStyle]; } else { return fontVariants; } } } </s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; import { Text as NativeText } from 'react-native'; import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps'; </s> remove const { resolvedProps } = usePropsResolution('InputRightAddon', props); </s> add const resolvedProps = usePropsResolution('InputRightAddon', props); </s> remove const { resolvedProps } = usePropsResolution('InputLeftAddon', props); </s> add const resolvedProps = usePropsResolution('InputLeftAddon', props); </s> remove import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps'; </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d1e65b3a29701927408720f3afd2977ebc7f4733
example/storybook/stories/components/primitives/Box/composition.tsx
const resolvedProps = usePropsResolution('InputLeftAddon', props);
<mask> import { usePropsResolution } from '../../../hooks/useThemeProps/usePropsResolution'; <mask> <mask> export const InputLeftAddon = memo( <mask> forwardRef((props: IBoxProps & IInputProps, ref?: any) => { <mask> const { resolvedProps } = usePropsResolution('InputLeftAddon', props); <mask> //TODO: refactor for responsive prop <mask> if (useHasResponsiveProps(props)) { <mask> return null; <mask> } <mask> return ( </s> fix: broken uis and component theme integrations </s> remove const { resolvedProps } = usePropsResolution('InputRightAddon', props); </s> add const resolvedProps = usePropsResolution('InputRightAddon', props); </s> remove type IUseResolvedFontFamily = { fontFamily: string; fontStyle: string; fontWeight: string | number; }; // Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead. function useResolvedFontFamily(props: IUseResolvedFontFamily) { const { fontFamily, fontStyle, fontWeight } = props; const { fontConfig, fontWeights, fonts } = useTheme(); const fontToken = fonts[fontFamily]; if (fontConfig && fontConfig[fontToken]) { // fontWeights are also specified using "400" const parsedFontWeight = parseInt(fontWeight as any); let fontWeightNumber = Number.isNaN(parsedFontWeight) ? fontWeights[fontWeight] : fontWeight; let fontVariants = fontConfig[fontToken][fontWeightNumber]; if (typeof fontVariants === 'object') { if (fontVariants[fontStyle]) return fontVariants[fontStyle]; } else { return fontVariants; } } } </s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; import { Text as NativeText } from 'react-native'; import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps'; </s> remove import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps'; </s> add </s> remove import { Text as NativeText } from 'react-native'; import { useTheme } from '../../../hooks'; </s> add </s> remove lineHeight: 6, // Todo: Move to _web inside size so that sm and xs don't have this much height </s> add lineHeight: 'lg', // Todo: Move to _web inside size so that sm and xs don't have this much height
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d1e65b3a29701927408720f3afd2977ebc7f4733
src/components/primitives/Input/InputAddons.tsx
const resolvedProps = usePropsResolution('InputRightAddon', props);
<mask> }) <mask> ); <mask> export const InputRightAddon = memo( <mask> forwardRef((props: IBoxProps & IInputProps, ref?: any) => { <mask> const { resolvedProps } = usePropsResolution('InputRightAddon', props); <mask> //TODO: refactor for responsive prop <mask> if (useHasResponsiveProps(props)) { <mask> return null; <mask> } <mask> return ( </s> fix: broken uis and component theme integrations </s> remove const { resolvedProps } = usePropsResolution('InputLeftAddon', props); </s> add const resolvedProps = usePropsResolution('InputLeftAddon', props); </s> remove type IUseResolvedFontFamily = { fontFamily: string; fontStyle: string; fontWeight: string | number; }; // Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead. function useResolvedFontFamily(props: IUseResolvedFontFamily) { const { fontFamily, fontStyle, fontWeight } = props; const { fontConfig, fontWeights, fonts } = useTheme(); const fontToken = fonts[fontFamily]; if (fontConfig && fontConfig[fontToken]) { // fontWeights are also specified using "400" const parsedFontWeight = parseInt(fontWeight as any); let fontWeightNumber = Number.isNaN(parsedFontWeight) ? fontWeights[fontWeight] : fontWeight; let fontVariants = fontConfig[fontToken][fontWeightNumber]; if (typeof fontVariants === 'object') { if (fontVariants[fontStyle]) return fontVariants[fontStyle]; } else { return fontVariants; } } } </s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; import { Text as NativeText } from 'react-native'; import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps'; </s> remove import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps'; </s> add </s> remove import { Text as NativeText } from 'react-native'; import { useTheme } from '../../../hooks'; </s> add </s> remove lineHeight: 6, // Todo: Move to _web inside size so that sm and xs don't have this much height </s> add lineHeight: 'lg', // Todo: Move to _web inside size so that sm and xs don't have this much height
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/d1e65b3a29701927408720f3afd2977ebc7f4733
src/components/primitives/Input/InputAddons.tsx