native-pytech 1.0.63 → 1.0.65

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 @@
1
+ export { default } from '../libs/colorPage';
@@ -0,0 +1 @@
1
+ export { default } from '../libs/colorPage';
@@ -0,0 +1 @@
1
+ export { default } from './src/Page';
@@ -0,0 +1 @@
1
+ export { default } from './src/Page';
@@ -0,0 +1,3 @@
1
+ import type Props from "./types";
2
+ declare const _default: ({ ...props }: Props) => any;
3
+ export default _default;
@@ -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,16 @@
1
+ import { Host, HStack, VStack, Spacer } from '@expo/ui/swift-ui';
2
+ import React, { memo, Fragment } from 'react';
3
+ import Item from '../Item';
4
+ export default memo(({ colorRows, ...pageProps }) => {
5
+ return (<Host style={{ flex: 1 }}>
6
+ <VStack spacing={16}>
7
+ {colorRows.map((row, index) => (<HStack key={index}>
8
+ {row.map((color, indexColor) => (<Fragment key={color}>
9
+ {indexColor === 0 && <Spacer />}
10
+ <Item color={color} size={55} {...pageProps}/>
11
+ <Spacer />
12
+ </Fragment>))}
13
+ </HStack>))}
14
+ </VStack>
15
+ </Host>);
16
+ });
@@ -0,0 +1 @@
1
+ export default ({ ...props }) => null;
@@ -0,0 +1,10 @@
1
+ import type { ColorsType } from '../../../../libs/components/Gradient';
2
+ import PropsPage from '../Page/types';
3
+ type Props = PropsPage & {
4
+ /**
5
+ List of rows of colors to display.
6
+ Each row contains 4 colors.
7
+ */
8
+ colorRows: ColorsType[][];
9
+ };
10
+ export default Props;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type Props from "./types";
2
+ declare const _default: ({ ...props }: Props) => any;
3
+ export default _default;
@@ -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,31 @@
1
+ import { background, clipShape, buttonStyle, controlSize, frame, glassEffect, padding, foregroundStyle } from '@expo/ui/swift-ui/modifiers';
2
+ import { Text, Button } from '@expo/ui/swift-ui';
3
+ import React, { memo, useMemo } from 'react';
4
+ import { colors } from '../../../../libs/components/Gradient';
5
+ export default memo(({ color, size, selectedColor, onSelectColor, }) => {
6
+ const modifiersButton = useMemo(() => [
7
+ buttonStyle('plain'),
8
+ controlSize('large'),
9
+ padding({ all: 1.5 }),
10
+ clipShape('circle'),
11
+ glassEffect({
12
+ glass: {
13
+ variant: 'regular',
14
+ interactive: true,
15
+ tint: colors[color].light
16
+ },
17
+ shape: 'circle'
18
+ })
19
+ ], []);
20
+ const modifiers = useMemo(() => [
21
+ frame({ width: size, height: size }),
22
+ foregroundStyle('transparent'),
23
+ background(colors[color].middle),
24
+ clipShape('circle'),
25
+ ], [size]);
26
+ return (<Button modifiers={modifiersButton} onPress={() => onSelectColor?.(color)}>
27
+ <Text modifiers={modifiers}>
28
+ .
29
+ </Text>
30
+ </Button>);
31
+ });
@@ -0,0 +1 @@
1
+ export default ({ ...props }) => null;
@@ -0,0 +1,13 @@
1
+ import type { ColorsType } from '../../../../libs/components/Gradient';
2
+ import PropsPage from '../Page/types';
3
+ type Props = PropsPage & {
4
+ /**
5
+ Color to display.
6
+ */
7
+ color: ColorsType;
8
+ /**
9
+ Size of the item.
10
+ */
11
+ size: number;
12
+ };
13
+ export default Props;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type Props from './types';
3
+ declare const _default: React.MemoExoticComponent<({ onSelectColor, ...restProps }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import React, { memo, useMemo, useCallback } from 'react';
2
+ import { Stack, useRouter } from 'expo-router';
3
+ import { colors } from '../../../../libs/components/Gradient';
4
+ import Content from '../Content';
5
+ export default memo(({ onSelectColor, ...restProps }) => {
6
+ const router = useRouter();
7
+ const listColors = useMemo(() => Object.keys(colors), []);
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) => {
10
+ router.back();
11
+ onSelectColor?.(color);
12
+ }, [onSelectColor]);
13
+ return (<>
14
+ <Stack.Screen.Title>Color de fondo</Stack.Screen.Title>
15
+ <Content colorRows={colorRows} onSelectColor={_onSelectColor} {...restProps}/>
16
+ </>);
17
+ });
@@ -0,0 +1,13 @@
1
+ import type { ColorsType } from '../../../../libs/components/Gradient';
2
+ type Props = {
3
+ /**
4
+ Title of the date picker.
5
+ @default 'default'
6
+ */
7
+ selectedColor?: ColorsType;
8
+ /**
9
+ Function to be called when the user selects a color.
10
+ */
11
+ onSelectColor?: (color: ColorsType) => void;
12
+ };
13
+ export default Props;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { sizesType, Colors } from '../../constants';
1
+ import { sizesType, ColorsType } from '../../constants';
2
2
  import IconProps from '../Icon/types';
3
3
  export type Props = Omit<IconProps, 'size'> & {
4
4
  /**
@@ -10,7 +10,7 @@ export type Props = Omit<IconProps, 'size'> & {
10
10
  The color of the gradient.
11
11
  @default 'default'
12
12
  */
13
- color?: Colors;
13
+ color?: ColorsType;
14
14
  /**
15
15
  The size of the gradient.
16
16
  @default 'small'
@@ -80,7 +80,7 @@ export declare const colors: {
80
80
  light: string;
81
81
  };
82
82
  };
83
- export type Colors = keyof typeof colors;
83
+ export type ColorsType = keyof typeof colors;
84
84
  declare const diameterCircle: {
85
85
  small: number;
86
86
  medium: number;
@@ -1,3 +1,3 @@
1
- export { sizes, colors, Colors } from './constants';
1
+ export { sizes, colors, ColorsType } from './constants';
2
2
  export { Props } from './components/Gradient/types';
3
3
  export { default } from './components/Gradient';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",