native-pytech 1.0.53 → 1.0.55

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.
@@ -0,0 +1,3 @@
1
+ import { Props } from './types';
2
+ declare const _default: import("react").MemoExoticComponent<({ text, onPress, onSubmit, backgroundColorPage, enabled, themeColor }: Props) => import("react").JSX.Element>;
3
+ export default _default;
@@ -0,0 +1,52 @@
1
+ import colors from '../../constants';
2
+ import { GlassView } from 'expo-glass-effect';
3
+ import { useApp } from "../../../../../libs/providers/App";
4
+ import { memo, useCallback, useMemo, useState } from 'react';
5
+ import { ActivityIndicator, Pressable, StyleSheet } from 'react-native';
6
+ import Utils from '../../../../../libs/constants/utils';
7
+ import Text from './Text';
8
+ export default memo(({ text, onPress, onSubmit, backgroundColorPage, enabled = true, themeColor = 'default' }) => {
9
+ const { colorScheme } = useApp();
10
+ const Theme = colors.theme[colorScheme];
11
+ const [isLoading, setIsLoading] = useState(false);
12
+ const _onPress = useCallback(async () => {
13
+ if (isLoading)
14
+ return;
15
+ if (onPress) {
16
+ setIsLoading(true);
17
+ const result = await onPress();
18
+ setIsLoading(false);
19
+ if (!result)
20
+ return;
21
+ }
22
+ onSubmit?.();
23
+ }, [onPress, onSubmit]);
24
+ const backgroundColor = useCallback((pressed) => {
25
+ return enabled ?
26
+ (themeColor === 'default' ? Utils.adjustLightness(colors.especiales.azul, -10) : undefined)
27
+ : Theme.colorButtonFooterDisabled;
28
+ }, [enabled, themeColor]);
29
+ const color = useMemo(() => themeColor === 'default' ? colors.especiales.celeste : Theme.text2, [themeColor]);
30
+ return (<Pressable disabled={!enabled} onPress={_onPress} style={{ width: '100%' }}>
31
+ <GlassView glassEffectStyle={themeColor === 'default' ? "clear" : "regular"} isInteractive={enabled} style={[
32
+ styles.button,
33
+ { backgroundColor: backgroundColor(true) }
34
+ ]}>
35
+ {!isLoading ? (<Text text={text} enabled={enabled} themeColor={themeColor}/>) : (<ActivityIndicator size='small' style={{ margin: 'auto' }} color={color}/>)}
36
+ </GlassView>
37
+ </Pressable>);
38
+ });
39
+ const styles = StyleSheet.create({
40
+ button: {
41
+ borderRadius: 99,
42
+ paddingHorizontal: 20,
43
+ paddingVertical: 15.5,
44
+ alignItems: 'center',
45
+ justifyContent: 'center',
46
+ width: '100%',
47
+ },
48
+ text: {
49
+ fontSize: 17,
50
+ fontWeight: '600',
51
+ }
52
+ });
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { Props } from './types';
2
- declare const _default: import("react").MemoExoticComponent<({ text, onPress, onSubmit, backgroundColorPage, enabled, themeColor }: Props) => import("react").JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ text, onPress, onSubmit, backgroundColorPage, enabled, themeColor }: Props) => React.JSX.Element>;
3
4
  export default _default;
