native-pytech 1.0.37 → 1.0.40
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/Section.js +5 -4
- package/dist/libs/swiftui/src/components/List/BaseList/index.d.ts +1 -1
- package/dist/libs/swiftui/src/components/List/BaseList/index.js +8 -4
- package/dist/libs/swiftui/src/components/List/BaseList/types.d.ts +4 -1
- package/dist/libs/swiftui/src/components/List/Editable/List/index.js +5 -4
- package/dist/libs/swiftui/src/components/List/Editable/Section/index.js +0 -1
- package/dist/libs/swiftui/src/components/NavigationLink/index.js +6 -3
- package/dist/libs/swiftui/src/components/Picker.js +5 -2
- package/dist/libs/swiftui/src/components/Text.js +5 -2
- 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';
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Section, VStack } from '@expo/ui/swift-ui';
|
|
2
2
|
import { containerRelativeFrame, listRowBackground, frame, listRowInsets } from '@expo/ui/swift-ui/modifiers';
|
|
3
|
-
import React, { memo } from 'react';
|
|
3
|
+
import React, { memo, useMemo } from 'react';
|
|
4
4
|
export default memo(({ children, modifiers, ...vStackProps }) => {
|
|
5
|
-
const _modifiers = [
|
|
5
|
+
const _modifiers = useMemo(() => [
|
|
6
|
+
...(modifiers ?? []),
|
|
6
7
|
frame({ alignment: 'center' }),
|
|
7
8
|
containerRelativeFrame({ axes: 'horizontal' }),
|
|
8
9
|
listRowBackground('transparent'),
|
|
9
10
|
listRowInsets({ bottom: 0.1 })
|
|
10
|
-
];
|
|
11
|
+
], [modifiers]);
|
|
11
12
|
return (<Section>
|
|
12
|
-
<VStack spacing={20} modifiers={
|
|
13
|
+
<VStack spacing={20} modifiers={_modifiers} {...vStackProps}>
|
|
13
14
|
{children}
|
|
14
15
|
</VStack>
|
|
15
16
|
</Section>);
|
|
@@ -6,5 +6,5 @@ import type Props from './types';
|
|
|
6
6
|
Este componente extiende "List" de @expo/ui/swift-ui y agrega automáticamente:
|
|
7
7
|
- padding({ top: -15 })
|
|
8
8
|
*/
|
|
9
|
-
declare const _default: React.MemoExoticComponent<({ children, modifiers, disablePaddingTop, ...listProps }: Props) => React.JSX.Element>;
|
|
9
|
+
declare const _default: React.MemoExoticComponent<({ children, modifiers, disablePaddingTop, onRefresh, ...listProps }: Props) => React.JSX.Element>;
|
|
10
10
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { List } from '@expo/ui/swift-ui';
|
|
2
|
-
import { padding } from '@expo/ui/swift-ui/modifiers';
|
|
2
|
+
import { padding, refreshable } from '@expo/ui/swift-ui/modifiers';
|
|
3
3
|
import React, { memo, useMemo } from 'react';
|
|
4
4
|
/**
|
|
5
5
|
Wrapper de List que aplica un padding superior negativo por defecto.
|
|
@@ -7,9 +7,13 @@ import React, { memo, useMemo } from 'react';
|
|
|
7
7
|
Este componente extiende "List" de @expo/ui/swift-ui y agrega automáticamente:
|
|
8
8
|
- padding({ top: -15 })
|
|
9
9
|
*/
|
|
10
|
-
export default memo(({ children, modifiers, disablePaddingTop
|
|
11
|
-
const _modifiers = useMemo(() =>
|
|
12
|
-
|
|
10
|
+
export default memo(({ children, modifiers, disablePaddingTop, onRefresh, ...listProps }) => {
|
|
11
|
+
const _modifiers = useMemo(() => [
|
|
12
|
+
...(modifiers ?? []),
|
|
13
|
+
...(disablePaddingTop ? [padding({ top: -15 })] : []),
|
|
14
|
+
...(onRefresh ? [refreshable(onRefresh)] : []),
|
|
15
|
+
], [modifiers, disablePaddingTop, onRefresh]);
|
|
16
|
+
return (<List modifiers={_modifiers} {...listProps}>
|
|
13
17
|
{children}
|
|
14
18
|
</List>);
|
|
15
19
|
});
|
|
@@ -2,8 +2,11 @@ import { ListProps } from "@expo/ui/swift-ui";
|
|
|
2
2
|
type Props = ListProps & {
|
|
3
3
|
/**
|
|
4
4
|
Whether to disable the padding top of the list.
|
|
5
|
-
@default false
|
|
6
5
|
*/
|
|
7
6
|
disablePaddingTop?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
The function to handle the refresh event.
|
|
9
|
+
*/
|
|
10
|
+
onRefresh?: () => Promise<void>;
|
|
8
11
|
};
|
|
9
12
|
export default Props;
|
|
@@ -4,13 +4,14 @@ import BaseList from "../../BaseList";
|
|
|
4
4
|
import { Provider } from '../../../../context/ListEditable';
|
|
5
5
|
export default memo(({ children, editMode, moveEnabled, deleteEnabled, modifiers, ...listProps }) => {
|
|
6
6
|
const _modifiers = useMemo(() => [
|
|
7
|
+
...(modifiers ?? []),
|
|
7
8
|
listStyle('inset'),
|
|
8
9
|
environment('editMode', editMode ? 'active' : 'inactive'),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
], [editMode, moveEnabled, deleteEnabled]);
|
|
10
|
+
...(moveEnabled ? [moveDisabled(false)] : []),
|
|
11
|
+
...(deleteEnabled ? [deleteDisabled(false)] : []),
|
|
12
|
+
], [modifiers, editMode, moveEnabled, deleteEnabled]);
|
|
12
13
|
const value = useMemo(() => ({ enableMove: moveEnabled, enableDelete: deleteEnabled }), [moveEnabled, deleteEnabled]);
|
|
13
|
-
return (<BaseList {...listProps} modifiers={
|
|
14
|
+
return (<BaseList {...listProps} modifiers={_modifiers}>
|
|
14
15
|
<Provider value={value}>
|
|
15
16
|
{children}
|
|
16
17
|
</Provider>
|
|
@@ -7,7 +7,6 @@ function Component({ data = [], keyExtractor, onDelete, onMove, renderItem }) {
|
|
|
7
7
|
// ---------------------- Variables ----------------------
|
|
8
8
|
const { enableMove, enableDelete } = useListEditable();
|
|
9
9
|
const [_data, setData] = useState(data ?? []);
|
|
10
|
-
// ---------------------- Hooks ----------------------
|
|
11
10
|
Hooks.useEffectWithoutFirstRender(() => setData(data ?? []), [data]);
|
|
12
11
|
// ---------------------- Functions ----------------------
|
|
13
12
|
const handleDelete = useCallback((indices) => {
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { Button, HStack, Label } from '@expo/ui/swift-ui';
|
|
2
2
|
import { foregroundStyle } from '@expo/ui/swift-ui/modifiers';
|
|
3
3
|
import { Color } from 'expo-router';
|
|
4
|
-
import React, { memo } from 'react';
|
|
4
|
+
import React, { memo, useMemo } from 'react';
|
|
5
5
|
import Trailing from './Trailing';
|
|
6
6
|
export default memo(({ children, systemImage, label, modifiers, maintainButtonStyle = false, textTrailing, textTrailingProps, ...buttonProps }) => {
|
|
7
7
|
// Va a poner una Label cuando no tenga que mantener el estilo del button y haya una imagen.
|
|
8
8
|
// Si no tiene que mantener el estilo del button y no hay una imagen, solo va a cambiar el foregroundColor.
|
|
9
9
|
const renderLabel = !maintainButtonStyle && systemImage !== undefined;
|
|
10
|
-
const _modifiers = (
|
|
10
|
+
const _modifiers = useMemo(() => [
|
|
11
|
+
...(modifiers ?? []),
|
|
12
|
+
...(!maintainButtonStyle && !renderLabel ? [foregroundStyle(Color.ios.label)] : []),
|
|
13
|
+
], [modifiers, maintainButtonStyle, renderLabel]);
|
|
11
14
|
const buttonSystemImage = !renderLabel ? systemImage : undefined;
|
|
12
15
|
const buttonLabel = !renderLabel ? label : undefined;
|
|
13
16
|
return (<HStack>
|
|
14
|
-
<Button modifiers={
|
|
17
|
+
<Button modifiers={_modifiers} systemImage={buttonSystemImage} label={buttonLabel} {...buttonProps}>
|
|
15
18
|
{children}
|
|
16
19
|
</Button>
|
|
17
20
|
{!children && renderLabel && (<Label title={label} systemImage={systemImage}/>)}
|
|
@@ -2,8 +2,11 @@ import { Picker, Text } from '@expo/ui/swift-ui';
|
|
|
2
2
|
import { pickerStyle, tag } from "@expo/ui/swift-ui/modifiers";
|
|
3
3
|
import React, { memo, useMemo } from 'react';
|
|
4
4
|
export default memo(({ modifiers, data = [], ...pickerProps }) => {
|
|
5
|
-
const _modifiers = useMemo(() => [
|
|
6
|
-
|
|
5
|
+
const _modifiers = useMemo(() => [
|
|
6
|
+
...(modifiers ?? []),
|
|
7
|
+
pickerStyle('menu'),
|
|
8
|
+
], [modifiers]);
|
|
9
|
+
return (<Picker modifiers={_modifiers} {...pickerProps}>
|
|
7
10
|
{data.map(item => (<Text key={item} modifiers={[tag(item)]}>
|
|
8
11
|
{item}
|
|
9
12
|
</Text>))}
|
|
@@ -2,6 +2,9 @@ import { Text } from '@expo/ui/swift-ui';
|
|
|
2
2
|
import { foregroundStyle } from '@expo/ui/swift-ui/modifiers';
|
|
3
3
|
import React, { memo, useMemo } from 'react';
|
|
4
4
|
export default memo(({ modifiers, secondary = false, ...restProps }) => {
|
|
5
|
-
const _modifiers = useMemo(() =>
|
|
6
|
-
|
|
5
|
+
const _modifiers = useMemo(() => [
|
|
6
|
+
...(modifiers ?? []),
|
|
7
|
+
...(secondary ? [foregroundStyle({ type: 'hierarchical', style: 'secondary' })] : []),
|
|
8
|
+
], [modifiers, secondary]);
|
|
9
|
+
return (<Text modifiers={_modifiers} {...restProps}/>);
|
|
7
10
|
});
|