@meatech/payblend_app_ui_component 1.0.81 → 1.0.82
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/components/IconWithLabel/IconWithLabel.tsx +14 -13
- package/components/IconWithLabel/type.ts +1 -0
- package/dist/components/IconWithLabel/IconWithLabel.d.ts.map +1 -1
- package/dist/components/IconWithLabel/IconWithLabel.js +7 -7
- package/dist/components/IconWithLabel/IconWithLabel.js.map +1 -1
- package/dist/components/IconWithLabel/type.d.ts +1 -0
- package/dist/components/IconWithLabel/type.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { StyleSheet, TouchableOpacity } from
|
|
3
|
-
import { IconWithLabelProps } from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet, TouchableOpacity } from "react-native";
|
|
3
|
+
import { IconWithLabelProps } from "./type";
|
|
4
4
|
import {
|
|
5
5
|
ACTIVE_OPACITY,
|
|
6
6
|
colors,
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
metrics,
|
|
9
9
|
pf,
|
|
10
10
|
pw,
|
|
11
|
-
} from
|
|
12
|
-
import { Icon } from
|
|
13
|
-
import { formatNumber } from
|
|
14
|
-
import Text from
|
|
11
|
+
} from "@ui/themes";
|
|
12
|
+
import { Icon } from "@ui/components";
|
|
13
|
+
import { formatNumber } from "@ui/utils";
|
|
14
|
+
import Text from "@ui/components/Text";
|
|
15
15
|
|
|
16
16
|
export const SIZE_ICON_WITH_LABEL_DEFAULT = (deviceWidth() - 52) / 3;
|
|
17
17
|
|
|
@@ -21,6 +21,7 @@ export const IconWithLabel: React.FC<IconWithLabelProps> = ({
|
|
|
21
21
|
balance = 0,
|
|
22
22
|
width = SIZE_ICON_WITH_LABEL_DEFAULT,
|
|
23
23
|
height = SIZE_ICON_WITH_LABEL_DEFAULT,
|
|
24
|
+
isFlex = false,
|
|
24
25
|
disabled,
|
|
25
26
|
style,
|
|
26
27
|
labelStyle,
|
|
@@ -33,7 +34,7 @@ export const IconWithLabel: React.FC<IconWithLabelProps> = ({
|
|
|
33
34
|
style={[
|
|
34
35
|
styles.container,
|
|
35
36
|
style,
|
|
36
|
-
{ width: pw(width), height: pw(height) },
|
|
37
|
+
isFlex ? { flex: 1 } : { width: pw(width), height: pw(height) },
|
|
37
38
|
disabled && styles.disabled,
|
|
38
39
|
]}
|
|
39
40
|
activeOpacity={ACTIVE_OPACITY}
|
|
@@ -43,7 +44,7 @@ export const IconWithLabel: React.FC<IconWithLabelProps> = ({
|
|
|
43
44
|
name={icon}
|
|
44
45
|
width={metrics.iconSemiLarge}
|
|
45
46
|
height={metrics.iconSemiLarge}
|
|
46
|
-
tintColor={colors.neutral[
|
|
47
|
+
tintColor={colors.neutral["60"]}
|
|
47
48
|
/>
|
|
48
49
|
<Text
|
|
49
50
|
size="xs"
|
|
@@ -70,14 +71,14 @@ export const IconWithLabel: React.FC<IconWithLabelProps> = ({
|
|
|
70
71
|
const styles = StyleSheet.create({
|
|
71
72
|
container: {
|
|
72
73
|
borderWidth: metrics.borderWidthMedium,
|
|
73
|
-
borderColor: colors.neutral[
|
|
74
|
-
alignItems:
|
|
75
|
-
justifyContent:
|
|
74
|
+
borderColor: colors.neutral["20"],
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
justifyContent: "center",
|
|
76
77
|
padding: metrics.width.spacingTiny,
|
|
77
78
|
},
|
|
78
79
|
label: {
|
|
79
80
|
lineHeight: pf(18),
|
|
80
|
-
textAlign:
|
|
81
|
+
textAlign: "center",
|
|
81
82
|
},
|
|
82
83
|
txtBalance: {
|
|
83
84
|
lineHeight: pf(30),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWithLabel.d.ts","sourceRoot":"","sources":["../../../components/IconWithLabel/IconWithLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAa5C,eAAO,MAAM,4BAA4B,QAA2B,CAAC;AAErE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"IconWithLabel.d.ts","sourceRoot":"","sources":["../../../components/IconWithLabel/IconWithLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAa5C,eAAO,MAAM,4BAA4B,QAA2B,CAAC;AAErE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmDtD,CAAC"}
|
|
@@ -34,14 +34,14 @@ import '../../utils/dayjs.js';
|
|
|
34
34
|
import { formatNumber } from '../../utils/utils.js';
|
|
35
35
|
|
|
36
36
|
const SIZE_ICON_WITH_LABEL_DEFAULT = (deviceWidth() - 52) / 3;
|
|
37
|
-
const IconWithLabel = ({ label, icon, balance = 0, width = SIZE_ICON_WITH_LABEL_DEFAULT, height = SIZE_ICON_WITH_LABEL_DEFAULT, disabled, style, labelStyle, isShowBalance = false, ...rest }) => {
|
|
37
|
+
const IconWithLabel = ({ label, icon, balance = 0, width = SIZE_ICON_WITH_LABEL_DEFAULT, height = SIZE_ICON_WITH_LABEL_DEFAULT, isFlex = false, disabled, style, labelStyle, isShowBalance = false, ...rest }) => {
|
|
38
38
|
return (React.createElement(TouchableOpacity, { disabled: disabled, style: [
|
|
39
39
|
styles.container,
|
|
40
40
|
style,
|
|
41
|
-
{ width: responsiveWidth(width), height: responsiveWidth(height) },
|
|
41
|
+
isFlex ? { flex: 1 } : { width: responsiveWidth(width), height: responsiveWidth(height) },
|
|
42
42
|
disabled && styles.disabled,
|
|
43
43
|
], activeOpacity: ACTIVE_OPACITY, ...rest },
|
|
44
|
-
React.createElement(Icon, { name: icon, width: metrics.iconSemiLarge, height: metrics.iconSemiLarge, tintColor: colors.neutral[
|
|
44
|
+
React.createElement(Icon, { name: icon, width: metrics.iconSemiLarge, height: metrics.iconSemiLarge, tintColor: colors.neutral["60"] }),
|
|
45
45
|
React.createElement(Text, { size: "xs", color: "tertiary", style: [styles.label, labelStyle], numberOfLines: 2 }, label),
|
|
46
46
|
isShowBalance && (React.createElement(Text, { fontWeight: "700", size: "large", color: "tertiary", style: styles.txtBalance },
|
|
47
47
|
"\u00A5",
|
|
@@ -50,14 +50,14 @@ const IconWithLabel = ({ label, icon, balance = 0, width = SIZE_ICON_WITH_LABEL_
|
|
|
50
50
|
const styles = StyleSheet.create({
|
|
51
51
|
container: {
|
|
52
52
|
borderWidth: metrics.borderWidthMedium,
|
|
53
|
-
borderColor: colors.neutral[
|
|
54
|
-
alignItems:
|
|
55
|
-
justifyContent:
|
|
53
|
+
borderColor: colors.neutral["20"],
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
justifyContent: "center",
|
|
56
56
|
padding: metrics.width.spacingTiny,
|
|
57
57
|
},
|
|
58
58
|
label: {
|
|
59
59
|
lineHeight: responsiveFont(18),
|
|
60
|
-
textAlign:
|
|
60
|
+
textAlign: "center",
|
|
61
61
|
},
|
|
62
62
|
txtBalance: {
|
|
63
63
|
lineHeight: responsiveFont(30),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWithLabel.js","sources":["../../../../components/IconWithLabel/IconWithLabel.tsx"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"file":"IconWithLabel.js","sources":["../../../../components/IconWithLabel/IconWithLabel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { StyleSheet, TouchableOpacity } from \"react-native\";\nimport { IconWithLabelProps } from \"./type\";\nimport {\n ACTIVE_OPACITY,\n colors,\n deviceWidth,\n metrics,\n pf,\n pw,\n} from \"@ui/themes\";\nimport { Icon } from \"@ui/components\";\nimport { formatNumber } from \"@ui/utils\";\nimport Text from \"@ui/components/Text\";\n\nexport const SIZE_ICON_WITH_LABEL_DEFAULT = (deviceWidth() - 52) / 3;\n\nexport const IconWithLabel: React.FC<IconWithLabelProps> = ({\n label,\n icon,\n balance = 0,\n width = SIZE_ICON_WITH_LABEL_DEFAULT,\n height = SIZE_ICON_WITH_LABEL_DEFAULT,\n isFlex = false,\n disabled,\n style,\n labelStyle,\n isShowBalance = false,\n ...rest\n}) => {\n return (\n <TouchableOpacity\n disabled={disabled}\n style={[\n styles.container,\n style,\n isFlex ? { flex: 1 } : { width: pw(width), height: pw(height) },\n disabled && styles.disabled,\n ]}\n activeOpacity={ACTIVE_OPACITY}\n {...rest}\n >\n <Icon\n name={icon}\n width={metrics.iconSemiLarge}\n height={metrics.iconSemiLarge}\n tintColor={colors.neutral[\"60\"]}\n />\n <Text\n size=\"xs\"\n color=\"tertiary\"\n style={[styles.label, labelStyle]}\n numberOfLines={2}\n >\n {label}\n </Text>\n {isShowBalance && (\n <Text\n fontWeight=\"700\"\n size=\"large\"\n color=\"tertiary\"\n style={styles.txtBalance}\n >\n ¥{formatNumber(balance.toString())}\n </Text>\n )}\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n borderWidth: metrics.borderWidthMedium,\n borderColor: colors.neutral[\"20\"],\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: metrics.width.spacingTiny,\n },\n label: {\n lineHeight: pf(18),\n textAlign: \"center\",\n },\n txtBalance: {\n lineHeight: pf(30),\n marginTop: metrics.width.spacingTiny,\n },\n disabled: {\n opacity: 0.4,\n },\n});\n"],"names":["pw","pf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,4BAA4B,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI;AAEtD,MAAA,aAAa,GAAiC,CAAC,EAC1D,KAAK,EACL,IAAI,EACJ,OAAO,GAAG,CAAC,EACX,KAAK,GAAG,4BAA4B,EACpC,MAAM,GAAG,4BAA4B,EACrC,MAAM,GAAG,KAAK,EACd,QA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,IAAI,CAAC;AACjC,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,cAAc,EAAE,QAAQ;AACxB,QAAA,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,WAAW;AACnC,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,UAAU,EAAEC,cAAE,CAAC,EAAE,CAAC;AAClB,QAAA,SAAS,EAAE,QAAQ;AACpB,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,UAAU,EAAEA,cAAE,CAAC,EAAE,CAAC;AAClB,QAAA,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,WAAW;AACrC,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE,GAAG;AACb,KAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../components/IconWithLabel/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,MAAM,WAAW,kBACf,SAAQ,IAAI,CACV,qBAAqB,EACrB,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CAC9C;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,OAAO,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../components/IconWithLabel/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,MAAM,WAAW,kBACf,SAAQ,IAAI,CACV,qBAAqB,EACrB,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CAC9C;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,OAAO,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
|