sapo-components-ui-rn 1.1.87 → 1.1.89

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.
package/README.md CHANGED
@@ -19,22 +19,21 @@ Thư viện này yêu cầu các peer dependencies sau:
19
19
  "react": ">=18.0.0",
20
20
  "react-native": ">=0.70.0",
21
21
  "@react-native-community/masked-view": "*",
22
+ "react-native-gesture-handler": "*",
23
+ "react-native-reanimated": "*",
22
24
  "react-native-safe-area-context": "*",
23
- "react-native-screens": "*",
24
- "react-native-svg": "*"
25
+ "react-native-screens": "*"
25
26
  }
26
27
  ```
27
28
 
28
29
  ## Sử dụng
29
30
 
30
31
  ```tsx
31
- import { Button, ToastProvider } from 'sapo-components-ui-rn';
32
+ import { Button } from '@sapo/components-ui-rn';
32
33
 
33
- function App() {
34
+ function MyComponent() {
34
35
  return (
35
- <ToastProvider>
36
- <Button title="My Button" onPress={() => {}} />
37
- </ToastProvider>
36
+ <Button disabled textStyle={{...}} title="My Button" onPress={()=> {}}/>
38
37
  );
39
38
  }
40
39
  ```
@@ -1 +1 @@
1
- export declare const IMAGE_DEFAULT: any;
1
+ export declare const getImageDefault: () => number;
@@ -1 +1,9 @@
1
- export const IMAGE_DEFAULT = require('./image_default.png');
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ let imageDefault: number | undefined;
3
+
4
+ export const getImageDefault = (): number => {
5
+ if (imageDefault === undefined) {
6
+ imageDefault = require("./image_default.png");
7
+ }
8
+ return imageDefault;
9
+ };
@@ -1,29 +1,9 @@
1
- import IconClose from "./icon-close.svg";
2
- import IconCheckbox from "./icon-checkbox.svg";
3
- import IconCheckboxActive from "./icon-checkbox-active.svg";
4
- import IconRadio from "./icon-radio.svg";
5
- import IconRadioActive from "./icon-radio-active.svg";
6
- import IconSearch from "./icon-search.svg";
7
- import IconInfo from "./icon-info.svg";
8
- import IconSuccess from "./icon-success.svg";
9
- import IconWarning from "./icon-warning.svg";
10
- import IconArrowDown from "./icon-arrow-down.svg";
11
- import IconError from "./icon-error.svg";
12
- import IconClearText from "./icon-clear-text.svg";
13
- import IconDelNumber from './icon-del-number.svg'
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ let imageDefault: number | undefined;
14
3
 
15
- export const Svg = {
16
- IconClose,
17
- IconCheckbox,
18
- IconCheckboxActive,
19
- IconRadio,
20
- IconRadioActive,
21
- IconSearch,
22
- IconInfo,
23
- IconSuccess,
24
- IconWarning,
25
- IconArrowDown,
26
- IconError,
27
- IconClearText,
28
- IconDelNumber,
4
+ export const getImageDefault = (): number => {
5
+ if (imageDefault === undefined) {
6
+ imageDefault = require("./image_default.png");
7
+ }
8
+ return imageDefault;
29
9
  };
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- import { StyleProp, TextInput as NativeTextInput, TextStyle, ViewStyle } from 'react-native';
3
- import { Props as TextInputAffixProps } from './Adornment/TextInputAffix';
4
- import type { RenderProps, TextInputLabelProp } from './types';
5
- import type { ThemeProp } from '../../types';
1
+ import React from "react";
2
+ import { StyleProp, TextInput as NativeTextInput, TextStyle, ViewStyle } from "react-native";
3
+ import { Props as TextInputAffixProps } from "./Adornment/TextInputAffix";
4
+ import type { RenderProps, TextInputLabelProp } from "./types";
5
+ import type { ThemeProp } from "../../types";
6
6
  export type Props = React.ComponentPropsWithRef<typeof NativeTextInput> & {
7
- mode?: 'flat' | 'default' | 'number';
7
+ mode?: "flat" | "default" | "number";
8
8
  left?: React.ReactNode;
9
9
  right?: React.ReactNode;
10
10
  prefix?: string;
@@ -12,7 +12,7 @@ export type Props = React.ComponentPropsWithRef<typeof NativeTextInput> & {
12
12
  textError?: string;
13
13
  maxValue?: number;
14
14
  minValue?: number;
15
- type?: 'integer' | 'float';
15
+ type?: "integer" | "float";
16
16
  keyboardStyle?: StyleProp<ViewStyle>;
17
17
  formatDecimal?: 1 | 2 | 3;
18
18
  required?: boolean;
@@ -156,7 +156,7 @@ export type Props = React.ComponentPropsWithRef<typeof NativeTextInput> & {
156
156
  interface CompoundedComponent extends React.ForwardRefExoticComponent<Props & React.RefAttributes<TextInputHandles>> {
157
157
  Affix: React.FunctionComponent<Partial<TextInputAffixProps>>;
158
158
  }
159
- type TextInputHandles = Pick<NativeTextInput, 'focus' | 'clear' | 'blur' | 'isFocused' | 'setNativeProps'>;
159
+ type TextInputHandles = Pick<NativeTextInput, "focus" | "clear" | "blur" | "isFocused" | "setNativeProps">;
160
160
  /**
161
161
  * A component to allow users to input text.
162
162
  *
@@ -14,7 +14,7 @@ interface ToastProviderProps {
14
14
  children: React.ReactNode;
15
15
  /**
16
16
  * Nếu ứng dụng đã có SafeAreaProvider, set wrapSafeArea = false
17
- * @default false
17
+ * @default true
18
18
  */
19
19
  wrapSafeArea?: boolean;
20
20
  }
@@ -7,7 +7,7 @@ export declare const ThemeProvider: ({ children }: {
7
7
  children: React.ReactNode;
8
8
  }) => React.JSX.Element;
9
9
  export declare function useTheme<T = AppTheme>(overrides?: $DeepPartial<T>): T;
10
- export declare const useInternalTheme: () => InternalTheme;
10
+ export declare const useInternalTheme: () => AppTheme;
11
11
  export declare const withInternalTheme: <Props extends {
12
12
  theme: InternalTheme;
13
13
  }, C>(WrappedComponent: ComponentType<Props & {
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { ThemeColors } from "./styles/themes/tokens";
2
2
  export { CONSTANTS } from "./styles/themes/tokens";
3
3
  export { ThemeColors as ThemeColorsProps } from "./types";
4
4
  export { default as containerStyles } from "./theme/container-styles";
5
+ export { useTheme, ThemeProvider, DefaultTheme, adaptNavigationTheme, } from "./core/theming";
5
6
  export * from "./styles/themes";
6
7
  export { default as Switch } from "./components/Switch/Switch";
7
8
  export { default as TextInput } from "./components/TextInput/TextInput";