@ovotech/element-native 2.1.0 → 2.2.0-canary-1cac2ba-73
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/Accordion.js +20 -19
- package/dist/components/Accordion/Icon.js +7 -10
- package/dist/components/Accordion/styles.d.ts +688 -46
- package/dist/components/Accordion/styles.js +56 -49
- package/dist/components/Badge/Badge.d.ts +237 -8
- package/dist/components/Badge/Badge.js +35 -16
- package/dist/components/CTAButton/CTAButton.d.ts +7 -12
- package/dist/components/CTAButton/CTAButton.js +18 -19
- package/dist/components/CTALink/CTALink.d.ts +3 -3
- package/dist/components/Card/Card.d.ts +228 -5
- package/dist/components/Card/Card.js +5 -25
- package/dist/components/Checkbox/Checkbox.js +14 -19
- package/dist/components/DataTable/DataTable.d.ts +3 -12
- package/dist/components/DataTable/DataTable.js +8 -71
- package/dist/components/DataTable/TableRow.d.ts +2 -0
- package/dist/components/DataTable/TableRow.js +33 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.js +16 -0
- package/dist/components/DataTable/styles.d.ts +2517 -0
- package/dist/components/DataTable/styles.js +77 -0
- package/dist/components/DataTable/types.d.ts +15 -0
- package/dist/components/DataTable/types.js +2 -0
- package/dist/components/DateField/DateField.js +9 -9
- package/dist/components/DescriptionList/DescriptionList.d.ts +10 -0
- package/dist/components/DescriptionList/DescriptionList.js +66 -0
- package/dist/components/DescriptionList/index.d.ts +1 -0
- package/dist/components/DescriptionList/index.js +6 -0
- package/dist/components/DescriptionList/styled.d.ts +241 -0
- package/dist/components/DescriptionList/styled.js +88 -0
- package/dist/components/Disclosure/Disclosure.js +7 -10
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
- package/dist/components/ErrorText/ErrorText.d.ts +228 -1
- package/dist/components/ErrorText/ErrorText.js +1 -1
- package/dist/components/Field/Field.js +3 -3
- package/dist/components/Grid/Col.d.ts +228 -1
- package/dist/components/Grid/Row.d.ts +228 -1
- package/dist/components/Heading/Heading.js +8 -24
- package/dist/components/HintText/HintText.d.ts +228 -1
- package/dist/components/HintText/HintText.js +1 -1
- package/dist/components/Icon/Icon.d.ts +2 -3
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +13 -16
- package/dist/components/Input/PasswordInput.styled.d.ts +228 -1
- package/dist/components/Input/PasswordInput.styled.js +2 -5
- package/dist/components/Input/PasswordVisibilityToggle.js +2 -5
- package/dist/components/Input/{TelInput.d.ts → PhoneInput.d.ts} +2 -2
- package/dist/components/Input/{TelInput.js → PhoneInput.js} +3 -3
- package/dist/components/Input/TextareaInput.js +11 -9
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/LabelText/LabelText.d.ts +228 -1
- package/dist/components/LabelText/LabelText.js +1 -1
- package/dist/components/List/List.d.ts +706 -3
- package/dist/components/List/List.js +18 -5
- package/dist/components/Margin/Margin.d.ts +228 -1
- package/dist/components/NavHeader/NavHeader.js +4 -4
- package/dist/components/Notification/Notification.d.ts +466 -20
- package/dist/components/Notification/Notification.js +32 -44
- package/dist/components/Radio/Radio.js +13 -29
- package/dist/components/SelectField/Select.d.ts +244 -0
- package/dist/components/SelectField/Select.js +101 -0
- package/dist/components/SelectField/SelectField.d.ts +7 -0
- package/dist/components/SelectField/SelectField.js +38 -0
- package/dist/components/SelectField/index.d.ts +1 -0
- package/dist/components/SelectField/index.js +5 -0
- package/dist/components/SkeletonLoading/Skeleton.d.ts +228 -1
- package/dist/components/SubLabelText/SubLabelText.d.ts +228 -1
- package/dist/components/SubLabelText/SubLabelText.js +1 -1
- package/dist/components/SummaryList/SummaryList.d.ts +4 -0
- package/dist/components/SummaryList/SummaryList.js +5 -0
- package/dist/components/Tabs/Tab.js +22 -19
- package/dist/components/Tabs/TabList.d.ts +11 -1
- package/dist/components/Tabs/TabList.js +19 -16
- package/dist/components/Tabs/TabPanel.js +32 -6
- package/dist/components/Tabs/Tabs.d.ts +8 -6
- package/dist/components/Tabs/Tabs.js +10 -6
- package/dist/components/Text/Text.d.ts +1140 -5
- package/dist/components/Text/Text.js +6 -10
- package/dist/components/TextField/PhoneField.d.ts +10 -0
- package/dist/components/TextField/PhoneField.js +56 -0
- package/dist/components/TextField/TelField.d.ts +4 -0
- package/dist/components/TextField/TelField.js +7 -2
- package/dist/components/TextField/index.d.ts +1 -0
- package/dist/components/TextField/index.js +3 -1
- package/dist/components/TextLink/TextLink.js +2 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/esm/components/Accordion/Accordion.js +23 -22
- package/dist/esm/components/Accordion/Icon.js +8 -8
- package/dist/esm/components/Accordion/styles.js +29 -48
- package/dist/esm/components/Badge/Badge.js +35 -16
- package/dist/esm/components/CTAButton/CTAButton.js +20 -21
- package/dist/esm/components/Card/Card.js +5 -25
- package/dist/esm/components/Checkbox/Checkbox.js +12 -20
- package/dist/esm/components/DataTable/DataTable.js +3 -66
- package/dist/esm/components/DataTable/TableRow.js +26 -0
- package/dist/esm/components/DataTable/index.js +2 -0
- package/dist/esm/components/DataTable/styles.js +51 -0
- package/dist/esm/components/DataTable/types.js +1 -0
- package/dist/esm/components/DateField/DateField.js +9 -9
- package/dist/esm/components/DescriptionList/DescriptionList.js +39 -0
- package/dist/esm/components/DescriptionList/index.js +1 -0
- package/dist/esm/components/DescriptionList/styled.js +57 -0
- package/dist/esm/components/Disclosure/Disclosure.js +9 -12
- package/dist/esm/components/ErrorText/ErrorText.js +1 -1
- package/dist/esm/components/Field/Field.js +3 -3
- package/dist/esm/components/Heading/Heading.js +8 -24
- package/dist/esm/components/HintText/HintText.js +1 -1
- package/dist/esm/components/Icon/Icon.js +2 -2
- package/dist/esm/components/Input/Input.js +15 -18
- package/dist/esm/components/Input/PasswordInput.styled.js +2 -5
- package/dist/esm/components/Input/PasswordVisibilityToggle.js +3 -6
- package/dist/esm/components/Input/{TelInput.js → PhoneInput.js} +2 -2
- package/dist/esm/components/Input/TextareaInput.js +11 -9
- package/dist/esm/components/Input/index.js +1 -1
- package/dist/esm/components/LabelText/LabelText.js +1 -1
- package/dist/esm/components/List/List.js +17 -5
- package/dist/esm/components/NavHeader/NavHeader.js +4 -4
- package/dist/esm/components/Notification/Notification.js +34 -46
- package/dist/esm/components/Radio/Radio.js +13 -29
- package/dist/esm/components/SelectField/Select.js +74 -0
- package/dist/esm/components/SelectField/SelectField.js +31 -0
- package/dist/esm/components/SelectField/index.js +1 -0
- package/dist/esm/components/SubLabelText/SubLabelText.js +1 -1
- package/dist/esm/components/SummaryList/SummaryList.js +5 -0
- package/dist/esm/components/Tabs/Tab.js +22 -16
- package/dist/esm/components/Tabs/TabList.js +18 -16
- package/dist/esm/components/Tabs/TabPanel.js +9 -6
- package/dist/esm/components/Tabs/Tabs.js +9 -6
- package/dist/esm/components/Text/Text.js +6 -10
- package/dist/esm/components/TextField/PhoneField.js +30 -0
- package/dist/esm/components/TextField/TelField.js +7 -2
- package/dist/esm/components/TextField/index.js +1 -0
- package/dist/esm/components/TextLink/TextLink.js +2 -2
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/providers/icons/Logo.js +6 -3
- package/dist/esm/theme/create-theme.js +2 -176
- package/dist/esm/theme/index.js +13 -2
- package/dist/providers/icons/Logo.js +5 -2
- package/dist/styled.native.d.ts +1363 -1
- package/dist/theme/create-theme.d.ts +1 -1
- package/dist/theme/create-theme.js +2 -176
- package/dist/theme/index.d.ts +228 -2
- package/dist/theme/index.js +13 -2
- package/dist/theme/theme.d.ts +1 -110
- package/package.json +9 -6
|
@@ -1,6 +1,233 @@
|
|
|
1
1
|
import React, { ComponentProps } from 'react';
|
|
2
2
|
import { Breakpoints } from '../../hooks';
|
|
3
|
-
declare const StyledRow: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme
|
|
3
|
+
declare const StyledRow: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme & {
|
|
4
|
+
core: {
|
|
5
|
+
radius: Record<"small" | "medium" | "large" | "max", string>;
|
|
6
|
+
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
7
|
+
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
8
|
+
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
9
|
+
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15, string>;
|
|
10
|
+
transition: Record<"medium" | "slow" | "fast", string>;
|
|
11
|
+
opacity: Record<"solid" | "transparent" | "translucent", string | number>;
|
|
12
|
+
color: Record<"neutral" | "red" | "orange" | "yellow" | "green" | "blue", {
|
|
13
|
+
lightest: string;
|
|
14
|
+
lighter: string;
|
|
15
|
+
light: string;
|
|
16
|
+
base: string;
|
|
17
|
+
dark: string;
|
|
18
|
+
darker: string;
|
|
19
|
+
darkest: string;
|
|
20
|
+
}> & {
|
|
21
|
+
brand: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
fontFamily: Record<"heading" | "body" | "mono" | "bodyBold", {
|
|
24
|
+
native: string;
|
|
25
|
+
web: string;
|
|
26
|
+
}>;
|
|
27
|
+
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
28
|
+
fontSize: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
29
|
+
small: string | number;
|
|
30
|
+
large: string | number;
|
|
31
|
+
}>;
|
|
32
|
+
lineHeight: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
33
|
+
small: string | number;
|
|
34
|
+
large: string | number;
|
|
35
|
+
}>;
|
|
36
|
+
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
37
|
+
};
|
|
38
|
+
semantic: {
|
|
39
|
+
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
40
|
+
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
41
|
+
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
42
|
+
focus: Record<"surface" | "outline" | "hover", string>;
|
|
43
|
+
inverted: Record<"border" | "surface", string> & {
|
|
44
|
+
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
45
|
+
};
|
|
46
|
+
success: {
|
|
47
|
+
border: string;
|
|
48
|
+
surface: string;
|
|
49
|
+
surfaceEmphasis: string;
|
|
50
|
+
message: string;
|
|
51
|
+
messageOnEmphasis: string;
|
|
52
|
+
};
|
|
53
|
+
warning: {
|
|
54
|
+
border: string;
|
|
55
|
+
surface: string;
|
|
56
|
+
surfaceEmphasis: string;
|
|
57
|
+
message: string;
|
|
58
|
+
messageOnEmphasis: string;
|
|
59
|
+
};
|
|
60
|
+
error: {
|
|
61
|
+
border: string;
|
|
62
|
+
surface: string;
|
|
63
|
+
surfaceEmphasis: string;
|
|
64
|
+
message: string;
|
|
65
|
+
messageOnEmphasis: string;
|
|
66
|
+
};
|
|
67
|
+
info: {
|
|
68
|
+
border: string;
|
|
69
|
+
surface: string;
|
|
70
|
+
surfaceEmphasis: string;
|
|
71
|
+
message: string;
|
|
72
|
+
messageOnEmphasis: string;
|
|
73
|
+
};
|
|
74
|
+
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
75
|
+
};
|
|
76
|
+
component: {
|
|
77
|
+
heading1: {
|
|
78
|
+
fontFamily: string;
|
|
79
|
+
fontWeight: string | number;
|
|
80
|
+
fontSize: {
|
|
81
|
+
small: string | number;
|
|
82
|
+
large: string | number;
|
|
83
|
+
};
|
|
84
|
+
lineHeight: {
|
|
85
|
+
small: string | number;
|
|
86
|
+
large: string | number;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
heading2: {
|
|
90
|
+
fontFamily: string;
|
|
91
|
+
fontWeight: string | number;
|
|
92
|
+
fontSize: {
|
|
93
|
+
small: string | number;
|
|
94
|
+
large: string | number;
|
|
95
|
+
};
|
|
96
|
+
lineHeight: {
|
|
97
|
+
small: string | number;
|
|
98
|
+
large: string | number;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
heading3: {
|
|
102
|
+
fontFamily: string;
|
|
103
|
+
fontWeight: string | number;
|
|
104
|
+
fontSize: {
|
|
105
|
+
small: string | number;
|
|
106
|
+
large: string | number;
|
|
107
|
+
};
|
|
108
|
+
lineHeight: {
|
|
109
|
+
small: string | number;
|
|
110
|
+
large: string | number;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
heading4: {
|
|
114
|
+
fontFamily: string;
|
|
115
|
+
fontWeight: string | number;
|
|
116
|
+
fontSize: {
|
|
117
|
+
small: string | number;
|
|
118
|
+
large: string | number;
|
|
119
|
+
};
|
|
120
|
+
lineHeight: {
|
|
121
|
+
small: string | number;
|
|
122
|
+
large: string | number;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
lead: {
|
|
126
|
+
fontFamily: string;
|
|
127
|
+
fontWeight: string | number;
|
|
128
|
+
fontSize: {
|
|
129
|
+
small: string | number;
|
|
130
|
+
large: string | number;
|
|
131
|
+
};
|
|
132
|
+
lineHeight: {
|
|
133
|
+
small: string | number;
|
|
134
|
+
large: string | number;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
body: {
|
|
138
|
+
fontFamily: string;
|
|
139
|
+
fontWeight: string | number;
|
|
140
|
+
fontSize: {
|
|
141
|
+
small: string | number;
|
|
142
|
+
large: string | number;
|
|
143
|
+
};
|
|
144
|
+
lineHeight: {
|
|
145
|
+
small: string | number;
|
|
146
|
+
large: string | number;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
small: {
|
|
150
|
+
fontFamily: string;
|
|
151
|
+
fontWeight: string | number;
|
|
152
|
+
fontSize: {
|
|
153
|
+
small: string | number;
|
|
154
|
+
large: string | number;
|
|
155
|
+
};
|
|
156
|
+
lineHeight: {
|
|
157
|
+
small: string | number;
|
|
158
|
+
large: string | number;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
label: {
|
|
162
|
+
fontFamily: string;
|
|
163
|
+
fontWeight: string | number;
|
|
164
|
+
fontSize: {
|
|
165
|
+
small: string | number;
|
|
166
|
+
large: string | number;
|
|
167
|
+
};
|
|
168
|
+
lineHeight: {
|
|
169
|
+
small: string | number;
|
|
170
|
+
large: string | number;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
cta: {
|
|
174
|
+
primary: {
|
|
175
|
+
message: string;
|
|
176
|
+
surface: string;
|
|
177
|
+
messageHover: string;
|
|
178
|
+
surfaceHover: string;
|
|
179
|
+
messageFocused: string;
|
|
180
|
+
surfaceFocused: string;
|
|
181
|
+
outlineFocused: string;
|
|
182
|
+
backgroundFocused: string;
|
|
183
|
+
};
|
|
184
|
+
secondary: {
|
|
185
|
+
message: string;
|
|
186
|
+
surface: string;
|
|
187
|
+
messageHover: string;
|
|
188
|
+
surfaceHover: string;
|
|
189
|
+
messageFocused: string;
|
|
190
|
+
surfaceFocused: string;
|
|
191
|
+
outlineFocused: string;
|
|
192
|
+
backgroundFocused: string;
|
|
193
|
+
};
|
|
194
|
+
destructive: {
|
|
195
|
+
message: string;
|
|
196
|
+
surface: string;
|
|
197
|
+
messageHover: string;
|
|
198
|
+
surfaceHover: string;
|
|
199
|
+
messageFocused: string;
|
|
200
|
+
surfaceFocused: string;
|
|
201
|
+
outlineFocused: string;
|
|
202
|
+
backgroundFocused: string;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
badge: {
|
|
206
|
+
variants: {
|
|
207
|
+
red: {
|
|
208
|
+
foreground: string;
|
|
209
|
+
background: string;
|
|
210
|
+
};
|
|
211
|
+
orange: {
|
|
212
|
+
foreground: string;
|
|
213
|
+
background: string;
|
|
214
|
+
};
|
|
215
|
+
yellow: {
|
|
216
|
+
foreground: string;
|
|
217
|
+
background: string;
|
|
218
|
+
};
|
|
219
|
+
green: {
|
|
220
|
+
foreground: string;
|
|
221
|
+
background: string;
|
|
222
|
+
};
|
|
223
|
+
blue: {
|
|
224
|
+
foreground: string;
|
|
225
|
+
background: string;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
}, {
|
|
4
231
|
isNested?: boolean | undefined;
|
|
5
232
|
} & {
|
|
6
233
|
children?: React.ReactNode;
|
|
@@ -57,12 +57,8 @@ var react_1 = __importDefault(require("react"));
|
|
|
57
57
|
var hooks_1 = require("../../hooks");
|
|
58
58
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
59
59
|
var StyledHeading1 = styled_native_1.default.Text(function (_a) {
|
|
60
|
-
var
|
|
61
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-
|
|
62
|
-
? heading.heading1.marginTop[1]
|
|
63
|
-
: heading.heading1.marginTop[0], smallAndUp
|
|
64
|
-
? heading.heading1.marginBottom[1]
|
|
65
|
-
: heading.heading1.marginBottom[0]);
|
|
60
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
61
|
+
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.heading.native, core.fontSize.heading1[smallAndUp ? 'large' : 'small'], core.lineHeight.heading1[smallAndUp ? 'large' : 'small'], semantic.message.branded);
|
|
66
62
|
});
|
|
67
63
|
var Heading1 = function (_a) {
|
|
68
64
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
@@ -71,12 +67,8 @@ var Heading1 = function (_a) {
|
|
|
71
67
|
};
|
|
72
68
|
exports.Heading1 = Heading1;
|
|
73
69
|
var StyledHeading2 = styled_native_1.default.Text(function (_a) {
|
|
74
|
-
var
|
|
75
|
-
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n
|
|
76
|
-
? heading.heading2.marginTop[1]
|
|
77
|
-
: heading.heading2.marginTop[0], smallAndUp
|
|
78
|
-
? heading.heading2.marginBottom[1]
|
|
79
|
-
: heading.heading2.marginBottom[0]);
|
|
70
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
71
|
+
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __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.heading.native, core.fontSize.heading2[smallAndUp ? 'large' : 'small'], core.lineHeight.heading2[smallAndUp ? 'large' : 'small'], semantic.message.branded);
|
|
80
72
|
});
|
|
81
73
|
var Heading2 = function (_a) {
|
|
82
74
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
@@ -85,12 +77,8 @@ var Heading2 = function (_a) {
|
|
|
85
77
|
};
|
|
86
78
|
exports.Heading2 = Heading2;
|
|
87
79
|
var StyledHeading3 = styled_native_1.default.Text(function (_a) {
|
|
88
|
-
var
|
|
89
|
-
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n
|
|
90
|
-
? heading.heading3.marginTop[1]
|
|
91
|
-
: heading.heading3.marginTop[0], smallAndUp
|
|
92
|
-
? heading.heading3.marginBottom[1]
|
|
93
|
-
: heading.heading3.marginBottom[0]);
|
|
80
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
81
|
+
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __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.heading.native, core.fontSize.heading3[smallAndUp ? 'large' : 'small'], core.lineHeight.heading3[smallAndUp ? 'large' : 'small'], semantic.message.branded);
|
|
94
82
|
});
|
|
95
83
|
var Heading3 = function (_a) {
|
|
96
84
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
@@ -99,12 +87,8 @@ var Heading3 = function (_a) {
|
|
|
99
87
|
};
|
|
100
88
|
exports.Heading3 = Heading3;
|
|
101
89
|
var StyledHeading4 = styled_native_1.default.Text(function (_a) {
|
|
102
|
-
var
|
|
103
|
-
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n
|
|
104
|
-
? heading.heading4.marginTop[1]
|
|
105
|
-
: heading.heading4.marginTop[0], smallAndUp
|
|
106
|
-
? heading.heading4.marginBottom[1]
|
|
107
|
-
: heading.heading4.marginBottom[0]);
|
|
90
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
91
|
+
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __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.heading.native, core.fontSize.heading4[smallAndUp ? 'large' : 'small'], core.lineHeight.heading4[smallAndUp ? 'large' : 'small'], semantic.message.branded);
|
|
108
92
|
});
|
|
109
93
|
var Heading4 = function (_a) {
|
|
110
94
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
@@ -5,7 +5,234 @@ declare const HintText: import("react").ForwardRefExoticComponent<Pick<Omit<{
|
|
|
5
5
|
[x: number]: any;
|
|
6
6
|
[x: symbol]: any;
|
|
7
7
|
} & {
|
|
8
|
-
theme?: import("../../theme/theme").Theme
|
|
8
|
+
theme?: (import("../../theme/theme").Theme & {
|
|
9
|
+
core: {
|
|
10
|
+
radius: Record<"small" | "medium" | "large" | "max", string>;
|
|
11
|
+
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
12
|
+
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
13
|
+
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
14
|
+
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15, string>;
|
|
15
|
+
transition: Record<"medium" | "slow" | "fast", string>;
|
|
16
|
+
opacity: Record<"solid" | "transparent" | "translucent", string | number>;
|
|
17
|
+
color: Record<"neutral" | "red" | "orange" | "yellow" | "green" | "blue", {
|
|
18
|
+
lightest: string;
|
|
19
|
+
lighter: string;
|
|
20
|
+
light: string;
|
|
21
|
+
base: string;
|
|
22
|
+
dark: string;
|
|
23
|
+
darker: string;
|
|
24
|
+
darkest: string;
|
|
25
|
+
}> & {
|
|
26
|
+
brand: Record<string, string>;
|
|
27
|
+
};
|
|
28
|
+
fontFamily: Record<"heading" | "body" | "mono" | "bodyBold", {
|
|
29
|
+
native: string;
|
|
30
|
+
web: string;
|
|
31
|
+
}>;
|
|
32
|
+
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
33
|
+
fontSize: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
34
|
+
small: string | number;
|
|
35
|
+
large: string | number;
|
|
36
|
+
}>;
|
|
37
|
+
lineHeight: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
38
|
+
small: string | number;
|
|
39
|
+
large: string | number;
|
|
40
|
+
}>;
|
|
41
|
+
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
42
|
+
};
|
|
43
|
+
semantic: {
|
|
44
|
+
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
45
|
+
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
46
|
+
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
47
|
+
focus: Record<"surface" | "outline" | "hover", string>;
|
|
48
|
+
inverted: Record<"border" | "surface", string> & {
|
|
49
|
+
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
50
|
+
};
|
|
51
|
+
success: {
|
|
52
|
+
border: string;
|
|
53
|
+
surface: string;
|
|
54
|
+
surfaceEmphasis: string;
|
|
55
|
+
message: string;
|
|
56
|
+
messageOnEmphasis: string;
|
|
57
|
+
};
|
|
58
|
+
warning: {
|
|
59
|
+
border: string;
|
|
60
|
+
surface: string;
|
|
61
|
+
surfaceEmphasis: string;
|
|
62
|
+
message: string;
|
|
63
|
+
messageOnEmphasis: string;
|
|
64
|
+
};
|
|
65
|
+
error: {
|
|
66
|
+
border: string;
|
|
67
|
+
surface: string;
|
|
68
|
+
surfaceEmphasis: string;
|
|
69
|
+
message: string;
|
|
70
|
+
messageOnEmphasis: string;
|
|
71
|
+
};
|
|
72
|
+
info: {
|
|
73
|
+
border: string;
|
|
74
|
+
surface: string;
|
|
75
|
+
surfaceEmphasis: string;
|
|
76
|
+
message: string;
|
|
77
|
+
messageOnEmphasis: string;
|
|
78
|
+
};
|
|
79
|
+
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
80
|
+
};
|
|
81
|
+
component: {
|
|
82
|
+
heading1: {
|
|
83
|
+
fontFamily: string;
|
|
84
|
+
fontWeight: string | number;
|
|
85
|
+
fontSize: {
|
|
86
|
+
small: string | number;
|
|
87
|
+
large: string | number;
|
|
88
|
+
};
|
|
89
|
+
lineHeight: {
|
|
90
|
+
small: string | number;
|
|
91
|
+
large: string | number;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
heading2: {
|
|
95
|
+
fontFamily: string;
|
|
96
|
+
fontWeight: string | number;
|
|
97
|
+
fontSize: {
|
|
98
|
+
small: string | number;
|
|
99
|
+
large: string | number;
|
|
100
|
+
};
|
|
101
|
+
lineHeight: {
|
|
102
|
+
small: string | number;
|
|
103
|
+
large: string | number;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
heading3: {
|
|
107
|
+
fontFamily: string;
|
|
108
|
+
fontWeight: string | number;
|
|
109
|
+
fontSize: {
|
|
110
|
+
small: string | number;
|
|
111
|
+
large: string | number;
|
|
112
|
+
};
|
|
113
|
+
lineHeight: {
|
|
114
|
+
small: string | number;
|
|
115
|
+
large: string | number;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
heading4: {
|
|
119
|
+
fontFamily: string;
|
|
120
|
+
fontWeight: string | number;
|
|
121
|
+
fontSize: {
|
|
122
|
+
small: string | number;
|
|
123
|
+
large: string | number;
|
|
124
|
+
};
|
|
125
|
+
lineHeight: {
|
|
126
|
+
small: string | number;
|
|
127
|
+
large: string | number;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
lead: {
|
|
131
|
+
fontFamily: string;
|
|
132
|
+
fontWeight: string | number;
|
|
133
|
+
fontSize: {
|
|
134
|
+
small: string | number;
|
|
135
|
+
large: string | number;
|
|
136
|
+
};
|
|
137
|
+
lineHeight: {
|
|
138
|
+
small: string | number;
|
|
139
|
+
large: string | number;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
body: {
|
|
143
|
+
fontFamily: string;
|
|
144
|
+
fontWeight: string | number;
|
|
145
|
+
fontSize: {
|
|
146
|
+
small: string | number;
|
|
147
|
+
large: string | number;
|
|
148
|
+
};
|
|
149
|
+
lineHeight: {
|
|
150
|
+
small: string | number;
|
|
151
|
+
large: string | number;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
small: {
|
|
155
|
+
fontFamily: string;
|
|
156
|
+
fontWeight: string | number;
|
|
157
|
+
fontSize: {
|
|
158
|
+
small: string | number;
|
|
159
|
+
large: string | number;
|
|
160
|
+
};
|
|
161
|
+
lineHeight: {
|
|
162
|
+
small: string | number;
|
|
163
|
+
large: string | number;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
label: {
|
|
167
|
+
fontFamily: string;
|
|
168
|
+
fontWeight: string | number;
|
|
169
|
+
fontSize: {
|
|
170
|
+
small: string | number;
|
|
171
|
+
large: string | number;
|
|
172
|
+
};
|
|
173
|
+
lineHeight: {
|
|
174
|
+
small: string | number;
|
|
175
|
+
large: string | number;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
cta: {
|
|
179
|
+
primary: {
|
|
180
|
+
message: string;
|
|
181
|
+
surface: string;
|
|
182
|
+
messageHover: string;
|
|
183
|
+
surfaceHover: string;
|
|
184
|
+
messageFocused: string;
|
|
185
|
+
surfaceFocused: string;
|
|
186
|
+
outlineFocused: string;
|
|
187
|
+
backgroundFocused: string;
|
|
188
|
+
};
|
|
189
|
+
secondary: {
|
|
190
|
+
message: string;
|
|
191
|
+
surface: string;
|
|
192
|
+
messageHover: string;
|
|
193
|
+
surfaceHover: string;
|
|
194
|
+
messageFocused: string;
|
|
195
|
+
surfaceFocused: string;
|
|
196
|
+
outlineFocused: string;
|
|
197
|
+
backgroundFocused: string;
|
|
198
|
+
};
|
|
199
|
+
destructive: {
|
|
200
|
+
message: string;
|
|
201
|
+
surface: string;
|
|
202
|
+
messageHover: string;
|
|
203
|
+
surfaceHover: string;
|
|
204
|
+
messageFocused: string;
|
|
205
|
+
surfaceFocused: string;
|
|
206
|
+
outlineFocused: string;
|
|
207
|
+
backgroundFocused: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
badge: {
|
|
211
|
+
variants: {
|
|
212
|
+
red: {
|
|
213
|
+
foreground: string;
|
|
214
|
+
background: string;
|
|
215
|
+
};
|
|
216
|
+
orange: {
|
|
217
|
+
foreground: string;
|
|
218
|
+
background: string;
|
|
219
|
+
};
|
|
220
|
+
yellow: {
|
|
221
|
+
foreground: string;
|
|
222
|
+
background: string;
|
|
223
|
+
};
|
|
224
|
+
green: {
|
|
225
|
+
foreground: string;
|
|
226
|
+
background: string;
|
|
227
|
+
};
|
|
228
|
+
blue: {
|
|
229
|
+
foreground: string;
|
|
230
|
+
background: string;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
}) | undefined;
|
|
9
236
|
} & {
|
|
10
237
|
as?: string | import("react").ComponentType<any> | undefined;
|
|
11
238
|
forwardedAs?: string | import("react").ComponentType<any> | undefined;
|
|
@@ -34,7 +34,7 @@ var utils_1 = require("../../utils");
|
|
|
34
34
|
var StyledHintText = styled_native_1.default.Text(function (_a) {
|
|
35
35
|
var field = _a.theme.field, smallAndUp = _a.smallAndUp;
|
|
36
36
|
var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
|
|
37
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-
|
|
37
|
+
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 "])), field.fontFamily, fontSize, (0, theme_1.calculateLineHeight)(fontSize, field.lineHeight), field.hint.color);
|
|
38
38
|
});
|
|
39
39
|
var HintText = (0, utils_1.styledComponentWithBreakpoints)(StyledHintText);
|
|
40
40
|
exports.HintText = HintText;
|
|
@@ -2,10 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { SvgProps } from 'react-native-svg';
|
|
3
3
|
import { IconName } from '../../providers';
|
|
4
4
|
export declare type IconBase = React.FunctionComponent<SvgProps>;
|
|
5
|
-
declare type
|
|
5
|
+
export declare type IconProps = SvgProps & {
|
|
6
6
|
name: IconName | (string & {});
|
|
7
7
|
color?: string;
|
|
8
8
|
size: string | number;
|
|
9
9
|
};
|
|
10
|
-
export declare const Icon: ({ name, size, color, testID, ...rest }:
|
|
11
|
-
export {};
|
|
10
|
+
export declare const Icon: ({ name, size, color, testID, ...rest }: IconProps) => JSX.Element | null;
|
|
@@ -52,11 +52,11 @@ var styled_native_1 = require("../../styled.native");
|
|
|
52
52
|
var Icon = function (_a) {
|
|
53
53
|
var name = _a.name, size = _a.size, color = _a.color, testID = _a.testID, rest = __rest(_a, ["name", "size", "color", "testID"]);
|
|
54
54
|
var icons = (0, providers_1.useIcons)();
|
|
55
|
-
var
|
|
55
|
+
var semantic = (0, react_1.useContext)(styled_native_1.ThemeContext).semantic;
|
|
56
56
|
// @ts-ignore to support additional icons.
|
|
57
57
|
var Svg = name && icons[name];
|
|
58
58
|
return Svg ? (react_1.default.createElement(Svg, __assign({ testID: testID ? testID : "element-icon".concat(name ? "-".concat(name) : ''),
|
|
59
59
|
// @ts-ignore this is valid.
|
|
60
|
-
color: color !== null && color !== void 0 ? color :
|
|
60
|
+
color: color !== null && color !== void 0 ? color : semantic.message.base, width: size, height: size }, rest))) : null;
|
|
61
61
|
};
|
|
62
62
|
exports.Icon = Icon;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TextInput, TextInputProps } from 'react-native';
|
|
3
3
|
import { IconName } from '../../providers/types';
|
|
4
4
|
export declare type InputProps = TextInputProps & {
|
|
5
5
|
invalid?: boolean;
|
|
@@ -53,21 +53,17 @@ exports.Input = void 0;
|
|
|
53
53
|
var react_1 = __importStar(require("react"));
|
|
54
54
|
var hooks_1 = require("../../hooks");
|
|
55
55
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
56
|
-
var utils_1 = require("../../utils");
|
|
57
56
|
var Icon_1 = require("../Icon/Icon");
|
|
58
57
|
var StyledIcon = (0, styled_native_1.default)(Icon_1.Icon)(function (_a) {
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
(focused ? (0, utils_1.pxToNumber)(focusRing.distance) : 0);
|
|
62
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", "px;\n ", ";\n ", ";\n "], ["\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", "px;\n ", ";\n ", ";\n "])), input.icon.size, distance, side === 'left' ? "left: ".concat(distance, "px") : '', side === 'right' ? "right: ".concat(distance, "px") : '');
|
|
58
|
+
var core = _a.theme.core, side = _a.side, focused = _a.focused;
|
|
59
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n z-index: 1;\n top: ", ";\n ", ";\n ", ";\n "], ["\n position: absolute;\n z-index: 1;\n top: ", ";\n ", ";\n ", ";\n "])), focused ? '16px' : '14px', side === 'left' ? "left: ".concat(core.space[2]) : '', side === 'right' ? "right: ".concat(core.space[2]) : '');
|
|
63
60
|
});
|
|
64
61
|
var Input = (0, react_1.forwardRef)(function (_a, ref) {
|
|
65
62
|
var onFocus = _a.onFocus, onBlur = _a.onBlur, style = _a.style, iconLeft = _a.iconLeft, iconRight = _a.iconRight, rightSlot = _a.rightSlot, rest = __rest(_a, ["onFocus", "onBlur", "style", "iconLeft", "iconRight", "rightSlot"]);
|
|
66
63
|
var _b = (0, react_1.useState)(false), focused = _b[0], setFocused = _b[1];
|
|
67
64
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
68
|
-
var input = (0, react_1.useContext)(styled_native_1.ThemeContext).input;
|
|
69
65
|
return (react_1.default.createElement(InputWrapper, { focused: focused },
|
|
70
|
-
iconLeft ? (react_1.default.createElement(StyledIcon, { name: iconLeft, size:
|
|
66
|
+
iconLeft ? (react_1.default.createElement(StyledIcon, { name: iconLeft, size: 16, focused: focused, pointerEvents: "none", side: "left" })) : null,
|
|
71
67
|
react_1.default.createElement(StyledInput, __assign({}, rest, breakpoints, { iconLeft: !!iconLeft, iconRight: !!iconRight, hasRightSlot: !!rightSlot, style: style,
|
|
72
68
|
// @ts-ignore
|
|
73
69
|
ref: ref, onFocus: function (event) {
|
|
@@ -81,23 +77,24 @@ var Input = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
81
77
|
onBlur(event);
|
|
82
78
|
}
|
|
83
79
|
} })),
|
|
84
|
-
iconRight && !rightSlot ? (react_1.default.createElement(StyledIcon, { name: iconRight, size:
|
|
80
|
+
iconRight && !rightSlot ? (react_1.default.createElement(StyledIcon, { name: iconRight, size: 16, focused: focused, pointerEvents: "none", side: "right" })) : null,
|
|
85
81
|
rightSlot));
|
|
86
82
|
});
|
|
87
83
|
exports.Input = Input;
|
|
88
84
|
var InputWrapper = styled_native_1.default.View(function (_a) {
|
|
89
|
-
var _b = _a.theme,
|
|
90
|
-
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: stretch;\n
|
|
91
|
-
? "\n border-width: ".concat(
|
|
92
|
-
(0, utils_1.pxToNumber)(focusRing.distance), "px;")
|
|
85
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, focused = _a.focused;
|
|
86
|
+
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: stretch;\n border-radius: ", ";\n border-width: 0;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "], ["\n align-self: stretch;\n border-radius: ", ";\n border-width: 0;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "])), core.radius.small, semantic.border.functional, focused
|
|
87
|
+
? "\n border-width: ".concat(core.borderWidth.small, ";\n border-color: ").concat(semantic.focus.outline, ";\n padding: 2px;\n margin: -4px;")
|
|
93
88
|
: null);
|
|
94
89
|
});
|
|
95
90
|
var StyledInput = styled_native_1.default.TextInput(function (_a) {
|
|
96
|
-
var
|
|
97
|
-
var fontSize = smallAndUp
|
|
91
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, smallAndUp = _a.smallAndUp, iconLeft = _a.iconLeft, iconRight = _a.iconRight, hasRightSlot = _a.hasRightSlot;
|
|
92
|
+
var fontSize = smallAndUp
|
|
93
|
+
? core.fontSize.body.large
|
|
94
|
+
: core.fontSize.body.small;
|
|
98
95
|
var errorStyles = invalid
|
|
99
|
-
? "\n border-
|
|
96
|
+
? "\n border-color: ".concat(semantic.message.error, ";\n ")
|
|
100
97
|
: '';
|
|
101
|
-
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n
|
|
98
|
+
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid ", ";\n border-radius: ", ";\n padding: 0 ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "], ["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid ", ";\n border-radius: ", ";\n padding: 0 ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "])), core.fontFamily.body.native, semantic.message.base, fontSize, core.space[11], core.borderWidth.small, semantic.border.functional, core.radius.small, core.space[2], iconLeft ? "padding-left: ".concat(core.space[8], ";") : '', iconRight || hasRightSlot ? "padding-right: ".concat(core.space[8], ";") : '', errorStyles);
|
|
102
99
|
});
|
|
103
100
|
var templateObject_1, templateObject_2, templateObject_3;
|