@ovotech/element-native 5.5.0 → 5.6.0
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/Accordion/styles.d.ts +9 -0
- package/dist/components/ActionList/Action.d.ts +23 -0
- package/dist/components/ActionList/Action.js +29 -0
- package/dist/components/ActionList/ActionList.d.ts +11 -27
- package/dist/components/ActionList/ActionList.js +9 -25
- package/dist/components/ActionList/ActionListItems/DataListItem.d.ts +23 -0
- package/dist/components/ActionList/ActionListItems/DataListItem.js +21 -0
- package/dist/components/ActionList/ActionListItems/EditableListItem.d.ts +43 -0
- package/dist/components/ActionList/ActionListItems/EditableListItem.js +134 -0
- package/dist/components/ActionList/ActionListItems/NavigationListItem.d.ts +16 -0
- package/dist/components/ActionList/ActionListItems/NavigationListItem.js +30 -0
- package/dist/components/ActionList/ActionListItems/ProgressRing.d.ts +7 -0
- package/dist/components/ActionList/ActionListItems/ProgressRing.js +66 -0
- package/dist/components/ActionList/ActionListItems/ToggleListItem.d.ts +9 -0
- package/dist/components/ActionList/ActionListItems/ToggleListItem.js +13 -0
- package/dist/components/ActionList/ActionListItems/styles.d.ts +10433 -0
- package/dist/components/ActionList/ActionListItems/styles.js +171 -0
- package/dist/components/ActionList/components/ActionListHeading.d.ts +9 -0
- package/dist/components/ActionList/components/ActionListHeading.js +11 -0
- package/dist/components/ActionList/index.d.ts +6 -1
- package/dist/components/ActionList/index.js +11 -2
- package/dist/components/ActionList/styled.d.ts +1187 -7
- package/dist/components/ActionList/styled.js +24 -9
- package/dist/components/Badge/Badge.d.ts +3 -0
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.styles.d.ts +12 -0
- package/dist/components/Card/Card.d.ts +7 -4
- package/dist/components/Card/Card.js +44 -22
- package/dist/components/Card/Card.styles.d.ts +11 -1
- package/dist/components/Card/Card.styles.js +7 -11
- package/dist/components/Cards/AccountCard/AccountCard.styles.d.ts +24 -0
- package/dist/components/Cards/BalanceCard/BalanceCard.styles.d.ts +46 -1
- package/dist/components/Cards/BalanceCard/BalanceCard.styles.js +2 -2
- package/dist/components/Cards/DisruptiveCard/DisruptiveCard.d.ts +13 -0
- package/dist/components/Cards/DisruptiveCard/DisruptiveCard.js +45 -0
- package/dist/components/Cards/DisruptiveCard/DisruptiveCard.styles.d.ts +580 -0
- package/dist/components/Cards/DisruptiveCard/DisruptiveCard.styles.js +11 -0
- package/dist/components/Cards/DisruptiveCard/index.d.ts +1 -0
- package/dist/components/Cards/DisruptiveCard/index.js +17 -0
- package/dist/components/Cards/HeroImageCard/HeroImageCard.d.ts +12 -0
- package/dist/components/Cards/HeroImageCard/HeroImageCard.js +65 -0
- package/dist/components/Cards/HeroImageCard/HeroImageCard.styles.d.ts +1741 -0
- package/dist/components/Cards/HeroImageCard/HeroImageCard.styles.js +27 -0
- package/dist/components/Cards/HeroImageCard/index.d.ts +1 -0
- package/dist/components/Cards/HeroImageCard/index.js +17 -0
- package/dist/components/Cards/IconDataCard/IconDataCard.styles.d.ts +12 -0
- package/dist/components/Cards/IconTextCard/IconTextCard.js +3 -16
- package/dist/components/Cards/IconTextCard/IconTextCard.styles.d.ts +10 -576
- package/dist/components/Cards/IconTextCard/IconTextCard.styles.js +1 -6
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.d.ts +14 -0
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.js +26 -0
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.d.ts +2903 -0
- package/dist/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +34 -0
- package/dist/components/Cards/IllustrationTextCard/index.d.ts +1 -0
- package/dist/components/Cards/IllustrationTextCard/index.js +17 -0
- package/dist/components/Cards/LinkTextCard/LinkTextCard.d.ts +2 -2
- package/dist/components/Cards/LinkTextCard/LinkTextCard.js +7 -6
- package/dist/components/Cards/LinkTextCard/LinkTextCard.styles.d.ts +20 -2
- package/dist/components/Cards/LinkTextCard/LinkTextCard.styles.js +9 -6
- package/dist/components/Cards/ProgressBarCard/ProgressBarCard.styles.d.ts +28 -1
- package/dist/components/Cards/QuickLinkCard/QuickLinkCard.d.ts +12 -0
- package/dist/components/Cards/QuickLinkCard/QuickLinkCard.js +27 -0
- package/dist/components/Cards/QuickLinkCard/QuickLinkCard.styles.d.ts +2897 -0
- package/dist/components/Cards/QuickLinkCard/QuickLinkCard.styles.js +31 -0
- package/dist/components/Cards/QuickLinkCard/index.d.ts +1 -0
- package/dist/components/Cards/QuickLinkCard/index.js +17 -0
- package/dist/components/Cards/ServicesImageCard/ServicesImageCard.d.ts +12 -0
- package/dist/components/Cards/ServicesImageCard/ServicesImageCard.js +24 -0
- package/dist/components/Cards/ServicesImageCard/ServicesImageCard.styles.d.ts +2902 -0
- package/dist/components/Cards/ServicesImageCard/ServicesImageCard.styles.js +38 -0
- package/dist/components/Cards/ServicesImageCard/index.d.ts +1 -0
- package/dist/components/Cards/ServicesImageCard/index.js +17 -0
- package/dist/components/Cards/components.d.ts +15 -0
- package/dist/components/Cards/components.js +24 -0
- package/dist/components/Cards/index.d.ts +5 -0
- package/dist/components/Cards/index.js +11 -1
- package/dist/components/Cards/shared.styles.d.ts +2835 -505
- package/dist/components/Cards/shared.styles.js +18 -2
- package/dist/components/Cards/utils.d.ts +1 -0
- package/dist/components/Cards/utils.js +13 -1
- package/dist/components/Checkbox/Checkbox.d.ts +2 -13
- package/dist/components/Checkbox/Checkbox.js +3 -49
- package/dist/components/Checkbox/styled.d.ts +3483 -0
- package/dist/components/Checkbox/styled.js +52 -0
- package/dist/components/Checkbox/types.d.ts +16 -0
- package/dist/components/Checkbox/types.js +2 -0
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +2 -1
- package/dist/components/CurrencyInput/CurrencyInput.js +11 -4
- package/dist/components/CurrencyInput/styled.d.ts +2318 -0
- package/dist/components/CurrencyInput/styled.js +39 -0
- package/dist/components/DataTable/styles.d.ts +39 -0
- package/dist/components/Disclosure/Disclosure.d.ts +3 -0
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.js +3 -1
- package/dist/components/Em/Em.d.ts +3 -0
- package/dist/components/EmailInput/EmailInput.d.ts +4 -1
- package/dist/components/EmailInput/EmailInput.js +18 -2
- package/dist/components/EmptyState/EmptyState.d.ts +2 -0
- package/dist/components/EmptyState/EmptyState.js +17 -0
- package/dist/components/EmptyState/EmptyState.test.d.ts +1 -0
- package/dist/components/EmptyState/EmptyState.test.js +92 -0
- package/dist/components/EmptyState/index.d.ts +1 -0
- package/dist/components/EmptyState/index.js +17 -0
- package/dist/components/EmptyState/styles.d.ts +1156 -0
- package/dist/components/EmptyState/styles.js +23 -0
- package/dist/components/EmptyState/types.d.ts +18 -0
- package/dist/components/EmptyState/types.js +2 -0
- package/dist/components/ErrorText/ErrorText.d.ts +3 -0
- package/dist/components/Field/Field.d.ts +3 -2
- package/dist/components/Field/Field.js +3 -2
- package/dist/components/Grid/Col.d.ts +3 -0
- package/dist/components/HintText/HintText.d.ts +3 -0
- package/dist/components/Input/Input.d.ts +2 -1
- package/dist/components/Input/Input.js +6 -97
- package/dist/components/Input/styled.d.ts +1747 -0
- package/dist/components/Input/styled.js +96 -0
- package/dist/components/LabelText/LabelText.d.ts +3 -0
- package/dist/components/LargeValueReference/LargeValueReference.d.ts +11 -0
- package/dist/components/LargeValueReference/LargeValueReference.js +49 -0
- package/dist/components/LargeValueReference/index.d.ts +1 -0
- package/dist/components/LargeValueReference/index.js +17 -0
- package/dist/components/LargeValueReference/styles.d.ts +1741 -0
- package/dist/components/LargeValueReference/styles.js +29 -0
- package/dist/components/LineThrough/LineThrough.d.ts +3 -0
- package/dist/components/List/styled.d.ts +12 -0
- package/dist/components/Margin/Margin.d.ts +3 -0
- package/dist/components/NavHeader/NavHeader.styles.d.ts +33 -0
- package/dist/components/Notification/Notification.styles.d.ts +27 -0
- package/dist/components/PasswordInput/PasswordInput.styled.d.ts +4 -3
- package/dist/components/PasswordInput/PasswordInput.styled.js +5 -3
- package/dist/components/PasswordInput/PasswordVisibilityToggle.js +2 -8
- package/dist/components/RadioCard/RadioCard.d.ts +2 -1
- package/dist/components/RadioCard/RadioCard.js +7 -57
- package/dist/components/RadioCard/RadioCard.styles.d.ts +2901 -0
- package/dist/components/RadioCard/RadioCard.styles.js +97 -0
- package/dist/components/SelectField/Select.d.ts +5 -579
- package/dist/components/SelectField/Select.js +7 -107
- package/dist/components/SelectField/SelectField.d.ts +2 -2
- package/dist/components/SelectField/SelectField.js +2 -2
- package/dist/components/SelectField/styled.d.ts +4642 -0
- package/dist/components/SelectField/styled.js +118 -0
- package/dist/components/SkeletonText/SkeletonText.js +4 -4
- package/dist/components/Strong/Strong.d.ts +3 -0
- package/dist/components/SubLabelText/SubLabelText.d.ts +3 -0
- package/dist/components/Tabs/Tab.d.ts +3 -0
- package/dist/components/TextareaInput/TextareaInput.js +12 -6
- package/dist/components/Toggle/Toggle.d.ts +3 -1
- package/dist/components/Toggle/Toggle.js +4 -6
- package/dist/components/Toggle/styles.d.ts +13 -0
- package/dist/components/Toggle/styles.js +3 -3
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/esm/components/ActionList/Action.js +26 -0
- package/dist/esm/components/ActionList/ActionList.js +12 -28
- package/dist/esm/components/ActionList/ActionListItems/DataListItem.js +17 -0
- package/dist/esm/components/ActionList/ActionListItems/EditableListItem.js +131 -0
- package/dist/esm/components/ActionList/ActionListItems/NavigationListItem.js +26 -0
- package/dist/esm/components/ActionList/ActionListItems/ProgressRing.js +29 -0
- package/dist/esm/components/ActionList/ActionListItems/ToggleListItem.js +9 -0
- package/dist/esm/components/ActionList/ActionListItems/styles.js +135 -0
- package/dist/esm/components/ActionList/components/ActionListHeading.js +7 -0
- package/dist/esm/components/ActionList/index.js +6 -1
- package/dist/esm/components/ActionList/styled.js +23 -8
- package/dist/esm/components/Button/Button.js +1 -1
- package/dist/esm/components/Card/Card.js +45 -23
- package/dist/esm/components/Card/Card.styles.js +8 -12
- package/dist/esm/components/Cards/BalanceCard/BalanceCard.styles.js +2 -2
- package/dist/esm/components/Cards/DisruptiveCard/DisruptiveCard.js +41 -0
- package/dist/esm/components/Cards/DisruptiveCard/DisruptiveCard.styles.js +5 -0
- package/dist/esm/components/Cards/DisruptiveCard/index.js +1 -0
- package/dist/esm/components/Cards/HeroImageCard/HeroImageCard.js +28 -0
- package/dist/esm/components/Cards/HeroImageCard/HeroImageCard.styles.js +21 -0
- package/dist/esm/components/Cards/HeroImageCard/index.js +1 -0
- package/dist/esm/components/Cards/IconTextCard/IconTextCard.js +5 -18
- package/dist/esm/components/Cards/IconTextCard/IconTextCard.styles.js +0 -5
- package/dist/esm/components/Cards/IllustrationTextCard/IllustrationTextCard.js +22 -0
- package/dist/esm/components/Cards/IllustrationTextCard/IllustrationTextCard.styles.js +28 -0
- package/dist/esm/components/Cards/IllustrationTextCard/index.js +1 -0
- package/dist/esm/components/Cards/LinkTextCard/LinkTextCard.js +7 -6
- package/dist/esm/components/Cards/LinkTextCard/LinkTextCard.styles.js +9 -6
- package/dist/esm/components/Cards/QuickLinkCard/QuickLinkCard.js +23 -0
- package/dist/esm/components/Cards/QuickLinkCard/QuickLinkCard.styles.js +25 -0
- package/dist/esm/components/Cards/QuickLinkCard/index.js +1 -0
- package/dist/esm/components/Cards/ServicesImageCard/ServicesImageCard.js +20 -0
- package/dist/esm/components/Cards/ServicesImageCard/ServicesImageCard.styles.js +32 -0
- package/dist/esm/components/Cards/ServicesImageCard/index.js +1 -0
- package/dist/esm/components/Cards/components.js +19 -0
- package/dist/esm/components/Cards/index.js +5 -0
- package/dist/esm/components/Cards/shared.styles.js +17 -1
- package/dist/esm/components/Cards/utils.js +11 -0
- package/dist/esm/components/Checkbox/Checkbox.js +2 -45
- package/dist/esm/components/Checkbox/styled.js +46 -0
- package/dist/esm/components/Checkbox/types.js +1 -0
- package/dist/esm/components/CurrencyInput/CurrencyInput.js +12 -5
- package/dist/esm/components/CurrencyInput/styled.js +33 -0
- package/dist/esm/components/Divider/Divider.js +3 -1
- package/dist/esm/components/EmailInput/EmailInput.js +18 -2
- package/dist/esm/components/EmptyState/EmptyState.js +13 -0
- package/dist/esm/components/EmptyState/EmptyState.test.js +90 -0
- package/dist/esm/components/EmptyState/index.js +1 -0
- package/dist/esm/components/EmptyState/styles.js +17 -0
- package/dist/esm/components/EmptyState/types.js +1 -0
- package/dist/esm/components/Field/Field.js +3 -2
- package/dist/esm/components/Input/Input.js +6 -64
- package/dist/esm/components/Input/styled.js +60 -0
- package/dist/esm/components/LargeValueReference/LargeValueReference.js +45 -0
- package/dist/esm/components/LargeValueReference/index.js +1 -0
- package/dist/esm/components/LargeValueReference/styles.js +23 -0
- package/dist/esm/components/PasswordInput/PasswordInput.styled.js +5 -3
- package/dist/esm/components/PasswordInput/PasswordVisibilityToggle.js +2 -8
- package/dist/esm/components/RadioCard/RadioCard.js +5 -52
- package/dist/esm/components/RadioCard/RadioCard.styles.js +61 -0
- package/dist/esm/components/SelectField/Select.js +7 -74
- package/dist/esm/components/SelectField/SelectField.js +3 -3
- package/dist/esm/components/SelectField/styled.js +82 -0
- package/dist/esm/components/SkeletonText/SkeletonText.js +4 -4
- package/dist/esm/components/TextareaInput/TextareaInput.js +12 -6
- package/dist/esm/components/Toggle/Toggle.js +4 -6
- package/dist/esm/components/Toggle/styles.js +3 -3
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/hooks/use-font-scaling.js +32 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/test/utils.js +12 -0
- package/dist/esm/utils/utils.js +12 -1
- package/dist/hooks/use-font-scaling.d.ts +26 -0
- package/dist/hooks/use-font-scaling.js +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/styled.native.d.ts +18 -0
- package/dist/test/utils.d.ts +4 -0
- package/dist/test/utils.js +28 -0
- package/dist/utils/utils.d.ts +11 -1
- package/dist/utils/utils.js +12 -0
- package/package.json +4 -4
- package/dist/components/ErrorWrapper/styles.d.ts +0 -0
- package/dist/components/ErrorWrapper/styles.js +0 -1
- package/dist/esm/components/ErrorWrapper/styles.js +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TextContainer = exports.StyledCard = void 0;
|
|
7
|
+
const styled_native_1 = __importDefault(require("../../styled.native"));
|
|
8
|
+
const Card_1 = require("../Card");
|
|
9
|
+
exports.StyledCard = (0, styled_native_1.default)(Card_1.Card)(({ theme }) => ({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
gap: theme.space[100],
|
|
14
|
+
}));
|
|
15
|
+
exports.TextContainer = styled_native_1.default.View(({ theme }) => ({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
width: '100%',
|
|
19
|
+
gap: theme.space[50],
|
|
20
|
+
paddingLeft: theme.space[400],
|
|
21
|
+
paddingRight: theme.space[400],
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PictogramNameExtended } from '../../providers';
|
|
3
|
+
import { RemoteImageProps } from '../RemoteImage';
|
|
4
|
+
export type BackgroundType = 'filled' | 'transparent';
|
|
5
|
+
type WithPictogram = {
|
|
6
|
+
illustration?: never;
|
|
7
|
+
pictogramName: PictogramNameExtended;
|
|
8
|
+
};
|
|
9
|
+
type WithIllustration = {
|
|
10
|
+
illustration: RemoteImageProps;
|
|
11
|
+
pictogramName?: never;
|
|
12
|
+
};
|
|
13
|
+
export type EmptyStateProps = (WithPictogram | WithIllustration) & {
|
|
14
|
+
backgroundStyle?: BackgroundType;
|
|
15
|
+
heading: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -42,6 +42,7 @@ declare const ErrorText: (props: Omit<{
|
|
|
42
42
|
"30": string;
|
|
43
43
|
"40": string;
|
|
44
44
|
"50": string;
|
|
45
|
+
"55": string;
|
|
45
46
|
"56": string;
|
|
46
47
|
"60": string;
|
|
47
48
|
"70": string;
|
|
@@ -84,6 +85,7 @@ declare const ErrorText: (props: Omit<{
|
|
|
84
85
|
onBrandVariant: string;
|
|
85
86
|
aiGradientFrom: string;
|
|
86
87
|
aiGradientTo: string;
|
|
88
|
+
accessible: string;
|
|
87
89
|
fixed: {
|
|
88
90
|
brand: string;
|
|
89
91
|
dark: string;
|
|
@@ -92,6 +94,7 @@ declare const ErrorText: (props: Omit<{
|
|
|
92
94
|
bright: string;
|
|
93
95
|
onBrand: string;
|
|
94
96
|
onBrandVariant: string;
|
|
97
|
+
accessible: string;
|
|
95
98
|
};
|
|
96
99
|
};
|
|
97
100
|
outline: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { TextInput } from 'react-native';
|
|
3
|
+
import { InputProps } from '../Input/Input';
|
|
3
4
|
export type FieldProps = {
|
|
4
5
|
affixWidth?: number;
|
|
5
6
|
children: ReactNode;
|
|
@@ -10,5 +11,5 @@ export type FieldProps = {
|
|
|
10
11
|
hint?: ReactNode;
|
|
11
12
|
optional?: boolean;
|
|
12
13
|
ref?: React.Ref<TextInput>;
|
|
13
|
-
}
|
|
14
|
-
export declare const Field: ({ children, label, optional, hint, error, fullWidth, characters, affixWidth, ref, ...rest }: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
} & Pick<InputProps, 'selected'>;
|
|
15
|
+
export declare const Field: ({ children, label, optional, hint, error, fullWidth, characters, affixWidth, ref, selected, ...rest }: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,7 +23,7 @@ const LabelText_1 = require("../LabelText");
|
|
|
23
23
|
const Stack_1 = require("../Stack");
|
|
24
24
|
const Stretch_1 = require("../Stretch");
|
|
25
25
|
const Field = (_a) => {
|
|
26
|
-
var { children, label, optional = false, hint, error, fullWidth, characters = 25, affixWidth = 0, ref } = _a, rest = __rest(_a, ["children", "label", "optional", "hint", "error", "fullWidth", "characters", "affixWidth", "ref"]);
|
|
26
|
+
var { children, label, optional = false, hint, error, fullWidth, characters = 25, affixWidth = 0, ref, selected } = _a, rest = __rest(_a, ["children", "label", "optional", "hint", "error", "fullWidth", "characters", "affixWidth", "ref", "selected"]);
|
|
27
27
|
const hasError = !!error;
|
|
28
28
|
const inputRef = (0, react_1.createRef)();
|
|
29
29
|
const labelText = optional ? `${label} (optional)` : label;
|
|
@@ -42,7 +42,8 @@ const Field = (_a) => {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [(0, jsx_runtime_1.jsxs)(LabelText_1.LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null, error ? (0, jsx_runtime_1.jsx)(ErrorText_1.ErrorText, { children: error }) : null] }) }), (0, jsx_runtime_1.jsx)(Stretch_1.Stretch, { defaultWidth: `${Math.ceil(characters * 0.8 * 16) + affixWidth}px`, fullWidth: fullWidth, children: react_1.Children.map(children, child => (0, react_1.isValidElement)(child)
|
|
45
|
-
? (0, react_1.cloneElement)(child, Object.assign({ invalid: hasError || undefined, ref: (0, utils_1.mergeRefs)(inputRef, ref), accessibilityLabel
|
|
45
|
+
? (0, react_1.cloneElement)(child, Object.assign({ invalid: hasError || undefined, ref: (0, utils_1.mergeRefs)(inputRef, ref), accessibilityLabel,
|
|
46
|
+
selected }, rest))
|
|
46
47
|
: child) })] }) }));
|
|
47
48
|
};
|
|
48
49
|
exports.Field = Field;
|
|
@@ -42,6 +42,7 @@ declare const Col: (props: Omit<{
|
|
|
42
42
|
"30": string;
|
|
43
43
|
"40": string;
|
|
44
44
|
"50": string;
|
|
45
|
+
"55": string;
|
|
45
46
|
"56": string;
|
|
46
47
|
"60": string;
|
|
47
48
|
"70": string;
|
|
@@ -84,6 +85,7 @@ declare const Col: (props: Omit<{
|
|
|
84
85
|
onBrandVariant: string;
|
|
85
86
|
aiGradientFrom: string;
|
|
86
87
|
aiGradientTo: string;
|
|
88
|
+
accessible: string;
|
|
87
89
|
fixed: {
|
|
88
90
|
brand: string;
|
|
89
91
|
dark: string;
|
|
@@ -92,6 +94,7 @@ declare const Col: (props: Omit<{
|
|
|
92
94
|
bright: string;
|
|
93
95
|
onBrand: string;
|
|
94
96
|
onBrandVariant: string;
|
|
97
|
+
accessible: string;
|
|
95
98
|
};
|
|
96
99
|
};
|
|
97
100
|
outline: {
|
|
@@ -42,6 +42,7 @@ declare const HintText: (props: Omit<{
|
|
|
42
42
|
"30": string;
|
|
43
43
|
"40": string;
|
|
44
44
|
"50": string;
|
|
45
|
+
"55": string;
|
|
45
46
|
"56": string;
|
|
46
47
|
"60": string;
|
|
47
48
|
"70": string;
|
|
@@ -84,6 +85,7 @@ declare const HintText: (props: Omit<{
|
|
|
84
85
|
onBrandVariant: string;
|
|
85
86
|
aiGradientFrom: string;
|
|
86
87
|
aiGradientTo: string;
|
|
88
|
+
accessible: string;
|
|
87
89
|
fixed: {
|
|
88
90
|
brand: string;
|
|
89
91
|
dark: string;
|
|
@@ -92,6 +94,7 @@ declare const HintText: (props: Omit<{
|
|
|
92
94
|
bright: string;
|
|
93
95
|
onBrand: string;
|
|
94
96
|
onBrandVariant: string;
|
|
97
|
+
accessible: string;
|
|
95
98
|
};
|
|
96
99
|
};
|
|
97
100
|
outline: {
|
|
@@ -7,7 +7,8 @@ export type InputProps = TextInputProps & {
|
|
|
7
7
|
invalid?: boolean;
|
|
8
8
|
ref?: React.Ref<TextInput | null>;
|
|
9
9
|
rightSlot?: ReactNode;
|
|
10
|
+
selected?: boolean;
|
|
10
11
|
stretch?: boolean;
|
|
11
12
|
};
|
|
12
|
-
declare const Input: ({ onFocus, onBlur, style, iconLeft, iconRight, rightSlot, ref, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const Input: ({ onFocus, onBlur, style, iconLeft, iconRight, invalid, rightSlot, ref, selected, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export { Input };
|
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
3
|
var t = {};
|
|
37
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -46,30 +13,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
46
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
14
|
exports.Input = void 0;
|
|
48
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
49
|
-
const element_core_1 = require("@ovotech/element-core");
|
|
50
16
|
const react_1 = require("react");
|
|
51
17
|
const hooks_1 = require("../../hooks");
|
|
52
|
-
const styled_native_1 =
|
|
53
|
-
const
|
|
54
|
-
const StyledIcon = (0, styled_native_1.default)(Icon_1.Icon)(({ theme, side, focused }) => {
|
|
55
|
-
const focusCompensation = focused ? theme.space[50] : 0;
|
|
56
|
-
return (0, styled_native_1.css) `
|
|
57
|
-
position: absolute;
|
|
58
|
-
z-index: 1;
|
|
59
|
-
top: ${(0, element_core_1.numToPx)(theme.space[350] + focusCompensation)};
|
|
60
|
-
${side === 'left'
|
|
61
|
-
? `left: ${(0, element_core_1.numToPx)(theme.space[200] + focusCompensation)}`
|
|
62
|
-
: ''};
|
|
63
|
-
${side === 'right'
|
|
64
|
-
? `right: ${(0, element_core_1.numToPx)(theme.space[200] + focusCompensation)}`
|
|
65
|
-
: ''};
|
|
66
|
-
`;
|
|
67
|
-
});
|
|
18
|
+
const styled_native_1 = require("../../styled.native");
|
|
19
|
+
const styled_1 = require("./styled");
|
|
68
20
|
const Input = (_a) => {
|
|
69
|
-
var { onFocus, onBlur, style, iconLeft, iconRight, rightSlot, ref } = _a, rest = __rest(_a, ["onFocus", "onBlur", "style", "iconLeft", "iconRight", "rightSlot", "ref"]);
|
|
21
|
+
var { onFocus, onBlur, style, iconLeft, iconRight, invalid, rightSlot, ref, selected } = _a, rest = __rest(_a, ["onFocus", "onBlur", "style", "iconLeft", "iconRight", "invalid", "rightSlot", "ref", "selected"]);
|
|
70
22
|
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
71
23
|
const breakpoints = (0, hooks_1.useBreakpoint)();
|
|
72
|
-
|
|
24
|
+
const theme = (0, styled_native_1.useTheme)();
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(styled_1.StyledInputWrapper, { focused: focused, hasError: invalid, isSelected: selected, children: [iconLeft ? ((0, jsx_runtime_1.jsx)(styled_1.StyledIcon, { name: iconLeft, size: styled_1.ICON_SIZE, pointerEvents: "none", side: "left" })) : null, (0, jsx_runtime_1.jsx)(styled_1.StyledInput, Object.assign({}, rest, breakpoints, { hasRightSlot: !!rightSlot, iconLeft: !!iconLeft, iconRight: !!iconRight, invalid: invalid, placeholderTextColor: theme.color.surface.onSurfaceVariant, ref: ref, style: style, onFocus: (event) => {
|
|
73
26
|
setFocused(true);
|
|
74
27
|
if (onFocus) {
|
|
75
28
|
onFocus(event);
|
|
@@ -79,50 +32,6 @@ const Input = (_a) => {
|
|
|
79
32
|
if (onBlur) {
|
|
80
33
|
onBlur(event);
|
|
81
34
|
}
|
|
82
|
-
} })), iconRight && !rightSlot ? ((0, jsx_runtime_1.jsx)(StyledIcon, { name: iconRight, size:
|
|
35
|
+
} })), iconRight && !rightSlot ? ((0, jsx_runtime_1.jsx)(styled_1.StyledIcon, { name: iconRight, size: styled_1.ICON_SIZE, pointerEvents: "none", side: "right" })) : null, rightSlot] }));
|
|
83
36
|
};
|
|
84
37
|
exports.Input = Input;
|
|
85
|
-
const InputWrapper = styled_native_1.default.View(({ theme, focused }) => (0, styled_native_1.css) `
|
|
86
|
-
align-self: stretch;
|
|
87
|
-
border-radius: ${(0, element_core_1.numToPx)(theme.border.radius.md)};
|
|
88
|
-
border-width: 0;
|
|
89
|
-
border-style: solid;
|
|
90
|
-
border-color: ${theme.input.color.border};
|
|
91
|
-
flex-direction: row;
|
|
92
|
-
|
|
93
|
-
${focused
|
|
94
|
-
? `
|
|
95
|
-
border-width: ${(0, element_core_1.numToPx)(theme.border.width.md)};
|
|
96
|
-
border-color: ${theme.color.outline.outer};
|
|
97
|
-
padding: 2px;
|
|
98
|
-
margin: -4px;`
|
|
99
|
-
: null}
|
|
100
|
-
`);
|
|
101
|
-
const StyledInput = styled_native_1.default.TextInput(({ theme, invalid, smallAndUp, iconLeft, iconRight, hasRightSlot }) => {
|
|
102
|
-
const fontSize = smallAndUp
|
|
103
|
-
? theme.font.size.md.mediaQuery.lg
|
|
104
|
-
: theme.font.size.md.mediaQuery.sm;
|
|
105
|
-
const errorStyles = invalid
|
|
106
|
-
? `
|
|
107
|
-
border-color: ${theme.color.alert.error};
|
|
108
|
-
`
|
|
109
|
-
: '';
|
|
110
|
-
return (0, styled_native_1.css) `
|
|
111
|
-
font-family: ${theme.native.font.family.book};
|
|
112
|
-
color: ${theme.color.surface.onSurface};
|
|
113
|
-
font-size: ${(0, element_core_1.numToPx)(fontSize)};
|
|
114
|
-
height: ${(0, element_core_1.numToPx)(theme.space[1100])};
|
|
115
|
-
line-height: 18px; /* Corrects for responsive line height in fixed height input */
|
|
116
|
-
border: ${(0, element_core_1.numToPx)(theme.border.width.md)} solid ${theme.input.color.border};
|
|
117
|
-
border-radius: ${(0, element_core_1.numToPx)(theme.border.radius.sm)};
|
|
118
|
-
padding: ${(0, element_core_1.numToPx)(theme.space[200])};
|
|
119
|
-
flex: 1;
|
|
120
|
-
|
|
121
|
-
${iconLeft ? `padding-left: ${(0, element_core_1.numToPx)(theme.space[800])};` : ''}
|
|
122
|
-
${iconRight || hasRightSlot
|
|
123
|
-
? `padding-right: ${(0, element_core_1.numToPx)(theme.space[800])};`
|
|
124
|
-
: ''}
|
|
125
|
-
|
|
126
|
-
${errorStyles}
|
|
127
|
-
`;
|
|
128
|
-
});
|