@codeleap/mobile 5.7.0 → 5.8.1

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,12 +1,8 @@
1
- /// <reference types="react" />
2
1
  import { InputBaseProps } from './types';
2
+ import { StyledComponentWithProps } from '@codeleap/styles';
3
3
  export { useInputBase } from './useInputBase';
4
4
  export * from './styles';
5
5
  export * from './utils';
6
6
  export * from './types';
7
7
  export declare const InputBaseDefaultOrder: InputBaseProps['order'];
8
- export declare const InputBase: {
9
- (props: InputBaseProps): JSX.Element;
10
- elements: string[];
11
- defaultProps: Partial<InputBaseProps>;
12
- };
8
+ export declare const InputBase: StyledComponentWithProps<InputBaseProps>;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
  import { TypeGuards } from '@codeleap/types';
3
3
  import { getRenderedComponent } from '@codeleap/utils';
4
4
  import { ActionIcon } from '../ActionIcon';
@@ -16,8 +16,8 @@ export const InputBaseDefaultOrder = [
16
16
  'innerWrapper',
17
17
  'error',
18
18
  ];
19
- export const InputBase = (props) => {
20
- const { children, error = null, label, description = null, leftIcon = null, rightIcon = null, wrapper, debugName, innerWrapper, focused, innerWrapperProps = {}, wrapperProps = {}, disabled, order = InputBaseDefaultOrder, style, labelAsRow, hideErrorMessage, ref, ...otherProps } = {
19
+ export const InputBase = forwardRef((props, ref) => {
20
+ const { children, error = null, label, description = null, leftIcon = null, rightIcon = null, wrapper, debugName, innerWrapper, focused, innerWrapperProps = {}, wrapperProps = {}, disabled, order = InputBaseDefaultOrder, style, labelAsRow, hideErrorMessage, ...otherProps } = {
21
21
  ...InputBase.defaultProps,
22
22
  ...props,
23
23
  };
@@ -51,7 +51,7 @@ export const InputBase = (props) => {
51
51
  {TypeGuards.isString(error) ? <Text text={error} style={styles.errorStyle}/> : error}
52
52
  </RNAnimated.View>)}
53
53
  </WrapperComponent>;
54
- };
54
+ });
55
55
  InputBase.elements = ['wrapper', 'innerWrapper', 'label', 'errorMessage', 'description', 'icon', 'leftIcon', 'rightIcon'];
56
56
  InputBase.defaultProps = {
57
57
  disabled: false,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/InputBase/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAmB,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,UAAU,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AAEvB,MAAM,CAAC,MAAM,qBAAqB,GAA4B;IAC5D,OAAO;IACP,aAAa;IACb,cAAc;IACd,OAAO;CACR,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IACjD,MAAM,EACJ,QAAQ,EACR,KAAK,GAAG,IAAI,EACZ,KAAK,EACL,WAAW,GAAG,IAAI,EAClB,QAAQ,GAAG,IAAI,EACf,SAAS,GAAG,IAAI,EAChB,OAAO,EACP,SAAS,EACT,YAAY,EACZ,OAAO,EACP,iBAAiB,GAAG,EAAE,EACtB,YAAY,GAAG,EAAE,EACjB,QAAQ,EACR,KAAK,GAAG,qBAAqB,EAC7B,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,GAAG,EACH,GAAG,UAAU,EACd,GAAG;QACF,GAAG,S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AAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAC9E;QAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,EAAG,CAAC,CAAC,CAAC,KAAK,CACvF;MAAA,EAAE,UAAU,CAAC,IAAI,CAAC,CACnB,CACH;EAAA,EAAE,gBAAgB,CAAC,CAAA;AACrB,CAAC,CAA6C,CAAA;AAE9C,SAAS,CAAC,QAAQ,GAAG,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAA;AAEzH,SAAS,CAAC,YAAY,GAAG;IACvB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,KAAK;IACvB,KAAK,EAAE,qBAAqB;IAC5B,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,IAAI;CACQ,CAAA"}
@@ -2,7 +2,7 @@
2
2
  import { PropsOf, StylesOf } from '@codeleap/types';
3
3
  import { InputBaseComposition } from './styles';
4
4
  import { ActionIcon } from '../ActionIcon';
5
- import { View, ViewProps } from 'react-native';
5
+ import { ViewProps } from 'react-native';
6
6
  type ActionIconProps = PropsOf<typeof ActionIcon>;
7
7
  type OrderedParts = 'label' | 'description' | 'innerWrapper' | 'error';
8
8
  type IconProp = Partial<ActionIconProps> | JSX.Element;
@@ -24,7 +24,7 @@ export type InputBaseProps = React.PropsWithChildren<{
24
24
  labelAsRow?: boolean;
25
25
  hideErrorMessage?: boolean;
26
26
  hasValue?: boolean;
27
- ref?: React.Ref<View>;
28
27
  onLayout?: ViewProps['onLayout'];
28
+ ref?: any;
29
29
  }>;
30
30
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/mobile",
3
- "version": "5.7.0",
3
+ "version": "5.8.1",
4
4
  "main": "src/index.ts",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -9,28 +9,28 @@
9
9
  "directory": "packages/mobile"
10
10
  },
