@proximus/lavender-patch-native 0.1.0-alpha.4 → 0.1.0-alpha.6

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 CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.1.0-alpha.6](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-patch-native@0.1.0-alpha.5...@proximus/lavender-patch-native@0.1.0-alpha.6) (2025-09-26)
7
+
8
+ **Note:** Version bump only for package @proximus/lavender-patch-native
9
+
10
+ # [0.1.0-alpha.5](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-patch-native@0.1.0-alpha.4...@proximus/lavender-patch-native@0.1.0-alpha.5) (2025-09-25)
11
+
12
+ ### Bug Fixes
13
+
14
+ - **BCRI-000000:** no free space on gh runner during build ([#27](https://github.com/Pxs-Corporate/react-native-lavender/issues/27)) ([a7c8604](https://github.com/Pxs-Corporate/react-native-lavender/commit/a7c86043b5cefcb10fd768d449c5718fbabe87ec))
15
+
6
16
  # [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
17
 
8
18
  **Note:** Version bump only for package @proximus/lavender-patch-native
@@ -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
+ : {}), ...e2eID(testID + '-PxPatch') },
70
+ React.createElement(Header, { style: {
71
+ color: fontColor(),
72
+ lineHeight: theme.t('TextSizeLabelMMobile').number * 1.5,
73
+ } }, title),
74
+ iconName && onPress && type === 'promo' && (React.createElement(PxIcon, { name: iconName, size: 16, style: {
75
+ marginLeft: 5,
76
+ color: fontColor(),
77
+ } }))));
78
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@proximus/lavender-patch-native",
3
+ "version": "0.1.0-alpha.6",
4
+ "description": "Lavender patch component",
5
+ "license": "MIT",
6
+ "main": "dist/index.js",
7
+ "type": "module",
8
+ "peerDependencies": {
9
+ "@proximus/lavender-common-native": "*",
10
+ "@proximus/lavender-icon-native": "*",
11
+ "@proximus/lavender-styling-native": "*",
12
+ "@proximus/lavender-texts-native": "*"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "lerna": {
18
+ "command": {
19
+ "publish": {
20
+ "assets": [
21
+ {
22
+ "from": "dist/far/away/package.json",
23
+ "to": "."
24
+ },
25
+ "dist/*.js",
26
+ "dist/*.d.ts",
27
+ "dist/*.d.ts.map",
28
+ "src",
29
+ "package.json"
30
+ ]
31
+ }
32
+ }
33
+ },
34
+ "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
35
+ }
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './PxPatch';
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@proximus/lavender-patch-native",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.6",
4
4
  "description": "Lavender patch component",
5
5
  "license": "MIT",
6
6
  "main": "src/index.ts",
7
7
  "type": "module",
8
8
  "scripts": {
9
9
  "clean": "rm -rf dist",
10
- "prepublish": "yarn clean && yarn build",
10
+ "transform-package-json": "node ../../../scripts/tranformPackageJson.js package.json dist/far/away",
11
+ "prepublish": "yarn clean && yarn transform-package-json && yarn build",
11
12
  "build": "npx tsc -p tsconfig.json"
12
13
  },
13
14
  "peerDependencies": {
@@ -17,10 +18,10 @@
17
18
  "@proximus/lavender-texts-native": "workspace:*"
18
19
  },
19
20
  "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"
21
+ "@proximus/lavender-common-native": "0.1.0-alpha.6",
22
+ "@proximus/lavender-icon-native": "0.1.0-alpha.6",
23
+ "@proximus/lavender-styling-native": "0.1.0-alpha.5",
24
+ "@proximus/lavender-texts-native": "0.1.0-alpha.6"
24
25
  },
25
26
  "publishConfig": {
26
27
  "access": "public"
@@ -29,12 +30,18 @@
29
30
  "command": {
30
31
  "publish": {
31
32
  "assets": [
32
- "dist",
33
+ {
34
+ "from": "dist/far/away/package.json",
35
+ "to": "."
36
+ },
37
+ "dist/*.js",
38
+ "dist/*.d.ts",
39
+ "dist/*.d.ts.map",
33
40
  "src",
34
41
  "package.json"
35
42
  ]
36
43
  }
37
44
  }
38
45
  },
39
- "gitHead": "6e9252a716a08ededdfbfd6f5b1db70ab21e026e"
46
+ "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
40
47
  }
package/tsconfig.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "outDir": "dist",
5
5
  },
6
6
  "include": ["src","../../../lib.d.ts"],
7
- "exclude": ["dist", "node_modules", "src/**/*.test.ts", "src/**/*.spec.ts"]
7
+ "exclude": ["dist", "node_modules", "src/**/*.spec.tsx", "src/**/*.spec.ts"]
8
8
  }