@proximus/lavender-patch-native 2.1.1-alpha.2 → 2.1.1-alpha.20
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/PxPatch.d.ts +4 -2
- package/dist/PxPatch.d.ts.map +1 -1
- package/dist/PxPatch.js +5 -4
- package/package.json +1 -1
package/dist/PxPatch.d.ts
CHANGED
|
@@ -5,11 +5,13 @@ export interface IPxPatchProps {
|
|
|
5
5
|
title: string;
|
|
6
6
|
testID?: string;
|
|
7
7
|
iconName?: IconName;
|
|
8
|
-
|
|
8
|
+
variant: 'promo' | 'info' | 'blackfriday' | 'eco';
|
|
9
|
+
/** @deprecated use variant instead */
|
|
10
|
+
type?: 'promo' | 'info' | 'blackfriday' | 'eco';
|
|
9
11
|
borderType?: 'bottomLeft' | 'bottomRight';
|
|
10
12
|
isFocused?: boolean;
|
|
11
13
|
wrapperStyle?: StyleProp<ViewStyle>;
|
|
12
14
|
onPress?: () => void;
|
|
13
15
|
}
|
|
14
|
-
export declare function PxPatch({ title, testID, type, iconName, borderType, wrapperStyle, onPress, ...accessibilityProps }: IPxPatchProps & AccessibilityProps): React.JSX.Element;
|
|
16
|
+
export declare function PxPatch({ title, testID, variant, type, iconName, borderType, wrapperStyle, onPress, ...accessibilityProps }: IPxPatchProps & AccessibilityProps): React.JSX.Element;
|
|
15
17
|
//# sourceMappingURL=PxPatch.d.ts.map
|
package/dist/PxPatch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PxPatch.d.ts","sourceRoot":"","sources":["../src/PxPatch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,SAAS,EAGT,SAAS,EACV,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAGrE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"PxPatch.d.ts","sourceRoot":"","sources":["../src/PxPatch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,SAAS,EAGT,SAAS,EACV,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAGrE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,KAAK,CAAC;IAClD,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,KAAK,CAAC;IAChD,UAAU,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,OAAO,EACP,GAAG,kBAAkB,EACtB,EAAE,aAAa,GAAG,kBAAkB,qBAkGpC"}
|
package/dist/PxPatch.js
CHANGED
|
@@ -4,10 +4,11 @@ import { a11y, e2eID } from '@proximus/lavender-common-native';
|
|
|
4
4
|
import { Header } from '@proximus/lavender-texts-native';
|
|
5
5
|
import { PxIcon } from '@proximus/lavender-icon-native';
|
|
6
6
|
import { useTheme } from '@proximus/lavender-styling-native';
|
|
7
|
-
export function PxPatch({ title, testID, type, iconName, borderType, wrapperStyle, onPress, ...accessibilityProps }) {
|
|
7
|
+
export function PxPatch({ title, testID, variant, type, iconName, borderType, wrapperStyle, onPress, ...accessibilityProps }) {
|
|
8
8
|
const { theme } = useTheme();
|
|
9
|
+
const selectedVariant = variant ?? type;
|
|
9
10
|
const backgroundColor = () => {
|
|
10
|
-
switch (
|
|
11
|
+
switch (selectedVariant) {
|
|
11
12
|
case 'promo':
|
|
12
13
|
return {
|
|
13
14
|
backgroundColor: theme.t('ColorBackgroundPurposePromoDefault'),
|
|
@@ -42,7 +43,7 @@ export function PxPatch({ title, testID, type, iconName, borderType, wrapperStyl
|
|
|
42
43
|
return undefined;
|
|
43
44
|
};
|
|
44
45
|
const fontColor = () => {
|
|
45
|
-
if (
|
|
46
|
+
if (selectedVariant !== 'info') {
|
|
46
47
|
return theme.t('ColorTextNeutralInverted');
|
|
47
48
|
}
|
|
48
49
|
return theme.t('ColorTextNeutralInverted');
|
|
@@ -71,7 +72,7 @@ export function PxPatch({ title, testID, type, iconName, borderType, wrapperStyl
|
|
|
71
72
|
color: fontColor(),
|
|
72
73
|
lineHeight: theme.t('TextSizeLabelMMobile').number * 1.5,
|
|
73
74
|
} }, title),
|
|
74
|
-
iconName && onPress &&
|
|
75
|
+
iconName && onPress && selectedVariant === 'promo' && (React.createElement(PxIcon, { ...(testID && e2eID(testID + '-patch-icon')), name: iconName, size: 'Xs', style: {
|
|
75
76
|
marginLeft: 5,
|
|
76
77
|
color: fontColor(),
|
|
77
78
|
} }))));
|