11
11
  "devDependencies": {
12
- "@codeleap/types": "5.7.0",
13
- "@codeleap/utils": "5.7.0",
14
- "@codeleap/hooks": "5.7.0",
15
- "@codeleap/form": "5.7.0",
16
- "@codeleap/query": "5.7.0",
17
- "@codeleap/logger": "5.7.0",
18
- "@codeleap/config": "5.7.0",
19
- "@codeleap/modals": "5.7.0"
12
+ "@codeleap/types": "5.8.1",
13
+ "@codeleap/utils": "5.8.1",
14
+ "@codeleap/hooks": "5.8.1",
15
+ "@codeleap/form": "5.8.1",
16
+ "@codeleap/query": "5.8.1",
17
+ "@codeleap/logger": "5.8.1",
18
+ "@codeleap/config": "5.8.1",
19
+ "@codeleap/modals": "5.8.1"
20
20
  },
21
21
  "scripts": {
22
22
  "build": "tsc --build",
23
23
  "lint": "eslint -c .eslintrc.js --fix \"./src/**/*.{ts,tsx,js,jsx}\""
24
24
  },
25
25
  "peerDependencies": {
26
- "@codeleap/types": "5.7.0",
27
- "@codeleap/utils": "5.7.0",
28
- "@codeleap/hooks": "5.7.0",
29
- "@codeleap/form": "5.7.0",
30
- "@codeleap/query": "5.7.0",
31
- "@codeleap/logger": "5.7.0",
32
- "@codeleap/styles": "5.7.0",
33
- "@codeleap/modals": "5.7.0",
26
+ "@codeleap/types": "5.8.1",
27
+ "@codeleap/utils": "5.8.1",
28
+ "@codeleap/hooks": "5.8.1",
29
+ "@codeleap/form": "5.8.1",
30
+ "@codeleap/query": "5.8.1",
31
+ "@codeleap/logger": "5.8.1",
32
+ "@codeleap/styles": "5.8.1",
33
+ "@codeleap/modals": "5.8.1",
34
34
  "@d11/react-native-fast-image": "8.9.2",
35
35
  "@react-native-firebase/messaging": "21.12.0",
36
36
  "@react-navigation/bottom-tabs": "7.3.10",
package/package.json.bak CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/mobile",
3
- "version": "5.7.0",
3
+ "version": "5.8.1",
4
4
  "main": "src/index.ts",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React, { forwardRef } from 'react'
2
2
  import { TypeGuards } from '@codeleap/types'
3
3
  import { getRenderedComponent } from '@codeleap/utils'
4
4
  import { ActionIcon, ActionIconProps } from '../ActionIcon'
@@ -7,6 +7,8 @@ import { useInputBaseStyles } from './styles'
7
7
  import { InputBaseProps } from './types'
8
8
  import { Text } from '../Text'
9
9
  import RNAnimated, { FadeIn, FadeOut } from 'react-native-reanimated'
10
+ import { View as RNView } from 'react-native'
11
+ import { StyledComponentWithProps } from '@codeleap/styles'
10
12
 
11
13
  export { useInputBase } from './useInputBase'
12
14
 
@@ -21,7 +23,7 @@ export const InputBaseDefaultOrder: InputBaseProps['order'] = [
21
23
  'error',
22
24
  ]
23
25
 
24
- export const InputBase = (props: InputBaseProps) => {
26
+ export const InputBase = forwardRef<RNView, InputBaseProps>((props: InputBaseProps, ref) => {
25
27
  const {
26
28
  children,
27
29
  error = null,
@@ -40,7 +42,6 @@ export const InputBase = (props: InputBaseProps) => {
40
42
  style,
41
43
  labelAsRow,
42
44
  hideErrorMessage,
43
- ref,
44
45
  ...otherProps
45
46
  } = {
46
47
  ...InputBase.defaultProps,
@@ -89,7 +90,7 @@ export const InputBase = (props: InputBaseProps) => {
89
90
  </RNAnimated.View>
90
91
  )}
91
92
  </WrapperComponent>
92
- }
93
+ }) as StyledComponentWithProps<InputBaseProps>
93
94
 
94
95
  InputBase.elements = ['wrapper', 'innerWrapper', 'label', 'errorMessage', 'description', 'icon', 'leftIcon', 'rightIcon']
95
96
 
@@ -26,6 +26,6 @@ export type InputBaseProps = React.PropsWithChildren<{
26
26
  labelAsRow?: boolean
27
27
  hideErrorMessage?: boolean
28
28
  hasValue?: boolean
29
- ref?: React.Ref<View>
30
29
  onLayout?: ViewProps['onLayout']
30
+ ref?: any
31
31
  }>