native-pytech 1.0.79 → 1.0.81

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,4 @@
1
+ import React from 'react';
2
+ import type Props from './types';
3
+ declare const _default: React.MemoExoticComponent<({ colorRows, ...pageProps }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { Host, Column, Row } from '@expo/ui/jetpack-compose';
2
+ import React, { memo } from 'react';
3
+ import Item from '../Item';
4
+ export default memo(({ colorRows, ...pageProps }) => {
5
+ return (<Host style={{ flex: 1 }}>
6
+ <Column verticalArrangement={{ spacedBy: 16 }}>
7
+ {colorRows.map((row, index) => (<Row key={index} verticalArrangement="spaceEvenly">
8
+ {row.map((color, indexColor) => (<Item color={color} size={55} {...pageProps}/>))}
9
+ </Row>))}
10
+ </Column>
11
+ </Host>);
12
+ });
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type Props from './types';
3
+ declare const _default: React.MemoExoticComponent<({ color, size, selectedColor, onSelectColor, }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { clip, size as sizeModifier, border, background, clickable } from '@expo/ui/jetpack-compose/modifiers';
2
+ import { Box } from '@expo/ui/jetpack-compose';
3
+ import React, { memo, useMemo } from 'react';
4
+ import { colors } from '../../../../libs/components/Gradient';
5
+ export default memo(({ color, size, selectedColor, onSelectColor, }) => {
6
+ const modifiers = useMemo(() => [
7
+ sizeModifier(size, size),
8
+ border(2, colors[color].light),
9
+ background(colors[color].middle),
10
+ clip({ type: 'circle' }),
11
+ clickable(() => onSelectColor?.(color))
12
+ ], []);
13
+ return <Box modifiers={modifiers}/>;
14
+ });
@@ -6,9 +6,9 @@ export default memo(({ onSelectColor, ...restProps }) => {
6
6
  const router = useRouter();
7
7
  const listColors = useMemo(() => Object.keys(colors), []);
8
8
  const colorRows = useMemo(() => Array.from({ length: Math.ceil(listColors.length / 4) }, (_, i) => listColors.slice(i * 4, i * 4 + 4)), [listColors]);
9
- const _onSelectColor = useCallback((color) => {
9
+ const _onSelectColor = useCallback(async (color) => {
10
+ await onSelectColor?.(color);
10
11
  router.back();
11
- onSelectColor?.(color);
12
12
  }, [onSelectColor]);
13
13
  return (<>
14
14
  <Stack.Screen.Title>Color de fondo</Stack.Screen.Title>
@@ -51,34 +51,34 @@ function Component({ data = [], renderItem, onSave, }) {
51
51
  isUniqueItem: (data?.length ?? 0) === 1,
52
52
  textFieldsRefs
53
53
  }), []);
54
- return (<>
55
- <Stack.Toolbar placement="left">
56
- <Stack.Toolbar.Button onPress={() => router.back()}>
57
- <Stack.Toolbar.Icon sf="xmark"/>
58
- </Stack.Toolbar.Button>
59
- </Stack.Toolbar>
60
-
61
- <Stack.Toolbar placement="right">
62
- <Stack.Toolbar.Button disabled={!saveEnabled} variant="done" onPress={onPressSave}>
63
- <Stack.Toolbar.Icon sf="checkmark"/>
64
- </Stack.Toolbar.Button>
65
- </Stack.Toolbar>
66
-
67
- <Host style={{ flex: 1 }}>
68
- <List>
69
- <Section>
70
- <Provider value={value}>
54
+ return (<>
55
+ <Stack.Toolbar placement="left">
56
+ <Stack.Toolbar.Button onPress={() => router.back()}>
57
+ <Stack.Toolbar.Icon sf="xmark"/>
58
+ </Stack.Toolbar.Button>
59
+ </Stack.Toolbar>
60
+
61
+ <Stack.Toolbar placement="right">
62
+ <Stack.Toolbar.Button disabled={!saveEnabled} variant="done" onPress={onPressSave}>
63
+ <Stack.Toolbar.Icon sf="checkmark"/>
64
+ </Stack.Toolbar.Button>
65
+ </Stack.Toolbar>
66
+
67
+ <Host style={{ flex: 1 }}>
68
+ <List>
69
+ <Section>
70
+ <Provider value={value}>
71
71
  {data.map((item, index) => {
72
72
  const nextIndex = index + 1;
73
73
  const value = { index, nextIndex: nextIndex < data.length ? nextIndex : undefined };
74
- return (<ItemProvider key={index} value={value}>
75
- {renderItem?.(item)}
74
+ return (<ItemProvider key={index} value={value}>
75
+ {renderItem?.(item)}
76
76
  </ItemProvider>);
77
- })}
78
- </Provider>
79
- </Section>
80
- </List>
81
- </Host>
77
+ })}
78
+ </Provider>
79
+ </Section>
80
+ </List>
81
+ </Host>
82
82
  </>);
83
83
  }
84
84
  export default memo(Component);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.79",
3
+ "version": "1.0.81",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",