native-pytech 1.0.131 → 1.0.133

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, sizeDiameter, icon, iconSize, }: Props) => React.JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ text, color, type, sizeDiameter, icon, iconSize, ionIconName, }: Props) => React.JSX.Element>;
4
4
  export default _default;
@@ -1,8 +1,10 @@
1
1
  import React, { memo, useMemo } from 'react';
2
2
  import { StyleSheet, Text } from 'react-native';
3
3
  import { LinearGradient } from 'expo-linear-gradient';
4
+ import { Ionicons } from '@expo/vector-icons';
5
+ import Colors from '../../../../../libs/constants/colors';
4
6
  import colors, { sizes } from '../../constants';
5
- export default memo(({ text, color = 'default', type = 'small', sizeDiameter, icon, iconSize, }) => {
7
+ export default memo(({ text, color = 'default', type = 'small', sizeDiameter, icon, iconSize, ionIconName, }) => {
6
8
  const typeSizes = useMemo(() => sizes[type], [type]);
7
9
  const textComponent = useMemo(() => {
8
10
  const cantLetras = text?.length;
@@ -15,7 +17,7 @@ export default memo(({ text, color = 'default', type = 'small', sizeDiameter, ic
15
17
  </Text>);
16
18
  }, [text, typeSizes]);
17
19
  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 }}>
18
- {textComponent ?? icon}
20
+ {textComponent ?? (icon ?? (ionIconName && <Ionicons name={ionIconName} size={24} color={Colors.especiales.azul}/>))}
19
21
  </LinearGradient>);
20
22
  });
21
23
  const styles = StyleSheet.create({
@@ -1,19 +1,24 @@
1
+ import { Ionicons } from '@expo/vector-icons';
1
2
  import { type SFSymbol } from 'sf-symbols-typescript';
2
3
  type Props = {
3
4
  /**
4
5
  The name of the system image (SF Symbol).
5
6
  For example: 'photo', 'heart.fill', 'star.circle'
6
- @ios
7
+ @platform ios
7
8
  */
8
9
  systemName?: SFSymbol;
10
+ /**
11
+ The name of the Ionicon to be displayed in the label.
12
+ */
13
+ ionIconName?: keyof typeof Ionicons.glyphMap;
9
14
  /**
10
15
  The icon to display.
11
- @web
16
+ @platform web
12
17
  */
13
18
  icon?: React.ReactNode;
14
19
  /**
15
20
  The size of the icon.
16
- @ios
21
+ @platform ios
17
22
  @default 100
18
23
  */
19
24
  size?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.131",
3
+ "version": "1.0.133",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",