native-pytech 1.0.156 → 1.0.157

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.
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type Props from './types';
2
- declare const _default: import("react").MemoExoticComponent<({ color, size, selectedColor, onSelectColor, }: Props) => import("react").JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ color, size, selectedColor, onSelectColor, renderGradientIOS }: Props) => React.JSX.Element | null>;
3
4
  export default _default;
@@ -1,8 +1,10 @@
1
1
  import { background, clipShape, buttonStyle, controlSize, frame, glassEffect, padding, foregroundStyle } from '@expo/ui/swift-ui/modifiers';
2
2
  import { Text, Button } from '@expo/ui/swift-ui';
3
- import { memo, useMemo } from 'react';
3
+ import React, { memo, useMemo } from 'react';
4
4
  import { colors } from '../../../../libs/components/Gradient';
5
- export default memo(({ color, size, selectedColor, onSelectColor, }) => {
5
+ export default memo(({ color, size, selectedColor, onSelectColor, renderGradientIOS }) => {
6
+ if (!renderGradientIOS)
7
+ return null;
6
8
  const modifiersButton = useMemo(() => [
7
9
  buttonStyle('plain'),
8
10
  controlSize('large'),
@@ -17,6 +19,9 @@ export default memo(({ color, size, selectedColor, onSelectColor, }) => {
17
19
  shape: 'circle'
18
20
  })
19
21
  ], []);
22
+ return (<Button onPress={() => onSelectColor?.(color)} modifiers={modifiersButton}>
23
+ {React.createElement(renderGradientIOS, { color, iconSize: size })}
24
+ </Button>);
20
25
  const modifiers = useMemo(() => [
21
26
  frame({ width: size, height: size }),
22
27
  foregroundStyle('transparent'),
@@ -11,8 +11,14 @@ type Props = {
11
11
  onSelectColor?: (color: ColorsType) => void;
12
12
  /**
13
13
  Function to render the item.
14
+ @platform android
14
15
  */
15
16
  renderGradient?: (props: renderGradientProps) => React.ReactNode;
17
+ /**
18
+ Function to render the item.
19
+ @platform ios
20
+ */
21
+ renderGradientIOS?: (props: renderGradientIOSProps) => React.ReactNode;
16
22
  };
17
23
  type renderGradientProps = {
18
24
  /**
@@ -24,4 +30,10 @@ type renderGradientProps = {
24
30
  */
25
31
  size: number;
26
32
  };
33
+ type renderGradientIOSProps = Omit<renderGradientProps, 'size'> & {
34
+ /**
35
+ Size of the item.
36
+ */
37
+ iconSize: number;
38
+ };
27
39
  export default Props;
@@ -1,3 +1,3 @@
1
- export { sizes, colors, ColorsType } from './constants';
1
+ export { sizes, colors, ColorsType, sizesType } 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.156",
3
+ "version": "1.0.157",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",