@dropi/react-native-design-system 0.1.2 → 0.1.3
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.d.ts +15 -0
- package/lib/atoms/Buttons/DefaultButton.js +67 -0
- package/lib/atoms/Buttons/FeedbackButton.d.ts +17 -0
- package/lib/atoms/Buttons/FeedbackButton.js +67 -0
- package/lib/atoms/Buttons/TextButton.d.ts +14 -0
- package/lib/atoms/Buttons/TextButton.js +57 -0
- package/lib/atoms/Buttons/index.d.ts +3 -0
- package/lib/atoms/Buttons/index.js +38 -0
- package/lib/atoms/Text/Body.d.ts +7 -0
- package/lib/atoms/Text/Body.js +62 -0
- package/lib/atoms/Text/Caption.d.ts +7 -0
- package/lib/atoms/Text/Caption.js +42 -0
- package/lib/atoms/Text/Heading.d.ts +7 -0
- package/lib/atoms/Text/Heading.js +47 -0
- package/lib/atoms/Text/Label.d.ts +7 -0
- package/lib/atoms/Text/Label.js +37 -0
- package/lib/atoms/Text/index.d.ts +4 -0
- package/lib/atoms/Text/index.js +49 -0
- package/lib/atoms/index.d.ts +2 -0
- package/lib/atoms/index.js +27 -0
- package/lib/utils/TextUtils.d.ts +1 -0
- package/lib/utils/TextUtils.js +10 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +15 -0
- package/package.json +5 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TouchableOpacityProps } from 'react-native';
|
|
2
|
+
import { IconName } from 'dropi-lib-icons';
|
|
3
|
+
type Variant = 'primary' | 'secondary' | 'tertiary';
|
|
4
|
+
type Size = 'small' | 'normal' | 'large';
|
|
5
|
+
interface Props extends TouchableOpacityProps {
|
|
6
|
+
label: string;
|
|
7
|
+
variant: Variant;
|
|
8
|
+
size: Size;
|
|
9
|
+
preIcon?: IconName;
|
|
10
|
+
postIcon?: IconName;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
isMakingRequest?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const DefaultButton: ({ label, variant, size, preIcon, postIcon, disabled, isMakingRequest, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DefaultButton = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _reactNative2 = require("dropi-lib-icons/react-native");
|
|
9
|
+
var _utils = require("../../utils");
|
|
10
|
+
var _constants = require("../../constants");
|
|
11
|
+
var _Text = require("../Text");
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
+
const DefaultButton = ({
|
|
14
|
+
label,
|
|
15
|
+
variant,
|
|
16
|
+
size,
|
|
17
|
+
preIcon,
|
|
18
|
+
postIcon,
|
|
19
|
+
disabled,
|
|
20
|
+
isMakingRequest,
|
|
21
|
+
...rest
|
|
22
|
+
}) => {
|
|
23
|
+
const textVariant = size === 'small' ? 's' : size === 'large' ? 'l' : 'm';
|
|
24
|
+
const iconSize = size === 'small' ? 12 : size === 'large' ? 16 : 14;
|
|
25
|
+
const tabletIconSize = size === 'small' ? 20 : size === 'large' ? 24 : 22;
|
|
26
|
+
const labelColor = variant === 'primary' ? _constants.colors.White.light : variant === 'secondary' ? _constants.colors['Primary-500'].light : _constants.colors['Gray-500'].light;
|
|
27
|
+
return /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, _extends({
|
|
28
|
+
style: {
|
|
29
|
+
backgroundColor: variant == 'primary' ? _constants.colors['Primary-500'].light : 'transparent',
|
|
30
|
+
paddingVertical: size === 'small' ? 8 : size === 'large' ? _constants.spacing['size-4'] : _constants.spacing['size-3'],
|
|
31
|
+
paddingHorizontal: _constants.spacing['size-4'],
|
|
32
|
+
borderRadius: _constants.radius['border-2'],
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
opacity: disabled ? 0.5 : 1,
|
|
36
|
+
borderWidth: variant === 'primary' ? 0 : 1,
|
|
37
|
+
borderColor: variant === 'secondary' ? _constants.colors['Primary-500'].light : _constants.colors['Gray-500'].light,
|
|
38
|
+
flexDirection: 'row'
|
|
39
|
+
},
|
|
40
|
+
disabled: disabled || isMakingRequest
|
|
41
|
+
}, rest), preIcon && /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
42
|
+
style: {
|
|
43
|
+
marginRight: _constants.spacing['size-2']
|
|
44
|
+
}
|
|
45
|
+
}, /*#__PURE__*/React.createElement(_reactNative2.Icon, {
|
|
46
|
+
name: preIcon,
|
|
47
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
48
|
+
color: labelColor
|
|
49
|
+
})), !isMakingRequest ? /*#__PURE__*/React.createElement(_Text.Label, {
|
|
50
|
+
type: textVariant,
|
|
51
|
+
style: {
|
|
52
|
+
color: labelColor
|
|
53
|
+
}
|
|
54
|
+
}, label) : /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
55
|
+
color: labelColor
|
|
56
|
+
}), postIcon && /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
57
|
+
style: {
|
|
58
|
+
marginLeft: _constants.spacing['size-2']
|
|
59
|
+
}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(_reactNative2.Icon, {
|
|
61
|
+
name: postIcon,
|
|
62
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
63
|
+
color: labelColor
|
|
64
|
+
})));
|
|
65
|
+
};
|
|
66
|
+
exports.DefaultButton = DefaultButton;
|
|
67
|
+
const styles = _reactNative.StyleSheet.create({});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TouchableOpacityProps } from 'react-native';
|
|
2
|
+
import { IconName } from 'dropi-lib-icons';
|
|
3
|
+
type FeedbackType = 'success' | 'error' | 'warning' | 'info';
|
|
4
|
+
type Variant = 'primary' | 'secondary' | 'text';
|
|
5
|
+
type Size = 'small' | 'normal' | 'large';
|
|
6
|
+
interface Props extends TouchableOpacityProps {
|
|
7
|
+
label: string;
|
|
8
|
+
feedbackType: FeedbackType;
|
|
9
|
+
variant: Variant;
|
|
10
|
+
size: Size;
|
|
11
|
+
preIcon?: IconName;
|
|
12
|
+
postIcon?: IconName;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
isMakingRerequest?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const FeedbackButton: ({ label, feedbackType, variant, size, preIcon, postIcon, disabled, isMakingRerequest, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FeedbackButton = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _reactNative2 = require("dropi-lib-icons/react-native");
|
|
9
|
+
var _utils = require("../../utils");
|
|
10
|
+
var _constants = require("../../constants");
|
|
11
|
+
var _Text = require("../Text");
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
+
const FeedbackButton = ({
|
|
14
|
+
label,
|
|
15
|
+
feedbackType,
|
|
16
|
+
variant,
|
|
17
|
+
size,
|
|
18
|
+
preIcon,
|
|
19
|
+
postIcon,
|
|
20
|
+
disabled,
|
|
21
|
+
isMakingRerequest,
|
|
22
|
+
...rest
|
|
23
|
+
}) => {
|
|
24
|
+
const textVariant = size === 'small' ? 's' : size === 'large' ? 'l' : 'm';
|
|
25
|
+
const iconSize = size === 'small' ? 12 : size === 'large' ? 16 : 14;
|
|
26
|
+
const tabletIconSize = size === 'small' ? 20 : size === 'large' ? 24 : 22;
|
|
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
|
+
const labelColor = variant === 'primary' ? _constants.colors.White.light : color;
|
|
29
|
+
return /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, _extends({
|
|
30
|
+
style: {
|
|
31
|
+
backgroundColor: variant === 'primary' ? color : 'transparent',
|
|
32
|
+
paddingVertical: size === 'small' ? 8 : size === 'large' ? _constants.spacing['size-4'] : _constants.spacing['size-3'],
|
|
33
|
+
paddingHorizontal: _constants.spacing['size-4'],
|
|
34
|
+
borderRadius: _constants.radius['border-2'],
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
justifyContent: 'center',
|
|
37
|
+
opacity: disabled || isMakingRerequest ? 0.5 : 1,
|
|
38
|
+
borderWidth: variant === 'secondary' ? 1 : 0,
|
|
39
|
+
borderColor: variant === 'secondary' ? color : undefined,
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
alignSelf: 'flex-start'
|
|
42
|
+
}
|
|
43
|
+
}, rest), preIcon && /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
44
|
+
style: {
|
|
45
|
+
marginRight: _constants.spacing['size-2']
|
|
46
|
+
}
|
|
47
|
+
}, /*#__PURE__*/React.createElement(_reactNative2.Icon, {
|
|
48
|
+
name: preIcon,
|
|
49
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
50
|
+
color: labelColor
|
|
51
|
+
})), label !== '' && /*#__PURE__*/React.createElement(_Text.Label, {
|
|
52
|
+
type: textVariant,
|
|
53
|
+
style: {
|
|
54
|
+
color: labelColor
|
|
55
|
+
}
|
|
56
|
+
}, label), postIcon && /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
57
|
+
style: {
|
|
58
|
+
marginLeft: _constants.spacing['size-2']
|
|
59
|
+
}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(_reactNative2.Icon, {
|
|
61
|
+
name: postIcon,
|
|
62
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
63
|
+
color: labelColor
|
|
64
|
+
})));
|
|
65
|
+
};
|
|
66
|
+
exports.FeedbackButton = FeedbackButton;
|
|
67
|
+
const styles = _reactNative.StyleSheet.create({});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TouchableOpacityProps } from 'react-native';
|
|
2
|
+
import type { IconName } from 'dropi-lib-icons/';
|
|
3
|
+
type Variant = 'primary' | 'secondary';
|
|
4
|
+
type Size = 'small' | 'normal' | 'large';
|
|
5
|
+
interface Props extends TouchableOpacityProps {
|
|
6
|
+
label: string;
|
|
7
|
+
variant: Variant;
|
|
8
|
+
size: Size;
|
|
9
|
+
preIcon?: IconName;
|
|
10
|
+
postIcon?: IconName;
|
|
11
|
+
replaceColor?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const TextButton: ({ label, variant, size, preIcon, postIcon, replaceColor, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TextButton = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _utils = require("../../utils");
|
|
9
|
+
var _constants = require("../../constants/");
|
|
10
|
+
var _Text = require("../Text");
|
|
11
|
+
var _reactNative2 = require("dropi-lib-icons/react-native");
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
+
const TextButton = ({
|
|
14
|
+
label,
|
|
15
|
+
variant,
|
|
16
|
+
size,
|
|
17
|
+
preIcon,
|
|
18
|
+
postIcon,
|
|
19
|
+
replaceColor,
|
|
20
|
+
...rest
|
|
21
|
+
}) => {
|
|
22
|
+
const textVariant = size === 'small' ? 's' : size === 'large' ? 'l' : 'm';
|
|
23
|
+
const iconSize = size === 'small' ? 12 : size === 'large' ? 16 : 14;
|
|
24
|
+
const tabletIconSize = size === 'small' ? 20 : size === 'large' ? 24 : 22;
|
|
25
|
+
const color = replaceColor ? replaceColor : variant == 'primary' ? _constants.colors['Primary-500'].light : _constants.colors['Gray-500'].dark;
|
|
26
|
+
return /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, _extends({
|
|
27
|
+
style: styles.settingsButton
|
|
28
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
29
|
+
style: {
|
|
30
|
+
marginRight: label != '' || postIcon ? _constants.spacing['size-2'] : 0
|
|
31
|
+
}
|
|
32
|
+
}, preIcon && /*#__PURE__*/React.createElement(_reactNative2.Icon, {
|
|
33
|
+
name: preIcon,
|
|
34
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
35
|
+
color: color
|
|
36
|
+
})), label !== '' && /*#__PURE__*/React.createElement(_Text.Label, {
|
|
37
|
+
type: textVariant,
|
|
38
|
+
style: {
|
|
39
|
+
color: color
|
|
40
|
+
}
|
|
41
|
+
}, label), postIcon && /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
42
|
+
style: {
|
|
43
|
+
marginLeft: label != '' || preIcon ? _constants.spacing['size-2'] : 0
|
|
44
|
+
}
|
|
45
|
+
}, /*#__PURE__*/React.createElement(_reactNative2.Icon, {
|
|
46
|
+
name: postIcon,
|
|
47
|
+
size: !_utils.isTablet ? iconSize : tabletIconSize,
|
|
48
|
+
color: color
|
|
49
|
+
})));
|
|
50
|
+
};
|
|
51
|
+
exports.TextButton = TextButton;
|
|
52
|
+
const styles = _reactNative.StyleSheet.create({
|
|
53
|
+
settingsButton: {
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
justifyContent: 'center'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _DefaultButton = require("./DefaultButton");
|
|
7
|
+
Object.keys(_DefaultButton).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _DefaultButton[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _DefaultButton[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _FeedbackButton = require("./FeedbackButton");
|
|
18
|
+
Object.keys(_FeedbackButton).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _FeedbackButton[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _FeedbackButton[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _TextButton = require("./TextButton");
|
|
29
|
+
Object.keys(_TextButton).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _TextButton[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _TextButton[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextProps } from 'react-native';
|
|
2
|
+
type BodyType = 'xs-regular' | 'xs-medium' | 's-regular' | 's-medium' | 'm-regular' | 'm-medium' | 'l-regular' | 'l-medium';
|
|
3
|
+
type Props = TextProps & {
|
|
4
|
+
type: BodyType;
|
|
5
|
+
};
|
|
6
|
+
export declare const Body: ({ type, style, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Body = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("../../constants");
|
|
9
|
+
var _utils = require("../../utils");
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
|
+
const Body = ({
|
|
12
|
+
type,
|
|
13
|
+
style,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({
|
|
17
|
+
style: [styles[type], style]
|
|
18
|
+
}, rest));
|
|
19
|
+
};
|
|
20
|
+
exports.Body = Body;
|
|
21
|
+
const styles = _reactNative.StyleSheet.create({
|
|
22
|
+
'xs-regular': {
|
|
23
|
+
fontSize: _constants.sizes.xs,
|
|
24
|
+
fontWeight: _constants.weights.regular,
|
|
25
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xs, 150)
|
|
26
|
+
},
|
|
27
|
+
'xs-medium': {
|
|
28
|
+
fontSize: _constants.sizes.xs,
|
|
29
|
+
fontWeight: _constants.weights.medium,
|
|
30
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xs, 150)
|
|
31
|
+
},
|
|
32
|
+
's-regular': {
|
|
33
|
+
fontSize: _constants.sizes.s,
|
|
34
|
+
fontWeight: _constants.weights.regular,
|
|
35
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.s, 150)
|
|
36
|
+
},
|
|
37
|
+
's-medium': {
|
|
38
|
+
fontSize: _constants.sizes.s,
|
|
39
|
+
fontWeight: _constants.weights.medium,
|
|
40
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.s, 150)
|
|
41
|
+
},
|
|
42
|
+
'm-regular': {
|
|
43
|
+
fontSize: _constants.sizes.m,
|
|
44
|
+
fontWeight: _constants.weights.regular,
|
|
45
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.m, 150)
|
|
46
|
+
},
|
|
47
|
+
'm-medium': {
|
|
48
|
+
fontSize: _constants.sizes.m,
|
|
49
|
+
fontWeight: _constants.weights.medium,
|
|
50
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.m, 150)
|
|
51
|
+
},
|
|
52
|
+
'l-regular': {
|
|
53
|
+
fontSize: _constants.sizes.l,
|
|
54
|
+
fontWeight: _constants.weights.regular,
|
|
55
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.l, 150)
|
|
56
|
+
},
|
|
57
|
+
'l-medium': {
|
|
58
|
+
fontSize: _constants.sizes.l,
|
|
59
|
+
fontWeight: _constants.weights.medium,
|
|
60
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.l, 150)
|
|
61
|
+
}
|
|
62
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextProps } from 'react-native';
|
|
2
|
+
type CaptionType = 's' | 'm' | 's-light' | 'm-light';
|
|
3
|
+
type Props = TextProps & {
|
|
4
|
+
type: CaptionType;
|
|
5
|
+
};
|
|
6
|
+
export declare const Caption: ({ type, style, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Caption = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("../../constants");
|
|
9
|
+
var _utils = require("../..//utils");
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
|
+
const Caption = ({
|
|
12
|
+
type,
|
|
13
|
+
style,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({
|
|
17
|
+
style: [styles[type], style]
|
|
18
|
+
}, rest));
|
|
19
|
+
};
|
|
20
|
+
exports.Caption = Caption;
|
|
21
|
+
const styles = _reactNative.StyleSheet.create({
|
|
22
|
+
s: {
|
|
23
|
+
fontSize: _constants.sizes.xxs,
|
|
24
|
+
fontWeight: _constants.weights.bold,
|
|
25
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xxs, 110)
|
|
26
|
+
},
|
|
27
|
+
m: {
|
|
28
|
+
fontSize: _constants.sizes.xs,
|
|
29
|
+
fontWeight: _constants.weights.bold,
|
|
30
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xs, 110)
|
|
31
|
+
},
|
|
32
|
+
"s-light": {
|
|
33
|
+
fontSize: _constants.sizes.xxs,
|
|
34
|
+
fontWeight: _constants.weights.light,
|
|
35
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xxs, 110)
|
|
36
|
+
},
|
|
37
|
+
"m-light": {
|
|
38
|
+
fontSize: _constants.sizes.xs,
|
|
39
|
+
fontWeight: _constants.weights.light,
|
|
40
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xs, 110)
|
|
41
|
+
}
|
|
42
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextProps } from 'react-native';
|
|
2
|
+
type HeadingType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
|
|
3
|
+
type Props = TextProps & {
|
|
4
|
+
type: HeadingType;
|
|
5
|
+
};
|
|
6
|
+
export declare const Heading: ({ type, style, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Heading = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("../../constants");
|
|
9
|
+
var _utils = require("../../utils");
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
|
+
const Heading = ({
|
|
12
|
+
type,
|
|
13
|
+
style,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({
|
|
17
|
+
style: [styles[type], style]
|
|
18
|
+
}, rest));
|
|
19
|
+
};
|
|
20
|
+
exports.Heading = Heading;
|
|
21
|
+
const styles = _reactNative.StyleSheet.create({
|
|
22
|
+
h1: {
|
|
23
|
+
fontSize: _constants.sizes.xxxxl,
|
|
24
|
+
fontWeight: _constants.weights.bold,
|
|
25
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xxxxl, 110)
|
|
26
|
+
},
|
|
27
|
+
h2: {
|
|
28
|
+
fontSize: _constants.sizes.xxxl,
|
|
29
|
+
fontWeight: _constants.weights.bold,
|
|
30
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xxxl, 110)
|
|
31
|
+
},
|
|
32
|
+
h3: {
|
|
33
|
+
fontSize: _constants.sizes.xxl,
|
|
34
|
+
fontWeight: _constants.weights.bold,
|
|
35
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xxl, 110)
|
|
36
|
+
},
|
|
37
|
+
h4: {
|
|
38
|
+
fontSize: _constants.sizes.xl,
|
|
39
|
+
fontWeight: _constants.weights.bold,
|
|
40
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xl, 110)
|
|
41
|
+
},
|
|
42
|
+
h5: {
|
|
43
|
+
fontSize: _constants.sizes.l,
|
|
44
|
+
fontWeight: _constants.weights.bold,
|
|
45
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.l, 110)
|
|
46
|
+
}
|
|
47
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Label = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("../../constants");
|
|
9
|
+
var _utils = require("../../utils");
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
|
+
const Label = ({
|
|
12
|
+
type,
|
|
13
|
+
style,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, _extends({
|
|
17
|
+
style: [styles[type], style]
|
|
18
|
+
}, rest));
|
|
19
|
+
};
|
|
20
|
+
exports.Label = Label;
|
|
21
|
+
const styles = _reactNative.StyleSheet.create({
|
|
22
|
+
s: {
|
|
23
|
+
fontSize: _constants.sizes.xs,
|
|
24
|
+
fontWeight: _constants.weights.bold,
|
|
25
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.xs, 110)
|
|
26
|
+
},
|
|
27
|
+
m: {
|
|
28
|
+
fontSize: _constants.sizes.s,
|
|
29
|
+
fontWeight: _constants.weights.bold,
|
|
30
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.s, 110)
|
|
31
|
+
},
|
|
32
|
+
l: {
|
|
33
|
+
fontSize: _constants.sizes.m,
|
|
34
|
+
fontWeight: _constants.weights.bold,
|
|
35
|
+
lineHeight: (0, _utils.getLineHeight)(_constants.sizes.m, 110)
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Heading = require("./Heading");
|
|
7
|
+
Object.keys(_Heading).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Heading[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Heading[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _Body = require("./Body");
|
|
18
|
+
Object.keys(_Body).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _Body[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _Body[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _Caption = require("./Caption");
|
|
29
|
+
Object.keys(_Caption).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _Caption[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _Caption[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _Label = require("./Label");
|
|
40
|
+
Object.keys(_Label).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _Label[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _Label[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Text = require("./Text");
|
|
7
|
+
Object.keys(_Text).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Text[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Text[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _Buttons = require("./Buttons");
|
|
18
|
+
Object.keys(_Buttons).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _Buttons[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _Buttons[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getLineHeight: (fontSize: number, percentage: number) => number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getLineHeight = void 0;
|
|
7
|
+
const getLineHeight = (fontSize, percentage) => {
|
|
8
|
+
return Math.round(fontSize * (percentage / 100));
|
|
9
|
+
};
|
|
10
|
+
exports.getLineHeight = getLineHeight;
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -3,7 +3,22 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
isTablet: true
|
|
8
|
+
};
|
|
6
9
|
exports.isTablet = void 0;
|
|
7
10
|
var _reactNative = require("react-native");
|
|
11
|
+
var _TextUtils = require("./TextUtils");
|
|
12
|
+
Object.keys(_TextUtils).forEach(function (key) {
|
|
13
|
+
if (key === "default" || key === "__esModule") return;
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
+
if (key in exports && exports[key] === _TextUtils[key]) return;
|
|
16
|
+
Object.defineProperty(exports, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _TextUtils[key];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
8
23
|
const windowWidth = _reactNative.Dimensions.get("window").width;
|
|
9
24
|
const isTablet = exports.isTablet = windowWidth >= 768;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dropi/react-native-design-system",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A React Native package built from scratch",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"react": ">=19.0.0",
|
|
23
|
-
"react-native": ">=0.79.5"
|
|
23
|
+
"react-native": ">=0.79.5",
|
|
24
|
+
"dropi-lib-icons": ">=1.2.5"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"@babel/cli": "^7.28.3",
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
"@types/react": "^19.2.3",
|
|
32
33
|
"react": "^19.2.0",
|
|
33
34
|
"react-native": "^0.82.1",
|
|
34
|
-
"typescript": "^5.6.0"
|
|
35
|
+
"typescript": "^5.6.0",
|
|
36
|
+
"dropi-lib-icons": "^1.2.5"
|
|
35
37
|
}
|
|
36
38
|
}
|