@xhsreds/reds-rn-next 0.11.1-beta202601161832 → 0.11.1-beta202601191704
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/coverage/.tmp/coverage-0.json +1 -1
- package/coverage/.tmp/coverage-1.json +1 -1
- package/coverage/.tmp/coverage-11.json +1 -1
- package/coverage/.tmp/coverage-12.json +1 -1
- package/coverage/.tmp/coverage-13.json +1 -1
- package/coverage/.tmp/coverage-14.json +1 -1
- package/coverage/.tmp/coverage-15.json +1 -1
- package/coverage/.tmp/coverage-16.json +1 -1
- package/coverage/.tmp/coverage-17.json +1 -1
- package/coverage/.tmp/coverage-18.json +1 -1
- package/coverage/.tmp/coverage-19.json +1 -1
- package/coverage/.tmp/coverage-2.json +1 -1
- package/coverage/.tmp/coverage-20.json +1 -1
- package/coverage/.tmp/coverage-25.json +1 -1
- package/coverage/.tmp/coverage-26.json +1 -1
- package/coverage/.tmp/coverage-27.json +1 -1
- package/coverage/.tmp/coverage-3.json +1 -1
- package/coverage/.tmp/coverage-30.json +1 -1
- package/coverage/.tmp/coverage-31.json +1 -1
- package/coverage/.tmp/coverage-32.json +1 -1
- package/coverage/.tmp/coverage-33.json +1 -1
- package/coverage/.tmp/coverage-34.json +1 -1
- package/coverage/.tmp/coverage-35.json +1 -1
- package/coverage/.tmp/coverage-36.json +1 -1
- package/coverage/.tmp/coverage-37.json +1 -1
- package/coverage/.tmp/coverage-38.json +1 -1
- package/coverage/.tmp/coverage-39.json +1 -1
- package/coverage/.tmp/coverage-40.json +1 -1
- package/coverage/.tmp/coverage-41.json +1 -1
- package/coverage/.tmp/coverage-42.json +1 -1
- package/coverage/.tmp/coverage-43.json +1 -1
- package/coverage/.tmp/coverage-5.json +1 -1
- package/coverage/.tmp/coverage-7.json +1 -1
- package/coverage/.tmp/coverage-9.json +1 -1
- package/lib/cjs/_chunks/{B6BxX_sn.js → D9vEt_Qk.js} +3 -2
- package/lib/cjs/_chunks/D9vEt_Qk.js.map +1 -0
- package/lib/cjs/components/Alert/Alert.js +7 -7
- package/lib/cjs/components/Alert/Alert.js.map +1 -1
- package/lib/cjs/components/Alert/hooks/alert.js +1 -1
- package/lib/cjs/components/Alert/index.js +1 -1
- package/lib/cjs/components/Alert/interface/index.js +1 -1
- package/lib/cjs/components/Alert/styles.js +13 -55
- package/lib/cjs/components/Alert/styles.js.map +1 -1
- package/lib/cjs/components/Radio/Radio.js +1 -1
- package/lib/cjs/components/Radio/index.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/esm/_chunks/{BP2FxtYY.js → CNx6YBDL.js} +3 -2
- package/lib/esm/_chunks/CNx6YBDL.js.map +1 -0
- package/lib/esm/components/Alert/Alert.js +7 -7
- package/lib/esm/components/Alert/Alert.js.map +1 -1
- package/lib/esm/components/Alert/hooks/alert.js +1 -1
- package/lib/esm/components/Alert/index.js +1 -1
- package/lib/esm/components/Alert/interface/index.js +1 -1
- package/lib/esm/components/Alert/styles.js +13 -55
- package/lib/esm/components/Alert/styles.js.map +1 -1
- package/lib/esm/components/Radio/Radio.js +1 -1
- package/lib/esm/components/Radio/index.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/src/components/Alert/interface/index.d.ts +2 -0
- package/lib/src/components/Alert/styles.d.ts +11 -43
- package/lib/types/components/Alert/interface/index.d.ts +2 -0
- package/lib/types/components/Alert/styles.d.ts +11 -43
- package/package.json +2 -2
- package/src/components/Alert/Alert.tsx +7 -78
- package/src/components/Alert/doc/index.mdx +1 -0
- package/src/components/Alert/interface/index.ts +2 -0
- package/src/components/Alert/styles.ts +12 -49
- package/src/i18n/@types/resources.d.ts +18 -18
- package/src/i18n/index.json +31 -31
- package/lib/cjs/_chunks/B6BxX_sn.js.map +0 -1
- package/lib/esm/_chunks/BP2FxtYY.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as _objectSpread2 } from '../../_chunks/BcGvf0Pc.js';
|
|
2
1
|
import { StyleSheet } from 'react-native';
|
|
3
2
|
import { alwaysColor } from '@xhsreds/reds-token-next';
|
|
4
3
|
import '../ConfigProvider/hooks/ConfigCache/ConfigCache.js';
|
|
5
4
|
import 'react';
|
|
6
5
|
import '@xhs/reds-apm/src/index.native';
|
|
7
6
|
import { useThemeColor, useThemeTypography } from '../ConfigProvider/hooks/themeToken/useThemeToken.js';
|
|
7
|
+
import '../../_chunks/BcGvf0Pc.js';
|
|
8
8
|
import '../ConfigProvider/hooks/ConfigContext/ConfigContext.js';
|
|
9
9
|
|
|
10
10
|
var style = function style(props) {
|
|
@@ -67,81 +67,39 @@ var style = function style(props) {
|
|
|
67
67
|
},
|
|
68
68
|
footer: {
|
|
69
69
|
width: "100%",
|
|
70
|
-
// height: 48,
|
|
71
70
|
flexDirection: "row",
|
|
72
71
|
justifyContent: "space-between",
|
|
73
72
|
paddingTop: 0
|
|
74
73
|
},
|
|
75
|
-
footerText: {
|
|
76
|
-
borderTopWidth: 0.5,
|
|
77
|
-
borderTopColor: themeColor.Fill2,
|
|
78
|
-
paddingBottom: props.footerLayout === "vertical" ? 0 : 6,
|
|
79
|
-
paddingTop: props.footerLayout === "vertical" ? 0 : 6,
|
|
80
|
-
paddingHorizontal: props.footerLayout === "vertical" ? 0 : 12
|
|
81
|
-
},
|
|
82
74
|
footerHorizontal: {
|
|
83
75
|
flexDirection: "row",
|
|
76
|
+
paddingBottom: props.footerType === "text" ? 0 : 20,
|
|
84
77
|
paddingHorizontal: 20,
|
|
85
|
-
|
|
78
|
+
gap: 12
|
|
86
79
|
},
|
|
87
80
|
footerVertical: {
|
|
88
81
|
flexDirection: "column-reverse",
|
|
89
82
|
alignItems: "center",
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
cancelButton: {
|
|
94
|
-
flex: 1,
|
|
95
|
-
width: 109,
|
|
96
|
-
margin: 0,
|
|
97
|
-
paddingHorizontal: 0
|
|
98
|
-
// height: 36,
|
|
99
|
-
},
|
|
100
|
-
button: {
|
|
101
|
-
flex: 1,
|
|
102
|
-
width: 109,
|
|
103
|
-
margin: 0,
|
|
104
|
-
paddingHorizontal: 0
|
|
105
|
-
// height: 36,
|
|
83
|
+
paddingHorizontal: 20,
|
|
84
|
+
height: props.showCancelButton && props.showConfirmButton ? props.cancelBtnProps.variant === "text" ? 82 : 100 : 56
|
|
106
85
|
},
|
|
107
86
|
dividerBox: {
|
|
108
87
|
marginTop: 5
|
|
109
88
|
},
|
|
89
|
+
cancelButton: {
|
|
90
|
+
flex: 1,
|
|
91
|
+
height: props.cancelBtnProps.variant === "text" ? 34 : props.footerType === "text" ? 52 : 36,
|
|
92
|
+
alignItems: props.cancelBtnProps.variant === "text" ? "flex-start" : "center",
|
|
93
|
+
paddingTop: props.cancelBtnProps.variant === "text" ? 12 : 0
|
|
94
|
+
},
|
|
110
95
|
confirmButton: {
|
|
111
96
|
flex: 1,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
width: 109,
|
|
115
|
-
// height: 36,
|
|
116
|
-
paddingHorizontal: 20
|
|
97
|
+
width: "100%",
|
|
98
|
+
height: props.footerType === "text" ? 52 : 36
|
|
117
99
|
},
|
|
118
100
|
confirmButtonText: {
|
|
119
101
|
fontSize: props.footerType === "text" ? typography.T2FontSize : typography.T3FontSize
|
|
120
102
|
},
|
|
121
|
-
verButton: {
|
|
122
|
-
flex: 0,
|
|
123
|
-
width: "100%",
|
|
124
|
-
margin: 0,
|
|
125
|
-
marginLeft: props.footerLayout === "vertical" ? 0 : 10,
|
|
126
|
-
marginTop: props.footerType === "text" ? 7 : props.footerLayout === "vertical" ? 7 : 10,
|
|
127
|
-
marginBottom: props.footerLayout === "vertical" ? 7 : 0,
|
|
128
|
-
// height: 36,
|
|
129
|
-
paddingHorizontal: 20
|
|
130
|
-
},
|
|
131
|
-
verCancelButton: _objectSpread2(_objectSpread2({
|
|
132
|
-
flex: 0,
|
|
133
|
-
width: "100%",
|
|
134
|
-
margin: 0,
|
|
135
|
-
marginLeft: props.footerLayout === "vertical" ? 0 : 10,
|
|
136
|
-
marginTop: props.footerType === "text" ? 7 : props.footerLayout === "vertical" ? 7 : 10,
|
|
137
|
-
marginBottom: props.footerLayout === "vertical" ? 7 : 0
|
|
138
|
-
}, props.cancelBtnProps.variant === "text" ? {
|
|
139
|
-
height: 20,
|
|
140
|
-
marginTop: 0,
|
|
141
|
-
marginBottom: 14
|
|
142
|
-
} : {}), {}, {
|
|
143
|
-
paddingHorizontal: 20
|
|
144
|
-
}),
|
|
145
103
|
cancelText: {
|
|
146
104
|
color: themeColor.Description,
|
|
147
105
|
fontSize: props.cancelBtnProps.variant === "text" ? 12 : props.footerType === "text" ? typography.T2FontSize : typography.T3FontSize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Alert/styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport { alwaysColor } from \"@xhsreds/reds-token-next\";\nimport { useThemeColor, useThemeTypography } from \"../ConfigProvider\";\nimport { RedsAlert } from \"./interface\";\n\nexport const style = (props: RedsAlert) => {\n const themeColor = useThemeColor(\"Button\");\n const typography = useThemeTypography(\"Button\");\n\n const styles = StyleSheet.create({\n modalOverlay: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: alwaysColor.MaskBg,\n },\n centeredView: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n alertContainer: {\n width: 270,\n backgroundColor: themeColor.White,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow: \"0 2px 16px rgba(0, 0, 0, 0.1)\",\n position: \"relative\",\n top: 0,\n left: 0,\n },\n alertContent: {\n padding: 20,\n },\n title: {\n textAlign: \"center\",\n marginBottom: 8,\n fontSize: typography.T2FontSize,\n fontWeight: typography.T2FontWeight,\n lineHeight: typography.T2LineHeight,\n color: themeColor.Title,\n },\n message: {\n maxHeight: 126,\n overflow: \"hidden\",\n position: \"relative\",\n },\n messageText: {\n fontSize: typography.C2FontSize,\n color: themeColor.Paragraph,\n textAlign: \"center\",\n lineHeight: typography.C2LineHeight,\n fontWeight: typography.C2FontWeight,\n },\n messageLeft: {\n textAlign: \"left\",\n },\n footer: {\n width: \"100%\",\n // height: 48,\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: 0,\n },\n footerText: {\n borderTopWidth: 0.5,\n borderTopColor: themeColor.Fill2,\n paddingBottom: props.footerLayout === \"vertical\" ? 0 : 6,\n paddingTop: props.footerLayout === \"vertical\" ? 0 : 6,\n paddingHorizontal: props.footerLayout === \"vertical\" ? 0 : 12,\n },\n footerHorizontal: {\n flexDirection: \"row\",\n paddingHorizontal: 20,\n paddingVertical: 20,\n },\n footerVertical: {\n flexDirection: \"column-reverse\",\n alignItems: \"center\",\n // height: 100,\n paddingHorizontal: 20,\n },\n cancelButton: {\n flex: 1,\n width: 109,\n margin: 0,\n paddingHorizontal: 0,\n // height: 36,\n },\n button: {\n flex: 1,\n width: 109,\n margin: 0,\n paddingHorizontal: 0,\n // height: 36,\n },\n dividerBox: {\n marginTop: 5,\n },\n confirmButton: {\n flex: 1,\n margin: 0,\n marginLeft: props.footerLayout === \"horizontal\" && !props.showCancelButton ? 0 : 10,\n width: 109,\n // height: 36,\n paddingHorizontal: 20,\n },\n confirmButtonText: {\n fontSize: props.footerType === \"text\" ? typography.T2FontSize : typography.T3FontSize,\n },\n verButton: {\n flex: 0,\n width: \"100%\",\n margin: 0,\n marginLeft: props.footerLayout === \"vertical\" ? 0 : 10,\n marginTop: props.footerType === \"text\" ? 7 : props.footerLayout === \"vertical\" ? 7 : 10,\n marginBottom: props.footerLayout === \"vertical\" ? 7 : 0,\n // height: 36,\n paddingHorizontal: 20,\n },\n verCancelButton: {\n flex: 0,\n width: \"100%\",\n margin: 0,\n marginLeft: props.footerLayout === \"vertical\" ? 0 : 10,\n marginTop: props.footerType === \"text\" ? 7 : props.footerLayout === \"vertical\" ? 7 : 10,\n marginBottom: props.footerLayout === \"vertical\" ? 7 : 0,\n ...(props.cancelBtnProps.variant === \"text\" ? { height: 20, marginTop: 0, marginBottom: 14 } : {}),\n paddingHorizontal: 20,\n },\n cancelText: {\n color: themeColor.Description,\n fontSize:\n props.cancelBtnProps.variant === \"text\"\n ? 12\n : props.footerType === \"text\"\n ? typography.T2FontSize\n : typography.T3FontSize,\n fontWeight: typography.C2FontWeight,\n },\n horizontalLine: {\n width: \"100%\",\n height: 0.5,\n backgroundColor: themeColor.Fill2,\n },\n verticalLine: {\n width: 0.5,\n height: 24,\n marginTop: 6,\n backgroundColor: themeColor.Fill2,\n },\n });\n return styles;\n};\n"],"names":["style","props","themeColor","useThemeColor","typography","useThemeTypography","styles","StyleSheet","create","modalOverlay","position","top","left","right","bottom","backgroundColor","alwaysColor","MaskBg","centeredView","flex","justifyContent","alignItems","alertContainer","width","White","borderRadius","overflow","boxShadow","alertContent","padding","title","textAlign","marginBottom","fontSize","T2FontSize","fontWeight","T2FontWeight","lineHeight","T2LineHeight","color","Title","message","maxHeight","messageText","C2FontSize","Paragraph","C2LineHeight","C2FontWeight","messageLeft","footer","flexDirection","paddingTop","footerText","borderTopWidth","borderTopColor","Fill2","paddingBottom","footerLayout","paddingHorizontal","footerHorizontal","paddingVertical","footerVertical","cancelButton","margin","button","dividerBox","marginTop","confirmButton","marginLeft","showCancelButton","confirmButtonText","footerType","T3FontSize","verButton","verCancelButton","_objectSpread","cancelBtnProps","variant","height","cancelText","Description","horizontalLine","verticalLine"],"mappings":";;;;;;;;;IAKaA,KAAA,GAAQ,SAARA,KAAAA,CAASC,KAAqB,EAAA;AACnC,EAAA,IAAAC,UAAA,GAAaC,cAAc,QAAQ,CAAA,CAAA;AACnC,EAAA,IAAAC,UAAA,GAAaC,mBAAmB,QAAQ,CAAA,CAAA;AAExC,EAAA,IAAAC,MAAA,GAASC,WAAWC,MAAO,CAAA;AAC/BC,IAAAA,YAAc,EAAA;AACZC,MAAAA,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.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport { alwaysColor } from \"@xhsreds/reds-token-next\";\nimport { useThemeColor, useThemeTypography } from \"../ConfigProvider\";\nimport { RedsAlert } from \"./interface\";\n\nexport const style = (props: RedsAlert) => {\n const themeColor = useThemeColor(\"Button\");\n const typography = useThemeTypography(\"Button\");\n\n const styles = StyleSheet.create({\n modalOverlay: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: alwaysColor.MaskBg,\n },\n centeredView: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n alertContainer: {\n width: 270,\n backgroundColor: themeColor.White,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow: \"0 2px 16px rgba(0, 0, 0, 0.1)\",\n position: \"relative\",\n top: 0,\n left: 0,\n },\n alertContent: {\n padding: 20,\n },\n title: {\n textAlign: \"center\",\n marginBottom: 8,\n fontSize: typography.T2FontSize,\n fontWeight: typography.T2FontWeight,\n lineHeight: typography.T2LineHeight,\n color: themeColor.Title,\n },\n message: {\n maxHeight: 126,\n overflow: \"hidden\",\n position: \"relative\",\n },\n messageText: {\n fontSize: typography.C2FontSize,\n color: themeColor.Paragraph,\n textAlign: \"center\",\n lineHeight: typography.C2LineHeight,\n fontWeight: typography.C2FontWeight,\n },\n messageLeft: {\n textAlign: \"left\",\n },\n footer: {\n width: \"100%\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: 0,\n },\n footerHorizontal: {\n flexDirection: \"row\",\n paddingBottom: props.footerType === \"text\" ? 0 : 20,\n paddingHorizontal: 20,\n gap: 12,\n },\n footerVertical: {\n flexDirection: \"column-reverse\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n height:\n props.showCancelButton && props.showConfirmButton ? (props.cancelBtnProps.variant === \"text\" ? 82 : 100) : 56,\n },\n dividerBox: {\n marginTop: 5,\n },\n cancelButton: {\n flex: 1,\n height: props.cancelBtnProps.variant === \"text\" ? 34 : props.footerType === \"text\" ? 52 : 36,\n alignItems: props.cancelBtnProps.variant === \"text\" ? \"flex-start\" : \"center\",\n paddingTop: props.cancelBtnProps.variant === \"text\" ? 12 : 0,\n },\n confirmButton: {\n flex: 1,\n width: \"100%\",\n height: props.footerType === \"text\" ? 52 : 36,\n },\n confirmButtonText: {\n fontSize: props.footerType === \"text\" ? typography.T2FontSize : typography.T3FontSize,\n },\n cancelText: {\n color: themeColor.Description,\n fontSize:\n props.cancelBtnProps.variant === \"text\"\n ? 12\n : props.footerType === \"text\"\n ? typography.T2FontSize\n : typography.T3FontSize,\n fontWeight: typography.C2FontWeight,\n },\n horizontalLine: {\n width: \"100%\",\n height: 0.5,\n backgroundColor: themeColor.Fill2,\n },\n verticalLine: {\n width: 0.5,\n height: 24,\n marginTop: 6,\n backgroundColor: themeColor.Fill2,\n },\n });\n return styles;\n};\n"],"names":["style","props","themeColor","useThemeColor","typography","useThemeTypography","styles","StyleSheet","create","modalOverlay","position","top","left","right","bottom","backgroundColor","alwaysColor","MaskBg","centeredView","flex","justifyContent","alignItems","alertContainer","width","White","borderRadius","overflow","boxShadow","alertContent","padding","title","textAlign","marginBottom","fontSize","T2FontSize","fontWeight","T2FontWeight","lineHeight","T2LineHeight","color","Title","message","maxHeight","messageText","C2FontSize","Paragraph","C2LineHeight","C2FontWeight","messageLeft","footer","flexDirection","paddingTop","footerHorizontal","paddingBottom","footerType","paddingHorizontal","gap","footerVertical","height","showCancelButton","showConfirmButton","cancelBtnProps","variant","dividerBox","marginTop","cancelButton","confirmButton","confirmButtonText","T3FontSize","cancelText","Description","horizontalLine","Fill2","verticalLine"],"mappings":";;;;;;;;;IAKaA,KAAA,GAAQ,SAARA,KAAAA,CAASC,KAAqB,EAAA;AACnC,EAAA,IAAAC,UAAA,GAAaC,cAAc,QAAQ,CAAA,CAAA;AACnC,EAAA,IAAAC,UAAA,GAAaC,mBAAmB,QAAQ,C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
|
67
67
|
import '../../_chunks/3fnqPSWW.js';
|
|
68
68
|
import '../Picker/api.js';
|
|
69
69
|
import '../Alert/Alert.js';
|
|
70
|
-
import '../../_chunks/
|
|
70
|
+
import '../../_chunks/CNx6YBDL.js';
|
|
71
71
|
import '../Alert/hooks/alert.js';
|
|
72
72
|
import '../FAB/FAB.js';
|
|
73
73
|
import '../../_chunks/D22mAc_y.js';
|
|
@@ -129,7 +129,7 @@ import '../Sheets/api.js';
|
|
|
129
129
|
import '../../_chunks/DcCfwG0m.js';
|
|
130
130
|
import '../Picker/api.js';
|
|
131
131
|
import '../Alert/Alert.js';
|
|
132
|
-
import '../../_chunks/
|
|
132
|
+
import '../../_chunks/CNx6YBDL.js';
|
|
133
133
|
import '../Alert/styles.js';
|
|
134
134
|
import '../Alert/hooks/alert.js';
|
|
135
135
|
import '../FAB/FAB.js';
|
package/lib/esm/index.js
CHANGED
|
@@ -61,7 +61,7 @@ export { default as Picker } from './components/Picker/Picker.js';
|
|
|
61
61
|
export { i as PickerType } from './_chunks/3fnqPSWW.js';
|
|
62
62
|
export { usePicker } from './components/Picker/api.js';
|
|
63
63
|
export { default as Alert } from './components/Alert/Alert.js';
|
|
64
|
-
export { i as AlertType } from './_chunks/
|
|
64
|
+
export { i as AlertType } from './_chunks/CNx6YBDL.js';
|
|
65
65
|
export { default as alert } from './components/Alert/hooks/alert.js';
|
|
66
66
|
export { default as FAB } from './components/FAB/FAB.js';
|
|
67
67
|
export { i as FABType } from './_chunks/D22mAc_y.js';
|
|
@@ -34,6 +34,7 @@ export interface RedsAlert {
|
|
|
34
34
|
cancelBtnTextStyle?: TextStyle;
|
|
35
35
|
confirmBtnProps?: any;
|
|
36
36
|
cancelBtnProps?: any;
|
|
37
|
+
style?: any;
|
|
37
38
|
}
|
|
38
39
|
export interface RedsAlertEvent {
|
|
39
40
|
}
|
|
@@ -58,5 +59,6 @@ export declare const AlertDefaultProps: {
|
|
|
58
59
|
cancelBtnTextStyle: {};
|
|
59
60
|
confirmBtnProps: {};
|
|
60
61
|
cancelBtnProps: {};
|
|
62
|
+
style: {};
|
|
61
63
|
};
|
|
62
64
|
export {};
|
|
@@ -60,66 +60,34 @@ export declare const style: (props: RedsAlert) => {
|
|
|
60
60
|
justifyContent: "space-between";
|
|
61
61
|
paddingTop: number;
|
|
62
62
|
};
|
|
63
|
-
footerText: {
|
|
64
|
-
borderTopWidth: number;
|
|
65
|
-
borderTopColor: string;
|
|
66
|
-
paddingBottom: number;
|
|
67
|
-
paddingTop: number;
|
|
68
|
-
paddingHorizontal: number;
|
|
69
|
-
};
|
|
70
63
|
footerHorizontal: {
|
|
71
64
|
flexDirection: "row";
|
|
65
|
+
paddingBottom: number;
|
|
72
66
|
paddingHorizontal: number;
|
|
73
|
-
|
|
67
|
+
gap: number;
|
|
74
68
|
};
|
|
75
69
|
footerVertical: {
|
|
76
70
|
flexDirection: "column-reverse";
|
|
77
71
|
alignItems: "center";
|
|
78
72
|
paddingHorizontal: number;
|
|
79
|
-
|
|
80
|
-
cancelButton: {
|
|
81
|
-
flex: number;
|
|
82
|
-
width: number;
|
|
83
|
-
margin: number;
|
|
84
|
-
paddingHorizontal: number;
|
|
85
|
-
};
|
|
86
|
-
button: {
|
|
87
|
-
flex: number;
|
|
88
|
-
width: number;
|
|
89
|
-
margin: number;
|
|
90
|
-
paddingHorizontal: number;
|
|
73
|
+
height: number;
|
|
91
74
|
};
|
|
92
75
|
dividerBox: {
|
|
93
76
|
marginTop: number;
|
|
94
77
|
};
|
|
95
|
-
|
|
78
|
+
cancelButton: {
|
|
96
79
|
flex: number;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
paddingHorizontal: number;
|
|
101
|
-
};
|
|
102
|
-
confirmButtonText: {
|
|
103
|
-
fontSize: any;
|
|
80
|
+
height: number;
|
|
81
|
+
alignItems: "center" | "flex-start";
|
|
82
|
+
paddingTop: number;
|
|
104
83
|
};
|
|
105
|
-
|
|
84
|
+
confirmButton: {
|
|
106
85
|
flex: number;
|
|
107
86
|
width: "100%";
|
|
108
|
-
|
|
109
|
-
marginLeft: number;
|
|
110
|
-
marginTop: number;
|
|
111
|
-
marginBottom: number;
|
|
112
|
-
paddingHorizontal: number;
|
|
87
|
+
height: number;
|
|
113
88
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
height?: number;
|
|
117
|
-
marginTop: number;
|
|
118
|
-
marginBottom: number;
|
|
119
|
-
flex: number;
|
|
120
|
-
width: "100%";
|
|
121
|
-
margin: number;
|
|
122
|
-
marginLeft: number;
|
|
89
|
+
confirmButtonText: {
|
|
90
|
+
fontSize: any;
|
|
123
91
|
};
|
|
124
92
|
cancelText: {
|
|
125
93
|
color: string;
|
|
@@ -34,6 +34,7 @@ export interface RedsAlert {
|
|
|
34
34
|
cancelBtnTextStyle?: TextStyle;
|
|
35
35
|
confirmBtnProps?: any;
|
|
36
36
|
cancelBtnProps?: any;
|
|
37
|
+
style?: any;
|
|
37
38
|
}
|
|
38
39
|
export interface RedsAlertEvent {
|
|
39
40
|
}
|
|
@@ -58,5 +59,6 @@ export declare const AlertDefaultProps: {
|
|
|
58
59
|
cancelBtnTextStyle: {};
|
|
59
60
|
confirmBtnProps: {};
|
|
60
61
|
cancelBtnProps: {};
|
|
62
|
+
style: {};
|
|
61
63
|
};
|
|
62
64
|
export {};
|
|
@@ -60,66 +60,34 @@ export declare const style: (props: RedsAlert) => {
|
|
|
60
60
|
justifyContent: "space-between";
|
|
61
61
|
paddingTop: number;
|
|
62
62
|
};
|
|
63
|
-
footerText: {
|
|
64
|
-
borderTopWidth: number;
|
|
65
|
-
borderTopColor: string;
|
|
66
|
-
paddingBottom: number;
|
|
67
|
-
paddingTop: number;
|
|
68
|
-
paddingHorizontal: number;
|
|
69
|
-
};
|
|
70
63
|
footerHorizontal: {
|
|
71
64
|
flexDirection: "row";
|
|
65
|
+
paddingBottom: number;
|
|
72
66
|
paddingHorizontal: number;
|
|
73
|
-
|
|
67
|
+
gap: number;
|
|
74
68
|
};
|
|
75
69
|
footerVertical: {
|
|
76
70
|
flexDirection: "column-reverse";
|
|
77
71
|
alignItems: "center";
|
|
78
72
|
paddingHorizontal: number;
|
|
79
|
-
|
|
80
|
-
cancelButton: {
|
|
81
|
-
flex: number;
|
|
82
|
-
width: number;
|
|
83
|
-
margin: number;
|
|
84
|
-
paddingHorizontal: number;
|
|
85
|
-
};
|
|
86
|
-
button: {
|
|
87
|
-
flex: number;
|
|
88
|
-
width: number;
|
|
89
|
-
margin: number;
|
|
90
|
-
paddingHorizontal: number;
|
|
73
|
+
height: number;
|
|
91
74
|
};
|
|
92
75
|
dividerBox: {
|
|
93
76
|
marginTop: number;
|
|
94
77
|
};
|
|
95
|
-
|
|
78
|
+
cancelButton: {
|
|
96
79
|
flex: number;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
paddingHorizontal: number;
|
|
101
|
-
};
|
|
102
|
-
confirmButtonText: {
|
|
103
|
-
fontSize: any;
|
|
80
|
+
height: number;
|
|
81
|
+
alignItems: "center" | "flex-start";
|
|
82
|
+
paddingTop: number;
|
|
104
83
|
};
|
|
105
|
-
|
|
84
|
+
confirmButton: {
|
|
106
85
|
flex: number;
|
|
107
86
|
width: "100%";
|
|
108
|
-
|
|
109
|
-
marginLeft: number;
|
|
110
|
-
marginTop: number;
|
|
111
|
-
marginBottom: number;
|
|
112
|
-
paddingHorizontal: number;
|
|
87
|
+
height: number;
|
|
113
88
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
height?: number | undefined;
|
|
117
|
-
marginTop: number;
|
|
118
|
-
marginBottom: number;
|
|
119
|
-
flex: number;
|
|
120
|
-
width: "100%";
|
|
121
|
-
margin: number;
|
|
122
|
-
marginLeft: number;
|
|
89
|
+
confirmButtonText: {
|
|
90
|
+
fontSize: any;
|
|
123
91
|
};
|
|
124
92
|
cancelText: {
|
|
125
93
|
color: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xhsreds/reds-rn-next",
|
|
3
|
-
"version": "0.11.1-
|
|
3
|
+
"version": "0.11.1-beta202601191704",
|
|
4
4
|
"author": "贾斌(呀哈) <jiabin@xiaohongshu.com>",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"dependencies": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react-native-svg": "13.14.0",
|
|
28
28
|
"@xhs/react-native-harmony": "*",
|
|
29
29
|
"@xhs/reds-components": "*",
|
|
30
|
-
"@xhsreds/reds-token-next": "0.11.
|
|
30
|
+
"@xhsreds/reds-token-next": "0.11.1-beta202601191704"
|
|
31
31
|
},
|
|
32
32
|
"peerDependenciesMeta": {
|
|
33
33
|
"ozone-schema-web": {
|
|
@@ -19,77 +19,6 @@ import { Portal } from "../Portal";
|
|
|
19
19
|
import { style } from "./styles";
|
|
20
20
|
import useMounted from "../../pvCount/useUnmountedProcess";
|
|
21
21
|
import { useLanguage } from "../LanguageProvider";
|
|
22
|
-
// const AlertView: React.FC<RedsAlert> = (props) => {
|
|
23
|
-
// const finalProps = { ...AlertDefaultProps, ...props };
|
|
24
|
-
// const {
|
|
25
|
-
// show,
|
|
26
|
-
// title,
|
|
27
|
-
// message,
|
|
28
|
-
// confirmText,
|
|
29
|
-
// cancelText,
|
|
30
|
-
// onConfirm,
|
|
31
|
-
// onCancel,
|
|
32
|
-
// onOpen,
|
|
33
|
-
// onClose,
|
|
34
|
-
// align,
|
|
35
|
-
// // showScrollOverlay,
|
|
36
|
-
// footerLayout,
|
|
37
|
-
// showConfirmButton,
|
|
38
|
-
// showCancelButton,
|
|
39
|
-
// mask,
|
|
40
|
-
// footerType,
|
|
41
|
-
// header,
|
|
42
|
-
// footer,
|
|
43
|
-
// children,
|
|
44
|
-
// onMask,
|
|
45
|
-
// confirmBtnStyle,
|
|
46
|
-
// } = finalProps;
|
|
47
|
-
// const themeColor = useThemeColor("Alert");
|
|
48
|
-
// const cancelKey = useLanguage("componentKey", "cancelKey");
|
|
49
|
-
// const confirmKey = useLanguage("componentKey", "confirmKey");
|
|
50
|
-
// const styles = style(props);
|
|
51
|
-
// // const [hasScrollToBottom, setHasScrollToBottom] = useState(true);
|
|
52
|
-
// const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
53
|
-
|
|
54
|
-
// useEffect(() => {
|
|
55
|
-
// if (show && onOpen) onOpen();
|
|
56
|
-
// if (!show && onClose) onClose();
|
|
57
|
-
// }, [show]);
|
|
58
|
-
|
|
59
|
-
// const handleConfirm = (e: GestureResponderEvent) => {
|
|
60
|
-
// if (onConfirm) onConfirm(e);
|
|
61
|
-
// };
|
|
62
|
-
|
|
63
|
-
// const handleCancel = (e: GestureResponderEvent) => {
|
|
64
|
-
// if (onCancel) onCancel(e);
|
|
65
|
-
// };
|
|
66
|
-
// return show ? (
|
|
67
|
-
// <>
|
|
68
|
-
// <Animated.View
|
|
69
|
-
// style={[
|
|
70
|
-
// styles.centeredView,
|
|
71
|
-
// {
|
|
72
|
-
// transform: [
|
|
73
|
-
// {
|
|
74
|
-
// scale: fadeAnim.interpolate({
|
|
75
|
-
// inputRange: [0, 1],
|
|
76
|
-
// outputRange: [1, 1],
|
|
77
|
-
// }),
|
|
78
|
-
// },
|
|
79
|
-
// ],
|
|
80
|
-
// },
|
|
81
|
-
// ]}
|
|
82
|
-
// >
|
|
83
|
-
// {mask && (
|
|
84
|
-
// <TouchableOpacity onPress={() => { console.log('onMask xxxx')}} activeOpacity={1}>
|
|
85
|
-
// <View style={styles.modalOverlay} />
|
|
86
|
-
// </TouchableOpacity>
|
|
87
|
-
// )}
|
|
88
|
-
|
|
89
|
-
// </Animated.View>
|
|
90
|
-
// </>
|
|
91
|
-
// ) : null;
|
|
92
|
-
// };
|
|
93
22
|
|
|
94
23
|
const Alert: React.FC<RedsAlert> = (props) => {
|
|
95
24
|
const finalProps = { ...AlertDefaultProps, ...props };
|
|
@@ -143,6 +72,7 @@ const Alert: React.FC<RedsAlert> = (props) => {
|
|
|
143
72
|
if (onCancel) onCancel(e);
|
|
144
73
|
};
|
|
145
74
|
useMounted("Alert");
|
|
75
|
+
|
|
146
76
|
return show ? (
|
|
147
77
|
<Portal hostName={hostName}>
|
|
148
78
|
<View style={styles.centeredView}>
|
|
@@ -165,7 +95,7 @@ const Alert: React.FC<RedsAlert> = (props) => {
|
|
|
165
95
|
},
|
|
166
96
|
]}
|
|
167
97
|
>
|
|
168
|
-
<View style={[styles.alertContainer, { top: props.offset?.y || 0, left: props.offset?.x || 0 }]}>
|
|
98
|
+
<View style={[styles.alertContainer, props.style, { top: props.offset?.y || 0, left: props.offset?.x || 0 }]}>
|
|
169
99
|
{header}
|
|
170
100
|
<View style={[styles.alertContent, props.contentStyle]}>
|
|
171
101
|
<Text style={styles.title}>{title}</Text>
|
|
@@ -189,7 +119,7 @@ const Alert: React.FC<RedsAlert> = (props) => {
|
|
|
189
119
|
style={[
|
|
190
120
|
styles.footer,
|
|
191
121
|
footerLayout === "vertical" ? styles.footerVertical : styles.footerHorizontal,
|
|
192
|
-
footerType === "text" && styles.footerText,
|
|
122
|
+
// footerType === "text" && styles.footerText,
|
|
193
123
|
props.footerStyle,
|
|
194
124
|
]}
|
|
195
125
|
>
|
|
@@ -198,7 +128,7 @@ const Alert: React.FC<RedsAlert> = (props) => {
|
|
|
198
128
|
variant={footerType === "text" ? "text" : "outline"}
|
|
199
129
|
onClick={handleCancel}
|
|
200
130
|
style={{
|
|
201
|
-
...
|
|
131
|
+
...styles.cancelButton,
|
|
202
132
|
...cancelBtnStyle,
|
|
203
133
|
}}
|
|
204
134
|
size={footerType === "text" ? (footerLayout === "vertical" ? "medium" : "large") : "medium"}
|
|
@@ -212,10 +142,10 @@ const Alert: React.FC<RedsAlert> = (props) => {
|
|
|
212
142
|
showCancelButton &&
|
|
213
143
|
(footerLayout === "vertical" ? (
|
|
214
144
|
// @ts-ignore
|
|
215
|
-
<View
|
|
145
|
+
<View style={styles.horizontalLine} />
|
|
216
146
|
) : (
|
|
217
147
|
// @ts-ignore
|
|
218
|
-
<View
|
|
148
|
+
<View style={styles.verticalLine} />
|
|
219
149
|
))}
|
|
220
150
|
{showConfirmButton && (
|
|
221
151
|
<Button
|
|
@@ -223,8 +153,7 @@ const Alert: React.FC<RedsAlert> = (props) => {
|
|
|
223
153
|
variant={footerType === "text" ? "text" : "fill"}
|
|
224
154
|
onClick={handleConfirm}
|
|
225
155
|
style={{
|
|
226
|
-
...
|
|
227
|
-
...(footerLayout === "vertical" ? styles.verButton : styles.confirmButton),
|
|
156
|
+
...styles.confirmButton,
|
|
228
157
|
...confirmBtnStyle,
|
|
229
158
|
}}
|
|
230
159
|
textStyle={[styles.confirmButtonText, confirmBtnTextStyle]}
|
|
@@ -36,6 +36,7 @@ import BaseDemo from "!!raw-loader!../demo/index.tsx";
|
|
|
36
36
|
| cancelBtnTextStyle | cancelBtnTextStyle | TextStyle | `{}` |
|
|
37
37
|
| confirmBtnProps | confirmBtnProps | any | `{}` |
|
|
38
38
|
| cancelBtnProps | cancelBtnProps | any | `{}` |
|
|
39
|
+
| style | style | any | `{}` |
|
|
39
40
|
|
|
40
41
|
### Events
|
|
41
42
|
|
|
@@ -35,6 +35,7 @@ export interface RedsAlert {
|
|
|
35
35
|
cancelBtnTextStyle?: TextStyle;
|
|
36
36
|
confirmBtnProps?: any;
|
|
37
37
|
cancelBtnProps?: any;
|
|
38
|
+
style?: any;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
export interface RedsAlertEvent {}
|
|
@@ -56,4 +57,5 @@ export const AlertDefaultProps = {
|
|
|
56
57
|
cancelBtnTextStyle: {},
|
|
57
58
|
confirmBtnProps: {},
|
|
58
59
|
cancelBtnProps: {},
|
|
60
|
+
style: {},
|
|
59
61
|
};
|
|
@@ -64,77 +64,40 @@ export const style = (props: RedsAlert) => {
|
|
|
64
64
|
},
|
|
65
65
|
footer: {
|
|
66
66
|
width: "100%",
|
|
67
|
-
// height: 48,
|
|
68
67
|
flexDirection: "row",
|
|
69
68
|
justifyContent: "space-between",
|
|
70
69
|
paddingTop: 0,
|
|
71
70
|
},
|
|
72
|
-
footerText: {
|
|
73
|
-
borderTopWidth: 0.5,
|
|
74
|
-
borderTopColor: themeColor.Fill2,
|
|
75
|
-
paddingBottom: props.footerLayout === "vertical" ? 0 : 6,
|
|
76
|
-
paddingTop: props.footerLayout === "vertical" ? 0 : 6,
|
|
77
|
-
paddingHorizontal: props.footerLayout === "vertical" ? 0 : 12,
|
|
78
|
-
},
|
|
79
71
|
footerHorizontal: {
|
|
80
72
|
flexDirection: "row",
|
|
73
|
+
paddingBottom: props.footerType === "text" ? 0 : 20,
|
|
81
74
|
paddingHorizontal: 20,
|
|
82
|
-
|
|
75
|
+
gap: 12,
|
|
83
76
|
},
|
|
84
77
|
footerVertical: {
|
|
85
78
|
flexDirection: "column-reverse",
|
|
86
79
|
alignItems: "center",
|
|
87
|
-
// height: 100,
|
|
88
80
|
paddingHorizontal: 20,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
flex: 1,
|
|
92
|
-
width: 109,
|
|
93
|
-
margin: 0,
|
|
94
|
-
paddingHorizontal: 0,
|
|
95
|
-
// height: 36,
|
|
96
|
-
},
|
|
97
|
-
button: {
|
|
98
|
-
flex: 1,
|
|
99
|
-
width: 109,
|
|
100
|
-
margin: 0,
|
|
101
|
-
paddingHorizontal: 0,
|
|
102
|
-
// height: 36,
|
|
81
|
+
height:
|
|
82
|
+
props.showCancelButton && props.showConfirmButton ? (props.cancelBtnProps.variant === "text" ? 82 : 100) : 56,
|
|
103
83
|
},
|
|
104
84
|
dividerBox: {
|
|
105
85
|
marginTop: 5,
|
|
106
86
|
},
|
|
87
|
+
cancelButton: {
|
|
88
|
+
flex: 1,
|
|
89
|
+
height: props.cancelBtnProps.variant === "text" ? 34 : props.footerType === "text" ? 52 : 36,
|
|
90
|
+
alignItems: props.cancelBtnProps.variant === "text" ? "flex-start" : "center",
|
|
91
|
+
paddingTop: props.cancelBtnProps.variant === "text" ? 12 : 0,
|
|
92
|
+
},
|
|
107
93
|
confirmButton: {
|
|
108
94
|
flex: 1,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
width: 109,
|
|
112
|
-
// height: 36,
|
|
113
|
-
paddingHorizontal: 20,
|
|
95
|
+
width: "100%",
|
|
96
|
+
height: props.footerType === "text" ? 52 : 36,
|
|
114
97
|
},
|
|
115
98
|
confirmButtonText: {
|
|
116
99
|
fontSize: props.footerType === "text" ? typography.T2FontSize : typography.T3FontSize,
|
|
117
100
|
},
|
|
118
|
-
verButton: {
|
|
119
|
-
flex: 0,
|
|
120
|
-
width: "100%",
|
|
121
|
-
margin: 0,
|
|
122
|
-
marginLeft: props.footerLayout === "vertical" ? 0 : 10,
|
|
123
|
-
marginTop: props.footerType === "text" ? 7 : props.footerLayout === "vertical" ? 7 : 10,
|
|
124
|
-
marginBottom: props.footerLayout === "vertical" ? 7 : 0,
|
|
125
|
-
// height: 36,
|
|
126
|
-
paddingHorizontal: 20,
|
|
127
|
-
},
|
|
128
|
-
verCancelButton: {
|
|
129
|
-
flex: 0,
|
|
130
|
-
width: "100%",
|
|
131
|
-
margin: 0,
|
|
132
|
-
marginLeft: props.footerLayout === "vertical" ? 0 : 10,
|
|
133
|
-
marginTop: props.footerType === "text" ? 7 : props.footerLayout === "vertical" ? 7 : 10,
|
|
134
|
-
marginBottom: props.footerLayout === "vertical" ? 7 : 0,
|
|
135
|
-
...(props.cancelBtnProps.variant === "text" ? { height: 20, marginTop: 0, marginBottom: 14 } : {}),
|
|
136
|
-
paddingHorizontal: 20,
|
|
137
|
-
},
|
|
138
101
|
cancelText: {
|
|
139
102
|
color: themeColor.Description,
|
|
140
103
|
fontSize:
|