@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.
Files changed (140) hide show
  1. package/lib/commonjs/components/Appbar/Appbar.component.js +6 -4
  2. package/lib/commonjs/components/Appbar/Appbar.component.js.map +1 -1
  3. package/lib/commonjs/components/Appbar/Appbar.style.js +9 -2
  4. package/lib/commonjs/components/Appbar/Appbar.style.js.map +1 -1
  5. package/lib/commonjs/components/BottomSheet/BottomSheet.component.js +6 -23
  6. package/lib/commonjs/components/BottomSheet/BottomSheet.component.js.map +1 -1
  7. package/lib/commonjs/components/BottomSheet/BottomSheet.style.js +11 -4
  8. package/lib/commonjs/components/BottomSheet/BottomSheet.style.js.map +1 -1
  9. package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.component.js +18 -10
  10. package/lib/commonjs/components/CheckBoxInput/CheckBoxInput.component.js.map +1 -1
  11. package/lib/commonjs/components/Checkbox/Checkbox.component.js +5 -3
  12. package/lib/commonjs/components/Checkbox/Checkbox.component.js.map +1 -1
  13. package/lib/commonjs/components/Checkbox/Checkbox.type.js +4 -0
  14. package/lib/commonjs/components/RadioButton/RadioButton.component.js +5 -3
  15. package/lib/commonjs/components/RadioButton/RadioButton.component.js.map +1 -1
  16. package/lib/commonjs/components/RadioButton/RadioButton.type.js +4 -0
  17. package/lib/commonjs/components/RadioInput/RadioInput.component.js +18 -10
  18. package/lib/commonjs/components/RadioInput/RadioInput.component.js.map +1 -1
  19. package/lib/commonjs/components/Tabs/Tabs.component.js +1 -0
  20. package/lib/commonjs/components/Tabs/Tabs.component.js.map +1 -1
  21. package/lib/commonjs/components/TextArea/TextArea.component.js +3 -2
  22. package/lib/commonjs/components/TextArea/TextArea.component.js.map +1 -1
  23. package/lib/commonjs/components/TextInput/TextInput.component.js +6 -3
  24. package/lib/commonjs/components/TextInput/TextInput.component.js.map +1 -1
  25. package/lib/commonjs/components/index.js +62 -0
  26. package/lib/commonjs/components/index.js.map +1 -1
  27. package/lib/commonjs/components/rounded-tab/rounded-tab.component.js +7 -2
  28. package/lib/commonjs/components/rounded-tab/rounded-tab.component.js.map +1 -1
  29. package/lib/commonjs/components/search-input/search-input.component.js +57 -0
  30. package/lib/commonjs/components/search-input/search-input.component.js.map +1 -0
  31. package/lib/commonjs/components/search-input/search-input.style.js +34 -0
  32. package/lib/commonjs/components/search-input/search-input.style.js.map +1 -0
  33. package/lib/commonjs/components/search-input/search-input.type.js +6 -0
  34. package/lib/commonjs/components/search-input/search-input.type.js.map +1 -0
  35. package/lib/commonjs/components/textlink/textlink.component.js +7 -2
  36. package/lib/commonjs/components/textlink/textlink.component.js.map +1 -1
  37. package/lib/module/components/Appbar/Appbar.component.js +6 -4
  38. package/lib/module/components/Appbar/Appbar.component.js.map +1 -1
  39. package/lib/module/components/Appbar/Appbar.style.js +9 -2
  40. package/lib/module/components/Appbar/Appbar.style.js.map +1 -1
  41. package/lib/module/components/BottomSheet/BottomSheet.component.js +7 -25
  42. package/lib/module/components/BottomSheet/BottomSheet.component.js.map +1 -1
  43. package/lib/module/components/BottomSheet/BottomSheet.style.js +11 -4
  44. package/lib/module/components/BottomSheet/BottomSheet.style.js.map +1 -1
  45. package/lib/module/components/CheckBoxInput/CheckBoxInput.component.js +18 -10
  46. package/lib/module/components/CheckBoxInput/CheckBoxInput.component.js.map +1 -1
  47. package/lib/module/components/Checkbox/Checkbox.component.js +5 -3
  48. package/lib/module/components/Checkbox/Checkbox.component.js.map +1 -1
  49. package/lib/module/components/Checkbox/Checkbox.type.js +1 -1
  50. package/lib/module/components/RadioButton/RadioButton.component.js +5 -3
  51. package/lib/module/components/RadioButton/RadioButton.component.js.map +1 -1
  52. package/lib/module/components/RadioButton/RadioButton.type.js +1 -1
  53. package/lib/module/components/RadioInput/RadioInput.component.js +18 -10
  54. package/lib/module/components/RadioInput/RadioInput.component.js.map +1 -1
  55. package/lib/module/components/Tabs/Tabs.component.js +1 -0
  56. package/lib/module/components/Tabs/Tabs.component.js.map +1 -1
  57. package/lib/module/components/TextArea/TextArea.component.js +3 -2
  58. package/lib/module/components/TextArea/TextArea.component.js.map +1 -1
  59. package/lib/module/components/TextInput/TextInput.component.js +5 -4
  60. package/lib/module/components/TextInput/TextInput.component.js.map +1 -1
  61. package/lib/module/components/index.js +2 -0
  62. package/lib/module/components/index.js.map +1 -1
  63. package/lib/module/components/rounded-tab/rounded-tab.component.js +7 -2
  64. package/lib/module/components/rounded-tab/rounded-tab.component.js.map +1 -1
  65. package/lib/module/components/search-input/search-input.component.js +50 -0
  66. package/lib/module/components/search-input/search-input.component.js.map +1 -0
  67. package/lib/module/components/search-input/search-input.style.js +27 -0
  68. package/lib/module/components/search-input/search-input.style.js.map +1 -0
  69. package/lib/module/components/search-input/search-input.type.js +2 -0
  70. package/lib/module/components/search-input/search-input.type.js.map +1 -0
  71. package/lib/module/components/textlink/textlink.component.js +7 -2
  72. package/lib/module/components/textlink/textlink.component.js.map +1 -1
  73. package/lib/typescript/components/Appbar/Appbar.component.d.ts.map +1 -1
  74. package/lib/typescript/components/Appbar/Appbar.style.d.ts +3 -1
  75. package/lib/typescript/components/Appbar/Appbar.style.d.ts.map +1 -1
  76. package/lib/typescript/components/Appbar/Appbar.type.d.ts +2 -0
  77. package/lib/typescript/components/Appbar/Appbar.type.d.ts.map +1 -1
  78. package/lib/typescript/components/BottomSheet/BottomSheet.component.d.ts.map +1 -1
  79. package/lib/typescript/components/BottomSheet/BottomSheet.style.d.ts +1 -0
  80. package/lib/typescript/components/BottomSheet/BottomSheet.style.d.ts.map +1 -1
  81. package/lib/typescript/components/BottomSheet/BottomSheet.type.d.ts +2 -2
  82. package/lib/typescript/components/BottomSheet/BottomSheet.type.d.ts.map +1 -1
  83. package/lib/typescript/components/CheckBoxInput/CheckBoxInput.component.d.ts.map +1 -1
  84. package/lib/typescript/components/CheckBoxInput/CheckBoxInput.type.d.ts +7 -4
  85. package/lib/typescript/components/CheckBoxInput/CheckBoxInput.type.d.ts.map +1 -1
  86. package/lib/typescript/components/Checkbox/Checkbox.component.d.ts.map +1 -1
  87. package/lib/typescript/components/Checkbox/Checkbox.type.d.ts +2 -1
  88. package/lib/typescript/components/Checkbox/Checkbox.type.d.ts.map +1 -1
  89. package/lib/typescript/components/RadioButton/RadioButton.component.d.ts.map +1 -1
  90. package/lib/typescript/components/RadioButton/RadioButton.type.d.ts +2 -1
  91. package/lib/typescript/components/RadioButton/RadioButton.type.d.ts.map +1 -1
  92. package/lib/typescript/components/RadioInput/RadioInput.component.d.ts.map +1 -1
  93. package/lib/typescript/components/RadioInput/RadioInput.type.d.ts +7 -4
  94. package/lib/typescript/components/RadioInput/RadioInput.type.d.ts.map +1 -1
  95. package/lib/typescript/components/Tabs/Tabs.component.d.ts.map +1 -1
  96. package/lib/typescript/components/TextArea/TextArea.component.d.ts.map +1 -1
  97. package/lib/typescript/components/TextArea/TextArea.type.d.ts +2 -0
  98. package/lib/typescript/components/TextArea/TextArea.type.d.ts.map +1 -1
  99. package/lib/typescript/components/TextInput/TextInput.component.d.ts.map +1 -1
  100. package/lib/typescript/components/TextInput/TextInput.type.d.ts +4 -2
  101. package/lib/typescript/components/TextInput/TextInput.type.d.ts.map +1 -1
  102. package/lib/typescript/components/index.d.ts +3 -0
  103. package/lib/typescript/components/index.d.ts.map +1 -1
  104. package/lib/typescript/components/rounded-tab/rounded-tab.component.d.ts.map +1 -1
  105. package/lib/typescript/components/rounded-tab/rounded-tab.type.d.ts +3 -1
  106. package/lib/typescript/components/rounded-tab/rounded-tab.type.d.ts.map +1 -1
  107. package/lib/typescript/components/search-input/search-input.component.d.ts +4 -0
  108. package/lib/typescript/components/search-input/search-input.component.d.ts.map +1 -0
  109. package/lib/typescript/components/search-input/search-input.style.d.ts +10 -0
  110. package/lib/typescript/components/search-input/search-input.style.d.ts.map +1 -0
  111. package/lib/typescript/components/search-input/search-input.type.d.ts +7 -0
  112. package/lib/typescript/components/search-input/search-input.type.d.ts.map +1 -0
  113. package/lib/typescript/components/textlink/textlink.component.d.ts.map +1 -1
  114. package/package.json +3 -2
  115. package/src/components/Appbar/Appbar.component.tsx +35 -34
  116. package/src/components/Appbar/Appbar.style.tsx +9 -2
  117. package/src/components/Appbar/Appbar.type.ts +4 -0
  118. package/src/components/BottomSheet/BottomSheet.component.tsx +32 -53
  119. package/src/components/BottomSheet/BottomSheet.style.tsx +11 -2
  120. package/src/components/BottomSheet/BottomSheet.type.ts +3 -2
  121. package/src/components/CheckBoxInput/CheckBoxInput.component.tsx +18 -2
  122. package/src/components/CheckBoxInput/CheckBoxInput.type.ts +7 -5
  123. package/src/components/Checkbox/Checkbox.component.tsx +2 -1
  124. package/src/components/Checkbox/Checkbox.type.ts +3 -1
  125. package/src/components/RadioButton/RadioButton.component.tsx +2 -1
  126. package/src/components/RadioButton/RadioButton.type.ts +3 -1
  127. package/src/components/RadioInput/RadioInput.component.tsx +18 -2
  128. package/src/components/RadioInput/RadioInput.type.ts +7 -5
  129. package/src/components/Tabs/Tabs.component.tsx +1 -0
  130. package/src/components/TextArea/TextArea.component.tsx +6 -1
  131. package/src/components/TextArea/TextArea.type.ts +2 -0
  132. package/src/components/TextInput/TextInput.component.tsx +8 -3
  133. package/src/components/TextInput/TextInput.type.ts +4 -2
  134. package/src/components/index.ts +13 -0
  135. package/src/components/rounded-tab/rounded-tab.component.tsx +11 -2
  136. package/src/components/rounded-tab/rounded-tab.type.ts +3 -1
  137. package/src/components/search-input/search-input.component.tsx +66 -0
  138. package/src/components/search-input/search-input.style.ts +38 -0
  139. package/src/components/search-input/search-input.type.ts +7 -0
  140. 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 { data = [], selectedValue = '', onTabItemPress = () => null } = props;
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
+ };
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ import { TextInputProps } from 'react-native';
3
+
4
+ export interface SearchInputProps extends TextInputProps {
5
+ trailingIcon?: ReactNode;
6
+ onTraillingIconPress: () => void;
7
+ }
@@ -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
  >