@ovotech/element-native 3.5.0 → 3.6.0-canary-0ed6e33-174
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/ActionCard/ActionCard.js +13 -11
- package/dist/components/CTALink/CTALink.d.ts +1 -1
- package/dist/components/DescriptionList/styled.d.ts +214 -222
- package/dist/components/DescriptionList/styled.js +4 -2
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +2 -1
- package/dist/components/Label/Label.d.ts +243 -0
- package/dist/components/Label/Label.js +38 -0
- package/dist/components/Label/index.d.ts +1 -0
- package/dist/components/Label/index.js +5 -0
- package/dist/components/Lead/Lead.d.ts +243 -0
- package/dist/components/Lead/Lead.js +38 -0
- package/dist/components/Lead/index.d.ts +1 -0
- package/dist/components/Lead/index.js +5 -0
- package/dist/components/List/List.d.ts +4 -245
- package/dist/components/List/List.js +17 -66
- package/dist/components/List/styled.d.ts +7 -473
- package/dist/components/List/styled.js +9 -26
- package/dist/components/SelectField/Select.js +5 -3
- package/dist/components/Spinner/Spinner.d.ts +8 -0
- package/dist/components/Spinner/Spinner.js +82 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Spinner/index.js +5 -0
- package/dist/components/Toggle/Toggle.d.ts +10 -0
- package/dist/components/Toggle/Toggle.js +56 -0
- package/dist/components/Toggle/index.d.ts +1 -0
- package/dist/components/Toggle/index.js +5 -0
- package/dist/components/Toggle/styles.d.ts +939 -0
- package/dist/components/Toggle/styles.js +28 -0
- package/dist/components/index.d.ts +29 -25
- package/dist/components/index.js +29 -25
- package/dist/esm/components/ActionCard/ActionCard.js +13 -11
- package/dist/esm/components/DescriptionList/styled.js +4 -2
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +2 -1
- package/dist/esm/components/Label/Label.js +12 -0
- package/dist/esm/components/Label/index.js +1 -0
- package/dist/esm/components/Lead/Lead.js +12 -0
- package/dist/esm/components/Lead/index.js +1 -0
- package/dist/esm/components/List/List.js +19 -67
- package/dist/esm/components/List/styled.js +8 -25
- package/dist/esm/components/SelectField/Select.js +5 -3
- package/dist/esm/components/Spinner/Spinner.js +55 -0
- package/dist/esm/components/Spinner/index.js +1 -0
- package/dist/esm/components/Toggle/Toggle.js +53 -0
- package/dist/esm/components/Toggle/index.js +1 -0
- package/dist/esm/components/Toggle/styles.js +22 -0
- package/dist/esm/components/index.js +29 -25
- package/dist/esm/providers/IconsProvider.js +2 -1
- package/dist/esm/providers/icons/Logo.js +3 -3
- package/dist/esm/providers/icons/Torch.js +14 -0
- package/dist/esm/providers/icons/index.js +1 -0
- package/dist/providers/IconsProvider.js +1 -0
- package/dist/providers/icons/Logo.js +1 -1
- package/dist/providers/icons/Torch.d.ts +2 -0
- package/dist/providers/icons/Torch.js +41 -0
- package/dist/providers/icons/index.d.ts +1 -0
- package/dist/providers/icons/index.js +1 -0
- package/dist/providers/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,249 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { TextProps, ViewProps } from 'react-native';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: number]: any;
|
|
6
|
-
[x: symbol]: any;
|
|
7
|
-
} & {
|
|
8
|
-
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 | 10 | 6 | 7 | 8 | 9 | 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<"body" | "mono" | "heading" | "bodyBold", {
|
|
29
|
-
native: string;
|
|
30
|
-
web: string;
|
|
31
|
-
}>;
|
|
32
|
-
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
33
|
-
fontSize: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
34
|
-
small: string | number;
|
|
35
|
-
large: string | number;
|
|
36
|
-
}>;
|
|
37
|
-
lineHeight: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
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" | "secondary" | "error" | "branded", string>;
|
|
46
|
-
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
47
|
-
focus: Record<"surface" | "outline" | "hover", string>;
|
|
48
|
-
inverted: Record<"surface" | "border", 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<"branded" | "gas" | "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
|
-
neutral: {
|
|
213
|
-
foreground: string;
|
|
214
|
-
background: string;
|
|
215
|
-
};
|
|
216
|
-
red: {
|
|
217
|
-
foreground: string;
|
|
218
|
-
background: string;
|
|
219
|
-
};
|
|
220
|
-
orange: {
|
|
221
|
-
foreground: string;
|
|
222
|
-
background: string;
|
|
223
|
-
};
|
|
224
|
-
yellow: {
|
|
225
|
-
foreground: string;
|
|
226
|
-
background: string;
|
|
227
|
-
};
|
|
228
|
-
green: {
|
|
229
|
-
foreground: string;
|
|
230
|
-
background: string;
|
|
231
|
-
};
|
|
232
|
-
blue: {
|
|
233
|
-
foreground: string;
|
|
234
|
-
background: string;
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
} | undefined;
|
|
240
|
-
} & {
|
|
241
|
-
as?: string | import("react").ComponentType<any> | undefined;
|
|
242
|
-
forwardedAs?: string | import("react").ComponentType<any> | undefined;
|
|
243
|
-
}, import("../../hooks").BreakpointNames>, string | number | symbol> & import("react").RefAttributes<import("react-native/types").View>>;
|
|
244
|
-
declare const Li: ({ children, ...rest }: PropsWithChildren<TextProps>) => JSX.Element;
|
|
245
|
-
declare const Ul: ({ children, showBullets, ...rest }: PropsWithChildren<ViewProps & {
|
|
3
|
+
declare const Li: ({ children }: PropsWithChildren<TextProps>) => JSX.Element;
|
|
4
|
+
declare const Ul: (props: PropsWithChildren<ViewProps & {
|
|
246
5
|
showBullets?: boolean | undefined;
|
|
247
6
|
}>) => JSX.Element;
|
|
248
|
-
declare const Ol: (
|
|
249
|
-
export {
|
|
7
|
+
declare const Ol: (props: PropsWithChildren<ViewProps>) => JSX.Element;
|
|
8
|
+
export { Li, Ol, Ul };
|
|
@@ -10,85 +10,36 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.
|
|
14
|
+
exports.Ul = exports.Ol = exports.Li = void 0;
|
|
26
15
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
16
|
var react_1 = require("react");
|
|
28
|
-
var
|
|
29
|
-
var
|
|
17
|
+
var react_native_1 = require("react-native");
|
|
18
|
+
var Margin_1 = require("../Margin");
|
|
30
19
|
var Stack_1 = require("../Stack");
|
|
31
20
|
var styled_1 = require("./styled");
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
var ListBulletItem = function (_a) {
|
|
36
|
-
var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b, level = _a.level;
|
|
37
|
-
return ((0, jsx_runtime_1.jsxs)(styled_1.StyledUlItem, __assign({ level: level }, { children: [(0, jsx_runtime_1.jsx)(styled_1.UlBullet, { visible: showBullets }), children] })));
|
|
38
|
-
};
|
|
39
|
-
var ListNumberedItem = function (_a) {
|
|
40
|
-
var children = _a.children, prefix = _a.prefix, level = _a.level;
|
|
41
|
-
return ((0, jsx_runtime_1.jsxs)(styled_1.StyledOlItem, __assign({ level: level }, { children: [(0, jsx_runtime_1.jsx)(Bullet, { children: prefix }), children] })));
|
|
21
|
+
var ListItem = function (_a) {
|
|
22
|
+
var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b, prefix = _a.prefix;
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(styled_1.FlexRow, { children: [prefix ? ((0, jsx_runtime_1.jsx)(styled_1.TextBullet, { children: prefix })) : ((0, jsx_runtime_1.jsx)(styled_1.SquareBullet, { visible: showBullets })), (0, jsx_runtime_1.jsx)(styled_1.LiContent, { children: children })] }));
|
|
42
24
|
};
|
|
43
25
|
var renderList = function (_a) {
|
|
44
|
-
var
|
|
45
|
-
return react_1.Children.map(
|
|
46
|
-
|
|
47
|
-
var lvl = level;
|
|
48
|
-
var PADDING = 3;
|
|
49
|
-
lvl = lvl + PADDING;
|
|
50
|
-
// @ts-ignore doesn't recognise child props.
|
|
51
|
-
var nestedChildren = ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.children) || {};
|
|
52
|
-
var nestedLists = [];
|
|
53
|
-
var childrenToRender = Array.from(nestedChildren).filter(function (ch) {
|
|
54
|
-
var _a, _b;
|
|
55
|
-
if (typeof ch == 'object' &&
|
|
56
|
-
// @ts-ignore Missing types for React Children
|
|
57
|
-
(((_a = ch === null || ch === void 0 ? void 0 : ch.type) === null || _a === void 0 ? void 0 : _a.name) === 'Ul' || ((_b = ch === null || ch === void 0 ? void 0 : ch.type) === null || _b === void 0 ? void 0 : _b.name) === 'Ol')) {
|
|
58
|
-
nestedLists.push(ch);
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [childrenToRender.length > 0 && listType === 'ul' ? ((0, jsx_runtime_1.jsx)(ListBulletItem, __assign({ showBullets: showBullets, level: level }, { children: (0, jsx_runtime_1.jsx)(P_1.P, { children: childrenToRender }) }))) : null, childrenToRender.length > 0 && listType === 'ol' ? ((0, jsx_runtime_1.jsx)(ListNumberedItem, __assign({ level: level, prefix: "".concat(index + 1, ".") }, { children: (0, jsx_runtime_1.jsx)(P_1.P, { children: childrenToRender }) }))) : null, nestedLists.length > 0
|
|
66
|
-
? nestedLists.map(function (obj) {
|
|
67
|
-
var _a, _b, _c, _d;
|
|
68
|
-
return renderList({
|
|
69
|
-
//@ts-ignore
|
|
70
|
-
arrayChildren: (_b = (_a = obj === null || obj === void 0 ? void 0 : obj.props) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : obj,
|
|
71
|
-
level: lvl,
|
|
72
|
-
showBullets: showBullets,
|
|
73
|
-
//@ts-ignore
|
|
74
|
-
listType: (_d = (_c = obj.type) === null || _c === void 0 ? void 0 : _c.name) === null || _d === void 0 ? void 0 : _d.toLowerCase(),
|
|
75
|
-
});
|
|
76
|
-
})
|
|
77
|
-
: null] }));
|
|
26
|
+
var children = _a.children, listType = _a.listType, showBullets = _a.showBullets;
|
|
27
|
+
return react_1.Children.map(children, function (child, index) {
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(ListItem, __assign({ prefix: listType === 'ol' ? "".concat(index + 1, ".") : undefined, showBullets: showBullets }, { children: child })));
|
|
78
29
|
});
|
|
79
30
|
};
|
|
80
31
|
var Li = function (_a) {
|
|
81
|
-
var children = _a.children
|
|
82
|
-
return (0, jsx_runtime_1.jsx)(
|
|
32
|
+
var children = _a.children;
|
|
33
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.View, __assign({ style: { flexDirection: 'column' } }, { children: children }));
|
|
83
34
|
};
|
|
84
35
|
exports.Li = Li;
|
|
85
|
-
var Ul = function (
|
|
86
|
-
var children =
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
36
|
+
var Ul = function (props) {
|
|
37
|
+
var children = props.children, showBullets = props.showBullets;
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(Margin_1.Margin, __assign({ top: 2 }, { children: (0, jsx_runtime_1.jsx)(Stack_1.Stack, __assign({ spaceBetween: 2 }, { children: renderList({ children: children, listType: 'ul', showBullets: showBullets }) })) })));
|
|
88
39
|
};
|
|
89
40
|
exports.Ul = Ul;
|
|
90
|
-
var Ol = function (
|
|
91
|
-
var children =
|
|
92
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
41
|
+
var Ol = function (props) {
|
|
42
|
+
var children = props.children;
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(Margin_1.Margin, __assign({ top: 2 }, { children: (0, jsx_runtime_1.jsx)(Stack_1.Stack, __assign({ spaceBetween: 2 }, { children: renderList({ children: children, listType: 'ol' }) })) })));
|
|
93
44
|
};
|
|
94
45
|
exports.Ol = Ol;
|