@proximus/lavender-icon-native 0.1.0-alpha.11 → 0.1.0-alpha.13

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/dist/PxIcon.d.ts CHANGED
@@ -1,17 +1,24 @@
1
1
  import React from 'react';
2
2
  import { AccessibilityProps, StyleProp, TextStyle, ViewStyle } from 'react-native';
3
3
  import type { IconName } from '@proximus/lavender-icon/dist/iconNames.js';
4
+ import { IconColor } from '@proximus/lavender-icon';
5
+ import { IconSize } from '@proximus/lavender-common';
4
6
  export declare function convertIconName(oldName: string): string;
5
7
  interface PxIconProps extends AccessibilityProps {
6
8
  name: IconName;
7
- size?: number;
8
- color?: string;
9
+ size?: IconSize;
10
+ color?: IconColor;
11
+ /** @deprecated Use 'color' property instead */
12
+ deprecatedColor?: string;
13
+ /** @deprecated Use 'size' property instead */
14
+ deprecatedSize?: number;
9
15
  background?: boolean;
10
16
  disabled?: boolean;
17
+ inverted?: boolean;
11
18
  backgroundSize?: number;
12
19
  style?: StyleProp<TextStyle>;
13
20
  containerStyle?: StyleProp<ViewStyle>;
14
21
  }
15
- export declare function PxIcon({ name, size, color, style, disabled, containerStyle, ...accessibilityProps }: PxIconProps): React.JSX.Element;
22
+ export declare function PxIcon({ name, size, color, style, disabled, containerStyle, inverted, deprecatedColor, deprecatedSize, ...accessibilityProps }: PxIconProps): React.JSX.Element;
16
23
  export {};
17
24
  //# sourceMappingURL=PxIcon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PxIcon.d.ts","sourceRoot":"","sources":["../src/PxIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,SAAS,EAET,SAAS,EAET,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAG1E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,G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CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACvC;AAID,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,IAAU,EACV,KAAe,EACf,KAAK,EACL,QAAQ,EACR,cAAc,EACd,QAAgB,EAChB,eAAe,EACf,cAAc,EACd,GAAG,kBAAkB,EACtB,EAAE,WAAW,qBA0Bb"}
package/dist/PxIcon.js CHANGED
@@ -75,14 +75,19 @@ export function convertIconName(oldName) {
75
75
  return iconMap[oldName] ?? oldName;
76
76
  }
77
77
  const LavenderIcon = createIconSet(LavenderGlyphMap, 'lavender');
78
- export function PxIcon({ name, size, color, style, disabled, containerStyle, ...accessibilityProps }) {
78
+ export function PxIcon({ name, size = 'M', color = 'Brand', style, disabled, containerStyle, inverted = false, deprecatedColor, deprecatedSize, ...accessibilityProps }) {
79
79
  const { theme } = useTheme();
80
+ const invertedSuffix = inverted ? 'Inverted' : 'Default';
80
81
  const iconColor = disabled
81
82
  ? theme.t('ColorIconStateDisabledDefault')
82
- : color || theme.t('ColorIconBrandDefault');
83
- const iconSize = size || theme.t('SizeIconS').number;
83
+ : color
84
+ ? theme.t(`ColorIcon${color}${invertedSuffix}`)
85
+ : theme.t('ColorIconBrandDefault');
86
+ const iconSize = size
87
+ ? theme.t(`SizeIcon${size}`).number
88
+ : theme.t('SizeIconS').number;
84
89
  return (React.createElement(View, { style: [styles.container, containerStyle] },
85
- React.createElement(LavenderIcon, { name: name, color: iconColor, size: iconSize, style: style, ...accessibilityProps })));
90
+ React.createElement(LavenderIcon, { name: name, color: deprecatedColor || iconColor, size: deprecatedSize || iconSize, style: style, ...accessibilityProps })));
86
91
  }
87
92
  const styles = StyleSheet.create({
88
93
  container: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-icon-native",
3
- "version": "0.1.0-alpha.11",
3
+ "version": "0.1.0-alpha.13",
4
4
  "description": "Lavender icon component",
5
5
  "main": "dist/index.js",
6
6
  "files": [