dhre-ui-kit 0.0.91 → 0.0.93
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/package.json +1 -1
- package/src/components/accordion/Accordion.interface.ts +1 -0
- package/src/components/accordion/Accordion.tsx +4 -1
- package/src/components/progressBar/ProgressBar.tsx +4 -1
- package/src/components/textInput/Textinput.tsx +51 -33
- package/src/components/topic/Topic.tsx +1 -1
- package/src/theme/themes.ts +9 -9
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ const Accordion = ({
|
|
|
17
17
|
onToggle,
|
|
18
18
|
optionalElement, // Destructure the new prop,
|
|
19
19
|
headerComponent,
|
|
20
|
+
disabled = false,
|
|
20
21
|
}: AccordionProps) => {
|
|
21
22
|
const contentRef = useRef<View>(null);
|
|
22
23
|
const [animation] = useState(new Animated.Value(0));
|
|
@@ -45,7 +46,9 @@ const Accordion = ({
|
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
48
|
<View style={[styles.container, containerStyle]} testID={testId}>
|
|
48
|
-
<Pressable
|
|
49
|
+
<Pressable
|
|
50
|
+
style={[styles.header, headerStyle, disabled && {opacity: 0.5}]}
|
|
51
|
+
onPress={!disabled ? onToggle : undefined}>
|
|
49
52
|
{headerComponent ? (
|
|
50
53
|
headerComponent()
|
|
51
54
|
) : (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, {useEffect} from 'react';
|
|
2
|
-
import {StyleSheet, View} from 'react-native';
|
|
2
|
+
import {StyleSheet, TextStyle, View} from 'react-native';
|
|
3
3
|
import * as Progress from 'react-native-progress';
|
|
4
4
|
import {ShapeType} from '../../utils/appEnum';
|
|
5
5
|
import CustomText from '../customText';
|
|
@@ -20,6 +20,7 @@ interface CustomProgressBarProps {
|
|
|
20
20
|
increment?: number; // Optional increment value for progress update
|
|
21
21
|
interval?: number; // Optional interval time (ms) for progress update
|
|
22
22
|
percentageText?: string;
|
|
23
|
+
valueTextStyle?: TextStyle;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
const CustomProgressBar: React.FC<CustomProgressBarProps> = ({
|
|
@@ -38,6 +39,7 @@ const CustomProgressBar: React.FC<CustomProgressBarProps> = ({
|
|
|
38
39
|
increment = 1, // Default increment to 1
|
|
39
40
|
interval = 100, // Default interval to 100ms
|
|
40
41
|
percentageText,
|
|
42
|
+
valueTextStyle,
|
|
41
43
|
}) => {
|
|
42
44
|
useEffect(() => {
|
|
43
45
|
const progressInterval = setInterval(() => {
|
|
@@ -58,6 +60,7 @@ const CustomProgressBar: React.FC<CustomProgressBarProps> = ({
|
|
|
58
60
|
text={`${value}%`}
|
|
59
61
|
variant="B1_REGULAR"
|
|
60
62
|
textColor="CONTENT_PRIMARY"
|
|
63
|
+
style={valueTextStyle}
|
|
61
64
|
/>
|
|
62
65
|
{percentageText ? (
|
|
63
66
|
<CustomText
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {StyleSheet, ViewStyle} from 'react-native';
|
|
2
|
+
import {Pressable, StyleSheet, View, ViewStyle} from 'react-native';
|
|
3
3
|
import {TextInput} from 'react-native-paper';
|
|
4
4
|
import {DHRE_COLORS_TEXT, DHRE_DEFAULT} from '../../theme/colors';
|
|
5
5
|
import {verticalScale, moderateScale} from '../../utils/stylehelper';
|
|
@@ -22,6 +22,8 @@ interface CommonTextInputProps {
|
|
|
22
22
|
editable?: boolean;
|
|
23
23
|
textColor?: string;
|
|
24
24
|
labelColor?: string;
|
|
25
|
+
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined;
|
|
26
|
+
handlePress?: () => void;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
const CommonTextInput: React.FC<CommonTextInputProps> = ({
|
|
@@ -39,46 +41,62 @@ const CommonTextInput: React.FC<CommonTextInputProps> = ({
|
|
|
39
41
|
editable = true,
|
|
40
42
|
textColor = theme.CONTENT_PRIMARY['light'],
|
|
41
43
|
labelColor,
|
|
44
|
+
handlePress,
|
|
45
|
+
pointerEvents,
|
|
42
46
|
}) => {
|
|
43
47
|
return (
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
onChangeText={onChangeText}
|
|
54
|
-
secureTextEntry={isSecureTextEntry}
|
|
55
|
-
keyboardType={keyboardType}
|
|
56
|
-
theme={{
|
|
57
|
-
colors: {
|
|
58
|
-
primary: labelColor ? labelColor : DHRE_COLORS_TEXT.DH_BLACK,
|
|
59
|
-
},
|
|
60
|
-
}}
|
|
61
|
-
style={[errorMessage ? styles.errorInput : styles.input, inputStyle]}
|
|
62
|
-
maxLength={maxLength}
|
|
63
|
-
textColor={textColor}
|
|
64
|
-
placeholder={placeholderText}
|
|
65
|
-
editable={editable}
|
|
66
|
-
/>
|
|
67
|
-
{errorMessage ? (
|
|
68
|
-
<CustomTypography
|
|
69
|
-
variant={'L2_REGULAR'}
|
|
70
|
-
text={errorMessage ?? ''}
|
|
71
|
-
style={{
|
|
72
|
-
...styles.errorStyle,
|
|
73
|
-
color: DHRE_DEFAULT.DH_SEMENTIC_ERROR,
|
|
48
|
+
<View style={styles.container}>
|
|
49
|
+
<Pressable onPress={handlePress} style={styles.touchable}>
|
|
50
|
+
<TextInput
|
|
51
|
+
mode="outlined"
|
|
52
|
+
outlineStyle={{
|
|
53
|
+
...styles.outlineStyle,
|
|
54
|
+
borderColor: value?.length
|
|
55
|
+
? activeBorderColor
|
|
56
|
+
: inactiveBorderColor,
|
|
74
57
|
}}
|
|
58
|
+
label={label}
|
|
59
|
+
value={value}
|
|
60
|
+
onChangeText={onChangeText}
|
|
61
|
+
secureTextEntry={isSecureTextEntry}
|
|
62
|
+
keyboardType={keyboardType}
|
|
63
|
+
theme={{
|
|
64
|
+
colors: {
|
|
65
|
+
primary: labelColor ? labelColor : DHRE_COLORS_TEXT.DH_BLACK,
|
|
66
|
+
},
|
|
67
|
+
}}
|
|
68
|
+
style={[errorMessage ? styles.errorInput : styles.input, inputStyle]}
|
|
69
|
+
maxLength={maxLength}
|
|
70
|
+
textColor={textColor}
|
|
71
|
+
placeholder={placeholderText}
|
|
72
|
+
editable={editable}
|
|
73
|
+
pointerEvents={pointerEvents}
|
|
75
74
|
/>
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
{errorMessage ? (
|
|
76
|
+
<CustomTypography
|
|
77
|
+
variant={'L2_REGULAR'}
|
|
78
|
+
text={errorMessage ?? ''}
|
|
79
|
+
style={{
|
|
80
|
+
...styles.errorStyle,
|
|
81
|
+
color: DHRE_DEFAULT.DH_SEMENTIC_ERROR,
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
) : null}
|
|
85
|
+
</Pressable>
|
|
86
|
+
</View>
|
|
78
87
|
);
|
|
79
88
|
};
|
|
80
89
|
|
|
81
90
|
const styles = StyleSheet.create({
|
|
91
|
+
container: {
|
|
92
|
+
flex: 1,
|
|
93
|
+
justifyContent: 'center',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
},
|
|
96
|
+
touchable: {
|
|
97
|
+
width: '100%', // Adjust width as needed
|
|
98
|
+
},
|
|
99
|
+
|
|
82
100
|
input: {
|
|
83
101
|
marginVertical: verticalScale(8),
|
|
84
102
|
backgroundColor: DHRE_COLORS_TEXT.DH_WHITE,
|
package/src/theme/themes.ts
CHANGED
|
@@ -10,7 +10,7 @@ const theme = {
|
|
|
10
10
|
dark: '#212121',
|
|
11
11
|
},
|
|
12
12
|
[Theme.SURFACE_TERTIARY]: {
|
|
13
|
-
light: '#
|
|
13
|
+
light: '#0000001A',
|
|
14
14
|
dark: '#373737',
|
|
15
15
|
},
|
|
16
16
|
[Theme.SURFACE_STATIC]: {
|
|
@@ -22,8 +22,8 @@ const theme = {
|
|
|
22
22
|
dark: '#D92D27',
|
|
23
23
|
},
|
|
24
24
|
[Theme.SURFACE_BRAND_TRANSPARENT_STATIC]: {
|
|
25
|
-
light: '#
|
|
26
|
-
dark: '#
|
|
25
|
+
light: '#D92D3E',
|
|
26
|
+
dark: '#D92D3E',
|
|
27
27
|
},
|
|
28
28
|
[Theme.SURFACE_DISABLE]: {
|
|
29
29
|
light: '#E1E1E1',
|
|
@@ -34,12 +34,12 @@ const theme = {
|
|
|
34
34
|
dark: '#FFFFFF',
|
|
35
35
|
},
|
|
36
36
|
[Theme.SURFACE_INVERTED_TRANSPARENT]: {
|
|
37
|
-
light: '#
|
|
38
|
-
dark: '#
|
|
37
|
+
light: '#686868',
|
|
38
|
+
dark: '#FFFFFF',
|
|
39
39
|
},
|
|
40
40
|
[Theme.SURFACE_DROP_SHADOW]: {
|
|
41
41
|
light: '#CECECE',
|
|
42
|
-
dark: '#
|
|
42
|
+
dark: '#373737',
|
|
43
43
|
},
|
|
44
44
|
[Theme.SURFACE_BLUR]: {
|
|
45
45
|
light: '#000000B2',
|
|
@@ -67,7 +67,7 @@ const theme = {
|
|
|
67
67
|
dark: '#FFFFFF',
|
|
68
68
|
},
|
|
69
69
|
[Theme.CONTENT_PRIMARY_STATIC]: {
|
|
70
|
-
light: '#
|
|
70
|
+
light: '#0000001A',
|
|
71
71
|
dark: '#686868',
|
|
72
72
|
},
|
|
73
73
|
[Theme.CONTENT_SECONDRY_STATIC]: {
|
|
@@ -108,8 +108,8 @@ const theme = {
|
|
|
108
108
|
dark: '#404040',
|
|
109
109
|
},
|
|
110
110
|
[Theme.BORDER_SEPRATOR]: {
|
|
111
|
-
light: '#
|
|
112
|
-
dark: '#
|
|
111
|
+
light: '#282828',
|
|
112
|
+
dark: '#FFFFFF',
|
|
113
113
|
},
|
|
114
114
|
[Theme.BORDER_SEPERATOR_HEADER]: {
|
|
115
115
|
light: '#E1E1E1',
|