@@ -1,52 +1,22 @@
1
- import colors from '../../constants';
2
- import { GlassView } from 'expo-glass-effect';
3
- import { useApp } from "../../../../../libs/providers/App";
4
- import { memo, useCallback, useMemo, useState } from 'react';
5
- import { ActivityIndicator, Pressable, StyleSheet } from 'react-native';
6
- import Utils from '../../../../../libs/constants/utils';
7
- import Text from './Text';
1
+ import { Button, Text } from '@expo/ui/swift-ui';
2
+ import { frame, font, foregroundStyle, buttonStyle, controlSize, disabled } from '@expo/ui/swift-ui/modifiers';
3
+ import React, { memo, useMemo } from 'react';
4
+ import { useWindowDimensions } from 'react-native';
8
5
  export default memo(({ text, onPress, onSubmit, backgroundColorPage, enabled = true, themeColor = 'default' }) => {
9
- const { colorScheme } = useApp();
10
- const Theme = colors.theme[colorScheme];
11
- const [isLoading, setIsLoading] = useState(false);
12
- const _onPress = useCallback(async () => {
13
- if (isLoading)
14
- return;
15
- if (onPress) {
16
- setIsLoading(true);
17
- const result = await onPress();
18
- setIsLoading(false);
19
- if (!result)
20
- return;
21
- }
22
- onSubmit?.();
23
- }, [onPress, onSubmit]);
24
- const backgroundColor = useCallback((pressed) => {
25
- return enabled ?
26
- (themeColor === 'default' ? Utils.adjustLightness(colors.especiales.azul, -10) : undefined)
27
- : Theme.colorButtonFooterDisabled;
28
- }, [enabled, themeColor]);
29
- const color = useMemo(() => themeColor === 'default' ? colors.especiales.celeste : Theme.text2, [themeColor]);
30
- return (<Pressable disabled={!enabled} onPress={_onPress} style={{ width: '100%' }}>
31
- <GlassView glassEffectStyle={themeColor === 'default' ? "clear" : "regular"} isInteractive={enabled} style={[
32
- styles.button,
33
- { backgroundColor: backgroundColor(true) }
34
- ]}>
35
- {!isLoading ? (<Text text={text} enabled={enabled} themeColor={themeColor}/>) : (<ActivityIndicator size='small' style={{ margin: 'auto' }} color={color}/>)}
36
- </GlassView>
37
- </Pressable>);
38
- });
39
- const styles = StyleSheet.create({
40
- button: {
41
- borderRadius: 99,
42
- paddingHorizontal: 20,
43
- paddingVertical: 15.5,
44
- alignItems: 'center',
45
- justifyContent: 'center',
46
- width: '100%',
47
- },
48
- text: {
49
- fontSize: 17,
50
- fontWeight: '600',
51
- }
6
+ const { width } = useWindowDimensions();
7
+ const modifiers = useMemo(() => [
8
+ disabled(!enabled),
9
+ buttonStyle('glassProminent'),
10
+ controlSize('large')
11
+ ], [enabled]);
12
+ const modifiersText = useMemo(() => [
13
+ frame({ width: width - 110 }),
14
+ font({ weight: 'semibold' }),
15
+ foregroundStyle('#85fffd') // colors.especiales.celeste
16
+ ], [width]);
17
+ return (<Button onPress={onSubmit} modifiers={modifiers}>
18
+ <Text modifiers={modifiersText}>
19
+ Siguiente
20
+ </Text>
21
+ </Button>);
52
22
  });
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ children: React.ReactNode;
4
+ backgroundColorPage?: string;
5
+ };
6
+ declare const _default: React.MemoExoticComponent<({ children, backgroundColorPage }: Props) => React.JSX.Element>;
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import React, { memo } from 'react';
2
+ import { Overlay } from '@expo/ui/swift-ui';
3
+ export default memo(({ children, backgroundColorPage }) => {
4
+ return (<Overlay.Content>
5
+ {children}
6
+ </Overlay.Content>);
7
+ });
@@ -4,8 +4,8 @@ import { BlurView } from 'expo-blur';
4
4
  import { LinearGradient } from 'expo-linear-gradient';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
6
  import { memo } from 'react';
7
- import Background from './Background';
8
- import ButtonView from './View';
7
+ import Background from '../Background';
8
+ import ButtonView from '../View';
9
9
  export default memo(({ children, backgroundColorPage }) => {
10
10
  const insets = useSafeAreaInsets();
11
11
  return (<View style={styles.footer}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.53",
3
+ "version": "1.0.55",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",