dhre-ui-kit 0.0.17 → 0.0.19

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.17",
3
+ "version": "0.0.19",
4
4
  "main": "src/index.ts",
5
5
  "files": [
6
6
  "src",
package/src/App.tsx CHANGED
@@ -1,42 +1,14 @@
1
1
  import React from 'react';
2
2
  import {ThemeProvider} from './theme/ThemeContext';
3
- import {Badge, Line} from './index';
3
+ import {Badge, DateRangePicker, Line} from './index';
4
4
  import {ArrowLeft, CalenderDots} from './assets';
5
5
  import {View} from 'react-native';
6
6
  import CustomButton from './components/button/Button';
7
7
 
8
8
  const App = () => {
9
9
  return (
10
- <ThemeProvider>
11
- <View style={{marginTop: 50}}>
12
- <Badge
13
- handleIconPress={function (): void {}}
14
- text="gggsdfghjhgf"
15
- style={{margin: 20}}
16
- iconName={<CalenderDots width={20} height={20} />}
17
- textStyle={{color: 'black'}}
18
- iconStyle={{}}
19
- />
20
- <Line />
21
- <CustomButton
22
- title="Yes"
23
- onPress={() => console.log('Yes Button Pressed')}
24
- leftIcon={<ArrowLeft />}
25
- // titleColor={color.CONTENT_SECONDRY[currentTheme]}
26
- titleVariant="L2_REGULAR"
27
- containerStyle={[
28
- {
29
- borderWidth: 1,
30
- borderRadius: 20,
10
+ <DateRangePicker onPress={() => {}} />
31
11
 
32
- height: 40,
33
- },
34
- ]}
35
- // iconStyle={styles.iconStyle}
36
- imagePosition="left"
37
- />
38
- </View>
39
- </ThemeProvider>
40
12
  );
41
13
  };
42
14
 
@@ -5,6 +5,7 @@ import {
5
5
  View,
6
6
  ViewStyle,
7
7
  StyleProp,
8
+ TextStyle,
8
9
  } from 'react-native';
9
10
  import {SvgProps} from 'react-native-svg';
10
11
  import CustomText from '../customText';
@@ -13,7 +14,7 @@ interface CustomButtonProps {
13
14
  title: string;
14
15
  onPress: () => void;
15
16
  containerStyle?: StyleProp<ViewStyle>;
16
- textStyle?: ViewStyle;
17
+ textStyle?: TextStyle;
17
18
  leftIcon?: ReactElement<SvgProps>;
18
19
  rightIcon?: ReactElement<SvgProps>;
19
20
  iconStyle?: ViewStyle;
@@ -1,3 +1,5 @@
1
+ import {TextStyle, ViewStyle} from 'react-native';
2
+
1
3
  export interface CheckBoxProps {
2
4
  isChecked: boolean;
3
5
  onCheck?: (checked: boolean) => void;
@@ -7,4 +9,7 @@ export interface CheckBoxProps {
7
9
  testID?: string;
8
10
  checkedIcon: React.ReactElement;
9
11
  uncheckedIcon: React.ReactElement;
12
+ titleVariant?: string;
13
+ titleStyle?: TextStyle;
14
+ containerStyle?: ViewStyle;
10
15
  }
@@ -12,6 +12,9 @@ const Checkbox: React.FC<CheckBoxProps> = ({
12
12
  testID,
13
13
  checkedIcon,
14
14
  uncheckedIcon,
15
+ titleVariant = 'L1_REGULAR',
16
+ titleStyle,
17
+ containerStyle,
15
18
  }) => {
16
19
  const [checked, setChecked] = useState(isChecked || false);
17
20
 
@@ -21,7 +24,7 @@ const Checkbox: React.FC<CheckBoxProps> = ({
21
24
  };
22
25
 
23
26
  return (
24
- <View testID={testID}>
27
+ <View testID={testID} style={containerStyle}>
25
28
  <Pressable
26
29
  testID={'Checkbox-Press'}
27
30
  onPress={handlePress}
@@ -33,7 +36,11 @@ const Checkbox: React.FC<CheckBoxProps> = ({
33
36
  <View style={styles.checkboxContainer}>
34
37
  {React.cloneElement(checked ? checkedIcon : uncheckedIcon)}
35
38
  </View>
36
- <CustomTypography variant="H8medium" text={labelName} />
39
+ <CustomTypography
40
+ variant={titleVariant}
41
+ text={labelName}
42
+ style={titleStyle}
43
+ />
37
44
  </Pressable>
38
45
  </View>
39
46
  );
@@ -3,8 +3,8 @@ import {FONT_STYLES} from '../../theme/fonts';
3
3
  import {verticalScale, moderateScale} from '../../utils/stylehelper';
4
4
 
5
5
  const styles = StyleSheet.create({
6
- container: {marginTop: verticalScale(8)},
7
6
  applyButton: {
7
+ marginTop: verticalScale(40),
8
8
  height: verticalScale(48),
9
9
  alignItems: 'center',
10
10
  borderRadius: moderateScale(25),
@@ -60,15 +60,16 @@ const DateRangePicker = ({onPress}: DateRangePickerProps) => {
60
60
  };
61
61
  }
62
62
  }
63
-
63
+
64
64
  return markedDates;
65
65
  };
66
66
 
67
67
  return (
68
- <View style={styles.container}>
68
+ <View>
69
69
  <Calendar
70
70
  markedDates={getMarkedDates()}
71
71
  mode="date"
72
+ markingType={'period'}
72
73
  theme={{
73
74
  calendarBackground: 'transparent',
74
75
  arrowColor: '#fff',
@@ -9,8 +9,9 @@ import {
9
9
  const styles = StyleSheet.create({
10
10
  container: {
11
11
  position: 'absolute',
12
+ alignSelf: 'center',
12
13
  height: verticalScale(72),
13
- width: width - horizontalScale(48),
14
+ width: width - horizontalScale(32),
14
15
  top: 56,
15
16
  borderRadius: moderateScale(8),
16
17
  overflow: 'hidden',
@@ -14,8 +14,8 @@ interface ThemeProviderProps {
14
14
 
15
15
  export const ThemeProvider: React.FC<ThemeProviderProps> = ({children}) => {
16
16
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- const mode = useSelector((state: any) => state.theme.currentTheme);
18
- // const mode = 'light'
17
+ // const mode = useSelector((state: any) => state.theme.currentTheme);
18
+ const mode = 'light'
19
19
  // Filter the theme based on the mode (light or dark)
20
20
  const filteredTheme = Object.keys(theme).reduce((acc, key) => {
21
21
  acc[key] = theme[key][mode];