@nexara/nativeflow 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/assets/svg/Check.js.map +1 -1
- package/lib/commonjs/assets/svg/X.js.map +1 -1
- package/lib/commonjs/assets/svg/index.js.map +1 -1
- package/lib/commonjs/components/Avatar/AvatarImage.js.map +1 -1
- package/lib/commonjs/components/Avatar/AvatarText.js.map +1 -1
- package/lib/commonjs/components/Avatar/index.js.map +1 -1
- package/lib/commonjs/components/Button/Button.js +9 -4
- package/lib/commonjs/components/Button/Button.js.map +1 -1
- package/lib/commonjs/components/Button/utils.js +17 -10
- package/lib/commonjs/components/Button/utils.js.map +1 -1
- package/lib/commonjs/components/CheckBox/CheckBox.js.map +1 -1
- package/lib/commonjs/components/Chip/Chip.js.map +1 -1
- package/lib/commonjs/components/Chip/utils.js.map +1 -1
- package/lib/commonjs/components/Dialog/Dialog.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogBody.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogDescription.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogFoot.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogHead.js.map +1 -1
- package/lib/commonjs/components/Dialog/index.js.map +1 -1
- package/lib/commonjs/components/Divider/Divider.js.map +1 -1
- package/lib/commonjs/components/Grid/Grid.js.map +1 -1
- package/lib/commonjs/components/Icon/Icon.js.map +1 -1
- package/lib/commonjs/components/IconButton/IconButton.js.map +1 -1
- package/lib/commonjs/components/Link/Link.js.map +1 -1
- package/lib/commonjs/components/Menu/Menu.js.map +1 -1
- package/lib/commonjs/components/Menu/MenuItem.js.map +1 -1
- package/lib/commonjs/components/Menu/MenuItemLabel.js.map +1 -1
- package/lib/commonjs/components/Menu/calculations.js.map +1 -1
- package/lib/commonjs/components/Menu/index.js.map +1 -1
- package/lib/commonjs/components/Portal/Portal.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalContext.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalProvider.js.map +1 -1
- package/lib/commonjs/components/Progress/Progress.js.map +1 -1
- package/lib/commonjs/components/Provider/ContextManager.js.map +1 -1
- package/lib/commonjs/components/Provider/NativeProvider.js.map +1 -1
- package/lib/commonjs/components/Radio/RadioGroup.js.map +1 -1
- package/lib/commonjs/components/Radio/RadioItem.js.map +1 -1
- package/lib/commonjs/components/Radio/index.js.map +1 -1
- package/lib/commonjs/components/Slider/Slider.js.map +1 -1
- package/lib/commonjs/components/Stack/HStack.js.map +1 -1
- package/lib/commonjs/components/Stack/VStack.js.map +1 -1
- package/lib/commonjs/components/Stack/index.js.map +1 -1
- package/lib/commonjs/components/StyledComponents/StyledText.js +3 -1
- package/lib/commonjs/components/StyledComponents/StyledText.js.map +1 -1
- package/lib/commonjs/components/StyledComponents/StyledView.js.map +1 -1
- package/lib/commonjs/components/StyledComponents/index.js.map +1 -1
- package/lib/commonjs/components/Surface/Surface.js +3 -3
- package/lib/commonjs/components/Surface/Surface.js.map +1 -1
- package/lib/commonjs/components/Switch/Switch.js.map +1 -1
- package/lib/commonjs/components/TouchableRipple/TouchableRipple.js.map +1 -1
- package/lib/commonjs/components/UserInput/UserInput.js.map +1 -1
- package/lib/commonjs/components/UserInput/UserInputV2.js.map +1 -1
- package/lib/commonjs/components/UserInput/generateColors.js.map +1 -1
- package/lib/commonjs/constants/breakPoints.js.map +1 -1
- package/lib/commonjs/constants/dialogSizes.js.map +1 -1
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/constants/theme.js.map +1 -1
- package/lib/commonjs/constants/typographySizes.js.map +1 -1
- package/lib/commonjs/helpers/CalculateGridSize.js +1 -1
- package/lib/commonjs/helpers/CalculateGridSize.js.map +1 -1
- package/lib/commonjs/helpers/DeviceSizeCategory.js.map +1 -1
- package/lib/commonjs/helpers/ResponsiveCalculations.js +4 -1
- package/lib/commonjs/helpers/ResponsiveCalculations.js.map +1 -1
- package/lib/commonjs/helpers/index.js.map +1 -1
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useColorScheme.js.map +1 -1
- package/lib/commonjs/hooks/useConditionalWindowDimension.js.map +1 -1
- package/lib/commonjs/hooks/useScalingMode.js.map +1 -1
- package/lib/commonjs/hooks/useTheme.js.map +1 -1
- package/lib/commonjs/index.d.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/themes/DarkTheme.js.map +1 -1
- package/lib/commonjs/themes/LightTheme.js.map +1 -1
- package/lib/commonjs/themes/index.js.map +1 -1
- package/lib/commonjs/types/avatar.type.js.map +1 -1
- package/lib/commonjs/types/button.type.js.map +1 -1
- package/lib/commonjs/types/checkbox.type.js.map +1 -1
- package/lib/commonjs/types/chip.type.js.map +1 -1
- package/lib/commonjs/types/common.type.js.map +1 -1
- package/lib/commonjs/types/dialog.type.js.map +1 -1
- package/lib/commonjs/types/divider.type.js.map +1 -1
- package/lib/commonjs/types/grid.type.js.map +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/link.type.js.map +1 -1
- package/lib/commonjs/types/menu.type.js.map +1 -1
- package/lib/commonjs/types/progress.type.js.map +1 -1
- package/lib/commonjs/types/radio.type.js.map +1 -1
- package/lib/commonjs/types/stack.type.js.map +1 -1
- package/lib/commonjs/types/styledComponents.type.js.map +1 -1
- package/lib/commonjs/types/surface.type.js.map +1 -1
- package/lib/commonjs/types/switch.type.js.map +1 -1
- package/lib/commonjs/types/userInput.type.js.map +1 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/assets/svg/Check.js.map +1 -1
- package/lib/module/assets/svg/X.js.map +1 -1
- package/lib/module/assets/svg/index.js.map +1 -1
- package/lib/module/components/Avatar/AvatarImage.js.map +1 -1
- package/lib/module/components/Avatar/AvatarText.js.map +1 -1
- package/lib/module/components/Avatar/index.js.map +1 -1
- package/lib/module/components/Button/Button.js +10 -5
- package/lib/module/components/Button/Button.js.map +1 -1
- package/lib/module/components/Button/utils.js +17 -10
- package/lib/module/components/Button/utils.js.map +1 -1
- package/lib/module/components/CheckBox/CheckBox.js.map +1 -1
- package/lib/module/components/Chip/Chip.js.map +1 -1
- package/lib/module/components/Chip/utils.js.map +1 -1
- package/lib/module/components/Dialog/Dialog.js.map +1 -1
- package/lib/module/components/Dialog/DialogBody.js.map +1 -1
- package/lib/module/components/Dialog/DialogDescription.js.map +1 -1
- package/lib/module/components/Dialog/DialogFoot.js.map +1 -1
- package/lib/module/components/Dialog/DialogHead.js.map +1 -1
- package/lib/module/components/Dialog/index.js.map +1 -1
- package/lib/module/components/Divider/Divider.js.map +1 -1
- package/lib/module/components/Grid/Grid.js.map +1 -1
- package/lib/module/components/Icon/Icon.js.map +1 -1
- package/lib/module/components/IconButton/IconButton.js.map +1 -1
- package/lib/module/components/Link/Link.js.map +1 -1
- package/lib/module/components/Menu/Menu.js.map +1 -1
- package/lib/module/components/Menu/MenuItem.js.map +1 -1
- package/lib/module/components/Menu/MenuItemLabel.js.map +1 -1
- package/lib/module/components/Menu/calculations.js.map +1 -1
- package/lib/module/components/Menu/index.js.map +1 -1
- package/lib/module/components/Portal/Portal.js.map +1 -1
- package/lib/module/components/Portal/PortalContext.js.map +1 -1
- package/lib/module/components/Portal/PortalProvider.js.map +1 -1
- package/lib/module/components/Progress/Progress.js.map +1 -1
- package/lib/module/components/Provider/ContextManager.js.map +1 -1
- package/lib/module/components/Provider/NativeProvider.js.map +1 -1
- package/lib/module/components/Radio/RadioGroup.js.map +1 -1
- package/lib/module/components/Radio/RadioItem.js.map +1 -1
- package/lib/module/components/Radio/index.js.map +1 -1
- package/lib/module/components/Slider/Slider.js.map +1 -1
- package/lib/module/components/Stack/HStack.js.map +1 -1
- package/lib/module/components/Stack/VStack.js.map +1 -1
- package/lib/module/components/Stack/index.js.map +1 -1
- package/lib/module/components/StyledComponents/StyledText.js +3 -1
- package/lib/module/components/StyledComponents/StyledText.js.map +1 -1
- package/lib/module/components/StyledComponents/StyledView.js.map +1 -1
- package/lib/module/components/StyledComponents/index.js.map +1 -1
- package/lib/module/components/Surface/Surface.js +3 -3
- package/lib/module/components/Surface/Surface.js.map +1 -1
- package/lib/module/components/Switch/Switch.js.map +1 -1
- package/lib/module/components/TouchableRipple/TouchableRipple.js.map +1 -1
- package/lib/module/components/UserInput/UserInput.js.map +1 -1
- package/lib/module/components/UserInput/UserInputV2.js.map +1 -1
- package/lib/module/components/UserInput/generateColors.js.map +1 -1
- package/lib/module/constants/breakPoints.js.map +1 -1
- package/lib/module/constants/dialogSizes.js.map +1 -1
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/constants/theme.js.map +1 -1
- package/lib/module/constants/typographySizes.js.map +1 -1
- package/lib/module/helpers/CalculateGridSize.js +1 -1
- package/lib/module/helpers/CalculateGridSize.js.map +1 -1
- package/lib/module/helpers/DeviceSizeCategory.js.map +1 -1
- package/lib/module/helpers/ResponsiveCalculations.js +4 -1
- package/lib/module/helpers/ResponsiveCalculations.js.map +1 -1
- package/lib/module/helpers/index.js.map +1 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useColorScheme.js.map +1 -1
- package/lib/module/hooks/useConditionalWindowDimension.js.map +1 -1
- package/lib/module/hooks/useScalingMode.js.map +1 -1
- package/lib/module/hooks/useTheme.js.map +1 -1
- package/lib/module/index.d.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/themes/DarkTheme.js.map +1 -1
- package/lib/module/themes/LightTheme.js.map +1 -1
- package/lib/module/themes/index.js.map +1 -1
- package/lib/module/types/avatar.type.js.map +1 -1
- package/lib/module/types/button.type.js.map +1 -1
- package/lib/module/types/checkbox.type.js.map +1 -1
- package/lib/module/types/chip.type.js.map +1 -1
- package/lib/module/types/common.type.js.map +1 -1
- package/lib/module/types/dialog.type.js.map +1 -1
- package/lib/module/types/divider.type.js.map +1 -1
- package/lib/module/types/grid.type.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/link.type.js.map +1 -1
- package/lib/module/types/menu.type.js.map +1 -1
- package/lib/module/types/progress.type.js.map +1 -1
- package/lib/module/types/radio.type.js.map +1 -1
- package/lib/module/types/stack.type.js.map +1 -1
- package/lib/module/types/styledComponents.type.js.map +1 -1
- package/lib/module/types/surface.type.js.map +1 -1
- package/lib/module/types/switch.type.js.map +1 -1
- package/lib/module/types/userInput.type.js.map +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/commonjs/src/components/Button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Button/utils.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Button/utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserInput/UserInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/button.type.d.ts +2 -0
- package/lib/typescript/commonjs/src/types/button.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/surface.type.d.ts +1 -1
- package/lib/typescript/commonjs/src/types/surface.type.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/Button.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/utils.d.ts +2 -1
- package/lib/typescript/module/src/components/Button/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserInput/UserInput.d.ts.map +1 -1
- package/lib/typescript/module/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
- package/lib/typescript/module/src/types/button.type.d.ts +2 -0
- package/lib/typescript/module/src/types/button.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/surface.type.d.ts +1 -1
- package/lib/typescript/module/src/types/surface.type.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/assets/svg/Check.tsx +16 -16
- package/src/assets/svg/X.tsx +15 -15
- package/src/assets/svg/index.ts +1 -1
- package/src/components/Avatar/AvatarImage.tsx +33 -33
- package/src/components/Avatar/AvatarText.tsx +34 -34
- package/src/components/Avatar/index.ts +8 -8
- package/src/components/Button/Button.tsx +216 -205
- package/src/components/Button/utils.ts +152 -141
- package/src/components/CheckBox/CheckBox.tsx +118 -118
- package/src/components/Chip/Chip.tsx +82 -82
- package/src/components/Chip/utils.ts +109 -109
- package/src/components/Dialog/Dialog.tsx +124 -124
- package/src/components/Dialog/DialogBody.tsx +31 -31
- package/src/components/Dialog/DialogDescription.tsx +27 -27
- package/src/components/Dialog/DialogFoot.tsx +35 -35
- package/src/components/Dialog/DialogHead.tsx +50 -50
- package/src/components/Dialog/index.ts +10 -10
- package/src/components/Divider/Divider.tsx +22 -22
- package/src/components/Grid/Grid.tsx +61 -61
- package/src/components/Icon/Icon.tsx +31 -31
- package/src/components/IconButton/IconButton.tsx +44 -44
- package/src/components/Link/Link.tsx +38 -38
- package/src/components/Menu/Menu.tsx +142 -142
- package/src/components/Menu/MenuItem.tsx +33 -33
- package/src/components/Menu/MenuItemLabel.tsx +21 -21
- package/src/components/Menu/calculations.ts +33 -33
- package/src/components/Menu/index.ts +7 -7
- package/src/components/Portal/Portal.tsx +18 -18
- package/src/components/Portal/PortalContext.tsx +9 -9
- package/src/components/Portal/PortalProvider.tsx +36 -36
- package/src/components/Progress/Progress.tsx +66 -66
- package/src/components/Provider/ContextManager.tsx +8 -8
- package/src/components/Provider/NativeProvider.tsx +72 -72
- package/src/components/Radio/RadioGroup.tsx +39 -39
- package/src/components/Radio/RadioItem.tsx +72 -72
- package/src/components/Radio/index.ts +8 -8
- package/src/components/Slider/Slider.tsx +45 -45
- package/src/components/Stack/HStack.tsx +32 -32
- package/src/components/Stack/VStack.tsx +26 -26
- package/src/components/Stack/index.ts +8 -8
- package/src/components/StyledComponents/StyledText.tsx +49 -49
- package/src/components/StyledComponents/StyledView.tsx +44 -44
- package/src/components/StyledComponents/index.tsx +5 -5
- package/src/components/Surface/Surface.tsx +31 -31
- package/src/components/Switch/Switch.tsx +36 -36
- package/src/components/TouchableRipple/TouchableRipple.tsx +92 -92
- package/src/components/UserInput/UserInput.tsx +135 -135
- package/src/components/UserInput/UserInputV2.tsx +132 -132
- package/src/components/UserInput/generateColors.ts +13 -13
- package/src/constants/breakPoints.ts +17 -17
- package/src/constants/dialogSizes.ts +11 -11
- package/src/constants/index.ts +2 -2
- package/src/constants/theme.ts +32 -32
- package/src/constants/typographySizes.ts +19 -19
- package/src/helpers/CalculateGridSize.ts +25 -25
- package/src/helpers/DeviceSizeCategory.ts +21 -21
- package/src/helpers/ResponsiveCalculations.ts +107 -104
- package/src/helpers/index.ts +2 -2
- package/src/hooks/index.ts +3 -3
- package/src/hooks/useColorScheme.tsx +11 -11
- package/src/hooks/useConditionalWindowDimension.tsx +7 -7
- package/src/hooks/useScalingMode.tsx +6 -6
- package/src/hooks/useTheme.tsx +12 -12
- package/src/index.d.ts +2 -2
- package/src/index.ts +52 -52
- package/src/themes/DarkTheme.ts +177 -177
- package/src/themes/LightTheme.ts +88 -88
- package/src/themes/index.ts +3 -3
- package/src/types/avatar.type.ts +40 -40
- package/src/types/button.type.ts +79 -76
- package/src/types/checkbox.type.ts +64 -64
- package/src/types/chip.type.ts +65 -65
- package/src/types/common.type.ts +109 -109
- package/src/types/dialog.type.ts +89 -89
- package/src/types/divider.type.ts +15 -15
- package/src/types/grid.type.ts +71 -71
- package/src/types/index.ts +16 -16
- package/src/types/link.type.ts +14 -14
- package/src/types/menu.type.ts +100 -100
- package/src/types/progress.type.ts +15 -15
- package/src/types/radio.type.ts +78 -78
- package/src/types/stack.type.ts +46 -46
- package/src/types/styledComponents.type.ts +70 -70
- package/src/types/surface.type.ts +19 -19
- package/src/types/switch.type.ts +39 -39
- package/src/types/userInput.type.ts +98 -98
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import { ScrollView } from 'react-native';
|
|
3
|
-
import { horizontalScale, verticalScale } from '../../helpers/ResponsiveCalculations';
|
|
4
|
-
import type { DialogBodyProps, StyledViewProps } from '../../types';
|
|
5
|
-
import { StyledView } from '../StyledComponents';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
interface props extends DialogBodyProps, StyledViewProps {
|
|
9
|
-
variant?: 'classic' | 'default';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const DialogBody: FC<props> = ({
|
|
13
|
-
variant,
|
|
14
|
-
scrollEnable = true,
|
|
15
|
-
containerStyle,
|
|
16
|
-
children,
|
|
17
|
-
...rest
|
|
18
|
-
}) => {
|
|
19
|
-
const style = {
|
|
20
|
-
paddingVertical: variant == 'default' ? verticalScale(16) : 0,
|
|
21
|
-
paddingHorizontal: horizontalScale(variant == 'default' ? 16 : 25),
|
|
22
|
-
};
|
|
23
|
-
return (<>
|
|
24
|
-
<ScrollView scrollEnabled={scrollEnable}>
|
|
25
|
-
<StyledView style={[style, containerStyle]} pointerEvents='box-none' {...rest}>
|
|
26
|
-
{children}
|
|
27
|
-
</StyledView>
|
|
28
|
-
</ScrollView>
|
|
29
|
-
</>);
|
|
30
|
-
}
|
|
31
|
-
export default DialogBody;
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { ScrollView } from 'react-native';
|
|
3
|
+
import { horizontalScale, verticalScale } from '../../helpers/ResponsiveCalculations';
|
|
4
|
+
import type { DialogBodyProps, StyledViewProps } from '../../types';
|
|
5
|
+
import { StyledView } from '../StyledComponents';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface props extends DialogBodyProps, StyledViewProps {
|
|
9
|
+
variant?: 'classic' | 'default';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const DialogBody: FC<props> = ({
|
|
13
|
+
variant,
|
|
14
|
+
scrollEnable = true,
|
|
15
|
+
containerStyle,
|
|
16
|
+
children,
|
|
17
|
+
...rest
|
|
18
|
+
}) => {
|
|
19
|
+
const style = {
|
|
20
|
+
paddingVertical: variant == 'default' ? verticalScale(16) : 0,
|
|
21
|
+
paddingHorizontal: horizontalScale(variant == 'default' ? 16 : 25),
|
|
22
|
+
};
|
|
23
|
+
return (<>
|
|
24
|
+
<ScrollView scrollEnabled={scrollEnable}>
|
|
25
|
+
<StyledView style={[style, containerStyle]} pointerEvents='box-none' {...rest}>
|
|
26
|
+
{children}
|
|
27
|
+
</StyledView>
|
|
28
|
+
</ScrollView>
|
|
29
|
+
</>);
|
|
30
|
+
}
|
|
31
|
+
export default DialogBody;
|
|
32
32
|
export type { DialogBodyProps };
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { verticalScale } from '../../helpers/ResponsiveCalculations';
|
|
4
|
-
import { StyledText } from '../StyledComponents';
|
|
5
|
-
import type { DialogDescriptionProps } from '../../types';
|
|
6
|
-
|
|
7
|
-
const DialogDescription: FC<DialogDescriptionProps> = ({
|
|
8
|
-
fScale = 'sm',
|
|
9
|
-
containerStyle,
|
|
10
|
-
textStyle,
|
|
11
|
-
children,
|
|
12
|
-
...rest
|
|
13
|
-
}) => {
|
|
14
|
-
return (<>
|
|
15
|
-
<View style={containerStyle}>
|
|
16
|
-
<StyledText
|
|
17
|
-
style={[{ lineHeight: verticalScale(20) }, textStyle]}
|
|
18
|
-
variant='tertiary'
|
|
19
|
-
fScale={fScale}
|
|
20
|
-
{...rest}
|
|
21
|
-
>
|
|
22
|
-
{children}
|
|
23
|
-
</StyledText>
|
|
24
|
-
</View>
|
|
25
|
-
</>);
|
|
26
|
-
}
|
|
27
|
-
export default DialogDescription;
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { verticalScale } from '../../helpers/ResponsiveCalculations';
|
|
4
|
+
import { StyledText } from '../StyledComponents';
|
|
5
|
+
import type { DialogDescriptionProps } from '../../types';
|
|
6
|
+
|
|
7
|
+
const DialogDescription: FC<DialogDescriptionProps> = ({
|
|
8
|
+
fScale = 'sm',
|
|
9
|
+
containerStyle,
|
|
10
|
+
textStyle,
|
|
11
|
+
children,
|
|
12
|
+
...rest
|
|
13
|
+
}) => {
|
|
14
|
+
return (<>
|
|
15
|
+
<View style={containerStyle}>
|
|
16
|
+
<StyledText
|
|
17
|
+
style={[{ lineHeight: verticalScale(20) }, textStyle]}
|
|
18
|
+
variant='tertiary'
|
|
19
|
+
fScale={fScale}
|
|
20
|
+
{...rest}
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</StyledText>
|
|
24
|
+
</View>
|
|
25
|
+
</>);
|
|
26
|
+
}
|
|
27
|
+
export default DialogDescription;
|
|
28
28
|
export type { DialogDescriptionProps };
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import { type ViewStyle } from 'react-native';
|
|
3
|
-
import { horizontalScale, verticalScale } from '../../helpers/ResponsiveCalculations';
|
|
4
|
-
import type { DialogFootProps } from '../../types';
|
|
5
|
-
import { useTheme } from '../../hooks';
|
|
6
|
-
import { StyledView } from '../StyledComponents';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interface props extends DialogFootProps {
|
|
10
|
-
variant?: 'classic' | 'default';
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const DialogFoot: FC<props> = ({
|
|
14
|
-
variant,
|
|
15
|
-
containerStyle,
|
|
16
|
-
children,
|
|
17
|
-
...rest
|
|
18
|
-
}) => {
|
|
19
|
-
const theme = useTheme();
|
|
20
|
-
|
|
21
|
-
const dynamicStyles: ViewStyle = {
|
|
22
|
-
borderTopWidth: variant === 'default' ? 0.7 : 0,
|
|
23
|
-
borderColor: theme?.colors.border.subtle,
|
|
24
|
-
padding: verticalScale(variant === 'default' ? 16 : 20),
|
|
25
|
-
paddingHorizontal: horizontalScale(variant === 'default' ? 16 : 25),
|
|
26
|
-
justifyContent: 'flex-end',
|
|
27
|
-
flexDirection: 'row'
|
|
28
|
-
};
|
|
29
|
-
return (<>
|
|
30
|
-
<StyledView style={[dynamicStyles, containerStyle]} {...rest}>
|
|
31
|
-
{children}
|
|
32
|
-
</StyledView>
|
|
33
|
-
</>);
|
|
34
|
-
}
|
|
35
|
-
export default DialogFoot;
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type ViewStyle } from 'react-native';
|
|
3
|
+
import { horizontalScale, verticalScale } from '../../helpers/ResponsiveCalculations';
|
|
4
|
+
import type { DialogFootProps } from '../../types';
|
|
5
|
+
import { useTheme } from '../../hooks';
|
|
6
|
+
import { StyledView } from '../StyledComponents';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
interface props extends DialogFootProps {
|
|
10
|
+
variant?: 'classic' | 'default';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const DialogFoot: FC<props> = ({
|
|
14
|
+
variant,
|
|
15
|
+
containerStyle,
|
|
16
|
+
children,
|
|
17
|
+
...rest
|
|
18
|
+
}) => {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
|
|
21
|
+
const dynamicStyles: ViewStyle = {
|
|
22
|
+
borderTopWidth: variant === 'default' ? 0.7 : 0,
|
|
23
|
+
borderColor: theme?.colors.border.subtle,
|
|
24
|
+
padding: verticalScale(variant === 'default' ? 16 : 20),
|
|
25
|
+
paddingHorizontal: horizontalScale(variant === 'default' ? 16 : 25),
|
|
26
|
+
justifyContent: 'flex-end',
|
|
27
|
+
flexDirection: 'row'
|
|
28
|
+
};
|
|
29
|
+
return (<>
|
|
30
|
+
<StyledView style={[dynamicStyles, containerStyle]} {...rest}>
|
|
31
|
+
{children}
|
|
32
|
+
</StyledView>
|
|
33
|
+
</>);
|
|
34
|
+
}
|
|
35
|
+
export default DialogFoot;
|
|
36
36
|
export type { DialogFootProps };
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { useMemo, type FC } from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import { verticalScale } from '../../helpers/ResponsiveCalculations';
|
|
4
|
-
import { StyledText } from '../StyledComponents';
|
|
5
|
-
import type { DialogHeadProps } from '../../types';
|
|
6
|
-
import { useTheme } from '../../hooks';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interface props extends DialogHeadProps {
|
|
10
|
-
variant?: 'classic' | 'default';
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const DialogHead: FC<props> = ({
|
|
14
|
-
variant = 'default',
|
|
15
|
-
title,
|
|
16
|
-
fScale = 'xl',
|
|
17
|
-
fs,
|
|
18
|
-
ff,
|
|
19
|
-
containerStyle,
|
|
20
|
-
titleStyle,
|
|
21
|
-
children
|
|
22
|
-
}) => {
|
|
23
|
-
const theme = useTheme();
|
|
24
|
-
const STYLES = useMemo(Styles, []);
|
|
25
|
-
|
|
26
|
-
const dynamicStyles = {
|
|
27
|
-
borderBottomWidth: variant == 'default' ? 0.7 : 0,
|
|
28
|
-
borderColor: theme?.colors.border.subtle,
|
|
29
|
-
padding: verticalScale(variant === 'default' ? 16 : 25),
|
|
30
|
-
};
|
|
31
|
-
return (<>
|
|
32
|
-
<View style={[STYLES.CONTAINER, dynamicStyles, containerStyle]}>
|
|
33
|
-
<StyledText style={[STYLES.HEADER_TEXT, titleStyle]} fs={fs} ff={ff} fScale={fScale}>{title || children}</StyledText>
|
|
34
|
-
</View>
|
|
35
|
-
</>);
|
|
36
|
-
}
|
|
37
|
-
export default DialogHead;
|
|
38
|
-
export type { DialogHeadProps };
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const Styles = () => StyleSheet.create({
|
|
42
|
-
CONTAINER: {
|
|
43
|
-
paddingBottom: verticalScale(16),
|
|
44
|
-
justifyContent: 'space-between',
|
|
45
|
-
flexDirection: 'row',
|
|
46
|
-
},
|
|
47
|
-
HEADER_TEXT: {
|
|
48
|
-
fontWeight: 'bold',
|
|
49
|
-
}
|
|
50
|
-
});
|
|
1
|
+
import { useMemo, type FC } from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import { verticalScale } from '../../helpers/ResponsiveCalculations';
|
|
4
|
+
import { StyledText } from '../StyledComponents';
|
|
5
|
+
import type { DialogHeadProps } from '../../types';
|
|
6
|
+
import { useTheme } from '../../hooks';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
interface props extends DialogHeadProps {
|
|
10
|
+
variant?: 'classic' | 'default';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const DialogHead: FC<props> = ({
|
|
14
|
+
variant = 'default',
|
|
15
|
+
title,
|
|
16
|
+
fScale = 'xl',
|
|
17
|
+
fs,
|
|
18
|
+
ff,
|
|
19
|
+
containerStyle,
|
|
20
|
+
titleStyle,
|
|
21
|
+
children
|
|
22
|
+
}) => {
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
const STYLES = useMemo(Styles, []);
|
|
25
|
+
|
|
26
|
+
const dynamicStyles = {
|
|
27
|
+
borderBottomWidth: variant == 'default' ? 0.7 : 0,
|
|
28
|
+
borderColor: theme?.colors.border.subtle,
|
|
29
|
+
padding: verticalScale(variant === 'default' ? 16 : 25),
|
|
30
|
+
};
|
|
31
|
+
return (<>
|
|
32
|
+
<View style={[STYLES.CONTAINER, dynamicStyles, containerStyle]}>
|
|
33
|
+
<StyledText style={[STYLES.HEADER_TEXT, titleStyle]} fs={fs} ff={ff} fScale={fScale}>{title || children}</StyledText>
|
|
34
|
+
</View>
|
|
35
|
+
</>);
|
|
36
|
+
}
|
|
37
|
+
export default DialogHead;
|
|
38
|
+
export type { DialogHeadProps };
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
const Styles = () => StyleSheet.create({
|
|
42
|
+
CONTAINER: {
|
|
43
|
+
paddingBottom: verticalScale(16),
|
|
44
|
+
justifyContent: 'space-between',
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
},
|
|
47
|
+
HEADER_TEXT: {
|
|
48
|
+
fontWeight: 'bold',
|
|
49
|
+
}
|
|
50
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { default as Dialog } from './Dialog';
|
|
2
|
-
export { default as DialogHead } from './DialogHead';
|
|
3
|
-
export { default as DialogBody } from './DialogBody';
|
|
4
|
-
export { default as DialogFoot } from './DialogFoot';
|
|
5
|
-
export { default as DialogDescription } from './DialogDescription';
|
|
6
|
-
|
|
7
|
-
export type { DialogProps } from './Dialog';
|
|
8
|
-
export type { DialogHeadProps } from './DialogHead';
|
|
9
|
-
export type { DialogBodyProps } from './DialogBody';
|
|
10
|
-
export type { DialogFootProps } from './DialogFoot';
|
|
1
|
+
export { default as Dialog } from './Dialog';
|
|
2
|
+
export { default as DialogHead } from './DialogHead';
|
|
3
|
+
export { default as DialogBody } from './DialogBody';
|
|
4
|
+
export { default as DialogFoot } from './DialogFoot';
|
|
5
|
+
export { default as DialogDescription } from './DialogDescription';
|
|
6
|
+
|
|
7
|
+
export type { DialogProps } from './Dialog';
|
|
8
|
+
export type { DialogHeadProps } from './DialogHead';
|
|
9
|
+
export type { DialogBodyProps } from './DialogBody';
|
|
10
|
+
export type { DialogFootProps } from './DialogFoot';
|
|
11
11
|
export type { DialogDescriptionProps } from './DialogDescription';
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import { StyledView } from '../StyledComponents';
|
|
3
|
-
import { useTheme } from '../../hooks';
|
|
4
|
-
import type { DividerProps } from '../../types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const Divider: FC<DividerProps> = ({
|
|
8
|
-
thickness = 0.7,
|
|
9
|
-
color,
|
|
10
|
-
style
|
|
11
|
-
}) => {
|
|
12
|
-
const theme = useTheme();
|
|
13
|
-
const dynamicStyles = {
|
|
14
|
-
borderWidth: thickness,
|
|
15
|
-
borderColor: color ?? theme?.colors.border.subtle
|
|
16
|
-
};
|
|
17
|
-
return (
|
|
18
|
-
<StyledView style={[dynamicStyles, style]} />
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
export default Divider;
|
|
22
|
-
export type { DividerProps };
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { StyledView } from '../StyledComponents';
|
|
3
|
+
import { useTheme } from '../../hooks';
|
|
4
|
+
import type { DividerProps } from '../../types';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const Divider: FC<DividerProps> = ({
|
|
8
|
+
thickness = 0.7,
|
|
9
|
+
color,
|
|
10
|
+
style
|
|
11
|
+
}) => {
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const dynamicStyles = {
|
|
14
|
+
borderWidth: thickness,
|
|
15
|
+
borderColor: color ?? theme?.colors.border.subtle
|
|
16
|
+
};
|
|
17
|
+
return (
|
|
18
|
+
<StyledView style={[dynamicStyles, style]} />
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export default Divider;
|
|
22
|
+
export type { DividerProps };
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { useMemo, type FC } from 'react';
|
|
2
|
-
import { StyleSheet } from "react-native";
|
|
3
|
-
import { getGridValue } from '../../helpers';
|
|
4
|
-
import { useConditionalWindowDimension } from '../../hooks';
|
|
5
|
-
import type { GridProps } from '../../types';
|
|
6
|
-
import { StyledView } from '../StyledComponents';
|
|
7
|
-
|
|
8
|
-
const Grid: FC<GridProps> = ({
|
|
9
|
-
container = false,
|
|
10
|
-
item = false,
|
|
11
|
-
spacing = 0,
|
|
12
|
-
spacingH = 0,
|
|
13
|
-
spacingV = 0,
|
|
14
|
-
size = 12,
|
|
15
|
-
xs = 12,
|
|
16
|
-
sm = 0,
|
|
17
|
-
md = 0,
|
|
18
|
-
lg = 0,
|
|
19
|
-
xl = 0,
|
|
20
|
-
containerStyle,
|
|
21
|
-
children,
|
|
22
|
-
...rest
|
|
23
|
-
}) => {
|
|
24
|
-
container = !item;
|
|
25
|
-
xs = Math.min(xs, 12);
|
|
26
|
-
sm = Math.min(sm, 12);
|
|
27
|
-
md = Math.min(md, 12);
|
|
28
|
-
lg = Math.min(lg, 12);
|
|
29
|
-
xl = Math.min(xl, 12);
|
|
30
|
-
|
|
31
|
-
const { width: windowWidth } = useConditionalWindowDimension(item);
|
|
32
|
-
|
|
33
|
-
const calculatedGridValue: number = item ? useMemo(() => getGridValue({
|
|
34
|
-
xs,
|
|
35
|
-
sm,
|
|
36
|
-
md,
|
|
37
|
-
lg,
|
|
38
|
-
xl,
|
|
39
|
-
}, windowWidth), [windowWidth, xs, sm, md, lg, xl]) : 12;
|
|
40
|
-
|
|
41
|
-
const STYLES = StyleSheet.create({
|
|
42
|
-
MAIN_CONT: {
|
|
43
|
-
width: item ? `${((calculatedGridValue / size) * 100)}%` : "100%",
|
|
44
|
-
flexDirection: 'row',
|
|
45
|
-
flexWrap: container ? 'wrap' : 'nowrap',
|
|
46
|
-
paddingHorizontal: spacingH,
|
|
47
|
-
paddingVertical: spacingV,
|
|
48
|
-
gap: spacing,
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
return (<>
|
|
52
|
-
<StyledView
|
|
53
|
-
style={[STYLES.MAIN_CONT, containerStyle]}
|
|
54
|
-
{...rest}
|
|
55
|
-
>
|
|
56
|
-
{children}
|
|
57
|
-
</StyledView>
|
|
58
|
-
</>);
|
|
59
|
-
};
|
|
60
|
-
export default Grid;
|
|
61
|
-
export type { GridProps };
|
|
1
|
+
import { useMemo, type FC } from 'react';
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import { getGridValue } from '../../helpers';
|
|
4
|
+
import { useConditionalWindowDimension } from '../../hooks';
|
|
5
|
+
import type { GridProps } from '../../types';
|
|
6
|
+
import { StyledView } from '../StyledComponents';
|
|
7
|
+
|
|
8
|
+
const Grid: FC<GridProps> = ({
|
|
9
|
+
container = false,
|
|
10
|
+
item = false,
|
|
11
|
+
spacing = 0,
|
|
12
|
+
spacingH = 0,
|
|
13
|
+
spacingV = 0,
|
|
14
|
+
size = 12,
|
|
15
|
+
xs = 12,
|
|
16
|
+
sm = 0,
|
|
17
|
+
md = 0,
|
|
18
|
+
lg = 0,
|
|
19
|
+
xl = 0,
|
|
20
|
+
containerStyle,
|
|
21
|
+
children,
|
|
22
|
+
...rest
|
|
23
|
+
}) => {
|
|
24
|
+
container = !item;
|
|
25
|
+
xs = Math.min(xs, 12);
|
|
26
|
+
sm = Math.min(sm, 12);
|
|
27
|
+
md = Math.min(md, 12);
|
|
28
|
+
lg = Math.min(lg, 12);
|
|
29
|
+
xl = Math.min(xl, 12);
|
|
30
|
+
|
|
31
|
+
const { width: windowWidth } = useConditionalWindowDimension(item);
|
|
32
|
+
|
|
33
|
+
const calculatedGridValue: number = item ? useMemo(() => getGridValue({
|
|
34
|
+
xs,
|
|
35
|
+
sm,
|
|
36
|
+
md,
|
|
37
|
+
lg,
|
|
38
|
+
xl,
|
|
39
|
+
}, windowWidth), [windowWidth, xs, sm, md, lg, xl]) : 12;
|
|
40
|
+
|
|
41
|
+
const STYLES = StyleSheet.create({
|
|
42
|
+
MAIN_CONT: {
|
|
43
|
+
width: item ? `${((calculatedGridValue / size) * 100)}%` : "100%",
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
flexWrap: container ? 'wrap' : 'nowrap',
|
|
46
|
+
paddingHorizontal: spacingH,
|
|
47
|
+
paddingVertical: spacingV,
|
|
48
|
+
gap: spacing,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
return (<>
|
|
52
|
+
<StyledView
|
|
53
|
+
style={[STYLES.MAIN_CONT, containerStyle]}
|
|
54
|
+
{...rest}
|
|
55
|
+
>
|
|
56
|
+
{children}
|
|
57
|
+
</StyledView>
|
|
58
|
+
</>);
|
|
59
|
+
};
|
|
60
|
+
export default Grid;
|
|
61
|
+
export type { GridProps };
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import React, { useMemo, type JSX } from "react";
|
|
2
|
-
import { verticalScale } from "../../helpers/ResponsiveCalculations";
|
|
3
|
-
import { useTheme } from "../../hooks";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type IconProps = {
|
|
7
|
-
renderIcon: JSX.Element;
|
|
8
|
-
color?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const Icon: React.FC<IconProps> = ({
|
|
12
|
-
renderIcon,
|
|
13
|
-
color
|
|
14
|
-
}) => {
|
|
15
|
-
const theme = useTheme(!color && !renderIcon?.props.color);
|
|
16
|
-
|
|
17
|
-
const renderCallBackIcon = useMemo(() => {
|
|
18
|
-
return React.cloneElement(renderIcon as React.ReactElement<any>,
|
|
19
|
-
{
|
|
20
|
-
...renderIcon?.props,
|
|
21
|
-
size: verticalScale(renderIcon?.props?.size ?? 17),
|
|
22
|
-
color: color ?? (renderIcon?.props.color ?? theme?.colors.typography.secondary)
|
|
23
|
-
}
|
|
24
|
-
)
|
|
25
|
-
}, [color, theme, renderIcon.props]);
|
|
26
|
-
|
|
27
|
-
return (<>
|
|
28
|
-
{renderCallBackIcon}
|
|
29
|
-
</>)
|
|
30
|
-
}
|
|
31
|
-
export default Icon;
|
|
1
|
+
import React, { useMemo, type JSX } from "react";
|
|
2
|
+
import { verticalScale } from "../../helpers/ResponsiveCalculations";
|
|
3
|
+
import { useTheme } from "../../hooks";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
type IconProps = {
|
|
7
|
+
renderIcon: JSX.Element;
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Icon: React.FC<IconProps> = ({
|
|
12
|
+
renderIcon,
|
|
13
|
+
color
|
|
14
|
+
}) => {
|
|
15
|
+
const theme = useTheme(!color && !renderIcon?.props.color);
|
|
16
|
+
|
|
17
|
+
const renderCallBackIcon = useMemo(() => {
|
|
18
|
+
return React.cloneElement(renderIcon as React.ReactElement<any>,
|
|
19
|
+
{
|
|
20
|
+
...renderIcon?.props,
|
|
21
|
+
size: verticalScale(renderIcon?.props?.size ?? 17),
|
|
22
|
+
color: color ?? (renderIcon?.props.color ?? theme?.colors.typography.secondary)
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}, [color, theme, renderIcon.props]);
|
|
26
|
+
|
|
27
|
+
return (<>
|
|
28
|
+
{renderCallBackIcon}
|
|
29
|
+
</>)
|
|
30
|
+
}
|
|
31
|
+
export default Icon;
|
|
32
32
|
export type { IconProps };
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import React, { isValidElement } from "react";
|
|
2
|
-
import type { ReactElement } from "react";
|
|
3
|
-
import { TouchableOpacity, type TouchableOpacityProps } from "react-native";
|
|
4
|
-
import Icon from "../Icon/Icon";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type IconButtonProps = TouchableOpacityProps & {
|
|
8
|
-
rippleColor?: string;
|
|
9
|
-
children?: ReactElement<{ size: number }>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const IconButton: React.FC<IconButtonProps> = ({
|
|
13
|
-
rippleColor,
|
|
14
|
-
children,
|
|
15
|
-
style,
|
|
16
|
-
...rest
|
|
17
|
-
}) => {
|
|
18
|
-
|
|
19
|
-
let size = 40;
|
|
20
|
-
|
|
21
|
-
if (!(isValidElement(children) && 'size' in children.props)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
size = children.props.size! * 1.5;
|
|
25
|
-
|
|
26
|
-
return (<>
|
|
27
|
-
<TouchableOpacity
|
|
28
|
-
// rippleColor={rippleColor}
|
|
29
|
-
style={[{
|
|
30
|
-
borderRadius: 100,
|
|
31
|
-
height: size,
|
|
32
|
-
width: size,
|
|
33
|
-
justifyContent: 'center',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
}, style]}
|
|
36
|
-
{...rest}
|
|
37
|
-
>
|
|
38
|
-
<Icon
|
|
39
|
-
renderIcon={React.cloneElement(children as React.ReactElement<any>)}
|
|
40
|
-
/>
|
|
41
|
-
</TouchableOpacity>
|
|
42
|
-
</>)
|
|
43
|
-
}
|
|
44
|
-
export default IconButton;
|
|
1
|
+
import React, { isValidElement } from "react";
|
|
2
|
+
import type { ReactElement } from "react";
|
|
3
|
+
import { TouchableOpacity, type TouchableOpacityProps } from "react-native";
|
|
4
|
+
import Icon from "../Icon/Icon";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
type IconButtonProps = TouchableOpacityProps & {
|
|
8
|
+
rippleColor?: string;
|
|
9
|
+
children?: ReactElement<{ size: number }>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const IconButton: React.FC<IconButtonProps> = ({
|
|
13
|
+
rippleColor,
|
|
14
|
+
children,
|
|
15
|
+
style,
|
|
16
|
+
...rest
|
|
17
|
+
}) => {
|
|
18
|
+
|
|
19
|
+
let size = 40;
|
|
20
|
+
|
|
21
|
+
if (!(isValidElement(children) && 'size' in children.props)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
size = children.props.size! * 1.5;
|
|
25
|
+
|
|
26
|
+
return (<>
|
|
27
|
+
<TouchableOpacity
|
|
28
|
+
// rippleColor={rippleColor}
|
|
29
|
+
style={[{
|
|
30
|
+
borderRadius: 100,
|
|
31
|
+
height: size,
|
|
32
|
+
width: size,
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
}, style]}
|
|
36
|
+
{...rest}
|
|
37
|
+
>
|
|
38
|
+
<Icon
|
|
39
|
+
renderIcon={React.cloneElement(children as React.ReactElement<any>)}
|
|
40
|
+
/>
|
|
41
|
+
</TouchableOpacity>
|
|
42
|
+
</>)
|
|
43
|
+
}
|
|
44
|
+
export default IconButton;
|
|
45
45
|
export type { IconButtonProps };
|