rechtspilot-ui 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks-native.cjs +1 -1
- package/dist/chunks-native.js +149 -148
- package/dist/chunks.cjs +1 -1
- package/dist/chunks.js +8 -4
- package/dist/icons.native.cjs +1 -1
- package/dist/icons.native.es.js +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.native.cjs +1 -1
- package/dist/index.native.es.js +437 -121
- package/dist/native/components/IconButton/IconButton.native.d.ts +8 -0
- package/dist/native/components/Input/Input.native.d.ts +3 -3
- package/dist/native/components/Select/Select.native.d.ts +13 -0
- package/dist/native/components/Sheet/Sheet.native.d.ts +10 -0
- package/dist/native/components/Text/Text.native.d.ts +9 -0
- package/dist/native/index.native.d.ts +10 -0
- package/dist/native/lib/theme.d.ts +8 -4
- package/dist/native/lib/ui/command.d.ts +1 -1
- package/icons/index.d.ts +5 -4
- package/icons/index.js +5 -2
- package/icons/package.json +5 -4
- package/package.json +8 -2
package/dist/index.native.es.js
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { Animated as
|
|
5
|
-
import { jsx as
|
|
1
|
+
import { G as e, J as t, K as n, q as r, t as i } from "./chunks-native.js";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import o, { useEffect as s, useRef as c, useState as l } from "react";
|
|
4
|
+
import { Animated as u, Easing as d, KeyboardAvoidingView as f, Modal as p, Platform as m, Pressable as h, ScrollView as g, StyleSheet as _, Text as v, TextInput as y, TouchableOpacity as b, View as x } from "react-native";
|
|
5
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
6
|
+
import { useSafeAreaInsets as T } from "react-native-safe-area-context";
|
|
6
7
|
//#region src/components/Spinner/Spinner.native.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
9
|
-
|
|
8
|
+
var E = ({ size: e = 20, color: t = r.primary[600], style: n }) => {
|
|
9
|
+
let i = o.useRef(new u.Value(0)).current;
|
|
10
|
+
o.useEffect(() => {
|
|
10
11
|
let e = () => {
|
|
11
|
-
|
|
12
|
+
i.setValue(0), u.timing(i, {
|
|
12
13
|
toValue: 1,
|
|
13
14
|
duration: 1e3,
|
|
14
|
-
easing:
|
|
15
|
+
easing: d.linear,
|
|
15
16
|
useNativeDriver: !0
|
|
16
17
|
}).start(() => e());
|
|
17
18
|
};
|
|
18
19
|
e();
|
|
19
|
-
}, [
|
|
20
|
-
let
|
|
20
|
+
}, [i]);
|
|
21
|
+
let a = i.interpolate({
|
|
21
22
|
inputRange: [0, 1],
|
|
22
23
|
outputRange: ["0deg", "360deg"]
|
|
23
24
|
});
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ C(x, {
|
|
25
26
|
style: [{
|
|
26
27
|
width: e,
|
|
27
28
|
height: e
|
|
28
|
-
},
|
|
29
|
-
children: /* @__PURE__ */
|
|
29
|
+
}, n],
|
|
30
|
+
children: /* @__PURE__ */ C(u.View, { style: {
|
|
30
31
|
width: e,
|
|
31
32
|
height: e,
|
|
32
33
|
borderRadius: e / 2,
|
|
33
34
|
borderWidth: 2,
|
|
34
35
|
borderColor: "transparent",
|
|
35
|
-
borderTopColor:
|
|
36
|
-
transform: [{ rotate:
|
|
36
|
+
borderTopColor: t,
|
|
37
|
+
transform: [{ rotate: a }]
|
|
37
38
|
} })
|
|
38
39
|
});
|
|
39
|
-
},
|
|
40
|
+
}, D = (e) => {
|
|
40
41
|
let n = {
|
|
41
42
|
alignItems: "center",
|
|
42
43
|
borderRadius: 12,
|
|
@@ -45,7 +46,8 @@ var _ = ({ size: e = 20, color: n = t.primary[600], style: r }) => {
|
|
|
45
46
|
height: 48,
|
|
46
47
|
justifyContent: "center",
|
|
47
48
|
paddingHorizontal: 16
|
|
48
|
-
},
|
|
49
|
+
}, i = {
|
|
50
|
+
fontFamily: t.body.fontFamily,
|
|
49
51
|
fontSize: 15,
|
|
50
52
|
fontWeight: "500",
|
|
51
53
|
textAlign: "center"
|
|
@@ -54,84 +56,124 @@ var _ = ({ size: e = 20, color: n = t.primary[600], style: r }) => {
|
|
|
54
56
|
case "primary": return {
|
|
55
57
|
container: {
|
|
56
58
|
...n,
|
|
57
|
-
backgroundColor:
|
|
58
|
-
borderColor:
|
|
59
|
+
backgroundColor: r.primary[500],
|
|
60
|
+
borderColor: r.neutral["800-A16"]
|
|
59
61
|
},
|
|
60
62
|
text: {
|
|
61
|
-
...
|
|
62
|
-
color:
|
|
63
|
+
...i,
|
|
64
|
+
color: r.primary[900]
|
|
63
65
|
}
|
|
64
66
|
};
|
|
65
67
|
case "secondary": return {
|
|
66
68
|
container: {
|
|
67
69
|
...n,
|
|
68
|
-
backgroundColor:
|
|
69
|
-
borderColor:
|
|
70
|
+
backgroundColor: r.primary[900],
|
|
71
|
+
borderColor: r.neutral["800-A16"]
|
|
70
72
|
},
|
|
71
73
|
text: {
|
|
72
|
-
...
|
|
73
|
-
color:
|
|
74
|
+
...i,
|
|
75
|
+
color: r.white
|
|
74
76
|
}
|
|
75
77
|
};
|
|
76
78
|
case "tertiary": return {
|
|
77
79
|
container: {
|
|
78
80
|
...n,
|
|
79
|
-
backgroundColor:
|
|
80
|
-
borderColor:
|
|
81
|
+
backgroundColor: r.neutral["800-A04"],
|
|
82
|
+
borderColor: r.neutral["800-A08"]
|
|
81
83
|
},
|
|
82
84
|
text: {
|
|
83
|
-
...
|
|
84
|
-
color:
|
|
85
|
+
...i,
|
|
86
|
+
color: r.primary[900]
|
|
85
87
|
}
|
|
86
88
|
};
|
|
87
89
|
case "destructive": return {
|
|
88
90
|
container: {
|
|
89
91
|
...n,
|
|
90
|
-
backgroundColor:
|
|
91
|
-
borderColor:
|
|
92
|
+
backgroundColor: r.fg.accent.error,
|
|
93
|
+
borderColor: r.fg.accent.error
|
|
92
94
|
},
|
|
93
95
|
text: {
|
|
94
|
-
...
|
|
95
|
-
color:
|
|
96
|
+
...i,
|
|
97
|
+
color: r.white
|
|
96
98
|
}
|
|
97
99
|
};
|
|
98
100
|
case "destructiveSubtle": return {
|
|
99
101
|
container: {
|
|
100
102
|
...n,
|
|
101
|
-
backgroundColor:
|
|
102
|
-
borderColor:
|
|
103
|
+
backgroundColor: r.cream,
|
|
104
|
+
borderColor: r.palePeach
|
|
103
105
|
},
|
|
104
106
|
text: {
|
|
105
|
-
...
|
|
106
|
-
color:
|
|
107
|
+
...i,
|
|
108
|
+
color: r.fg.accent.error
|
|
107
109
|
}
|
|
108
110
|
};
|
|
109
111
|
}
|
|
110
112
|
};
|
|
111
|
-
function
|
|
112
|
-
let c =
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
style:
|
|
113
|
+
function O({ variant: e = "primary", fullWidth: t = !1, children: n, loading: i = !1, disabled: a = !1, onPress: o, ...s }) {
|
|
114
|
+
let c = D(e);
|
|
115
|
+
return /* @__PURE__ */ w(b, {
|
|
116
|
+
style: _.flatten([
|
|
115
117
|
c.container,
|
|
116
|
-
|
|
118
|
+
t && { width: "100%" },
|
|
117
119
|
(a || i) && { opacity: .4 }
|
|
118
120
|
]),
|
|
119
121
|
onPress: o,
|
|
120
122
|
disabled: a || i,
|
|
121
123
|
activeOpacity: .7,
|
|
122
124
|
...s,
|
|
123
|
-
children: [typeof
|
|
125
|
+
children: [typeof n == "string" ? /* @__PURE__ */ C(v, {
|
|
124
126
|
style: c.text,
|
|
125
|
-
children:
|
|
126
|
-
}) :
|
|
127
|
+
children: n
|
|
128
|
+
}) : n, i && /* @__PURE__ */ C(E, {
|
|
127
129
|
size: 16,
|
|
128
|
-
color: e === "secondary" ?
|
|
130
|
+
color: e === "secondary" ? r.primary[600] : e === "destructiveSubtle" ? r.fg.accent.error : r.white
|
|
129
131
|
})]
|
|
130
132
|
});
|
|
131
133
|
}
|
|
132
134
|
//#endregion
|
|
135
|
+
//#region src/components/IconButton/IconButton.native.tsx
|
|
136
|
+
var k = {
|
|
137
|
+
sm: 32,
|
|
138
|
+
md: 40,
|
|
139
|
+
lg: 48
|
|
140
|
+
}, A = {
|
|
141
|
+
base: { backgroundColor: r.sf.base },
|
|
142
|
+
primary: { backgroundColor: r.primary["600-A08"] },
|
|
143
|
+
outline: {
|
|
144
|
+
borderWidth: 1,
|
|
145
|
+
borderColor: r.sf.base
|
|
146
|
+
}
|
|
147
|
+
}, j = {
|
|
148
|
+
base: { backgroundColor: r.neutral["800-A08"] },
|
|
149
|
+
primary: { backgroundColor: r.primary[50] },
|
|
150
|
+
outline: { backgroundColor: r.sf.tertiaryHover }
|
|
151
|
+
};
|
|
152
|
+
function M({ children: e, size: t = "md", variant: n = "base", disabled: r = !1, hitSlop: i = 10, ...a }) {
|
|
153
|
+
let o = k[t], s = {
|
|
154
|
+
width: o,
|
|
155
|
+
height: o,
|
|
156
|
+
borderRadius: o / 2,
|
|
157
|
+
alignItems: "center",
|
|
158
|
+
justifyContent: "center"
|
|
159
|
+
};
|
|
160
|
+
return /* @__PURE__ */ C(h, {
|
|
161
|
+
accessibilityRole: "button",
|
|
162
|
+
...a,
|
|
163
|
+
style: ({ pressed: e }) => [
|
|
164
|
+
s,
|
|
165
|
+
A[n],
|
|
166
|
+
e && j[n],
|
|
167
|
+
r && { opacity: .4 }
|
|
168
|
+
],
|
|
169
|
+
disabled: r,
|
|
170
|
+
hitSlop: i,
|
|
171
|
+
children: e
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
//#endregion
|
|
133
175
|
//#region src/components/Input/Input.native.tsx
|
|
134
|
-
var
|
|
176
|
+
var N = _.create({
|
|
135
177
|
container: { marginBottom: 8 },
|
|
136
178
|
fieldContainer: {
|
|
137
179
|
height: 49,
|
|
@@ -139,13 +181,13 @@ var b = u.create({
|
|
|
139
181
|
borderRadius: 12,
|
|
140
182
|
flexDirection: "row",
|
|
141
183
|
alignItems: "center",
|
|
142
|
-
backgroundColor:
|
|
184
|
+
backgroundColor: r.bg.secondary,
|
|
143
185
|
borderWidth: 2,
|
|
144
|
-
borderColor:
|
|
186
|
+
borderColor: r.bg.tertiary
|
|
145
187
|
},
|
|
146
|
-
fieldContainerError: { borderColor:
|
|
147
|
-
fieldContainerFocused: { borderColor:
|
|
148
|
-
fieldContainerFocusedError: { borderColor:
|
|
188
|
+
fieldContainerError: { borderColor: r.fg.accent.error },
|
|
189
|
+
fieldContainerFocused: { borderColor: r.fg.base },
|
|
190
|
+
fieldContainerFocusedError: { borderColor: r.fg.accent.error },
|
|
149
191
|
formGroup: {
|
|
150
192
|
position: "relative",
|
|
151
193
|
paddingVertical: 14,
|
|
@@ -157,22 +199,32 @@ var b = u.create({
|
|
|
157
199
|
width: "100%",
|
|
158
200
|
paddingTop: 4,
|
|
159
201
|
backgroundColor: "transparent",
|
|
202
|
+
fontFamily: t.body.fontFamily,
|
|
160
203
|
fontSize: 15,
|
|
161
204
|
fontWeight: "500",
|
|
162
|
-
color:
|
|
205
|
+
color: r.primary[900],
|
|
163
206
|
paddingBottom: 0
|
|
164
207
|
},
|
|
165
208
|
label: {
|
|
166
209
|
position: "absolute",
|
|
167
210
|
left: 0,
|
|
211
|
+
fontFamily: t.body.fontFamily,
|
|
168
212
|
fontSize: 15,
|
|
169
213
|
fontWeight: "500",
|
|
170
|
-
color:
|
|
214
|
+
color: r.fg.tertiary
|
|
215
|
+
},
|
|
216
|
+
currencyPrefix: {
|
|
217
|
+
fontFamily: t.body.fontFamily,
|
|
218
|
+
fontSize: 15,
|
|
219
|
+
fontWeight: "400",
|
|
220
|
+
color: r.fg.secondary,
|
|
221
|
+
marginRight: 4,
|
|
222
|
+
alignSelf: "center"
|
|
171
223
|
},
|
|
172
224
|
labelFloating: {
|
|
173
225
|
top: 2,
|
|
174
226
|
fontSize: 12,
|
|
175
|
-
color:
|
|
227
|
+
color: r.fg.secondary
|
|
176
228
|
},
|
|
177
229
|
labelNormal: {
|
|
178
230
|
top: "50%",
|
|
@@ -183,80 +235,344 @@ var b = u.create({
|
|
|
183
235
|
fontSize: 12,
|
|
184
236
|
paddingHorizontal: 4
|
|
185
237
|
},
|
|
186
|
-
helperError: { color:
|
|
187
|
-
helperNormal: { color:
|
|
238
|
+
helperError: { color: r.fg.accent.error },
|
|
239
|
+
helperNormal: { color: r.fg.secondary }
|
|
188
240
|
});
|
|
189
|
-
function
|
|
190
|
-
let [
|
|
191
|
-
|
|
192
|
-
i &&
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
], D = [
|
|
196
|
-
height:
|
|
241
|
+
function P({ label: e, value: t = "", onChange: n, error: i, helperText: a, placeholder: o, secureTextEntry: s = !1, keyboardType: c, autoCapitalize: u = "sentences", editable: d = !0, multiline: f = !1, numberOfLines: p = 1, currency: m = !1, ...h }) {
|
|
242
|
+
let [g, b] = l(!1), S = t.length > 0, T = g || S || m, E = [
|
|
243
|
+
N.fieldContainer,
|
|
244
|
+
i && N.fieldContainerError,
|
|
245
|
+
g && !i && N.fieldContainerFocused,
|
|
246
|
+
g && i && N.fieldContainerFocusedError
|
|
247
|
+
], D = [N.label, T ? N.labelFloating : N.labelNormal], O = _.flatten([N.input, f && {
|
|
248
|
+
height: p * 20,
|
|
197
249
|
textAlignVertical: "top"
|
|
198
250
|
}]);
|
|
199
|
-
return /* @__PURE__ */
|
|
200
|
-
style:
|
|
201
|
-
children: [/* @__PURE__ */
|
|
251
|
+
return /* @__PURE__ */ w(x, {
|
|
252
|
+
style: N.container,
|
|
253
|
+
children: [/* @__PURE__ */ w(x, {
|
|
202
254
|
style: E,
|
|
203
|
-
children: /* @__PURE__ */
|
|
204
|
-
style:
|
|
205
|
-
children:
|
|
255
|
+
children: [m && /* @__PURE__ */ C(v, {
|
|
256
|
+
style: N.currencyPrefix,
|
|
257
|
+
children: "€"
|
|
258
|
+
}), /* @__PURE__ */ w(x, {
|
|
259
|
+
style: N.formGroup,
|
|
260
|
+
children: [/* @__PURE__ */ C(y, {
|
|
206
261
|
style: O,
|
|
207
|
-
value:
|
|
208
|
-
onChangeText:
|
|
209
|
-
onFocus: () =>
|
|
210
|
-
onBlur: () =>
|
|
262
|
+
value: t,
|
|
263
|
+
onChangeText: n,
|
|
264
|
+
onFocus: () => b(!0),
|
|
265
|
+
onBlur: () => b(!1),
|
|
211
266
|
placeholder: T ? o : "",
|
|
212
|
-
placeholderTextColor:
|
|
213
|
-
secureTextEntry:
|
|
214
|
-
keyboardType:
|
|
215
|
-
autoCapitalize:
|
|
216
|
-
editable:
|
|
217
|
-
multiline:
|
|
218
|
-
numberOfLines:
|
|
219
|
-
...
|
|
220
|
-
}), /* @__PURE__ */
|
|
267
|
+
placeholderTextColor: r.fg.tertiary,
|
|
268
|
+
secureTextEntry: s,
|
|
269
|
+
keyboardType: c ?? (m ? "numeric" : "default"),
|
|
270
|
+
autoCapitalize: u,
|
|
271
|
+
editable: d,
|
|
272
|
+
multiline: f,
|
|
273
|
+
numberOfLines: p,
|
|
274
|
+
...h
|
|
275
|
+
}), /* @__PURE__ */ C(v, {
|
|
221
276
|
style: D,
|
|
222
277
|
children: e
|
|
223
278
|
})]
|
|
224
|
-
})
|
|
225
|
-
}), (i || a) && /* @__PURE__ */
|
|
226
|
-
style: [
|
|
279
|
+
})]
|
|
280
|
+
}), (i || a) && /* @__PURE__ */ C(v, {
|
|
281
|
+
style: [N.helper, i ? N.helperError : N.helperNormal],
|
|
227
282
|
children: i || a
|
|
228
283
|
})]
|
|
229
284
|
});
|
|
230
285
|
}
|
|
231
286
|
//#endregion
|
|
232
|
-
//#region src/
|
|
233
|
-
|
|
234
|
-
let [
|
|
235
|
-
|
|
287
|
+
//#region src/components/Select/Select.native.tsx
|
|
288
|
+
function F({ label: e, value: t, onChange: i, options: a, error: o, disabled: c = !1 }) {
|
|
289
|
+
let [u, d] = l(!1);
|
|
290
|
+
s(() => {
|
|
291
|
+
a.length === 1 && !t && i(a[0].value);
|
|
292
|
+
}, [a, t]);
|
|
293
|
+
let f = a.find((e) => e.value === t), m = o ? r.fg.accent.error : u ? r.fg.base : r.bg.tertiary;
|
|
294
|
+
return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ w(x, {
|
|
295
|
+
style: I.container,
|
|
296
|
+
children: [/* @__PURE__ */ w(h, {
|
|
297
|
+
style: [
|
|
298
|
+
I.trigger,
|
|
299
|
+
{ borderColor: m },
|
|
300
|
+
c && I.triggerDisabled
|
|
301
|
+
],
|
|
302
|
+
onPress: () => d(!0),
|
|
303
|
+
disabled: c,
|
|
304
|
+
accessibilityRole: "combobox",
|
|
305
|
+
accessibilityLabel: e,
|
|
306
|
+
accessibilityState: {
|
|
307
|
+
expanded: u,
|
|
308
|
+
disabled: c
|
|
309
|
+
},
|
|
310
|
+
children: [/* @__PURE__ */ w(x, {
|
|
311
|
+
style: I.triggerContent,
|
|
312
|
+
children: [/* @__PURE__ */ C(v, {
|
|
313
|
+
style: [I.labelText, f && I.labelFloating],
|
|
314
|
+
children: e
|
|
315
|
+
}), f && /* @__PURE__ */ C(v, {
|
|
316
|
+
style: I.valueText,
|
|
317
|
+
numberOfLines: 1,
|
|
318
|
+
children: f.text
|
|
319
|
+
})]
|
|
320
|
+
}), /* @__PURE__ */ C(n, {
|
|
321
|
+
direction: "down",
|
|
322
|
+
color: r.fg.secondary,
|
|
323
|
+
size: "small"
|
|
324
|
+
})]
|
|
325
|
+
}), o && /* @__PURE__ */ C(v, {
|
|
326
|
+
style: I.errorText,
|
|
327
|
+
children: o
|
|
328
|
+
})]
|
|
329
|
+
}), /* @__PURE__ */ C(p, {
|
|
330
|
+
visible: u,
|
|
331
|
+
transparent: !0,
|
|
332
|
+
animationType: "fade",
|
|
333
|
+
onRequestClose: () => d(!1),
|
|
334
|
+
children: /* @__PURE__ */ C(h, {
|
|
335
|
+
style: I.backdrop,
|
|
336
|
+
onPress: () => d(!1),
|
|
337
|
+
children: /* @__PURE__ */ w(x, {
|
|
338
|
+
style: I.sheet,
|
|
339
|
+
children: [/* @__PURE__ */ C(x, { style: I.sheetHandle }), /* @__PURE__ */ C(g, {
|
|
340
|
+
bounces: !1,
|
|
341
|
+
children: a.map((e) => {
|
|
342
|
+
let n = e.value === t;
|
|
343
|
+
return /* @__PURE__ */ C(h, {
|
|
344
|
+
style: [I.option, n && I.optionActive],
|
|
345
|
+
onPress: () => {
|
|
346
|
+
i(e.value), d(!1);
|
|
347
|
+
},
|
|
348
|
+
accessibilityRole: "menuitem",
|
|
349
|
+
accessibilityState: { selected: n },
|
|
350
|
+
children: /* @__PURE__ */ C(v, {
|
|
351
|
+
style: [I.optionText, n && I.optionTextActive],
|
|
352
|
+
children: e.text
|
|
353
|
+
})
|
|
354
|
+
}, e.value);
|
|
355
|
+
})
|
|
356
|
+
})]
|
|
357
|
+
})
|
|
358
|
+
})
|
|
359
|
+
})] });
|
|
360
|
+
}
|
|
361
|
+
var I = _.create({
|
|
362
|
+
container: { marginBottom: 8 },
|
|
363
|
+
trigger: {
|
|
364
|
+
height: 50,
|
|
365
|
+
paddingHorizontal: 12,
|
|
366
|
+
borderRadius: 12,
|
|
367
|
+
flexDirection: "row",
|
|
368
|
+
alignItems: "center",
|
|
369
|
+
backgroundColor: r.bg.secondary,
|
|
370
|
+
borderWidth: 2
|
|
371
|
+
},
|
|
372
|
+
triggerDisabled: { opacity: .4 },
|
|
373
|
+
triggerContent: {
|
|
374
|
+
flex: 1,
|
|
375
|
+
justifyContent: "center"
|
|
376
|
+
},
|
|
377
|
+
labelText: {
|
|
378
|
+
fontFamily: t.body.fontFamily,
|
|
379
|
+
fontSize: 15,
|
|
380
|
+
color: r.fg.tertiary
|
|
381
|
+
},
|
|
382
|
+
labelFloating: {
|
|
383
|
+
fontSize: 12,
|
|
384
|
+
color: r.fg.secondary,
|
|
385
|
+
marginBottom: 2
|
|
386
|
+
},
|
|
387
|
+
valueText: {
|
|
388
|
+
fontFamily: t.body.fontFamily,
|
|
389
|
+
fontSize: 15,
|
|
390
|
+
fontWeight: "500",
|
|
391
|
+
color: r.primary[900]
|
|
392
|
+
},
|
|
393
|
+
errorText: {
|
|
394
|
+
marginTop: 4,
|
|
395
|
+
fontSize: 12,
|
|
396
|
+
paddingHorizontal: 4,
|
|
397
|
+
color: r.fg.accent.error,
|
|
398
|
+
fontFamily: t.body.fontFamily
|
|
399
|
+
},
|
|
400
|
+
backdrop: {
|
|
401
|
+
flex: 1,
|
|
402
|
+
backgroundColor: "rgba(0,0,0,0.4)",
|
|
403
|
+
justifyContent: "flex-end"
|
|
404
|
+
},
|
|
405
|
+
sheet: {
|
|
406
|
+
backgroundColor: r.bg.base,
|
|
407
|
+
borderTopLeftRadius: 16,
|
|
408
|
+
borderTopRightRadius: 16,
|
|
409
|
+
paddingBottom: 32,
|
|
410
|
+
maxHeight: "70%"
|
|
411
|
+
},
|
|
412
|
+
sheetHandle: {
|
|
413
|
+
width: 36,
|
|
414
|
+
height: 4,
|
|
415
|
+
borderRadius: 2,
|
|
416
|
+
backgroundColor: r.border.default,
|
|
417
|
+
alignSelf: "center",
|
|
418
|
+
marginTop: 8,
|
|
419
|
+
marginBottom: 8
|
|
420
|
+
},
|
|
421
|
+
option: {
|
|
422
|
+
paddingVertical: 16,
|
|
423
|
+
paddingHorizontal: 20,
|
|
424
|
+
borderBottomWidth: 1,
|
|
425
|
+
borderBottomColor: r.border.default
|
|
426
|
+
},
|
|
427
|
+
optionActive: { backgroundColor: r.primary[50] },
|
|
428
|
+
optionText: {
|
|
429
|
+
fontFamily: t.body.fontFamily,
|
|
430
|
+
fontSize: 15,
|
|
431
|
+
color: r.fg.base
|
|
432
|
+
},
|
|
433
|
+
optionTextActive: {
|
|
434
|
+
color: r.primary[900],
|
|
435
|
+
fontWeight: "500"
|
|
436
|
+
}
|
|
437
|
+
}), L = {
|
|
438
|
+
heading: 20,
|
|
439
|
+
title: 16,
|
|
440
|
+
label: 13,
|
|
441
|
+
body: 15,
|
|
442
|
+
caption: 12
|
|
443
|
+
};
|
|
444
|
+
function R({ variant: e = "body", color: n, style: r, ...i }) {
|
|
445
|
+
return /* @__PURE__ */ C(v, {
|
|
446
|
+
style: [
|
|
447
|
+
t[e],
|
|
448
|
+
{ fontSize: L[e] },
|
|
449
|
+
n ? { color: n } : void 0,
|
|
450
|
+
r
|
|
451
|
+
],
|
|
452
|
+
...i
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/components/Sheet/Sheet.native.tsx
|
|
457
|
+
function z({ open: t, onClose: i, onGoBack: a, title: o, children: s, footer: c }) {
|
|
458
|
+
let l = T();
|
|
459
|
+
return /* @__PURE__ */ C(p, {
|
|
460
|
+
visible: t,
|
|
461
|
+
animationType: "slide",
|
|
462
|
+
presentationStyle: "pageSheet",
|
|
463
|
+
onRequestClose: i,
|
|
464
|
+
children: /* @__PURE__ */ C(f, {
|
|
465
|
+
style: B.flex,
|
|
466
|
+
behavior: m.OS === "ios" ? "padding" : void 0,
|
|
467
|
+
children: /* @__PURE__ */ w(x, {
|
|
468
|
+
style: [B.container, { paddingTop: Math.max(l.top, 16) }],
|
|
469
|
+
children: [
|
|
470
|
+
/* @__PURE__ */ w(x, {
|
|
471
|
+
style: B.header,
|
|
472
|
+
children: [
|
|
473
|
+
/* @__PURE__ */ C(x, {
|
|
474
|
+
style: B.headerSide,
|
|
475
|
+
children: a && /* @__PURE__ */ C(M, {
|
|
476
|
+
variant: "base",
|
|
477
|
+
size: "md",
|
|
478
|
+
accessibilityLabel: "Go back",
|
|
479
|
+
onPress: a,
|
|
480
|
+
children: /* @__PURE__ */ C(n, {
|
|
481
|
+
color: r.fg.secondary,
|
|
482
|
+
direction: "left"
|
|
483
|
+
})
|
|
484
|
+
})
|
|
485
|
+
}),
|
|
486
|
+
o ? /* @__PURE__ */ C(R, {
|
|
487
|
+
variant: "heading",
|
|
488
|
+
style: B.headerTitle,
|
|
489
|
+
children: o
|
|
490
|
+
}) : /* @__PURE__ */ C(x, { style: B.flex }),
|
|
491
|
+
/* @__PURE__ */ C(x, {
|
|
492
|
+
style: [B.headerSide, B.headerSideRight],
|
|
493
|
+
children: /* @__PURE__ */ C(M, {
|
|
494
|
+
variant: "base",
|
|
495
|
+
size: "md",
|
|
496
|
+
accessibilityLabel: "Close",
|
|
497
|
+
onPress: i,
|
|
498
|
+
children: /* @__PURE__ */ C(e, {
|
|
499
|
+
color: r.fg.secondary,
|
|
500
|
+
size: "small"
|
|
501
|
+
})
|
|
502
|
+
})
|
|
503
|
+
})
|
|
504
|
+
]
|
|
505
|
+
}),
|
|
506
|
+
/* @__PURE__ */ C(g, {
|
|
507
|
+
style: B.flex,
|
|
508
|
+
contentContainerStyle: B.body,
|
|
509
|
+
children: s
|
|
510
|
+
}),
|
|
511
|
+
c && /* @__PURE__ */ C(x, {
|
|
512
|
+
style: B.footer,
|
|
513
|
+
children: c
|
|
514
|
+
})
|
|
515
|
+
]
|
|
516
|
+
})
|
|
517
|
+
})
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
var B = _.create({
|
|
521
|
+
flex: { flex: 1 },
|
|
522
|
+
container: {
|
|
523
|
+
flex: 1,
|
|
524
|
+
backgroundColor: r.bg.base
|
|
525
|
+
},
|
|
526
|
+
header: {
|
|
527
|
+
flexDirection: "row",
|
|
528
|
+
alignItems: "center",
|
|
529
|
+
paddingHorizontal: 8,
|
|
530
|
+
paddingBottom: 8,
|
|
531
|
+
minHeight: 52
|
|
532
|
+
},
|
|
533
|
+
headerSide: { flex: 1 },
|
|
534
|
+
headerSideRight: { alignItems: "flex-end" },
|
|
535
|
+
headerTitle: {
|
|
536
|
+
flex: 2,
|
|
537
|
+
textAlign: "center"
|
|
538
|
+
},
|
|
539
|
+
body: {
|
|
540
|
+
paddingHorizontal: 20,
|
|
541
|
+
paddingBottom: 20
|
|
542
|
+
},
|
|
543
|
+
footer: {
|
|
544
|
+
paddingHorizontal: 20,
|
|
545
|
+
paddingVertical: 24,
|
|
546
|
+
borderTopWidth: 1,
|
|
547
|
+
borderTopColor: r.border.default
|
|
548
|
+
}
|
|
549
|
+
}), V = () => {
|
|
550
|
+
let [e, t] = l(window.innerWidth <= 768), n = c(window.innerWidth);
|
|
551
|
+
return s(() => {
|
|
236
552
|
let e = () => {
|
|
237
553
|
let e = window.innerWidth;
|
|
238
554
|
e <= 768 && n.current > 768 ? t(!0) : e > 768 && n.current <= 768 && t(!1), n.current = e;
|
|
239
555
|
};
|
|
240
556
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
241
557
|
}, []), e;
|
|
242
|
-
},
|
|
243
|
-
function
|
|
244
|
-
return
|
|
558
|
+
}, H = 1, U = 1e6, W = 0;
|
|
559
|
+
function G() {
|
|
560
|
+
return W = (W + 1) % (2 ** 53 - 1), W.toString();
|
|
245
561
|
}
|
|
246
|
-
var
|
|
247
|
-
if (
|
|
562
|
+
var K = /* @__PURE__ */ new Map(), q = (e) => {
|
|
563
|
+
if (K.has(e)) return;
|
|
248
564
|
let t = setTimeout(() => {
|
|
249
|
-
|
|
565
|
+
K.delete(e), Z({
|
|
250
566
|
type: "REMOVE_TOAST",
|
|
251
567
|
toastId: e
|
|
252
568
|
});
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
},
|
|
569
|
+
}, U);
|
|
570
|
+
K.set(e, t);
|
|
571
|
+
}, J = (e, t) => {
|
|
256
572
|
switch (t.type) {
|
|
257
573
|
case "ADD_TOAST": return {
|
|
258
574
|
...e,
|
|
259
|
-
toasts: [t.toast, ...e.toasts].slice(0,
|
|
575
|
+
toasts: [t.toast, ...e.toasts].slice(0, H)
|
|
260
576
|
};
|
|
261
577
|
case "UPDATE_TOAST": return {
|
|
262
578
|
...e,
|
|
@@ -267,8 +583,8 @@ var D = /* @__PURE__ */ new Map(), O = (e) => {
|
|
|
267
583
|
};
|
|
268
584
|
case "DISMISS_TOAST": {
|
|
269
585
|
let { toastId: n } = t;
|
|
270
|
-
return n ?
|
|
271
|
-
|
|
586
|
+
return n ? q(n) : e.toasts.forEach((e) => {
|
|
587
|
+
q(e.id);
|
|
272
588
|
}), {
|
|
273
589
|
...e,
|
|
274
590
|
toasts: e.toasts.map((e) => e.id === n || n === void 0 ? {
|
|
@@ -285,24 +601,24 @@ var D = /* @__PURE__ */ new Map(), O = (e) => {
|
|
|
285
601
|
toasts: e.toasts.filter((e) => e.id !== t.toastId)
|
|
286
602
|
};
|
|
287
603
|
}
|
|
288
|
-
},
|
|
289
|
-
function
|
|
290
|
-
|
|
291
|
-
e(
|
|
604
|
+
}, Y = [], X = { toasts: [] };
|
|
605
|
+
function Z(e) {
|
|
606
|
+
X = J(X, e), Y.forEach((e) => {
|
|
607
|
+
e(X);
|
|
292
608
|
});
|
|
293
609
|
}
|
|
294
|
-
function
|
|
295
|
-
let t =
|
|
610
|
+
function Q({ ...e }) {
|
|
611
|
+
let t = G(), n = (e) => Z({
|
|
296
612
|
type: "UPDATE_TOAST",
|
|
297
613
|
toast: {
|
|
298
614
|
...e,
|
|
299
615
|
id: t
|
|
300
616
|
}
|
|
301
|
-
}), r = () =>
|
|
617
|
+
}), r = () => Z({
|
|
302
618
|
type: "DISMISS_TOAST",
|
|
303
619
|
toastId: t
|
|
304
620
|
});
|
|
305
|
-
return
|
|
621
|
+
return Z({
|
|
306
622
|
type: "ADD_TOAST",
|
|
307
623
|
toast: {
|
|
308
624
|
...e,
|
|
@@ -318,19 +634,19 @@ function N({ ...e }) {
|
|
|
318
634
|
update: n
|
|
319
635
|
};
|
|
320
636
|
}
|
|
321
|
-
function
|
|
322
|
-
let [e, t] =
|
|
323
|
-
return
|
|
324
|
-
let e =
|
|
325
|
-
e > -1 &&
|
|
637
|
+
function $() {
|
|
638
|
+
let [e, t] = a.useState(X);
|
|
639
|
+
return a.useEffect(() => (Y.push(t), () => {
|
|
640
|
+
let e = Y.indexOf(t);
|
|
641
|
+
e > -1 && Y.splice(e, 1);
|
|
326
642
|
}), [e]), {
|
|
327
643
|
...e,
|
|
328
|
-
toast:
|
|
329
|
-
dismiss: (e) =>
|
|
644
|
+
toast: Q,
|
|
645
|
+
dismiss: (e) => Z({
|
|
330
646
|
type: "DISMISS_TOAST",
|
|
331
647
|
toastId: e
|
|
332
648
|
})
|
|
333
649
|
};
|
|
334
650
|
}
|
|
335
651
|
//#endregion
|
|
336
|
-
export {
|
|
652
|
+
export { O as Button, M as IconButton, P as Input, F as Select, z as Sheet, E as Spinner, R as Text, r as colors, i as icons, t as typography, V as useIsMobile, $ as useToast };
|