@dropi/react-native-design-system 0.1.11 → 0.1.12
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/constants/text.js +2 -2
- package/lib/molecules/Alert/Alert.js +25 -22
- package/package.json +1 -1
package/lib/constants/text.js
CHANGED
|
@@ -19,9 +19,9 @@ const baseSizes = {
|
|
|
19
19
|
xxxl: 28,
|
|
20
20
|
xxxxl: 32
|
|
21
21
|
};
|
|
22
|
-
const BASE_WIDTH =
|
|
22
|
+
const BASE_WIDTH = 360;
|
|
23
23
|
const rawScaleFactor = width / BASE_WIDTH;
|
|
24
|
-
const multiplier = rawScaleFactor > 1 ? 1 + (rawScaleFactor - 1) * 0.
|
|
24
|
+
const multiplier = rawScaleFactor > 1 ? 1 + (rawScaleFactor - 1) * 0.2 : rawScaleFactor;
|
|
25
25
|
const fontScale = _reactNative.PixelRatio.getFontScale();
|
|
26
26
|
const sizes = exports.sizes = Object.fromEntries(Object.entries(baseSizes).map(([key, value]) => [key, Math.round(value * multiplier * fontScale)]));
|
|
27
27
|
const weights = exports.weights = {
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Alert = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _reactNative2 = require("dropi-lib-icons/react-native");
|
|
9
|
-
var _utils = require("../../utils");
|
|
10
9
|
var _constants = require("../../constants");
|
|
11
10
|
var _atoms = require("../../atoms");
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -14,22 +13,22 @@ const variantStyles = {
|
|
|
14
13
|
info: {
|
|
15
14
|
backgroundColor: _constants.colors['Info-50'].light,
|
|
16
15
|
borderColor: _constants.colors['Info-500'].light,
|
|
17
|
-
icon: '
|
|
16
|
+
icon: 'info'
|
|
18
17
|
},
|
|
19
18
|
warning: {
|
|
20
19
|
backgroundColor: _constants.colors['Warning-50'].light,
|
|
21
20
|
borderColor: _constants.colors['Warning-500'].light,
|
|
22
|
-
icon: '
|
|
21
|
+
icon: 'warning-circle'
|
|
23
22
|
},
|
|
24
23
|
error: {
|
|
25
24
|
backgroundColor: _constants.colors['Error-50'].light,
|
|
26
25
|
borderColor: _constants.colors['Error-500'].light,
|
|
27
|
-
icon: 'warning-
|
|
26
|
+
icon: 'warning-triangle'
|
|
28
27
|
},
|
|
29
28
|
success: {
|
|
30
29
|
backgroundColor: _constants.colors['Success-50'].light,
|
|
31
30
|
borderColor: _constants.colors['Success-500'].light,
|
|
32
|
-
icon: '
|
|
31
|
+
icon: 'check-circle'
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
34
|
const Alert = ({
|
|
@@ -45,14 +44,10 @@ const Alert = ({
|
|
|
45
44
|
icon
|
|
46
45
|
} = variantStyles[variant];
|
|
47
46
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
48
|
-
style: {
|
|
47
|
+
style: [styles.container, {
|
|
49
48
|
backgroundColor: backgroundColor,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
padding: 12,
|
|
53
|
-
borderRadius: _constants.radius["border-2"],
|
|
54
|
-
flexDirection: 'row'
|
|
55
|
-
},
|
|
49
|
+
borderColor: borderColor
|
|
50
|
+
}],
|
|
56
51
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
57
52
|
style: styles.alertIcon,
|
|
58
53
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Icon, {
|
|
@@ -62,16 +57,10 @@ const Alert = ({
|
|
|
62
57
|
})
|
|
63
58
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_atoms.Body, {
|
|
64
59
|
type: "s-regular",
|
|
65
|
-
style:
|
|
66
|
-
color: _constants.colors['Gray-700'].light,
|
|
67
|
-
flex: 1,
|
|
68
|
-
marginRight: !_utils.isTablet ? 8 : 12
|
|
69
|
-
},
|
|
60
|
+
style: styles.message,
|
|
70
61
|
children: message
|
|
71
62
|
}), buttonLabel && onButtonPress && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
72
|
-
style:
|
|
73
|
-
marginRight: !_utils.isTablet ? 8 : 12
|
|
74
|
-
},
|
|
63
|
+
style: styles.btnContainer,
|
|
75
64
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_atoms.FeedbackButton, {
|
|
76
65
|
feedbackType: variant,
|
|
77
66
|
label: buttonLabel || 'Label',
|
|
@@ -90,8 +79,22 @@ const Alert = ({
|
|
|
90
79
|
};
|
|
91
80
|
exports.Alert = Alert;
|
|
92
81
|
const styles = _reactNative.StyleSheet.create({
|
|
82
|
+
container: {
|
|
83
|
+
borderWidth: 1,
|
|
84
|
+
padding: 12,
|
|
85
|
+
borderRadius: _constants.radius["border-2"],
|
|
86
|
+
flexDirection: 'row'
|
|
87
|
+
},
|
|
93
88
|
alertIcon: {
|
|
94
|
-
marginRight:
|
|
95
|
-
marginTop:
|
|
89
|
+
marginRight: _constants.spacing['size-4'],
|
|
90
|
+
marginTop: _constants.spacing['size-1']
|
|
91
|
+
},
|
|
92
|
+
message: {
|
|
93
|
+
color: _constants.colors['Gray-700'].light,
|
|
94
|
+
flex: 1,
|
|
95
|
+
marginRight: _constants.spacing['size-2']
|
|
96
|
+
},
|
|
97
|
+
btnContainer: {
|
|
98
|
+
marginRight: _constants.spacing['size-2']
|
|
96
99
|
}
|
|
97
100
|
});
|