native-pytech 1.0.51 → 1.0.53

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<({ text, color, type, systemName, iconSize, }: Props) => React.JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import React, { memo, useMemo } from 'react';
2
+ import { frame, font, foregroundStyle, background, clipShape } from '@expo/ui/swift-ui/modifiers';
3
+ import { Text, Image } from '@expo/ui/swift-ui';
4
+ import colors, { sizes } from '../../constants';
5
+ export default memo(({ text, color, type = 'small', systemName, iconSize, }) => {
6
+ const typeSizes = useMemo(() => sizes[type], [type]);
7
+ const cantLetras = text?.length ?? 0;
8
+ const modifiers = useMemo(() => [
9
+ frame({ width: typeSizes.diameter, height: typeSizes.diameter }),
10
+ font({ weight: 'semibold', size: typeSizes.fontSize[cantLetras] }),
11
+ foregroundStyle('white'),
12
+ background(colors[color].dark),
13
+ clipShape('circle'),
14
+ ], [typeSizes]);
15
+ // Return
16
+ if (text && cantLetras <= 3) {
17
+ return (<Text modifiers={[
18
+ font({ weight: 'semibold', size: typeSizes.fontSize[cantLetras] }),
19
+ ...modifiers
20
+ ]}>
21
+ {text}
22
+ </Text>);
23
+ }
24
+ return (<Image systemName={systemName} color='white' size={iconSize ?? typeSizes.diameter / 2} modifiers={modifiers}/>);
25
+ });
@@ -1,4 +1,4 @@
1
- import { Button, RNHostView, VStack } from '@expo/ui/swift-ui';
1
+ import { Button, VStack } from '@expo/ui/swift-ui';
2
2
  import { frame, font, buttonStyle } from '@expo/ui/swift-ui/modifiers';
3
3
  import React, { memo } from 'react';
4
4
  import Gradient from '../../../../../libs/components/Gradient';
@@ -7,9 +7,7 @@ import Section from './Section';
7
7
  export default memo(({ title, subtitle, gradientProps, buttonProps, }) => {
8
8
  const spacing = gradientProps?.type === 'extraLarge' ? 10 : 20;
9
9
  return (<Section spacing={spacing}>
10
- {gradientProps && (<RNHostView matchContents>
11
- <Gradient {...gradientProps}/>
12
- </RNHostView>)}
10
+ {gradientProps && (<Gradient {...gradientProps}/>)}
13
11
 
14
12
  {(title || subtitle) && (subtitle ? (<VStack modifiers={[frame({ alignment: 'center' })]} spacing={2}>
15
13
  <Title title={title}/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-pytech",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "Libreria de React Native Pytech",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +0,0 @@
1
- import type Props from './types';
2
- declare const _default: ({ systemName, size }: Props) => import("react").JSX.Element;
3
- export default _default;
@@ -1,6 +0,0 @@
1
- import { Host, Image } from '@expo/ui/swift-ui';
2
- export default ({ systemName, size = 100 }) => {
3
- return (<Host matchContents>
4
- <Image systemName={systemName} color='white' size={size}/>
5
- </Host>);
6
- };