@proximus/lavender-patch-native 0.1.0-alpha.4 → 0.1.0-beta.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.
@@ -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;IAC/C,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,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,OAAO,EACP,GAAG,kBAAkB,EACtB,EAAE,aAAa,GAAG,kBAAkB,qBA+FpC"}
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;IAC/C,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,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,OAAO,EACP,GAAG,kBAAkB,EACtB,EAAE,aAAa,GAAG,kBAAkB,qBAiGpC"}
@@ -0,0 +1,78 @@
1
+ import React from 'react';
2
+ import { TouchableOpacity, View, } from 'react-native';
3
+ import { a11y, e2eID } from '@proximus/lavender-common-native';
4
+ import { Header } from '@proximus/lavender-texts-native';
5
+ import { PxIcon } from '@proximus/lavender-icon-native';
6
+ import { useTheme } from '@proximus/lavender-styling-native';
7
+ export function PxPatch({ title, testID, type, iconName, borderType, wrapperStyle, onPress, ...accessibilityProps }) {
8
+ const { theme } = useTheme();
9
+ const backgroundColor = () => {
10
+ switch (type) {
11
+ case 'promo':
12
+ return {
13
+ backgroundColor: theme.t('ColorBackgroundPurposePromoDefault'),
14
+ };
15
+ case 'info':
16
+ return {
17
+ backgroundColor: theme.t('ColorBackgroundPurposeInfoDefault'),
18
+ };
19
+ case 'blackfriday':
20
+ return {
21
+ backgroundColor: theme.t('ColorBackgroundSurfaceDark'),
22
+ };
23
+ case 'eco':
24
+ return {
25
+ backgroundColor: theme.t('ColorBackgroundPurposeEcoDefault'),
26
+ };
27
+ default:
28
+ return undefined;
29
+ }
30
+ };
31
+ const borderStyle = () => {
32
+ if (borderType === 'bottomLeft') {
33
+ return {
34
+ borderBottomLeftRadius: 0,
35
+ };
36
+ }
37
+ if (borderType === 'bottomRight') {
38
+ return {
39
+ borderBottomRightRadius: 0,
40
+ };
41
+ }
42
+ return undefined;
43
+ };
44
+ const fontColor = () => {
45
+ if (type !== 'info') {
46
+ return theme.t('ColorTextNeutralInverted');
47
+ }
48
+ return theme.t('ColorTextNeutralInverted');
49
+ };
50
+ const Wrapper = (onPress ? TouchableOpacity : View);
51
+ return (React.createElement(Wrapper, { style: [
52
+ {
53
+ alignItems: 'center',
54
+ flexDirection: 'row',
55
+ height: 26,
56
+ fontSize: theme.t('TextSizeLabelMMobile').number,
57
+ paddingHorizontal: theme.t('PaddingSMobile').number,
58
+ borderRadius: theme.t('RadiusPatchBig').number,
59
+ },
60
+ borderStyle(),
61
+ backgroundColor(),
62
+ wrapperStyle,
63
+ ], accessible: false, disabled: !onPress, onPress: onPress, ...(onPress
64
+ ? a11y({
65
+ accessibilityRole: 'button',
66
+ accessible: true,
67
+ ...accessibilityProps,
68
+ })
69
+ : {}), ...(testID && e2eID(testID + '-patch')) },
70
+ React.createElement(Header, { ...(testID && e2eID(testID + '-patch-label')), style: {
71
+ color: fontColor(),
72
+ lineHeight: theme.t('TextSizeLabelMMobile').number * 1.5,
73
+ } }, title),
74
+ iconName && onPress && type === 'promo' && (React.createElement(PxIcon, { ...(testID && e2eID(testID + '-patch-icon')), name: iconName, size: 'Xs', style: {
75
+ marginLeft: 5,
76
+ color: fontColor(),
77
+ } }))));
78
+ }
package/package.json CHANGED
@@ -1,40 +1,20 @@
1
1
  {
2
2
  "name": "@proximus/lavender-patch-native",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-beta.0",
4
4
  "description": "Lavender patch component",
5
5
  "license": "MIT",
6
- "main": "src/index.ts",
6
+ "main": "dist/index.js",
7
+ "files": [
8
+ "dist"
9
+ ],
7
10
  "type": "module",
8
- "scripts": {
9
- "clean": "rm -rf dist",
10
- "prepublish": "yarn clean && yarn build",
11
- "build": "npx tsc -p tsconfig.json"
12
- },
13
11
  "peerDependencies": {
14
- "@proximus/lavender-common-native": "workspace:*",
15
- "@proximus/lavender-icon-native": "workspace:*",
16
- "@proximus/lavender-styling-native": "workspace:*",
17
- "@proximus/lavender-texts-native": "workspace:*"
18
- },
19
- "devDependencies": {
20
- "@proximus/lavender-common-native": "0.1.0-alpha.4",
21
- "@proximus/lavender-icon-native": "0.1.0-alpha.4",
22
- "@proximus/lavender-styling-native": "0.1.0-alpha.3",
23
- "@proximus/lavender-texts-native": "0.1.0-alpha.4"
12
+ "@proximus/lavender-common-native": "*",
13
+ "@proximus/lavender-icon-native": "*",
14
+ "@proximus/lavender-styling-native": "*",
15
+ "@proximus/lavender-texts-native": "*"
24
16
  },
25
17
  "publishConfig": {
26
18
  "access": "public"
27
- },
28
- "lerna": {
29
- "command": {
30
- "publish": {
31
- "assets": [
32
- "dist",
33
- "src",
34
- "package.json"
35
- ]
36
- }
37
- }
38
- },
39
- "gitHead": "6e9252a716a08ededdfbfd6f5b1db70ab21e026e"
19
+ }
40
20
  }
