@proximus/lavender-buttonicon-native 0.1.0-alpha.6 → 1.1.0-alpha.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":"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"}
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;AAyBD,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,qBA+ClB"}
@@ -23,24 +23,9 @@ function getBackgroundColor({ variant, inverted }, theme) {
23
23
  return 'transparent';
24
24
  }
25
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
26
  export function PxButtonIcon({ variant = 'primary', iconName, wrapperStyle, onPress, disabled, testID, accessibilityLabel, accessibilityHint, inverted, size = 'default', }) {
41
27
  const { theme } = useTheme();
42
28
  const backgroundColor = getBackgroundColor({ variant, inverted }, theme);
43
- const color = getColor({ variant, inverted }, theme);
44
29
  return (React.createElement(TouchableOpacity, { ...e2eID(testID), onPress: onPress, focusable: true, disabled: disabled, ...a11y({
45
30
  accessibilityRole: 'button',
46
31
  accessible: true,
@@ -64,9 +49,7 @@ export function PxButtonIcon({ variant = 'primary', iconName, wrapperStyle, onPr
64
49
  alignItems: 'center',
65
50
  justifyContent: 'center',
66
51
  } },
67
- React.createElement(PxIcon, { name: iconName, size: size === 'small'
68
- ? theme?.t('SizeIconXs')?.number
69
- : theme?.t('SizeIconS')?.number, color: color }))));
52
+ React.createElement(PxIcon, { inverted: variant === 'primary' ? !inverted : inverted, name: iconName, size: size === 'small' ? 'Xs' : 'S', color: 'Brand' }))));
70
53
  }
