@proximus/lavender-common-native 0.1.0-alpha.3 → 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,24 @@
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-common-native@0.1.0-alpha.5...@proximus/lavender-common-native@0.1.0-alpha.6) (2025-09-26)
7
+
8
+ ### Features
9
+
10
+ - **BCRI-42375821:** publisg js bundle output on npm ([#28](https://github.com/Pxs-Corporate/react-native-lavender/issues/28)) ([892ae60](https://github.com/Pxs-Corporate/react-native-lavender/commit/892ae600d6c00996c70028236f25afd0367402aa))
11
+
12
+ # [0.1.0-alpha.5](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-common-native@0.1.0-alpha.4...@proximus/lavender-common-native@0.1.0-alpha.5) (2025-09-25)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **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))
17
+
18
+ # [0.1.0-alpha.4](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-common-native@0.1.0-alpha.3...@proximus/lavender-common-native@0.1.0-alpha.4) (2025-09-19)
19
+
20
+ ### Features
21
+
22
+ - **BCRI-4249550:** message card + tag components ([#22](https://github.com/Pxs-Corporate/react-native-lavender/issues/22)) ([39fb91c](https://github.com/Pxs-Corporate/react-native-lavender/commit/39fb91cc294a37d07e63fca2b4e993d90b867082))
23
+
6
24
  # [0.1.0-alpha.3](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-common-native@0.1.0-alpha.2...@proximus/lavender-common-native@0.1.0-alpha.3) (2025-09-12)
7
25
 
8
26
  ### Features
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { StyleSheet, View, } from 'react-native';
3
+ import { a11y, e2eID } from './utils';
4
+ import { useTheme } from '@proximus/lavender-styling-native';
5
+ export function PxContainer(props) {
6
+ const { theme } = useTheme();
7
+ const { children, wrapperStyle, testId, wrapperA11yProps, ...viewProps } = props;
8
+ return (React.createElement(View, { style: [
9
+ styles.container,
10
+ {
11
+ backgroundColor: theme.t('ColorBackgroundContainerLightDefault'),
12
+ },
13
+ wrapperStyle,
14
+ ], ...e2eID(testId), ...a11y({
15
+ ...wrapperA11yProps,
16
+ }), ...viewProps }, children));
17
+ }
18
+ const styles = StyleSheet.create({
19
+ container: {
20
+ borderRadius: 8,
21
+ },
22
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare function PxSpacer(): React.JSX.Element;
3
+ //# sourceMappingURL=Spacer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spacer.d.ts","sourceRoot":"","sources":["../src/Spacer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,QAAQ,sBAEvB"}
package/dist/Spacer.js ADDED
@@ -0,0 +1,5 @@
1
+ import { View } from 'react-native';
2
+ import React from 'react';
3
+ export function PxSpacer() {
4
+ return React.createElement(View, { style: { flex: 1 } });
5
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "type": "module",
3
+ "name": "@proximus/lavender-common-native",
4
+ "version": "0.1.0-alpha.6",
5
+ "description": "Common components for Proximus design system",
6
+ "main": "dist/index.js",
7
+ "license": "MIT",
8
+ "peerDependencies": {
9
+ "@proximus/lavender-styling-native": "*"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "lerna": {
15
+ "command": {
16
+ "publish": {
17
+ "assets": [
18
+ {
19
+ "from": "dist/far/away/package.json",
20
+ "to": "."
21
+ },
22
+ "dist/*.js",
23
+ "dist/*.d.ts",
24
+ "dist/*.d.ts.map",
25
+ "src",
26
+ "package.json"
27
+ ]
28
+ }
29
+ }
30
+ },
31
+ "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
32
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './utils';
2
2
  export * from './PxContainer';
3
+ export * from './Spacer';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './utils';
2
+ export * from './PxContainer';
3
+ export * from './Spacer';
package/dist/utils.js ADDED
@@ -0,0 +1,58 @@
1
+ import { Image, Platform, } from 'react-native';
2
+ import Config from 'react-native-config';
3
+ import { LaunchArguments } from 'react-native-launch-arguments';
4
+ import { useEffect, useState } from 'react';
5
+ export function e2eID(id) {
6
+ const { e2e } = LaunchArguments.value();
7
+ if (('E2E' === Config.ENV || e2e) && id) {
8
+ if (Platform.OS === 'android') {
9
+ return {
10
+ accessibilityLabel: id,
11
+ accessible: true,
12
+ };
13
+ }
14
+ return {
15
+ testID: id,
16
+ };
17
+ }
18
+ return {};
19
+ }
20
+ export function a11y(a11yProps) {
21
+ const { e2e } = LaunchArguments.value();
22
+ if ('E2E' !== Config.ENV && !e2e) {
23
+ return {
24
+ ...a11yProps,
25
+ };
26
+ }
27
+ return {};
28
+ }
29
+ export function useImageAspectRatio(src) {
30
+ const [aspectRatio, setAspectRatio] = useState();
31
+ useEffect(() => {
32
+ if (!src)
33
+ return;
34
+ // 1) Try to resolve local assets (and also normalizes URIs)
35
+ const resolved = Image.resolveAssetSource(src);
36
+ // If RN knows width/height already (static asset), use them
37
+ if (resolved?.width && resolved?.height) {
38
+ setAspectRatio(resolved.width / resolved.height);
39
+ return;
40
+ }
41
+ // 2) Fall back to getSize for URIs (network, file://, content://)
42
+ const uri = typeof src === 'string'
43
+ ? src
44
+ : (resolved?.uri ??
45
+ (typeof src?.uri === 'string'
46
+ ? src.uri
47
+ : undefined));
48
+ if (uri) {
49
+ Image.getSize(uri, (width, height) => {
50
+ setAspectRatio(width / height);
51
+ }, (err) => console.warn('getSize failed:', err));
52
+ }
53
+ else {
54
+ console.warn('Could not resolve image source for size:', src);
55
+ }
56
+ }, [src]);
57
+ return aspectRatio;
58
+ }
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@proximus/lavender-common-native",
4
- "version": "0.1.0-alpha.3",
4
+ "version": "0.1.0-alpha.6",
5
5
  "description": "Common components for Proximus design system",
6
6
  "main": "src/index.ts",
7
7
  "scripts": {
8
8
  "clean": "rm -rf dist",
9
- "prepublish": "yarn clean && yarn build",
9
+ "transform-package-json": "node ../../../scripts/tranformPackageJson.js package.json dist/far/away",
10
+ "prepublish": "yarn clean && yarn transform-package-json && yarn build",
10
11
  "build": "npx tsc -p tsconfig.json"
11
12
  },
12
13
  "license": "MIT",
13
14
  "devDependencies": {
14
- "@proximus/lavender-styling-native": "0.1.0-alpha.2"
15
+ "@proximus/lavender-styling-native": "0.1.0-alpha.5"
15
16
  },
16
17
  "peerDependencies": {
17
18
  "@proximus/lavender-styling-native": "*"
@@ -23,12 +24,18 @@
23
24
  "command": {
24
25
  "publish": {
25
26
  "assets": [
26
- "dist",
27
+ {
28
+ "from": "dist/far/away/package.json",
29
+ "to": "."
30
+ },
31
+ "dist/*.js",
32
+ "dist/*.d.ts",
33
+ "dist/*.d.ts.map",
27
34
  "src",
28
35
  "package.json"
29
36
  ]
30
37
  }
31
38
  }
32
39
  },
33
- "gitHead": "6328f584529cb675f4a2ede8ad89f31e2b3c9ffb"
40
+ "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
34
41
  }
package/src/Spacer.tsx ADDED
@@ -0,0 +1,6 @@
1
+ import { View } from 'react-native';
2
+ import React from 'react';
3
+
4
+ export function PxSpacer() {
5
+ return <View style={{ flex: 1 }}></View>;
6
+ }
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './utils';
2
2
  export * from './PxContainer';
3
+ export * from './Spacer';
package/tsconfig.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "extends": "../../tsconfig.npm.json",
2
+ "extends": "../../../tsconfig.npm.json",
3
3
  "compilerOptions": {
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
  }