dhre-ui-kit 0.0.134 → 0.0.135

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/lib/index.mjs CHANGED
@@ -6,6 +6,8 @@ import { BlurView } from '@react-native-community/blur';
6
6
  import Tooltip from 'rn-tooltip';
7
7
  import Pdf from 'react-native-pdf';
8
8
  import * as Progress from 'react-native-progress';
9
+ import { useTheme as useTheme$1 } from 'src/theme/ThemeContext';
10
+ import { withThemeProvider as withThemeProvider$1 } from 'src/theme/withThemeProvider';
9
11
  import { Calendar } from 'react-native-calendars';
10
12
  import CountryPicker from 'react-native-country-picker-modal';
11
13
  import { TextInput as TextInput$1 } from 'react-native-paper';
@@ -635,7 +637,8 @@ const BottomDrawer = ({
635
637
  onLeftIconPress,
636
638
  titleStyle,
637
639
  titleVariant = "B2_REGULAR",
638
- showHeader = true
640
+ showHeader = true,
641
+ blurType = "light"
639
642
  }) => {
640
643
  const onSwipDown = (event) => {
641
644
  const { translationY } = event.nativeEvent;
@@ -661,7 +664,7 @@ const BottomDrawer = ({
661
664
  BlurView,
662
665
  {
663
666
  style: [styles$D.blurView, blurViewStyle],
664
- blurType: "light",
667
+ blurType,
665
668
  blurAmount
666
669
  }
667
670
  ) : null, /* @__PURE__ */ React.createElement(View, { style: [styles$D.modalContainer, modalContainerStyle] }, showHeader && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(View, { style: styles$D.separator }), /* @__PURE__ */ React.createElement(View, { style: styles$D.headerContainer }, showLeftIcon && leftIcon ? React.cloneElement(leftIcon, {
@@ -1857,8 +1860,7 @@ const CustomSwitch = ({
1857
1860
  const styles$p = StyleSheet.create({
1858
1861
  container: {
1859
1862
  paddingVertical: verticalScale(24),
1860
- borderBottomWidth: moderateScale(1),
1861
- borderBottomColor: "#282828"
1863
+ borderBottomWidth: moderateScale(1)
1862
1864
  },
1863
1865
  header: {
1864
1866
  flexDirection: "row",
@@ -1866,7 +1868,7 @@ const styles$p = StyleSheet.create({
1866
1868
  alignItems: "center",
1867
1869
  paddingHorizontal: horizontalScale(24)
1868
1870
  },
1869
- title: { flex: 1, color: "#FFFFFF" },
1871
+ title: { flex: 1 },
1870
1872
  iconStyle: { marginLeft: horizontalScale(20) },
1871
1873
  content: {
1872
1874
  overflow: "scroll",
@@ -1888,11 +1890,13 @@ const Accordion = ({
1888
1890
  headerComponent,
1889
1891
  disabled = false,
1890
1892
  icon,
1891
- onHeaderPress
1893
+ onHeaderPress,
1894
+ titleVariant = "B4_REGULAR"
1892
1895
  }) => {
1893
1896
  const contentRef = useRef(null);
1894
1897
  const [animation] = useState(new Animated.Value(0));
1895
1898
  const [contentHeight, setContentHeight] = useState(0);
1899
+ const { theme } = useTheme$1();
1896
1900
  useEffect(() => {
1897
1901
  if (contentRef.current) {
1898
1902
  contentRef.current.measure((x, y, width, height) => {
@@ -1911,28 +1915,46 @@ const Accordion = ({
1911
1915
  inputRange: [0, 1],
1912
1916
  outputRange: [0, contentHeight]
1913
1917
  });
1914
- return /* @__PURE__ */ React.createElement(View, { style: [styles$p.container, containerStyle], testID: testId }, /* @__PURE__ */ React.createElement(View, { style: [styles$p.header, headerStyle, disabled && { opacity: 0.5 }] }, headerComponent ? headerComponent() : /* @__PURE__ */ React.createElement(Pressable, { onPress: onHeaderPress }, /* @__PURE__ */ React.createElement(
1915
- CustomTypography,
1916
- {
1917
- variant: "B4_REGULAR",
1918
- text: title,
1919
- style: [styles$p.title, titleStyle]
1920
- }
1921
- )), /* @__PURE__ */ React.createElement(Pressable, { onPress: !disabled ? onToggle : void 0 }, React.cloneElement(icon, {
1922
- width: moderateScale(20),
1923
- height: moderateScale(20),
1924
- style: styles$p.iconStyle
1925
- }))), optionalElement ? optionalElement() : null, isOpen && /* @__PURE__ */ React.createElement(Animated.View, { style: [styles$p.content, { height: cardHeight }] }, /* @__PURE__ */ React.createElement(
1918
+ return /* @__PURE__ */ React.createElement(
1926
1919
  View,
1927
1920
  {
1928
- ref: contentRef,
1929
- onLayout: (event) => {
1930
- setContentHeight(event.nativeEvent.layout.height);
1931
- }
1921
+ style: {
1922
+ ...styles$p.container,
1923
+ borderBottomColor: theme.BORDER_SEPRATOR,
1924
+ ...containerStyle
1925
+ },
1926
+ testID: testId
1932
1927
  },
1933
- children
1934
- )));
1928
+ /* @__PURE__ */ React.createElement(View, { style: [styles$p.header, headerStyle, disabled && { opacity: 0.5 }] }, headerComponent ? headerComponent() : /* @__PURE__ */ React.createElement(Pressable, { onPress: onHeaderPress }, /* @__PURE__ */ React.createElement(
1929
+ CustomTypography,
1930
+ {
1931
+ variant: titleVariant,
1932
+ text: title,
1933
+ style: {
1934
+ ...styles$p.title,
1935
+ color: theme.CONTENT_PRIMARY,
1936
+ ...titleStyle
1937
+ }
1938
+ }
1939
+ )), /* @__PURE__ */ React.createElement(Pressable, { onPress: !disabled ? onToggle : void 0 }, React.cloneElement(icon, {
1940
+ width: moderateScale(20),
1941
+ height: moderateScale(20),
1942
+ style: styles$p.iconStyle
1943
+ }))),
1944
+ optionalElement ? optionalElement() : null,
1945
+ isOpen && /* @__PURE__ */ React.createElement(Animated.View, { style: [styles$p.content, { height: cardHeight }] }, /* @__PURE__ */ React.createElement(
1946
+ View,
1947
+ {
1948
+ ref: contentRef,
1949
+ onLayout: (event) => {
1950
+ setContentHeight(event.nativeEvent.layout.height);
1951
+ }
1952
+ },
1953
+ children
1954
+ ))
1955
+ );
1935
1956
  };
1957
+ var Accordion$1 = withThemeProvider$1(Accordion);
1936
1958
 
1937
1959
  const styles$o = StyleSheet.create({
1938
1960
  container: {
@@ -2166,17 +2188,12 @@ const styles$m = StyleSheet.create({
2166
2188
  paddingHorizontal: horizontalScale(16),
2167
2189
  paddingTop: verticalScale(74),
2168
2190
  paddingBottom: verticalScale(16),
2169
- backgroundColor: "#212121",
2170
- borderBottomWidth: 1,
2171
- borderBottomColor: "#282828"
2191
+ borderBottomWidth: 1
2172
2192
  },
2173
2193
  headderContainer: {
2174
2194
  flexDirection: "row",
2175
2195
  alignItems: "center"
2176
2196
  },
2177
- headerTitle: {
2178
- color: "#FFFFFF"
2179
- },
2180
2197
  leftIconStyle: { marginRight: horizontalScale(9) },
2181
2198
  rightIconStyle: { marginLeft: horizontalScale(8) }
2182
2199
  });
@@ -2191,25 +2208,39 @@ const CustomHeader = ({
2191
2208
  onLeftPress,
2192
2209
  onRightPress
2193
2210
  }) => {
2194
- return /* @__PURE__ */ React.createElement(View, { style: styles$m.container, testID: testId }, /* @__PURE__ */ React.createElement(View, { style: styles$m.headderContainer }, showLeftIcon && leftIcon ? React.cloneElement(leftIcon, {
2195
- width: moderateScale(24),
2196
- height: moderateScale(24),
2197
- onPress: onLeftPress,
2198
- style: styles$m.leftIconStyle
2199
- }) : null, /* @__PURE__ */ React.createElement(
2200
- CustomTypography,
2211
+ const { theme } = useTheme$1();
2212
+ return /* @__PURE__ */ React.createElement(
2213
+ View,
2201
2214
  {
2202
- variant: "B2_REGULAR",
2203
- text: title,
2204
- style: styles$m.headerTitle
2205
- }
2206
- )), showRightIcon && rightIcon ? React.cloneElement(rightIcon, {
2207
- width: moderateScale(24),
2208
- height: moderateScale(24),
2209
- onPress: onRightPress,
2210
- style: styles$m.rightIconStyle
2211
- }) : null);
2215
+ style: {
2216
+ ...styles$m.container,
2217
+ backgroundColor: theme.SURFACE_SECONDARY,
2218
+ borderBottomColor: theme.BORDER_SEPERATOR_HEADER
2219
+ },
2220
+ testID: testId
2221
+ },
2222
+ /* @__PURE__ */ React.createElement(View, { style: styles$m.headderContainer }, showLeftIcon && leftIcon ? React.cloneElement(leftIcon, {
2223
+ width: moderateScale(24),
2224
+ height: moderateScale(24),
2225
+ onPress: onLeftPress,
2226
+ style: styles$m.leftIconStyle
2227
+ }) : null, /* @__PURE__ */ React.createElement(
2228
+ CustomTypography,
2229
+ {
2230
+ variant: "B2_REGULAR",
2231
+ text: title,
2232
+ style: { color: theme.CONTENT_PRIMARY }
2233
+ }
2234
+ )),
2235
+ showRightIcon && rightIcon ? React.cloneElement(rightIcon, {
2236
+ width: moderateScale(24),
2237
+ height: moderateScale(24),
2238
+ onPress: onRightPress,
2239
+ style: styles$m.rightIconStyle
2240
+ }) : null
2241
+ );
2212
2242
  };
2243
+ var CustomHeader$1 = withThemeProvider$1(CustomHeader);
2213
2244
 
2214
2245
  const styles$l = StyleSheet.create({
2215
2246
  container: {
@@ -2218,21 +2249,14 @@ const styles$l = StyleSheet.create({
2218
2249
  swippableContainer: { paddingVertical: verticalScale(16) },
2219
2250
  actionButton: {
2220
2251
  justifyContent: "center",
2221
- alignItems: "center"
2252
+ alignItems: "center",
2253
+ paddingHorizontal: horizontalScale(24)
2222
2254
  },
2223
2255
  titleStyle: {
2224
2256
  color: "#fff"
2225
2257
  },
2226
- leftActions: {
2227
- flexDirection: "row",
2228
- justifyContent: "center",
2229
- alignItems: "center",
2230
- width: horizontalScale(150),
2231
- gap: horizontalScale(24)
2232
- },
2233
- rightActions: {
2234
- flexDirection: "row",
2235
- paddingHorizontal: horizontalScale(24)
2258
+ actionBtn: {
2259
+ flexDirection: "row"
2236
2260
  },
2237
2261
  seprator: {
2238
2262
  height: verticalScale(16)
@@ -2284,7 +2308,7 @@ const SwipableList = (props) => {
2284
2308
  }
2285
2309
  )
2286
2310
  );
2287
- const leftActionHandle = (item, leftPrimaryActionIcon, leftPrimaryActionTitle, leftSecondaryActionIcon, leftSecondaryActionTitle) => /* @__PURE__ */ React.createElement(View, { style: [styles$l.leftActions, leftPrimaryActionStyle] }, leftPrimaryActionIcon && /* @__PURE__ */ React.createElement(
2311
+ const leftActionHandle = (item, leftPrimaryActionIcon, leftPrimaryActionTitle, leftSecondaryActionIcon, leftSecondaryActionTitle) => /* @__PURE__ */ React.createElement(View, { style: styles$l.actionBtn }, leftPrimaryActionIcon && /* @__PURE__ */ React.createElement(
2288
2312
  ActionButton,
2289
2313
  {
2290
2314
  icon: leftPrimaryActionIcon,
@@ -2303,7 +2327,7 @@ const SwipableList = (props) => {
2303
2327
  testID: `${testId}-LEFT-SECONDARY-${item.id}`
2304
2328
  }
2305
2329
  ));
2306
- const rightActionHandle = (item) => /* @__PURE__ */ React.createElement(View, { style: [styles$l.rightActions, rightPrimaryActionStyle] }, rightPrimaryActionIcon && /* @__PURE__ */ React.createElement(
2330
+ const rightActionHandle = (item) => /* @__PURE__ */ React.createElement(View, { style: [styles$l.actionBtn, rightPrimaryActionStyle] }, rightPrimaryActionIcon && /* @__PURE__ */ React.createElement(
2307
2331
  ActionButton,
2308
2332
  {
2309
2333
  icon: rightPrimaryActionIcon,
@@ -2664,11 +2688,9 @@ const styles$f = StyleSheet.create({
2664
2688
  marginTop: verticalScale(24),
2665
2689
  height: verticalScale(48),
2666
2690
  alignItems: "center",
2667
- borderRadius: moderateScale(25),
2668
- backgroundColor: "#fff"
2691
+ borderRadius: moderateScale(25)
2669
2692
  },
2670
2693
  applyButtonText: {
2671
- color: "#000",
2672
2694
  ...FONT_STYLES.L1_REGULAR
2673
2695
  }
2674
2696
  });
@@ -2679,6 +2701,7 @@ const DateRangePicker = (props) => {
2679
2701
  startDate: "",
2680
2702
  endDate: ""
2681
2703
  });
2704
+ const { theme } = useTheme();
2682
2705
  const onDayPress = (day) => {
2683
2706
  const { dateString } = day;
2684
2707
  const { startDate, endDate } = selectedRange;
@@ -2698,15 +2721,15 @@ const DateRangePicker = (props) => {
2698
2721
  if (startDate) {
2699
2722
  markedDates[startDate] = {
2700
2723
  startingDay: true,
2701
- color: "#2DE3A6",
2702
- textColor: "#000000"
2724
+ color: theme.SUCCESS,
2725
+ textColor: theme.CONTENT_PRIMARY
2703
2726
  };
2704
2727
  }
2705
2728
  if (endDate) {
2706
2729
  markedDates[endDate] = {
2707
2730
  endingDay: true,
2708
- color: "#2DE3A6",
2709
- textColor: "#000000"
2731
+ color: theme.SUCCESS,
2732
+ textColor: theme.CONTENT_PRIMARY
2710
2733
  };
2711
2734
  }
2712
2735
  if (startDate && endDate) {
@@ -2715,8 +2738,8 @@ const DateRangePicker = (props) => {
2715
2738
  while (start < end) {
2716
2739
  start.setDate(start.getDate() + 1);
2717
2740
  markedDates[start.toISOString().split("T")[0]] = {
2718
- color: "#2DE3A6",
2719
- textColor: "#000000"
2741
+ color: theme.SUCCESS,
2742
+ textColor: theme.CONTENT_PRIMARY
2720
2743
  };
2721
2744
  }
2722
2745
  }
@@ -2731,14 +2754,14 @@ const DateRangePicker = (props) => {
2731
2754
  markingType: "period",
2732
2755
  theme: {
2733
2756
  calendarBackground: "transparent",
2734
- arrowColor: "#fff",
2735
- monthTextColor: "#FFFFFF",
2736
- dayTextColor: "#A7A7A7",
2737
- todayTextColor: "#2DE3A6"
2757
+ arrowColor: theme.CONTENT_PRIMARY,
2758
+ monthTextColor: theme.CONTENT_PRIMARY,
2759
+ dayTextColor: theme.CONTENT_SECONDRY,
2760
+ todayTextColor: theme.SUCCESS
2738
2761
  },
2739
2762
  style: {
2740
2763
  backgroundColor: "transparent",
2741
- color: "#A7A7A7"
2764
+ color: theme.CONTENT_SECONDRY
2742
2765
  },
2743
2766
  onDayPress,
2744
2767
  ...props
@@ -2750,12 +2773,16 @@ const DateRangePicker = (props) => {
2750
2773
  onPress: () => {
2751
2774
  onButtonPress(selectedRange?.startDate, selectedRange?.endDate);
2752
2775
  },
2753
- containerStyle: styles$f.applyButton,
2754
- textStyle: styles$f.applyButtonText,
2776
+ containerStyle: {
2777
+ ...styles$f.applyButton,
2778
+ backgroundColor: theme.SURFACE_INVERTED
2779
+ },
2780
+ textStyle: { color: theme.CONTENT_PRIMARY },
2755
2781
  disabled: isButtonDisabled
2756
2782
  }
2757
2783
  ));
2758
2784
  };
2785
+ var DateRangePicker$1 = withThemeProvider(DateRangePicker);
2759
2786
 
2760
2787
  const OurOfficesButton = ({
2761
2788
  leftIcon,
@@ -4158,7 +4185,7 @@ const AppointmentCard = ({
4158
4185
  }) => {
4159
4186
  const { theme } = useTheme();
4160
4187
  return /* @__PURE__ */ React.createElement(
4161
- Accordion,
4188
+ Accordion$1,
4162
4189
  {
4163
4190
  title,
4164
4191
  isOpen,
@@ -4350,5 +4377,5 @@ const PropertyDetails = ({
4350
4377
  };
4351
4378
  var index = withThemeProvider(PropertyDetails);
4352
4379
 
4353
- export { Accordion, index$1 as AppointmentCard, Badge$1 as Badge, BottomDrawer, CustomButton$1 as Button, Cards, category as Category, Checkbox as CheckBox, ContactModel, CountryDropDown as CountryPicker, CustomDocumentPicker$1 as CustomDocumentPicker, CustomDropdown$1 as CustomDropdown, CustomHeader, CustomIcon, CustomLoader, CustomProgressBar, CustomSearchBar, index$2 as CustomSlideButton, CustomSwitchBtn, CustomText$1 as CustomText, CustomTextInput, CustomTooltip, CustomTypography, DHRE_COLORS_ALERT, DHRE_COLORS_BG, DHRE_COLORS_PRIMARY, DHRE_COLORS_SECONDARY, DHRE_COLORS_TEXT, DHRE_DEFAULT, DateRangePicker, CustomDropdown as DropDown, FONT_STYLES, FeedbackForm, FileUpload, FontStyle, Line, NotificationBandge, index$4 as OTPInput, OurOffices as OurOfficesButton, PdfView, PopUp, index as PropertyDetails, ShapeType, TagsComponent as SingleSelectionTags, Star as StarRating, index$3 as Stepper, SwipableList, Tabs$1 as Tabs, Tags, TextDirectType, CommonTextInput as TextInput, Theme, Toast, CustomSwitch as ToggleButton, ToggleButtonType, ToggleTextType, Topic$1 as Topic, copyToClipboard, theme as default, height, horizontalScale, moderateScale, toastService, verticalScale, width };
4380
+ export { Accordion$1 as Accordion, index$1 as AppointmentCard, Badge$1 as Badge, BottomDrawer, CustomButton$1 as Button, Cards, category as Category, Checkbox as CheckBox, ContactModel, CountryDropDown as CountryPicker, CustomDocumentPicker$1 as CustomDocumentPicker, CustomDropdown$1 as CustomDropdown, CustomHeader$1 as CustomHeader, CustomIcon, CustomLoader, CustomProgressBar, CustomSearchBar, index$2 as CustomSlideButton, CustomSwitchBtn, CustomText$1 as CustomText, CustomTextInput, CustomTooltip, CustomTypography, DHRE_COLORS_ALERT, DHRE_COLORS_BG, DHRE_COLORS_PRIMARY, DHRE_COLORS_SECONDARY, DHRE_COLORS_TEXT, DHRE_DEFAULT, DateRangePicker$1 as DateRangePicker, CustomDropdown as DropDown, FONT_STYLES, FeedbackForm, FileUpload, FontStyle, Line, NotificationBandge, index$4 as OTPInput, OurOffices as OurOfficesButton, PdfView, PopUp, index as PropertyDetails, ShapeType, TagsComponent as SingleSelectionTags, Star as StarRating, index$3 as Stepper, SwipableList, Tabs$1 as Tabs, Tags, TextDirectType, CommonTextInput as TextInput, Theme, Toast, CustomSwitch as ToggleButton, ToggleButtonType, ToggleTextType, Topic$1 as Topic, copyToClipboard, theme as default, height, horizontalScale, moderateScale, toastService, verticalScale, width };
4354
4381
  //# sourceMappingURL=index.mjs.map