@proximus/lavender-buttonicon-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-buttonicon-native@0.1.0-alpha.5...@proximus/lavender-buttonicon-native@0.1.0-alpha.6) (2025-09-26)
7
+
8
+ **Note:** Version bump only for package @proximus/lavender-buttonicon-native
9
+
10
+ # [0.1.0-alpha.5](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-buttonicon-native@0.1.0-alpha.4...@proximus/lavender-buttonicon-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-buttonicon-native@0.1.0-alpha.3...@proximus/lavender-buttonicon-native@0.1.0-alpha.4) (2025-09-19)
7
17
 
8
18
  ### Features
@@ -0,0 +1,78 @@
1
+ import { StyleSheet, TouchableOpacity, View, } from 'react-native';
2
+ import { a11y, e2eID } from '@proximus/lavender-common-native';
3
+ import { PxIcon } from '@proximus/lavender-icon-native';
4
+ import React from 'react';
5
+ import { useTheme } from '@proximus/lavender-styling-native';
6
+ function getBackgroundColor({ variant, inverted }, theme) {
7
+ if (!inverted) {
8
+ if (variant === 'primary') {
9
+ return theme.t('ColorBackgroundContainerPrimaryDefault');
10
+ }
11
+ if (variant === 'secondary') {
12
+ return theme.t('ColorBackgroundContainerSecondaryDefault');
13
+ }
14
+ return 'transparent';
15
+ }
16
+ else {
17
+ if (variant === 'primary') {
18
+ return theme.t('ColorBackgroundContainerPrimaryInverted');
19
+ }
20
+ if (variant === 'secondary') {
21
+ return theme.t('ColorBackgroundContainerSecondaryInverted');
22
+ }
23
+ return 'transparent';
24
+ }
25
+ }
26
+ function getColor({ variant, inverted }, theme) {
27
+ if (!inverted) {
28
+ if (variant === 'primary') {
29
+ return theme.t('ColorTextBrandInverted');
30
+ }
31
+ return theme.t('ColorTextBrandDefault');
32
+ }
33
+ else {
34
+ if (variant === 'primary') {
35
+ return theme.t('ColorTextBrandDefault');
36
+ }
37
+ return theme.t('ColorTextBrandInverted');
38
+ }
39
+ }
40
+ export function PxButtonIcon({ variant = 'primary', iconName, wrapperStyle, onPress, disabled, testID, accessibilityLabel, accessibilityHint, inverted, size = 'default', }) {
41
+ const { theme } = useTheme();
42
+ const backgroundColor = getBackgroundColor({ variant, inverted }, theme);
43
+ const color = getColor({ variant, inverted }, theme);
44
+ return (React.createElement(TouchableOpacity, { ...e2eID(testID), onPress: onPress, focusable: true, disabled: disabled, ...a11y({
45
+ accessibilityRole: 'button',
46
+ accessible: true,
47
+ accessibilityState: {
48
+ disabled,
49
+ },
50
+ accessibilityLabel,
51
+ accessibilityHint,
52
+ }), style: [
53
+ styles.container,
54
+ { backgroundColor, borderRadius: theme?.t('RadiusPill')?.number },
55
+ wrapperStyle,
56
+ ] },
57
+ React.createElement(View, { style: {
58
+ height: size === 'small'
59
+ ? // @ts-ignore
60
+ theme?.t(`SizeM`)?.number
61
+ : // @ts-ignore
62
+ theme?.t(`SizeL`)?.number,
63
+ aspectRatio: 1,
64
+ alignItems: 'center',
65
+ justifyContent: 'center',
66
+ } },
67
+ React.createElement(PxIcon, { name: iconName, size: size === 'small'
68
+ ? theme?.t('SizeIconXs')?.number
69
+ : theme?.t('SizeIconS')?.number, color: color }))));
70
+ }
71
+ const styles = StyleSheet.create({
72
+ container: {
73
+ flexDirection: 'column',
74
+ flex: 0,
75
+ alignItems: 'center',
76
+ justifyContent: 'center',
77
+ },
78
+ });
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@proximus/lavender-buttonicon-native",
3
+ "version": "0.1.0-alpha.6",
4
+ "description": "Button icon component",
5
+ "license": "MIT",
6
+ "main": "dist/index.js",
7
+ "peerDependencies": {
8
+ "@proximus/lavender-common-native": "*",
9
+ "@proximus/lavender-icon-native": "*",
10
+ "@proximus/lavender-styling-native": "*",
11
+ "@proximus/lavender-texts-native": "*"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "lerna": {
17
+ "command": {
18
+ "publish": {
19
+ "assets": [
20
+ {
21
+ "from": "dist/far/away/package.json",
22
+ "to": "."
23
+ },
24
+ "dist/*.js",
25
+ "dist/*.d.ts",
26
+ "dist/*.d.ts.map",
27
+ "src",
28
+ "package.json"
29
+ ]
30
+ }
31
+ }
32
+ },
33
+ "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
34
+ }
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './PxButtonIcon';
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@proximus/lavender-buttonicon-native",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.6",
4
4
  "description": "Button icon component",
5
5
  "license": "MIT",
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
  "peerDependencies": {
@@ -16,10 +17,10 @@
16
17
  "@proximus/lavender-texts-native": "workspace:*"
17
18
  },
18
19
  "devDependencies": {
19
- "@proximus/lavender-common-native": "0.1.0-alpha.4",
20
- "@proximus/lavender-icon-native": "0.1.0-alpha.4",
21
- "@proximus/lavender-styling-native": "0.1.0-alpha.3",
22
- "@proximus/lavender-texts-native": "0.1.0-alpha.4"
20
+ "@proximus/lavender-common-native": "0.1.0-alpha.6",
21
+ "@proximus/lavender-icon-native": "0.1.0-alpha.6",
22
+ "@proximus/lavender-styling-native": "0.1.0-alpha.5",
23
+ "@proximus/lavender-texts-native": "0.1.0-alpha.6"
23
24
  },
24
25
  "publishConfig": {
25
26
  "access": "public"
@@ -28,12 +29,18 @@
28
29
  "command": {
29
30
  "publish": {
30
31
  "assets": [
31
- "dist",
32
+ {
33
+ "from": "dist/far/away/package.json",
34
+ "to": "."
35
+ },
36
+ "dist/*.js",
37
+ "dist/*.d.ts",
38
+ "dist/*.d.ts.map",
32
39
  "src",
33
40
  "package.json"
34
41
  ]
35
42
  }
36
43
  }
37
44
  },
38
- "gitHead": "6e9252a716a08ededdfbfd6f5b1db70ab21e026e"
45
+ "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
39
46
  }
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
  }