@proximus/lavender-buttonicon-native 1.2.8-beta.3 → 1.2.8

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;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,qBAsDlB"}
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,qBAkDlB"}
@@ -3,25 +3,29 @@ import { a11y, e2eID } from '@proximus/lavender-common-native';
3
3
  import { PxIcon } from '@proximus/lavender-icon-native';
4
4
  import React from 'react';
5
5
  import { useTheme } from '@proximus/lavender-styling-native';
6
- function getBackgroundColor({ variant, inverted, disabled }, theme) {
7
- const invertedSuffix = inverted ? 'Inverted' : 'Default';
8
- if (variant === 'naked') {
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
+ }
9
14
  return 'transparent';
10
15
  }
11
- if (disabled) {
12
- return theme.t(`ColorBackgroundStateDisabled${invertedSuffix}`);
13
- }
14
- if (variant === 'primary') {
15
- return theme.t(`ColorBackgroundContainerPrimary${invertedSuffix}`);
16
- }
17
- if (variant === 'secondary') {
18
- return theme.t(`ColorBackgroundContainerSecondary${invertedSuffix}`);
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';
19
24
  }
20
- return 'transparent';
21
25
  }
22
26
  export function PxButtonIcon({ variant = 'primary', iconName, wrapperStyle, onPress, disabled, testID, accessibilityLabel, accessibilityHint, inverted, size = 'default', }) {
23
27
  const { theme } = useTheme();
24
- const backgroundColor = getBackgroundColor({ variant, inverted, disabled }, theme);
28
+ const backgroundColor = getBackgroundColor({ variant, inverted }, theme);
25
29
  return (React.createElement(TouchableOpacity, { ...e2eID(testID), onPress: onPress, focusable: true, disabled: disabled, ...a11y({
26
30
  accessibilityRole: 'button',
27
31
  accessible: true,
@@ -48,7 +52,7 @@ export function PxButtonIcon({ variant = 'primary', iconName, wrapperStyle, onPr
48
52
  alignItems: 'center',
49
53
  justifyContent: 'center',
50
54
  } },
51
- React.createElement(PxIcon, { inverted: variant === 'primary' ? !inverted : inverted, name: iconName, size: size === 'small' ? 'Xs' : 'S', color: 'Brand', disabled: disabled }))));
55
+ React.createElement(PxIcon, { inverted: variant === 'primary' ? !inverted : inverted, name: iconName, size: size === 'small' ? 'Xs' : 'S', color: 'Brand' }))));
52
56
  }
53
57
  const styles = StyleSheet.create({
54
58
  container: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-buttonicon-native",
3
- "version": "1.2.8-beta.3",
3
+ "version": "1.2.8",
4
4
  "description": "Button icon component",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",