dhre-ui-kit 0.0.155 → 0.0.156
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.d.ts +12 -9
- package/lib/index.js +59 -85
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +59 -85
- package/lib/index.mjs.map +1 -1
- package/package.json +3 -2
package/lib/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { useSelector } from 'react-redux';
|
|
|
3
3
|
import { Dimensions, StyleSheet, Text, Pressable, View, Modal, KeyboardAvoidingView, Platform, TextInput, ScrollView, Animated, FlatList, ActivityIndicator, TouchableOpacity, Alert, Linking, PanResponder } from 'react-native';
|
|
4
4
|
import { PanGestureHandler, GestureHandlerRootView, Swipeable } from 'react-native-gesture-handler';
|
|
5
5
|
import { BlurView } from '@react-native-community/blur';
|
|
6
|
-
import Tooltip from '
|
|
6
|
+
import Tooltip from 'react-native-walkthrough-tooltip';
|
|
7
7
|
import Pdf from 'react-native-pdf';
|
|
8
8
|
import * as Progress from 'react-native-progress';
|
|
9
9
|
import { Calendar } from 'react-native-calendars';
|
|
@@ -328,13 +328,13 @@ const CustomTypography = ({
|
|
|
328
328
|
Text,
|
|
329
329
|
{
|
|
330
330
|
testID,
|
|
331
|
-
style: [textStyle, styles$
|
|
331
|
+
style: [textStyle, styles$B.container, style],
|
|
332
332
|
...props
|
|
333
333
|
},
|
|
334
334
|
text
|
|
335
335
|
);
|
|
336
336
|
};
|
|
337
|
-
const styles$
|
|
337
|
+
const styles$B = StyleSheet.create({
|
|
338
338
|
container: { writingDirection: "auto", alignSelf: "flex-start" }
|
|
339
339
|
});
|
|
340
340
|
|
|
@@ -545,7 +545,7 @@ const DHRE_COLORS_TEXT = {
|
|
|
545
545
|
DH_LIGHTGREEN: "#00B578"
|
|
546
546
|
};
|
|
547
547
|
|
|
548
|
-
const styles$
|
|
548
|
+
const styles$A = StyleSheet.create({
|
|
549
549
|
badge: {
|
|
550
550
|
backgroundColor: DHRE_COLORS_ALERT.DH_SUCCESS_GREEN,
|
|
551
551
|
borderRadius: 15,
|
|
@@ -572,16 +572,16 @@ const Badge = ({
|
|
|
572
572
|
return /* @__PURE__ */ React.createElement(
|
|
573
573
|
Pressable,
|
|
574
574
|
{
|
|
575
|
-
style: [styles$
|
|
575
|
+
style: [styles$A.badge, commonStyles.centerRow, style],
|
|
576
576
|
testID: "BADGE",
|
|
577
577
|
onPress: handleIconPress
|
|
578
578
|
},
|
|
579
|
-
iconName && /* @__PURE__ */ React.createElement(View, { style: [styles$
|
|
579
|
+
iconName && /* @__PURE__ */ React.createElement(View, { style: [styles$A.icon, iconStyle] }, React.cloneElement(iconName)),
|
|
580
580
|
text && /* @__PURE__ */ React.createElement(
|
|
581
581
|
CustomTypography,
|
|
582
582
|
{
|
|
583
583
|
variant: "B3semiBold",
|
|
584
|
-
style: [styles$
|
|
584
|
+
style: [styles$A.text, textStyle],
|
|
585
585
|
text
|
|
586
586
|
}
|
|
587
587
|
)
|
|
@@ -589,7 +589,7 @@ const Badge = ({
|
|
|
589
589
|
};
|
|
590
590
|
var Badge$1 = withThemeProvider(Badge);
|
|
591
591
|
|
|
592
|
-
const styles$
|
|
592
|
+
const styles$z = StyleSheet.create({
|
|
593
593
|
mainContainer: {
|
|
594
594
|
flex: 1,
|
|
595
595
|
justifyContent: "flex-end"
|
|
@@ -669,29 +669,29 @@ const BottomDrawer = ({
|
|
|
669
669
|
behavior: Platform.OS === "ios" ? "padding" : "height",
|
|
670
670
|
style: { flex: 1 }
|
|
671
671
|
},
|
|
672
|
-
/* @__PURE__ */ React.createElement(View, { style: [styles$
|
|
672
|
+
/* @__PURE__ */ React.createElement(View, { style: [styles$z.mainContainer, style], testID }, showBlurView ? /* @__PURE__ */ React.createElement(
|
|
673
673
|
BlurView,
|
|
674
674
|
{
|
|
675
|
-
style: [styles$
|
|
675
|
+
style: [styles$z.blurView, blurViewStyle],
|
|
676
676
|
blurType,
|
|
677
677
|
blurAmount
|
|
678
678
|
}
|
|
679
|
-
) : null, /* @__PURE__ */ React.createElement(View, { style: [styles$
|
|
679
|
+
) : null, /* @__PURE__ */ React.createElement(View, { style: [styles$z.modalContainer, modalContainerStyle] }, showHeader && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(View, { style: styles$z.separator }), /* @__PURE__ */ React.createElement(View, { style: styles$z.headerContainer }, showLeftIcon && leftIcon ? React.cloneElement(leftIcon, {
|
|
680
680
|
width: moderateScale(24),
|
|
681
681
|
height: moderateScale(24),
|
|
682
|
-
style: styles$
|
|
682
|
+
style: styles$z.leftIconStyle,
|
|
683
683
|
onPress: onLeftIconPress
|
|
684
684
|
}) : null, /* @__PURE__ */ React.createElement(
|
|
685
685
|
CustomTypography,
|
|
686
686
|
{
|
|
687
687
|
variant: titleVariant,
|
|
688
688
|
text: title,
|
|
689
|
-
style: { ...styles$
|
|
689
|
+
style: { ...styles$z.title, ...titleStyle }
|
|
690
690
|
}
|
|
691
691
|
), showRightIcon && rightIcon ? React.cloneElement(rightIcon, {
|
|
692
692
|
width: moderateScale(24),
|
|
693
693
|
height: moderateScale(24),
|
|
694
|
-
style: styles$
|
|
694
|
+
style: styles$z.rightIconStyle,
|
|
695
695
|
onPress: toggleModal
|
|
696
696
|
}) : null)), children))
|
|
697
697
|
))
|
|
@@ -720,7 +720,7 @@ const CustomButton = ({
|
|
|
720
720
|
{
|
|
721
721
|
testID,
|
|
722
722
|
style: [
|
|
723
|
-
styles$
|
|
723
|
+
styles$y.buttonContainer,
|
|
724
724
|
containerStyle,
|
|
725
725
|
disabled ? {
|
|
726
726
|
backgroundColor: disabledColor ? disabledColor : theme.SURFACE_DISABLE
|
|
@@ -747,7 +747,7 @@ const CustomButton = ({
|
|
|
747
747
|
imagePosition === "right" && rightIcon && /* @__PURE__ */ React.createElement(View, { style: iconStyle }, React.cloneElement(rightIcon, { width: 20, height: 20 }))
|
|
748
748
|
);
|
|
749
749
|
};
|
|
750
|
-
const styles$
|
|
750
|
+
const styles$y = StyleSheet.create({
|
|
751
751
|
buttonContainer: {
|
|
752
752
|
flexDirection: "row",
|
|
753
753
|
alignItems: "center",
|
|
@@ -759,7 +759,7 @@ const styles$z = StyleSheet.create({
|
|
|
759
759
|
});
|
|
760
760
|
var CustomButton$1 = withThemeProvider(CustomButton);
|
|
761
761
|
|
|
762
|
-
const styles$
|
|
762
|
+
const styles$x = StyleSheet.create({
|
|
763
763
|
container: {
|
|
764
764
|
padding: horizontalScale(20),
|
|
765
765
|
marginHorizontal: horizontalScale(16),
|
|
@@ -824,53 +824,53 @@ const Cards = ({
|
|
|
824
824
|
testID,
|
|
825
825
|
onButtonPress
|
|
826
826
|
}) => {
|
|
827
|
-
return /* @__PURE__ */ React.createElement(View, { testID, style: styles$
|
|
827
|
+
return /* @__PURE__ */ React.createElement(View, { testID, style: styles$x.container }, topLeftTitle ? /* @__PURE__ */ React.createElement(View, { style: styles$x.topLeft }, /* @__PURE__ */ React.createElement(
|
|
828
828
|
CustomTypography,
|
|
829
829
|
{
|
|
830
830
|
variant: "P2regular",
|
|
831
|
-
style: styles$
|
|
831
|
+
style: styles$x.title,
|
|
832
832
|
text: topLeftTitle
|
|
833
833
|
}
|
|
834
834
|
)) : null, title ? /* @__PURE__ */ React.createElement(
|
|
835
835
|
CustomTypography,
|
|
836
836
|
{
|
|
837
837
|
variant: "H6bold",
|
|
838
|
-
style: styles$
|
|
838
|
+
style: styles$x.subTitleBelow,
|
|
839
839
|
text: title
|
|
840
840
|
}
|
|
841
841
|
) : null, subtitle ? /* @__PURE__ */ React.createElement(
|
|
842
842
|
CustomTypography,
|
|
843
843
|
{
|
|
844
844
|
variant: "P3regular",
|
|
845
|
-
style: styles$
|
|
845
|
+
style: styles$x.subtitle,
|
|
846
846
|
text: subtitle
|
|
847
847
|
}
|
|
848
|
-
) : null, /* @__PURE__ */ React.createElement(View, { style: styles$
|
|
848
|
+
) : null, /* @__PURE__ */ React.createElement(View, { style: styles$x.leftBottomView }, iconSource ? iconSource : null, iconTitle ? /* @__PURE__ */ React.createElement(
|
|
849
849
|
CustomTypography,
|
|
850
850
|
{
|
|
851
851
|
variant: "P3regular",
|
|
852
|
-
style: styles$
|
|
852
|
+
style: styles$x.subTitleLeftBelow,
|
|
853
853
|
text: iconTitle
|
|
854
854
|
}
|
|
855
855
|
) : null), buttonShown ? /* @__PURE__ */ React.createElement(
|
|
856
856
|
Pressable,
|
|
857
857
|
{
|
|
858
858
|
testID: "Button-Press",
|
|
859
|
-
style: styles$
|
|
859
|
+
style: styles$x.button,
|
|
860
860
|
onPress: onButtonPress
|
|
861
861
|
},
|
|
862
862
|
/* @__PURE__ */ React.createElement(
|
|
863
863
|
CustomTypography,
|
|
864
864
|
{
|
|
865
865
|
variant: "B2semiBold",
|
|
866
|
-
style: styles$
|
|
866
|
+
style: styles$x.buttonText,
|
|
867
867
|
text: buttonText
|
|
868
868
|
}
|
|
869
869
|
)
|
|
870
870
|
) : null);
|
|
871
871
|
};
|
|
872
872
|
|
|
873
|
-
const styles$
|
|
873
|
+
const styles$w = StyleSheet.create({
|
|
874
874
|
checkboxContainer: {
|
|
875
875
|
alignItems: "center",
|
|
876
876
|
justifyContent: "center"
|
|
@@ -926,9 +926,9 @@ const Checkbox = ({
|
|
|
926
926
|
testID: "Checkbox-Press",
|
|
927
927
|
onPress: handlePress,
|
|
928
928
|
disabled: disable,
|
|
929
|
-
style: styles$
|
|
929
|
+
style: styles$w.directionStyle
|
|
930
930
|
},
|
|
931
|
-
/* @__PURE__ */ React.createElement(View, { style: styles$
|
|
931
|
+
/* @__PURE__ */ React.createElement(View, { style: styles$w.checkboxContainer }, React.cloneElement(checked ? checkedIcon : uncheckedIcon)),
|
|
932
932
|
/* @__PURE__ */ React.createElement(
|
|
933
933
|
CustomTypography,
|
|
934
934
|
{
|
|
@@ -940,7 +940,7 @@ const Checkbox = ({
|
|
|
940
940
|
));
|
|
941
941
|
};
|
|
942
942
|
|
|
943
|
-
const styles$
|
|
943
|
+
const styles$v = StyleSheet.create({
|
|
944
944
|
labelStyle: {
|
|
945
945
|
color: DHRE_COLORS_TEXT.DH_TEXTLIGHT
|
|
946
946
|
},
|
|
@@ -994,26 +994,26 @@ const CustomDropdown$1 = ({
|
|
|
994
994
|
CustomTypography,
|
|
995
995
|
{
|
|
996
996
|
variant: "P3regular",
|
|
997
|
-
style: styles$
|
|
997
|
+
style: styles$v.labelStyle,
|
|
998
998
|
text: label
|
|
999
999
|
}
|
|
1000
1000
|
), /* @__PURE__ */ React.createElement(
|
|
1001
1001
|
Pressable,
|
|
1002
1002
|
{
|
|
1003
1003
|
testID: `${testId}-BTN`,
|
|
1004
|
-
style: styles$
|
|
1004
|
+
style: styles$v.dropDownStyle,
|
|
1005
1005
|
onPress: () => setShowOptions(!showOptions)
|
|
1006
1006
|
},
|
|
1007
1007
|
iconName && /* @__PURE__ */ React.createElement(View, { style: iconStyle }, React.cloneElement(iconName, {
|
|
1008
1008
|
width: moderateScale(24),
|
|
1009
1009
|
height: moderateScale(24),
|
|
1010
|
-
style: styles$
|
|
1010
|
+
style: styles$v.iconStyle
|
|
1011
1011
|
})),
|
|
1012
1012
|
/* @__PURE__ */ React.createElement(
|
|
1013
1013
|
CustomTypography,
|
|
1014
1014
|
{
|
|
1015
1015
|
variant: "P3regular",
|
|
1016
|
-
style: styles$
|
|
1016
|
+
style: styles$v.selectedValueStyle,
|
|
1017
1017
|
text: selectedValue ? selectedValue.label : placeholder
|
|
1018
1018
|
}
|
|
1019
1019
|
),
|
|
@@ -1024,7 +1024,7 @@ const CustomDropdown$1 = ({
|
|
|
1024
1024
|
width: moderateScale(24),
|
|
1025
1025
|
height: moderateScale(24)
|
|
1026
1026
|
}))
|
|
1027
|
-
), showOptions && /* @__PURE__ */ React.createElement(View, { style: styles$
|
|
1027
|
+
), showOptions && /* @__PURE__ */ React.createElement(View, { style: styles$v.optionContainer }, options?.map(({ id, value, label: label2 }) => /* @__PURE__ */ React.createElement(
|
|
1028
1028
|
Pressable,
|
|
1029
1029
|
{
|
|
1030
1030
|
key: id,
|
|
@@ -1034,7 +1034,7 @@ const CustomDropdown$1 = ({
|
|
|
1034
1034
|
oneSelect({ id, value, label: label2 });
|
|
1035
1035
|
},
|
|
1036
1036
|
style: [
|
|
1037
|
-
styles$
|
|
1037
|
+
styles$v.item,
|
|
1038
1038
|
{
|
|
1039
1039
|
backgroundColor: id === selectedValue?.id ? DHRE_COLORS_BG.DH_GREY1 : DHRE_COLORS_TEXT.DH_WHITE
|
|
1040
1040
|
}
|
|
@@ -1043,7 +1043,7 @@ const CustomDropdown$1 = ({
|
|
|
1043
1043
|
iconName && /* @__PURE__ */ React.createElement(View, { style: iconStyle }, React.cloneElement(iconName, {
|
|
1044
1044
|
width: moderateScale(24),
|
|
1045
1045
|
height: moderateScale(24),
|
|
1046
|
-
style: styles$
|
|
1046
|
+
style: styles$v.iconStyle
|
|
1047
1047
|
})),
|
|
1048
1048
|
/* @__PURE__ */ React.createElement(
|
|
1049
1049
|
CustomTypography,
|
|
@@ -1058,7 +1058,7 @@ const CustomDropdown$1 = ({
|
|
|
1058
1058
|
))));
|
|
1059
1059
|
};
|
|
1060
1060
|
|
|
1061
|
-
const styles$
|
|
1061
|
+
const styles$u = StyleSheet.create({
|
|
1062
1062
|
labelStyle: {
|
|
1063
1063
|
color: DHRE_COLORS_TEXT.DH_TEXTDARK
|
|
1064
1064
|
},
|
|
@@ -1140,18 +1140,18 @@ const CustomTextInput = ({
|
|
|
1140
1140
|
CustomTypography,
|
|
1141
1141
|
{
|
|
1142
1142
|
variant: "P3medium",
|
|
1143
|
-
style: [styles$
|
|
1143
|
+
style: [styles$u.labelStyle, disabled && styles$u.disableTextStyle],
|
|
1144
1144
|
text: label
|
|
1145
1145
|
}
|
|
1146
1146
|
), /* @__PURE__ */ React.createElement(
|
|
1147
1147
|
View,
|
|
1148
1148
|
{
|
|
1149
1149
|
style: [
|
|
1150
|
-
styles$
|
|
1151
|
-
isFocused && styles$
|
|
1152
|
-
error && styles$
|
|
1153
|
-
disabled && styles$
|
|
1154
|
-
successMessage ? styles$
|
|
1150
|
+
styles$u.inputContainer,
|
|
1151
|
+
isFocused && styles$u.inputFocused,
|
|
1152
|
+
error && styles$u.inputError,
|
|
1153
|
+
disabled && styles$u.disableInputStyle,
|
|
1154
|
+
successMessage ? styles$u.inputSucess : {},
|
|
1155
1155
|
{
|
|
1156
1156
|
height: multiline ? 120 : 48,
|
|
1157
1157
|
alignItems: multiline ? "flex-start" : "center"
|
|
@@ -1161,7 +1161,7 @@ const CustomTextInput = ({
|
|
|
1161
1161
|
isSearchBar && searchIcon && React.cloneElement(searchIcon, {
|
|
1162
1162
|
width: moderateScale(24),
|
|
1163
1163
|
height: moderateScale(24),
|
|
1164
|
-
style: styles$
|
|
1164
|
+
style: styles$u.searchIconStyle
|
|
1165
1165
|
}),
|
|
1166
1166
|
/* @__PURE__ */ React.createElement(
|
|
1167
1167
|
TextInput,
|
|
@@ -1169,7 +1169,7 @@ const CustomTextInput = ({
|
|
|
1169
1169
|
...props,
|
|
1170
1170
|
onFocus,
|
|
1171
1171
|
onBlur,
|
|
1172
|
-
style: styles$
|
|
1172
|
+
style: styles$u.input,
|
|
1173
1173
|
placeholderTextColor: DHRE_COLORS_TEXT.DH_TEXTLIGHTEST,
|
|
1174
1174
|
editable: !disabled,
|
|
1175
1175
|
value,
|
|
@@ -1202,52 +1202,26 @@ const CustomTextInput = ({
|
|
|
1202
1202
|
));
|
|
1203
1203
|
};
|
|
1204
1204
|
|
|
1205
|
-
const styles$u = StyleSheet.create({
|
|
1206
|
-
tooltipContainerStyle: {
|
|
1207
|
-
flex: 1,
|
|
1208
|
-
borderRadius: moderateScale(16),
|
|
1209
|
-
padding: moderateScale(8)
|
|
1210
|
-
},
|
|
1211
|
-
mesageContainer: {
|
|
1212
|
-
flex: 1,
|
|
1213
|
-
flexDirection: "row",
|
|
1214
|
-
justifyContent: "space-between",
|
|
1215
|
-
alignItems: "center"
|
|
1216
|
-
},
|
|
1217
|
-
messageStyle: {
|
|
1218
|
-
flex: 1,
|
|
1219
|
-
color: DHRE_COLORS_TEXT.DH_TEXTDARK
|
|
1220
|
-
}
|
|
1221
|
-
});
|
|
1222
|
-
|
|
1223
1205
|
const CustomTooltip = ({
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
iconStyle,
|
|
1232
|
-
iconColor = DHRE_COLORS_TEXT.DH_BLACK
|
|
1206
|
+
isVisible,
|
|
1207
|
+
onClose,
|
|
1208
|
+
content,
|
|
1209
|
+
placement = "bottom",
|
|
1210
|
+
displayInsets = { top: 0, bottom: 20, left: 20, right: 0 },
|
|
1211
|
+
backgroundColor,
|
|
1212
|
+
triggerElement
|
|
1233
1213
|
}) => {
|
|
1234
|
-
const defaultPopoverContent = /* @__PURE__ */ React.createElement(View, { style: styles$u.mesageContainer, testID: testId }, /* @__PURE__ */ React.createElement(
|
|
1235
|
-
CustomTypography,
|
|
1236
|
-
{
|
|
1237
|
-
variant: "P4regular",
|
|
1238
|
-
style: styles$u.messageStyle,
|
|
1239
|
-
text: message
|
|
1240
|
-
}
|
|
1241
|
-
), icon && /* @__PURE__ */ React.createElement(View, { style: iconStyle }, React.cloneElement(icon, { fill: iconColor })));
|
|
1242
1214
|
return /* @__PURE__ */ React.createElement(
|
|
1243
1215
|
Tooltip,
|
|
1244
1216
|
{
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1217
|
+
isVisible,
|
|
1218
|
+
content,
|
|
1219
|
+
placement,
|
|
1220
|
+
onClose,
|
|
1221
|
+
displayInsets,
|
|
1222
|
+
backgroundColor
|
|
1249
1223
|
},
|
|
1250
|
-
|
|
1224
|
+
triggerElement
|
|
1251
1225
|
);
|
|
1252
1226
|
};
|
|
1253
1227
|
|