native-pytech 1.0.158 → 1.0.159

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,3 +1,3 @@
1
1
  import type Props from './types';
2
- declare const _default: import("react").MemoExoticComponent<({ text, color, type, sizeDiameter, icon, iconSize, ionIconName, }: Props) => import("react").JSX.Element>;
2
+ declare const _default: import("react").MemoExoticComponent<({ text, color, type, icon, ionIconName, }: Props) => import("react").JSX.Element>;
3
3
  export default _default;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type Props from './types';
2
- declare const _default: import("react").MemoExoticComponent<({ text, color, type, sizeDiameter, systemName, iconSize, }: Props) => import("react").JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ text, color, type, systemName, sizeDiameter, size, renderGradientIOS, }: Props) => React.FunctionComponentElement<import("./types").renderGradientIOSProps> | null>;
3
4
  export default _default;
@@ -1,35 +1,6 @@
1
- import { memo, useMemo } from 'react';
2
- import { frame, font, foregroundStyle, background, clipShape } from '@expo/ui/swift-ui/modifiers';
3
- import { Text, Image } from '@expo/ui/swift-ui';
4
- import colors, { sizes } from '../../constants';
5
- export default memo(({ text, color = 'default', type = 'small', sizeDiameter, systemName, iconSize, }) => {
6
- const typeSizes = useMemo(() => {
7
- if (!sizeDiameter)
8
- return sizes[type];
9
- return {
10
- diameter: sizeDiameter,
11
- fontSize: {
12
- 1: sizeDiameter * 0.53,
13
- 2: sizeDiameter * 0.48,
14
- 3: sizeDiameter * 0.43
15
- }
16
- };
17
- }, [type]);
18
- const cantLetras = text?.length ?? 0;
19
- const modifiers = useMemo(() => [
20
- frame({ width: typeSizes.diameter, height: typeSizes.diameter }),
21
- foregroundStyle('white'),
22
- background(colors[color].middle),
23
- clipShape('circle'),
24
- ], [typeSizes, color]);
25
- // Return
26
- if (text && cantLetras <= 3) {
27
- return (<Text modifiers={[
28
- font({ weight: 'semibold', size: typeSizes.fontSize[cantLetras] }),
29
- ...modifiers
30
- ]}>
31
- {text}
32
- </Text>);
33
- }
34
- return (<Image systemName={systemName} color='white' size={iconSize ?? typeSizes.diameter / 2} modifiers={modifiers}/>);
1
+ import React, { memo } from 'react';
2
+ export default memo(({ text, color = 'default', type = 'small', systemName, sizeDiameter, size, renderGradientIOS, }) => {
3
+ if (!renderGradientIOS)
4
+ return null;
5
+ return React.createElement(renderGradientIOS, { text, color, type, sizeDiameter, size, systemName });
35
6
  });
@@ -3,7 +3,7 @@ import { StyleSheet, Text } from 'react-native';
3
3
  import { LinearGradient } from 'expo-linear-gradient';
4
4
  import { Ionicons } from '@expo/vector-icons';
5
5
  import colors, { sizes } from '../../constants';
6
- export default memo(({ text, color = 'default', type = 'small', sizeDiameter, icon, iconSize, ionIconName, }) => {
6
+ export default memo(({ text, color = 'default', type = 'small', icon, ionIconName, }) => {
7
7
  const typeSizes = useMemo(() => sizes[type], [type]);
8
8
  const textComponent = useMemo(() => {
9
9
  const cantLetras = text?.length;
@@ -1,6 +1,6 @@
1
1
  import { sizesType, ColorsType } from '../../constants';
2
2
  import IconProps from '../Icon';
3
- export type Props = Omit<IconProps, 'size'> & {
3
+ export type BaseProps = Pick<IconProps, 'size'> & {
4
4
  /**
5
5
  The text to display in the gradient.
6
6
  Must be less than 3 characters.
@@ -20,11 +20,18 @@ export type Props = Omit<IconProps, 'size'> & {
20
20
  The size of the gradient. If "type" is provided, this will be ignored.
21
21
  */
22
22
  sizeDiameter?: number;
23
+ };
24
+ export type Props = BaseProps & Omit<IconProps, 'size'> & {
25
+ /**
26
+ Function to render the item.
27
+ @platform android
28
+ */
29
+ renderGradientAndroid?: (props: BaseProps) => React.ReactNode;
23
30
  /**
24
- The size of the icon.
25
- @ios
26
- @default (typeSizes.diameter/2)
31
+ Function to render the item.
32
+ @platform ios
27
33
  */
28
- iconSize?: number;
34
+ renderGradientIOS?: (props: renderGradientIOSProps) => React.ReactNode;
29
35
  };
36
+ export type renderGradientIOSProps = BaseProps & Pick<IconProps, 'systemName'>;
30
37
  export default Props;
@@ -19,7 +19,6 @@ type Props = {
19
19
  /**
20
20
  The size of the icon.
21
21
  @platform ios
22
- @default 100
23
22
  */
24
23
  size?: number;
25
24
  };
@@ -1,3 +1,3 @@
1
- export { sizes, colors, ColorsType, sizesType } from './constants';
2
- export { Props } from './components/Gradient/types';
1
+ export * from './constants';
2
+ export * from './components/Gradient/types';
3
3
  export { default } from './components/Gradient';
@@ -1,2 +1,3 @@
1
- export { sizes, colors } from './constants';
1
+ export * from './constants';
2
+ export * from './components/Gradient/types';
2
3
  export { default } from './components/Gradient';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.158",
3
+ "version": "1.0.159",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",