native-pytech 1.0.45 → 1.0.47

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,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type Props from './types';
3
- declare const _default: React.MemoExoticComponent<({ text, color, type, systemName }: Props) => React.JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ text, color, type, systemName, iconSize, }: Props) => React.JSX.Element>;
4
4
  export default _default;
@@ -3,7 +3,7 @@ import { StyleSheet, Text } from 'react-native';
3
3
  import { LinearGradient } from 'expo-linear-gradient';
4
4
  import colors, { sizes } from '../../constants';
5
5
  import Icon from '../Icon';
6
- export default memo(({ text, color, type = 'small', systemName }) => {
6
+ export default memo(({ text, color, type = 'small', systemName, iconSize, }) => {
7
7
  const typeSizes = useMemo(() => sizes[type], [type]);
8
8
  const textComponent = useMemo(() => {
9
9
  const cantLetras = text?.length;
@@ -16,7 +16,7 @@ export default memo(({ text, color, type = 'small', systemName }) => {
16
16
  </Text>);
17
17
  }, [text, typeSizes]);
18
18
  return (<LinearGradient style={[styles.gradient, { height: typeSizes.diameter, borderRadius: typeSizes.diameter }]} colors={[colors[color].light, colors[color].dark]} start={{ x: 0, y: 0 }} end={{ x: 0, y: 1 }}>
19
- {textComponent ?? (systemName && <Icon systemName={systemName}/>)}
19
+ {textComponent ?? (systemName && (<Icon systemName={systemName} size={iconSize ?? typeSizes.diameter / 2}/>))}
20
20
  </LinearGradient>);
21
21
  });
22
22
  const styles = StyleSheet.create({
@@ -1,6 +1,6 @@
1
1
  import colors, { sizesType } from '../../constants';
2
2
  import IconProps from '../Icon/types';
3
- export type Props = IconProps & {
3
+ export type Props = Omit<IconProps, 'size'> & {
4
4
  /**
5
5
  The text to display in the gradient.
6
6
  Must be less than 3 characters.
@@ -15,5 +15,11 @@ export type Props = IconProps & {
15
15
  @default 'small'
16
16
  */
17
17
  type: sizesType;
18
+ /**
19
+ The size of the icon.
20
+ @ios
21
+ @default (typeSizes.diameter/2)
22
+ */
23
+ iconSize?: number;
18
24
  };
19
25
  export default Props;
@@ -1,3 +1,3 @@
1
1
  import type Props from './types';
2
- declare const _default: ({ systemName, iconSize }: Props) => any;
2
+ declare const _default: ({ systemName, size }: Props) => any;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import type Props from './types';
2
- declare const _default: ({ systemName, iconSize }: Props) => import("react").JSX.Element;
2
+ declare const _default: ({ systemName, size }: Props) => import("react").JSX.Element;
3
3
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { Host, Image } from '@expo/ui/swift-ui';
2
- export default ({ systemName, iconSize = 100 }) => {
2
+ export default ({ systemName, size = 100 }) => {
3
3
  return (<Host matchContents>
4
- <Image systemName={systemName} color='white' size={iconSize}/>
4
+ <Image systemName={systemName} color='white' size={size}/>
5
5
  </Host>);
6
6
  };
@@ -1 +1 @@
1
- export default ({ systemName, iconSize = 100 }) => null;
1
+ export default ({ systemName, size = 100 }) => null;
@@ -11,6 +11,6 @@ type Props = {
11
11
  @ios
12
12
  @default 100
13
13
  */
14
- iconSize?: number;
14
+ size?: number;
15
15
  };
16
16
  export default Props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.45",
3
+ "version": "1.0.47",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",