@adiraku/react-native-ui 0.2.3 → 1.0.0
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/components/BottomSheet/BottomSheet.component.js +44 -36
- package/lib/commonjs/components/BottomSheet/BottomSheet.component.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.style.js +8 -8
- package/lib/commonjs/components/BottomSheet/BottomSheet.style.js.map +1 -1
- package/lib/commonjs/components/TextInput/TextInput.component.js +3 -10
- package/lib/commonjs/components/TextInput/TextInput.component.js.map +1 -1
- package/lib/commonjs/components/index.js +6 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/rounded-tab/rounded-tab.component.js +19 -10
- package/lib/commonjs/components/rounded-tab/rounded-tab.component.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.component.js +44 -37
- package/lib/module/components/BottomSheet/BottomSheet.component.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.style.js +9 -9
- package/lib/module/components/BottomSheet/BottomSheet.style.js.map +1 -1
- package/lib/module/components/TextInput/TextInput.component.js +6 -10
- package/lib/module/components/TextInput/TextInput.component.js.map +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/rounded-tab/rounded-tab.component.js +19 -10
- package/lib/module/components/rounded-tab/rounded-tab.component.js.map +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.component.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.style.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.type.d.ts +6 -3
- package/lib/typescript/components/BottomSheet/BottomSheet.type.d.ts.map +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.type.d.ts +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.type.d.ts.map +1 -1
- package/lib/typescript/components/RadioInput/RadioInput.type.d.ts +1 -1
- package/lib/typescript/components/RadioInput/RadioInput.type.d.ts.map +1 -1
- package/lib/typescript/components/TextInput/TextInput.component.d.ts +0 -5
- package/lib/typescript/components/TextInput/TextInput.component.d.ts.map +1 -1
- package/lib/typescript/components/TextInput/TextInput.type.d.ts +2 -2
- package/lib/typescript/components/TextInput/TextInput.type.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -1
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/rounded-tab/rounded-tab.component.d.ts.map +1 -1
- package/lib/typescript/components/rounded-tab/rounded-tab.type.d.ts +6 -11
- package/lib/typescript/components/rounded-tab/rounded-tab.type.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/BottomSheet/BottomSheet.component.tsx +53 -55
- package/src/components/BottomSheet/BottomSheet.style.tsx +9 -8
- package/src/components/BottomSheet/BottomSheet.type.ts +6 -4
- package/src/components/CheckBoxInput/CheckBoxInput.type.ts +1 -1
- package/src/components/RadioInput/RadioInput.type.ts +1 -1
- package/src/components/TextInput/TextInput.component.tsx +9 -17
- package/src/components/TextInput/TextInput.type.ts +2 -2
- package/src/components/index.ts +4 -1
- package/src/components/rounded-tab/rounded-tab.component.tsx +18 -11
- package/src/components/rounded-tab/rounded-tab.type.ts +6 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ViewStyle, TextStyle } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { Palettes, Radius, Spacing } from '../../../src/themes';
|
|
5
5
|
|
|
@@ -31,16 +31,16 @@ export const getStyle = () => {
|
|
|
31
31
|
flex: 1,
|
|
32
32
|
justifyContent: 'flex-end',
|
|
33
33
|
};
|
|
34
|
-
computedStyle.overlayColor = {
|
|
35
|
-
backgroundColor: 'rgba(0,0,0,0.2)',
|
|
36
|
-
};
|
|
37
34
|
|
|
38
35
|
computedStyle.container = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
backgroundColor: Palettes.white[50],
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
bottom: 0,
|
|
39
|
+
width: '100%',
|
|
40
|
+
borderTopEndRadius: Spacing[16],
|
|
41
|
+
borderTopStartRadius: Spacing[16],
|
|
43
42
|
};
|
|
43
|
+
|
|
44
44
|
computedStyle.sliderIndicator = {
|
|
45
45
|
height: 5,
|
|
46
46
|
width: 100,
|
|
@@ -62,6 +62,7 @@ export const getStyle = () => {
|
|
|
62
62
|
|
|
63
63
|
computedStyle.sheetHeaderWrapper = {
|
|
64
64
|
paddingHorizontal: Spacing[16],
|
|
65
|
+
paddingBottom: Spacing[8],
|
|
65
66
|
};
|
|
66
67
|
computedStyle.sheetDismissIconWrapper = {
|
|
67
68
|
padding: 4,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { TextProps, TouchableHighlightProps } from 'react-native';
|
|
4
|
+
import type { ModalProps } from 'react-native-modal';
|
|
4
5
|
|
|
5
|
-
export interface BottomSheetProps {
|
|
6
|
+
export interface BottomSheetProps extends Omit<ModalProps, 'isVisible'> {
|
|
6
7
|
onDismiss?: () => void;
|
|
7
8
|
|
|
8
9
|
sheetHeader?: ReactNode;
|
|
@@ -27,9 +28,10 @@ export interface BottomSheetProps {
|
|
|
27
28
|
|
|
28
29
|
largeIconContainerHeight?: number;
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Decimal number between 0 - 1
|
|
33
|
+
*/
|
|
34
|
+
maxSheetHeight?: number;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export type BottomSheetRefHandle = {
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import MaskInput from 'react-native-mask-input';
|
|
4
|
-
|
|
5
|
-
import { Palettes } from '../../themes';
|
|
6
|
-
import { Typography } from '../typography/typography.component';
|
|
2
|
+
import { View } from 'react-native';
|
|
7
3
|
import { getStyle } from './TextInput.style';
|
|
8
|
-
|
|
9
4
|
import type { TextInputProps } from './TextInput.type';
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from 'react-native';
|
|
5
|
+
import { TextInput as RNTextInput } from 'react-native';
|
|
6
|
+
import { Typography } from '../typography/typography.component';
|
|
7
|
+
import { Animated } from 'react-native';
|
|
8
|
+
import { Palettes } from '../../themes';
|
|
9
|
+
import type { LayoutChangeEvent } from 'react-native';
|
|
10
|
+
import type { NativeSyntheticEvent } from 'react-native';
|
|
11
|
+
import type { TextInputFocusEventData } from 'react-native';
|
|
15
12
|
|
|
16
|
-
/**
|
|
17
|
-
* This component extend react-native-mask-input package
|
|
18
|
-
* read, please read react-native-mask-input documentation
|
|
19
|
-
* for further information
|
|
20
|
-
*/
|
|
21
13
|
const TextInput: React.FunctionComponent<TextInputProps> = (props) => {
|
|
22
14
|
const {
|
|
23
15
|
value,
|
|
@@ -101,7 +93,7 @@ const TextInput: React.FunctionComponent<TextInputProps> = (props) => {
|
|
|
101
93
|
</Typography>
|
|
102
94
|
</Animated.View>
|
|
103
95
|
<View style={computedStyle.inputWrapper}>
|
|
104
|
-
<
|
|
96
|
+
<RNTextInput
|
|
105
97
|
value={value}
|
|
106
98
|
style={[computedStyle.textField]}
|
|
107
99
|
onFocus={handleOnFocus}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TextInput } from 'react-native';
|
|
3
3
|
|
|
4
|
-
export interface TextInputProps extends
|
|
4
|
+
export interface TextInputProps extends React.ComponentProps<typeof TextInput> {
|
|
5
5
|
/**
|
|
6
6
|
* A string that specifies the label text for the input field.
|
|
7
7
|
*/
|
package/src/components/index.ts
CHANGED
|
@@ -11,7 +11,10 @@ export { StepperCounter } from './StepperCounter/StepperCounter.component';
|
|
|
11
11
|
export { Divider } from './Divider/Divider.component';
|
|
12
12
|
export { Tabs } from './Tabs/Tabs.component';
|
|
13
13
|
export { RadioButton } from './RadioButton/RadioButton.component';
|
|
14
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
BottomSheet,
|
|
16
|
+
BottomSheetHandler,
|
|
17
|
+
} from './BottomSheet/BottomSheet.component';
|
|
15
18
|
export { RadioInput } from './RadioInput/RadioInput.component';
|
|
16
19
|
export { CheckBoxInput } from './CheckBoxInput/CheckBoxInput.component';
|
|
17
20
|
export { Checkbox } from './Checkbox/Checkbox.component';
|
|
@@ -8,6 +8,7 @@ import { TouchableWithoutFeedback } from 'react-native';
|
|
|
8
8
|
import { Typography } from '../typography/typography.component';
|
|
9
9
|
import { Animated } from 'react-native';
|
|
10
10
|
import { FlatList } from 'react-native';
|
|
11
|
+
import { GestureResponderEvent } from 'react-native';
|
|
11
12
|
|
|
12
13
|
const RoundedTab: React.FunctionComponent<RoundedTabProps> = (props) => {
|
|
13
14
|
const { data = [], selectedValue = '', onTabItemPress = () => null } = props;
|
|
@@ -19,16 +20,20 @@ const RoundedTab: React.FunctionComponent<RoundedTabProps> = (props) => {
|
|
|
19
20
|
<FlatList
|
|
20
21
|
horizontal={true}
|
|
21
22
|
data={data}
|
|
22
|
-
renderItem={({ item }) =>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
renderItem={({ item }) => {
|
|
24
|
+
const { label, value, leading, trailing, ...rest } = item;
|
|
25
|
+
return (
|
|
26
|
+
<TabItem
|
|
27
|
+
label={label}
|
|
28
|
+
value={value}
|
|
29
|
+
isSelected={selectedValue === value}
|
|
30
|
+
leading={leading}
|
|
31
|
+
trailing={trailing}
|
|
32
|
+
onPress={onTabItemPress}
|
|
33
|
+
{...rest}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}}
|
|
32
37
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
33
38
|
ItemSeparatorComponent={() => (
|
|
34
39
|
<View style={[computedStyle.itemSeparator]} />
|
|
@@ -46,6 +51,7 @@ function TabItem(props: TabItemProps): JSX.Element {
|
|
|
46
51
|
onPress = () => null,
|
|
47
52
|
leading = null,
|
|
48
53
|
trailing = null,
|
|
54
|
+
...rest
|
|
49
55
|
} = props;
|
|
50
56
|
|
|
51
57
|
const computedStyle = getTabItemStyle(props);
|
|
@@ -76,7 +82,7 @@ function TabItem(props: TabItemProps): JSX.Element {
|
|
|
76
82
|
|
|
77
83
|
const onTabItemPress = () => {
|
|
78
84
|
if (!isSelected) {
|
|
79
|
-
onPress(value);
|
|
85
|
+
onPress(value as GestureResponderEvent);
|
|
80
86
|
}
|
|
81
87
|
};
|
|
82
88
|
|
|
@@ -85,6 +91,7 @@ function TabItem(props: TabItemProps): JSX.Element {
|
|
|
85
91
|
onPress={onTabItemPress}
|
|
86
92
|
onPressIn={onPressIn}
|
|
87
93
|
onPressOut={onPressOut}
|
|
94
|
+
{...rest}
|
|
88
95
|
>
|
|
89
96
|
<Animated.View style={[computedStyle.container, animatedScaleStyle]}>
|
|
90
97
|
{leading && (
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { TouchableWithoutFeedbackProps } from 'react-native';
|
|
2
3
|
|
|
3
4
|
export interface RoundedTabProps {
|
|
4
|
-
data:
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
leading?: ReactNode;
|
|
8
|
-
trailing?: ReactNode;
|
|
9
|
-
}[];
|
|
5
|
+
data: Omit<TabItemProps, 'isSelected'>[];
|
|
10
6
|
selectedValue: string;
|
|
11
|
-
onTabItemPress: (value:
|
|
7
|
+
onTabItemPress: (value: any) => void;
|
|
12
8
|
}
|
|
13
9
|
|
|
14
|
-
export type TabItemProps = {
|
|
10
|
+
export type TabItemProps = TouchableWithoutFeedbackProps & {
|
|
15
11
|
label: string;
|
|
16
|
-
value:
|
|
17
|
-
isSelected: boolean;
|
|
18
|
-
onPress: (value: string) => void;
|
|
12
|
+
value: any;
|
|
19
13
|
leading?: ReactNode;
|
|
20
14
|
trailing?: ReactNode;
|
|
15
|
+
isSelected: boolean;
|
|
21
16
|
};
|