native-pytech 1.0.81 → 1.0.86

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 +1 @@
1
- export { default } from '../libs/colorPage';
1
+ export * from '../libs/colorPage';
@@ -1 +1 @@
1
- export { default } from '../libs/colorPage';
1
+ export * from '../libs/colorPage';
@@ -1 +1,3 @@
1
1
  export { default } from './src/Page';
2
+ export { default as ColorPageProps } from './src/Page/types';
3
+ export { default as renderItemProps } from './src/Item/types';
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type Props from './types';
3
- declare const _default: React.MemoExoticComponent<({ colorRows, ...pageProps }: Props) => React.JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ colorRows, renderItem, ...pageProps }: Props) => React.JSX.Element>;
4
4
  export default _default;
@@ -1,11 +1,10 @@
1
1
  import { Host, Column, Row } from '@expo/ui/jetpack-compose';
2
2
  import React, { memo } from 'react';
3
- import Item from '../Item';
4
- export default memo(({ colorRows, ...pageProps }) => {
3
+ export default memo(({ colorRows, renderItem, ...pageProps }) => {
5
4
  return (<Host style={{ flex: 1 }}>
6
5
  <Column verticalArrangement={{ spacedBy: 16 }}>
7
6
  {colorRows.map((row, index) => (<Row key={index} verticalArrangement="spaceEvenly">
8
- {row.map((color, indexColor) => (<Item color={color} size={55} {...pageProps}/>))}
7
+ {row.map((color, indexColor) => (renderItem?.({ color, size: 55, ...pageProps })))}
9
8
  </Row>))}
10
9
  </Column>
11
10
  </Host>);
@@ -1,6 +1,6 @@
1
1
  import type { ColorsType } from '../../../../libs/components/Gradient';
2
- import PropsPage from '../Page/types';
3
- type Props = PropsPage & {
2
+ import { BaseProps } from '../Page/types';
3
+ type Props = BaseProps & {
4
4
  /**
5
5
  Color to display.
6
6
  */
@@ -1,5 +1,6 @@
1
1
  import type { ColorsType } from '../../../../libs/components/Gradient';
2
- type Props = {
2
+ import type itemProps from '../Item/types';
3
+ export type BaseProps = {
3
4
  /**
4
5
  Title of the date picker.
5
6
  @default 'default'
@@ -10,4 +11,10 @@ type Props = {
10
11
  */
11
12
  onSelectColor?: (color: ColorsType) => void;
12
13
  };
14
+ type Props = BaseProps & {
15
+ /**
16
+ Function to render the item.
17
+ */
18
+ renderItem?: (props: itemProps) => React.ReactNode;
19
+ };
13
20
  export default Props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.81",
3
+ "version": "1.0.86",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,4 +0,0 @@
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;
@@ -1,14 +0,0 @@
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
- });