@proximus/lavender-buttonicon-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,22 @@
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
+
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)
17
+
18
+ ### Features
19
+
20
+ - **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))
21
+
6
22
  # [0.1.0-alpha.3](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-buttonicon-native@0.1.0-alpha.2...@proximus/lavender-buttonicon-native@0.1.0-alpha.3) (2025-09-12)
7
23
 
8
24
  **Note:** Version bump only for package @proximus/lavender-buttonicon-native
@@ -8,7 +8,8 @@ export interface IButtonIconProps extends AccessibilityProps {
8
8
  onPress?: () => void;
9
9
  disabled?: boolean;
10
10
  inverted?: boolean;
11
+ size?: 'small' | 'default';
11
12
  testID?: string;
12
13
  }
13
- export declare function PxButtonIcon({ variant, iconName, wrapperStyle, onPress, disabled, testID, accessibilityLabel, accessibilityHint, inverted, }: IButtonIconProps): React.JSX.Element;
14
+ export declare function PxButtonIcon({ variant, iconName, wrapperStyle, onPress, disabled, testID, accessibilityLabel, accessibilityHint, inverted, size, }: IButtonIconProps): React.JSX.Element;
14
15
  //# sourceMappingURL=PxButtonIcon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PxButtonIcon.d.ts","sourceRoot":"","sources":["../src/PxButtonIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,SAAS,EAIT,SAAS,EACV,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAG1E,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IAC3C,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA0CD,wBAAgB,YAAY,CAAC,EAC3B,OAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,MAAM,EACN,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,GACT,EAAE,gBAAgB,qBAkClB"}
1
+ {"version":3,"file":"PxButtonIcon.d.ts","sourceRoot":"","sources":["../src/PxButtonIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,SAAS,EAIT,SAAS,EACV,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAG1E,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IAC3C,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA0CD,wBAAgB,YAAY,CAAC,EAC3B,OAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,MAAM,EACN,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,IAAgB,GACjB,EAAE,gBAAgB,qBAmDlB"}
@@ -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.3",
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.3",
20
- "@proximus/lavender-icon-native": "0.1.0-alpha.3",
21
- "@proximus/lavender-styling-native": "0.1.0-alpha.2",
22
- "@proximus/lavender-texts-native": "0.1.0-alpha.3"
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": "6328f584529cb675f4a2ede8ad89f31e2b3c9ffb"
45
+ "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
39
46
  }
@@ -19,6 +19,7 @@ export interface IButtonIconProps extends AccessibilityProps {
19
19
  onPress?: () => void;
20
20
  disabled?: boolean;
21
21
  inverted?: boolean;
22
+ size?: 'small' | 'default';
22
23
  testID?: string;
23
24
  }
24
25
 
@@ -72,6 +73,7 @@ export function PxButtonIcon({
72
73
  accessibilityLabel,
73
74
  accessibilityHint,
74
75
  inverted,
76
+ size = 'default',
75
77
  }: IButtonIconProps) {
76
78
  const { theme } = useTheme();
77
79
  const backgroundColor = getBackgroundColor({ variant, inverted }, theme);
@@ -92,17 +94,34 @@ export function PxButtonIcon({
92
94
  accessibilityLabel,
93
95
  accessibilityHint,
94
96
  })}
95
- style={[styles.container, { backgroundColor }, wrapperStyle]}
97
+ style={[
98
+ styles.container,
99
+ { backgroundColor, borderRadius: theme?.t('RadiusPill')?.number },
100
+ wrapperStyle,
101
+ ]}
96
102
  >
97
103
  <View
98
104
  style={{
99
- height: 24,
100
- width: 24,
105
+ height:
106
+ size === 'small'
107
+ ? // @ts-ignore
108
+ theme?.t(`SizeM`)?.number
109
+ : // @ts-ignore
110
+ theme?.t(`SizeL`)?.number,
111
+ aspectRatio: 1,
101
112
  alignItems: 'center',
102
113
  justifyContent: 'center',
103
114
  }}
104
115
  >
105
- <PxIcon name={iconName} size={22} color={color} />
116
+ <PxIcon
117
+ name={iconName}
118
+ size={
119
+ size === 'small'
120
+ ? theme?.t('SizeIconXs')?.number
121
+ : theme?.t('SizeIconS')?.number
122
+ }
123
+ color={color}
124
+ />
106
125
  </View>
107
126
  </TouchableOpacity>
108
127
  );
@@ -111,9 +130,7 @@ export function PxButtonIcon({
111
130
  const styles = StyleSheet.create({
112
131
  container: {
113
132
  flexDirection: 'column',
114
- padding: 8,
115
133
  flex: 0,
116
- borderRadius: 20,
117
134
  alignItems: 'center',
118
135
  justifyContent: 'center',
119
136
  },
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
  }