@proximus/lavender-buttonicon-native 0.1.0-alpha.1 → 0.1.0-alpha.3
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 +10 -0
- package/dist/PxButtonIcon.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/PxButtonIcon.tsx +20 -16
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.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
|
+
|
|
8
|
+
**Note:** Version bump only for package @proximus/lavender-buttonicon-native
|
|
9
|
+
|
|
10
|
+
# [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)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **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))
|
|
15
|
+
|
|
6
16
|
# [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)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
|
@@ -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;
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-buttonicon-native",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.3",
|
|
4
4
|
"description": "Button icon component",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"@proximus/lavender-texts-native": "workspace:*"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@proximus/lavender-common-native": "0.1.0-alpha.
|
|
20
|
-
"@proximus/lavender-icon-native": "0.1.0-alpha.
|
|
21
|
-
"@proximus/lavender-styling-native": "0.1.0-alpha.
|
|
22
|
-
"@proximus/lavender-texts-native": "0.1.0-alpha.
|
|
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"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "6328f584529cb675f4a2ede8ad89f31e2b3c9ffb"
|
|
39
39
|
}
|
package/src/PxButtonIcon.tsx
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
import { a11y, e2eID } from '@proximus/lavender-common-native';
|
|
10
10
|
import { PxIcon } from '@proximus/lavender-icon-native';
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import { Colors } from '@proximus/lavender-styling-native';
|
|
13
12
|
import type { IconName } from '@proximus/lavender-icon/dist/iconNames.js';
|
|
13
|
+
import { ITheme, useTheme } from '@proximus/lavender-styling-native';
|
|
14
14
|
|
|
15
15
|
export interface IButtonIconProps extends AccessibilityProps {
|
|
16
16
|
iconName: IconName;
|
|
@@ -22,40 +22,43 @@ export interface IButtonIconProps extends AccessibilityProps {
|
|
|
22
22
|
testID?: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function getBackgroundColor(
|
|
25
|
+
function getBackgroundColor(
|
|
26
|
+
{ variant, inverted }: Partial<IButtonIconProps>,
|
|
27
|
+
theme: ITheme
|
|
28
|
+
) {
|
|
26
29
|
if (!inverted) {
|
|
27
30
|
if (variant === 'primary') {
|
|
28
|
-
return
|
|
31
|
+
return theme.t('ColorBackgroundContainerPrimaryDefault');
|
|
29
32
|
}
|
|
30
33
|
if (variant === 'secondary') {
|
|
31
|
-
return
|
|
34
|
+
return theme.t('ColorBackgroundContainerSecondaryDefault');
|
|
32
35
|
}
|
|
33
36
|
return 'transparent';
|
|
34
37
|
} else {
|
|
35
38
|
if (variant === 'primary') {
|
|
36
|
-
return
|
|
39
|
+
return theme.t('ColorBackgroundContainerPrimaryInverted');
|
|
37
40
|
}
|
|
38
41
|
if (variant === 'secondary') {
|
|
39
|
-
return
|
|
42
|
+
return theme.t('ColorBackgroundContainerSecondaryInverted');
|
|
40
43
|
}
|
|
41
44
|
return 'transparent';
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
|
|
45
|
-
function getColor(
|
|
48
|
+
function getColor(
|
|
49
|
+
{ variant, inverted }: Partial<IButtonIconProps>,
|
|
50
|
+
theme: ITheme
|
|
51
|
+
) {
|
|
46
52
|
if (!inverted) {
|
|
47
53
|
if (variant === 'primary') {
|
|
48
|
-
return
|
|
54
|
+
return theme.t('ColorTextBrandInverted');
|
|
49
55
|
}
|
|
50
|
-
|
|
51
|
-
return Colors.v8_1.shadesOfPurple.purple;
|
|
52
|
-
}
|
|
53
|
-
return Colors.v8_1.shadesOfPurple.purple;
|
|
56
|
+
return theme.t('ColorTextBrandDefault');
|
|
54
57
|
} else {
|
|
55
58
|
if (variant === 'primary') {
|
|
56
|
-
return
|
|
59
|
+
return theme.t('ColorTextBrandDefault');
|
|
57
60
|
}
|
|
58
|
-
return
|
|
61
|
+
return theme.t('ColorTextBrandInverted');
|
|
59
62
|
}
|
|
60
63
|
}
|
|
61
64
|
|
|
@@ -70,8 +73,9 @@ export function PxButtonIcon({
|
|
|
70
73
|
accessibilityHint,
|
|
71
74
|
inverted,
|
|
72
75
|
}: IButtonIconProps) {
|
|
73
|
-
const
|
|
74
|
-
const
|
|
76
|
+
const { theme } = useTheme();
|
|
77
|
+
const backgroundColor = getBackgroundColor({ variant, inverted }, theme);
|
|
78
|
+
const color = getColor({ variant, inverted }, theme);
|
|
75
79
|
|
|
76
80
|
return (
|
|
77
81
|
<TouchableOpacity
|