@navegarti/rn-design-system 0.8.2 → 0.8.5

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.
Files changed (119) hide show
  1. package/lib/module/components/Button/styles.js +4 -2
  2. package/lib/module/components/Button/types.js +4 -0
  3. package/lib/module/components/Checkbox/types.js +4 -0
  4. package/lib/module/components/FAB/types.js +4 -0
  5. package/lib/module/components/Flex/types.js +4 -0
  6. package/lib/module/components/FormLabel/types.js +4 -0
  7. package/lib/module/components/Input/styles.js +6 -3
  8. package/lib/module/components/Input/types.js +4 -0
  9. package/lib/module/components/Margin/styles.js +4 -6
  10. package/lib/module/components/Margin/types.js +2 -0
  11. package/lib/module/components/OTPInput/index.js +50 -67
  12. package/lib/module/components/OTPInput/types.js +4 -0
  13. package/lib/module/components/Padding/styles.js +4 -6
  14. package/lib/module/components/Padding/types.js +2 -0
  15. package/lib/module/components/Radio/types.js +4 -0
  16. package/lib/module/components/Select/types.js +4 -0
  17. package/lib/module/components/Skeleton/types.js +4 -0
  18. package/lib/module/components/Switch/types.js +4 -0
  19. package/lib/module/components/Text/styles.js +3 -1
  20. package/lib/module/components/Text/types.js +4 -0
  21. package/lib/typescript/src/components/Button/index.d.ts +3 -81
  22. package/lib/typescript/src/components/Button/styles.d.ts +2 -87
  23. package/lib/typescript/src/components/Button/types.d.ts +8 -0
  24. package/lib/typescript/src/components/Card/index.d.ts +55 -322
  25. package/lib/typescript/src/components/Card/styles.d.ts +55 -322
  26. package/lib/typescript/src/components/Carousel/index.d.ts +10 -17
  27. package/lib/typescript/src/components/Checkbox/index.d.ts +3 -8
  28. package/lib/typescript/src/components/Checkbox/styles.d.ts +9 -4
  29. package/lib/typescript/src/components/Checkbox/types.d.ts +8 -0
  30. package/lib/typescript/src/components/FAB/components/extended-fab.d.ts +1 -1
  31. package/lib/typescript/src/components/FAB/index.d.ts +3 -3
  32. package/lib/typescript/src/components/FAB/styles.d.ts +9 -103
  33. package/lib/typescript/src/components/FAB/types.d.ts +16 -0
  34. package/lib/typescript/src/components/Flex/index.d.ts +1 -0
  35. package/lib/typescript/src/components/Flex/styles.d.ts +10 -7
  36. package/lib/typescript/src/components/Flex/types.d.ts +3 -0
  37. package/lib/typescript/src/components/FormLabel/index.d.ts +3 -2
  38. package/lib/typescript/src/components/FormLabel/styles.d.ts +1 -79
  39. package/lib/typescript/src/components/FormLabel/types.d.ts +3 -0
  40. package/lib/typescript/src/components/Input/components/input-field.d.ts +2 -6
  41. package/lib/typescript/src/components/Input/components/input-root.d.ts +1 -7
  42. package/lib/typescript/src/components/Input/index.d.ts +3 -9
  43. package/lib/typescript/src/components/Input/styles.d.ts +29 -170
  44. package/lib/typescript/src/components/Input/types.d.ts +11 -0
  45. package/lib/typescript/src/components/Margin/index.d.ts +1 -0
  46. package/lib/typescript/src/components/Margin/styles.d.ts +11 -17
  47. package/lib/typescript/src/components/Margin/types.d.ts +12 -0
  48. package/lib/typescript/src/components/OTPInput/index.d.ts +3 -15
  49. package/lib/typescript/src/components/OTPInput/types.d.ts +12 -0
  50. package/lib/typescript/src/components/Padding/index.d.ts +1 -0
  51. package/lib/typescript/src/components/Padding/styles.d.ts +11 -17
  52. package/lib/typescript/src/components/Padding/types.d.ts +12 -0
  53. package/lib/typescript/src/components/Radio/components/radio-item.d.ts +1 -6
  54. package/lib/typescript/src/components/Radio/index.d.ts +3 -83
  55. package/lib/typescript/src/components/Radio/styles.d.ts +18 -8
  56. package/lib/typescript/src/components/Radio/types.d.ts +12 -0
  57. package/lib/typescript/src/components/Select/components/select-field.d.ts +2 -4
  58. package/lib/typescript/src/components/Select/index.d.ts +3 -6
  59. package/lib/typescript/src/components/Select/styles.d.ts +2 -158
  60. package/lib/typescript/src/components/Select/types.d.ts +7 -0
  61. package/lib/typescript/src/components/Skeleton/index.d.ts +2 -9
  62. package/lib/typescript/src/components/Skeleton/types.d.ts +9 -0
  63. package/lib/typescript/src/components/Switch/index.d.ts +2 -9
  64. package/lib/typescript/src/components/Switch/styles.d.ts +18 -8
  65. package/lib/typescript/src/components/Switch/types.d.ts +9 -0
  66. package/lib/typescript/src/components/Text/index.d.ts +1 -1
  67. package/lib/typescript/src/components/Text/styles.d.ts +2 -93
  68. package/lib/typescript/src/components/Text/types.d.ts +15 -0
  69. package/lib/typescript/src/components.d.ts +11 -0
  70. package/lib/typescript/src/index.d.ts +11 -0
  71. package/package.json +16 -38
  72. package/src/components/Button/index.tsx +3 -2
  73. package/src/components/Button/styles.ts +6 -10
  74. package/src/components/Button/types.ts +8 -0
  75. package/src/components/Checkbox/index.tsx +3 -8
  76. package/src/components/Checkbox/types.ts +8 -0
  77. package/src/components/FAB/components/extended-fab.tsx +2 -5
  78. package/src/components/FAB/index.tsx +3 -2
  79. package/src/components/FAB/styles.ts +2 -24
  80. package/src/components/FAB/types.ts +18 -0
  81. package/src/components/Flex/index.tsx +1 -0
  82. package/src/components/Flex/styles.ts +1 -15
  83. package/src/components/Flex/types.ts +16 -0
  84. package/src/components/FormLabel/index.tsx +4 -2
  85. package/src/components/FormLabel/types.ts +3 -0
  86. package/src/components/Input/components/input-field.tsx +2 -6
  87. package/src/components/Input/components/input-root.tsx +1 -7
  88. package/src/components/Input/index.tsx +2 -0
  89. package/src/components/Input/styles.ts +6 -3
  90. package/src/components/Input/types.ts +12 -0
  91. package/src/components/Margin/index.tsx +1 -0
  92. package/src/components/Margin/styles.ts +6 -18
  93. package/src/components/Margin/types.ts +11 -0
  94. package/src/components/OTPInput/index.tsx +54 -99
  95. package/src/components/OTPInput/types.ts +13 -0
  96. package/src/components/Padding/index.tsx +1 -0
  97. package/src/components/Padding/styles.ts +6 -18
  98. package/src/components/Padding/types.ts +11 -0
  99. package/src/components/Radio/components/radio-item.tsx +1 -7
  100. package/src/components/Radio/index.tsx +2 -8
  101. package/src/components/Radio/types.ts +14 -0
  102. package/src/components/Select/components/select-field.tsx +2 -4
  103. package/src/components/Select/index.tsx +2 -4
  104. package/src/components/Select/types.ts +8 -0
  105. package/src/components/Skeleton/index.tsx +6 -9
  106. package/src/components/Skeleton/types.ts +9 -0
  107. package/src/components/Switch/index.tsx +3 -9
  108. package/src/components/Switch/types.ts +10 -0
  109. package/src/components/Text/index.tsx +1 -1
  110. package/src/components/Text/styles.ts +3 -18
  111. package/src/components/Text/types.ts +16 -0
  112. package/src/components.tsx +11 -0
  113. package/src/index.tsx +11 -0
  114. package/lib/module/components/OTPInput/styles.js +0 -23
  115. package/lib/module/components/OTPInput/utils.js +0 -24
  116. package/lib/typescript/src/components/OTPInput/styles.d.ts +0 -214
  117. package/lib/typescript/src/components/OTPInput/utils.d.ts +0 -3
  118. package/src/components/OTPInput/styles.ts +0 -23
  119. package/src/components/OTPInput/utils.ts +0 -31
