@dropi/react-native-design-system 0.1.3 → 0.1.5
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/atoms/Buttons/DefaultButton.js +31 -26
- package/lib/atoms/Buttons/FeedbackButton.js +30 -25
- package/lib/atoms/Buttons/TextButton.js +30 -25
- package/lib/atoms/Text/Body.js +5 -4
- package/lib/atoms/Text/Caption.js +5 -4
- package/lib/atoms/Text/Heading.js +5 -4
- package/lib/atoms/Text/Label.js +5 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.js +11 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ var _reactNative2 = require("dropi-lib-icons/react-native");
|
|
|
9
9
|
var _utils = require("../../utils");
|
|
10
10
|
var _constants = require("../../constants");
|
|
11
11
|
var _Text = require("../Text");
|
|
12
|
-
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
const DefaultButton = ({
|
|
14
14
|
label,
|
|
15
15
|
variant,
|
|
@@ -24,7 +24,7 @@ const DefaultButton = ({
|
|
|
24
24
|
const iconSize = size === 'small' ? 12 : size === 'large' ? 16 : 14;
|
|
25
25
|
const tabletIconSize = size === 'small' ? 20 : size === 'large' ? 24 : 22;
|
|
26
26
|
const labelColor = variant === 'primary' ? _constants.colors.White.light : variant === 'secondary' ? _constants.colors['Primary-500'].light : _constants.colors['Gray-500'].light;
|
|
27
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
28
28
|
style: {
|
|
29
29
|
backgroundColor: variant == 'primary' ? _constants.colors['Primary-500'].light : 'transparent',
|
|
30
30
|
paddingVertical: size === 'small' ? 8 : size === 'large' ? _constants.spacing['size-4'] : _constants.spacing['size-3'],
|
|
@@ -37,31 +37,36 @@ const DefaultButton = ({
|
|
|
37
37
|
borderColor: variant === 'secondary' ? _constants.colors['Primary-500'].light : _constants.colors['Gray-500'].light,
|
|
38
38
|
flexDirection: 'row'
|
|
39
39
|
},
|
|
40
|
-
disabled: disabled || isMakingRequest
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
disabled: disabled || isMakingRequest,
|
|
41
|
+
...rest,
|
|
42
|
+
children: [preIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
43
|
+
style: {
|
|
44
|
+
marginRight: _constants.spacing['size-2']
|
|
45
|
+
},
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Icon, {
|
|
47
|
+
name: preIcon,
|
|
48
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
49
|
+
color: labelColor
|
|
50
|
+
})
|
|
51
|
+
}), !isMakingRequest ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Label, {
|
|
52
|
+
type: textVariant,
|
|
53
|
+
style: {
|
|
54
|
+
color: labelColor
|
|
55
|
+
},
|
|
56
|
+
children: label
|
|
57
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
52
58
|
color: labelColor
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
})));
|
|
59
|
+
}), postIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
60
|
+
style: {
|
|
61
|
+
marginLeft: _constants.spacing['size-2']
|
|
62
|
+
},
|
|
63
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Icon, {
|
|
64
|
+
name: postIcon,
|
|
65
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
66
|
+
color: labelColor
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
65
70
|
};
|
|
66
71
|
exports.DefaultButton = DefaultButton;
|
|
67
72
|
const styles = _reactNative.StyleSheet.create({});
|
|
@@ -9,7 +9,7 @@ var _reactNative2 = require("dropi-lib-icons/react-native");
|
|
|
9
9
|
var _utils = require("../../utils");
|
|
10
10
|
var _constants = require("../../constants");
|
|
11
11
|
var _Text = require("../Text");
|
|
12
|
-
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
const FeedbackButton = ({
|
|
14
14
|
label,
|
|
15
15
|
feedbackType,
|
|
@@ -26,7 +26,7 @@ const FeedbackButton = ({
|
|
|
26
26
|
const tabletIconSize = size === 'small' ? 20 : size === 'large' ? 24 : 22;
|
|
27
27
|
const color = feedbackType === 'success' ? _constants.colors['Success-500'].light : feedbackType === 'error' ? _constants.colors['Error-500'].light : feedbackType === 'warning' ? _constants.colors['Warning-500'].light : _constants.colors['Info-500'].light;
|
|
28
28
|
const labelColor = variant === 'primary' ? _constants.colors.White.light : color;
|
|
29
|
-
return /*#__PURE__*/
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
30
30
|
style: {
|
|
31
31
|
backgroundColor: variant === 'primary' ? color : 'transparent',
|
|
32
32
|
paddingVertical: size === 'small' ? 8 : size === 'large' ? _constants.spacing['size-4'] : _constants.spacing['size-3'],
|
|
@@ -39,29 +39,34 @@ const FeedbackButton = ({
|
|
|
39
39
|
borderColor: variant === 'secondary' ? color : undefined,
|
|
40
40
|
flexDirection: 'row',
|
|
41
41
|
alignSelf: 'flex-start'
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
42
|
+
},
|
|
43
|
+
...rest,
|
|
44
|
+
children: [preIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
45
|
+
style: {
|
|
46
|
+
marginRight: _constants.spacing['size-2']
|
|
47
|
+
},
|
|
48
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Icon, {
|
|
49
|
+
name: preIcon,
|
|
50
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
51
|
+
color: labelColor
|
|
52
|
+
})
|
|
53
|
+
}), label !== '' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Label, {
|
|
54
|
+
type: textVariant,
|
|
55
|
+
style: {
|
|
56
|
+
color: labelColor
|
|
57
|
+
},
|
|
58
|
+
children: label
|
|
59
|
+
}), postIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
60
|
+
style: {
|
|
61
|
+
marginLeft: _constants.spacing['size-2']
|
|
62
|
+
},
|
|
63
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Icon, {
|
|
64
|
+
name: postIcon,
|
|
65
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
66
|
+
color: labelColor
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
65
70
|
};
|
|
66
71
|
exports.FeedbackButton = FeedbackButton;
|
|
67
72
|
const styles = _reactNative.StyleSheet.create({});
|
|
@@ -9,7 +9,7 @@ var _utils = require("../../utils");
|
|
|
9
9
|
var _constants = require("../../constants/");
|
|
10
10
|
var _Text = require("../Text");
|
|
11
11
|
var _reactNative2 = require("dropi-lib-icons/react-native");
|
|
12
|
-
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
const TextButton = ({
|
|
14
14
|
label,
|
|
15
15
|
variant,
|
|
@@ -23,30 +23,35 @@ const TextButton = ({
|
|
|
23
23
|
const iconSize = size === 'small' ? 12 : size === 'large' ? 16 : 14;
|
|
24
24
|
const tabletIconSize = size === 'small' ? 20 : size === 'large' ? 24 : 22;
|
|
25
25
|
const color = replaceColor ? replaceColor : variant == 'primary' ? _constants.colors['Primary-500'].light : _constants.colors['Gray-500'].dark;
|
|
26
|
-
return /*#__PURE__*/
|
|
27
|
-
style: styles.settingsButton
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
27
|
+
style: styles.settingsButton,
|
|
28
|
+
...rest,
|
|
29
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
30
|
+
style: {
|
|
31
|
+
marginRight: label != '' || postIcon ? _constants.spacing['size-2'] : 0
|
|
32
|
+
},
|
|
33
|
+
children: preIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Icon, {
|
|
34
|
+
name: preIcon,
|
|
35
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
36
|
+
color: color
|
|
37
|
+
})
|
|
38
|
+
}), label !== '' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Label, {
|
|
39
|
+
type: textVariant,
|
|
40
|
+
style: {
|
|
41
|
+
color: color
|
|
42
|
+
},
|
|
43
|
+
children: label
|
|
44
|
+
}), postIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
45
|
+
style: {
|
|
46
|
+
marginLeft: label != '' || preIcon ? _constants.spacing['size-2'] : 0
|
|
47
|
+
},
|
|
48
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Icon, {
|
|
49
|
+
name: postIcon,
|
|
50
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
51
|
+
color: color
|
|
52
|
+
})
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
50
55
|
};
|
|
51
56
|
exports.TextButton = TextButton;
|
|
52
57
|
const styles = _reactNative.StyleSheet.create({
|
package/lib/atoms/Text/Body.js
CHANGED
|
@@ -7,15 +7,16 @@ exports.Body = void 0;
|
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _constants = require("../../constants");
|
|
9
9
|
var _utils = require("../../utils");
|
|
10
|
-
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
const Body = ({
|
|
12
12
|
type,
|
|
13
13
|
style,
|
|
14
14
|
...rest
|
|
15
15
|
}) => {
|
|
16
|
-
return /*#__PURE__*/
|
|
17
|
-
style: [styles[type], style]
|
|
18
|
-
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
17
|
+
style: [styles[type], style],
|
|
18
|
+
...rest
|
|
19
|
+
});
|
|
19
20
|
};
|
|
20
21
|
exports.Body = Body;
|
|
21
22
|
const styles = _reactNative.StyleSheet.create({
|
|
@@ -7,15 +7,16 @@ exports.Caption = void 0;
|
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _constants = require("../../constants");
|
|
9
9
|
var _utils = require("../..//utils");
|
|
10
|
-
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
const Caption = ({
|
|
12
12
|
type,
|
|
13
13
|
style,
|
|
14
14
|
...rest
|
|
15
15
|
}) => {
|
|
16
|
-
return /*#__PURE__*/
|
|
17
|
-
style: [styles[type], style]
|
|
18
|
-
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
17
|
+
style: [styles[type], style],
|
|
18
|
+
...rest
|
|
19
|
+
});
|
|
19
20
|
};
|
|
20
21
|
exports.Caption = Caption;
|
|
21
22
|
const styles = _reactNative.StyleSheet.create({
|
|
@@ -7,15 +7,16 @@ exports.Heading = void 0;
|
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _constants = require("../../constants");
|
|
9
9
|
var _utils = require("../../utils");
|
|
10
|
-
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
const Heading = ({
|
|
12
12
|
type,
|
|
13
13
|
style,
|
|
14
14
|
...rest
|
|
15
15
|
}) => {
|
|
16
|
-
return /*#__PURE__*/
|
|
17
|
-
style: [styles[type], style]
|
|
18
|
-
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
17
|
+
style: [styles[type], style],
|
|
18
|
+
...rest
|
|
19
|
+
});
|
|
19
20
|
};
|
|
20
21
|
exports.Heading = Heading;
|
|
21
22
|
const styles = _reactNative.StyleSheet.create({
|
package/lib/atoms/Text/Label.js
CHANGED
|
@@ -7,15 +7,16 @@ exports.Label = void 0;
|
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _constants = require("../../constants");
|
|
9
9
|
var _utils = require("../../utils");
|
|
10
|
-
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
const Label = ({
|
|
12
12
|
type,
|
|
13
13
|
style,
|
|
14
14
|
...rest
|
|
15
15
|
}) => {
|
|
16
|
-
return /*#__PURE__*/
|
|
17
|
-
style: [styles[type], style]
|
|
18
|
-
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
17
|
+
style: [styles[type], style],
|
|
18
|
+
...rest
|
|
19
|
+
});
|
|
19
20
|
};
|
|
20
21
|
exports.Label = Label;
|
|
21
22
|
const styles = _reactNative.StyleSheet.create({
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -24,4 +24,15 @@ Object.keys(_utils).forEach(function (key) {
|
|
|
24
24
|
return _utils[key];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
+
});
|
|
28
|
+
var _atoms = require("./atoms/");
|
|
29
|
+
Object.keys(_atoms).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _atoms[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _atoms[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
27
38
|
});
|