@adiraku/react-native-ui 1.2.0 → 1.2.2
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/Appbar/Appbar.component.js +6 -4
- package/lib/commonjs/components/Appbar/Appbar.component.js.map +1 -1
- package/lib/commonjs/components/Appbar/Appbar.style.js +9 -2
- package/lib/commonjs/components/Appbar/Appbar.style.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.component.js +6 -23
- package/lib/commonjs/components/BottomSheet/BottomSheet.component.js.map +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.style.js +11 -4
- package/lib/commonjs/components/BottomSheet/BottomSheet.style.js.map +1 -1
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.component.js +18 -10
- package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.component.js.map +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.component.js +5 -3
- package/lib/commonjs/components/Checkbox/Checkbox.component.js.map +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.type.js +4 -0
- package/lib/commonjs/components/RadioButton/RadioButton.component.js +5 -3
- package/lib/commonjs/components/RadioButton/RadioButton.component.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.type.js +4 -0
- package/lib/commonjs/components/RadioInput/RadioInput.component.js +18 -10
- package/lib/commonjs/components/RadioInput/RadioInput.component.js.map +1 -1
- package/lib/commonjs/components/Tabs/Tabs.component.js +1 -0
- package/lib/commonjs/components/Tabs/Tabs.component.js.map +1 -1
- package/lib/commonjs/components/TextArea/TextArea.component.js +3 -2
- package/lib/commonjs/components/TextArea/TextArea.component.js.map +1 -1
- package/lib/commonjs/components/TextInput/TextInput.component.js +6 -3
- package/lib/commonjs/components/TextInput/TextInput.component.js.map +1 -1
- package/lib/commonjs/components/index.js +62 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/rounded-tab/rounded-tab.component.js +7 -2
- package/lib/commonjs/components/rounded-tab/rounded-tab.component.js.map +1 -1
- package/lib/commonjs/components/search-input/search-input.component.js +57 -0
- package/lib/commonjs/components/search-input/search-input.component.js.map +1 -0
- package/lib/commonjs/components/search-input/search-input.style.js +34 -0
- package/lib/commonjs/components/search-input/search-input.style.js.map +1 -0
- package/lib/commonjs/components/search-input/search-input.type.js +6 -0
- package/lib/commonjs/components/search-input/search-input.type.js.map +1 -0
- package/lib/commonjs/components/textlink/textlink.component.js +7 -2
- package/lib/commonjs/components/textlink/textlink.component.js.map +1 -1
- package/lib/module/components/Appbar/Appbar.component.js +6 -4
- package/lib/module/components/Appbar/Appbar.component.js.map +1 -1
- package/lib/module/components/Appbar/Appbar.style.js +9 -2
- package/lib/module/components/Appbar/Appbar.style.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.component.js +7 -25
- package/lib/module/components/BottomSheet/BottomSheet.component.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.style.js +11 -4
- package/lib/module/components/BottomSheet/BottomSheet.style.js.map +1 -1
- package/lib/module/components/CheckBoxInput/CheckBoxInput.component.js +18 -10
- package/lib/module/components/CheckBoxInput/CheckBoxInput.component.js.map +1 -1
- package/lib/module/components/Checkbox/Checkbox.component.js +5 -3
- package/lib/module/components/Checkbox/Checkbox.component.js.map +1 -1
- package/lib/module/components/Checkbox/Checkbox.type.js +1 -1
- package/lib/module/components/RadioButton/RadioButton.component.js +5 -3
- package/lib/module/components/RadioButton/RadioButton.component.js.map +1 -1
- package/lib/module/components/RadioButton/RadioButton.type.js +1 -1
- package/lib/module/components/RadioInput/RadioInput.component.js +18 -10
- package/lib/module/components/RadioInput/RadioInput.component.js.map +1 -1
- package/lib/module/components/Tabs/Tabs.component.js +1 -0
- package/lib/module/components/Tabs/Tabs.component.js.map +1 -1
- package/lib/module/components/TextArea/TextArea.component.js +3 -2
- package/lib/module/components/TextArea/TextArea.component.js.map +1 -1
- package/lib/module/components/TextInput/TextInput.component.js +5 -4
- package/lib/module/components/TextInput/TextInput.component.js.map +1 -1
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/rounded-tab/rounded-tab.component.js +7 -2
- package/lib/module/components/rounded-tab/rounded-tab.component.js.map +1 -1
- package/lib/module/components/search-input/search-input.component.js +50 -0
- package/lib/module/components/search-input/search-input.component.js.map +1 -0
- package/lib/module/components/search-input/search-input.style.js +27 -0
- package/lib/module/components/search-input/search-input.style.js.map +1 -0
- package/lib/module/components/search-input/search-input.type.js +2 -0
- package/lib/module/components/search-input/search-input.type.js.map +1 -0
- package/lib/module/components/textlink/textlink.component.js +7 -2
- package/lib/module/components/textlink/textlink.component.js.map +1 -1
- package/lib/typescript/components/Appbar/Appbar.component.d.ts.map +1 -1
- package/lib/typescript/components/Appbar/Appbar.style.d.ts +3 -1
- package/lib/typescript/components/Appbar/Appbar.style.d.ts.map +1 -1
- package/lib/typescript/components/Appbar/Appbar.type.d.ts +2 -0
- package/lib/typescript/components/Appbar/Appbar.type.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.component.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.style.d.ts +1 -0
- package/lib/typescript/components/BottomSheet/BottomSheet.style.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet/BottomSheet.type.d.ts +2 -2
- package/lib/typescript/components/BottomSheet/BottomSheet.type.d.ts.map +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.component.d.ts.map +1 -1
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.type.d.ts +7 -4
- package/lib/typescript/components/CheckBoxInput/CheckBoxInput.type.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/Checkbox.component.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/Checkbox.type.d.ts +2 -1
- package/lib/typescript/components/Checkbox/Checkbox.type.d.ts.map +1 -1
- package/lib/typescript/components/RadioButton/RadioButton.component.d.ts.map +1 -1
- package/lib/typescript/components/RadioButton/RadioButton.type.d.ts +2 -1
- package/lib/typescript/components/RadioButton/RadioButton.type.d.ts.map +1 -1
- package/lib/typescript/components/RadioInput/RadioInput.component.d.ts.map +1 -1
- package/lib/typescript/components/RadioInput/RadioInput.type.d.ts +7 -4
- package/lib/typescript/components/RadioInput/RadioInput.type.d.ts.map +1 -1
- package/lib/typescript/components/Tabs/Tabs.component.d.ts.map +1 -1
- package/lib/typescript/components/TextArea/TextArea.component.d.ts.map +1 -1
- package/lib/typescript/components/TextArea/TextArea.type.d.ts +2 -0
- package/lib/typescript/components/TextArea/TextArea.type.d.ts.map +1 -1
- package/lib/typescript/components/TextInput/TextInput.component.d.ts.map +1 -1
- package/lib/typescript/components/TextInput/TextInput.type.d.ts +4 -2
- package/lib/typescript/components/TextInput/TextInput.type.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +3 -0
- 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 +3 -1
- package/lib/typescript/components/rounded-tab/rounded-tab.type.d.ts.map +1 -1
- package/lib/typescript/components/search-input/search-input.component.d.ts +4 -0
- package/lib/typescript/components/search-input/search-input.component.d.ts.map +1 -0
- package/lib/typescript/components/search-input/search-input.style.d.ts +10 -0
- package/lib/typescript/components/search-input/search-input.style.d.ts.map +1 -0
- package/lib/typescript/components/search-input/search-input.type.d.ts +7 -0
- package/lib/typescript/components/search-input/search-input.type.d.ts.map +1 -0
- package/lib/typescript/components/textlink/textlink.component.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/components/Appbar/Appbar.component.tsx +35 -34
- package/src/components/Appbar/Appbar.style.tsx +9 -2
- package/src/components/Appbar/Appbar.type.ts +4 -0
- package/src/components/BottomSheet/BottomSheet.component.tsx +32 -53
- package/src/components/BottomSheet/BottomSheet.style.tsx +11 -2
- package/src/components/BottomSheet/BottomSheet.type.ts +3 -2
- package/src/components/CheckBoxInput/CheckBoxInput.component.tsx +18 -2
- package/src/components/CheckBoxInput/CheckBoxInput.type.ts +7 -5
- package/src/components/Checkbox/Checkbox.component.tsx +2 -1
- package/src/components/Checkbox/Checkbox.type.ts +3 -1
- package/src/components/RadioButton/RadioButton.component.tsx +2 -1
- package/src/components/RadioButton/RadioButton.type.ts +3 -1
- package/src/components/RadioInput/RadioInput.component.tsx +18 -2
- package/src/components/RadioInput/RadioInput.type.ts +7 -5
- package/src/components/Tabs/Tabs.component.tsx +1 -0
- package/src/components/TextArea/TextArea.component.tsx +6 -1
- package/src/components/TextArea/TextArea.type.ts +2 -0
- package/src/components/TextInput/TextInput.component.tsx +8 -3
- package/src/components/TextInput/TextInput.type.ts +4 -2
- package/src/components/index.ts +13 -0
- package/src/components/rounded-tab/rounded-tab.component.tsx +11 -2
- package/src/components/rounded-tab/rounded-tab.type.ts +3 -1
- package/src/components/search-input/search-input.component.tsx +66 -0
- package/src/components/search-input/search-input.style.ts +38 -0
- package/src/components/search-input/search-input.type.ts +7 -0
- package/src/components/textlink/textlink.component.tsx +6 -0
|
@@ -11,19 +11,28 @@ import { FlatList } from 'react-native';
|
|
|
11
11
|
import { GestureResponderEvent } from 'react-native';
|
|
12
12
|
|
|
13
13
|
const RoundedTab: React.FunctionComponent<RoundedTabProps> = (props) => {
|
|
14
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
data = [],
|
|
16
|
+
selectedValue = '',
|
|
17
|
+
onTabItemPress = () => null,
|
|
18
|
+
containerStyle,
|
|
19
|
+
contentContainerStyle,
|
|
20
|
+
} = props;
|
|
15
21
|
|
|
16
22
|
const computedStyle = getStyle(props);
|
|
17
23
|
|
|
18
24
|
return (
|
|
19
|
-
<View style={[computedStyle.container]}>
|
|
25
|
+
<View style={[computedStyle.container, containerStyle]}>
|
|
20
26
|
<FlatList
|
|
21
27
|
horizontal={true}
|
|
22
28
|
data={data}
|
|
29
|
+
showsHorizontalScrollIndicator={false}
|
|
30
|
+
contentContainerStyle={[contentContainerStyle]}
|
|
23
31
|
renderItem={({ item }) => {
|
|
24
32
|
const { label, value, leading, trailing, ...rest } = item;
|
|
25
33
|
return (
|
|
26
34
|
<TabItem
|
|
35
|
+
key={label}
|
|
27
36
|
label={label}
|
|
28
37
|
value={value}
|
|
29
38
|
isSelected={selectedValue === value}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { TouchableWithoutFeedbackProps } from 'react-native';
|
|
2
|
+
import { TouchableWithoutFeedbackProps, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export interface RoundedTabProps {
|
|
5
5
|
data: Omit<TabItemProps, 'isSelected'>[];
|
|
6
6
|
selectedValue: string;
|
|
7
|
+
containerStyle: ViewStyle;
|
|
8
|
+
contentContainerStyle: ViewStyle;
|
|
7
9
|
onTabItemPress: (value: any) => void;
|
|
8
10
|
}
|
|
9
11
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TextInput } from 'react-native';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { Palettes } from '../../themes';
|
|
6
|
+
import { IconRoundClose, IconSearch } from '../../icons';
|
|
7
|
+
import { getStyles } from './search-input.style';
|
|
8
|
+
import { SearchInputProps } from './search-input.type';
|
|
9
|
+
import { NativeSyntheticEvent } from 'react-native';
|
|
10
|
+
import { TextInputFocusEventData } from 'react-native';
|
|
11
|
+
import { TouchableWithoutFeedback } from 'react-native';
|
|
12
|
+
|
|
13
|
+
export const SearchInput = (props: SearchInputProps) => {
|
|
14
|
+
const {
|
|
15
|
+
value = '',
|
|
16
|
+
onFocus = () => null,
|
|
17
|
+
onBlur = () => null,
|
|
18
|
+
trailingIcon,
|
|
19
|
+
onTraillingIconPress,
|
|
20
|
+
...rest
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
const computedStyle = getStyles();
|
|
24
|
+
|
|
25
|
+
const [focused, setFocused] = React.useState(false);
|
|
26
|
+
|
|
27
|
+
const handleOnFocus = (
|
|
28
|
+
event: NativeSyntheticEvent<TextInputFocusEventData>
|
|
29
|
+
) => {
|
|
30
|
+
setFocused(true);
|
|
31
|
+
onFocus(event);
|
|
32
|
+
};
|
|
33
|
+
const handleOnBlur = (
|
|
34
|
+
event: NativeSyntheticEvent<TextInputFocusEventData>
|
|
35
|
+
) => {
|
|
36
|
+
onBlur(event);
|
|
37
|
+
setFocused(false);
|
|
38
|
+
};
|
|
39
|
+
return (
|
|
40
|
+
<View
|
|
41
|
+
style={[
|
|
42
|
+
computedStyle.container,
|
|
43
|
+
{ borderColor: focused ? Palettes.black[900] : Palettes.grey[300] },
|
|
44
|
+
]}
|
|
45
|
+
>
|
|
46
|
+
<IconSearch width={24} height={24} />
|
|
47
|
+
|
|
48
|
+
<TextInput
|
|
49
|
+
style={[computedStyle.textInput]}
|
|
50
|
+
placeholderTextColor={Palettes.grey[400]}
|
|
51
|
+
onBlur={handleOnBlur}
|
|
52
|
+
onFocus={handleOnFocus}
|
|
53
|
+
value={value}
|
|
54
|
+
{...rest}
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
{value.length > 0 && (
|
|
58
|
+
<TouchableWithoutFeedback onPress={onTraillingIconPress}>
|
|
59
|
+
<View style={[computedStyle.trailingIconContainer]}>
|
|
60
|
+
{trailingIcon || <IconRoundClose width={16} height={16} />}
|
|
61
|
+
</View>
|
|
62
|
+
</TouchableWithoutFeedback>
|
|
63
|
+
)}
|
|
64
|
+
</View>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { StyleSheet, ViewStyle } from 'react-native';
|
|
2
|
+
import { Palettes, Radius, Spacing } from '../../themes';
|
|
3
|
+
import { TextStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
type StyleType = {
|
|
6
|
+
container?: ViewStyle;
|
|
7
|
+
textInput?: TextStyle;
|
|
8
|
+
trailingIconContainer?: ViewStyle;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const getStyles = () => {
|
|
12
|
+
const style: StyleType = {};
|
|
13
|
+
|
|
14
|
+
style.container = {
|
|
15
|
+
width: '100%',
|
|
16
|
+
maxHeight: 40,
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
borderRadius: Radius.full,
|
|
20
|
+
overflow: 'hidden',
|
|
21
|
+
borderWidth: 1.5,
|
|
22
|
+
paddingHorizontal: Spacing[12],
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
style.textInput = {
|
|
26
|
+
marginLeft: Spacing[8],
|
|
27
|
+
fontFamily: 'Montserrat-Regular',
|
|
28
|
+
flex: 1,
|
|
29
|
+
textAlignVertical: 'center',
|
|
30
|
+
color: Palettes.black[900],
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
style.trailingIconContainer = {
|
|
34
|
+
padding: Spacing[4],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return StyleSheet.create(style);
|
|
38
|
+
};
|
|
@@ -3,6 +3,7 @@ import type { TextLinkProps } from './textlink.type';
|
|
|
3
3
|
import { Typography } from '../typography/typography.component';
|
|
4
4
|
import { TouchableOpacity } from 'react-native';
|
|
5
5
|
import { getStyle } from './textlink.style';
|
|
6
|
+
import { Palettes } from '../../themes';
|
|
6
7
|
|
|
7
8
|
export const TextLink: React.FunctionComponent<TextLinkProps> = (props) => {
|
|
8
9
|
const {
|
|
@@ -12,6 +13,7 @@ export const TextLink: React.FunctionComponent<TextLinkProps> = (props) => {
|
|
|
12
13
|
leading,
|
|
13
14
|
containerStyles,
|
|
14
15
|
numberOfLines,
|
|
16
|
+
disabled,
|
|
15
17
|
...rest
|
|
16
18
|
} = props;
|
|
17
19
|
|
|
@@ -23,6 +25,7 @@ export const TextLink: React.FunctionComponent<TextLinkProps> = (props) => {
|
|
|
23
25
|
return (
|
|
24
26
|
<TouchableOpacity
|
|
25
27
|
style={[computedStyle.container, containerStyles]}
|
|
28
|
+
disabled={disabled}
|
|
26
29
|
{...rest}
|
|
27
30
|
>
|
|
28
31
|
{hasLeading && leading}
|
|
@@ -33,6 +36,9 @@ export const TextLink: React.FunctionComponent<TextLinkProps> = (props) => {
|
|
|
33
36
|
hasLeading && computedStyle.hasLeading,
|
|
34
37
|
hasTrailing && computedStyle.hasTrailing,
|
|
35
38
|
textStyles,
|
|
39
|
+
{
|
|
40
|
+
color: disabled ? Palettes.grey[500] : Palettes.blueDark[700],
|
|
41
|
+
},
|
|
36
42
|
]}
|
|
37
43
|
numberOfLines={numberOfLines}
|
|
38
44
|
>
|