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 +6 -7
- package/dist/assets/images/index.d.ts +1 -1
- package/dist/assets/images/index.ts +9 -1
- package/dist/assets/index.ts +7 -27
- package/dist/components/TextInput/TextInput.d.ts +8 -8
- package/dist/components/Toast/ToastProvider.d.ts +1 -1
- package/dist/core/theming.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +188 -124
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +167 -98
- package/dist/index.js.map +1 -1
- package/dist/styles/themes/tokens.d.ts +4 -2
- package/dist/theme/dimensions.d.ts +2 -0
- package/package.json +1 -1
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
|
|
32
|
+
import { Button } from '@sapo/components-ui-rn';
|
|
32
33
|
|
|
33
|
-
function
|
|
34
|
+
function MyComponent() {
|
|
34
35
|
return (
|
|
35
|
-
<
|
|
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
|
|
1
|
+
export declare const getImageDefault: () => number;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
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
|
+
};
|
package/dist/assets/index.ts
CHANGED
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
|
2
|
-
import { StyleProp, TextInput as NativeTextInput, TextStyle, ViewStyle } from
|
|
3
|
-
import { Props as TextInputAffixProps } from
|
|
4
|
-
import type { RenderProps, TextInputLabelProp } from
|
|
5
|
-
import type { ThemeProp } from
|
|
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?:
|
|
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?:
|
|
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,
|
|
159
|
+
type TextInputHandles = Pick<NativeTextInput, "focus" | "clear" | "blur" | "isFocused" | "setNativeProps">;
|
|
160
160
|
/**
|
|
161
161
|
* A component to allow users to input text.
|
|
162
162
|
*
|
package/dist/core/theming.d.ts
CHANGED
|
@@ -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: () =>
|
|
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";
|