@proximus/lavender-dialogbox-native 1.2.0-beta.1 → 1.2.1
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/dist/PxDialogBox.d.ts +6 -1
- package/dist/PxDialogBox.d.ts.map +1 -1
- package/dist/PxDialogBox.js +22 -9
- package/package.json +1 -1
package/dist/PxDialogBox.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare function PxDialogBox({ title, body, primaryButtonLabel, primaryButtonCallback, secondaryButtonLabel, secondaryButtonCallback, sideBySideButtons, containerStyle, }: {
|
|
3
|
+
export declare function PxDialogBox({ title, body, primaryButtonLabel, primaryButtonCallback, secondaryButtonLabel, secondaryButtonCallback, sideBySideButtons, containerStyle, testID, primaryButtonAccessibilityLabel, primaryButtonAccessibilityHint, secondaryButtonAccessibilityLabel, secondaryButtonAccessibilityHint, }: {
|
|
4
4
|
title: string;
|
|
5
5
|
body?: string;
|
|
6
6
|
primaryButtonLabel: string;
|
|
@@ -9,5 +9,10 @@ export declare function PxDialogBox({ title, body, primaryButtonLabel, primaryBu
|
|
|
9
9
|
secondaryButtonCallback?: () => void;
|
|
10
10
|
sideBySideButtons?: boolean;
|
|
11
11
|
containerStyle?: StyleProp<ViewStyle>;
|
|
12
|
+
testID?: string;
|
|
13
|
+
primaryButtonAccessibilityLabel?: string;
|
|
14
|
+
primaryButtonAccessibilityHint?: string;
|
|
15
|
+
secondaryButtonAccessibilityLabel?: string;
|
|
16
|
+
secondaryButtonAccessibilityHint?: string;
|
|
12
17
|
}): React.JSX.Element;
|
|
13
18
|
//# sourceMappingURL=PxDialogBox.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAO1B,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,EACjC,gCAAgC,GACjC,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;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,iCAAiC,CAAC,EAAE,MAAM,CAAC;IAC3C,gCAAgC,CAAC,EAAE,MAAM,CAAC;CAC3C,qBA4CA"}
|
package/dist/PxDialogBox.js
CHANGED
|
@@ -4,7 +4,8 @@ import { Body, Header } from '@proximus/lavender-texts-native';
|
|
|
4
4
|
import { PxButton } from '@proximus/lavender-button-native';
|
|
5
5
|
import { PxSeparator } from '@proximus/lavender-separator-native';
|
|
6
6
|
import { useTheme } from '@proximus/lavender-styling-native';
|
|
7
|
-
|
|
7
|
+
import { e2eID, a11y } from '@proximus/lavender-common-native';
|
|
8
|
+
export function PxDialogBox({ title, body, primaryButtonLabel, primaryButtonCallback, secondaryButtonLabel, secondaryButtonCallback, sideBySideButtons, containerStyle, testID, primaryButtonAccessibilityLabel, primaryButtonAccessibilityHint, secondaryButtonAccessibilityLabel, secondaryButtonAccessibilityHint, }) {
|
|
8
9
|
const { theme } = useTheme();
|
|
9
10
|
return (React.createElement(View, { style: [
|
|
10
11
|
styles.container,
|
|
@@ -12,21 +13,33 @@ export function PxDialogBox({ title, body, primaryButtonLabel, primaryButtonCall
|
|
|
12
13
|
backgroundColor: theme.t('ColorBackgroundContainerLightDefault'),
|
|
13
14
|
},
|
|
14
15
|
...(Array.isArray(containerStyle) ? containerStyle : [containerStyle]),
|
|
15
|
-
] },
|
|
16
|
+
], ...e2eID(testID) },
|
|
16
17
|
React.createElement(Header, { style: styles.header }, title),
|
|
17
18
|
body && React.createElement(Body, { style: styles.body }, body),
|
|
18
19
|
React.createElement(PxSeparator, { style: { marginVertical: 8 } }),
|
|
19
|
-
sideBySideButtons ? (React.createElement(SideBySideButtons, { primaryButtonLabel: primaryButtonLabel, primaryButtonCallback: primaryButtonCallback, secondaryButtonLabel: secondaryButtonLabel, secondaryButtonCallback: secondaryButtonCallback })) : (React.createElement(StackedButtons, { primaryButtonLabel: primaryButtonLabel, primaryButtonCallback: primaryButtonCallback, secondaryButtonLabel: secondaryButtonLabel, secondaryButtonCallback: secondaryButtonCallback }))));
|
|
20
|
+
sideBySideButtons ? (React.createElement(SideBySideButtons, { primaryButtonLabel: primaryButtonLabel, primaryButtonCallback: primaryButtonCallback, secondaryButtonLabel: secondaryButtonLabel, secondaryButtonCallback: secondaryButtonCallback, testID: testID, primaryButtonAccessibilityLabel: primaryButtonAccessibilityLabel, primaryButtonAccessibilityHint: primaryButtonAccessibilityHint, secondaryButtonAccessibilityLabel: secondaryButtonAccessibilityLabel, secondaryButtonAccessibilityHint: secondaryButtonAccessibilityHint })) : (React.createElement(StackedButtons, { primaryButtonLabel: primaryButtonLabel, primaryButtonCallback: primaryButtonCallback, secondaryButtonLabel: secondaryButtonLabel, secondaryButtonCallback: secondaryButtonCallback, testID: testID, primaryButtonAccessibilityLabel: primaryButtonAccessibilityLabel, primaryButtonAccessibilityHint: primaryButtonAccessibilityHint, secondaryButtonAccessibilityLabel: secondaryButtonAccessibilityLabel, secondaryButtonAccessibilityHint: secondaryButtonAccessibilityHint }))));
|
|
20
21
|
}
|
|
21
|
-
function StackedButtons({ primaryButtonLabel, primaryButtonCallback, secondaryButtonLabel, secondaryButtonCallback, }) {
|
|
22
|
+
function StackedButtons({ primaryButtonLabel, primaryButtonCallback, secondaryButtonLabel, secondaryButtonCallback, testID, primaryButtonAccessibilityLabel, primaryButtonAccessibilityHint, secondaryButtonAccessibilityLabel, secondaryButtonAccessibilityHint, }) {
|
|
22
23
|
return (React.createElement(React.Fragment, null,
|
|
23
|
-
React.createElement(PxButton, { wrapperStyle: { marginVertical: 8 }, title: primaryButtonLabel, onPress: primaryButtonCallback }),
|
|
24
|
-
|
|
24
|
+
React.createElement(PxButton, { wrapperStyle: { marginVertical: 8 }, title: primaryButtonLabel, onPress: primaryButtonCallback, ...e2eID(testID ? `${testID}.primaryButton` : undefined), ...a11y({
|
|
25
|
+
accessibilityLabel: primaryButtonAccessibilityLabel,
|
|
26
|
+
accessibilityHint: primaryButtonAccessibilityHint,
|
|
27
|
+
}) }),
|
|
28
|
+
secondaryButtonLabel && secondaryButtonCallback && (React.createElement(PxButton, { title: secondaryButtonLabel, onPress: secondaryButtonCallback, type: 'secondary', ...e2eID(testID ? `${testID}.secondaryButton` : undefined), ...a11y({
|
|
29
|
+
accessibilityLabel: secondaryButtonAccessibilityLabel,
|
|
30
|
+
accessibilityHint: secondaryButtonAccessibilityHint,
|
|
31
|
+
}) }))));
|
|
25
32
|
}
|
|
26
|
-
function SideBySideButtons({ primaryButtonLabel, primaryButtonCallback, secondaryButtonLabel, secondaryButtonCallback, }) {
|
|
33
|
+
function SideBySideButtons({ primaryButtonLabel, primaryButtonCallback, secondaryButtonLabel, secondaryButtonCallback, testID, primaryButtonAccessibilityLabel, primaryButtonAccessibilityHint, secondaryButtonAccessibilityLabel, secondaryButtonAccessibilityHint, }) {
|
|
27
34
|
return (React.createElement(View, { style: { flexDirection: 'row', flex: 1, marginVertical: 8 } },
|
|
28
|
-
secondaryButtonLabel && secondaryButtonCallback && (React.createElement(PxButton, { wrapperStyle: { flexGrow: 1, marginRight: 4 }, title: secondaryButtonLabel, onPress: secondaryButtonCallback, type: 'secondary', isRoundedBottomCorner: false })
|
|
29
|
-
|
|
35
|
+
secondaryButtonLabel && secondaryButtonCallback && (React.createElement(PxButton, { wrapperStyle: { flexGrow: 1, marginRight: 4 }, title: secondaryButtonLabel, onPress: secondaryButtonCallback, type: 'secondary', isRoundedBottomCorner: false, ...e2eID(testID ? `${testID}.secondaryButton` : undefined), ...a11y({
|
|
36
|
+
accessibilityLabel: secondaryButtonAccessibilityLabel,
|
|
37
|
+
accessibilityHint: secondaryButtonAccessibilityHint,
|
|
38
|
+
}) })),
|
|
39
|
+
React.createElement(PxButton, { wrapperStyle: { flexGrow: 1, marginLeft: 4 }, title: primaryButtonLabel, onPress: primaryButtonCallback, ...e2eID(testID ? `${testID}.primaryButton` : undefined), ...a11y({
|
|
40
|
+
accessibilityLabel: primaryButtonAccessibilityLabel,
|
|
41
|
+
accessibilityHint: primaryButtonAccessibilityHint,
|
|
42
|
+
}) })));
|
|
30
43
|
}
|
|
31
44
|
const styles = StyleSheet.create({
|
|
32
45
|
container: {
|