71
54
  const styles = StyleSheet.create({
72
55
  container: {
package/package.json CHANGED
@@ -1,46 +1,19 @@
1
1
  {
2
2
  "name": "@proximus/lavender-buttonicon-native",
3
- "version": "0.1.0-alpha.6",
3
+ "version": "1.1.0-alpha.0",
4
4
  "description": "Button icon component",
5
5
  "license": "MIT",
6
- "main": "src/index.ts",
7
- "scripts": {
8
- "clean": "rm -rf dist",
9
- "transform-package-json": "node ../../../scripts/tranformPackageJson.js package.json dist/far/away",
10
- "prepublish": "yarn clean && yarn transform-package-json && yarn build",
11
- "build": "npx tsc -p tsconfig.json"
12
- },
6
+ "main": "dist/index.js",
7
+ "files": [
8
+ "dist"
9
+ ],
13
10
  "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.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"
11
+ "@proximus/lavender-common-native": "*",
12
+ "@proximus/lavender-icon-native": "*",
13
+ "@proximus/lavender-styling-native": "*",
14
+ "@proximus/lavender-texts-native": "*"
24
15
  },
25
16
  "publishConfig": {
26
17
  "access": "public"
27
- },
28
- "lerna": {
29
- "command": {
30
- "publish": {
31
- "assets": [
32
- {
33
- "from": "dist/far/away/package.json",
34
- "to": "."
35
- },
36
- "dist/*.js",
37
- "dist/*.d.ts",
38
- "dist/*.d.ts.map",
39
- "src",
40
- "package.json"
41
- ]
42
- }
43
- }
44
- },
45
- "gitHead": "e50a17526561b3eafb159e36c737173956093e0d"
18
+ }
46
19
  }
package/CHANGELOG.md DELETED
@@ -1,46 +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.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
-
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)
23
-
24
- **Note:** Version bump only for package @proximus/lavender-buttonicon-native
25
-
26
- # [0.1.0-alpha.2](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-buttonicon-native@0.1.0-alpha.1...@proximus/lavender-buttonicon-native@0.1.0-alpha.2) (2025-09-05)
27
-
28
- ### Features
29
-
30
- - **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))
31
-
32
- # [0.1.0-alpha.1](https://github.com/Pxs-Corporate/react-native-lavender/compare/@proximus/lavender-buttonicon-native@0.1.0-alpha.0...@proximus/lavender-buttonicon-native@0.1.0-alpha.1) (2025-08-13)
33
-
34
- ### Bug Fixes
35
-
36
- - **BCRI-4210372:** fix types field in modules ([68ac126](https://github.com/Pxs-Corporate/react-native-lavender/commit/68ac12657112473ae9e0e683076b1d9172be9ce6))
37
-
38
- # 0.1.0-alpha.0 (2025-08-13)
39
-
40
- ### Features
41
-
42
- - **BCRI-000000:** remove default E2E on DEV env build for all components ([a5d27bf](https://github.com/Pxs-Corporate/react-native-lavender/commit/a5d27bfaaebf5b75f3160f31c64b590b7bd00b93))
43
- - **BCRI-3619796:** top navigation bar ([0b2bcae](https://github.com/Pxs-Corporate/react-native-lavender/commit/0b2bcaee7243b9f00f88e2b2fb97d86cf0cf5b77))
44
- - **BCRI-3749589:** button icon component ([62cfd94](https://github.com/Pxs-Corporate/react-native-lavender/commit/62cfd945420c26cf6da6dfb802cc998c613e9687))
45
- - **BCRI-4002610:** update icon handling and remove deprecated font references ([4399fe4](https://github.com/Pxs-Corporate/react-native-lavender/commit/4399fe4bff06aa70f5c29705fcc89d5243b0e3e7))
46
- - **BCRI-4210372:** automatic versionning ([9c1f0a0](https://github.com/Pxs-Corporate/react-native-lavender/commit/9c1f0a00e19a9d1a277044ea627632032a674102))
@@ -1,34 +0,0 @@
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
- }
@@ -1,137 +0,0 @@
1
- import {
2
- AccessibilityProps,
3
- StyleProp,
4
- StyleSheet,
5
- TouchableOpacity,
6
- View,
7
- ViewStyle,
8
- } from 'react-native';
9
- import { a11y, e2eID } from '@proximus/lavender-common-native';
10
- import { PxIcon } from '@proximus/lavender-icon-native';
11
- import React from 'react';
12
- import type { IconName } from '@proximus/lavender-icon/dist/iconNames.js';
13
- import { ITheme, useTheme } from '@proximus/lavender-styling-native';
14
-
15
- export interface IButtonIconProps extends AccessibilityProps {
16
- iconName: IconName;
17
- variant: 'primary' | 'secondary' | 'naked';
18
- wrapperStyle?: StyleProp<ViewStyle>;
19
- onPress?: () => void;
20
- disabled?: boolean;
21
- inverted?: boolean;
22
- size?: 'small' | 'default';
23
- testID?: string;
24
- }
25
-
26
- function getBackgroundColor(
27
- { variant, inverted }: Partial<IButtonIconProps>,
28
- theme: ITheme
29
- ) {
30
- if (!inverted) {
31
- if (variant === 'primary') {
32
- return theme.t('ColorBackgroundContainerPrimaryDefault');
33
- }
34
- if (variant === 'secondary') {
35
- return theme.t('ColorBackgroundContainerSecondaryDefault');
36
- }
37
- return 'transparent';
38
- } else {
39
- if (variant === 'primary') {
40
- return theme.t('ColorBackgroundContainerPrimaryInverted');
41
- }
42
- if (variant === 'secondary') {
43
- return theme.t('ColorBackgroundContainerSecondaryInverted');
44
- }
45
- return 'transparent';
46
- }
47
- }
48
-
49
- function getColor(
50
- { variant, inverted }: Partial<IButtonIconProps>,
51
- theme: ITheme
52
- ) {
53
- if (!inverted) {
54
- if (variant === 'primary') {
55
- return theme.t('ColorTextBrandInverted');
56
- }
57
- return theme.t('ColorTextBrandDefault');
58
- } else {
59
- if (variant === 'primary') {
60
- return theme.t('ColorTextBrandDefault');
61
- }
62
- return theme.t('ColorTextBrandInverted');
63
- }
64
- }
65
-
66
- export function PxButtonIcon({
67
- variant = 'primary',
68
- iconName,
69
- wrapperStyle,
70
- onPress,
71
- disabled,
72
- testID,
73
- accessibilityLabel,
74
- accessibilityHint,
75
- inverted,
76
- size = 'default',
77
- }: IButtonIconProps) {
78
- const { theme } = useTheme();
79
- const backgroundColor = getBackgroundColor({ variant, inverted }, theme);
80
- const color = getColor({ variant, inverted }, theme);
81
-
82
- return (
83
- <TouchableOpacity
84
- {...e2eID(testID)}
85
- onPress={onPress}
86
- focusable={true}
87
- disabled={disabled}
88
- {...a11y({
89
- accessibilityRole: 'button',
90
- accessible: true,
91
- accessibilityState: {
92
- disabled,
93
- },
94
- accessibilityLabel,
95
- accessibilityHint,
96
- })}
97
- style={[
98
- styles.container,
99
- { backgroundColor, borderRadius: theme?.t('RadiusPill')?.number },
100
- wrapperStyle,
101
- ]}
102
- >
103
- <View
104
- style={{
105
- height:
106
- size === 'small'
107
- ? // @ts-ignore
108
- theme?.t(`SizeM`)?.number
109
- : // @ts-ignore
110
- theme?.t(`SizeL`)?.number,
111
- aspectRatio: 1,
112
- alignItems: 'center',
113
- justifyContent: 'center',
114
- }}
115
- >
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
- />
125
- </View>
126
- </TouchableOpacity>
127
- );
128
- }
129
-
130
- const styles = StyleSheet.create({
131
- container: {
132
- flexDirection: 'column',
133
- flex: 0,
134
- alignItems: 'center',
135
- justifyContent: 'center',
136
- },
137
- });
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './PxButtonIcon';
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/**/*.spec.tsx", "src/**/*.spec.ts"]
8
- }