@@ -0,0 +1,8 @@
1
+ import type { CheckboxProps as ExpoCheckboxProps } from 'expo-checkbox';
2
+ import type { ViewProps } from 'react-native';
3
+
4
+ export type CheckboxProps = {
5
+ value: boolean;
6
+ onValueChange: (value: boolean) => void;
7
+ containerProps?: ViewProps;
8
+ } & Omit<ExpoCheckboxProps, 'OnValueChange'>;
@@ -1,8 +1,5 @@
1
- import {
2
- ExtendedFABContainer,
3
- type ExtendedFABProps,
4
- FABText,
5
- } from '../styles';
1
+ import { ExtendedFABContainer, FABText } from '../styles';
2
+ import type { ExtendedFABProps } from '../types';
6
3
 
7
4
  export const ExtendedFAB = ({
8
5
  label,
@@ -1,7 +1,8 @@
1
1
  import { ExtendedFAB } from './components/extended-fab';
2
- import { DefaultFABStyle, type FABProps, LargeFAB, SmallFAB } from './styles';
2
+ import { DefaultFABStyle, LargeFAB, SmallFAB } from './styles';
3
+ import type { FABProps } from './types';
3
4
 
4
- export type { ExtendedFABProps, FABProps } from './styles';
5
+ export type { ExtendedFABProps, FABProps } from './types';
5
6
 
6
7
  const DefaultFAB = (props: FABProps) => (
7
8
  <DefaultFABStyle activeOpacity={0.9} {...props} />
@@ -1,30 +1,8 @@
1
1
  import styled from '@emotion/native';
2
- import type { TouchableOpacityProps } from 'react-native';
3
2
 
4
3
  import { Text } from '../Text';
5
- import {
6
- getPositionStyle,
7
- getSizeStyle,
8
- type Position,
9
- type Size,
10
- } from './utils';
11
-
12
- type FABProps = {
13
- position?: Position;
14
- size?: Size;
15
- color?: string;
16
- offset?: {
17
- horizontal?: number;
18
- vertical?: number;
19
- };
20
- } & TouchableOpacityProps;
21
-
22
- export type { FABProps };
23
-
24
- export type ExtendedFABProps = FABProps & {
25
- label: string;
26
- labelColor?: string;
27
- };
4
+ import type { FABProps } from './types';
5
+ import { getPositionStyle, getSizeStyle } from './utils';
28
6
 
29
7
  export const DefaultFABStyle = styled.TouchableOpacity<FABProps>(
30
8
  ({ position, size, color, offset }) => ({
@@ -0,0 +1,18 @@
1
+ import type { TouchableOpacityProps } from 'react-native';
2
+
3
+ import type { Position, Size } from './utils';
4
+
5
+ export type FABProps = {
6
+ position?: Position;
7
+ size?: Size;
8
+ color?: string;
9
+ offset?: {
10
+ horizontal?: number;
11
+ vertical?: number;
12
+ };
13
+ } & TouchableOpacityProps;
14
+
15
+ export type ExtendedFABProps = FABProps & {
16
+ label: string;
17
+ labelColor?: string;
18
+ };
@@ -1 +1,2 @@
1
1
  export { Flex } from './styles';
2
+ export type { FlexProps } from './types';
@@ -1,20 +1,6 @@
1
1
  import styled from '@emotion/native';
2
- import type { ViewStyle } from 'react-native';
3
2
 
4
- type FlexProps = Pick<
5
- ViewStyle,
6
- | 'flex'
7
- | 'flexDirection'
8
- | 'flexGrow'
9
- | 'flexShrink'
10
- | 'flexWrap'
11
- | 'alignContent'
12
- | 'alignItems'
13
- | 'alignSelf'
14
- | 'justifyContent'
15
- | 'gap'
16
- | 'flexBasis'
17
- >;
3
+ import type { FlexProps } from './types';
18
4
 
19
5
  export const Flex = styled.View<FlexProps>(
20
6
  ({
@@ -0,0 +1,16 @@
1
+ import type { ViewStyle } from 'react-native';
2
+
3
+ export type FlexProps = Pick<
4
+ ViewStyle,
5
+ | 'flex'
6
+ | 'flexDirection'
7
+ | 'flexGrow'
8
+ | 'flexShrink'
9
+ | 'flexWrap'
10
+ | 'alignContent'
11
+ | 'alignItems'
12
+ | 'alignSelf'
13
+ | 'justifyContent'
14
+ | 'gap'
15
+ | 'flexBasis'
16
+ >;
@@ -1,6 +1,8 @@
1
- import type { TextProps } from 'react-native';
2
1
  import { LabelText } from './styles';
2
+ import type { FormLabelProps } from './types';
3
3
 
4
- export const FormLabel = (props: TextProps) => {
4
+ export type { FormLabelProps } from './types';
5
+
6
+ export const FormLabel = (props: FormLabelProps) => {
5
7
  return <LabelText {...props} />;
6
8
  };
@@ -0,0 +1,3 @@
1
+ import type { TextProps } from 'react-native';
2
+
3
+ export type FormLabelProps = TextProps;
@@ -1,16 +1,12 @@
1
1
  import { memo, useState } from 'react';
2
- import type { MaskInputProps } from 'react-native-mask-input';
3
2
 
4
3
  import { useInputContext } from '../context';
5
4
  import { ErrorExclamation, StyledMaskInput } from '../styles';
5
+ import type { InputFieldProps } from '../types';
6
6
  import { InputIcon } from './input-icon';
7
7
 
8
- type InputProps = {
9
- onChangeText?: (unmasked: string, masked: string) => void;
10
- } & Omit<MaskInputProps, 'onBlur' | 'onFocus'>;
11
-
12
8
  export const InputField = memo(
13
- ({ value, onChangeText, ...props }: InputProps) => {
9
+ ({ value, onChangeText, ...props }: InputFieldProps) => {
14
10
  const {
15
11
  inputRef,
16
12
  handleFocus,
@@ -2,13 +2,7 @@ import { useRef, useState } from 'react';
2
2
 
3
3
  import { InputContext } from '../context';
4
4
  import { InputRootContainer } from '../styles';
5
-
6
- type InputRootProps = {
7
- children: React.ReactNode;
8
- isPassword?: boolean;
9
- hasError?: boolean;
10
- disabled?: boolean;
11
- };
5
+ import type { InputRootProps } from '../types';
12
6
 
13
7
  export const InputRoot = ({
14
8
  children,
@@ -5,6 +5,8 @@ import { InputIcon } from './components/input-icon';
5
5
  import { InputPasswordToggle } from './components/input-password-toggle';
6
6
  import { InputRoot } from './components/input-root';
7
7
 
8
+ export type { InputFieldProps, InputRootProps } from './types';
9
+
8
10
  const Input = {
9
11
  Root: InputRoot,
10
12
  Field: InputField,
@@ -35,12 +35,15 @@ export const InputControlContainer = styled.Pressable<{
35
35
  borderColor: getInputBorderColor(!!hasError, isFocused),
36
36
  borderRadius: 4,
37
37
  boxShadow: getInputShadow(!!hasError, isFocused),
38
- paddingInline: 8,
39
- paddingBlock: 4,
38
+ paddingLeft: 8,
39
+ paddingRight: 8,
40
+ paddingTop: 4,
41
+ paddingBottom: 4,
40
42
 
41
43
  backgroundColor: disabled ? '#f2f2f2' : '#fff',
42
44
  }));
43
45
 
44
46
  export const InputIconContainer = styled.View({
45
- marginInline: 4,
47
+ marginLeft: 4,
48
+ marginRight: 4,
46
49
  });
@@ -0,0 +1,12 @@
1
+ import type { MaskInputProps } from 'react-native-mask-input';
2
+
3
+ export type InputRootProps = {
4
+ children: React.ReactNode;
5
+ isPassword?: boolean;
6
+ hasError?: boolean;
7
+ disabled?: boolean;
8
+ };
9
+
10
+ export type InputFieldProps = {
11
+ onChangeText?: (unmasked: string, masked: string) => void;
12
+ } & Omit<MaskInputProps, 'onBlur' | 'onFocus'>;
@@ -1 +1,2 @@
1
1
  export { Margin } from './styles';
2
+ export type { MarginProps } from './types';
@@ -1,23 +1,11 @@
1
1
  import styled from '@emotion/native';
2
2
 
3
- type MarginTypes = {
4
- insets: {
5
- all?: number | 'auto';
6
- block?: number | 'auto';
7
- inline?: number | 'auto';
8
- top?: number | 'auto';
9
- right?: number | 'auto';
10
- bottom?: number | 'auto';
11
- left?: number | 'auto';
12
- };
13
- };
3
+ import type { MarginProps } from './types';
14
4
 
15
- export const Margin = styled.View<MarginTypes>(({ insets }) => ({
5
+ export const Margin = styled.View<MarginProps>(({ insets }) => ({
16
6
  margin: insets.all,
17
- marginBlock: insets.block,
18
- marginInline: insets.inline,
19
- marginBottom: insets.bottom,
20
- marginLeft: insets.left,
21
- marginRight: insets.right,
22
- marginTop: insets.top,
7
+ marginTop: insets.vertical ?? insets.top,
8
+ marginBottom: insets.vertical ?? insets.bottom,
9
+ marginLeft: insets.horizontal ?? insets.left,
10
+ marginRight: insets.horizontal ?? insets.right,
23
11
  }));
@@ -0,0 +1,11 @@
1
+ export type MarginProps = {
2
+ insets: {
3
+ all?: number | 'auto';
4
+ vertical?: number | 'auto';
5
+ horizontal?: number | 'auto';
6
+ top?: number | 'auto';
7
+ right?: number | 'auto';
8
+ bottom?: number | 'auto';
9
+ left?: number | 'auto';
10
+ };
11
+ };
@@ -1,114 +1,69 @@
1
- import { type ComponentProps, useEffect, useRef, useState } from 'react';
2
- import type { TextInputKeyPressEvent, TextInputProps } from 'react-native';
1
+ import type { OTPInputProps } from './types';
3
2
 
4
- import { Flex } from '../Flex';
5
- import { InputBox } from './styles';
3
+ export type { OTPInputProps } from './types';
6
4
 
7
- type OTPInputProps = {
8
- length?: number;
9
- defaultValue?: string;
10
- onComplete: (code: string[]) => void;
11
- hasError?: boolean;
12
- disabled?: boolean;
13
- autoFocus?: boolean;
14
- onlyNumbers?: boolean;
15
- containerProps?: ComponentProps<typeof Flex>;
16
- } & Omit<TextInputProps, 'value' | 'onChangeText' | 'maxLength'>;
5
+ import { OtpInput as OtpEntry } from 'react-native-otp-entry';
17
6
 
18
7
  export const OTPInput = ({
19
8
  length = 6,
20
- defaultValue = '',
21
9
  onComplete,
22
- hasError = false,
23
10
  disabled = false,
24
11
  autoFocus = false,
25
12
  onlyNumbers = true,
26
13
  containerProps,
27
14
  ...props
28
15
  }: OTPInputProps) => {
29
- const [otp, setOtp] = useState<string[]>(
30
- Array(length)
31
- .fill('')
32
- .map((_, i) => defaultValue[i] || ''),
33
- );
34
- const [focusedIndex, setFocusedIndex] = useState<number | null>(
35
- autoFocus ? 0 : null,
36
- );
37
- const inputRefs = useRef<any[]>([]);
38
-
39
- const handleChangeText = (text: string, index: number) => {
40
- if (disabled) return;
41
-
42
- setOtp((prevOtp) => {
43
- const newOtp = [...prevOtp];
44
- newOtp[index] = text;
45
-
46
- const newOtpLength = newOtp.join('').length;
47
-
48
- if (newOtpLength === length) {
49
- onComplete(newOtp);
50
- inputRefs.current[index]?.blur();
51
- }
52
-
53
- return newOtp;
54
- });
55
-
56
- if (index < length - 1 && text) {
57
- inputRefs.current[index + 1]?.focus();
58
- }
59
- };
60
-
61
- const handleKeyPress = (e: TextInputKeyPressEvent, index: number) => {
62
- if (e.nativeEvent.key === 'Backspace' && !otp[index] && index > 0) {
63
- inputRefs.current[index - 1]?.focus();
64
- }
65
- };
66
-
67
- const handleFocus = (index: number) => {
68
- setFocusedIndex(index);
69
- };
70
-
71
- const handleBlur = () => {
72
- setFocusedIndex(null);
73
- };
74
-
75
- useEffect(() => {
76
- if (autoFocus && inputRefs.current[0]) {
77
- inputRefs.current[0]?.focus();
78
- }
79
- }, [autoFocus]);
80
-
81
16
  return (
82
- <Flex
83
- alignContent="center"
84
- gap={8}
85
- flexWrap="wrap"
86
- flexDirection="row"
87
- {...containerProps}
88
- >
89
- {Array.from({ length }).map((_, index) => (
90
- <InputBox
91
- key={index}
92
- ref={(ref: any) => {
93
- inputRefs.current[index] = ref;
94
- }}
95
- value={otp[index]}
96
- onChangeText={(text) => handleChangeText(text, index)}
97
- onKeyPress={(e) => handleKeyPress(e, index)}
98
- onFocus={() => handleFocus(index)}
99
- onBlur={handleBlur}
100
- isFocused={focusedIndex === index}
101
- hasError={hasError}
102
- disabled={disabled}
103
- hasValue={!!otp[index]}
104
- keyboardType={onlyNumbers ? 'number-pad' : 'default'}
105
- maxLength={1}
106
- selectTextOnFocus
107
- editable={!disabled}
108
- cursorColor="#000"
109
- {...props}
110
- />
111
- ))}
112
- </Flex>
17
+ <OtpEntry
18
+ numberOfDigits={length}
19
+ focusColor="rgb(0, 140, 255)"
20
+ onFilled={onComplete}
21
+ disabled={disabled}
22
+ autoFocus={autoFocus}
23
+ type="alphanumeric"
24
+ blurOnFilled={true}
25
+ textInputProps={{
26
+ accessibilityLabel: 'Código de verificação',
27
+ }}
28
+ textProps={{
29
+ accessibilityRole: 'text',
30
+ accessibilityLabel: 'Dígito do código de verificação',
31
+ allowFontScaling: false,
32
+ }}
33
+ theme={{
34
+ containerStyle: {
35
+ gap: 10,
36
+ justifyContent: 'flex-start',
37
+ },
38
+ pinCodeContainerStyle: {
39
+ backgroundColor: 'rgb(242,242,242)',
40
+ borderWidth: 1,
41
+ borderRadius: 4,
42
+ width: 50,
43
+ height: 50,
44
+ borderColor: 'transparent',
45
+ },
46
+ pinCodeTextStyle: {
47
+ color: disabled ? '#555' : '#333',
48
+ fontSize: 20,
49
+ fontWeight: 500,
50
+ },
51
+ focusedPinCodeContainerStyle: {
52
+ borderColor: 'rgb(50,50,50)',
53
+ },
54
+ focusStickStyle: {
55
+ backgroundColor: '#555',
56
+ height: 24,
57
+ },
58
+ disabledPinCodeContainerStyle: {
59
+ backgroundColor: 'rgb(220,220,220)',
60
+ borderColor: 'rgb(100,100,100)',
61
+ },
62
+ filledPinCodeContainerStyle: {
63
+ borderColor: 'transparent',
64
+ },
65
+ }}
66
+ {...props}
67
+ />
113
68
  );
114
69
  };
@@ -0,0 +1,13 @@
1
+ import type { OtpInputProps } from 'react-native-otp-entry';
2
+
3
+ import type { FlexProps } from '../Flex';
4
+
5
+ export type OTPInputProps = {
6
+ length?: number;
7
+ onComplete: (code: string) => void;
8
+ hasError?: boolean;
9
+ disabled?: boolean;
10
+ autoFocus?: boolean;
11
+ onlyNumbers?: boolean;
12
+ containerProps?: FlexProps;
13
+ } & OtpInputProps;
@@ -1 +1,2 @@
1
1
  export { Padding } from './styles';
2
+ export type { PaddingProps } from './types';
@@ -1,23 +1,11 @@
1
1
  import styled from '@emotion/native';
2
2
 
3
- type PaddingTypes = {
4
- insets: {
5
- all?: number | 'auto';
6
- block?: number | 'auto';
7
- inline?: number | 'auto';
8
- top?: number | 'auto';
9
- right?: number | 'auto';
10
- bottom?: number | 'auto';
11
- left?: number | 'auto';
12
- };
13
- };
3
+ import type { PaddingProps } from './types';
14
4
 
15
- export const Padding = styled.View<PaddingTypes>(({ insets }) => ({
5
+ export const Padding = styled.View<PaddingProps>(({ insets }) => ({
16
6
  padding: insets.all,
17
- paddingBlock: insets.block,
18
- paddingInline: insets.inline,
19
- paddingBottom: insets.bottom,
20
- paddingLeft: insets.left,
21
- paddingRight: insets.right,
22
- paddingTop: insets.top,
7
+ paddingTop: insets.vertical ?? insets.top,
8
+ paddingBottom: insets.vertical ?? insets.bottom,
9
+ paddingLeft: insets.horizontal ?? insets.left,
10
+ paddingRight: insets.horizontal ?? insets.right,
23
11
  }));
@@ -0,0 +1,11 @@
1
+ export type PaddingProps = {
2
+ insets: {
3
+ all?: number | 'auto';
4
+ vertical?: number | 'auto';
5
+ horizontal?: number | 'auto';
6
+ top?: number | 'auto';
7
+ right?: number | 'auto';
8
+ bottom?: number | 'auto';
9
+ left?: number | 'auto';
10
+ };
11
+ };
@@ -1,15 +1,9 @@
1
- import type { PropsWithChildren } from 'react';
2
1
  import { useContext } from 'react';
3
- import type { TouchableOpacityProps } from 'react-native';
4
2
 
5
3
  import { Text } from '../../Text';
6
4
  import { RadioContext } from '../context';
7
5
  import { RadioButton, RadioInner, RadioTouchable } from '../styles';
8
-
9
- type RadioItemProps = PropsWithChildren<{
10
- value: string;
11
- }> &
12
- Omit<TouchableOpacityProps, 'onPress'>;
6
+ import type { RadioItemProps } from '../types';
13
7
 
14
8
  export const RadioItem = ({ value, children, ...props }: RadioItemProps) => {
15
9
  const context = useContext(RadioContext);
@@ -1,15 +1,9 @@
1
- import type { PropsWithChildren } from 'react';
2
-
3
1
  import { Flex } from '../Flex';
4
2
  import { RadioItem } from './components/radio-item';
5
3
  import { RadioContext } from './context';
4
+ import type { RadioGroupProps } from './types';
6
5
 
7
- type RadioGroupProps = PropsWithChildren<{
8
- value: string;
9
- onValueChange: (value: string) => void;
10
- disabled?: boolean;
11
- hasError?: boolean;
12
- }>;
6
+ export type { RadioGroupProps, RadioItemProps } from './types';
13
7
 
14
8
  const RadioGroup = ({
15
9
  value,
@@ -0,0 +1,14 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import type { TouchableOpacityProps } from 'react-native';
3
+
4
+ export type RadioGroupProps = PropsWithChildren<{
5
+ value: string;
6
+ onValueChange: (value: string) => void;
7
+ disabled?: boolean;
8
+ hasError?: boolean;
9
+ }>;
10
+
11
+ export type RadioItemProps = PropsWithChildren<{
12
+ value: string;
13
+ }> &
14
+ Omit<TouchableOpacityProps, 'onPress'>;
@@ -1,17 +1,15 @@
1
- import type { PickerSelectProps } from 'react-native-picker-select';
2
1
  import RNPickerSelect from 'react-native-picker-select';
3
2
 
4
3
  import { useSelectContext } from '../context';
4
+ import type { SelectFieldProps } from '../types';
5
5
  import { ErrorIcon } from './error-icon';
6
6
 
7
- type FormSelectProps = PickerSelectProps;
8
-
9
7
  export const SelectField = ({
10
8
  placeholder,
11
9
  style,
12
10
  disabled,
13
11
  ...props
14
- }: FormSelectProps) => {
12
+ }: SelectFieldProps) => {
15
13
  const { hasError } = useSelectContext();
16
14
 
17
15
  const {
@@ -1,13 +1,11 @@
1
- import type { PropsWithChildren } from 'react';
2
1
  import { View } from 'react-native';
3
2
 
4
3
  import { SelectError } from './components/select-error';
5
4
  import { SelectField } from './components/select-field';
6
5
  import { SelectContext } from './context';
6
+ import type { SelectRootProps } from './types';
7
7
 
8
- type SelectRootProps = PropsWithChildren & {
9
- hasError?: boolean;
10
- };
8
+ export type { SelectFieldProps, SelectRootProps } from './types';
11
9
 
12
10
  const SelectRoot = ({ children, hasError }: SelectRootProps) => {
13
11
  return (
@@ -0,0 +1,8 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import type { PickerSelectProps } from 'react-native-picker-select';
3
+
4
+ export type SelectRootProps = PropsWithChildren & {
5
+ hasError?: boolean;
6
+ };
7
+
8
+ export type SelectFieldProps = PickerSelectProps;
@@ -1,12 +1,9 @@
1
- import { type PropsWithChildren, useEffect, useRef } from 'react';
2
- import { Animated, type DimensionValue } from 'react-native';
3
-
4
- type SkeletonProps = {
5
- width: DimensionValue;
6
- height: DimensionValue;
7
- radius?: number;
8
- isLoading?: boolean;
9
- } & PropsWithChildren;
1
+ import { useEffect, useRef } from 'react';
2
+ import { Animated } from 'react-native';
3
+
4
+ import type { SkeletonProps } from './types';
5
+
6
+ export type { SkeletonProps } from './types';
10
7
 
11
8
  export const Skeleton = ({
12
9
  width,
@@ -0,0 +1,9 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import type { DimensionValue } from 'react-native';
3
+
4
+ export type SkeletonProps = {
5
+ width: DimensionValue;
6
+ height: DimensionValue;
7
+ radius?: number;
8
+ isLoading?: boolean;
9
+ } & PropsWithChildren;
@@ -1,17 +1,11 @@
1
- import type { PropsWithChildren } from 'react';
2
1
  import { useEffect, useRef } from 'react';
3
- import { Animated, type TouchableOpacityProps } from 'react-native';
2
+ import { Animated } from 'react-native';
4
3
 
5
4
  import { Text } from '../Text';
6
5
  import { SwitchContainer, SwitchThumb, SwitchTrack } from './styles';
6
+ import type { SwitchProps } from './types';
7
7
 
8
- type SwitchProps = PropsWithChildren<{
9
- value: boolean;
10
- onValueChange: (value: boolean) => void;
11
- disabled?: boolean;
12
- hasError?: boolean;
13
- }> &
14
- Omit<TouchableOpacityProps, 'onPress'>;
8
+ export type { SwitchProps } from './types';
15
9
 
16
10
  export const Switch = ({
17
11
  value,