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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dhre-ui-kit",
3
- "version": "0.0.91",
3
+ "version": "0.0.93",
4
4
  "main": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -12,4 +12,5 @@ export interface AccordionProps {
12
12
  onToggle: () => void;
13
13
  optionalElement?: () => React.ReactNode; // Update this line
14
14
  headerComponent?: () => React.ReactNode;
15
+ disabled?: boolean;
15
16
  }
@@ -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 style={[styles.header, headerStyle]} onPress={onToggle}>
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
- <TextInput
46
- mode="outlined"
47
- outlineStyle={{
48
- ...styles.outlineStyle,
49
- borderColor: value?.length ? activeBorderColor : inactiveBorderColor,
50
- }}
51
- label={label}
52
- value={value}
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
- ) : null}
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,
@@ -77,7 +77,7 @@ const styles = StyleSheet.create({
77
77
  },
78
78
  rightIconContainer: {
79
79
  position: 'absolute',
80
- left: 10,
80
+ left: 16,
81
81
  top: 10,
82
82
  },
83
83
  });
@@ -10,7 +10,7 @@ const theme = {
10
10
  dark: '#212121',
11
11
  },
12
12
  [Theme.SURFACE_TERTIARY]: {
13
- light: '#E1E1E1',
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: '#D92D3E33',
26
- dark: '#D92D3E33',
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: '#68686833',
38
- dark: '#FFFFFF33',
37
+ light: '#686868',
38
+ dark: '#FFFFFF',
39
39
  },
40
40
  [Theme.SURFACE_DROP_SHADOW]: {
41
41
  light: '#CECECE',
42
- dark: '#000000',
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: '#686868',
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: '#F5F5F5',
112
- dark: '#282828',
111
+ light: '#282828',
112
+ dark: '#FFFFFF',
113
113
  },
114
114
  [Theme.BORDER_SEPERATOR_HEADER]: {
115
115
  light: '#E1E1E1',