package/CHANGELOG.md DELETED
@@ -1,45 +0,0 @@
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.4](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-patch-native@0.1.0-alpha.3...@proximus/lavender-patch-native@0.1.0-alpha.4) (2025-09-19)
7
-
8
- **Note:** Version bump only for package @proximus/lavender-patch-native
9
-
10
- # [0.1.0-alpha.3](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-patch-native@0.1.0-alpha.2...@proximus/lavender-patch-native@0.1.0-alpha.3) (2025-09-12)
11
-
12
- **Note:** Version bump only for package @proximus/lavender-patch-native
13
-
14
- # [0.1.0-alpha.2](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-patch-native@0.1.0-alpha.1...@proximus/lavender-patch-native@0.1.0-alpha.2) (2025-09-05)
15
-
16
- ### Features
17
-
18
- - **BCRI-4279213:** update token architecture and component styles ([#18](https://github.com/Pxs-Corporate/react-native-lavender/issues/18)) ([2fabf41](https://github.com/Pxs-Corporate/react-native-lavender/commit/2fabf416ce069e9756daa868c3012181db87e7f5))
19
-
20
- # [0.1.0-alpha.1](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-patch-native@0.1.0-alpha.0...@proximus/lavender-patch-native@0.1.0-alpha.1) (2025-08-13)
21
-
22
- ### Bug Fixes
23
-
24
- - **BCRI-4210372:** fix types field in modules ([68ac126](https://github.com/Pxs-Corporate/react-native-lavender/commit/68ac12657112473ae9e0e683076b1d9172be9ce6))
25
-
26
- # 0.1.0-alpha.0 (2025-08-13)
27
-
28
- ### Features
29
-
30
- - **BCRI-000000:** remove default E2E on DEV env build for all components ([a5d27bf](https://github.com/Pxs-Corporate/react-native-lavender/commit/a5d27bfaaebf5b75f3160f31c64b590b7bd00b93))
31
- - **BCRI-3651742:** patch module ([46bf85e](https://github.com/Pxs-Corporate/react-native-lavender/commit/46bf85e225088cd3d90ed84a7e54c070a421805e))
32
- - **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
33
- - **BCRI-4002610:** update package versions and add new dependencies for styling and icon handling ([bd36e12](https://github.com/Pxs-Corporate/react-native-lavender/commit/bd36e120c36fd33602f441ceed5f41f15f81f0ea))
34
- - **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
35
- - **BCRI-4210372:** fix bad version numbers ([bc6a8ba](https://github.com/Pxs-Corporate/react-native-lavender/commit/bc6a8ba48c15347442f2ac38dacae7ffba3d95eb))
36
-
37
- # (2025-08-13)
38
-
39
- ### Features
40
-
41
- - **BCRI-000000:** remove default E2E on DEV env build for all components ([a5d27bf](https://github.com/Pxs-Corporate/react-native-lavender/commit/a5d27bfaaebf5b75f3160f31c64b590b7bd00b93))
42
- - **BCRI-3651742:** patch module ([46bf85e](https://github.com/Pxs-Corporate/react-native-lavender/commit/46bf85e225088cd3d90ed84a7e54c070a421805e))
43
- - **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
44
- - **BCRI-4002610:** update package versions and add new dependencies for styling and icon handling ([bd36e12](https://github.com/Pxs-Corporate/react-native-lavender/commit/bd36e120c36fd33602f441ceed5f41f15f81f0ea))
45
- - **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
package/src/PxPatch.tsx DELETED
@@ -1,131 +0,0 @@
1
- import React from 'react';
2
- import {
3
- AccessibilityProps,
4
- StyleProp,
5
- TouchableOpacity,
6
- View,
7
- ViewStyle,
8
- } from 'react-native';
9
-
10
- import { a11y, e2eID } from '@proximus/lavender-common-native';
11
- import { Header } from '@proximus/lavender-texts-native';
12
- import { PxIcon } from '@proximus/lavender-icon-native';
13
- import { IconName } from '@proximus/lavender-icon/dist/iconNames.js';
14
- import { useTheme } from '@proximus/lavender-styling-native';
15
-
16
- export interface IPxPatchProps {
17
- title: string;
18
- testID?: string;
19
- iconName?: IconName;
20
- type: 'promo' | 'info' | 'blackfriday' | 'eco';
21
- borderType?: 'bottomLeft' | 'bottomRight';
22
- isFocused?: boolean;
23
- wrapperStyle?: StyleProp<ViewStyle>;
24
- onPress?: () => void;
25
- }
26
-
27
- export function PxPatch({
28
- title,
29
- testID,
30
- type,
31
- iconName,
32
- borderType,
33
- wrapperStyle,
34
- onPress,
35
- ...accessibilityProps
36
- }: IPxPatchProps & AccessibilityProps) {
37
- const { theme } = useTheme();
38
-
39
- const backgroundColor = () => {
40
- switch (type) {
41
- case 'promo':
42
- return {
43
- backgroundColor: theme.t('ColorBackgroundPurposePromoDefault'),
44
- };
45
- case 'info':
46
- return {
47
- backgroundColor: theme.t('ColorBackgroundPurposeInfoDefault'),
48
- };
49
- case 'blackfriday':
50
- return {
51
- backgroundColor: theme.t('ColorBackgroundSurfaceDark'),
52
- };
53
- case 'eco':
54
- return {
55
- backgroundColor: theme.t('ColorBackgroundPurposeEcoDefault'),
56
- };
57
- default:
58
- return undefined;
59
- }
60
- };
61
- const borderStyle = () => {
62
- if (borderType === 'bottomLeft') {
63
- return {
64
- borderBottomLeftRadius: 0,
65
- };
66
- }
67
- if (borderType === 'bottomRight') {
68
- return {
69
- borderBottomRightRadius: 0,
70
- };
71
- }
72
- return undefined;
73
- };
74
-
75
- const fontColor = () => {
76
- if (type !== 'info') {
77
- return theme.t('ColorTextNeutralInverted');
78
- }
79
- return theme.t('ColorTextNeutralInverted');
80
- };
81
-
82
- const Wrapper = (onPress ? TouchableOpacity : View) as React.ElementType;
83
-
84
- return (
85
- <Wrapper
86
- style={[
87
- {
88
- alignItems: 'center',
89
- flexDirection: 'row',
90
- height: 26,
91
- fontSize: theme.t('TextSizeLabelMMobile').number,
92
- paddingHorizontal: theme.t('PaddingSMobile').number,
93
- borderRadius: theme.t('RadiusPatchBig').number,
94
- },
95
- borderStyle(),
96
- backgroundColor(),
97
- wrapperStyle,
98
- ]}
99
- accessible={false}
100
- disabled={!onPress}
101
- onPress={onPress}
102
- {...(onPress
103
- ? a11y({
104
- accessibilityRole: 'button',
105
- accessible: true,
106
- ...accessibilityProps,
107
- })
108
- : {})}
109
- {...e2eID(testID + '-PxPatch')}
110
- >
111
- <Header
112
- style={{
113
- color: fontColor(),
114
- lineHeight: theme.t('TextSizeLabelMMobile').number * 1.5,
115
- }}
116
- >
117
- {title}
118
- </Header>
119
- {iconName && onPress && type === 'promo' && (
120
- <PxIcon
121
- name={iconName}
122
- size={16}
123
- style={{
124
- marginLeft: 5,
125
- color: fontColor(),
126
- }}
127
- />
128
- )}
129
- </Wrapper>
130
- );
131
- }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.npm.json",
3
- "compilerOptions": {
4
- "outDir": "dist",
5
- },
6
- "include": ["src","../../../lib.d.ts"],
7
- "exclude": ["dist", "node_modules", "src/**/*.test.ts", "src/**/*.spec.ts"]
8
- }
File without changes