native-pytech 1.0.38 → 1.0.41
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 +4 -0
- package/dist/libs/components/Gradient/components/Gradient/index.js +33 -0
- package/dist/libs/components/Gradient/components/Gradient/types.d.ts +19 -0
- package/dist/libs/components/Gradient/components/Gradient/types.js +1 -0
- package/dist/libs/components/Gradient/components/Icon/index.d.ts +3 -0
- package/dist/libs/components/Gradient/components/Icon/index.ios.d.ts +3 -0
- package/dist/libs/components/Gradient/components/Icon/index.ios.js +6 -0
- package/dist/libs/components/Gradient/components/Icon/index.js +1 -0
- package/dist/libs/components/Gradient/components/Icon/types.d.ts +16 -0
- package/dist/libs/components/Gradient/components/Icon/types.js +1 -0
- package/dist/libs/components/Gradient/index.d.ts +3 -21
- package/dist/libs/components/Gradient/index.js +2 -33
- package/dist/libs/swiftui/src/components/IconSection/Icon.d.ts +1 -3
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { memo, useMemo } from 'react';
|
|
2
|
+
import { StyleSheet, Text } from 'react-native';
|
|
3
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
4
|
+
import colors, { sizes } from '../../constants';
|
|
5
|
+
import Icon from '../Icon';
|
|
6
|
+
export default memo(({ text, color, type = 'small', systemName }) => {
|
|
7
|
+
const typeSizes = useMemo(() => sizes[type], [type]);
|
|
8
|
+
const textComponent = useMemo(() => {
|
|
9
|
+
const cantLetras = text?.length;
|
|
10
|
+
if (!text || !cantLetras || systemName)
|
|
11
|
+
return null;
|
|
12
|
+
if (cantLetras > 3)
|
|
13
|
+
throw new Error('Text must be less than 3 characters');
|
|
14
|
+
return (<Text style={[styles.text, { fontSize: typeSizes.fontSize[cantLetras] }]} allowFontScaling={false}>
|
|
15
|
+
{text}
|
|
16
|
+
</Text>);
|
|
17
|
+
}, [text, typeSizes]);
|
|
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}/>)}
|
|
20
|
+
</LinearGradient>);
|
|
21
|
+
});
|
|
22
|
+
const styles = StyleSheet.create({
|
|
23
|
+
gradient: {
|
|
24
|
+
aspectRatio: 1, // width will automatically match height
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
alignItems: 'center'
|
|
27
|
+
},
|
|
28
|
+
text: {
|
|
29
|
+
color: 'white',
|
|
30
|
+
fontWeight: 'bold',
|
|
31
|
+
letterSpacing: -0.5,
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import colors, { sizesType } from '../../constants';
|
|
2
|
+
import IconProps from '../Icon/types';
|
|
3
|
+
export type Props = IconProps & {
|
|
4
|
+
/**
|
|
5
|
+
The text to display in the gradient.
|
|
6
|
+
Must be less than 3 characters.
|
|
7
|
+
*/
|
|
8
|
+
text?: string;
|
|
9
|
+
/**
|
|
10
|
+
The color of the gradient.
|
|
11
|
+
*/
|
|
12
|
+
color: keyof typeof colors;
|
|
13
|
+
/**
|
|
14
|
+
The size of the gradient.
|
|
15
|
+
@default 'small'
|
|
16
|
+
*/
|
|
17
|
+
type: sizesType;
|
|
18
|
+
};
|
|
19
|
+
export default Props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default ({ systemName, iconSize = 100 }) => null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SFSymbol } from 'sf-symbols-typescript';
|
|
2
|
+
type Props = {
|
|
3
|
+
/**
|
|
4
|
+
The name of the system image (SF Symbol).
|
|
5
|
+
For example: 'photo', 'heart.fill', 'star.circle'
|
|
6
|
+
@ios
|
|
7
|
+
*/
|
|
8
|
+
systemName?: SFSymbol;
|
|
9
|
+
/**
|
|
10
|
+
The size of the icon.
|
|
11
|
+
@ios
|
|
12
|
+
@default 100
|
|
13
|
+
*/
|
|
14
|
+
iconSize?: number;
|
|
15
|
+
};
|
|
16
|
+
export default Props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export type Props = {
|
|
5
|
-
/**
|
|
6
|
-
The text to display in the gradient.
|
|
7
|
-
Must be less than 3 characters.
|
|
8
|
-
*/
|
|
9
|
-
text?: string;
|
|
10
|
-
/**
|
|
11
|
-
The color of the gradient.
|
|
12
|
-
*/
|
|
13
|
-
color: keyof typeof colors;
|
|
14
|
-
/**
|
|
15
|
-
The size of the gradient.
|
|
16
|
-
@default 'small'
|
|
17
|
-
*/
|
|
18
|
-
type: sizesType;
|
|
19
|
-
};
|
|
20
|
-
declare const _default: React.MemoExoticComponent<({ text, color, type }: Props) => React.JSX.Element>;
|
|
21
|
-
export default _default;
|
|
1
|
+
export { sizes } from './constants';
|
|
2
|
+
export { Props } from './components/Gradient/types';
|
|
3
|
+
export { default } from './components/Gradient';
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { LinearGradient } from 'expo-linear-gradient';
|
|
4
|
-
import colors, { sizes } from './constants';
|
|
5
|
-
export { sizes };
|
|
6
|
-
export default memo(({ text, color, type = 'small' }) => {
|
|
7
|
-
const typeSizes = useMemo(() => sizes[type], [type]);
|
|
8
|
-
const textComponent = useMemo(() => {
|
|
9
|
-
const cantLetras = text?.length;
|
|
10
|
-
if (!text || !cantLetras)
|
|
11
|
-
return null;
|
|
12
|
-
if (cantLetras > 3)
|
|
13
|
-
throw new Error('Text must be less than 3 characters');
|
|
14
|
-
return (<Text style={[styles.text, { fontSize: typeSizes.fontSize[cantLetras] }]} allowFontScaling={false}>
|
|
15
|
-
{text}
|
|
16
|
-
</Text>);
|
|
17
|
-
}, [text, typeSizes]);
|
|
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}
|
|
20
|
-
</LinearGradient>);
|
|
21
|
-
});
|
|
22
|
-
const styles = StyleSheet.create({
|
|
23
|
-
gradient: {
|
|
24
|
-
aspectRatio: 1, // width will automatically match height
|
|
25
|
-
justifyContent: 'center',
|
|
26
|
-
alignItems: 'center'
|
|
27
|
-
},
|
|
28
|
-
text: {
|
|
29
|
-
color: 'white',
|
|
30
|
-
fontWeight: 'bold',
|
|
31
|
-
letterSpacing: -0.5,
|
|
32
|
-
}
|
|
33
|
-
});
|
|
1
|
+
export { sizes } from './constants';
|
|
2
|
+
export { default } from './components/Gradient';
|
|
@@ -13,9 +13,7 @@ type Props = {
|
|
|
13
13
|
/**
|
|
14
14
|
If it is given, displays a gradient.
|
|
15
15
|
*/
|
|
16
|
-
gradientProps?: {
|
|
17
|
-
text: GradientProps['text'];
|
|
18
|
-
color: GradientProps['color'];
|
|
16
|
+
gradientProps?: Omit<GradientProps, 'type'> & {
|
|
19
17
|
type: 'extraLarge' | 'extraExtraLarge';
|
|
20
18
|
};
|
|
21
19
|
/**
|