@dropi/react-native-design-system 0.3.27 → 0.3.29

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.
@@ -1,11 +1,13 @@
1
- import type { Variant } from '../../atoms/Buttons/DefaultButton';
1
+ import type { Variant } from "../../atoms/Buttons/DefaultButton";
2
+ import { IconName } from "dropi-lib-icons";
2
3
  interface Props {
3
4
  imageSource?: string | number;
5
+ icon?: IconName;
4
6
  title?: string;
5
7
  message: string;
6
8
  buttonLabel?: string;
7
9
  onButtonPress?: () => void;
8
10
  buttonType?: Variant;
9
11
  }
10
- export declare const EmptyState: ({ imageSource, title, message, buttonLabel, onButtonPress, buttonType }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const EmptyState: ({ imageSource, icon, title, message, buttonLabel, onButtonPress, buttonType, }: Props) => import("react/jsx-runtime").JSX.Element;
11
13
  export {};
@@ -9,18 +9,35 @@ var _expoImage = require("expo-image");
9
9
  var _constants = require("../../constants");
10
10
  var _atoms = require("../../atoms");
11
11
  var _utils = require("../../utils");
12
+ var _reactNative2 = _interopRequireDefault(require("dropi-lib-icons/react-native"));
12
13
  var _jsxRuntime = require("react/jsx-runtime");
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
15
  const EmptyState = ({
14
16
  imageSource,
17
+ icon,
15
18
  title,
16
19
  message,
17
20
  buttonLabel,
18
21
  onButtonPress,
19
- buttonType = 'tertiary'
22
+ buttonType = "tertiary"
20
23
  }) => {
24
+ if (imageSource && icon) {
25
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_atoms.Body, {
26
+ type: "m-regular",
27
+ style: styles.message,
28
+ children: "Debe seleccionar un solo tipo de \xEDcono, ya sea imagen o icono integrado."
29
+ });
30
+ }
21
31
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
22
32
  style: styles.container,
23
- children: [imageSource && /*#__PURE__*/(0, _jsxRuntime.jsx)(_expoImage.Image, {
33
+ children: [icon && !imageSource && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
34
+ style: styles.warningIconContainer,
35
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.default, {
36
+ name: icon,
37
+ size: 20,
38
+ color: _constants.colors["Gray-500"].light
39
+ })
40
+ }), imageSource && !icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_expoImage.Image, {
24
41
  source: imageSource,
25
42
  style: styles.image,
26
43
  contentFit: "contain"
@@ -38,7 +55,7 @@ const EmptyState = ({
38
55
  label: buttonLabel,
39
56
  onPress: onButtonPress,
40
57
  variant: buttonType,
41
- size: 'normal'
58
+ size: "normal"
42
59
  })
43
60
  })]
44
61
  });
@@ -46,25 +63,34 @@ const EmptyState = ({
46
63
  exports.EmptyState = EmptyState;
47
64
  const styles = _reactNative.StyleSheet.create({
48
65
  container: {
49
- paddingVertical: _constants.spacing['size-4']
66
+ paddingVertical: _constants.spacing["size-4"],
67
+ alignItems: "center"
50
68
  },
51
69
  image: {
52
70
  width: !_utils.isTablet ? 51 : 72,
53
71
  height: !_utils.isTablet ? 48 : 68,
54
- alignSelf: 'center',
55
- marginBottom: _constants.spacing['size-4']
72
+ marginBottom: _constants.spacing["size-4"]
56
73
  },
57
74
  title: {
58
- color: _constants.colors['Gray-700'].light,
59
- textAlign: 'center',
60
- marginBottom: _constants.spacing['size-2']
75
+ color: _constants.colors["Gray-700"].light,
76
+ textAlign: "center",
77
+ marginBottom: _constants.spacing["size-2"]
61
78
  },
62
79
  message: {
63
- color: _constants.colors['Gray-500'].light,
64
- textAlign: 'center'
80
+ color: _constants.colors["Gray-500"].light,
81
+ textAlign: "center"
65
82
  },
66
83
  buttonContainer: {
67
- marginTop: _constants.spacing['size-5'],
68
- alignItems: 'center'
84
+ marginTop: _constants.spacing["size-5"],
85
+ alignItems: "center"
86
+ },
87
+ warningIconContainer: {
88
+ backgroundColor: _constants.colors["Gray-50"].light,
89
+ width: 48,
90
+ height: 48,
91
+ borderRadius: 32,
92
+ justifyContent: "center",
93
+ alignItems: "center",
94
+ marginBottom: _constants.spacing["size-4"]
69
95
  }
70
96
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dropi/react-native-design-system",
3
- "version": "0.3.27",
3
+ "version": "0.3.29",
4
4
  "description": "A React Native package built from scratch",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",