@proximus/lavender-dialogbox-native 0.1.0-alpha.0
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/CHANGELOG.md +21 -0
- package/dist/PxDialogBox.d.ts +13 -0
- package/dist/PxDialogBox.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +43 -0
- package/src/PxDialogBox.tsx +131 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +8 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 0.1.0-alpha.0 (2025-08-13)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **BCRI-000000:** remove default E2E on DEV env build for all components ([a5d27bf](https://github.com/Pxs-Corporate/react-native-lavender/commit/a5d27bfaaebf5b75f3160f31c64b590b7bd00b93))
|
|
11
|
+
- **BCRI-3651640:** dialogbox module ([f81465e](https://github.com/Pxs-Corporate/react-native-lavender/commit/f81465ee7332fee42789700c468344ce3b3f5cc4))
|
|
12
|
+
- **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
|
|
13
|
+
- **BCRI-4210372:** fix bad version numbers ([bc6a8ba](https://github.com/Pxs-Corporate/react-native-lavender/commit/bc6a8ba48c15347442f2ac38dacae7ffba3d95eb))
|
|
14
|
+
|
|
15
|
+
# (2025-08-13)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- **BCRI-000000:** remove default E2E on DEV env build for all components ([a5d27bf](https://github.com/Pxs-Corporate/react-native-lavender/commit/a5d27bfaaebf5b75f3160f31c64b590b7bd00b93))
|
|
20
|
+
- **BCRI-3651640:** dialogbox module ([f81465e](https://github.com/Pxs-Corporate/react-native-lavender/commit/f81465ee7332fee42789700c468344ce3b3f5cc4))
|
|
21
|
+
- **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare function PxDialogBox({ title, body, primaryButtonLabel, primaryButtonCallback, secondaryButtonLabel, secondaryButtonCallback, sideBySideButtons, containerStyle, }: {
|
|
4
|
+
title: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
primaryButtonLabel: string;
|
|
7
|
+
primaryButtonCallback: () => void;
|
|
8
|
+
secondaryButtonLabel?: string;
|
|
9
|
+
secondaryButtonCallback?: () => void;
|
|
10
|
+
sideBySideButtons?: boolean;
|
|
11
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
//# sourceMappingURL=PxDialogBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PxDialogBox.d.ts","sourceRoot":"","sources":["../src/PxDialogBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,GACf,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACvC,qBA4BA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proximus/lavender-dialogbox-native",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "Lavender dialog box component",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"prepublish": "yarn clean && yarn build",
|
|
12
|
+
"build": "npx tsc -p tsconfig.json"
|
|
13
|
+
},
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"@proximus/lavender-button-native": "workspace:*",
|
|
16
|
+
"@proximus/lavender-common-native": "workspace:*",
|
|
17
|
+
"@proximus/lavender-separator-native": "workspace:*",
|
|
18
|
+
"@proximus/lavender-styling-native": "workspace:*",
|
|
19
|
+
"@proximus/lavender-texts-native": "workspace:*"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@proximus/lavender-button-native": "0.1.0-alpha.1",
|
|
23
|
+
"@proximus/lavender-common-native": "0.1.0-alpha.0",
|
|
24
|
+
"@proximus/lavender-separator-native": "0.1.0-alpha.0",
|
|
25
|
+
"@proximus/lavender-styling-native": "0.1.0-alpha.0",
|
|
26
|
+
"@proximus/lavender-texts-native": "0.1.0-alpha.0"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"lerna": {
|
|
32
|
+
"command": {
|
|
33
|
+
"publish": {
|
|
34
|
+
"assets": [
|
|
35
|
+
"dist",
|
|
36
|
+
"src",
|
|
37
|
+
"package.json"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"gitHead": "27525289a448a6e4f3c2d36a88b9dc54d0f15fbf"
|
|
43
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { StyleSheet, View, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Body, Header } from '@proximus/lavender-texts-native';
|
|
4
|
+
import { PxButton } from '@proximus/lavender-button-native';
|
|
5
|
+
import { Colors } from '@proximus/lavender-styling-native';
|
|
6
|
+
import { PxSeparator } from '@proximus/lavender-separator-native';
|
|
7
|
+
|
|
8
|
+
export function PxDialogBox({
|
|
9
|
+
title,
|
|
10
|
+
body,
|
|
11
|
+
primaryButtonLabel,
|
|
12
|
+
primaryButtonCallback,
|
|
13
|
+
secondaryButtonLabel,
|
|
14
|
+
secondaryButtonCallback,
|
|
15
|
+
sideBySideButtons,
|
|
16
|
+
containerStyle,
|
|
17
|
+
}: {
|
|
18
|
+
title: string;
|
|
19
|
+
body?: string;
|
|
20
|
+
primaryButtonLabel: string;
|
|
21
|
+
primaryButtonCallback: () => void;
|
|
22
|
+
secondaryButtonLabel?: string;
|
|
23
|
+
secondaryButtonCallback?: () => void;
|
|
24
|
+
sideBySideButtons?: boolean;
|
|
25
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
26
|
+
}) {
|
|
27
|
+
return (
|
|
28
|
+
<View
|
|
29
|
+
style={[
|
|
30
|
+
styles.container,
|
|
31
|
+
...(Array.isArray(containerStyle) ? containerStyle : [containerStyle]),
|
|
32
|
+
]}
|
|
33
|
+
>
|
|
34
|
+
<Header style={styles.header}>{title}</Header>
|
|
35
|
+
{body && <Body style={styles.body}>{body}</Body>}
|
|
36
|
+
<PxSeparator style={{ marginVertical: 8 }} />
|
|
37
|
+
{sideBySideButtons ? (
|
|
38
|
+
<SideBySideButtons
|
|
39
|
+
primaryButtonLabel={primaryButtonLabel}
|
|
40
|
+
primaryButtonCallback={primaryButtonCallback}
|
|
41
|
+
secondaryButtonLabel={secondaryButtonLabel}
|
|
42
|
+
secondaryButtonCallback={secondaryButtonCallback}
|
|
43
|
+
/>
|
|
44
|
+
) : (
|
|
45
|
+
<StackedButtons
|
|
46
|
+
primaryButtonLabel={primaryButtonLabel}
|
|
47
|
+
primaryButtonCallback={primaryButtonCallback}
|
|
48
|
+
secondaryButtonLabel={secondaryButtonLabel}
|
|
49
|
+
secondaryButtonCallback={secondaryButtonCallback}
|
|
50
|
+
/>
|
|
51
|
+
)}
|
|
52
|
+
</View>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function StackedButtons({
|
|
57
|
+
primaryButtonLabel,
|
|
58
|
+
primaryButtonCallback,
|
|
59
|
+
secondaryButtonLabel,
|
|
60
|
+
secondaryButtonCallback,
|
|
61
|
+
}: {
|
|
62
|
+
primaryButtonLabel: string;
|
|
63
|
+
primaryButtonCallback: () => void;
|
|
64
|
+
secondaryButtonLabel?: string;
|
|
65
|
+
secondaryButtonCallback?: () => void;
|
|
66
|
+
}) {
|
|
67
|
+
return (
|
|
68
|
+
<>
|
|
69
|
+
<PxButton
|
|
70
|
+
wrapperStyle={{ marginVertical: 8 }}
|
|
71
|
+
title={primaryButtonLabel}
|
|
72
|
+
onPress={primaryButtonCallback}
|
|
73
|
+
/>
|
|
74
|
+
{secondaryButtonLabel && secondaryButtonCallback && (
|
|
75
|
+
<PxButton
|
|
76
|
+
title={secondaryButtonLabel}
|
|
77
|
+
onPress={secondaryButtonCallback}
|
|
78
|
+
type={'secondary'}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function SideBySideButtons({
|
|
86
|
+
primaryButtonLabel,
|
|
87
|
+
primaryButtonCallback,
|
|
88
|
+
secondaryButtonLabel,
|
|
89
|
+
secondaryButtonCallback,
|
|
90
|
+
}: {
|
|
91
|
+
primaryButtonLabel: string;
|
|
92
|
+
primaryButtonCallback: () => void;
|
|
93
|
+
secondaryButtonLabel?: string;
|
|
94
|
+
secondaryButtonCallback?: () => void;
|
|
95
|
+
}) {
|
|
96
|
+
return (
|
|
97
|
+
<View style={{ flexDirection: 'row', flex: 1, marginVertical: 8 }}>
|
|
98
|
+
{secondaryButtonLabel && secondaryButtonCallback && (
|
|
99
|
+
<PxButton
|
|
100
|
+
wrapperStyle={{ flexGrow: 1, marginRight: 4 }}
|
|
101
|
+
title={secondaryButtonLabel}
|
|
102
|
+
onPress={secondaryButtonCallback}
|
|
103
|
+
type={'secondary'}
|
|
104
|
+
isRoundedBottomCorner={false}
|
|
105
|
+
/>
|
|
106
|
+
)}
|
|
107
|
+
<PxButton
|
|
108
|
+
wrapperStyle={{ flexGrow: 1, marginLeft: 4 }}
|
|
109
|
+
title={primaryButtonLabel}
|
|
110
|
+
onPress={primaryButtonCallback}
|
|
111
|
+
/>
|
|
112
|
+
</View>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const styles = StyleSheet.create({
|
|
117
|
+
container: {
|
|
118
|
+
paddingHorizontal: 16,
|
|
119
|
+
paddingVertical: 8,
|
|
120
|
+
borderRadius: 4,
|
|
121
|
+
backgroundColor: Colors.v8_1.white,
|
|
122
|
+
},
|
|
123
|
+
header: {
|
|
124
|
+
marginVertical: 8,
|
|
125
|
+
fontSize: 18,
|
|
126
|
+
},
|
|
127
|
+
body: {
|
|
128
|
+
fontSize: 14,
|
|
129
|
+
marginVertical: 8,
|
|
130
|
+
},
|
|
131
|
+
});
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PxDialogBox } from './PxDialogBox';
|