@ovotech/element-native 2.2.0-canary-215f187-78 → 2.2.0-canary-d4e6dad-80
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/dist/components/Input/CurrencyInput.d.ts +2 -2
- package/dist/components/Input/EmailInput.d.ts +2 -2
- package/dist/components/Input/Input.d.ts +4 -4
- package/dist/components/Input/NumberInput.d.ts +2 -2
- package/dist/components/Input/PasswordInput.d.ts +2 -2
- package/dist/components/Input/PhoneInput.d.ts +2 -2
- package/dist/components/Input/TextInput.d.ts +2 -2
- package/dist/components/Input/TextareaInput.d.ts +2 -2
- package/dist/components/SubLabelText/SubLabelText.js +5 -4
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/TextField/CurrencyField.d.ts +2 -2
- package/dist/components/TextField/EmailField.d.ts +2 -2
- package/dist/components/TextField/NumberField.d.ts +2 -2
- package/dist/components/TextField/PasswordField.d.ts +2 -2
- package/dist/components/TextField/PhoneField.d.ts +2 -2
- package/dist/components/TextField/TelField.d.ts +2 -2
- package/dist/components/TextField/TextField.d.ts +2 -2
- package/dist/components/TextField/TextareaField.d.ts +2 -2
- package/dist/esm/components/SubLabelText/SubLabelText.js +5 -4
- package/dist/esm/components/Text/Text.js +1 -1
- package/dist/esm/hooks/use-breakpoint.js +4 -4
- package/dist/hooks/use-breakpoint.js +4 -4
- package/package.json +2 -2
|
@@ -7,8 +7,8 @@ export declare type CurrencyInputProps = InputProps & {
|
|
|
7
7
|
declare const CurrencyInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
8
8
|
invalid?: boolean | undefined;
|
|
9
9
|
stretch?: boolean | undefined;
|
|
10
|
-
iconLeft?:
|
|
11
|
-
iconRight?:
|
|
10
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
11
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
12
12
|
rightSlot?: React.ReactNode;
|
|
13
13
|
} & {
|
|
14
14
|
currency?: "GBP" | "EUR" | "AUD" | "USD" | undefined;
|
|
@@ -3,8 +3,8 @@ import { TextInput } from 'react-native';
|
|
|
3
3
|
declare const EmailInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?:
|
|
7
|
-
iconRight?:
|
|
6
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
8
8
|
rightSlot?: React.ReactNode;
|
|
9
9
|
} & React.RefAttributes<TextInput>>;
|
|
10
10
|
export { EmailInput };
|
|
@@ -4,15 +4,15 @@ import { IconName } from '../../providers/types';
|
|
|
4
4
|
export declare type InputProps = TextInputProps & {
|
|
5
5
|
invalid?: boolean;
|
|
6
6
|
stretch?: boolean;
|
|
7
|
-
iconLeft?: IconName | (string &
|
|
8
|
-
iconRight?: IconName | (string &
|
|
7
|
+
iconLeft?: IconName | (string & object);
|
|
8
|
+
iconRight?: IconName | (string & object);
|
|
9
9
|
rightSlot?: ReactNode;
|
|
10
10
|
};
|
|
11
11
|
declare const Input: React.ForwardRefExoticComponent<TextInputProps & {
|
|
12
12
|
invalid?: boolean | undefined;
|
|
13
13
|
stretch?: boolean | undefined;
|
|
14
|
-
iconLeft?:
|
|
15
|
-
iconRight?:
|
|
14
|
+
iconLeft?: IconName | undefined;
|
|
15
|
+
iconRight?: IconName | undefined;
|
|
16
16
|
rightSlot?: ReactNode;
|
|
17
17
|
} & React.RefAttributes<TextInput>>;
|
|
18
18
|
export { Input };
|
|
@@ -3,8 +3,8 @@ import { TextInput as RNTextInput } from 'react-native';
|
|
|
3
3
|
declare const NumberInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?:
|
|
7
|
-
iconRight?:
|
|
6
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
8
8
|
rightSlot?: React.ReactNode;
|
|
9
9
|
} & React.RefAttributes<RNTextInput>>;
|
|
10
10
|
export { NumberInput };
|
|
@@ -3,8 +3,8 @@ import { TextInput as RNTextInput } from 'react-native';
|
|
|
3
3
|
declare const PasswordInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?:
|
|
7
|
-
iconRight?:
|
|
6
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
8
8
|
rightSlot?: React.ReactNode;
|
|
9
9
|
} & {
|
|
10
10
|
hasVisibilityToggle?: boolean | undefined;
|
|
@@ -3,8 +3,8 @@ import { TextInput } from 'react-native';
|
|
|
3
3
|
declare const PhoneInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?:
|
|
7
|
-
iconRight?:
|
|
6
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
8
8
|
rightSlot?: React.ReactNode;
|
|
9
9
|
} & React.RefAttributes<TextInput>>;
|
|
10
10
|
export { PhoneInput };
|
|
@@ -3,8 +3,8 @@ import { TextInput as RNTextInput } from 'react-native';
|
|
|
3
3
|
declare const TextInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
|
-
iconLeft?:
|
|
7
|
-
iconRight?:
|
|
6
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
7
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
8
8
|
rightSlot?: React.ReactNode;
|
|
9
9
|
} & React.RefAttributes<RNTextInput>>;
|
|
10
10
|
export { TextInput };
|
|
@@ -7,8 +7,8 @@ declare type TextareaInputProps = InputProps & {
|
|
|
7
7
|
declare const TextareaInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
8
8
|
invalid?: boolean | undefined;
|
|
9
9
|
stretch?: boolean | undefined;
|
|
10
|
-
iconLeft?:
|
|
11
|
-
iconRight?:
|
|
10
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
11
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
12
12
|
rightSlot?: React.ReactNode;
|
|
13
13
|
} & {
|
|
14
14
|
rows?: number | undefined;
|
|
@@ -29,12 +29,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.SubLabelText = void 0;
|
|
31
31
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
32
|
-
var theme_1 = require("../../theme");
|
|
33
32
|
var utils_1 = require("../../utils");
|
|
34
33
|
var StyledSubLabelText = styled_native_1.default.Text(function (_a) {
|
|
35
|
-
var
|
|
36
|
-
var fontSize = smallAndUp
|
|
37
|
-
|
|
34
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
35
|
+
var fontSize = smallAndUp
|
|
36
|
+
? core.fontSize.body.large
|
|
37
|
+
: core.fontSize.body.small;
|
|
38
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), core.fontFamily.body.native, core.lineHeight.body.small, semantic.message.secondary, fontSize);
|
|
38
39
|
});
|
|
39
40
|
var SubLabelText = (0, utils_1.styledComponentWithBreakpoints)(StyledSubLabelText);
|
|
40
41
|
exports.SubLabelText = SubLabelText;
|
|
@@ -56,7 +56,7 @@ var styled_native_1 = __importStar(require("../../styled.native"));
|
|
|
56
56
|
var utils_1 = require("../../utils");
|
|
57
57
|
var StyledP = styled_native_1.default.Text(function (_a) {
|
|
58
58
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
59
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n
|
|
59
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, core.fontSize.body[smallAndUp ? 'large' : 'small'], core.lineHeight.body[smallAndUp ? 'large' : 'small'], semantic.message.base);
|
|
60
60
|
});
|
|
61
61
|
exports.P = (0, utils_1.styledComponentWithBreakpoints)(StyledP);
|
|
62
62
|
var StyledSmall = styled_native_1.default.Text(function (_a) {
|
|
@@ -4,8 +4,8 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const CurrencyField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native/types").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?:
|
|
8
|
-
iconRight?:
|
|
7
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
9
9
|
rightSlot?: React.ReactNode;
|
|
10
10
|
} & {
|
|
11
11
|
currency?: "GBP" | "EUR" | "AUD" | "USD" | undefined;
|
|
@@ -4,7 +4,7 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const EmailField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native/types").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?:
|
|
8
|
-
iconRight?:
|
|
7
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
9
9
|
rightSlot?: React.ReactNode;
|
|
10
10
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,7 +4,7 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const NumberField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native/types").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?:
|
|
8
|
-
iconRight?:
|
|
7
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
9
9
|
rightSlot?: React.ReactNode;
|
|
10
10
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,8 +4,8 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const PasswordField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native/types").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?:
|
|
8
|
-
iconRight?:
|
|
7
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
9
9
|
rightSlot?: React.ReactNode;
|
|
10
10
|
} & {
|
|
11
11
|
hasVisibilityToggle?: boolean | undefined;
|
|
@@ -4,7 +4,7 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const PhoneField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native/types").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?:
|
|
8
|
-
iconRight?:
|
|
7
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
9
9
|
rightSlot?: React.ReactNode;
|
|
10
10
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -8,7 +8,7 @@ import { FieldProps } from '../Field';
|
|
|
8
8
|
export declare const TelField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native/types").TextInputProps & {
|
|
9
9
|
invalid?: boolean | undefined;
|
|
10
10
|
stretch?: boolean | undefined;
|
|
11
|
-
iconLeft?:
|
|
12
|
-
iconRight?:
|
|
11
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
12
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
13
13
|
rightSlot?: React.ReactNode;
|
|
14
14
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,7 +4,7 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const TextField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native/types").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?:
|
|
8
|
-
iconRight?:
|
|
7
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
9
9
|
rightSlot?: React.ReactNode;
|
|
10
10
|
} & React.RefAttributes<NativeTextInput>>;
|
|
@@ -4,8 +4,8 @@ import { FieldProps } from '../Field';
|
|
|
4
4
|
export declare const TextareaField: React.ForwardRefExoticComponent<Omit<FieldProps, "children"> & import("react-native/types").TextInputProps & {
|
|
5
5
|
invalid?: boolean | undefined;
|
|
6
6
|
stretch?: boolean | undefined;
|
|
7
|
-
iconLeft?:
|
|
8
|
-
iconRight?:
|
|
7
|
+
iconLeft?: import("../../providers").IconName | undefined;
|
|
8
|
+
iconRight?: import("../../providers").IconName | undefined;
|
|
9
9
|
rightSlot?: React.ReactNode;
|
|
10
10
|
} & {
|
|
11
11
|
rows?: number | undefined;
|
|
@@ -3,12 +3,13 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled, { css } from '../../styled.native';
|
|
6
|
-
import { calculateLineHeight } from '../../theme';
|
|
7
6
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
8
7
|
var StyledSubLabelText = styled.Text(function (_a) {
|
|
9
|
-
var
|
|
10
|
-
var fontSize = smallAndUp
|
|
11
|
-
|
|
8
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
9
|
+
var fontSize = smallAndUp
|
|
10
|
+
? core.fontSize.body.large
|
|
11
|
+
: core.fontSize.body.small;
|
|
12
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), core.fontFamily.body.native, core.lineHeight.body.small, semantic.message.secondary, fontSize);
|
|
12
13
|
});
|
|
13
14
|
var SubLabelText = styledComponentWithBreakpoints(StyledSubLabelText);
|
|
14
15
|
export { SubLabelText };
|
|
@@ -30,7 +30,7 @@ import styled, { css } from '../../styled.native';
|
|
|
30
30
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
31
31
|
var StyledP = styled.Text(function (_a) {
|
|
32
32
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
33
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n
|
|
33
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, core.fontSize.body[smallAndUp ? 'large' : 'small'], core.lineHeight.body[smallAndUp ? 'large' : 'small'], semantic.message.base);
|
|
34
34
|
});
|
|
35
35
|
export var P = styledComponentWithBreakpoints(StyledP);
|
|
36
36
|
var StyledSmall = styled.Text(function (_a) {
|
|
@@ -2,11 +2,11 @@ import { useContext } from 'react';
|
|
|
2
2
|
import { useWindowDimensions } from 'react-native';
|
|
3
3
|
import { ThemeContext } from '../styled.native';
|
|
4
4
|
export var useBreakpoint = function () {
|
|
5
|
-
var
|
|
5
|
+
var breakpoint = useContext(ThemeContext).core.breakpoint;
|
|
6
6
|
var width = useWindowDimensions().width;
|
|
7
7
|
return {
|
|
8
|
-
smallAndUp: width
|
|
9
|
-
mediumAndUp: width
|
|
10
|
-
largeAndUp: width
|
|
8
|
+
smallAndUp: width > Number(breakpoint.small),
|
|
9
|
+
mediumAndUp: width > Number(breakpoint.medium),
|
|
10
|
+
largeAndUp: width > Number(breakpoint.large),
|
|
11
11
|
};
|
|
12
12
|
};
|
|
@@ -5,12 +5,12 @@ var react_1 = require("react");
|
|
|
5
5
|
var react_native_1 = require("react-native");
|
|
6
6
|
var styled_native_1 = require("../styled.native");
|
|
7
7
|
var useBreakpoint = function () {
|
|
8
|
-
var
|
|
8
|
+
var breakpoint = (0, react_1.useContext)(styled_native_1.ThemeContext).core.breakpoint;
|
|
9
9
|
var width = (0, react_native_1.useWindowDimensions)().width;
|
|
10
10
|
return {
|
|
11
|
-
smallAndUp: width
|
|
12
|
-
mediumAndUp: width
|
|
13
|
-
largeAndUp: width
|
|
11
|
+
smallAndUp: width > Number(breakpoint.small),
|
|
12
|
+
mediumAndUp: width > Number(breakpoint.medium),
|
|
13
|
+
largeAndUp: width > Number(breakpoint.large),
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
exports.useBreakpoint = useBreakpoint;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovotech/element-native",
|
|
3
|
-
"version": "2.2.0-canary-
|
|
3
|
+
"version": "2.2.0-canary-d4e6dad-80",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "@ovotech/element"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ovotech/element-core": "^1.1.0-canary-
|
|
16
|
+
"@ovotech/element-core": "^1.1.0-canary-d4e6dad-80",
|
|
17
17
|
"deepmerge": "^4.2.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|