dhre-ui-kit 0.0.5 → 0.0.7

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.5",
3
+ "version": "0.0.7",
4
4
  "main": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -1,3 +1,3 @@
1
- <svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M16.25 8L10 14.25L3.75 8" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1
+ <svg width="28" height="20" viewBox="0 0 28 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M16.25 7.5L10 13.75L3.75 7.5" stroke="#A7A7A7" stroke-linecap="round" stroke-linejoin="round"/>
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M3.75 13L10 6.75L16.25 13" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1
+ <svg width="28" height="20" viewBox="0 0 28 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M3.75 12.5L10 6.25L16.25 12.5" stroke="#A7A7A7" stroke-linecap="round" stroke-linejoin="round"/>
3
3
  </svg>
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
+ import {TextStyle, ViewStyle} from 'react-native';
2
3
 
3
4
  export interface AccordionProps {
4
5
  title: string;
5
- children: React.ReactNode;
6
6
  testId?: string;
7
+ containerStyle?: ViewStyle;
8
+ titleStyle?: TextStyle;
9
+ children: React.ReactNode;
7
10
  }
@@ -21,7 +21,6 @@ const styles = StyleSheet.create({
21
21
  content: {
22
22
  overflow: 'scroll',
23
23
  marginTop: verticalScale(16),
24
- marginHorizontal: horizontalScale(16),
25
24
  },
26
25
  });
27
26
 
@@ -6,7 +6,13 @@ import {moderateScale} from '../../utils/stylehelper';
6
6
  import {AccordionProps} from './Accordion.interface';
7
7
  import styles from './Accordion.styles';
8
8
 
9
- const Accordion = ({title, testId = 'ACCORDION', children}: AccordionProps) => {
9
+ const Accordion = ({
10
+ title,
11
+ testId = 'ACCORDION',
12
+ containerStyle,
13
+ titleStyle,
14
+ children,
15
+ }: AccordionProps) => {
10
16
  const contentRef = useRef<View>(null);
11
17
  const [animation] = useState(new Animated.Value(0));
12
18
  const [contentHeight, setContentHeight] = useState(0);
@@ -35,12 +41,12 @@ const Accordion = ({title, testId = 'ACCORDION', children}: AccordionProps) => {
35
41
  });
36
42
 
37
43
  return (
38
- <View style={styles.container} testID={testId}>
44
+ <View style={[styles.container, containerStyle]} testID={testId}>
39
45
  <Pressable style={styles.header} onPress={toggleAccordion}>
40
46
  <CustomTypography
41
47
  variant={'B4_REGULAR'}
42
48
  text={title}
43
- style={styles.title}
49
+ style={[styles.title, titleStyle]}
44
50
  />
45
51
  {React.cloneElement(expanded ? <CaretUp /> : <CaretDown />, {
46
52
  width: moderateScale(20),
@@ -8,7 +8,9 @@ const styles = StyleSheet.create({
8
8
  paddingHorizontal: horizontalScale(16),
9
9
  paddingTop: verticalScale(74),
10
10
  paddingBottom: verticalScale(16),
11
- backgroundColor: '#000',
11
+ backgroundColor: '#212121',
12
+ borderBottomWidth: 1,
13
+ borderBottomColor: '#282828',
12
14
  },
13
15
  headderContainer: {
14
16
  flexDirection: 'row',
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import {TextStyle, ViewStyle} from 'react-native';
3
+
4
+ export interface CustomIconProps {
5
+ icon: React.ReactElement;
6
+ title?: string;
7
+ testId?: string;
8
+ onPress?: () => void;
9
+ containerStyle?: ViewStyle;
10
+ titleStyle?: TextStyle;
11
+ }
@@ -0,0 +1,14 @@
1
+ import {StyleSheet} from 'react-native';
2
+
3
+ const styles = StyleSheet.create({
4
+ container: {
5
+ justifyContent: 'center',
6
+ alignItems: 'center',
7
+ backgroundColor: '#fff',
8
+ },
9
+ title: {
10
+ color: '#000',
11
+ },
12
+ });
13
+
14
+ export default styles;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import {render, fireEvent} from '@testing-library/react-native';
3
+ import {CalenderDots} from '../../assets';
4
+ import CustomIcon from './CustomIcon';
5
+
6
+ describe('Custom Icon Component', () => {
7
+ it('Component renders correctly', () => {
8
+ const {getByTestId} = render(
9
+ <CustomIcon icon={<CalenderDots />} title="Test Title" />,
10
+ );
11
+ expect(getByTestId('CUSTOM-ICON')).toBeTruthy();
12
+ fireEvent.press(getByTestId('CUSTOM-ICON'));
13
+ });
14
+ });
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import {Pressable} from 'react-native';
3
+ import CustomTypography from '../customTypography';
4
+ import {CustomIconProps} from './CustomIcon.interface';
5
+ import styles from './CustomIcon.styles';
6
+
7
+ const CustomIcon = ({
8
+ icon,
9
+ title,
10
+ testId = 'CUSTOM-ICON',
11
+ onPress,
12
+ containerStyle,
13
+ titleStyle,
14
+ }: CustomIconProps) => {
15
+ return (
16
+ <Pressable
17
+ style={[styles.container, containerStyle]}
18
+ onPress={onPress}
19
+ testID={testId}>
20
+ {icon}
21
+ {title && (
22
+ <CustomTypography
23
+ variant="L1_REGULAR"
24
+ text={title}
25
+ style={[styles.title, titleStyle]}
26
+ />
27
+ )}
28
+ </Pressable>
29
+ );
30
+ };
31
+
32
+ export default CustomIcon;
@@ -0,0 +1 @@
1
+ export {default} from './CustomIcon';
@@ -0,0 +1 @@
1
+ export {default} from './CustomTypography';
package/src/index.ts CHANGED
@@ -12,13 +12,15 @@ export {default as FileUpload} from './components/fileUpload';
12
12
  export {default as PdfView} from './components/pdfView';
13
13
  export {default as PopUp} from './components/popup';
14
14
  export {default as CustomProgressBar} from './components/progressBar';
15
- export {default as Property360View} from './components/property360View';
15
+ // export {default as Property360View} from './components/property360View';
16
16
  export {default as StarRating} from './components/rating';
17
17
  export {default as Tabs} from './components/tabs';
18
18
  export {default as Tags} from './components/tags';
19
19
  export {default as ToggleButton} from './components/toggleButton';
20
- // export {default as Accordion} from './components/accordion';
21
- // export {default as Toast} from './components/toast';
22
- // export {default as CustomSearchBar} from './components/customSearchBar';
23
- // export {default as CustomHeader} from './components/customHeader';
24
- // export {default as SwipableList} from './components/swipableList';
20
+ export {default as Accordion} from './components/accordion';
21
+ export {default as Toast} from './components/toast';
22
+ export {default as CustomSearchBar} from './components/customSearchBar';
23
+ export {default as CustomHeader} from './components/customHeader';
24
+ export {default as SwipableList} from './components/swipableList';
25
+ export {default as CustomTypography} from './components/customTypography';
26
+ export {default as CustomIcon} from './components/customIcon';