@ovotech/element-native 2.1.0 → 2.2.0-canary-ea79e4d-74
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,31 +1,477 @@
|
|
|
1
1
|
import React, { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import { Breakpoints } from '../../hooks';
|
|
4
3
|
export declare type NotificationVariantName = 'error' | 'success' | 'info' | 'warning';
|
|
5
|
-
export declare type NotificationVariant = {
|
|
6
|
-
background: string;
|
|
7
|
-
borderColor: string;
|
|
8
|
-
textColor: string;
|
|
9
|
-
};
|
|
10
4
|
declare type NotificationProps = Omit<ComponentProps<typeof Notification>, 'variant'>;
|
|
11
|
-
export declare const NotificationContentBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
export declare const NotificationContentBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme & {
|
|
6
|
+
core: {
|
|
7
|
+
radius: Record<"small" | "medium" | "large" | "max", string>;
|
|
8
|
+
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
9
|
+
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
10
|
+
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
11
|
+
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15, string>;
|
|
12
|
+
transition: Record<"medium" | "slow" | "fast", string>;
|
|
13
|
+
opacity: Record<"solid" | "transparent" | "translucent", string | number>;
|
|
14
|
+
color: Record<"neutral" | "red" | "orange" | "yellow" | "green" | "blue", {
|
|
15
|
+
lightest: string;
|
|
16
|
+
lighter: string;
|
|
17
|
+
light: string;
|
|
18
|
+
base: string;
|
|
19
|
+
dark: string;
|
|
20
|
+
darker: string;
|
|
21
|
+
darkest: string;
|
|
22
|
+
}> & {
|
|
23
|
+
brand: Record<string, string>;
|
|
24
|
+
};
|
|
25
|
+
fontFamily: Record<"heading" | "body" | "mono" | "bodyBold", {
|
|
26
|
+
native: string;
|
|
27
|
+
web: string;
|
|
28
|
+
}>;
|
|
29
|
+
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
30
|
+
fontSize: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
31
|
+
small: string | number;
|
|
32
|
+
large: string | number;
|
|
33
|
+
}>;
|
|
34
|
+
lineHeight: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
35
|
+
small: string | number;
|
|
36
|
+
large: string | number;
|
|
37
|
+
}>;
|
|
38
|
+
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
39
|
+
};
|
|
40
|
+
semantic: {
|
|
41
|
+
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
42
|
+
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
43
|
+
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
44
|
+
focus: Record<"surface" | "outline" | "hover", string>;
|
|
45
|
+
inverted: Record<"border" | "surface", string> & {
|
|
46
|
+
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
47
|
+
};
|
|
48
|
+
success: {
|
|
49
|
+
border: string;
|
|
50
|
+
surface: string;
|
|
51
|
+
surfaceEmphasis: string;
|
|
52
|
+
message: string;
|
|
53
|
+
messageOnEmphasis: string;
|
|
54
|
+
};
|
|
55
|
+
warning: {
|
|
56
|
+
border: string;
|
|
57
|
+
surface: string;
|
|
58
|
+
surfaceEmphasis: string;
|
|
59
|
+
message: string;
|
|
60
|
+
messageOnEmphasis: string;
|
|
61
|
+
};
|
|
62
|
+
error: {
|
|
63
|
+
border: string;
|
|
64
|
+
surface: string;
|
|
65
|
+
surfaceEmphasis: string;
|
|
66
|
+
message: string;
|
|
67
|
+
messageOnEmphasis: string;
|
|
68
|
+
};
|
|
69
|
+
info: {
|
|
70
|
+
border: string;
|
|
71
|
+
surface: string;
|
|
72
|
+
surfaceEmphasis: string;
|
|
73
|
+
message: string;
|
|
74
|
+
messageOnEmphasis: string;
|
|
75
|
+
};
|
|
76
|
+
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
77
|
+
};
|
|
78
|
+
component: {
|
|
79
|
+
heading1: {
|
|
80
|
+
fontFamily: string;
|
|
81
|
+
fontWeight: string | number;
|
|
82
|
+
fontSize: {
|
|
83
|
+
small: string | number;
|
|
84
|
+
large: string | number;
|
|
85
|
+
};
|
|
86
|
+
lineHeight: {
|
|
87
|
+
small: string | number;
|
|
88
|
+
large: string | number;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
heading2: {
|
|
92
|
+
fontFamily: string;
|
|
93
|
+
fontWeight: string | number;
|
|
94
|
+
fontSize: {
|
|
95
|
+
small: string | number;
|
|
96
|
+
large: string | number;
|
|
97
|
+
};
|
|
98
|
+
lineHeight: {
|
|
99
|
+
small: string | number;
|
|
100
|
+
large: string | number;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
heading3: {
|
|
104
|
+
fontFamily: string;
|
|
105
|
+
fontWeight: string | number;
|
|
106
|
+
fontSize: {
|
|
107
|
+
small: string | number;
|
|
108
|
+
large: string | number;
|
|
109
|
+
};
|
|
110
|
+
lineHeight: {
|
|
111
|
+
small: string | number;
|
|
112
|
+
large: string | number;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
heading4: {
|
|
116
|
+
fontFamily: string;
|
|
117
|
+
fontWeight: string | number;
|
|
118
|
+
fontSize: {
|
|
119
|
+
small: string | number;
|
|
120
|
+
large: string | number;
|
|
121
|
+
};
|
|
122
|
+
lineHeight: {
|
|
123
|
+
small: string | number;
|
|
124
|
+
large: string | number;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
lead: {
|
|
128
|
+
fontFamily: string;
|
|
129
|
+
fontWeight: string | number;
|
|
130
|
+
fontSize: {
|
|
131
|
+
small: string | number;
|
|
132
|
+
large: string | number;
|
|
133
|
+
};
|
|
134
|
+
lineHeight: {
|
|
135
|
+
small: string | number;
|
|
136
|
+
large: string | number;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
body: {
|
|
140
|
+
fontFamily: string;
|
|
141
|
+
fontWeight: string | number;
|
|
142
|
+
fontSize: {
|
|
143
|
+
small: string | number;
|
|
144
|
+
large: string | number;
|
|
145
|
+
};
|
|
146
|
+
lineHeight: {
|
|
147
|
+
small: string | number;
|
|
148
|
+
large: string | number;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
small: {
|
|
152
|
+
fontFamily: string;
|
|
153
|
+
fontWeight: string | number;
|
|
154
|
+
fontSize: {
|
|
155
|
+
small: string | number;
|
|
156
|
+
large: string | number;
|
|
157
|
+
};
|
|
158
|
+
lineHeight: {
|
|
159
|
+
small: string | number;
|
|
160
|
+
large: string | number;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
label: {
|
|
164
|
+
fontFamily: string;
|
|
165
|
+
fontWeight: string | number;
|
|
166
|
+
fontSize: {
|
|
167
|
+
small: string | number;
|
|
168
|
+
large: string | number;
|
|
169
|
+
};
|
|
170
|
+
lineHeight: {
|
|
171
|
+
small: string | number;
|
|
172
|
+
large: string | number;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
cta: {
|
|
176
|
+
primary: {
|
|
177
|
+
message: string;
|
|
178
|
+
surface: string;
|
|
179
|
+
messageHover: string;
|
|
180
|
+
surfaceHover: string;
|
|
181
|
+
messageFocused: string;
|
|
182
|
+
surfaceFocused: string;
|
|
183
|
+
outlineFocused: string;
|
|
184
|
+
backgroundFocused: string;
|
|
185
|
+
};
|
|
186
|
+
secondary: {
|
|
187
|
+
message: string;
|
|
188
|
+
surface: string;
|
|
189
|
+
messageHover: string;
|
|
190
|
+
surfaceHover: string;
|
|
191
|
+
messageFocused: string;
|
|
192
|
+
surfaceFocused: string;
|
|
193
|
+
outlineFocused: string;
|
|
194
|
+
backgroundFocused: string;
|
|
195
|
+
};
|
|
196
|
+
destructive: {
|
|
197
|
+
message: string;
|
|
198
|
+
surface: string;
|
|
199
|
+
messageHover: string;
|
|
200
|
+
surfaceHover: string;
|
|
201
|
+
messageFocused: string;
|
|
202
|
+
surfaceFocused: string;
|
|
203
|
+
outlineFocused: string;
|
|
204
|
+
backgroundFocused: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
badge: {
|
|
208
|
+
variants: {
|
|
209
|
+
red: {
|
|
210
|
+
foreground: string;
|
|
211
|
+
background: string;
|
|
212
|
+
};
|
|
213
|
+
orange: {
|
|
214
|
+
foreground: string;
|
|
215
|
+
background: string;
|
|
216
|
+
};
|
|
217
|
+
yellow: {
|
|
218
|
+
foreground: string;
|
|
219
|
+
background: string;
|
|
220
|
+
};
|
|
221
|
+
green: {
|
|
222
|
+
foreground: string;
|
|
223
|
+
background: string;
|
|
224
|
+
};
|
|
225
|
+
blue: {
|
|
226
|
+
foreground: string;
|
|
227
|
+
background: string;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
}, {}, never>;
|
|
233
|
+
export declare const NotificationTitleBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme & {
|
|
234
|
+
core: {
|
|
235
|
+
radius: Record<"small" | "medium" | "large" | "max", string>;
|
|
236
|
+
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
237
|
+
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
238
|
+
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
239
|
+
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15, string>;
|
|
240
|
+
transition: Record<"medium" | "slow" | "fast", string>;
|
|
241
|
+
opacity: Record<"solid" | "transparent" | "translucent", string | number>;
|
|
242
|
+
color: Record<"neutral" | "red" | "orange" | "yellow" | "green" | "blue", {
|
|
243
|
+
lightest: string;
|
|
244
|
+
lighter: string;
|
|
245
|
+
light: string;
|
|
246
|
+
base: string;
|
|
247
|
+
dark: string;
|
|
248
|
+
darker: string;
|
|
249
|
+
darkest: string;
|
|
250
|
+
}> & {
|
|
251
|
+
brand: Record<string, string>;
|
|
252
|
+
};
|
|
253
|
+
fontFamily: Record<"heading" | "body" | "mono" | "bodyBold", {
|
|
254
|
+
native: string;
|
|
255
|
+
web: string;
|
|
256
|
+
}>;
|
|
257
|
+
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
258
|
+
fontSize: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
259
|
+
small: string | number;
|
|
260
|
+
large: string | number;
|
|
261
|
+
}>;
|
|
262
|
+
lineHeight: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
263
|
+
small: string | number;
|
|
264
|
+
large: string | number;
|
|
265
|
+
}>;
|
|
266
|
+
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
267
|
+
};
|
|
268
|
+
semantic: {
|
|
269
|
+
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
270
|
+
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
271
|
+
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
272
|
+
focus: Record<"surface" | "outline" | "hover", string>;
|
|
273
|
+
inverted: Record<"border" | "surface", string> & {
|
|
274
|
+
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
275
|
+
};
|
|
276
|
+
success: {
|
|
277
|
+
border: string;
|
|
278
|
+
surface: string;
|
|
279
|
+
surfaceEmphasis: string;
|
|
280
|
+
message: string;
|
|
281
|
+
messageOnEmphasis: string;
|
|
282
|
+
};
|
|
283
|
+
warning: {
|
|
284
|
+
border: string;
|
|
285
|
+
surface: string;
|
|
286
|
+
surfaceEmphasis: string;
|
|
287
|
+
message: string;
|
|
288
|
+
messageOnEmphasis: string;
|
|
289
|
+
};
|
|
290
|
+
error: {
|
|
291
|
+
border: string;
|
|
292
|
+
surface: string;
|
|
293
|
+
surfaceEmphasis: string;
|
|
294
|
+
message: string;
|
|
295
|
+
messageOnEmphasis: string;
|
|
296
|
+
};
|
|
297
|
+
info: {
|
|
298
|
+
border: string;
|
|
299
|
+
surface: string;
|
|
300
|
+
surfaceEmphasis: string;
|
|
301
|
+
message: string;
|
|
302
|
+
messageOnEmphasis: string;
|
|
303
|
+
};
|
|
304
|
+
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
305
|
+
};
|
|
306
|
+
component: {
|
|
307
|
+
heading1: {
|
|
308
|
+
fontFamily: string;
|
|
309
|
+
fontWeight: string | number;
|
|
310
|
+
fontSize: {
|
|
311
|
+
small: string | number;
|
|
312
|
+
large: string | number;
|
|
313
|
+
};
|
|
314
|
+
lineHeight: {
|
|
315
|
+
small: string | number;
|
|
316
|
+
large: string | number;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
heading2: {
|
|
320
|
+
fontFamily: string;
|
|
321
|
+
fontWeight: string | number;
|
|
322
|
+
fontSize: {
|
|
323
|
+
small: string | number;
|
|
324
|
+
large: string | number;
|
|
325
|
+
};
|
|
326
|
+
lineHeight: {
|
|
327
|
+
small: string | number;
|
|
328
|
+
large: string | number;
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
heading3: {
|
|
332
|
+
fontFamily: string;
|
|
333
|
+
fontWeight: string | number;
|
|
334
|
+
fontSize: {
|
|
335
|
+
small: string | number;
|
|
336
|
+
large: string | number;
|
|
337
|
+
};
|
|
338
|
+
lineHeight: {
|
|
339
|
+
small: string | number;
|
|
340
|
+
large: string | number;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
heading4: {
|
|
344
|
+
fontFamily: string;
|
|
345
|
+
fontWeight: string | number;
|
|
346
|
+
fontSize: {
|
|
347
|
+
small: string | number;
|
|
348
|
+
large: string | number;
|
|
349
|
+
};
|
|
350
|
+
lineHeight: {
|
|
351
|
+
small: string | number;
|
|
352
|
+
large: string | number;
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
lead: {
|
|
356
|
+
fontFamily: string;
|
|
357
|
+
fontWeight: string | number;
|
|
358
|
+
fontSize: {
|
|
359
|
+
small: string | number;
|
|
360
|
+
large: string | number;
|
|
361
|
+
};
|
|
362
|
+
lineHeight: {
|
|
363
|
+
small: string | number;
|
|
364
|
+
large: string | number;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
body: {
|
|
368
|
+
fontFamily: string;
|
|
369
|
+
fontWeight: string | number;
|
|
370
|
+
fontSize: {
|
|
371
|
+
small: string | number;
|
|
372
|
+
large: string | number;
|
|
373
|
+
};
|
|
374
|
+
lineHeight: {
|
|
375
|
+
small: string | number;
|
|
376
|
+
large: string | number;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
small: {
|
|
380
|
+
fontFamily: string;
|
|
381
|
+
fontWeight: string | number;
|
|
382
|
+
fontSize: {
|
|
383
|
+
small: string | number;
|
|
384
|
+
large: string | number;
|
|
385
|
+
};
|
|
386
|
+
lineHeight: {
|
|
387
|
+
small: string | number;
|
|
388
|
+
large: string | number;
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
label: {
|
|
392
|
+
fontFamily: string;
|
|
393
|
+
fontWeight: string | number;
|
|
394
|
+
fontSize: {
|
|
395
|
+
small: string | number;
|
|
396
|
+
large: string | number;
|
|
397
|
+
};
|
|
398
|
+
lineHeight: {
|
|
399
|
+
small: string | number;
|
|
400
|
+
large: string | number;
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
cta: {
|
|
404
|
+
primary: {
|
|
405
|
+
message: string;
|
|
406
|
+
surface: string;
|
|
407
|
+
messageHover: string;
|
|
408
|
+
surfaceHover: string;
|
|
409
|
+
messageFocused: string;
|
|
410
|
+
surfaceFocused: string;
|
|
411
|
+
outlineFocused: string;
|
|
412
|
+
backgroundFocused: string;
|
|
413
|
+
};
|
|
414
|
+
secondary: {
|
|
415
|
+
message: string;
|
|
416
|
+
surface: string;
|
|
417
|
+
messageHover: string;
|
|
418
|
+
surfaceHover: string;
|
|
419
|
+
messageFocused: string;
|
|
420
|
+
surfaceFocused: string;
|
|
421
|
+
outlineFocused: string;
|
|
422
|
+
backgroundFocused: string;
|
|
423
|
+
};
|
|
424
|
+
destructive: {
|
|
425
|
+
message: string;
|
|
426
|
+
surface: string;
|
|
427
|
+
messageHover: string;
|
|
428
|
+
surfaceHover: string;
|
|
429
|
+
messageFocused: string;
|
|
430
|
+
surfaceFocused: string;
|
|
431
|
+
outlineFocused: string;
|
|
432
|
+
backgroundFocused: string;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
badge: {
|
|
436
|
+
variants: {
|
|
437
|
+
red: {
|
|
438
|
+
foreground: string;
|
|
439
|
+
background: string;
|
|
440
|
+
};
|
|
441
|
+
orange: {
|
|
442
|
+
foreground: string;
|
|
443
|
+
background: string;
|
|
444
|
+
};
|
|
445
|
+
yellow: {
|
|
446
|
+
foreground: string;
|
|
447
|
+
background: string;
|
|
448
|
+
};
|
|
449
|
+
green: {
|
|
450
|
+
foreground: string;
|
|
451
|
+
background: string;
|
|
452
|
+
};
|
|
453
|
+
blue: {
|
|
454
|
+
foreground: string;
|
|
455
|
+
background: string;
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
};
|
|
460
|
+
}, {
|
|
461
|
+
variant: NotificationVariantName;
|
|
16
462
|
noMargin?: boolean | undefined;
|
|
17
|
-
|
|
18
|
-
}
|
|
463
|
+
dismissible: boolean;
|
|
464
|
+
}, never>;
|
|
19
465
|
export declare const Notification: React.ForwardRefExoticComponent<{
|
|
20
|
-
variant?:
|
|
21
|
-
title
|
|
466
|
+
variant?: NotificationVariantName | undefined;
|
|
467
|
+
title: string;
|
|
22
468
|
noMargin?: boolean | undefined;
|
|
23
469
|
children?: ReactNode;
|
|
24
|
-
|
|
470
|
+
dismissible?: boolean | undefined;
|
|
25
471
|
onDismiss?: (() => void) | undefined;
|
|
26
472
|
} & React.RefAttributes<View>>;
|
|
27
|
-
export declare const ErrorNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "
|
|
28
|
-
export declare const SuccessNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "
|
|
29
|
-
export declare const InfoNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "
|
|
30
|
-
export declare const WarningNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "
|
|
473
|
+
export declare const ErrorNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissible" | "onDismiss"> & React.RefAttributes<View>>;
|
|
474
|
+
export declare const SuccessNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissible" | "onDismiss"> & React.RefAttributes<View>>;
|
|
475
|
+
export declare const InfoNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissible" | "onDismiss"> & React.RefAttributes<View>>;
|
|
476
|
+
export declare const WarningNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissible" | "onDismiss"> & React.RefAttributes<View>>;
|
|
31
477
|
export {};
|
|
@@ -52,67 +52,55 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
52
52
|
exports.WarningNotification = exports.InfoNotification = exports.SuccessNotification = exports.ErrorNotification = exports.Notification = exports.NotificationTitleBox = exports.NotificationContentBox = void 0;
|
|
53
53
|
var react_1 = __importStar(require("react"));
|
|
54
54
|
var react_native_1 = require("react-native");
|
|
55
|
-
var hooks_1 = require("../../hooks");
|
|
56
55
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
57
56
|
var Icon_1 = require("../Icon");
|
|
58
|
-
var pxToNumber = function (value) { return parseInt(value.replace('px', '')); };
|
|
59
|
-
var numberToPx = function (value) { return "".concat(value, "px"); };
|
|
60
57
|
var NotificationBox = styled_native_1.default.View(function (_a) {
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
var currentVariant = notification.variants[variant];
|
|
64
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "])), notification.borderWidth, currentVariant.borderColor, notification.borderRadius, noMargin ? 0 : space[4], colors.canvas);
|
|
58
|
+
var core = _a.theme.core, noMargin = _a.noMargin;
|
|
59
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n overflow: hidden;\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n overflow: hidden;\n "])), core.borderWidth.medium, core.color.brand.white, core.radius.small, noMargin ? 0 : core.space[4]);
|
|
65
60
|
});
|
|
66
61
|
exports.NotificationContentBox = styled_native_1.default.View(function (_a) {
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
var currentVariant = variants[variant];
|
|
70
|
-
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "], ["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "])), paddingX[smallAndUp ? 1 : 0], paddingY[smallAndUp ? 1 : 0], currentVariant.textColor, colors.body, currentVariant.textColor);
|
|
62
|
+
var core = _a.theme.core;
|
|
63
|
+
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), core.color.brand.white, core.space[2], core.space[3], core.space[4], core.space[4]);
|
|
71
64
|
});
|
|
72
65
|
exports.NotificationTitleBox = styled_native_1.default.View(function (_a) {
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.background, notification.paddingX[smallAndUp ? 1 : 0], notification.paddingX[smallAndUp ? 1 : 0], notification.paddingY[smallAndUp ? 1 : 0], dismissable
|
|
77
|
-
? numberToPx(pxToNumber(notification.dismiss.touchSize) -
|
|
78
|
-
pxToNumber(notification.dismiss.size))
|
|
79
|
-
: notification.paddingY[smallAndUp ? 1 : 0]);
|
|
66
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, variant = _a.variant, dismissible = _a.dismissible;
|
|
67
|
+
var currentVariant = semantic[variant];
|
|
68
|
+
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.surface, core.space[2], core.space[2], core.space[4], dismissible ? core.space[3] : core.space[4]);
|
|
80
69
|
});
|
|
81
70
|
var NotificationTitleText = styled_native_1.default.Text(function (_a) {
|
|
82
|
-
var _b = _a.theme,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n "], ["\n color: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n "])), currentVariant.textColor, fonts.bold, fontWeights.bold, responsiveFontSizes.body[0]);
|
|
71
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, variant = _a.variant;
|
|
72
|
+
var currentVariant = semantic[variant];
|
|
73
|
+
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "], ["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "])), core.fontSize.body.small, core.fontFamily.bodyBold.native, currentVariant.message);
|
|
86
74
|
});
|
|
87
|
-
var DismissButton = styled_native_1.default.TouchableOpacity(function (
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
var DismissButton = styled_native_1.default.TouchableOpacity(function () {
|
|
76
|
+
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 16px;\n height: 16px;\n margin-left: auto;\n "], ["\n width: 16px;\n height: 16px;\n margin-left: auto;\n "])));
|
|
77
|
+
});
|
|
78
|
+
var StyledIcon = (0, styled_native_1.default)(Icon_1.Icon)(function (_a) {
|
|
79
|
+
var semantic = _a.theme.semantic, variant = _a.variant;
|
|
80
|
+
var currentVariant = semantic[variant];
|
|
81
|
+
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), currentVariant.message);
|
|
90
82
|
});
|
|
91
83
|
exports.Notification = (0, react_1.forwardRef)(function (_a, ref) {
|
|
92
|
-
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin,
|
|
93
|
-
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
94
|
-
var theme = (0, react_1.useContext)(styled_native_1.ThemeContext);
|
|
84
|
+
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin, dismissible = _a.dismissible, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissible", "onDismiss"]);
|
|
95
85
|
var _c = (0, react_1.useState)(false), dismissed = _c[0], setDismissed = _c[1];
|
|
96
|
-
if (dismissed ||
|
|
86
|
+
if (dismissed || !children) {
|
|
97
87
|
return null;
|
|
98
88
|
}
|
|
99
89
|
return (react_1.default.createElement(react_native_1.View, __assign({ ref: ref }, rest),
|
|
100
|
-
react_1.default.createElement(NotificationBox,
|
|
101
|
-
|
|
102
|
-
react_1.default.createElement(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
color: theme.notification.variants[variant].textColor }))) : null,
|
|
112
|
-
children ? (react_1.default.createElement(exports.NotificationContentBox, __assign({ "data-testid": "el-notification-box", variant: variant }, breakpoints), children)) : null)));
|
|
90
|
+
react_1.default.createElement(NotificationBox, { noMargin: noMargin, testID: "nb-notification" },
|
|
91
|
+
react_1.default.createElement(exports.NotificationTitleBox, { variant: variant, dismissible: dismissible },
|
|
92
|
+
react_1.default.createElement(NotificationTitleText, { variant: variant }, title),
|
|
93
|
+
dismissible ? (react_1.default.createElement(DismissButton, { accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
|
|
94
|
+
setDismissed(true);
|
|
95
|
+
if (onDismiss) {
|
|
96
|
+
onDismiss();
|
|
97
|
+
}
|
|
98
|
+
} },
|
|
99
|
+
react_1.default.createElement(StyledIcon, { variant: variant, name: "cross", size: "16" }))) : null),
|
|
100
|
+
children ? (react_1.default.createElement(exports.NotificationContentBox, { "data-testid": "el-notification-box" }, children)) : null)));
|
|
113
101
|
});
|
|
114
|
-
exports.ErrorNotification = (0, react_1.forwardRef)(function (props, ref) { return
|
|
102
|
+
exports.ErrorNotification = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "error" }, props)); });
|
|
115
103
|
exports.SuccessNotification = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "success" }, props))); });
|
|
116
104
|
exports.InfoNotification = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "info" }, props)); });
|
|
117
105
|
exports.WarningNotification = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "warning" }, props)); });
|
|
118
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
106
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|