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.
- package/dist/libs/components/Gradient/components/Gradient/index.d.ts +1 -1
- package/dist/libs/components/Gradient/components/Gradient/index.ios.d.ts +2 -1
- package/dist/libs/components/Gradient/components/Gradient/index.ios.js +5 -34
- package/dist/libs/components/Gradient/components/Gradient/index.js +1 -1
- package/dist/libs/components/Gradient/components/Gradient/types.d.ts +12 -5
- package/dist/libs/components/Gradient/components/Icon.d.ts +0 -1
- package/dist/libs/components/Gradient/index.d.ts +2 -2
- package/dist/libs/components/Gradient/index.js +2 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type Props from './types';
|
|
2
|
-
declare const _default: import("react").MemoExoticComponent<({ text, color, type,
|
|
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:
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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',
|
|
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
|
|
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
|
-
|
|
25
|
-
@ios
|
|
26
|
-
@default (typeSizes.diameter/2)
|
|
31
|
+
Function to render the item.
|
|
32
|
+
@platform ios
|
|
27
33
|
*/
|
|
28
|
-
|
|
34
|
+
renderGradientIOS?: (props: renderGradientIOSProps) => React.ReactNode;
|
|
29
35
|
};
|
|
36
|
+
export type renderGradientIOSProps = BaseProps & Pick<IconProps, 'systemName'>;
|
|
30
37
|
export default Props;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './components/Gradient/types';
|
|
3
3
|
export { default } from './components/Gradient';
|