@boostdev/design-system-react-native 0.4.0 → 0.5.1
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/CHANGELOG.md +65 -0
- package/README.md +10 -0
- package/dist/index.cjs +854 -764
- package/dist/index.d.cts +35 -4
- package/dist/index.d.ts +35 -4
- package/dist/index.js +645 -659
- package/package.json +1 -1
- package/src/components/interaction/Button/Button.mdx +5 -1
- package/src/components/interaction/Button/Button.spec.tsx +40 -0
- package/src/components/interaction/Button/Button.tsx +15 -8
- package/src/components/interaction/Dialog/Dialog.tsx +2 -9
- package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +2 -13
- package/src/components/interaction/Rating/Rating.tsx +2 -1
- package/src/components/interaction/SideSheet/SideSheet.tsx +2 -11
- package/src/components/interaction/Toast/Toast.tsx +2 -9
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx +2 -1
- package/src/components/interaction/form/Combobox/Combobox.spec.tsx +9 -0
- package/src/components/interaction/form/Combobox/Combobox.tsx +4 -12
- package/src/components/interaction/form/FileInput/FileInput.spec.tsx +6 -0
- package/src/components/interaction/form/FileInput/FileInput.tsx +3 -2
- package/src/components/interaction/form/FormInput/FormInput.spec.tsx +18 -9
- package/src/components/interaction/form/FormInput/FormInput.tsx +5 -11
- package/src/components/interaction/form/NumberInput/NumberInput.spec.tsx +8 -0
- package/src/components/interaction/form/NumberInput/NumberInput.tsx +6 -13
- package/src/components/interaction/form/RadioGroup/RadioGroup.tsx +2 -1
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.spec.tsx +40 -0
- package/src/components/interaction/form/SegmentedControl/SegmentedControl.tsx +8 -2
- package/src/components/interaction/form/Select/Select.mdx +2 -1
- package/src/components/interaction/form/Select/Select.spec.tsx +22 -1
- package/src/components/interaction/form/Select/Select.tsx +9 -17
- package/src/components/interaction/form/Slider/Slider.tsx +2 -9
- package/src/components/interaction/form/Textarea/Textarea.spec.tsx +6 -0
- package/src/components/interaction/form/Textarea/Textarea.tsx +3 -8
- package/src/components/interaction/form/atoms/Label.tsx +2 -1
- package/src/components/interaction/form/atoms/Message.tsx +2 -1
- package/src/components/layout/SectionHeader/SectionHeader.tsx +2 -1
- package/src/components/ui/Accordion/Accordion.tsx +2 -11
- package/src/components/ui/Alert/Alert.tsx +2 -1
- package/src/components/ui/Avatar/Avatar.tsx +2 -1
- package/src/components/ui/Badge/Badge.spec.tsx +28 -0
- package/src/components/ui/Badge/Badge.tsx +9 -3
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +2 -1
- package/src/components/ui/Calendar/Calendar.tsx +2 -8
- package/src/components/ui/Carousel/Carousel.tsx +2 -12
- package/src/components/ui/Collapsible/Collapsible.spec.tsx +1 -1
- package/src/components/ui/Collapsible/Collapsible.tsx +7 -22
- package/src/components/ui/DescriptionList/DescriptionList.tsx +2 -1
- package/src/components/ui/Link/Link.tsx +2 -1
- package/src/components/ui/NotificationBanner/NotificationBanner.tsx +2 -1
- package/src/components/ui/Pagination/Pagination.tsx +2 -1
- package/src/components/ui/Progress/Progress.tsx +2 -1
- package/src/components/ui/ProgressCircle/ProgressCircle.tsx +2 -1
- package/src/components/ui/Table/Table.tsx +2 -9
- package/src/components/ui/Tabs/Tabs.tsx +2 -10
- package/src/components/ui/Tooltip/Tooltip.tsx +2 -1
- package/src/components/ui/Typography/Typography.mdx +2 -0
- package/src/components/ui/Typography/Typography.spec.tsx +59 -0
- package/src/components/ui/Typography/Typography.tsx +18 -2
- package/src/index.ts +2 -0
- package/src/native/Chevron.spec.tsx +34 -0
- package/src/native/Chevron.tsx +50 -0
- package/src/native/ScaledText.guard.spec.ts +25 -0
- package/src/native/ScaledText.spec.tsx +77 -0
- package/src/native/ScaledText.tsx +30 -0
- package/src/native/fontScale.spec.ts +35 -0
- package/src/native/fontScale.ts +15 -0
- package/src/test/cornerRadii.ts +15 -0
package/dist/index.cjs
CHANGED
|
@@ -64,6 +64,8 @@ __export(index_exports, {
|
|
|
64
64
|
Radio: () => Radio,
|
|
65
65
|
RadioGroup: () => RadioGroup,
|
|
66
66
|
Rating: () => Rating,
|
|
67
|
+
ScaledText: () => ScaledText,
|
|
68
|
+
ScaledTextInput: () => ScaledTextInput,
|
|
67
69
|
SectionHeader: () => SectionHeader,
|
|
68
70
|
SegmentedControl: () => SegmentedControl,
|
|
69
71
|
Select: () => Select,
|
|
@@ -85,6 +87,8 @@ __export(index_exports, {
|
|
|
85
87
|
createReactNavigationTheme: () => createReactNavigationTheme,
|
|
86
88
|
font: () => import_native.font,
|
|
87
89
|
lineHeight: () => lineHeight,
|
|
90
|
+
maxFontScaleFor: () => maxFontScaleFor,
|
|
91
|
+
maxFontScaleForStyle: () => maxFontScaleForStyle,
|
|
88
92
|
spacing: () => import_native.spacing,
|
|
89
93
|
useReactNavigationTheme: () => useReactNavigationTheme,
|
|
90
94
|
useTheme: () => useTheme,
|
|
@@ -167,10 +171,37 @@ function useReactNavigationTheme(overrides = {}) {
|
|
|
167
171
|
});
|
|
168
172
|
}
|
|
169
173
|
|
|
170
|
-
// src/
|
|
174
|
+
// src/native/ScaledText.tsx
|
|
175
|
+
var import_react2 = require("react");
|
|
171
176
|
var import_react_native2 = require("react-native");
|
|
177
|
+
|
|
178
|
+
// src/native/fontScale.ts
|
|
179
|
+
function maxFontScaleFor(fontSize) {
|
|
180
|
+
if (fontSize >= 60) return 1;
|
|
181
|
+
if (fontSize >= 26) return 1.3;
|
|
182
|
+
if (fontSize >= 20) return 1.5;
|
|
183
|
+
return 2;
|
|
184
|
+
}
|
|
185
|
+
var DEFAULT_FONT_SIZE = 14;
|
|
186
|
+
|
|
187
|
+
// src/native/ScaledText.tsx
|
|
172
188
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
173
|
-
|
|
189
|
+
function maxFontScaleForStyle(style, override) {
|
|
190
|
+
if (override !== void 0 && override !== null) return override;
|
|
191
|
+
const fontSize = import_react_native2.StyleSheet.flatten(style)?.fontSize;
|
|
192
|
+
return maxFontScaleFor(typeof fontSize === "number" ? fontSize : DEFAULT_FONT_SIZE);
|
|
193
|
+
}
|
|
194
|
+
var ScaledText = (0, import_react2.forwardRef)(function ScaledText2({ maxFontSizeMultiplier, style, ...rest }, ref) {
|
|
195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.Text, { ref, style, maxFontSizeMultiplier: maxFontScaleForStyle(style, maxFontSizeMultiplier), ...rest });
|
|
196
|
+
});
|
|
197
|
+
var ScaledTextInput = (0, import_react2.forwardRef)(function ScaledTextInput2({ maxFontSizeMultiplier, style, ...rest }, ref) {
|
|
198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.TextInput, { ref, style, maxFontSizeMultiplier: maxFontScaleForStyle(style, maxFontSizeMultiplier), ...rest });
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// src/components/ui/Typography/Typography.tsx
|
|
202
|
+
var import_react_native3 = require("react-native");
|
|
203
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
204
|
+
var styles = import_react_native3.StyleSheet.create({
|
|
174
205
|
base: {
|
|
175
206
|
fontFamily: import_native.font.family.body,
|
|
176
207
|
fontWeight: import_native.font.weight.body
|
|
@@ -209,22 +240,30 @@ var accessibilityRoles = {
|
|
|
209
240
|
body: "text",
|
|
210
241
|
body_s: "text"
|
|
211
242
|
};
|
|
212
|
-
function Typography({
|
|
243
|
+
function Typography({
|
|
244
|
+
variant = "body",
|
|
245
|
+
children,
|
|
246
|
+
style,
|
|
247
|
+
maxFontSizeMultiplier,
|
|
248
|
+
numberOfLines
|
|
249
|
+
}) {
|
|
213
250
|
const { colors: colors2 } = useTheme();
|
|
214
|
-
return /* @__PURE__ */ (0,
|
|
215
|
-
|
|
251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
252
|
+
ScaledText,
|
|
216
253
|
{
|
|
217
254
|
accessibilityRole: accessibilityRoles[variant],
|
|
218
255
|
style: [styles.base, styles[variant], { color: colors2.colorOnBg }, style],
|
|
256
|
+
maxFontSizeMultiplier,
|
|
257
|
+
numberOfLines,
|
|
219
258
|
children
|
|
220
259
|
}
|
|
221
260
|
);
|
|
222
261
|
}
|
|
223
262
|
|
|
224
263
|
// src/components/ui/Badge/Badge.tsx
|
|
225
|
-
var
|
|
226
|
-
var
|
|
227
|
-
var styles2 =
|
|
264
|
+
var import_react_native4 = require("react-native");
|
|
265
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
266
|
+
var styles2 = import_react_native4.StyleSheet.create({
|
|
228
267
|
badge: {
|
|
229
268
|
alignSelf: "flex-start",
|
|
230
269
|
flexDirection: "row",
|
|
@@ -241,7 +280,7 @@ var styles2 = import_react_native3.StyleSheet.create({
|
|
|
241
280
|
lineHeight: import_native.font.size.bodyS
|
|
242
281
|
}
|
|
243
282
|
});
|
|
244
|
-
function Badge({ children, variant = "primary", style }) {
|
|
283
|
+
function Badge({ children, variant = "primary", style, maxFontSizeMultiplier }) {
|
|
245
284
|
const { colors: colors2 } = useTheme();
|
|
246
285
|
const variantColors = {
|
|
247
286
|
primary: { bg: colors2.colorInteractive, text: colors2.colorOnInteractive },
|
|
@@ -251,12 +290,12 @@ function Badge({ children, variant = "primary", style }) {
|
|
|
251
290
|
warning: { bg: colors2.colorWarning, text: colors2.colorOnWarning }
|
|
252
291
|
};
|
|
253
292
|
const { bg, text } = variantColors[variant];
|
|
254
|
-
return /* @__PURE__ */ (0,
|
|
293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.View, { style: [styles2.badge, { backgroundColor: bg }, style], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ScaledText, { style: [styles2.text, { color: text }], maxFontSizeMultiplier, children }) });
|
|
255
294
|
}
|
|
256
295
|
|
|
257
296
|
// src/components/ui/Avatar/Avatar.tsx
|
|
258
|
-
var
|
|
259
|
-
var
|
|
297
|
+
var import_react_native5 = require("react-native");
|
|
298
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
260
299
|
var sizeMap = {
|
|
261
300
|
small: { container: 32, fontSize: import_native.font.size.bodyS },
|
|
262
301
|
medium: { container: 48, fontSize: import_native.font.size.body },
|
|
@@ -265,7 +304,7 @@ var sizeMap = {
|
|
|
265
304
|
function getInitials(name) {
|
|
266
305
|
return name.split(" ").filter(Boolean).slice(0, 2).map((word) => word[0].toUpperCase()).join("");
|
|
267
306
|
}
|
|
268
|
-
var styles3 =
|
|
307
|
+
var styles3 = import_react_native5.StyleSheet.create({
|
|
269
308
|
container: {
|
|
270
309
|
borderRadius: import_native.border.radius.full,
|
|
271
310
|
overflow: "hidden",
|
|
@@ -286,19 +325,19 @@ function Avatar({ src, alt, name, size = "medium", style }) {
|
|
|
286
325
|
const { container, fontSize } = sizeMap[size];
|
|
287
326
|
const label = alt ?? name ?? "User avatar";
|
|
288
327
|
if (src) {
|
|
289
|
-
return /* @__PURE__ */ (0,
|
|
290
|
-
|
|
328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
329
|
+
import_react_native5.View,
|
|
291
330
|
{
|
|
292
331
|
style: [styles3.container, { width: container, height: container }, style],
|
|
293
332
|
accessibilityLabel: label,
|
|
294
333
|
accessibilityRole: "image",
|
|
295
|
-
children: /* @__PURE__ */ (0,
|
|
334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.Image, { source: { uri: src }, style: styles3.image })
|
|
296
335
|
}
|
|
297
336
|
);
|
|
298
337
|
}
|
|
299
338
|
const initials = name ? getInitials(name) : "";
|
|
300
|
-
return /* @__PURE__ */ (0,
|
|
301
|
-
|
|
339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
340
|
+
import_react_native5.View,
|
|
302
341
|
{
|
|
303
342
|
style: [
|
|
304
343
|
styles3.container,
|
|
@@ -307,8 +346,8 @@ function Avatar({ src, alt, name, size = "medium", style }) {
|
|
|
307
346
|
],
|
|
308
347
|
accessibilityLabel: label,
|
|
309
348
|
accessibilityRole: "image",
|
|
310
|
-
children: /* @__PURE__ */ (0,
|
|
311
|
-
|
|
349
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
350
|
+
ScaledText,
|
|
312
351
|
{
|
|
313
352
|
style: [styles3.initials, { fontSize, color: colors2.colorOnBlue }],
|
|
314
353
|
importantForAccessibility: "no",
|
|
@@ -321,22 +360,22 @@ function Avatar({ src, alt, name, size = "medium", style }) {
|
|
|
321
360
|
}
|
|
322
361
|
|
|
323
362
|
// src/components/ui/Separator/Separator.tsx
|
|
324
|
-
var
|
|
325
|
-
var
|
|
326
|
-
var styles4 =
|
|
363
|
+
var import_react_native6 = require("react-native");
|
|
364
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
365
|
+
var styles4 = import_react_native6.StyleSheet.create({
|
|
327
366
|
horizontal: {
|
|
328
|
-
height:
|
|
367
|
+
height: import_react_native6.StyleSheet.hairlineWidth,
|
|
329
368
|
width: "100%"
|
|
330
369
|
},
|
|
331
370
|
vertical: {
|
|
332
|
-
width:
|
|
371
|
+
width: import_react_native6.StyleSheet.hairlineWidth,
|
|
333
372
|
alignSelf: "stretch"
|
|
334
373
|
}
|
|
335
374
|
});
|
|
336
375
|
function Separator({ orientation = "horizontal", style }) {
|
|
337
376
|
const { colors: colors2 } = useTheme();
|
|
338
|
-
return /* @__PURE__ */ (0,
|
|
339
|
-
|
|
377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
378
|
+
import_react_native6.View,
|
|
340
379
|
{
|
|
341
380
|
accessibilityRole: "none",
|
|
342
381
|
style: [
|
|
@@ -349,8 +388,8 @@ function Separator({ orientation = "horizontal", style }) {
|
|
|
349
388
|
}
|
|
350
389
|
|
|
351
390
|
// src/components/ui/Loading/Loading.tsx
|
|
352
|
-
var
|
|
353
|
-
var
|
|
391
|
+
var import_react_native7 = require("react-native");
|
|
392
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
354
393
|
var rnSize = {
|
|
355
394
|
small: "small",
|
|
356
395
|
medium: "large",
|
|
@@ -358,8 +397,8 @@ var rnSize = {
|
|
|
358
397
|
};
|
|
359
398
|
function Loading({ size = "medium", accessibilityLabel = "Loading", style }) {
|
|
360
399
|
const { colors: colors2 } = useTheme();
|
|
361
|
-
return /* @__PURE__ */ (0,
|
|
362
|
-
|
|
400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
401
|
+
import_react_native7.ActivityIndicator,
|
|
363
402
|
{
|
|
364
403
|
size: rnSize[size],
|
|
365
404
|
color: colors2.colorInteractive,
|
|
@@ -371,14 +410,14 @@ function Loading({ size = "medium", accessibilityLabel = "Loading", style }) {
|
|
|
371
410
|
}
|
|
372
411
|
|
|
373
412
|
// src/components/ui/Progress/Progress.tsx
|
|
374
|
-
var
|
|
375
|
-
var
|
|
413
|
+
var import_react_native8 = require("react-native");
|
|
414
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
376
415
|
var trackHeight = {
|
|
377
416
|
small: 4,
|
|
378
417
|
medium: 8,
|
|
379
418
|
large: 12
|
|
380
419
|
};
|
|
381
|
-
var styles5 =
|
|
420
|
+
var styles5 = import_react_native8.StyleSheet.create({
|
|
382
421
|
container: {
|
|
383
422
|
width: "100%"
|
|
384
423
|
},
|
|
@@ -413,23 +452,23 @@ function Progress({
|
|
|
413
452
|
const { colors: colors2 } = useTheme();
|
|
414
453
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
415
454
|
const height = trackHeight[size];
|
|
416
|
-
return /* @__PURE__ */ (0,
|
|
417
|
-
showLabel && /* @__PURE__ */ (0,
|
|
418
|
-
/* @__PURE__ */ (0,
|
|
419
|
-
/* @__PURE__ */ (0,
|
|
455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native8.View, { style: [styles5.container, style], children: [
|
|
456
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native8.View, { style: styles5.labelRow, children: [
|
|
457
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ScaledText, { style: [styles5.labelText, { color: colors2.colorOnBg }], children: label }),
|
|
458
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ScaledText, { style: [styles5.labelText, { color: colors2.colorOnBgSubtle }], children: [
|
|
420
459
|
Math.round(percentage),
|
|
421
460
|
"%"
|
|
422
461
|
] })
|
|
423
462
|
] }),
|
|
424
|
-
/* @__PURE__ */ (0,
|
|
425
|
-
|
|
463
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
464
|
+
import_react_native8.View,
|
|
426
465
|
{
|
|
427
466
|
style: [styles5.track, { height, backgroundColor: colors2.colorBgSubtle }],
|
|
428
467
|
accessibilityRole: "progressbar",
|
|
429
468
|
accessibilityLabel: label,
|
|
430
469
|
accessibilityValue: { min: 0, max, now: value },
|
|
431
|
-
children: /* @__PURE__ */ (0,
|
|
432
|
-
|
|
470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
471
|
+
import_react_native8.View,
|
|
433
472
|
{
|
|
434
473
|
style: [
|
|
435
474
|
styles5.fill,
|
|
@@ -443,10 +482,10 @@ function Progress({
|
|
|
443
482
|
}
|
|
444
483
|
|
|
445
484
|
// src/components/ui/Skeleton/Skeleton.tsx
|
|
446
|
-
var
|
|
447
|
-
var
|
|
448
|
-
var
|
|
449
|
-
var styles6 =
|
|
485
|
+
var import_react3 = require("react");
|
|
486
|
+
var import_react_native9 = require("react-native");
|
|
487
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
488
|
+
var styles6 = import_react_native9.StyleSheet.create({
|
|
450
489
|
skeleton: {
|
|
451
490
|
borderRadius: import_native.border.radius.xs,
|
|
452
491
|
overflow: "hidden"
|
|
@@ -454,19 +493,19 @@ var styles6 = import_react_native8.StyleSheet.create({
|
|
|
454
493
|
});
|
|
455
494
|
function Skeleton({ style }) {
|
|
456
495
|
const { colors: colors2 } = useTheme();
|
|
457
|
-
const opacity = (0,
|
|
458
|
-
(0,
|
|
459
|
-
const anim =
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
496
|
+
const opacity = (0, import_react3.useRef)(new import_react_native9.Animated.Value(1)).current;
|
|
497
|
+
(0, import_react3.useEffect)(() => {
|
|
498
|
+
const anim = import_react_native9.Animated.loop(
|
|
499
|
+
import_react_native9.Animated.sequence([
|
|
500
|
+
import_react_native9.Animated.timing(opacity, { toValue: 0.4, duration: 700, useNativeDriver: true }),
|
|
501
|
+
import_react_native9.Animated.timing(opacity, { toValue: 1, duration: 700, useNativeDriver: true })
|
|
463
502
|
])
|
|
464
503
|
);
|
|
465
504
|
anim.start();
|
|
466
505
|
return () => anim.stop();
|
|
467
506
|
}, [opacity]);
|
|
468
|
-
return /* @__PURE__ */ (0,
|
|
469
|
-
|
|
507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
508
|
+
import_react_native9.Animated.View,
|
|
470
509
|
{
|
|
471
510
|
importantForAccessibility: "no-hide-descendants",
|
|
472
511
|
style: [
|
|
@@ -479,9 +518,9 @@ function Skeleton({ style }) {
|
|
|
479
518
|
}
|
|
480
519
|
|
|
481
520
|
// src/components/ui/Alert/Alert.tsx
|
|
482
|
-
var
|
|
483
|
-
var
|
|
484
|
-
var styles7 =
|
|
521
|
+
var import_react_native10 = require("react-native");
|
|
522
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
523
|
+
var styles7 = import_react_native10.StyleSheet.create({
|
|
485
524
|
alert: {
|
|
486
525
|
flexDirection: "row",
|
|
487
526
|
alignItems: "flex-start",
|
|
@@ -531,27 +570,27 @@ function Alert({
|
|
|
531
570
|
};
|
|
532
571
|
const { bg, text, border: borderColor } = variantColors[variant];
|
|
533
572
|
const resolvedChildren = typeof children === "function" ? children({ color: text }) : children;
|
|
534
|
-
return /* @__PURE__ */ (0,
|
|
535
|
-
|
|
573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
574
|
+
import_react_native10.View,
|
|
536
575
|
{
|
|
537
576
|
accessibilityRole: isUrgent ? "alert" : "none",
|
|
538
577
|
accessibilityLiveRegion: isUrgent ? "assertive" : "polite",
|
|
539
578
|
style: [styles7.alert, { backgroundColor: bg, borderStartWidth: import_native.spacing.s, borderStartColor: borderColor }, style],
|
|
540
579
|
children: [
|
|
541
|
-
icon && /* @__PURE__ */ (0,
|
|
542
|
-
/* @__PURE__ */ (0,
|
|
543
|
-
title && /* @__PURE__ */ (0,
|
|
544
|
-
typeof resolvedChildren === "string" || typeof resolvedChildren === "number" ? /* @__PURE__ */ (0,
|
|
580
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native10.View, { style: styles7.icon, children: icon }),
|
|
581
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native10.View, { style: styles7.content, children: [
|
|
582
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScaledText, { style: [styles7.title, { color: text }], children: title }),
|
|
583
|
+
typeof resolvedChildren === "string" || typeof resolvedChildren === "number" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScaledText, { style: [styles7.body, { color: text }], children: resolvedChildren }) : resolvedChildren
|
|
545
584
|
] }),
|
|
546
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
547
|
-
|
|
585
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
586
|
+
import_react_native10.Pressable,
|
|
548
587
|
{
|
|
549
588
|
onPress: onDismiss,
|
|
550
589
|
style: styles7.dismiss,
|
|
551
590
|
accessibilityLabel: "Dismiss alert",
|
|
552
591
|
accessibilityRole: "button",
|
|
553
592
|
hitSlop: 8,
|
|
554
|
-
children: /* @__PURE__ */ (0,
|
|
593
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScaledText, { style: { color: text, fontSize: 16 }, children: "\u2715" })
|
|
555
594
|
}
|
|
556
595
|
)
|
|
557
596
|
]
|
|
@@ -560,9 +599,9 @@ function Alert({
|
|
|
560
599
|
}
|
|
561
600
|
|
|
562
601
|
// src/components/ui/NotificationBanner/NotificationBanner.tsx
|
|
563
|
-
var
|
|
564
|
-
var
|
|
565
|
-
var styles8 =
|
|
602
|
+
var import_react_native11 = require("react-native");
|
|
603
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
604
|
+
var styles8 = import_react_native11.StyleSheet.create({
|
|
566
605
|
banner: {
|
|
567
606
|
flexDirection: "row",
|
|
568
607
|
alignItems: "center",
|
|
@@ -600,24 +639,24 @@ function NotificationBanner({
|
|
|
600
639
|
};
|
|
601
640
|
const { bg, text, border: borderColor } = variantColors[variant];
|
|
602
641
|
const resolvedChildren = typeof children === "function" ? children({ color: text }) : children;
|
|
603
|
-
return /* @__PURE__ */ (0,
|
|
604
|
-
|
|
642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
643
|
+
import_react_native11.View,
|
|
605
644
|
{
|
|
606
645
|
accessibilityRole: isUrgent ? "alert" : "none",
|
|
607
646
|
accessibilityLiveRegion: isUrgent ? "assertive" : "polite",
|
|
608
647
|
style: [styles8.banner, { backgroundColor: bg, borderBottomWidth: 3, borderBottomColor: borderColor }, style],
|
|
609
648
|
children: [
|
|
610
|
-
/* @__PURE__ */ (0,
|
|
649
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native11.View, { style: styles8.body, children: typeof resolvedChildren === "string" || typeof resolvedChildren === "number" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ScaledText, { style: [styles8.content, { color: text }], children: resolvedChildren }) : resolvedChildren }),
|
|
611
650
|
action,
|
|
612
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
613
|
-
|
|
651
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
652
|
+
import_react_native11.Pressable,
|
|
614
653
|
{
|
|
615
654
|
onPress: onDismiss,
|
|
616
655
|
style: styles8.dismiss,
|
|
617
656
|
accessibilityLabel: "Dismiss notification",
|
|
618
657
|
accessibilityRole: "button",
|
|
619
658
|
hitSlop: 8,
|
|
620
|
-
children: /* @__PURE__ */ (0,
|
|
659
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ScaledText, { style: { color: text, fontSize: 16 }, children: "\u2715" })
|
|
621
660
|
}
|
|
622
661
|
)
|
|
623
662
|
]
|
|
@@ -626,9 +665,9 @@ function NotificationBanner({
|
|
|
626
665
|
}
|
|
627
666
|
|
|
628
667
|
// src/components/ui/Link/Link.tsx
|
|
629
|
-
var
|
|
630
|
-
var
|
|
631
|
-
var styles9 =
|
|
668
|
+
var import_react_native12 = require("react-native");
|
|
669
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
670
|
+
var styles9 = import_react_native12.StyleSheet.create({
|
|
632
671
|
text: {
|
|
633
672
|
fontSize: import_native.font.size.body,
|
|
634
673
|
fontFamily: import_native.font.family.body,
|
|
@@ -644,25 +683,25 @@ function Link({ href, children, accessibilityLabel, style, onPress }) {
|
|
|
644
683
|
if (onPress) {
|
|
645
684
|
onPress();
|
|
646
685
|
} else if (href) {
|
|
647
|
-
|
|
686
|
+
import_react_native12.Linking.openURL(href);
|
|
648
687
|
}
|
|
649
688
|
};
|
|
650
|
-
return /* @__PURE__ */ (0,
|
|
651
|
-
|
|
689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
690
|
+
import_react_native12.Pressable,
|
|
652
691
|
{
|
|
653
692
|
onPress: handlePress,
|
|
654
693
|
accessibilityRole: "link",
|
|
655
694
|
accessibilityLabel,
|
|
656
695
|
style: ({ pressed }) => pressed && styles9.pressed,
|
|
657
|
-
children: /* @__PURE__ */ (0,
|
|
696
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScaledText, { style: [styles9.text, { color: colors2.colorInteractiveOnBg }, style], children })
|
|
658
697
|
}
|
|
659
698
|
);
|
|
660
699
|
}
|
|
661
700
|
|
|
662
701
|
// src/components/ui/DescriptionList/DescriptionList.tsx
|
|
663
|
-
var
|
|
664
|
-
var
|
|
665
|
-
var styles10 =
|
|
702
|
+
var import_react_native13 = require("react-native");
|
|
703
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
704
|
+
var styles10 = import_react_native13.StyleSheet.create({
|
|
666
705
|
list: {
|
|
667
706
|
gap: import_native.spacing.m
|
|
668
707
|
},
|
|
@@ -684,16 +723,16 @@ var styles10 = import_react_native12.StyleSheet.create({
|
|
|
684
723
|
});
|
|
685
724
|
function DescriptionList({ items, style }) {
|
|
686
725
|
const { colors: colors2 } = useTheme();
|
|
687
|
-
return /* @__PURE__ */ (0,
|
|
688
|
-
/* @__PURE__ */ (0,
|
|
689
|
-
typeof item.description === "string" ? /* @__PURE__ */ (0,
|
|
726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native13.View, { style: [styles10.list, style], accessibilityRole: "list", children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native13.View, { style: styles10.group, accessibilityRole: "listitem", children: [
|
|
727
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ScaledText, { style: [styles10.term, { color: colors2.colorOnBgSubtle }], children: item.term }),
|
|
728
|
+
typeof item.description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ScaledText, { style: [styles10.description, { color: colors2.colorOnBg }], children: item.description }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native13.View, { children: item.description })
|
|
690
729
|
] }, i)) });
|
|
691
730
|
}
|
|
692
731
|
|
|
693
732
|
// src/components/ui/Breadcrumb/Breadcrumb.tsx
|
|
694
|
-
var
|
|
695
|
-
var
|
|
696
|
-
var styles11 =
|
|
733
|
+
var import_react_native14 = require("react-native");
|
|
734
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
735
|
+
var styles11 = import_react_native14.StyleSheet.create({
|
|
697
736
|
container: {
|
|
698
737
|
flexDirection: "row",
|
|
699
738
|
flexWrap: "wrap",
|
|
@@ -716,33 +755,33 @@ var styles11 = import_react_native13.StyleSheet.create({
|
|
|
716
755
|
});
|
|
717
756
|
function Breadcrumb({ items, style }) {
|
|
718
757
|
const { colors: colors2 } = useTheme();
|
|
719
|
-
return /* @__PURE__ */ (0,
|
|
720
|
-
|
|
758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
759
|
+
import_react_native14.View,
|
|
721
760
|
{
|
|
722
761
|
style: [styles11.container, style],
|
|
723
762
|
accessibilityRole: "navigation",
|
|
724
763
|
accessibilityLabel: "Breadcrumb",
|
|
725
764
|
children: items.map((item, index) => {
|
|
726
765
|
const isLast = index === items.length - 1;
|
|
727
|
-
return /* @__PURE__ */ (0,
|
|
728
|
-
|
|
766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native14.View, { style: { flexDirection: "row", alignItems: "center", minHeight: 44 }, children: isLast ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
767
|
+
ScaledText,
|
|
729
768
|
{
|
|
730
769
|
style: [styles11.itemText, { color: colors2.colorOnBg }],
|
|
731
770
|
accessibilityRole: "text",
|
|
732
771
|
children: item.label
|
|
733
772
|
}
|
|
734
|
-
) : /* @__PURE__ */ (0,
|
|
735
|
-
/* @__PURE__ */ (0,
|
|
736
|
-
|
|
773
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
774
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
775
|
+
import_react_native14.Pressable,
|
|
737
776
|
{
|
|
738
777
|
onPress: item.onPress,
|
|
739
778
|
accessibilityRole: "link",
|
|
740
779
|
style: ({ pressed }) => pressed && styles11.pressed,
|
|
741
|
-
children: /* @__PURE__ */ (0,
|
|
780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ScaledText, { style: [styles11.itemText, { color: colors2.colorInteractiveOnBg }], children: item.label })
|
|
742
781
|
}
|
|
743
782
|
),
|
|
744
|
-
/* @__PURE__ */ (0,
|
|
745
|
-
|
|
783
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
784
|
+
ScaledText,
|
|
746
785
|
{
|
|
747
786
|
style: [styles11.separator, { color: colors2.colorOnBgSubtle }],
|
|
748
787
|
importantForAccessibility: "no",
|
|
@@ -757,8 +796,8 @@ function Breadcrumb({ items, style }) {
|
|
|
757
796
|
}
|
|
758
797
|
|
|
759
798
|
// src/components/ui/ProgressCircle/ProgressCircle.tsx
|
|
760
|
-
var
|
|
761
|
-
var
|
|
799
|
+
var import_react_native15 = require("react-native");
|
|
800
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
762
801
|
var SIZE_PX = {
|
|
763
802
|
small: 40,
|
|
764
803
|
medium: 64,
|
|
@@ -774,7 +813,7 @@ var FONT_SIZE = {
|
|
|
774
813
|
medium: import_native.font.size.bodyS,
|
|
775
814
|
large: import_native.font.size.body
|
|
776
815
|
};
|
|
777
|
-
var styles12 =
|
|
816
|
+
var styles12 = import_react_native15.StyleSheet.create({
|
|
778
817
|
wrapper: {
|
|
779
818
|
alignItems: "center",
|
|
780
819
|
justifyContent: "center"
|
|
@@ -791,16 +830,16 @@ function HalfCircle({
|
|
|
791
830
|
color,
|
|
792
831
|
rotation
|
|
793
832
|
}) {
|
|
794
|
-
return /* @__PURE__ */ (0,
|
|
795
|
-
|
|
833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
834
|
+
import_react_native15.View,
|
|
796
835
|
{
|
|
797
836
|
style: {
|
|
798
837
|
width: size / 2,
|
|
799
838
|
height: size,
|
|
800
839
|
overflow: "hidden"
|
|
801
840
|
},
|
|
802
|
-
children: /* @__PURE__ */ (0,
|
|
803
|
-
|
|
841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
842
|
+
import_react_native15.View,
|
|
804
843
|
{
|
|
805
844
|
style: {
|
|
806
845
|
width: size,
|
|
@@ -830,8 +869,8 @@ function ProgressCircle({
|
|
|
830
869
|
const fillColor = colors2.colorInteractive;
|
|
831
870
|
const trackColor = colors2.colorBgSubtle;
|
|
832
871
|
const degrees = percentage / 100 * 360;
|
|
833
|
-
return /* @__PURE__ */ (0,
|
|
834
|
-
|
|
872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
873
|
+
import_react_native15.View,
|
|
835
874
|
{
|
|
836
875
|
style: [
|
|
837
876
|
styles12.wrapper,
|
|
@@ -842,8 +881,8 @@ function ProgressCircle({
|
|
|
842
881
|
accessibilityLabel: label,
|
|
843
882
|
accessibilityValue: { min: 0, max, now: value },
|
|
844
883
|
children: [
|
|
845
|
-
/* @__PURE__ */ (0,
|
|
846
|
-
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
885
|
+
import_react_native15.View,
|
|
847
886
|
{
|
|
848
887
|
style: {
|
|
849
888
|
position: "absolute",
|
|
@@ -855,8 +894,8 @@ function ProgressCircle({
|
|
|
855
894
|
}
|
|
856
895
|
}
|
|
857
896
|
),
|
|
858
|
-
/* @__PURE__ */ (0,
|
|
859
|
-
|
|
897
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
898
|
+
import_react_native15.View,
|
|
860
899
|
{
|
|
861
900
|
style: {
|
|
862
901
|
position: "absolute",
|
|
@@ -865,7 +904,7 @@ function ProgressCircle({
|
|
|
865
904
|
start: px / 2,
|
|
866
905
|
overflow: "hidden"
|
|
867
906
|
},
|
|
868
|
-
children: /* @__PURE__ */ (0,
|
|
907
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
869
908
|
HalfCircle,
|
|
870
909
|
{
|
|
871
910
|
size: px,
|
|
@@ -876,8 +915,8 @@ function ProgressCircle({
|
|
|
876
915
|
)
|
|
877
916
|
}
|
|
878
917
|
),
|
|
879
|
-
degrees > 180 && /* @__PURE__ */ (0,
|
|
880
|
-
|
|
918
|
+
degrees > 180 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
919
|
+
import_react_native15.View,
|
|
881
920
|
{
|
|
882
921
|
style: {
|
|
883
922
|
position: "absolute",
|
|
@@ -886,14 +925,14 @@ function ProgressCircle({
|
|
|
886
925
|
start: 0,
|
|
887
926
|
overflow: "hidden"
|
|
888
927
|
},
|
|
889
|
-
children: /* @__PURE__ */ (0,
|
|
890
|
-
|
|
928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
929
|
+
import_react_native15.View,
|
|
891
930
|
{
|
|
892
931
|
style: {
|
|
893
932
|
position: "absolute",
|
|
894
933
|
end: 0
|
|
895
934
|
},
|
|
896
|
-
children: /* @__PURE__ */ (0,
|
|
935
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
897
936
|
HalfCircle,
|
|
898
937
|
{
|
|
899
938
|
size: px,
|
|
@@ -906,8 +945,8 @@ function ProgressCircle({
|
|
|
906
945
|
)
|
|
907
946
|
}
|
|
908
947
|
),
|
|
909
|
-
showValue && /* @__PURE__ */ (0,
|
|
910
|
-
|
|
948
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
949
|
+
ScaledText,
|
|
911
950
|
{
|
|
912
951
|
style: [styles12.valueText, { fontSize: FONT_SIZE[size], color: colors2.colorOnBg }],
|
|
913
952
|
importantForAccessibility: "no",
|
|
@@ -924,10 +963,10 @@ function ProgressCircle({
|
|
|
924
963
|
}
|
|
925
964
|
|
|
926
965
|
// src/components/ui/Tooltip/Tooltip.tsx
|
|
927
|
-
var
|
|
928
|
-
var
|
|
929
|
-
var
|
|
930
|
-
var styles13 =
|
|
966
|
+
var import_react4 = require("react");
|
|
967
|
+
var import_react_native16 = require("react-native");
|
|
968
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
969
|
+
var styles13 = import_react_native16.StyleSheet.create({
|
|
931
970
|
wrapper: {
|
|
932
971
|
position: "relative"
|
|
933
972
|
},
|
|
@@ -949,10 +988,10 @@ var styles13 = import_react_native15.StyleSheet.create({
|
|
|
949
988
|
});
|
|
950
989
|
function Tooltip({ content, children, style }) {
|
|
951
990
|
const { colors: colors2 } = useTheme();
|
|
952
|
-
const [visible, setVisible] = (0,
|
|
953
|
-
return /* @__PURE__ */ (0,
|
|
954
|
-
/* @__PURE__ */ (0,
|
|
955
|
-
|
|
991
|
+
const [visible, setVisible] = (0, import_react4.useState)(false);
|
|
992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native16.View, { style: [styles13.wrapper, style], children: [
|
|
993
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
994
|
+
import_react_native16.Pressable,
|
|
956
995
|
{
|
|
957
996
|
onLongPress: () => setVisible(true),
|
|
958
997
|
onPressOut: () => setVisible(false),
|
|
@@ -960,21 +999,21 @@ function Tooltip({ content, children, style }) {
|
|
|
960
999
|
children
|
|
961
1000
|
}
|
|
962
1001
|
),
|
|
963
|
-
visible && /* @__PURE__ */ (0,
|
|
964
|
-
|
|
1002
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1003
|
+
import_react_native16.View,
|
|
965
1004
|
{
|
|
966
1005
|
style: [styles13.tooltip, { backgroundColor: colors2.colorOnBg }],
|
|
967
1006
|
accessibilityRole: "text",
|
|
968
1007
|
accessibilityLabel: content,
|
|
969
|
-
children: /* @__PURE__ */ (0,
|
|
1008
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ScaledText, { style: [styles13.text, { color: colors2.colorBg }], children: content })
|
|
970
1009
|
}
|
|
971
1010
|
)
|
|
972
1011
|
] });
|
|
973
1012
|
}
|
|
974
1013
|
|
|
975
1014
|
// src/components/ui/Pagination/Pagination.tsx
|
|
976
|
-
var
|
|
977
|
-
var
|
|
1015
|
+
var import_react_native17 = require("react-native");
|
|
1016
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
978
1017
|
function getPageRange(current, total) {
|
|
979
1018
|
const delta = 1;
|
|
980
1019
|
const range = [];
|
|
@@ -987,7 +1026,7 @@ function getPageRange(current, total) {
|
|
|
987
1026
|
}
|
|
988
1027
|
return range;
|
|
989
1028
|
}
|
|
990
|
-
var styles14 =
|
|
1029
|
+
var styles14 = import_react_native17.StyleSheet.create({
|
|
991
1030
|
container: {
|
|
992
1031
|
flexDirection: "row",
|
|
993
1032
|
alignItems: "center",
|
|
@@ -1038,15 +1077,15 @@ function Pagination({
|
|
|
1038
1077
|
}) {
|
|
1039
1078
|
const { colors: colors2 } = useTheme();
|
|
1040
1079
|
const pages = getPageRange(currentPage, totalPages);
|
|
1041
|
-
return /* @__PURE__ */ (0,
|
|
1042
|
-
|
|
1080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1081
|
+
import_react_native17.View,
|
|
1043
1082
|
{
|
|
1044
1083
|
style: [styles14.container, style],
|
|
1045
1084
|
accessibilityRole: "navigation",
|
|
1046
1085
|
accessibilityLabel: "Pagination",
|
|
1047
1086
|
children: [
|
|
1048
|
-
/* @__PURE__ */ (0,
|
|
1049
|
-
|
|
1087
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1088
|
+
import_react_native17.Pressable,
|
|
1050
1089
|
{
|
|
1051
1090
|
onPress: () => onPageChange(currentPage - 1),
|
|
1052
1091
|
disabled: currentPage <= 1,
|
|
@@ -1058,12 +1097,12 @@ function Pagination({
|
|
|
1058
1097
|
currentPage <= 1 && styles14.disabled,
|
|
1059
1098
|
pressed && !currentPage && styles14.pressed
|
|
1060
1099
|
],
|
|
1061
|
-
children: /* @__PURE__ */ (0,
|
|
1100
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ScaledText, { style: [styles14.navText, { color: colors2.colorOnBg }], children: "\u2039" })
|
|
1062
1101
|
}
|
|
1063
1102
|
),
|
|
1064
1103
|
pages.map(
|
|
1065
|
-
(page, index) => page === "..." ? /* @__PURE__ */ (0,
|
|
1066
|
-
|
|
1104
|
+
(page, index) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1105
|
+
ScaledText,
|
|
1067
1106
|
{
|
|
1068
1107
|
style: [styles14.ellipsis, { color: colors2.colorOnBgSubtle }],
|
|
1069
1108
|
importantForAccessibility: "no",
|
|
@@ -1071,8 +1110,8 @@ function Pagination({
|
|
|
1071
1110
|
children: "..."
|
|
1072
1111
|
},
|
|
1073
1112
|
`ellipsis-${index}`
|
|
1074
|
-
) : /* @__PURE__ */ (0,
|
|
1075
|
-
|
|
1113
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1114
|
+
import_react_native17.Pressable,
|
|
1076
1115
|
{
|
|
1077
1116
|
onPress: () => onPageChange(page),
|
|
1078
1117
|
accessibilityRole: "button",
|
|
@@ -1083,8 +1122,8 @@ function Pagination({
|
|
|
1083
1122
|
currentPage === page && { backgroundColor: colors2.colorInteractive },
|
|
1084
1123
|
pressed && styles14.pressed
|
|
1085
1124
|
],
|
|
1086
|
-
children: /* @__PURE__ */ (0,
|
|
1087
|
-
|
|
1125
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1126
|
+
ScaledText,
|
|
1088
1127
|
{
|
|
1089
1128
|
style: [
|
|
1090
1129
|
styles14.buttonText,
|
|
@@ -1100,8 +1139,8 @@ function Pagination({
|
|
|
1100
1139
|
page
|
|
1101
1140
|
)
|
|
1102
1141
|
),
|
|
1103
|
-
/* @__PURE__ */ (0,
|
|
1104
|
-
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1143
|
+
import_react_native17.Pressable,
|
|
1105
1144
|
{
|
|
1106
1145
|
onPress: () => onPageChange(currentPage + 1),
|
|
1107
1146
|
disabled: currentPage >= totalPages,
|
|
@@ -1113,7 +1152,7 @@ function Pagination({
|
|
|
1113
1152
|
currentPage >= totalPages && styles14.disabled,
|
|
1114
1153
|
pressed && styles14.pressed
|
|
1115
1154
|
],
|
|
1116
|
-
children: /* @__PURE__ */ (0,
|
|
1155
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ScaledText, { style: [styles14.navText, { color: colors2.colorOnBg }], children: "\u203A" })
|
|
1117
1156
|
}
|
|
1118
1157
|
)
|
|
1119
1158
|
]
|
|
@@ -1122,13 +1161,51 @@ function Pagination({
|
|
|
1122
1161
|
}
|
|
1123
1162
|
|
|
1124
1163
|
// src/components/ui/Collapsible/Collapsible.tsx
|
|
1125
|
-
var
|
|
1126
|
-
var
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1164
|
+
var import_react5 = require("react");
|
|
1165
|
+
var import_react_native19 = require("react-native");
|
|
1166
|
+
|
|
1167
|
+
// src/native/Chevron.tsx
|
|
1168
|
+
var import_react_native18 = require("react-native");
|
|
1169
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1170
|
+
var SIZE = 8;
|
|
1171
|
+
var STROKE = 1.5;
|
|
1172
|
+
var CENTRE_SHIFT = -(SIZE - STROKE) / 4;
|
|
1173
|
+
var styles15 = import_react_native18.StyleSheet.create({
|
|
1174
|
+
chevron: {
|
|
1175
|
+
// Border-box chevron (no glyph font dependency): a small square with two
|
|
1176
|
+
// adjacent borders, rotated to form a crisp "›" / "⌄" indicator.
|
|
1177
|
+
width: SIZE,
|
|
1178
|
+
height: SIZE,
|
|
1179
|
+
borderRightWidth: STROKE,
|
|
1180
|
+
borderBottomWidth: STROKE
|
|
1181
|
+
}
|
|
1182
|
+
});
|
|
1183
|
+
function Chevron({ color, rotate = "45deg", testID, style }) {
|
|
1184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1185
|
+
import_react_native18.Animated.View,
|
|
1186
|
+
{
|
|
1187
|
+
testID,
|
|
1188
|
+
style: [
|
|
1189
|
+
styles15.chevron,
|
|
1190
|
+
{
|
|
1191
|
+
borderColor: color,
|
|
1192
|
+
transform: [{ rotate }, { translateX: CENTRE_SHIFT }, { translateY: CENTRE_SHIFT }]
|
|
1193
|
+
},
|
|
1194
|
+
style
|
|
1195
|
+
],
|
|
1196
|
+
"aria-hidden": true,
|
|
1197
|
+
importantForAccessibility: "no-hide-descendants",
|
|
1198
|
+
accessibilityElementsHidden: true
|
|
1199
|
+
}
|
|
1200
|
+
);
|
|
1130
1201
|
}
|
|
1131
|
-
|
|
1202
|
+
|
|
1203
|
+
// src/components/ui/Collapsible/Collapsible.tsx
|
|
1204
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1205
|
+
if (import_react_native19.Platform.OS === "android" && import_react_native19.UIManager.setLayoutAnimationEnabledExperimental) {
|
|
1206
|
+
import_react_native19.UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
1207
|
+
}
|
|
1208
|
+
var styles16 = import_react_native19.StyleSheet.create({
|
|
1132
1209
|
container: {
|
|
1133
1210
|
borderRadius: import_native.border.radius.m,
|
|
1134
1211
|
overflow: "hidden"
|
|
@@ -1149,12 +1226,6 @@ var styles15 = import_react_native17.StyleSheet.create({
|
|
|
1149
1226
|
lineHeight: lineHeight.body
|
|
1150
1227
|
},
|
|
1151
1228
|
chevron: {
|
|
1152
|
-
// Border-box chevron (no glyph font dependency): a small square with two
|
|
1153
|
-
// adjacent borders, rotated to form a crisp "›" / "⌄" disclosure indicator.
|
|
1154
|
-
width: 8,
|
|
1155
|
-
height: 8,
|
|
1156
|
-
borderRightWidth: 2,
|
|
1157
|
-
borderBottomWidth: 2,
|
|
1158
1229
|
marginStart: import_native.spacing.xs
|
|
1159
1230
|
},
|
|
1160
1231
|
content: {
|
|
@@ -1176,14 +1247,14 @@ function Collapsible({
|
|
|
1176
1247
|
style
|
|
1177
1248
|
}) {
|
|
1178
1249
|
const { colors: colors2 } = useTheme();
|
|
1179
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
1250
|
+
const [internalOpen, setInternalOpen] = (0, import_react5.useState)(defaultOpen);
|
|
1180
1251
|
const isControlled = controlledOpen !== void 0;
|
|
1181
1252
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
1182
|
-
const rotation = (0,
|
|
1183
|
-
const toggle = (0,
|
|
1253
|
+
const rotation = (0, import_react5.useRef)(new import_react_native19.Animated.Value(isOpen ? 1 : 0)).current;
|
|
1254
|
+
const toggle = (0, import_react5.useCallback)(() => {
|
|
1184
1255
|
const next = !isOpen;
|
|
1185
|
-
|
|
1186
|
-
|
|
1256
|
+
import_react_native19.LayoutAnimation.configureNext(import_react_native19.LayoutAnimation.Presets.easeInEaseOut);
|
|
1257
|
+
import_react_native19.Animated.timing(rotation, {
|
|
1187
1258
|
toValue: next ? 1 : 0,
|
|
1188
1259
|
duration: 200,
|
|
1189
1260
|
useNativeDriver: true
|
|
@@ -1197,48 +1268,48 @@ function Collapsible({
|
|
|
1197
1268
|
inputRange: [0, 1],
|
|
1198
1269
|
outputRange: ["-45deg", "45deg"]
|
|
1199
1270
|
});
|
|
1200
|
-
return /* @__PURE__ */ (0,
|
|
1201
|
-
|
|
1271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1272
|
+
import_react_native19.View,
|
|
1202
1273
|
{
|
|
1203
|
-
style: [
|
|
1274
|
+
style: [styles16.container, { borderBottomWidth: 1, borderBottomColor: colors2.colorBgSubtle }, style],
|
|
1204
1275
|
accessibilityRole: "summary",
|
|
1205
1276
|
children: [
|
|
1206
|
-
/* @__PURE__ */ (0,
|
|
1207
|
-
|
|
1277
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1278
|
+
import_react_native19.Pressable,
|
|
1208
1279
|
{
|
|
1209
1280
|
onPress: toggle,
|
|
1210
1281
|
accessibilityRole: "button",
|
|
1211
1282
|
accessibilityLabel: summary,
|
|
1212
1283
|
accessibilityState: { expanded: isOpen },
|
|
1213
|
-
style: ({ pressed }) => [
|
|
1284
|
+
style: ({ pressed }) => [styles16.header, pressed && styles16.pressed],
|
|
1214
1285
|
children: [
|
|
1215
|
-
/* @__PURE__ */ (0,
|
|
1216
|
-
/* @__PURE__ */ (0,
|
|
1217
|
-
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ScaledText, { style: [styles16.summaryText, { color: colors2.colorOnBg }], children: summary }),
|
|
1287
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1288
|
+
Chevron,
|
|
1218
1289
|
{
|
|
1219
1290
|
testID: "bds-collapsible-chevron",
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1291
|
+
color: colors2.colorOnBgSubtle,
|
|
1292
|
+
rotate,
|
|
1293
|
+
style: styles16.chevron
|
|
1223
1294
|
}
|
|
1224
1295
|
)
|
|
1225
1296
|
]
|
|
1226
1297
|
}
|
|
1227
1298
|
),
|
|
1228
|
-
isOpen && /* @__PURE__ */ (0,
|
|
1299
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native19.View, { style: styles16.content, children })
|
|
1229
1300
|
]
|
|
1230
1301
|
}
|
|
1231
1302
|
);
|
|
1232
1303
|
}
|
|
1233
1304
|
|
|
1234
1305
|
// src/components/ui/Accordion/Accordion.tsx
|
|
1235
|
-
var
|
|
1236
|
-
var
|
|
1237
|
-
var
|
|
1238
|
-
if (
|
|
1239
|
-
|
|
1306
|
+
var import_react6 = require("react");
|
|
1307
|
+
var import_react_native20 = require("react-native");
|
|
1308
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1309
|
+
if (import_react_native20.Platform.OS === "android" && import_react_native20.UIManager.setLayoutAnimationEnabledExperimental) {
|
|
1310
|
+
import_react_native20.UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
1240
1311
|
}
|
|
1241
|
-
var
|
|
1312
|
+
var styles17 = import_react_native20.StyleSheet.create({
|
|
1242
1313
|
container: {
|
|
1243
1314
|
overflow: "hidden",
|
|
1244
1315
|
borderRadius: import_native.border.radius.s
|
|
@@ -1283,45 +1354,45 @@ function Accordion({
|
|
|
1283
1354
|
style
|
|
1284
1355
|
}) {
|
|
1285
1356
|
const { colors: colors2 } = useTheme();
|
|
1286
|
-
const [openIds, setOpenIds] = (0,
|
|
1357
|
+
const [openIds, setOpenIds] = (0, import_react6.useState)(defaultOpen);
|
|
1287
1358
|
const toggle = (id) => {
|
|
1288
|
-
|
|
1359
|
+
import_react_native20.LayoutAnimation.configureNext(import_react_native20.LayoutAnimation.Presets.easeInEaseOut);
|
|
1289
1360
|
setOpenIds((prev) => {
|
|
1290
1361
|
const isOpen = prev.includes(id);
|
|
1291
1362
|
if (isOpen) return prev.filter((i) => i !== id);
|
|
1292
1363
|
return allowMultiple ? [...prev, id] : [id];
|
|
1293
1364
|
});
|
|
1294
1365
|
};
|
|
1295
|
-
return /* @__PURE__ */ (0,
|
|
1366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native20.View, { style: [styles17.container, style], children: items.map((item, index) => {
|
|
1296
1367
|
const isOpen = openIds.includes(item.id);
|
|
1297
1368
|
const isLast = index === items.length - 1;
|
|
1298
|
-
return /* @__PURE__ */ (0,
|
|
1299
|
-
|
|
1369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1370
|
+
import_react_native20.View,
|
|
1300
1371
|
{
|
|
1301
1372
|
style: [
|
|
1302
|
-
|
|
1373
|
+
styles17.item,
|
|
1303
1374
|
{ borderBottomColor: colors2.colorBgSubtle },
|
|
1304
1375
|
isLast && { borderBottomWidth: 0 }
|
|
1305
1376
|
],
|
|
1306
1377
|
children: [
|
|
1307
|
-
/* @__PURE__ */ (0,
|
|
1308
|
-
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1379
|
+
import_react_native20.Pressable,
|
|
1309
1380
|
{
|
|
1310
1381
|
onPress: () => toggle(item.id),
|
|
1311
1382
|
disabled: item.disabled,
|
|
1312
1383
|
accessibilityRole: "button",
|
|
1313
1384
|
accessibilityState: { expanded: isOpen, disabled: item.disabled },
|
|
1314
1385
|
style: ({ pressed }) => [
|
|
1315
|
-
|
|
1316
|
-
item.disabled &&
|
|
1317
|
-
pressed && !item.disabled &&
|
|
1386
|
+
styles17.header,
|
|
1387
|
+
item.disabled && styles17.disabled,
|
|
1388
|
+
pressed && !item.disabled && styles17.pressed
|
|
1318
1389
|
],
|
|
1319
1390
|
children: [
|
|
1320
|
-
/* @__PURE__ */ (0,
|
|
1321
|
-
/* @__PURE__ */ (0,
|
|
1322
|
-
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ScaledText, { style: [styles17.titleText, { color: colors2.colorOnBg }], children: typeof item.title === "string" ? item.title : item.title }),
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1393
|
+
ScaledText,
|
|
1323
1394
|
{
|
|
1324
|
-
style: [
|
|
1395
|
+
style: [styles17.chevron, { color: colors2.colorOnBgSubtle }],
|
|
1325
1396
|
importantForAccessibility: "no",
|
|
1326
1397
|
accessibilityElementsHidden: true,
|
|
1327
1398
|
children: isOpen ? "\u25BE" : "\u25B8"
|
|
@@ -1330,7 +1401,7 @@ function Accordion({
|
|
|
1330
1401
|
]
|
|
1331
1402
|
}
|
|
1332
1403
|
),
|
|
1333
|
-
isOpen && /* @__PURE__ */ (0,
|
|
1404
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native20.View, { style: styles17.panel, accessibilityRole: "summary", children: item.content })
|
|
1334
1405
|
]
|
|
1335
1406
|
},
|
|
1336
1407
|
item.id
|
|
@@ -1339,10 +1410,10 @@ function Accordion({
|
|
|
1339
1410
|
}
|
|
1340
1411
|
|
|
1341
1412
|
// src/components/ui/Tabs/Tabs.tsx
|
|
1342
|
-
var
|
|
1343
|
-
var
|
|
1344
|
-
var
|
|
1345
|
-
var
|
|
1413
|
+
var import_react7 = require("react");
|
|
1414
|
+
var import_react_native21 = require("react-native");
|
|
1415
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1416
|
+
var styles18 = import_react_native21.StyleSheet.create({
|
|
1346
1417
|
container: {
|
|
1347
1418
|
overflow: "hidden"
|
|
1348
1419
|
},
|
|
@@ -1380,19 +1451,19 @@ function Tabs({
|
|
|
1380
1451
|
style
|
|
1381
1452
|
}) {
|
|
1382
1453
|
const { colors: colors2 } = useTheme();
|
|
1383
|
-
const [activeTab, setActiveTab] = (0,
|
|
1384
|
-
return /* @__PURE__ */ (0,
|
|
1385
|
-
/* @__PURE__ */ (0,
|
|
1386
|
-
|
|
1454
|
+
const [activeTab, setActiveTab] = (0, import_react7.useState)(defaultTab ?? tabs[0]?.id);
|
|
1455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native21.View, { style: [styles18.container, style], children: [
|
|
1456
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1457
|
+
import_react_native21.ScrollView,
|
|
1387
1458
|
{
|
|
1388
1459
|
horizontal: true,
|
|
1389
1460
|
showsHorizontalScrollIndicator: false,
|
|
1390
|
-
contentContainerStyle: [
|
|
1461
|
+
contentContainerStyle: [styles18.tabList, { borderBottomColor: colors2.colorBgSubtle }],
|
|
1391
1462
|
accessibilityRole: "tabbar",
|
|
1392
1463
|
children: tabs.map((tab) => {
|
|
1393
1464
|
const isActive = activeTab === tab.id;
|
|
1394
|
-
return /* @__PURE__ */ (0,
|
|
1395
|
-
|
|
1465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1466
|
+
import_react_native21.Pressable,
|
|
1396
1467
|
{
|
|
1397
1468
|
onPress: () => setActiveTab(tab.id),
|
|
1398
1469
|
disabled: tab.disabled,
|
|
@@ -1403,18 +1474,18 @@ function Tabs({
|
|
|
1403
1474
|
},
|
|
1404
1475
|
accessibilityLabel: typeof tab.label === "string" ? tab.label : void 0,
|
|
1405
1476
|
style: ({ pressed }) => [
|
|
1406
|
-
|
|
1477
|
+
styles18.tabButton,
|
|
1407
1478
|
{
|
|
1408
1479
|
borderBottomColor: isActive ? colors2.colorInteractive : "transparent"
|
|
1409
1480
|
},
|
|
1410
|
-
tab.disabled &&
|
|
1411
|
-
pressed && !tab.disabled &&
|
|
1481
|
+
tab.disabled && styles18.disabled,
|
|
1482
|
+
pressed && !tab.disabled && styles18.pressed
|
|
1412
1483
|
],
|
|
1413
|
-
children: /* @__PURE__ */ (0,
|
|
1414
|
-
|
|
1484
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1485
|
+
ScaledText,
|
|
1415
1486
|
{
|
|
1416
1487
|
style: [
|
|
1417
|
-
|
|
1488
|
+
styles18.tabLabel,
|
|
1418
1489
|
{
|
|
1419
1490
|
color: isActive ? colors2.colorInteractive : colors2.colorOnBgSubtle,
|
|
1420
1491
|
fontWeight: isActive ? import_native.font.weight.semibold : import_native.font.weight.body
|
|
@@ -1432,15 +1503,15 @@ function Tabs({
|
|
|
1432
1503
|
tabs.map((tab) => {
|
|
1433
1504
|
const isActive = activeTab === tab.id;
|
|
1434
1505
|
if (!isActive) return null;
|
|
1435
|
-
return /* @__PURE__ */ (0,
|
|
1506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native21.View, { style: styles18.panel, accessibilityRole: "tabpanel", children: tab.content }, tab.id);
|
|
1436
1507
|
})
|
|
1437
1508
|
] });
|
|
1438
1509
|
}
|
|
1439
1510
|
|
|
1440
1511
|
// src/components/ui/Table/Table.tsx
|
|
1441
|
-
var
|
|
1442
|
-
var
|
|
1443
|
-
var
|
|
1512
|
+
var import_react_native22 = require("react-native");
|
|
1513
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1514
|
+
var styles19 = import_react_native22.StyleSheet.create({
|
|
1444
1515
|
wrapper: {
|
|
1445
1516
|
borderRadius: import_native.border.radius.s,
|
|
1446
1517
|
overflow: "hidden"
|
|
@@ -1516,29 +1587,29 @@ function Table({
|
|
|
1516
1587
|
if (sortKey !== col.key) return base;
|
|
1517
1588
|
return `${base}, currently ${sortDirection === "asc" ? "ascending" : "descending"}`;
|
|
1518
1589
|
};
|
|
1519
|
-
return /* @__PURE__ */ (0,
|
|
1520
|
-
|
|
1590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1591
|
+
import_react_native22.ScrollView,
|
|
1521
1592
|
{
|
|
1522
1593
|
horizontal: true,
|
|
1523
1594
|
showsHorizontalScrollIndicator: true,
|
|
1524
|
-
style: [
|
|
1525
|
-
children: /* @__PURE__ */ (0,
|
|
1526
|
-
caption && /* @__PURE__ */ (0,
|
|
1527
|
-
/* @__PURE__ */ (0,
|
|
1528
|
-
(col) => col.sortable ? /* @__PURE__ */ (0,
|
|
1529
|
-
|
|
1595
|
+
style: [styles19.wrapper, { backgroundColor: colors2.colorBg }, style],
|
|
1596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react_native22.View, { children: [
|
|
1597
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScaledText, { style: [styles19.caption, { color: colors2.colorOnBgSubtle }], children: caption }),
|
|
1598
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native22.View, { style: [styles19.headerRow, { backgroundColor: colors2.colorBgSubtle }], children: columns.map(
|
|
1599
|
+
(col) => col.sortable ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1600
|
+
import_react_native22.Pressable,
|
|
1530
1601
|
{
|
|
1531
1602
|
onPress: () => handleSort(col.key),
|
|
1532
1603
|
accessibilityRole: "button",
|
|
1533
1604
|
accessibilityLabel: getSortLabel(col),
|
|
1534
|
-
style: ({ pressed }) => [
|
|
1605
|
+
style: ({ pressed }) => [styles19.headerCell, pressed && styles19.pressed],
|
|
1535
1606
|
children: [
|
|
1536
|
-
/* @__PURE__ */ (0,
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1538
|
-
|
|
1607
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScaledText, { style: [styles19.headerText, { color: colors2.colorOnBg }], children: col.header }),
|
|
1608
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1609
|
+
ScaledText,
|
|
1539
1610
|
{
|
|
1540
1611
|
style: [
|
|
1541
|
-
|
|
1612
|
+
styles19.sortIndicator,
|
|
1542
1613
|
{
|
|
1543
1614
|
color: sortKey === col.key ? colors2.colorInteractive : colors2.colorOnBgSubtle
|
|
1544
1615
|
}
|
|
@@ -1551,18 +1622,18 @@ function Table({
|
|
|
1551
1622
|
]
|
|
1552
1623
|
},
|
|
1553
1624
|
col.key
|
|
1554
|
-
) : /* @__PURE__ */ (0,
|
|
1625
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native22.View, { style: styles19.headerCell, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScaledText, { style: [styles19.headerText, { color: colors2.colorOnBg }], children: col.header }) }, col.key)
|
|
1555
1626
|
) }),
|
|
1556
|
-
rows.map((row, rowIndex) => /* @__PURE__ */ (0,
|
|
1557
|
-
|
|
1627
|
+
rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1628
|
+
import_react_native22.View,
|
|
1558
1629
|
{
|
|
1559
1630
|
style: [
|
|
1560
|
-
|
|
1631
|
+
styles19.row,
|
|
1561
1632
|
{ borderTopColor: colors2.colorBgSubtle },
|
|
1562
1633
|
rowIndex % 2 === 1 && { backgroundColor: colors2.colorBgSubtle }
|
|
1563
1634
|
],
|
|
1564
1635
|
accessibilityRole: "none",
|
|
1565
|
-
children: columns.map((col) => /* @__PURE__ */ (0,
|
|
1636
|
+
children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native22.View, { style: styles19.cell, children: col.render ? typeof col.render(row) === "string" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScaledText, { style: [styles19.cellText, { color: colors2.colorOnBg }], children: col.render(row) }) : col.render(row) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScaledText, { style: [styles19.cellText, { color: colors2.colorOnBg }], children: String(row[col.key] ?? "") }) }, col.key))
|
|
1566
1637
|
},
|
|
1567
1638
|
rowIndex
|
|
1568
1639
|
))
|
|
@@ -1572,9 +1643,9 @@ function Table({
|
|
|
1572
1643
|
}
|
|
1573
1644
|
|
|
1574
1645
|
// src/components/ui/Calendar/Calendar.tsx
|
|
1575
|
-
var
|
|
1576
|
-
var
|
|
1577
|
-
var
|
|
1646
|
+
var import_react8 = require("react");
|
|
1647
|
+
var import_react_native23 = require("react-native");
|
|
1648
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1578
1649
|
var DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
1579
1650
|
var DAY_LABELS = {
|
|
1580
1651
|
Su: "Sunday",
|
|
@@ -1617,7 +1688,7 @@ function getFirstDayOfMonth(year, month) {
|
|
|
1617
1688
|
return new Date(year, month, 1).getDay();
|
|
1618
1689
|
}
|
|
1619
1690
|
var DAY_SIZE = 44;
|
|
1620
|
-
var
|
|
1691
|
+
var styles20 = import_react_native23.StyleSheet.create({
|
|
1621
1692
|
container: {
|
|
1622
1693
|
alignSelf: "flex-start"
|
|
1623
1694
|
},
|
|
@@ -1699,12 +1770,12 @@ function Calendar({
|
|
|
1699
1770
|
const { colors: colors2 } = useTheme();
|
|
1700
1771
|
const today = /* @__PURE__ */ new Date();
|
|
1701
1772
|
const controlled = value !== void 0;
|
|
1702
|
-
const [internal, setInternal] = (0,
|
|
1773
|
+
const [internal, setInternal] = (0, import_react8.useState)(defaultValue);
|
|
1703
1774
|
const selected = controlled ? value : internal;
|
|
1704
|
-
const [viewYear, setViewYear] = (0,
|
|
1775
|
+
const [viewYear, setViewYear] = (0, import_react8.useState)(
|
|
1705
1776
|
selected?.getFullYear() ?? today.getFullYear()
|
|
1706
1777
|
);
|
|
1707
|
-
const [viewMonth, setViewMonth] = (0,
|
|
1778
|
+
const [viewMonth, setViewMonth] = (0, import_react8.useState)(
|
|
1708
1779
|
selected?.getMonth() ?? today.getMonth()
|
|
1709
1780
|
);
|
|
1710
1781
|
const daysInMonth = getDaysInMonth(viewYear, viewMonth);
|
|
@@ -1729,28 +1800,28 @@ function Calendar({
|
|
|
1729
1800
|
{ length: cells.length / 7 },
|
|
1730
1801
|
(_, i) => cells.slice(i * 7, i * 7 + 7)
|
|
1731
1802
|
);
|
|
1732
|
-
return /* @__PURE__ */ (0,
|
|
1733
|
-
|
|
1803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1804
|
+
import_react_native23.View,
|
|
1734
1805
|
{
|
|
1735
|
-
style: [
|
|
1806
|
+
style: [styles20.container, style],
|
|
1736
1807
|
accessibilityRole: "none",
|
|
1737
1808
|
accessibilityLabel: `${MONTHS[viewMonth]} ${viewYear} calendar`,
|
|
1738
1809
|
children: [
|
|
1739
|
-
/* @__PURE__ */ (0,
|
|
1740
|
-
/* @__PURE__ */ (0,
|
|
1741
|
-
|
|
1810
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_native23.View, { style: styles20.header, children: [
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1812
|
+
import_react_native23.Pressable,
|
|
1742
1813
|
{
|
|
1743
1814
|
onPress: () => navigate(-1),
|
|
1744
1815
|
accessibilityRole: "button",
|
|
1745
1816
|
accessibilityLabel: "Previous month",
|
|
1746
|
-
style: ({ pressed }) => [
|
|
1747
|
-
children: /* @__PURE__ */ (0,
|
|
1817
|
+
style: ({ pressed }) => [styles20.navButton, pressed && styles20.pressed],
|
|
1818
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScaledText, { style: [styles20.navText, { color: colors2.colorOnBg }], children: "\u2039" })
|
|
1748
1819
|
}
|
|
1749
1820
|
),
|
|
1750
|
-
/* @__PURE__ */ (0,
|
|
1751
|
-
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1822
|
+
ScaledText,
|
|
1752
1823
|
{
|
|
1753
|
-
style: [
|
|
1824
|
+
style: [styles20.monthYear, { color: colors2.colorOnBg }],
|
|
1754
1825
|
accessibilityRole: "text",
|
|
1755
1826
|
accessibilityLiveRegion: "polite",
|
|
1756
1827
|
children: [
|
|
@@ -1760,35 +1831,35 @@ function Calendar({
|
|
|
1760
1831
|
]
|
|
1761
1832
|
}
|
|
1762
1833
|
),
|
|
1763
|
-
/* @__PURE__ */ (0,
|
|
1764
|
-
|
|
1834
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1835
|
+
import_react_native23.Pressable,
|
|
1765
1836
|
{
|
|
1766
1837
|
onPress: () => navigate(1),
|
|
1767
1838
|
accessibilityRole: "button",
|
|
1768
1839
|
accessibilityLabel: "Next month",
|
|
1769
|
-
style: ({ pressed }) => [
|
|
1770
|
-
children: /* @__PURE__ */ (0,
|
|
1840
|
+
style: ({ pressed }) => [styles20.navButton, pressed && styles20.pressed],
|
|
1841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScaledText, { style: [styles20.navText, { color: colors2.colorOnBg }], children: "\u203A" })
|
|
1771
1842
|
}
|
|
1772
1843
|
)
|
|
1773
1844
|
] }),
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1775
|
-
|
|
1845
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native23.View, { style: styles20.weekRow, children: DAYS.map((d) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native23.View, { style: styles20.weekday, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1846
|
+
ScaledText,
|
|
1776
1847
|
{
|
|
1777
|
-
style: [
|
|
1848
|
+
style: [styles20.weekdayText, { color: colors2.colorOnBgSubtle }],
|
|
1778
1849
|
accessibilityLabel: DAY_LABELS[d],
|
|
1779
1850
|
children: d
|
|
1780
1851
|
}
|
|
1781
1852
|
) }, d)) }),
|
|
1782
|
-
/* @__PURE__ */ (0,
|
|
1853
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native23.View, { style: styles20.grid, children: rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native23.View, { style: styles20.dayRow, children: row.map((cell, colIndex) => {
|
|
1783
1854
|
if (!cell) {
|
|
1784
|
-
return /* @__PURE__ */ (0,
|
|
1855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native23.View, { style: styles20.dayCell }, colIndex);
|
|
1785
1856
|
}
|
|
1786
1857
|
const date = new Date(viewYear, viewMonth, cell.day);
|
|
1787
1858
|
const isSelected = selected ? isSameDay(date, selected) : false;
|
|
1788
1859
|
const isToday = isSameDay(date, today);
|
|
1789
1860
|
const disabled = isOutOfRange(date, min, max);
|
|
1790
|
-
return /* @__PURE__ */ (0,
|
|
1791
|
-
|
|
1861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1862
|
+
import_react_native23.Pressable,
|
|
1792
1863
|
{
|
|
1793
1864
|
onPress: () => selectDay(cell.day),
|
|
1794
1865
|
disabled,
|
|
@@ -1803,22 +1874,22 @@ function Calendar({
|
|
|
1803
1874
|
disabled
|
|
1804
1875
|
},
|
|
1805
1876
|
style: ({ pressed }) => [
|
|
1806
|
-
|
|
1877
|
+
styles20.dayCell,
|
|
1807
1878
|
isSelected && {
|
|
1808
1879
|
backgroundColor: colors2.colorInteractive
|
|
1809
1880
|
},
|
|
1810
1881
|
isToday && !isSelected && [
|
|
1811
|
-
|
|
1882
|
+
styles20.today,
|
|
1812
1883
|
{ borderColor: colors2.colorInteractive }
|
|
1813
1884
|
],
|
|
1814
|
-
disabled &&
|
|
1815
|
-
pressed && !disabled &&
|
|
1885
|
+
disabled && styles20.disabled,
|
|
1886
|
+
pressed && !disabled && styles20.pressed
|
|
1816
1887
|
],
|
|
1817
|
-
children: /* @__PURE__ */ (0,
|
|
1818
|
-
|
|
1888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1889
|
+
ScaledText,
|
|
1819
1890
|
{
|
|
1820
1891
|
style: [
|
|
1821
|
-
|
|
1892
|
+
styles20.dayText,
|
|
1822
1893
|
{
|
|
1823
1894
|
color: isSelected ? colors2.colorOnInteractive : colors2.colorOnBg,
|
|
1824
1895
|
fontWeight: isToday ? import_native.font.weight.semibold : import_native.font.weight.body
|
|
@@ -1837,12 +1908,12 @@ function Calendar({
|
|
|
1837
1908
|
}
|
|
1838
1909
|
|
|
1839
1910
|
// src/components/ui/Carousel/Carousel.tsx
|
|
1840
|
-
var
|
|
1841
|
-
var
|
|
1842
|
-
var
|
|
1911
|
+
var import_react9 = require("react");
|
|
1912
|
+
var import_react_native24 = require("react-native");
|
|
1913
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1843
1914
|
var DOT_SIZE = 8;
|
|
1844
1915
|
var DOT_HIT_SIZE = 44;
|
|
1845
|
-
var
|
|
1916
|
+
var styles21 = import_react_native24.StyleSheet.create({
|
|
1846
1917
|
container: {
|
|
1847
1918
|
width: "100%"
|
|
1848
1919
|
},
|
|
@@ -1897,10 +1968,10 @@ function Carousel({
|
|
|
1897
1968
|
style
|
|
1898
1969
|
}) {
|
|
1899
1970
|
const { colors: colors2 } = useTheme();
|
|
1900
|
-
const scrollRef = (0,
|
|
1901
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
1902
|
-
const [slideWidth, setSlideWidth] = (0,
|
|
1903
|
-
const handleScroll = (0,
|
|
1971
|
+
const scrollRef = (0, import_react9.useRef)(null);
|
|
1972
|
+
const [activeIndex, setActiveIndex] = (0, import_react9.useState)(0);
|
|
1973
|
+
const [slideWidth, setSlideWidth] = (0, import_react9.useState)(import_react_native24.Dimensions.get("window").width);
|
|
1974
|
+
const handleScroll = (0, import_react9.useCallback)(
|
|
1904
1975
|
(e) => {
|
|
1905
1976
|
const offset = e.nativeEvent.contentOffset.x;
|
|
1906
1977
|
const width = e.nativeEvent.layoutMeasurement.width;
|
|
@@ -1915,15 +1986,15 @@ function Carousel({
|
|
|
1915
1986
|
const clamped = Math.max(0, Math.min(index, items.length - 1));
|
|
1916
1987
|
scrollRef.current?.scrollTo({ x: clamped * slideWidth, animated: true });
|
|
1917
1988
|
};
|
|
1918
|
-
return /* @__PURE__ */ (0,
|
|
1919
|
-
|
|
1989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1990
|
+
import_react_native24.View,
|
|
1920
1991
|
{
|
|
1921
|
-
style: [
|
|
1992
|
+
style: [styles21.container, style],
|
|
1922
1993
|
accessibilityRole: "none",
|
|
1923
1994
|
accessibilityLabel: label,
|
|
1924
1995
|
children: [
|
|
1925
|
-
/* @__PURE__ */ (0,
|
|
1926
|
-
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1997
|
+
import_react_native24.ScrollView,
|
|
1927
1998
|
{
|
|
1928
1999
|
ref: scrollRef,
|
|
1929
2000
|
horizontal: true,
|
|
@@ -1932,13 +2003,13 @@ function Carousel({
|
|
|
1932
2003
|
onScroll: handleScroll,
|
|
1933
2004
|
scrollEventThrottle: 16,
|
|
1934
2005
|
onLayout: (e) => setSlideWidth(e.nativeEvent.layout.width),
|
|
1935
|
-
style:
|
|
1936
|
-
children: items.map((item, index) => /* @__PURE__ */ (0,
|
|
2006
|
+
style: styles21.scrollView,
|
|
2007
|
+
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native24.View, { style: [styles21.slide, { width: slideWidth }], children: item }, index))
|
|
1937
2008
|
}
|
|
1938
2009
|
),
|
|
1939
|
-
/* @__PURE__ */ (0,
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
1941
|
-
|
|
2010
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native24.View, { style: styles21.nav, children: [
|
|
2011
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2012
|
+
import_react_native24.Pressable,
|
|
1942
2013
|
{
|
|
1943
2014
|
onPress: () => scrollTo(activeIndex - 1),
|
|
1944
2015
|
disabled: activeIndex <= 0,
|
|
@@ -1946,26 +2017,26 @@ function Carousel({
|
|
|
1946
2017
|
accessibilityLabel: "Previous",
|
|
1947
2018
|
accessibilityState: { disabled: activeIndex <= 0 },
|
|
1948
2019
|
style: ({ pressed }) => [
|
|
1949
|
-
|
|
2020
|
+
styles21.navButton,
|
|
1950
2021
|
activeIndex <= 0 && { opacity: 0.4 },
|
|
1951
|
-
pressed &&
|
|
2022
|
+
pressed && styles21.pressed
|
|
1952
2023
|
],
|
|
1953
|
-
children: /* @__PURE__ */ (0,
|
|
2024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ScaledText, { style: [styles21.navText, { color: colors2.colorOnBg }], children: "\u2039" })
|
|
1954
2025
|
}
|
|
1955
2026
|
),
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
1957
|
-
|
|
2027
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native24.View, { style: styles21.dots, children: items.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2028
|
+
import_react_native24.Pressable,
|
|
1958
2029
|
{
|
|
1959
2030
|
onPress: () => scrollTo(index),
|
|
1960
2031
|
accessibilityRole: "button",
|
|
1961
2032
|
accessibilityLabel: `Go to slide ${index + 1}`,
|
|
1962
2033
|
accessibilityState: { selected: activeIndex === index },
|
|
1963
|
-
style:
|
|
1964
|
-
children: /* @__PURE__ */ (0,
|
|
1965
|
-
|
|
2034
|
+
style: styles21.dotWrapper,
|
|
2035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2036
|
+
import_react_native24.View,
|
|
1966
2037
|
{
|
|
1967
2038
|
style: [
|
|
1968
|
-
|
|
2039
|
+
styles21.dot,
|
|
1969
2040
|
{
|
|
1970
2041
|
backgroundColor: activeIndex === index ? colors2.colorInteractive : colors2.colorBgSubtle
|
|
1971
2042
|
}
|
|
@@ -1975,8 +2046,8 @@ function Carousel({
|
|
|
1975
2046
|
},
|
|
1976
2047
|
index
|
|
1977
2048
|
)) }),
|
|
1978
|
-
/* @__PURE__ */ (0,
|
|
1979
|
-
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2050
|
+
import_react_native24.Pressable,
|
|
1980
2051
|
{
|
|
1981
2052
|
onPress: () => scrollTo(activeIndex + 1),
|
|
1982
2053
|
disabled: activeIndex >= items.length - 1,
|
|
@@ -1984,11 +2055,11 @@ function Carousel({
|
|
|
1984
2055
|
accessibilityLabel: "Next",
|
|
1985
2056
|
accessibilityState: { disabled: activeIndex >= items.length - 1 },
|
|
1986
2057
|
style: ({ pressed }) => [
|
|
1987
|
-
|
|
2058
|
+
styles21.navButton,
|
|
1988
2059
|
activeIndex >= items.length - 1 && { opacity: 0.4 },
|
|
1989
|
-
pressed &&
|
|
2060
|
+
pressed && styles21.pressed
|
|
1990
2061
|
],
|
|
1991
|
-
children: /* @__PURE__ */ (0,
|
|
2062
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ScaledText, { style: [styles21.navText, { color: colors2.colorOnBg }], children: "\u203A" })
|
|
1992
2063
|
}
|
|
1993
2064
|
)
|
|
1994
2065
|
] })
|
|
@@ -1998,8 +2069,8 @@ function Carousel({
|
|
|
1998
2069
|
}
|
|
1999
2070
|
|
|
2000
2071
|
// src/components/layout/Card/Card.tsx
|
|
2001
|
-
var
|
|
2002
|
-
var
|
|
2072
|
+
var import_react_native25 = require("react-native");
|
|
2073
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2003
2074
|
var paddingMap = {
|
|
2004
2075
|
none: 0,
|
|
2005
2076
|
small: import_native.spacing.s,
|
|
@@ -2011,7 +2082,7 @@ var alignMap = {
|
|
|
2011
2082
|
center: "center",
|
|
2012
2083
|
end: "flex-end"
|
|
2013
2084
|
};
|
|
2014
|
-
var
|
|
2085
|
+
var styles22 = import_react_native25.StyleSheet.create({
|
|
2015
2086
|
card: {
|
|
2016
2087
|
borderRadius: import_native.border.radius.m,
|
|
2017
2088
|
overflow: "hidden"
|
|
@@ -2046,29 +2117,29 @@ function Card({
|
|
|
2046
2117
|
alignItems: alignMap[textAlign]
|
|
2047
2118
|
};
|
|
2048
2119
|
if (onPress) {
|
|
2049
|
-
return /* @__PURE__ */ (0,
|
|
2050
|
-
|
|
2120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2121
|
+
import_react_native25.Pressable,
|
|
2051
2122
|
{
|
|
2052
2123
|
onPress,
|
|
2053
2124
|
accessibilityRole: "button",
|
|
2054
2125
|
accessibilityLabel,
|
|
2055
|
-
style: ({ pressed }) => [
|
|
2126
|
+
style: ({ pressed }) => [styles22.card, variantStyle, inner, pressed && { opacity: 0.8 }, style],
|
|
2056
2127
|
children
|
|
2057
2128
|
}
|
|
2058
2129
|
);
|
|
2059
2130
|
}
|
|
2060
|
-
return /* @__PURE__ */ (0,
|
|
2131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native25.View, { style: [styles22.card, variantStyle, inner, style], children });
|
|
2061
2132
|
}
|
|
2062
2133
|
|
|
2063
2134
|
// src/components/layout/SectionHeader/SectionHeader.tsx
|
|
2064
|
-
var
|
|
2065
|
-
var
|
|
2135
|
+
var import_react_native26 = require("react-native");
|
|
2136
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2066
2137
|
var alignMap2 = {
|
|
2067
2138
|
start: "flex-start",
|
|
2068
2139
|
center: "center",
|
|
2069
2140
|
end: "flex-end"
|
|
2070
2141
|
};
|
|
2071
|
-
var titleStyles =
|
|
2142
|
+
var titleStyles = import_react_native26.StyleSheet.create({
|
|
2072
2143
|
small: {
|
|
2073
2144
|
fontSize: import_native.font.size.heading3,
|
|
2074
2145
|
fontFamily: import_native.font.family.heading,
|
|
@@ -2088,7 +2159,7 @@ var titleStyles = import_react_native24.StyleSheet.create({
|
|
|
2088
2159
|
lineHeight: lineHeight.heading1
|
|
2089
2160
|
}
|
|
2090
2161
|
});
|
|
2091
|
-
var
|
|
2162
|
+
var styles23 = import_react_native26.StyleSheet.create({
|
|
2092
2163
|
container: {
|
|
2093
2164
|
gap: import_native.spacing.xxs
|
|
2094
2165
|
},
|
|
@@ -2107,25 +2178,25 @@ function SectionHeader({
|
|
|
2107
2178
|
}) {
|
|
2108
2179
|
const { colors: colors2 } = useTheme();
|
|
2109
2180
|
const align = alignMap2[alignment];
|
|
2110
|
-
return /* @__PURE__ */ (0,
|
|
2111
|
-
/* @__PURE__ */ (0,
|
|
2112
|
-
|
|
2181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_native26.View, { style: [styles23.container, { alignItems: align }, style], children: [
|
|
2182
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2183
|
+
ScaledText,
|
|
2113
2184
|
{
|
|
2114
2185
|
accessibilityRole: "header",
|
|
2115
2186
|
style: [titleStyles[size], { color: colors2.colorOnBg }],
|
|
2116
2187
|
children: title
|
|
2117
2188
|
}
|
|
2118
2189
|
),
|
|
2119
|
-
subtitle && /* @__PURE__ */ (0,
|
|
2190
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ScaledText, { style: [styles23.subtitle, { color: colors2.colorOnBgSubtle }], children: subtitle })
|
|
2120
2191
|
] });
|
|
2121
2192
|
}
|
|
2122
2193
|
|
|
2123
2194
|
// src/components/layout/IconWrapper/IconWrapper.tsx
|
|
2124
|
-
var
|
|
2125
|
-
var
|
|
2195
|
+
var import_react_native27 = require("react-native");
|
|
2196
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2126
2197
|
function IconWrapper({ children, style, accessibilityElementsHidden }) {
|
|
2127
|
-
return /* @__PURE__ */ (0,
|
|
2128
|
-
|
|
2198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2199
|
+
import_react_native27.View,
|
|
2129
2200
|
{
|
|
2130
2201
|
style: [{ alignItems: "center", justifyContent: "center" }, style],
|
|
2131
2202
|
importantForAccessibility: accessibilityElementsHidden ? "no-hide-descendants" : "auto",
|
|
@@ -2136,9 +2207,9 @@ function IconWrapper({ children, style, accessibilityElementsHidden }) {
|
|
|
2136
2207
|
}
|
|
2137
2208
|
|
|
2138
2209
|
// src/components/layout/ButtonGroup/ButtonGroup.tsx
|
|
2139
|
-
var
|
|
2140
|
-
var
|
|
2141
|
-
var
|
|
2210
|
+
var import_react_native28 = require("react-native");
|
|
2211
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2212
|
+
var styles24 = import_react_native28.StyleSheet.create({
|
|
2142
2213
|
group: {
|
|
2143
2214
|
flexDirection: "row",
|
|
2144
2215
|
flexWrap: "wrap",
|
|
@@ -2151,11 +2222,11 @@ var styles23 = import_react_native26.StyleSheet.create({
|
|
|
2151
2222
|
});
|
|
2152
2223
|
function ButtonContainer({ children, variant, accessibilityLabel, style }) {
|
|
2153
2224
|
const isColumn = variant === "card" || variant === "modal";
|
|
2154
|
-
return /* @__PURE__ */ (0,
|
|
2155
|
-
|
|
2225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2226
|
+
import_react_native28.View,
|
|
2156
2227
|
{
|
|
2157
2228
|
accessibilityLabel,
|
|
2158
|
-
style: [isColumn ?
|
|
2229
|
+
style: [isColumn ? styles24.column : styles24.group, style],
|
|
2159
2230
|
children
|
|
2160
2231
|
}
|
|
2161
2232
|
);
|
|
@@ -2163,14 +2234,14 @@ function ButtonContainer({ children, variant, accessibilityLabel, style }) {
|
|
|
2163
2234
|
var ButtonGroup = ButtonContainer;
|
|
2164
2235
|
|
|
2165
2236
|
// src/components/interaction/Button/Button.tsx
|
|
2166
|
-
var
|
|
2167
|
-
var
|
|
2237
|
+
var import_react_native29 = require("react-native");
|
|
2238
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2168
2239
|
var sizeTokens = {
|
|
2169
|
-
small: { height: 36, px: import_native.spacing.m, fontSize: import_native.font.size.bodyS
|
|
2170
|
-
medium: { height: 48, px: import_native.spacing.m, fontSize: import_native.font.size.body
|
|
2171
|
-
large: { height: 56, px: import_native.spacing.xxl, fontSize: import_native.font.size.heading3
|
|
2240
|
+
small: { height: 36, px: import_native.spacing.m, fontSize: import_native.font.size.bodyS },
|
|
2241
|
+
medium: { height: 48, px: import_native.spacing.m, fontSize: import_native.font.size.body },
|
|
2242
|
+
large: { height: 56, px: import_native.spacing.xxl, fontSize: import_native.font.size.heading3 }
|
|
2172
2243
|
};
|
|
2173
|
-
var
|
|
2244
|
+
var styles25 = import_react_native29.StyleSheet.create({
|
|
2174
2245
|
pressable: {
|
|
2175
2246
|
flexDirection: "row",
|
|
2176
2247
|
alignItems: "center",
|
|
@@ -2181,7 +2252,9 @@ var styles24 = import_react_native27.StyleSheet.create({
|
|
|
2181
2252
|
label: {
|
|
2182
2253
|
fontFamily: import_native.font.family.body,
|
|
2183
2254
|
fontWeight: import_native.font.weight.semibold,
|
|
2184
|
-
includeFontPadding: false
|
|
2255
|
+
includeFontPadding: false,
|
|
2256
|
+
flexShrink: 1,
|
|
2257
|
+
textAlign: "center"
|
|
2185
2258
|
}
|
|
2186
2259
|
});
|
|
2187
2260
|
function Button({
|
|
@@ -2197,18 +2270,22 @@ function Button({
|
|
|
2197
2270
|
style
|
|
2198
2271
|
}) {
|
|
2199
2272
|
const { colors: colors2 } = useTheme();
|
|
2200
|
-
const { height, px, fontSize
|
|
2273
|
+
const { height, px, fontSize } = sizeTokens[size];
|
|
2201
2274
|
const primaryColor = colors2.colorInteractive;
|
|
2202
2275
|
const onPrimaryColor = colors2.colorOnInteractive;
|
|
2203
2276
|
const outlineTextColor = colors2.colorInteractiveOnBg;
|
|
2204
2277
|
const isOutline = variant === "outline" || variant === "ghost";
|
|
2205
2278
|
const containerStyle = {
|
|
2206
|
-
height,
|
|
2279
|
+
minHeight: height,
|
|
2207
2280
|
paddingHorizontal: isIconOnly ? import_native.spacing.xs : px,
|
|
2208
|
-
|
|
2281
|
+
// A text button has medium corners on every size; an icon-only button stays round.
|
|
2282
|
+
borderRadius: isIconOnly ? import_native.border.radius.full : import_native.border.radius.m,
|
|
2209
2283
|
opacity: disabled ? 0.4 : 1,
|
|
2210
2284
|
// Icon-only: square with equal xs padding on both axes.
|
|
2211
2285
|
...isIconOnly && { aspectRatio: 1, paddingVertical: import_native.spacing.xs },
|
|
2286
|
+
// Icon-only keeps a fixed height (stays square); a text button gets vertical padding
|
|
2287
|
+
// instead, so a wrapped label grows the button from minHeight rather than clipping.
|
|
2288
|
+
...isIconOnly ? { height } : { paddingVertical: import_native.spacing.xxs },
|
|
2212
2289
|
...variant === "default" && { backgroundColor: primaryColor },
|
|
2213
2290
|
...isOutline && {
|
|
2214
2291
|
backgroundColor: "transparent",
|
|
@@ -2217,29 +2294,29 @@ function Button({
|
|
|
2217
2294
|
}
|
|
2218
2295
|
};
|
|
2219
2296
|
const textColor = variant === "default" ? onPrimaryColor : outlineTextColor;
|
|
2220
|
-
return /* @__PURE__ */ (0,
|
|
2221
|
-
|
|
2297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2298
|
+
import_react_native29.Pressable,
|
|
2222
2299
|
{
|
|
2223
2300
|
onPress,
|
|
2224
2301
|
disabled,
|
|
2225
2302
|
accessibilityRole: "button",
|
|
2226
2303
|
accessibilityLabel,
|
|
2227
2304
|
accessibilityState: { disabled },
|
|
2228
|
-
style: ({ pressed }) => [
|
|
2305
|
+
style: ({ pressed }) => [styles25.pressable, containerStyle, pressed && { opacity: 0.75 }, style],
|
|
2229
2306
|
children: [
|
|
2230
|
-
iconStart && /* @__PURE__ */ (0,
|
|
2231
|
-
children && (isIconOnly ? children : /* @__PURE__ */ (0,
|
|
2232
|
-
iconEnd && /* @__PURE__ */ (0,
|
|
2307
|
+
iconStart && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_native29.View, { importantForAccessibility: "no-hide-descendants", accessibilityElementsHidden: true, children: iconStart }),
|
|
2308
|
+
children && (isIconOnly ? children : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ScaledText, { style: [styles25.label, { fontSize, color: textColor }], children })),
|
|
2309
|
+
iconEnd && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_native29.View, { importantForAccessibility: "no-hide-descendants", children: iconEnd })
|
|
2233
2310
|
]
|
|
2234
2311
|
}
|
|
2235
2312
|
);
|
|
2236
2313
|
}
|
|
2237
2314
|
|
|
2238
2315
|
// src/components/interaction/Rating/Rating.tsx
|
|
2239
|
-
var
|
|
2240
|
-
var
|
|
2316
|
+
var import_react_native30 = require("react-native");
|
|
2317
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2241
2318
|
var STAR_SIZE = 24;
|
|
2242
|
-
var
|
|
2319
|
+
var styles26 = import_react_native30.StyleSheet.create({
|
|
2243
2320
|
container: {
|
|
2244
2321
|
flexDirection: "row",
|
|
2245
2322
|
alignItems: "center"
|
|
@@ -2252,17 +2329,17 @@ var styles25 = import_react_native28.StyleSheet.create({
|
|
|
2252
2329
|
function Rating({ value, max = 5, style, accessibilityLabel }) {
|
|
2253
2330
|
const { colors: colors2 } = useTheme();
|
|
2254
2331
|
const label = accessibilityLabel ?? `${value} out of ${max} stars`;
|
|
2255
|
-
return /* @__PURE__ */ (0,
|
|
2256
|
-
|
|
2332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2333
|
+
import_react_native30.View,
|
|
2257
2334
|
{
|
|
2258
|
-
style: [
|
|
2335
|
+
style: [styles26.container, style],
|
|
2259
2336
|
accessibilityRole: "image",
|
|
2260
2337
|
accessibilityLabel: label,
|
|
2261
|
-
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ (0,
|
|
2262
|
-
|
|
2338
|
+
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2339
|
+
ScaledText,
|
|
2263
2340
|
{
|
|
2264
2341
|
style: [
|
|
2265
|
-
|
|
2342
|
+
styles26.star,
|
|
2266
2343
|
{ color: i < value ? colors2.colorWarning : colors2.colorBgSubtle }
|
|
2267
2344
|
],
|
|
2268
2345
|
importantForAccessibility: "no",
|
|
@@ -2276,15 +2353,14 @@ function Rating({ value, max = 5, style, accessibilityLabel }) {
|
|
|
2276
2353
|
}
|
|
2277
2354
|
|
|
2278
2355
|
// src/components/interaction/form/Switch/Switch.tsx
|
|
2279
|
-
var
|
|
2356
|
+
var import_react_native32 = require("react-native");
|
|
2280
2357
|
|
|
2281
2358
|
// src/components/interaction/form/atoms/Label.tsx
|
|
2282
|
-
var
|
|
2283
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2359
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2284
2360
|
function Label({ label, style }) {
|
|
2285
2361
|
const { colors: colors2 } = useTheme();
|
|
2286
|
-
return /* @__PURE__ */ (0,
|
|
2287
|
-
|
|
2362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2363
|
+
ScaledText,
|
|
2288
2364
|
{
|
|
2289
2365
|
style: [
|
|
2290
2366
|
{
|
|
@@ -2302,9 +2378,9 @@ function Label({ label, style }) {
|
|
|
2302
2378
|
}
|
|
2303
2379
|
|
|
2304
2380
|
// src/components/interaction/form/atoms/Message.tsx
|
|
2305
|
-
var
|
|
2306
|
-
var
|
|
2307
|
-
var
|
|
2381
|
+
var import_react_native31 = require("react-native");
|
|
2382
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2383
|
+
var styles27 = import_react_native31.StyleSheet.create({
|
|
2308
2384
|
base: {
|
|
2309
2385
|
fontFamily: import_native.font.family.body,
|
|
2310
2386
|
fontSize: import_native.font.size.bodyS,
|
|
@@ -2315,20 +2391,20 @@ function Message({ message, type, style }) {
|
|
|
2315
2391
|
const { colors: colors2 } = useTheme();
|
|
2316
2392
|
if (!message) return null;
|
|
2317
2393
|
const color = type === "error" ? colors2.colorError : colors2.colorOnBgSubtle;
|
|
2318
|
-
return /* @__PURE__ */ (0,
|
|
2319
|
-
|
|
2394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2395
|
+
ScaledText,
|
|
2320
2396
|
{
|
|
2321
2397
|
accessibilityRole: type === "error" ? "alert" : "none",
|
|
2322
2398
|
accessibilityLiveRegion: type === "error" ? "assertive" : "polite",
|
|
2323
|
-
style: [
|
|
2399
|
+
style: [styles27.base, { color }, style],
|
|
2324
2400
|
children: message
|
|
2325
2401
|
}
|
|
2326
2402
|
);
|
|
2327
2403
|
}
|
|
2328
2404
|
|
|
2329
2405
|
// src/components/interaction/form/Switch/Switch.tsx
|
|
2330
|
-
var
|
|
2331
|
-
var
|
|
2406
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2407
|
+
var styles28 = import_react_native32.StyleSheet.create({
|
|
2332
2408
|
container: {
|
|
2333
2409
|
gap: import_native.spacing.xxs
|
|
2334
2410
|
},
|
|
@@ -2348,10 +2424,10 @@ function Switch({
|
|
|
2348
2424
|
style
|
|
2349
2425
|
}) {
|
|
2350
2426
|
const { colors: colors2 } = useTheme();
|
|
2351
|
-
return /* @__PURE__ */ (0,
|
|
2352
|
-
/* @__PURE__ */ (0,
|
|
2353
|
-
/* @__PURE__ */ (0,
|
|
2354
|
-
|
|
2427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_native32.View, { style: [styles28.container, style], children: [
|
|
2428
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_native32.View, { style: styles28.row, children: [
|
|
2429
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2430
|
+
import_react_native32.Switch,
|
|
2355
2431
|
{
|
|
2356
2432
|
value,
|
|
2357
2433
|
onValueChange: onChange,
|
|
@@ -2363,18 +2439,18 @@ function Switch({
|
|
|
2363
2439
|
trackColor: { false: colors2.colorBgSubtle, true: colors2.colorBlueSubtle }
|
|
2364
2440
|
}
|
|
2365
2441
|
),
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2442
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Label, { label })
|
|
2367
2443
|
] }),
|
|
2368
|
-
/* @__PURE__ */ (0,
|
|
2369
|
-
/* @__PURE__ */ (0,
|
|
2444
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Message, { type: "error", message: error }),
|
|
2445
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Message, { type: "hint", message: hint })
|
|
2370
2446
|
] });
|
|
2371
2447
|
}
|
|
2372
2448
|
|
|
2373
2449
|
// src/components/interaction/form/Checkbox/Checkbox.tsx
|
|
2374
|
-
var
|
|
2375
|
-
var
|
|
2450
|
+
var import_react_native33 = require("react-native");
|
|
2451
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2376
2452
|
var BOX = 22;
|
|
2377
|
-
var
|
|
2453
|
+
var styles29 = import_react_native33.StyleSheet.create({
|
|
2378
2454
|
container: {
|
|
2379
2455
|
gap: import_native.spacing.xxs
|
|
2380
2456
|
},
|
|
@@ -2411,31 +2487,31 @@ function Checkbox({
|
|
|
2411
2487
|
const { colors: colors2 } = useTheme();
|
|
2412
2488
|
const borderColor = error ? colors2.colorError : checked ? colors2.colorInteractive : colors2.colorOnBg;
|
|
2413
2489
|
const bgColor = checked ? colors2.colorInteractive : "transparent";
|
|
2414
|
-
return /* @__PURE__ */ (0,
|
|
2415
|
-
/* @__PURE__ */ (0,
|
|
2416
|
-
|
|
2490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_native33.View, { style: [styles29.container, style], children: [
|
|
2491
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2492
|
+
import_react_native33.Pressable,
|
|
2417
2493
|
{
|
|
2418
2494
|
onPress: () => !disabled && onChange?.(!checked),
|
|
2419
2495
|
accessibilityRole: "checkbox",
|
|
2420
2496
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
2421
2497
|
accessibilityState: { checked, disabled },
|
|
2422
2498
|
disabled,
|
|
2423
|
-
style: ({ pressed }) => [
|
|
2499
|
+
style: ({ pressed }) => [styles29.row, pressed && { opacity: 0.7 }, disabled && { opacity: 0.4 }],
|
|
2424
2500
|
children: [
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2426
|
-
/* @__PURE__ */ (0,
|
|
2501
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_native33.View, { style: [styles29.box, { borderColor, backgroundColor: bgColor }], children: checked && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Label, { label: "\u2713", style: [styles29.checkmark, { color: colors2.colorOnInteractive }] }) }),
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Label, { label })
|
|
2427
2503
|
]
|
|
2428
2504
|
}
|
|
2429
2505
|
),
|
|
2430
|
-
/* @__PURE__ */ (0,
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2506
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Message, { type: "error", message: error }),
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Message, { type: "hint", message: hint })
|
|
2432
2508
|
] });
|
|
2433
2509
|
}
|
|
2434
2510
|
|
|
2435
2511
|
// src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx
|
|
2436
|
-
var
|
|
2437
|
-
var
|
|
2438
|
-
var
|
|
2512
|
+
var import_react_native34 = require("react-native");
|
|
2513
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2514
|
+
var styles30 = import_react_native34.StyleSheet.create({
|
|
2439
2515
|
container: {
|
|
2440
2516
|
gap: import_native.spacing.xs
|
|
2441
2517
|
},
|
|
@@ -2462,31 +2538,31 @@ function CheckboxGroup({
|
|
|
2462
2538
|
style
|
|
2463
2539
|
}) {
|
|
2464
2540
|
const { colors: colors2 } = useTheme();
|
|
2465
|
-
return /* @__PURE__ */ (0,
|
|
2466
|
-
|
|
2541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2542
|
+
import_react_native34.View,
|
|
2467
2543
|
{
|
|
2468
|
-
style: [
|
|
2544
|
+
style: [styles30.container, disabled && { opacity: 0.4 }, style],
|
|
2469
2545
|
accessibilityRole: "none",
|
|
2470
2546
|
accessibilityLabel: legend,
|
|
2471
2547
|
children: [
|
|
2472
|
-
/* @__PURE__ */ (0,
|
|
2548
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ScaledText, { style: [styles30.legend, { color: colors2.colorOnBg }], children: [
|
|
2473
2549
|
legend,
|
|
2474
|
-
required && /* @__PURE__ */ (0,
|
|
2550
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ScaledText, { style: [styles30.required, { color: colors2.colorOnBgSubtle }], children: " *" })
|
|
2475
2551
|
] }),
|
|
2476
|
-
/* @__PURE__ */ (0,
|
|
2477
|
-
/* @__PURE__ */ (0,
|
|
2478
|
-
/* @__PURE__ */ (0,
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_native34.View, { style: styles30.items, children }),
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Message, { type: "error", message: error }),
|
|
2554
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Message, { type: "hint", message: hint })
|
|
2479
2555
|
]
|
|
2480
2556
|
}
|
|
2481
2557
|
);
|
|
2482
2558
|
}
|
|
2483
2559
|
|
|
2484
2560
|
// src/components/interaction/form/Radio/Radio.tsx
|
|
2485
|
-
var
|
|
2486
|
-
var
|
|
2561
|
+
var import_react_native35 = require("react-native");
|
|
2562
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2487
2563
|
var DOT = 22;
|
|
2488
2564
|
var INNER = 10;
|
|
2489
|
-
var
|
|
2565
|
+
var styles31 = import_react_native35.StyleSheet.create({
|
|
2490
2566
|
container: {
|
|
2491
2567
|
gap: import_native.spacing.xxs
|
|
2492
2568
|
},
|
|
@@ -2522,31 +2598,31 @@ function Radio({
|
|
|
2522
2598
|
}) {
|
|
2523
2599
|
const { colors: colors2 } = useTheme();
|
|
2524
2600
|
const borderColor = error ? colors2.colorError : checked ? colors2.colorInteractive : colors2.colorOnBg;
|
|
2525
|
-
return /* @__PURE__ */ (0,
|
|
2526
|
-
/* @__PURE__ */ (0,
|
|
2527
|
-
|
|
2601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react_native35.View, { style: [styles31.container, style], children: [
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2603
|
+
import_react_native35.Pressable,
|
|
2528
2604
|
{
|
|
2529
2605
|
onPress: () => !disabled && onChange?.(),
|
|
2530
2606
|
accessibilityRole: "radio",
|
|
2531
2607
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
2532
2608
|
accessibilityState: { checked, disabled },
|
|
2533
2609
|
disabled,
|
|
2534
|
-
style: ({ pressed }) => [
|
|
2610
|
+
style: ({ pressed }) => [styles31.row, pressed && { opacity: 0.7 }, disabled && { opacity: 0.4 }],
|
|
2535
2611
|
children: [
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
2537
|
-
/* @__PURE__ */ (0,
|
|
2612
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_native35.View, { style: [styles31.outer, { borderColor }], children: checked && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_native35.View, { style: [styles31.inner, { backgroundColor: colors2.colorInteractive }] }) }),
|
|
2613
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Label, { label })
|
|
2538
2614
|
]
|
|
2539
2615
|
}
|
|
2540
2616
|
),
|
|
2541
|
-
/* @__PURE__ */ (0,
|
|
2542
|
-
/* @__PURE__ */ (0,
|
|
2617
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Message, { type: "error", message: error }),
|
|
2618
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Message, { type: "hint", message: hint })
|
|
2543
2619
|
] });
|
|
2544
2620
|
}
|
|
2545
2621
|
|
|
2546
2622
|
// src/components/interaction/form/RadioGroup/RadioGroup.tsx
|
|
2547
|
-
var
|
|
2548
|
-
var
|
|
2549
|
-
var
|
|
2623
|
+
var import_react_native36 = require("react-native");
|
|
2624
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2625
|
+
var styles32 = import_react_native36.StyleSheet.create({
|
|
2550
2626
|
container: {
|
|
2551
2627
|
gap: import_native.spacing.xs
|
|
2552
2628
|
},
|
|
@@ -2573,29 +2649,29 @@ function RadioGroup({
|
|
|
2573
2649
|
style
|
|
2574
2650
|
}) {
|
|
2575
2651
|
const { colors: colors2 } = useTheme();
|
|
2576
|
-
return /* @__PURE__ */ (0,
|
|
2577
|
-
|
|
2652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2653
|
+
import_react_native36.View,
|
|
2578
2654
|
{
|
|
2579
|
-
style: [
|
|
2655
|
+
style: [styles32.container, disabled && { opacity: 0.4 }, style],
|
|
2580
2656
|
accessibilityRole: "radiogroup",
|
|
2581
2657
|
accessibilityLabel: legend,
|
|
2582
2658
|
children: [
|
|
2583
|
-
/* @__PURE__ */ (0,
|
|
2659
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(ScaledText, { style: [styles32.legend, { color: colors2.colorOnBg }], children: [
|
|
2584
2660
|
legend,
|
|
2585
|
-
required && /* @__PURE__ */ (0,
|
|
2661
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScaledText, { style: [styles32.required, { color: colors2.colorOnBgSubtle }], children: " *" })
|
|
2586
2662
|
] }),
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2589
|
-
/* @__PURE__ */ (0,
|
|
2663
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native36.View, { style: styles32.items, children }),
|
|
2664
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Message, { type: "error", message: error }),
|
|
2665
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Message, { type: "hint", message: hint })
|
|
2590
2666
|
]
|
|
2591
2667
|
}
|
|
2592
2668
|
);
|
|
2593
2669
|
}
|
|
2594
2670
|
|
|
2595
2671
|
// src/components/interaction/form/FileInput/FileInput.tsx
|
|
2596
|
-
var
|
|
2597
|
-
var
|
|
2598
|
-
var
|
|
2672
|
+
var import_react_native37 = require("react-native");
|
|
2673
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2674
|
+
var styles33 = import_react_native37.StyleSheet.create({
|
|
2599
2675
|
container: {
|
|
2600
2676
|
gap: import_native.spacing.xxs
|
|
2601
2677
|
},
|
|
@@ -2607,7 +2683,7 @@ var styles32 = import_react_native36.StyleSheet.create({
|
|
|
2607
2683
|
paddingHorizontal: import_native.spacing.m,
|
|
2608
2684
|
borderWidth: 2,
|
|
2609
2685
|
borderStyle: "dashed",
|
|
2610
|
-
borderRadius: import_native.border.radius.
|
|
2686
|
+
borderRadius: import_native.border.radius.m,
|
|
2611
2687
|
minHeight: 120
|
|
2612
2688
|
},
|
|
2613
2689
|
icon: {
|
|
@@ -2650,15 +2726,15 @@ function FileInput({
|
|
|
2650
2726
|
}) {
|
|
2651
2727
|
const { colors: colors2 } = useTheme();
|
|
2652
2728
|
const borderColor = error ? colors2.colorError : colors2.colorBgSubtle;
|
|
2653
|
-
return /* @__PURE__ */ (0,
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
2729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react_native37.View, { style: [styles33.container, style], testID: name, children: [
|
|
2730
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2655
2731
|
Label,
|
|
2656
2732
|
{
|
|
2657
2733
|
label: required ? `${label} *` : label
|
|
2658
2734
|
}
|
|
2659
2735
|
),
|
|
2660
|
-
/* @__PURE__ */ (0,
|
|
2661
|
-
|
|
2736
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2737
|
+
import_react_native37.Pressable,
|
|
2662
2738
|
{
|
|
2663
2739
|
onPress: () => !disabled && onSelect?.(),
|
|
2664
2740
|
disabled,
|
|
@@ -2666,7 +2742,7 @@ function FileInput({
|
|
|
2666
2742
|
accessibilityLabel: `${label}, tap to select file`,
|
|
2667
2743
|
accessibilityState: { disabled },
|
|
2668
2744
|
style: ({ pressed }) => [
|
|
2669
|
-
|
|
2745
|
+
styles33.dropZone,
|
|
2670
2746
|
{
|
|
2671
2747
|
borderColor,
|
|
2672
2748
|
backgroundColor: "transparent"
|
|
@@ -2675,35 +2751,35 @@ function FileInput({
|
|
|
2675
2751
|
disabled && { opacity: 0.4 }
|
|
2676
2752
|
],
|
|
2677
2753
|
children: [
|
|
2678
|
-
/* @__PURE__ */ (0,
|
|
2679
|
-
/* @__PURE__ */ (0,
|
|
2680
|
-
fileNames.length > 0 && /* @__PURE__ */ (0,
|
|
2681
|
-
accept && /* @__PURE__ */ (0,
|
|
2754
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScaledText, { style: [styles33.icon, { color: colors2.colorInteractive }], children: "\u2191" }),
|
|
2755
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScaledText, { style: [styles33.prompt, { color: colors2.colorOnBgSubtle }], children: fileNames.length > 0 ? "Selected files:" : "Tap to select file" }),
|
|
2756
|
+
fileNames.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native37.View, { style: styles33.fileList, children: fileNames.map((fileName) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScaledText, { style: [styles33.fileName, { color: colors2.colorOnBg }], children: fileName }, fileName)) }),
|
|
2757
|
+
accept && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ScaledText, { style: [styles33.acceptHint, { color: colors2.colorOnBgSubtle }], children: accept })
|
|
2682
2758
|
]
|
|
2683
2759
|
}
|
|
2684
2760
|
),
|
|
2685
|
-
/* @__PURE__ */ (0,
|
|
2686
|
-
/* @__PURE__ */ (0,
|
|
2761
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Message, { type: "error", message: error }),
|
|
2762
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Message, { type: "hint", message: hint })
|
|
2687
2763
|
] });
|
|
2688
2764
|
}
|
|
2689
2765
|
|
|
2690
2766
|
// src/components/interaction/form/Combobox/Combobox.tsx
|
|
2691
|
-
var
|
|
2692
|
-
var
|
|
2767
|
+
var import_react10 = require("react");
|
|
2768
|
+
var import_react_native38 = require("react-native");
|
|
2693
2769
|
|
|
2694
2770
|
// src/components/interaction/form/atoms/inputHelpers.ts
|
|
2695
2771
|
var OPTICAL_TEXT_SHIFT = -1.5;
|
|
2696
2772
|
|
|
2697
2773
|
// src/components/interaction/form/Combobox/Combobox.tsx
|
|
2698
|
-
var
|
|
2774
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2699
2775
|
var INPUT_HEIGHT = 44;
|
|
2700
2776
|
var MAX_DROPDOWN_HEIGHT = 200;
|
|
2701
|
-
var
|
|
2777
|
+
var styles34 = import_react_native38.StyleSheet.create({
|
|
2702
2778
|
container: {
|
|
2703
2779
|
gap: import_native.spacing.xxs
|
|
2704
2780
|
},
|
|
2705
2781
|
/**
|
|
2706
|
-
* Draws the
|
|
2782
|
+
* Draws the rounded border and provides the fixed 44pt touch-target height.
|
|
2707
2783
|
* justifyContent: 'center' vertically centers the inner TextInput.
|
|
2708
2784
|
* position: 'relative' is required for the dropdown's absolute positioning.
|
|
2709
2785
|
*/
|
|
@@ -2712,7 +2788,7 @@ var styles33 = import_react_native37.StyleSheet.create({
|
|
|
2712
2788
|
height: INPUT_HEIGHT,
|
|
2713
2789
|
justifyContent: "center",
|
|
2714
2790
|
borderWidth: 1,
|
|
2715
|
-
borderRadius: import_native.border.radius.
|
|
2791
|
+
borderRadius: import_native.border.radius.m
|
|
2716
2792
|
},
|
|
2717
2793
|
/**
|
|
2718
2794
|
* No vertical padding: iOS centers text automatically inside the wrapper height.
|
|
@@ -2766,13 +2842,13 @@ function Combobox({
|
|
|
2766
2842
|
style
|
|
2767
2843
|
}) {
|
|
2768
2844
|
const { colors: colors2 } = useTheme();
|
|
2769
|
-
const selectedOption = (0,
|
|
2845
|
+
const selectedOption = (0, import_react10.useMemo)(
|
|
2770
2846
|
() => options.find((o) => o.value === value),
|
|
2771
2847
|
[options, value]
|
|
2772
2848
|
);
|
|
2773
|
-
const [inputValue, setInputValue] = (0,
|
|
2774
|
-
const [isOpen, setIsOpen] = (0,
|
|
2775
|
-
const filtered = (0,
|
|
2849
|
+
const [inputValue, setInputValue] = (0, import_react10.useState)(selectedOption?.label ?? "");
|
|
2850
|
+
const [isOpen, setIsOpen] = (0, import_react10.useState)(false);
|
|
2851
|
+
const filtered = (0, import_react10.useMemo)(
|
|
2776
2852
|
() => options.filter(
|
|
2777
2853
|
(o) => o.label.toLowerCase().includes(inputValue.toLowerCase())
|
|
2778
2854
|
),
|
|
@@ -2794,13 +2870,13 @@ function Combobox({
|
|
|
2794
2870
|
setTimeout(() => setIsOpen(false), 150);
|
|
2795
2871
|
};
|
|
2796
2872
|
const borderColor = error ? colors2.colorError : colors2.colorOnBg;
|
|
2797
|
-
return /* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2799
|
-
/* @__PURE__ */ (0,
|
|
2800
|
-
|
|
2873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react_native38.View, { style: [styles34.container, style], children: [
|
|
2874
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Label, { label }),
|
|
2875
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2876
|
+
import_react_native38.View,
|
|
2801
2877
|
{
|
|
2802
2878
|
style: [
|
|
2803
|
-
|
|
2879
|
+
styles34.inputWrapper,
|
|
2804
2880
|
{
|
|
2805
2881
|
borderColor,
|
|
2806
2882
|
backgroundColor: colors2.colorBg
|
|
@@ -2808,8 +2884,8 @@ function Combobox({
|
|
|
2808
2884
|
disabled && { opacity: 0.4 }
|
|
2809
2885
|
],
|
|
2810
2886
|
children: [
|
|
2811
|
-
/* @__PURE__ */ (0,
|
|
2812
|
-
|
|
2887
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2888
|
+
ScaledTextInput,
|
|
2813
2889
|
{
|
|
2814
2890
|
value: inputValue,
|
|
2815
2891
|
onChangeText: handleChangeText,
|
|
@@ -2822,16 +2898,16 @@ function Combobox({
|
|
|
2822
2898
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
2823
2899
|
accessibilityState: { disabled, expanded: isOpen },
|
|
2824
2900
|
style: [
|
|
2825
|
-
|
|
2901
|
+
styles34.input,
|
|
2826
2902
|
{ color: colors2.colorOnBg }
|
|
2827
2903
|
]
|
|
2828
2904
|
}
|
|
2829
2905
|
),
|
|
2830
|
-
isOpen && filtered.length > 0 && /* @__PURE__ */ (0,
|
|
2831
|
-
|
|
2906
|
+
isOpen && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2907
|
+
import_react_native38.ScrollView,
|
|
2832
2908
|
{
|
|
2833
2909
|
style: [
|
|
2834
|
-
|
|
2910
|
+
styles34.dropdown,
|
|
2835
2911
|
{
|
|
2836
2912
|
borderColor: colors2.colorBgSubtle,
|
|
2837
2913
|
backgroundColor: colors2.colorBg
|
|
@@ -2842,8 +2918,8 @@ function Combobox({
|
|
|
2842
2918
|
children: filtered.map((option) => {
|
|
2843
2919
|
const isSelected = option.value === value;
|
|
2844
2920
|
const isDisabled = option.disabled;
|
|
2845
|
-
return /* @__PURE__ */ (0,
|
|
2846
|
-
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2922
|
+
import_react_native38.Pressable,
|
|
2847
2923
|
{
|
|
2848
2924
|
onPress: () => !isDisabled && selectOption(option),
|
|
2849
2925
|
disabled: isDisabled,
|
|
@@ -2851,16 +2927,16 @@ function Combobox({
|
|
|
2851
2927
|
accessibilityLabel: option.label,
|
|
2852
2928
|
accessibilityState: { selected: isSelected, disabled: isDisabled },
|
|
2853
2929
|
style: ({ pressed }) => [
|
|
2854
|
-
|
|
2930
|
+
styles34.option,
|
|
2855
2931
|
isSelected && { backgroundColor: colors2.colorBlueSubtle },
|
|
2856
2932
|
pressed && !isDisabled && { backgroundColor: colors2.colorBgSubtle },
|
|
2857
2933
|
isDisabled && { opacity: 0.4 }
|
|
2858
2934
|
],
|
|
2859
|
-
children: /* @__PURE__ */ (0,
|
|
2860
|
-
|
|
2935
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2936
|
+
ScaledText,
|
|
2861
2937
|
{
|
|
2862
2938
|
style: [
|
|
2863
|
-
|
|
2939
|
+
styles34.optionText,
|
|
2864
2940
|
{
|
|
2865
2941
|
color: isSelected ? colors2.colorInteractive : colors2.colorOnBg
|
|
2866
2942
|
},
|
|
@@ -2878,15 +2954,15 @@ function Combobox({
|
|
|
2878
2954
|
]
|
|
2879
2955
|
}
|
|
2880
2956
|
),
|
|
2881
|
-
/* @__PURE__ */ (0,
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
2957
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Message, { type: "error", message: error }),
|
|
2958
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Message, { type: "hint", message: hint })
|
|
2883
2959
|
] });
|
|
2884
2960
|
}
|
|
2885
2961
|
|
|
2886
2962
|
// src/components/interaction/form/SegmentedControl/SegmentedControl.tsx
|
|
2887
|
-
var
|
|
2888
|
-
var
|
|
2889
|
-
var
|
|
2963
|
+
var import_react11 = require("react");
|
|
2964
|
+
var import_react_native39 = require("react-native");
|
|
2965
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2890
2966
|
var TRACK_PADDING = import_native.spacing.xxxs;
|
|
2891
2967
|
var sizeTokens2 = {
|
|
2892
2968
|
small: { minHeight: 32, fontSize: import_native.font.size.bodyS, px: import_native.spacing.s, py: import_native.spacing.xxs },
|
|
@@ -2901,7 +2977,7 @@ var thumbShadow = {
|
|
|
2901
2977
|
shadowRadius: 2,
|
|
2902
2978
|
elevation: 2
|
|
2903
2979
|
};
|
|
2904
|
-
var
|
|
2980
|
+
var styles35 = import_react_native39.StyleSheet.create({
|
|
2905
2981
|
track: {
|
|
2906
2982
|
flexDirection: "row",
|
|
2907
2983
|
borderRadius: import_native.border.radius.full,
|
|
@@ -2933,13 +3009,13 @@ function SegmentedControl({
|
|
|
2933
3009
|
}) {
|
|
2934
3010
|
const { colors: colors2 } = useTheme();
|
|
2935
3011
|
const { minHeight, fontSize, px, py } = sizeTokens2[size];
|
|
2936
|
-
const items =
|
|
3012
|
+
const items = import_react11.Children.toArray(children);
|
|
2937
3013
|
const trackBg = colors2.colorBgSubtle;
|
|
2938
3014
|
const thumbBg = variant === "outline" ? colors2.colorBg : colors2.colorInteractive;
|
|
2939
|
-
return /* @__PURE__ */ (0,
|
|
2940
|
-
|
|
3015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3016
|
+
import_react_native39.View,
|
|
2941
3017
|
{
|
|
2942
|
-
style: [
|
|
3018
|
+
style: [styles35.track, { backgroundColor: trackBg }, style],
|
|
2943
3019
|
accessibilityRole: "tablist",
|
|
2944
3020
|
accessibilityLabel,
|
|
2945
3021
|
children: items.map((child, index) => {
|
|
@@ -2952,8 +3028,8 @@ function SegmentedControl({
|
|
|
2952
3028
|
paddingVertical: py,
|
|
2953
3029
|
...isActive ? { backgroundColor: thumbBg, ...thumbShadow } : { backgroundColor: "transparent" }
|
|
2954
3030
|
};
|
|
2955
|
-
return /* @__PURE__ */ (0,
|
|
2956
|
-
|
|
3031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3032
|
+
import_react_native39.Pressable,
|
|
2957
3033
|
{
|
|
2958
3034
|
onPress: () => !disabled && onValueChange?.(index),
|
|
2959
3035
|
disabled,
|
|
@@ -2961,12 +3037,21 @@ function SegmentedControl({
|
|
|
2961
3037
|
accessibilityLabel: label ?? void 0,
|
|
2962
3038
|
accessibilityState: { selected: isActive, disabled },
|
|
2963
3039
|
style: ({ pressed }) => [
|
|
2964
|
-
|
|
3040
|
+
styles35.segment,
|
|
2965
3041
|
segmentStyle,
|
|
2966
3042
|
pressed && !disabled && { opacity: 0.7 },
|
|
2967
3043
|
disabled && { opacity: 0.4 }
|
|
2968
3044
|
],
|
|
2969
|
-
children: label !== null ? /* @__PURE__ */ (0,
|
|
3045
|
+
children: label !== null ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3046
|
+
ScaledText,
|
|
3047
|
+
{
|
|
3048
|
+
style: [styles35.label, { fontSize, color: labelColor }],
|
|
3049
|
+
numberOfLines: 1,
|
|
3050
|
+
adjustsFontSizeToFit: true,
|
|
3051
|
+
minimumFontScale: 0.5,
|
|
3052
|
+
children: label
|
|
3053
|
+
}
|
|
3054
|
+
) : child
|
|
2970
3055
|
},
|
|
2971
3056
|
index
|
|
2972
3057
|
);
|
|
@@ -2976,9 +3061,9 @@ function SegmentedControl({
|
|
|
2976
3061
|
}
|
|
2977
3062
|
|
|
2978
3063
|
// src/components/interaction/form/FormInput/FormInput.tsx
|
|
2979
|
-
var
|
|
2980
|
-
var
|
|
2981
|
-
var
|
|
3064
|
+
var import_react12 = require("react");
|
|
3065
|
+
var import_react_native40 = require("react-native");
|
|
3066
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2982
3067
|
var INPUT_HEIGHT2 = 44;
|
|
2983
3068
|
var keyboardTypeMap = {
|
|
2984
3069
|
text: "default",
|
|
@@ -2989,19 +3074,19 @@ var keyboardTypeMap = {
|
|
|
2989
3074
|
number: "numeric",
|
|
2990
3075
|
search: "default"
|
|
2991
3076
|
};
|
|
2992
|
-
var
|
|
3077
|
+
var styles36 = import_react_native40.StyleSheet.create({
|
|
2993
3078
|
container: {
|
|
2994
3079
|
gap: import_native.spacing.xxs
|
|
2995
3080
|
},
|
|
2996
3081
|
/**
|
|
2997
|
-
* The wrapper draws the
|
|
3082
|
+
* The wrapper draws the rounded border and provides at least 44pt touch-target height.
|
|
2998
3083
|
* justifyContent: 'center' vertically centers the inner TextInput on both iOS and Android.
|
|
2999
3084
|
*/
|
|
3000
3085
|
inputWrapper: {
|
|
3001
|
-
|
|
3086
|
+
minHeight: INPUT_HEIGHT2,
|
|
3002
3087
|
justifyContent: "center",
|
|
3003
3088
|
borderWidth: 1,
|
|
3004
|
-
borderRadius: import_native.border.radius.
|
|
3089
|
+
borderRadius: import_native.border.radius.m
|
|
3005
3090
|
},
|
|
3006
3091
|
/**
|
|
3007
3092
|
* No vertical padding: iOS centers text automatically inside the wrapper height.
|
|
@@ -3035,23 +3120,23 @@ function FormInput({
|
|
|
3035
3120
|
style
|
|
3036
3121
|
}) {
|
|
3037
3122
|
const { colors: colors2 } = useTheme();
|
|
3038
|
-
const [focused, setFocused] = (0,
|
|
3123
|
+
const [focused, setFocused] = (0, import_react12.useState)(false);
|
|
3039
3124
|
const borderColor = error ? colors2.colorError : focused ? colors2.colorInteractive : colors2.colorOnBg;
|
|
3040
|
-
return /* @__PURE__ */ (0,
|
|
3041
|
-
/* @__PURE__ */ (0,
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
3043
|
-
|
|
3125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_react_native40.View, { style: [styles36.container, style], children: [
|
|
3126
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Label, { label }),
|
|
3127
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3128
|
+
import_react_native40.View,
|
|
3044
3129
|
{
|
|
3045
3130
|
style: [
|
|
3046
|
-
|
|
3131
|
+
styles36.inputWrapper,
|
|
3047
3132
|
{
|
|
3048
3133
|
borderColor,
|
|
3049
3134
|
backgroundColor: colors2.colorBg
|
|
3050
3135
|
},
|
|
3051
3136
|
disabled && { opacity: 0.4 }
|
|
3052
3137
|
],
|
|
3053
|
-
children: /* @__PURE__ */ (0,
|
|
3054
|
-
|
|
3138
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3139
|
+
ScaledTextInput,
|
|
3055
3140
|
{
|
|
3056
3141
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
3057
3142
|
accessibilityState: { disabled },
|
|
@@ -3075,23 +3160,23 @@ function FormInput({
|
|
|
3075
3160
|
onBlur?.();
|
|
3076
3161
|
},
|
|
3077
3162
|
style: [
|
|
3078
|
-
|
|
3163
|
+
styles36.input,
|
|
3079
3164
|
{ color: colors2.colorOnBg }
|
|
3080
3165
|
]
|
|
3081
3166
|
}
|
|
3082
3167
|
)
|
|
3083
3168
|
}
|
|
3084
3169
|
),
|
|
3085
|
-
/* @__PURE__ */ (0,
|
|
3086
|
-
/* @__PURE__ */ (0,
|
|
3170
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Message, { type: "error", message: error }),
|
|
3171
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Message, { type: "hint", message: hint })
|
|
3087
3172
|
] });
|
|
3088
3173
|
}
|
|
3089
3174
|
|
|
3090
3175
|
// src/components/interaction/form/Textarea/Textarea.tsx
|
|
3091
|
-
var
|
|
3092
|
-
var
|
|
3093
|
-
var
|
|
3094
|
-
var
|
|
3176
|
+
var import_react13 = require("react");
|
|
3177
|
+
var import_react_native41 = require("react-native");
|
|
3178
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3179
|
+
var styles37 = import_react_native41.StyleSheet.create({
|
|
3095
3180
|
container: {
|
|
3096
3181
|
gap: import_native.spacing.xxs
|
|
3097
3182
|
},
|
|
@@ -3102,7 +3187,7 @@ var styles36 = import_react_native40.StyleSheet.create({
|
|
|
3102
3187
|
paddingHorizontal: import_native.spacing.s,
|
|
3103
3188
|
paddingVertical: import_native.spacing.xs,
|
|
3104
3189
|
borderWidth: 1,
|
|
3105
|
-
borderRadius: import_native.border.radius.
|
|
3190
|
+
borderRadius: import_native.border.radius.m,
|
|
3106
3191
|
minHeight: 100,
|
|
3107
3192
|
textAlignVertical: "top"
|
|
3108
3193
|
}
|
|
@@ -3123,12 +3208,12 @@ function Textarea({
|
|
|
3123
3208
|
style
|
|
3124
3209
|
}) {
|
|
3125
3210
|
const { colors: colors2 } = useTheme();
|
|
3126
|
-
const [focused, setFocused] = (0,
|
|
3211
|
+
const [focused, setFocused] = (0, import_react13.useState)(false);
|
|
3127
3212
|
const borderColor = error ? colors2.colorError : focused ? colors2.colorInteractive : colors2.colorOnBg;
|
|
3128
|
-
return /* @__PURE__ */ (0,
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3131
|
-
|
|
3213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_react_native41.View, { style: [styles37.container, style], children: [
|
|
3214
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Label, { label }),
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3216
|
+
ScaledTextInput,
|
|
3132
3217
|
{
|
|
3133
3218
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
3134
3219
|
accessibilityState: { disabled },
|
|
@@ -3150,7 +3235,7 @@ function Textarea({
|
|
|
3150
3235
|
onBlur?.();
|
|
3151
3236
|
},
|
|
3152
3237
|
style: [
|
|
3153
|
-
|
|
3238
|
+
styles37.textarea,
|
|
3154
3239
|
{
|
|
3155
3240
|
borderColor,
|
|
3156
3241
|
color: colors2.colorOnBg,
|
|
@@ -3160,16 +3245,16 @@ function Textarea({
|
|
|
3160
3245
|
]
|
|
3161
3246
|
}
|
|
3162
3247
|
),
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3164
|
-
/* @__PURE__ */ (0,
|
|
3248
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Message, { type: "error", message: error }),
|
|
3249
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Message, { type: "hint", message: hint })
|
|
3165
3250
|
] });
|
|
3166
3251
|
}
|
|
3167
3252
|
|
|
3168
3253
|
// src/components/interaction/form/Select/Select.tsx
|
|
3169
|
-
var
|
|
3170
|
-
var
|
|
3171
|
-
var
|
|
3172
|
-
var
|
|
3254
|
+
var import_react14 = require("react");
|
|
3255
|
+
var import_react_native42 = require("react-native");
|
|
3256
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3257
|
+
var styles38 = import_react_native42.StyleSheet.create({
|
|
3173
3258
|
container: {
|
|
3174
3259
|
gap: import_native.spacing.xxs
|
|
3175
3260
|
},
|
|
@@ -3180,7 +3265,7 @@ var styles37 = import_react_native41.StyleSheet.create({
|
|
|
3180
3265
|
paddingHorizontal: import_native.spacing.s,
|
|
3181
3266
|
paddingVertical: import_native.spacing.xs,
|
|
3182
3267
|
borderWidth: 1,
|
|
3183
|
-
borderRadius: import_native.border.radius.
|
|
3268
|
+
borderRadius: import_native.border.radius.m,
|
|
3184
3269
|
minHeight: 44
|
|
3185
3270
|
},
|
|
3186
3271
|
triggerText: {
|
|
@@ -3190,8 +3275,6 @@ var styles37 = import_react_native41.StyleSheet.create({
|
|
|
3190
3275
|
flex: 1
|
|
3191
3276
|
},
|
|
3192
3277
|
chevron: {
|
|
3193
|
-
fontFamily: import_native.font.family.body,
|
|
3194
|
-
fontSize: import_native.font.size.body,
|
|
3195
3278
|
marginStart: import_native.spacing.xs
|
|
3196
3279
|
},
|
|
3197
3280
|
overlay: {
|
|
@@ -3248,7 +3331,7 @@ function Select({
|
|
|
3248
3331
|
style
|
|
3249
3332
|
}) {
|
|
3250
3333
|
const { colors: colors2 } = useTheme();
|
|
3251
|
-
const [open, setOpen] = (0,
|
|
3334
|
+
const [open, setOpen] = (0, import_react14.useState)(false);
|
|
3252
3335
|
const selectedOption = options.find((o) => o.value === value);
|
|
3253
3336
|
const displayText = selectedOption?.label ?? placeholder;
|
|
3254
3337
|
const isPlaceholder = !selectedOption;
|
|
@@ -3257,10 +3340,10 @@ function Select({
|
|
|
3257
3340
|
onChange?.(optionValue);
|
|
3258
3341
|
setOpen(false);
|
|
3259
3342
|
};
|
|
3260
|
-
return /* @__PURE__ */ (0,
|
|
3261
|
-
/* @__PURE__ */ (0,
|
|
3262
|
-
/* @__PURE__ */ (0,
|
|
3263
|
-
|
|
3343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_react_native42.View, { style: [styles38.container, style], children: [
|
|
3344
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Label, { label }),
|
|
3345
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3346
|
+
import_react_native42.Pressable,
|
|
3264
3347
|
{
|
|
3265
3348
|
accessibilityRole: "button",
|
|
3266
3349
|
accessibilityLabel: typeof label === "string" ? `${label}, ${displayText}` : name,
|
|
@@ -3269,7 +3352,7 @@ function Select({
|
|
|
3269
3352
|
disabled,
|
|
3270
3353
|
onPress: () => setOpen(true),
|
|
3271
3354
|
style: [
|
|
3272
|
-
|
|
3355
|
+
styles38.trigger,
|
|
3273
3356
|
{
|
|
3274
3357
|
borderColor,
|
|
3275
3358
|
backgroundColor: colors2.colorBg
|
|
@@ -3277,11 +3360,11 @@ function Select({
|
|
|
3277
3360
|
disabled && { opacity: 0.4 }
|
|
3278
3361
|
],
|
|
3279
3362
|
children: [
|
|
3280
|
-
/* @__PURE__ */ (0,
|
|
3281
|
-
|
|
3363
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3364
|
+
ScaledText,
|
|
3282
3365
|
{
|
|
3283
3366
|
style: [
|
|
3284
|
-
|
|
3367
|
+
styles38.triggerText,
|
|
3285
3368
|
{
|
|
3286
3369
|
color: isPlaceholder ? colors2.colorOnBgSubtle : colors2.colorOnBg
|
|
3287
3370
|
}
|
|
@@ -3289,53 +3372,60 @@ function Select({
|
|
|
3289
3372
|
children: displayText
|
|
3290
3373
|
}
|
|
3291
3374
|
),
|
|
3292
|
-
/* @__PURE__ */ (0,
|
|
3375
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3376
|
+
Chevron,
|
|
3377
|
+
{
|
|
3378
|
+
testID: "bds-select-chevron",
|
|
3379
|
+
color: colors2.colorOnBgSubtle,
|
|
3380
|
+
style: styles38.chevron
|
|
3381
|
+
}
|
|
3382
|
+
)
|
|
3293
3383
|
]
|
|
3294
3384
|
}
|
|
3295
3385
|
),
|
|
3296
|
-
/* @__PURE__ */ (0,
|
|
3297
|
-
|
|
3386
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3387
|
+
import_react_native42.Modal,
|
|
3298
3388
|
{
|
|
3299
3389
|
visible: open,
|
|
3300
3390
|
transparent: true,
|
|
3301
3391
|
animationType: "slide",
|
|
3302
3392
|
onRequestClose: () => setOpen(false),
|
|
3303
|
-
children: /* @__PURE__ */ (0,
|
|
3304
|
-
|
|
3393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3394
|
+
import_react_native42.Pressable,
|
|
3305
3395
|
{
|
|
3306
|
-
style:
|
|
3396
|
+
style: styles38.overlay,
|
|
3307
3397
|
onPress: () => setOpen(false),
|
|
3308
3398
|
accessibilityRole: "button",
|
|
3309
3399
|
accessibilityLabel: "Close options",
|
|
3310
|
-
children: /* @__PURE__ */ (0,
|
|
3311
|
-
|
|
3400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3401
|
+
import_react_native42.Pressable,
|
|
3312
3402
|
{
|
|
3313
|
-
style: [
|
|
3403
|
+
style: [styles38.sheet, { backgroundColor: colors2.colorBg }],
|
|
3314
3404
|
onPress: () => {
|
|
3315
3405
|
},
|
|
3316
|
-
children: /* @__PURE__ */ (0,
|
|
3317
|
-
/* @__PURE__ */ (0,
|
|
3318
|
-
/* @__PURE__ */ (0,
|
|
3319
|
-
/* @__PURE__ */ (0,
|
|
3320
|
-
|
|
3406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_react_native42.SafeAreaView, { children: [
|
|
3407
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_react_native42.View, { style: styles38.sheetHeader, children: [
|
|
3408
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ScaledText, { style: [styles38.sheetTitle, { color: colors2.colorOnBg }], children: typeof label === "string" ? label : "Select" }),
|
|
3409
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3410
|
+
import_react_native42.Pressable,
|
|
3321
3411
|
{
|
|
3322
3412
|
accessibilityRole: "button",
|
|
3323
3413
|
accessibilityLabel: "Close",
|
|
3324
3414
|
onPress: () => setOpen(false),
|
|
3325
3415
|
hitSlop: 8,
|
|
3326
|
-
children: /* @__PURE__ */ (0,
|
|
3416
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ScaledText, { style: [styles38.closeText, { color: colors2.colorInteractive }], children: "Done" })
|
|
3327
3417
|
}
|
|
3328
3418
|
)
|
|
3329
3419
|
] }),
|
|
3330
|
-
/* @__PURE__ */ (0,
|
|
3331
|
-
|
|
3420
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3421
|
+
import_react_native42.FlatList,
|
|
3332
3422
|
{
|
|
3333
3423
|
data: options,
|
|
3334
3424
|
keyExtractor: (item) => item.value,
|
|
3335
3425
|
renderItem: ({ item }) => {
|
|
3336
3426
|
const isSelected = item.value === value;
|
|
3337
|
-
return /* @__PURE__ */ (0,
|
|
3338
|
-
|
|
3427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3428
|
+
import_react_native42.Pressable,
|
|
3339
3429
|
{
|
|
3340
3430
|
accessibilityRole: "button",
|
|
3341
3431
|
accessibilityLabel: item.label,
|
|
@@ -3346,16 +3436,16 @@ function Select({
|
|
|
3346
3436
|
disabled: item.disabled,
|
|
3347
3437
|
onPress: () => handleSelect(item.value),
|
|
3348
3438
|
style: ({ pressed }) => [
|
|
3349
|
-
|
|
3439
|
+
styles38.optionItem,
|
|
3350
3440
|
isSelected && { backgroundColor: colors2.colorBgSubtle },
|
|
3351
3441
|
pressed && { opacity: 0.7 },
|
|
3352
3442
|
item.disabled && { opacity: 0.4 }
|
|
3353
3443
|
],
|
|
3354
|
-
children: /* @__PURE__ */ (0,
|
|
3355
|
-
|
|
3444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3445
|
+
ScaledText,
|
|
3356
3446
|
{
|
|
3357
3447
|
style: [
|
|
3358
|
-
|
|
3448
|
+
styles38.optionText,
|
|
3359
3449
|
{
|
|
3360
3450
|
color: isSelected ? colors2.colorInteractive : colors2.colorOnBg,
|
|
3361
3451
|
fontWeight: isSelected ? import_native.font.weight.semibold : import_native.font.weight.body
|
|
@@ -3376,18 +3466,18 @@ function Select({
|
|
|
3376
3466
|
)
|
|
3377
3467
|
}
|
|
3378
3468
|
),
|
|
3379
|
-
/* @__PURE__ */ (0,
|
|
3380
|
-
/* @__PURE__ */ (0,
|
|
3469
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Message, { type: "error", message: error }),
|
|
3470
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Message, { type: "hint", message: hint })
|
|
3381
3471
|
] });
|
|
3382
3472
|
}
|
|
3383
3473
|
|
|
3384
3474
|
// src/components/interaction/form/Slider/Slider.tsx
|
|
3385
|
-
var
|
|
3386
|
-
var
|
|
3387
|
-
var
|
|
3475
|
+
var import_react15 = require("react");
|
|
3476
|
+
var import_react_native43 = require("react-native");
|
|
3477
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3388
3478
|
var TRACK_HEIGHT = 6;
|
|
3389
3479
|
var THUMB_SIZE = 24;
|
|
3390
|
-
var
|
|
3480
|
+
var styles39 = import_react_native43.StyleSheet.create({
|
|
3391
3481
|
container: {
|
|
3392
3482
|
gap: import_native.spacing.xxs
|
|
3393
3483
|
},
|
|
@@ -3450,8 +3540,8 @@ function Slider({
|
|
|
3450
3540
|
}) {
|
|
3451
3541
|
const { colors: colors2 } = useTheme();
|
|
3452
3542
|
const isControlled = value !== void 0;
|
|
3453
|
-
const [internalValue, setInternalValue] = (0,
|
|
3454
|
-
const [trackWidth, setTrackWidth] = (0,
|
|
3543
|
+
const [internalValue, setInternalValue] = (0, import_react15.useState)(defaultValue ?? min);
|
|
3544
|
+
const [trackWidth, setTrackWidth] = (0, import_react15.useState)(0);
|
|
3455
3545
|
const currentValue = isControlled ? value : internalValue;
|
|
3456
3546
|
const fillPct = max > min ? (currentValue - min) / (max - min) * 100 : 0;
|
|
3457
3547
|
const updateValue = (v) => {
|
|
@@ -3481,34 +3571,34 @@ function Slider({
|
|
|
3481
3571
|
updateValue(valueFromTouch(e.nativeEvent.pageX, pageX));
|
|
3482
3572
|
});
|
|
3483
3573
|
};
|
|
3484
|
-
return /* @__PURE__ */ (0,
|
|
3485
|
-
|
|
3574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3575
|
+
import_react_native43.View,
|
|
3486
3576
|
{
|
|
3487
|
-
style: [
|
|
3577
|
+
style: [styles39.container, style],
|
|
3488
3578
|
accessibilityRole: "adjustable",
|
|
3489
3579
|
accessibilityLabel: label,
|
|
3490
3580
|
accessibilityValue: { min, max, now: currentValue, text: String(currentValue) },
|
|
3491
3581
|
accessibilityState: { disabled },
|
|
3492
3582
|
children: [
|
|
3493
|
-
/* @__PURE__ */ (0,
|
|
3494
|
-
/* @__PURE__ */ (0,
|
|
3495
|
-
showValue && /* @__PURE__ */ (0,
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_native43.View, { style: styles39.labelRow, children: [
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Label, { label }),
|
|
3585
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ScaledText, { style: [styles39.valueText, { color: colors2.colorOnBg }], children: currentValue })
|
|
3496
3586
|
] }),
|
|
3497
|
-
/* @__PURE__ */ (0,
|
|
3498
|
-
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3588
|
+
import_react_native43.View,
|
|
3499
3589
|
{
|
|
3500
|
-
style: [
|
|
3590
|
+
style: [styles39.trackContainer, disabled && { opacity: 0.4 }],
|
|
3501
3591
|
onLayout: handleTrackLayout,
|
|
3502
3592
|
onStartShouldSetResponder: handleStartShouldSetResponder,
|
|
3503
3593
|
onMoveShouldSetResponder: handleStartShouldSetResponder,
|
|
3504
3594
|
onResponderGrant: handleResponderGrant,
|
|
3505
3595
|
onResponderMove: handleResponderMove,
|
|
3506
3596
|
children: [
|
|
3507
|
-
/* @__PURE__ */ (0,
|
|
3508
|
-
|
|
3597
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_native43.View, { style: [styles39.track, { backgroundColor: colors2.colorBgSubtle }], children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3598
|
+
import_react_native43.View,
|
|
3509
3599
|
{
|
|
3510
3600
|
style: [
|
|
3511
|
-
|
|
3601
|
+
styles39.fill,
|
|
3512
3602
|
{
|
|
3513
3603
|
width: `${fillPct}%`,
|
|
3514
3604
|
backgroundColor: error ? colors2.colorError : colors2.colorInteractive
|
|
@@ -3516,11 +3606,11 @@ function Slider({
|
|
|
3516
3606
|
]
|
|
3517
3607
|
}
|
|
3518
3608
|
) }),
|
|
3519
|
-
/* @__PURE__ */ (0,
|
|
3520
|
-
|
|
3609
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3610
|
+
import_react_native43.View,
|
|
3521
3611
|
{
|
|
3522
3612
|
style: [
|
|
3523
|
-
|
|
3613
|
+
styles39.thumb,
|
|
3524
3614
|
{
|
|
3525
3615
|
start: `${fillPct}%`,
|
|
3526
3616
|
marginStart: -(THUMB_SIZE / 2),
|
|
@@ -3533,19 +3623,19 @@ function Slider({
|
|
|
3533
3623
|
]
|
|
3534
3624
|
}
|
|
3535
3625
|
),
|
|
3536
|
-
/* @__PURE__ */ (0,
|
|
3537
|
-
/* @__PURE__ */ (0,
|
|
3626
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Message, { type: "error", message: error }),
|
|
3627
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Message, { type: "hint", message: hint })
|
|
3538
3628
|
]
|
|
3539
3629
|
}
|
|
3540
3630
|
);
|
|
3541
3631
|
}
|
|
3542
3632
|
|
|
3543
3633
|
// src/components/interaction/form/NumberInput/NumberInput.tsx
|
|
3544
|
-
var
|
|
3545
|
-
var
|
|
3546
|
-
var
|
|
3634
|
+
var import_react16 = require("react");
|
|
3635
|
+
var import_react_native44 = require("react-native");
|
|
3636
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3547
3637
|
var STEPPER_SIZE = 44;
|
|
3548
|
-
var
|
|
3638
|
+
var styles40 = import_react_native44.StyleSheet.create({
|
|
3549
3639
|
container: {
|
|
3550
3640
|
gap: import_native.spacing.xxs
|
|
3551
3641
|
},
|
|
@@ -3561,13 +3651,13 @@ var styles39 = import_react_native43.StyleSheet.create({
|
|
|
3561
3651
|
borderWidth: 1
|
|
3562
3652
|
},
|
|
3563
3653
|
stepperStart: {
|
|
3564
|
-
borderTopStartRadius: import_native.border.radius.
|
|
3565
|
-
borderBottomStartRadius: import_native.border.radius.
|
|
3654
|
+
borderTopStartRadius: import_native.border.radius.m,
|
|
3655
|
+
borderBottomStartRadius: import_native.border.radius.m,
|
|
3566
3656
|
borderEndWidth: 0
|
|
3567
3657
|
},
|
|
3568
3658
|
stepperEnd: {
|
|
3569
|
-
borderTopEndRadius: import_native.border.radius.
|
|
3570
|
-
borderBottomEndRadius: import_native.border.radius.
|
|
3659
|
+
borderTopEndRadius: import_native.border.radius.m,
|
|
3660
|
+
borderBottomEndRadius: import_native.border.radius.m,
|
|
3571
3661
|
borderStartWidth: 0
|
|
3572
3662
|
},
|
|
3573
3663
|
stepperText: {
|
|
@@ -3620,7 +3710,7 @@ function NumberInput({
|
|
|
3620
3710
|
}) {
|
|
3621
3711
|
const { colors: colors2 } = useTheme();
|
|
3622
3712
|
const isControlled = value !== void 0;
|
|
3623
|
-
const [internalValue, setInternalValue] = (0,
|
|
3713
|
+
const [internalValue, setInternalValue] = (0, import_react16.useState)(defaultValue ?? 0);
|
|
3624
3714
|
const currentValue = isControlled ? value : internalValue;
|
|
3625
3715
|
const clamp = (v) => {
|
|
3626
3716
|
const withMin = min !== void 0 ? Math.max(min, v) : v;
|
|
@@ -3634,11 +3724,11 @@ function NumberInput({
|
|
|
3634
3724
|
const canDecrease = min === void 0 || currentValue > min;
|
|
3635
3725
|
const canIncrease = max === void 0 || currentValue < max;
|
|
3636
3726
|
const borderColor = error ? colors2.colorError : colors2.colorOnBg;
|
|
3637
|
-
return /* @__PURE__ */ (0,
|
|
3638
|
-
/* @__PURE__ */ (0,
|
|
3639
|
-
/* @__PURE__ */ (0,
|
|
3640
|
-
/* @__PURE__ */ (0,
|
|
3641
|
-
|
|
3727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_react_native44.View, { style: [styles40.container, style], children: [
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Label, { label }),
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_react_native44.View, { style: [styles40.inputRow, disabled && { opacity: 0.4 }], children: [
|
|
3730
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3731
|
+
import_react_native44.Pressable,
|
|
3642
3732
|
{
|
|
3643
3733
|
accessibilityRole: "button",
|
|
3644
3734
|
accessibilityLabel: "Decrease",
|
|
@@ -3646,8 +3736,8 @@ function NumberInput({
|
|
|
3646
3736
|
disabled: disabled || !canDecrease,
|
|
3647
3737
|
onPress: () => update(currentValue - step),
|
|
3648
3738
|
style: ({ pressed }) => [
|
|
3649
|
-
|
|
3650
|
-
|
|
3739
|
+
styles40.stepper,
|
|
3740
|
+
styles40.stepperStart,
|
|
3651
3741
|
{
|
|
3652
3742
|
borderColor,
|
|
3653
3743
|
backgroundColor: colors2.colorBgSubtle
|
|
@@ -3655,28 +3745,28 @@ function NumberInput({
|
|
|
3655
3745
|
pressed && { opacity: 0.7 },
|
|
3656
3746
|
(disabled || !canDecrease) && { opacity: 0.4 }
|
|
3657
3747
|
],
|
|
3658
|
-
children: /* @__PURE__ */ (0,
|
|
3659
|
-
|
|
3748
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3749
|
+
ScaledText,
|
|
3660
3750
|
{
|
|
3661
|
-
style: [
|
|
3751
|
+
style: [styles40.stepperText, { color: colors2.colorOnBg }],
|
|
3662
3752
|
"aria-hidden": true,
|
|
3663
3753
|
children: "\u2212"
|
|
3664
3754
|
}
|
|
3665
3755
|
)
|
|
3666
3756
|
}
|
|
3667
3757
|
),
|
|
3668
|
-
/* @__PURE__ */ (0,
|
|
3669
|
-
|
|
3758
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3759
|
+
import_react_native44.View,
|
|
3670
3760
|
{
|
|
3671
3761
|
style: [
|
|
3672
|
-
|
|
3762
|
+
styles40.inputWrapper,
|
|
3673
3763
|
{
|
|
3674
3764
|
borderColor,
|
|
3675
3765
|
backgroundColor: colors2.colorBg
|
|
3676
3766
|
}
|
|
3677
3767
|
],
|
|
3678
|
-
children: /* @__PURE__ */ (0,
|
|
3679
|
-
|
|
3768
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3769
|
+
ScaledTextInput,
|
|
3680
3770
|
{
|
|
3681
3771
|
accessibilityLabel: label,
|
|
3682
3772
|
accessibilityState: { disabled },
|
|
@@ -3695,15 +3785,15 @@ function NumberInput({
|
|
|
3695
3785
|
update(safe);
|
|
3696
3786
|
},
|
|
3697
3787
|
style: [
|
|
3698
|
-
|
|
3788
|
+
styles40.input,
|
|
3699
3789
|
{ color: colors2.colorOnBg }
|
|
3700
3790
|
]
|
|
3701
3791
|
}
|
|
3702
3792
|
)
|
|
3703
3793
|
}
|
|
3704
3794
|
),
|
|
3705
|
-
/* @__PURE__ */ (0,
|
|
3706
|
-
|
|
3795
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3796
|
+
import_react_native44.Pressable,
|
|
3707
3797
|
{
|
|
3708
3798
|
accessibilityRole: "button",
|
|
3709
3799
|
accessibilityLabel: "Increase",
|
|
@@ -3711,8 +3801,8 @@ function NumberInput({
|
|
|
3711
3801
|
disabled: disabled || !canIncrease,
|
|
3712
3802
|
onPress: () => update(currentValue + step),
|
|
3713
3803
|
style: ({ pressed }) => [
|
|
3714
|
-
|
|
3715
|
-
|
|
3804
|
+
styles40.stepper,
|
|
3805
|
+
styles40.stepperEnd,
|
|
3716
3806
|
{
|
|
3717
3807
|
borderColor,
|
|
3718
3808
|
backgroundColor: colors2.colorBgSubtle
|
|
@@ -3720,10 +3810,10 @@ function NumberInput({
|
|
|
3720
3810
|
pressed && { opacity: 0.7 },
|
|
3721
3811
|
(disabled || !canIncrease) && { opacity: 0.4 }
|
|
3722
3812
|
],
|
|
3723
|
-
children: /* @__PURE__ */ (0,
|
|
3724
|
-
|
|
3813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3814
|
+
ScaledText,
|
|
3725
3815
|
{
|
|
3726
|
-
style: [
|
|
3816
|
+
style: [styles40.stepperText, { color: colors2.colorOnBg }],
|
|
3727
3817
|
"aria-hidden": true,
|
|
3728
3818
|
children: "+"
|
|
3729
3819
|
}
|
|
@@ -3731,15 +3821,15 @@ function NumberInput({
|
|
|
3731
3821
|
}
|
|
3732
3822
|
)
|
|
3733
3823
|
] }),
|
|
3734
|
-
/* @__PURE__ */ (0,
|
|
3735
|
-
/* @__PURE__ */ (0,
|
|
3824
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Message, { type: "error", message: error }),
|
|
3825
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Message, { type: "hint", message: hint })
|
|
3736
3826
|
] });
|
|
3737
3827
|
}
|
|
3738
3828
|
|
|
3739
3829
|
// src/components/interaction/Dialog/Dialog.tsx
|
|
3740
|
-
var
|
|
3741
|
-
var
|
|
3742
|
-
var
|
|
3830
|
+
var import_react_native45 = require("react-native");
|
|
3831
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3832
|
+
var styles41 = import_react_native45.StyleSheet.create({
|
|
3743
3833
|
overlay: {
|
|
3744
3834
|
flex: 1,
|
|
3745
3835
|
justifyContent: "center",
|
|
@@ -3795,50 +3885,50 @@ function Dialog({
|
|
|
3795
3885
|
style
|
|
3796
3886
|
}) {
|
|
3797
3887
|
const { colors: colors2 } = useTheme();
|
|
3798
|
-
return /* @__PURE__ */ (0,
|
|
3799
|
-
|
|
3888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3889
|
+
import_react_native45.Modal,
|
|
3800
3890
|
{
|
|
3801
3891
|
visible: isOpen,
|
|
3802
3892
|
transparent: true,
|
|
3803
3893
|
animationType: "fade",
|
|
3804
3894
|
onRequestClose: onClose,
|
|
3805
|
-
children: /* @__PURE__ */ (0,
|
|
3806
|
-
/* @__PURE__ */ (0,
|
|
3807
|
-
|
|
3895
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react_native45.View, { style: styles41.overlay, children: [
|
|
3896
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3897
|
+
import_react_native45.Pressable,
|
|
3808
3898
|
{
|
|
3809
3899
|
testID: "bds-dialog-backdrop",
|
|
3810
|
-
style:
|
|
3900
|
+
style: import_react_native45.StyleSheet.absoluteFill,
|
|
3811
3901
|
onPress: onClose,
|
|
3812
3902
|
accessible: false,
|
|
3813
3903
|
importantForAccessibility: "no"
|
|
3814
3904
|
}
|
|
3815
3905
|
),
|
|
3816
|
-
/* @__PURE__ */ (0,
|
|
3817
|
-
|
|
3906
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3907
|
+
import_react_native45.View,
|
|
3818
3908
|
{
|
|
3819
|
-
style: [
|
|
3909
|
+
style: [styles41.panel, { backgroundColor: colors2.colorGreySubtle }, style],
|
|
3820
3910
|
accessibilityViewIsModal: true,
|
|
3821
3911
|
onAccessibilityEscape: onClose,
|
|
3822
3912
|
children: [
|
|
3823
|
-
/* @__PURE__ */ (0,
|
|
3824
|
-
|
|
3913
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3914
|
+
import_react_native45.Pressable,
|
|
3825
3915
|
{
|
|
3826
|
-
style:
|
|
3916
|
+
style: styles41.closeButton,
|
|
3827
3917
|
onPress: onClose,
|
|
3828
3918
|
accessibilityRole: "button",
|
|
3829
3919
|
accessibilityLabel: "Close dialog",
|
|
3830
3920
|
hitSlop: 8,
|
|
3831
|
-
children: /* @__PURE__ */ (0,
|
|
3832
|
-
|
|
3921
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3922
|
+
ScaledText,
|
|
3833
3923
|
{
|
|
3834
|
-
style: [
|
|
3924
|
+
style: [styles41.closeText, { color: colors2.colorOnBgSubtle }],
|
|
3835
3925
|
"aria-hidden": true,
|
|
3836
3926
|
children: "\u2715"
|
|
3837
3927
|
}
|
|
3838
3928
|
)
|
|
3839
3929
|
}
|
|
3840
3930
|
),
|
|
3841
|
-
!!title && /* @__PURE__ */ (0,
|
|
3931
|
+
!!title && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_native45.View, { style: styles41.header, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ScaledText, { style: [styles41.title, { color: colors2.colorOnGreySubtle }], children: title }) }),
|
|
3842
3932
|
children
|
|
3843
3933
|
]
|
|
3844
3934
|
}
|
|
@@ -3849,10 +3939,10 @@ function Dialog({
|
|
|
3849
3939
|
}
|
|
3850
3940
|
|
|
3851
3941
|
// src/components/interaction/SideSheet/SideSheet.tsx
|
|
3852
|
-
var
|
|
3853
|
-
var
|
|
3854
|
-
var
|
|
3855
|
-
var
|
|
3942
|
+
var import_react17 = require("react");
|
|
3943
|
+
var import_react_native46 = require("react-native");
|
|
3944
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3945
|
+
var styles42 = import_react_native46.StyleSheet.create({
|
|
3856
3946
|
overlay: {
|
|
3857
3947
|
flex: 1,
|
|
3858
3948
|
justifyContent: "flex-end"
|
|
@@ -3909,31 +3999,31 @@ function SideSheet({
|
|
|
3909
3999
|
style
|
|
3910
4000
|
}) {
|
|
3911
4001
|
const { colors: colors2 } = useTheme();
|
|
3912
|
-
const screenHeight =
|
|
3913
|
-
const slideAnim = (0,
|
|
3914
|
-
const backdropAnim = (0,
|
|
3915
|
-
(0,
|
|
4002
|
+
const screenHeight = import_react_native46.Dimensions.get("window").height;
|
|
4003
|
+
const slideAnim = (0, import_react17.useRef)(new import_react_native46.Animated.Value(screenHeight)).current;
|
|
4004
|
+
const backdropAnim = (0, import_react17.useRef)(new import_react_native46.Animated.Value(0)).current;
|
|
4005
|
+
(0, import_react17.useEffect)(() => {
|
|
3916
4006
|
if (isOpen) {
|
|
3917
|
-
|
|
3918
|
-
|
|
4007
|
+
import_react_native46.Animated.parallel([
|
|
4008
|
+
import_react_native46.Animated.timing(slideAnim, {
|
|
3919
4009
|
toValue: 0,
|
|
3920
4010
|
duration: 250,
|
|
3921
4011
|
useNativeDriver: true
|
|
3922
4012
|
}),
|
|
3923
|
-
|
|
4013
|
+
import_react_native46.Animated.timing(backdropAnim, {
|
|
3924
4014
|
toValue: 1,
|
|
3925
4015
|
duration: 250,
|
|
3926
4016
|
useNativeDriver: true
|
|
3927
4017
|
})
|
|
3928
4018
|
]).start();
|
|
3929
4019
|
} else {
|
|
3930
|
-
|
|
3931
|
-
|
|
4020
|
+
import_react_native46.Animated.parallel([
|
|
4021
|
+
import_react_native46.Animated.timing(slideAnim, {
|
|
3932
4022
|
toValue: screenHeight,
|
|
3933
4023
|
duration: 200,
|
|
3934
4024
|
useNativeDriver: true
|
|
3935
4025
|
}),
|
|
3936
|
-
|
|
4026
|
+
import_react_native46.Animated.timing(backdropAnim, {
|
|
3937
4027
|
toValue: 0,
|
|
3938
4028
|
duration: 200,
|
|
3939
4029
|
useNativeDriver: true
|
|
@@ -3941,25 +4031,25 @@ function SideSheet({
|
|
|
3941
4031
|
]).start();
|
|
3942
4032
|
}
|
|
3943
4033
|
}, [isOpen, slideAnim, backdropAnim, screenHeight]);
|
|
3944
|
-
return /* @__PURE__ */ (0,
|
|
3945
|
-
|
|
4034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4035
|
+
import_react_native46.Modal,
|
|
3946
4036
|
{
|
|
3947
4037
|
visible: isOpen,
|
|
3948
4038
|
transparent: true,
|
|
3949
4039
|
animationType: "none",
|
|
3950
4040
|
onRequestClose: onClose,
|
|
3951
|
-
children: /* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
3953
|
-
|
|
4041
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react_native46.View, { style: styles42.overlay, children: [
|
|
4042
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4043
|
+
import_react_native46.Animated.View,
|
|
3954
4044
|
{
|
|
3955
4045
|
style: [
|
|
3956
|
-
|
|
4046
|
+
import_react_native46.StyleSheet.absoluteFill,
|
|
3957
4047
|
{ backgroundColor: "rgba(0, 0, 0, 0.5)", opacity: backdropAnim }
|
|
3958
4048
|
],
|
|
3959
|
-
children: /* @__PURE__ */ (0,
|
|
3960
|
-
|
|
4049
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4050
|
+
import_react_native46.Pressable,
|
|
3961
4051
|
{
|
|
3962
|
-
style:
|
|
4052
|
+
style: import_react_native46.StyleSheet.absoluteFill,
|
|
3963
4053
|
onPress: onClose,
|
|
3964
4054
|
testID: "bds-sidesheet-backdrop",
|
|
3965
4055
|
accessible: false,
|
|
@@ -3968,11 +4058,11 @@ function SideSheet({
|
|
|
3968
4058
|
)
|
|
3969
4059
|
}
|
|
3970
4060
|
),
|
|
3971
|
-
/* @__PURE__ */ (0,
|
|
3972
|
-
|
|
4061
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4062
|
+
import_react_native46.Animated.View,
|
|
3973
4063
|
{
|
|
3974
4064
|
style: [
|
|
3975
|
-
|
|
4065
|
+
styles42.panel,
|
|
3976
4066
|
{
|
|
3977
4067
|
backgroundColor: colors2.colorBg,
|
|
3978
4068
|
transform: [{ translateY: slideAnim }]
|
|
@@ -3982,24 +4072,24 @@ function SideSheet({
|
|
|
3982
4072
|
accessibilityViewIsModal: true,
|
|
3983
4073
|
onAccessibilityEscape: onClose,
|
|
3984
4074
|
children: [
|
|
3985
|
-
/* @__PURE__ */ (0,
|
|
3986
|
-
|
|
4075
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4076
|
+
import_react_native46.View,
|
|
3987
4077
|
{
|
|
3988
|
-
style: [
|
|
4078
|
+
style: [styles42.header, { borderBottomColor: colors2.colorBgSubtle }],
|
|
3989
4079
|
children: [
|
|
3990
|
-
!!title && /* @__PURE__ */ (0,
|
|
3991
|
-
/* @__PURE__ */ (0,
|
|
3992
|
-
|
|
4080
|
+
!!title && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ScaledText, { style: [styles42.title, { color: colors2.colorOnBg }], children: title }),
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4082
|
+
import_react_native46.Pressable,
|
|
3993
4083
|
{
|
|
3994
|
-
style:
|
|
4084
|
+
style: styles42.closeButton,
|
|
3995
4085
|
onPress: onClose,
|
|
3996
4086
|
accessibilityRole: "button",
|
|
3997
4087
|
accessibilityLabel: "Close side sheet",
|
|
3998
4088
|
hitSlop: 8,
|
|
3999
|
-
children: /* @__PURE__ */ (0,
|
|
4000
|
-
|
|
4089
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4090
|
+
ScaledText,
|
|
4001
4091
|
{
|
|
4002
|
-
style: [
|
|
4092
|
+
style: [styles42.closeText, { color: colors2.colorOnBgSubtle }],
|
|
4003
4093
|
"aria-hidden": true,
|
|
4004
4094
|
children: "\u2715"
|
|
4005
4095
|
}
|
|
@@ -4009,7 +4099,7 @@ function SideSheet({
|
|
|
4009
4099
|
]
|
|
4010
4100
|
}
|
|
4011
4101
|
),
|
|
4012
|
-
/* @__PURE__ */ (0,
|
|
4102
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native46.View, { style: styles42.body, testID: "bds-sidesheet-body", children })
|
|
4013
4103
|
]
|
|
4014
4104
|
}
|
|
4015
4105
|
)
|
|
@@ -4019,11 +4109,11 @@ function SideSheet({
|
|
|
4019
4109
|
}
|
|
4020
4110
|
|
|
4021
4111
|
// src/components/interaction/Toast/Toast.tsx
|
|
4022
|
-
var
|
|
4023
|
-
var
|
|
4024
|
-
var
|
|
4025
|
-
var ToastContext = (0,
|
|
4026
|
-
var
|
|
4112
|
+
var import_react18 = require("react");
|
|
4113
|
+
var import_react_native47 = require("react-native");
|
|
4114
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4115
|
+
var ToastContext = (0, import_react18.createContext)(void 0);
|
|
4116
|
+
var styles43 = import_react_native47.StyleSheet.create({
|
|
4027
4117
|
container: {
|
|
4028
4118
|
position: "absolute",
|
|
4029
4119
|
top: 0,
|
|
@@ -4068,9 +4158,9 @@ function ToastItem({
|
|
|
4068
4158
|
onRemove
|
|
4069
4159
|
}) {
|
|
4070
4160
|
const { colors: colors2 } = useTheme();
|
|
4071
|
-
const slideAnim = (0,
|
|
4072
|
-
const opacityAnim = (0,
|
|
4073
|
-
const variantColors = (0,
|
|
4161
|
+
const slideAnim = (0, import_react18.useRef)(new import_react_native47.Animated.Value(-100)).current;
|
|
4162
|
+
const opacityAnim = (0, import_react18.useRef)(new import_react_native47.Animated.Value(0)).current;
|
|
4163
|
+
const variantColors = (0, import_react18.useMemo)(
|
|
4074
4164
|
() => ({
|
|
4075
4165
|
success: { bg: colors2.colorSuccess, text: colors2.colorOnSuccess },
|
|
4076
4166
|
error: { bg: colors2.colorError, text: colors2.colorOnError },
|
|
@@ -4078,30 +4168,30 @@ function ToastItem({
|
|
|
4078
4168
|
}),
|
|
4079
4169
|
[colors2]
|
|
4080
4170
|
);
|
|
4081
|
-
(0,
|
|
4082
|
-
|
|
4083
|
-
|
|
4171
|
+
(0, import_react18.useEffect)(() => {
|
|
4172
|
+
import_react_native47.Animated.parallel([
|
|
4173
|
+
import_react_native47.Animated.timing(slideAnim, {
|
|
4084
4174
|
toValue: 0,
|
|
4085
4175
|
duration: 200,
|
|
4086
4176
|
useNativeDriver: true
|
|
4087
4177
|
}),
|
|
4088
|
-
|
|
4178
|
+
import_react_native47.Animated.timing(opacityAnim, {
|
|
4089
4179
|
toValue: 1,
|
|
4090
4180
|
duration: 200,
|
|
4091
4181
|
useNativeDriver: true
|
|
4092
4182
|
})
|
|
4093
4183
|
]).start();
|
|
4094
4184
|
}, [slideAnim, opacityAnim]);
|
|
4095
|
-
(0,
|
|
4185
|
+
(0, import_react18.useEffect)(() => {
|
|
4096
4186
|
const timer = setTimeout(onRemove, 5e3);
|
|
4097
4187
|
return () => clearTimeout(timer);
|
|
4098
4188
|
}, [onRemove]);
|
|
4099
4189
|
const { bg, text } = variantColors[toast.variant];
|
|
4100
|
-
return /* @__PURE__ */ (0,
|
|
4101
|
-
|
|
4190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
4191
|
+
import_react_native47.Animated.View,
|
|
4102
4192
|
{
|
|
4103
4193
|
style: [
|
|
4104
|
-
|
|
4194
|
+
styles43.toast,
|
|
4105
4195
|
{
|
|
4106
4196
|
backgroundColor: bg,
|
|
4107
4197
|
transform: [{ translateY: slideAnim }],
|
|
@@ -4111,16 +4201,16 @@ function ToastItem({
|
|
|
4111
4201
|
accessibilityRole: "alert",
|
|
4112
4202
|
accessibilityLiveRegion: "polite",
|
|
4113
4203
|
children: [
|
|
4114
|
-
/* @__PURE__ */ (0,
|
|
4115
|
-
/* @__PURE__ */ (0,
|
|
4116
|
-
|
|
4204
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScaledText, { style: [styles43.message, { color: text }], children: toast.message }),
|
|
4205
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4206
|
+
import_react_native47.Pressable,
|
|
4117
4207
|
{
|
|
4118
|
-
style:
|
|
4208
|
+
style: styles43.closeButton,
|
|
4119
4209
|
onPress: onRemove,
|
|
4120
4210
|
accessibilityRole: "button",
|
|
4121
4211
|
accessibilityLabel: "Dismiss",
|
|
4122
4212
|
hitSlop: 8,
|
|
4123
|
-
children: /* @__PURE__ */ (0,
|
|
4213
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScaledText, { style: [styles43.closeText, { color: text }], "aria-hidden": true, children: "\u2715" })
|
|
4124
4214
|
}
|
|
4125
4215
|
)
|
|
4126
4216
|
]
|
|
@@ -4131,24 +4221,24 @@ function ToastProvider({
|
|
|
4131
4221
|
children,
|
|
4132
4222
|
style
|
|
4133
4223
|
}) {
|
|
4134
|
-
const [toasts, setToasts] = (0,
|
|
4135
|
-
const showToast = (0,
|
|
4224
|
+
const [toasts, setToasts] = (0, import_react18.useState)([]);
|
|
4225
|
+
const showToast = (0, import_react18.useCallback)((message, variant) => {
|
|
4136
4226
|
const id = Math.random().toString(36).substring(2, 9);
|
|
4137
4227
|
setToasts((prev) => [...prev, { id, message, variant }]);
|
|
4138
4228
|
}, []);
|
|
4139
|
-
const removeToast = (0,
|
|
4229
|
+
const removeToast = (0, import_react18.useCallback)((id) => {
|
|
4140
4230
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
4141
4231
|
}, []);
|
|
4142
|
-
const value = (0,
|
|
4143
|
-
return /* @__PURE__ */ (0,
|
|
4232
|
+
const value = (0, import_react18.useMemo)(() => ({ showToast }), [showToast]);
|
|
4233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ToastContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native47.View, { style: [{ flex: 1 }, style], children: [
|
|
4144
4234
|
children,
|
|
4145
|
-
toasts.length > 0 && /* @__PURE__ */ (0,
|
|
4146
|
-
|
|
4235
|
+
toasts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4236
|
+
import_react_native47.View,
|
|
4147
4237
|
{
|
|
4148
|
-
style:
|
|
4238
|
+
style: styles43.container,
|
|
4149
4239
|
accessibilityRole: "summary",
|
|
4150
4240
|
accessibilityLabel: "Notifications",
|
|
4151
|
-
children: toasts.map((toast) => /* @__PURE__ */ (0,
|
|
4241
|
+
children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4152
4242
|
ToastItem,
|
|
4153
4243
|
{
|
|
4154
4244
|
toast,
|
|
@@ -4161,7 +4251,7 @@ function ToastProvider({
|
|
|
4161
4251
|
] }) });
|
|
4162
4252
|
}
|
|
4163
4253
|
function useToast() {
|
|
4164
|
-
const context = (0,
|
|
4254
|
+
const context = (0, import_react18.useContext)(ToastContext);
|
|
4165
4255
|
if (!context) {
|
|
4166
4256
|
throw new Error("useToast must be used within a ToastProvider");
|
|
4167
4257
|
}
|
|
@@ -4169,10 +4259,10 @@ function useToast() {
|
|
|
4169
4259
|
}
|
|
4170
4260
|
|
|
4171
4261
|
// src/components/interaction/DropdownMenu/DropdownMenu.tsx
|
|
4172
|
-
var
|
|
4173
|
-
var
|
|
4174
|
-
var
|
|
4175
|
-
var
|
|
4262
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
4263
|
+
var import_react_native48 = require("react-native");
|
|
4264
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4265
|
+
var styles44 = import_react_native48.StyleSheet.create({
|
|
4176
4266
|
overlay: {
|
|
4177
4267
|
flex: 1,
|
|
4178
4268
|
justifyContent: "flex-end"
|
|
@@ -4229,32 +4319,32 @@ function DropdownMenu({
|
|
|
4229
4319
|
style
|
|
4230
4320
|
}) {
|
|
4231
4321
|
const { colors: colors2 } = useTheme();
|
|
4232
|
-
const [open, setOpen] = (0,
|
|
4233
|
-
const screenHeight =
|
|
4234
|
-
const slideAnim = (0,
|
|
4235
|
-
const backdropAnim = (0,
|
|
4236
|
-
(0,
|
|
4322
|
+
const [open, setOpen] = (0, import_react19.useState)(false);
|
|
4323
|
+
const screenHeight = import_react_native48.Dimensions.get("window").height;
|
|
4324
|
+
const slideAnim = (0, import_react19.useRef)(new import_react_native48.Animated.Value(screenHeight)).current;
|
|
4325
|
+
const backdropAnim = (0, import_react19.useRef)(new import_react_native48.Animated.Value(0)).current;
|
|
4326
|
+
(0, import_react19.useEffect)(() => {
|
|
4237
4327
|
if (open) {
|
|
4238
|
-
|
|
4239
|
-
|
|
4328
|
+
import_react_native48.Animated.parallel([
|
|
4329
|
+
import_react_native48.Animated.timing(slideAnim, {
|
|
4240
4330
|
toValue: 0,
|
|
4241
4331
|
duration: 250,
|
|
4242
4332
|
useNativeDriver: true
|
|
4243
4333
|
}),
|
|
4244
|
-
|
|
4334
|
+
import_react_native48.Animated.timing(backdropAnim, {
|
|
4245
4335
|
toValue: 1,
|
|
4246
4336
|
duration: 250,
|
|
4247
4337
|
useNativeDriver: true
|
|
4248
4338
|
})
|
|
4249
4339
|
]).start();
|
|
4250
4340
|
} else {
|
|
4251
|
-
|
|
4252
|
-
|
|
4341
|
+
import_react_native48.Animated.parallel([
|
|
4342
|
+
import_react_native48.Animated.timing(slideAnim, {
|
|
4253
4343
|
toValue: screenHeight,
|
|
4254
4344
|
duration: 200,
|
|
4255
4345
|
useNativeDriver: true
|
|
4256
4346
|
}),
|
|
4257
|
-
|
|
4347
|
+
import_react_native48.Animated.timing(backdropAnim, {
|
|
4258
4348
|
toValue: 0,
|
|
4259
4349
|
duration: 200,
|
|
4260
4350
|
useNativeDriver: true
|
|
@@ -4266,31 +4356,31 @@ function DropdownMenu({
|
|
|
4266
4356
|
item.onPress?.();
|
|
4267
4357
|
setOpen(false);
|
|
4268
4358
|
};
|
|
4269
|
-
return /* @__PURE__ */ (0,
|
|
4270
|
-
|
|
4359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react_native48.View, { style, children: [
|
|
4360
|
+
import_react19.default.cloneElement(trigger, {
|
|
4271
4361
|
onPress: () => setOpen(true),
|
|
4272
4362
|
accessibilityRole: "button",
|
|
4273
4363
|
accessibilityLabel: title
|
|
4274
4364
|
}),
|
|
4275
|
-
/* @__PURE__ */ (0,
|
|
4276
|
-
|
|
4365
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4366
|
+
import_react_native48.Modal,
|
|
4277
4367
|
{
|
|
4278
4368
|
visible: open,
|
|
4279
4369
|
transparent: true,
|
|
4280
4370
|
animationType: "none",
|
|
4281
4371
|
onRequestClose: () => setOpen(false),
|
|
4282
|
-
children: /* @__PURE__ */ (0,
|
|
4283
|
-
/* @__PURE__ */ (0,
|
|
4284
|
-
|
|
4372
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react_native48.View, { style: styles44.overlay, children: [
|
|
4373
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4374
|
+
import_react_native48.Animated.View,
|
|
4285
4375
|
{
|
|
4286
4376
|
style: [
|
|
4287
|
-
|
|
4377
|
+
import_react_native48.StyleSheet.absoluteFill,
|
|
4288
4378
|
{ backgroundColor: "rgba(0, 0, 0, 0.5)", opacity: backdropAnim }
|
|
4289
4379
|
],
|
|
4290
|
-
children: /* @__PURE__ */ (0,
|
|
4291
|
-
|
|
4380
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4381
|
+
import_react_native48.Pressable,
|
|
4292
4382
|
{
|
|
4293
|
-
style:
|
|
4383
|
+
style: import_react_native48.StyleSheet.absoluteFill,
|
|
4294
4384
|
onPress: () => setOpen(false),
|
|
4295
4385
|
testID: "bds-dropdownmenu-backdrop",
|
|
4296
4386
|
accessible: false,
|
|
@@ -4299,11 +4389,11 @@ function DropdownMenu({
|
|
|
4299
4389
|
)
|
|
4300
4390
|
}
|
|
4301
4391
|
),
|
|
4302
|
-
/* @__PURE__ */ (0,
|
|
4303
|
-
|
|
4392
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4393
|
+
import_react_native48.Animated.View,
|
|
4304
4394
|
{
|
|
4305
4395
|
style: [
|
|
4306
|
-
|
|
4396
|
+
styles44.sheet,
|
|
4307
4397
|
{
|
|
4308
4398
|
backgroundColor: colors2.colorBg,
|
|
4309
4399
|
transform: [{ translateY: slideAnim }]
|
|
@@ -4311,28 +4401,28 @@ function DropdownMenu({
|
|
|
4311
4401
|
],
|
|
4312
4402
|
accessibilityViewIsModal: true,
|
|
4313
4403
|
onAccessibilityEscape: () => setOpen(false),
|
|
4314
|
-
children: /* @__PURE__ */ (0,
|
|
4315
|
-
/* @__PURE__ */ (0,
|
|
4316
|
-
|
|
4404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react_native48.SafeAreaView, { children: [
|
|
4405
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
4406
|
+
import_react_native48.View,
|
|
4317
4407
|
{
|
|
4318
4408
|
style: [
|
|
4319
|
-
|
|
4409
|
+
styles44.sheetHeader,
|
|
4320
4410
|
{ borderBottomColor: colors2.colorBgSubtle }
|
|
4321
4411
|
],
|
|
4322
4412
|
children: [
|
|
4323
|
-
/* @__PURE__ */ (0,
|
|
4324
|
-
/* @__PURE__ */ (0,
|
|
4325
|
-
|
|
4413
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ScaledText, { style: [styles44.sheetTitle, { color: colors2.colorOnBg }], children: title }),
|
|
4414
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4415
|
+
import_react_native48.Pressable,
|
|
4326
4416
|
{
|
|
4327
4417
|
accessibilityRole: "button",
|
|
4328
4418
|
accessibilityLabel: "Close",
|
|
4329
4419
|
onPress: () => setOpen(false),
|
|
4330
4420
|
hitSlop: 8,
|
|
4331
|
-
children: /* @__PURE__ */ (0,
|
|
4332
|
-
|
|
4421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4422
|
+
ScaledText,
|
|
4333
4423
|
{
|
|
4334
4424
|
style: [
|
|
4335
|
-
|
|
4425
|
+
styles44.closeText,
|
|
4336
4426
|
{ color: colors2.colorInteractive }
|
|
4337
4427
|
],
|
|
4338
4428
|
children: "Done"
|
|
@@ -4343,24 +4433,24 @@ function DropdownMenu({
|
|
|
4343
4433
|
]
|
|
4344
4434
|
}
|
|
4345
4435
|
),
|
|
4346
|
-
/* @__PURE__ */ (0,
|
|
4347
|
-
|
|
4436
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4437
|
+
import_react_native48.FlatList,
|
|
4348
4438
|
{
|
|
4349
4439
|
data: items,
|
|
4350
4440
|
keyExtractor: (item) => item.id,
|
|
4351
|
-
renderItem: ({ item }) => /* @__PURE__ */ (0,
|
|
4352
|
-
item.separator && /* @__PURE__ */ (0,
|
|
4353
|
-
|
|
4441
|
+
renderItem: ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
4442
|
+
item.separator && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4443
|
+
import_react_native48.View,
|
|
4354
4444
|
{
|
|
4355
4445
|
style: [
|
|
4356
|
-
|
|
4446
|
+
styles44.separator,
|
|
4357
4447
|
{ backgroundColor: colors2.colorBgSubtle }
|
|
4358
4448
|
],
|
|
4359
4449
|
accessibilityRole: "none"
|
|
4360
4450
|
}
|
|
4361
4451
|
),
|
|
4362
|
-
/* @__PURE__ */ (0,
|
|
4363
|
-
|
|
4452
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
4453
|
+
import_react_native48.Pressable,
|
|
4364
4454
|
{
|
|
4365
4455
|
accessibilityRole: "menuitem",
|
|
4366
4456
|
accessibilityLabel: item.label,
|
|
@@ -4368,24 +4458,24 @@ function DropdownMenu({
|
|
|
4368
4458
|
disabled: item.disabled,
|
|
4369
4459
|
onPress: () => handleItemPress(item),
|
|
4370
4460
|
style: ({ pressed }) => [
|
|
4371
|
-
|
|
4461
|
+
styles44.item,
|
|
4372
4462
|
pressed && { backgroundColor: colors2.colorBgSubtle },
|
|
4373
4463
|
item.disabled && { opacity: 0.4 }
|
|
4374
4464
|
],
|
|
4375
4465
|
children: [
|
|
4376
|
-
!!item.icon && /* @__PURE__ */ (0,
|
|
4377
|
-
|
|
4466
|
+
!!item.icon && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4467
|
+
import_react_native48.View,
|
|
4378
4468
|
{
|
|
4379
4469
|
importantForAccessibility: "no-hide-descendants",
|
|
4380
4470
|
accessibilityElementsHidden: true,
|
|
4381
4471
|
children: item.icon
|
|
4382
4472
|
}
|
|
4383
4473
|
),
|
|
4384
|
-
/* @__PURE__ */ (0,
|
|
4385
|
-
|
|
4474
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4475
|
+
ScaledText,
|
|
4386
4476
|
{
|
|
4387
4477
|
style: [
|
|
4388
|
-
|
|
4478
|
+
styles44.itemText,
|
|
4389
4479
|
{ color: colors2.colorOnBg }
|
|
4390
4480
|
],
|
|
4391
4481
|
children: item.label
|
|
@@ -4407,10 +4497,10 @@ function DropdownMenu({
|
|
|
4407
4497
|
}
|
|
4408
4498
|
|
|
4409
4499
|
// src/components/interaction/Popover/Popover.tsx
|
|
4410
|
-
var
|
|
4411
|
-
var
|
|
4412
|
-
var
|
|
4413
|
-
var
|
|
4500
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
4501
|
+
var import_react_native49 = require("react-native");
|
|
4502
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4503
|
+
var styles45 = import_react_native49.StyleSheet.create({
|
|
4414
4504
|
wrapper: {
|
|
4415
4505
|
alignSelf: "flex-start"
|
|
4416
4506
|
},
|
|
@@ -4440,37 +4530,37 @@ function Popover({
|
|
|
4440
4530
|
style
|
|
4441
4531
|
}) {
|
|
4442
4532
|
const { colors: colors2 } = useTheme();
|
|
4443
|
-
const [isOpen, setIsOpen] = (0,
|
|
4533
|
+
const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
|
|
4444
4534
|
const close = () => setIsOpen(false);
|
|
4445
|
-
return /* @__PURE__ */ (0,
|
|
4446
|
-
|
|
4535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_react_native49.View, { style: [styles45.wrapper, style], children: [
|
|
4536
|
+
import_react20.default.cloneElement(children, {
|
|
4447
4537
|
onPress: () => setIsOpen(true),
|
|
4448
4538
|
accessibilityRole: "button",
|
|
4449
4539
|
accessibilityLabel: accessibilityLabel ?? "Open popover"
|
|
4450
4540
|
}),
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4452
|
-
|
|
4541
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4542
|
+
import_react_native49.Modal,
|
|
4453
4543
|
{
|
|
4454
4544
|
visible: isOpen,
|
|
4455
4545
|
transparent: true,
|
|
4456
4546
|
animationType: "fade",
|
|
4457
4547
|
onRequestClose: close,
|
|
4458
|
-
children: /* @__PURE__ */ (0,
|
|
4459
|
-
/* @__PURE__ */ (0,
|
|
4460
|
-
|
|
4548
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_react_native49.View, { style: styles45.overlay, onAccessibilityEscape: close, children: [
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4550
|
+
import_react_native49.Pressable,
|
|
4461
4551
|
{
|
|
4462
4552
|
testID: "bds-popover-backdrop",
|
|
4463
|
-
style:
|
|
4553
|
+
style: import_react_native49.StyleSheet.absoluteFill,
|
|
4464
4554
|
onPress: close,
|
|
4465
4555
|
onAccessibilityTap: close,
|
|
4466
4556
|
accessibilityRole: "button",
|
|
4467
4557
|
accessibilityLabel: "Close popover"
|
|
4468
4558
|
}
|
|
4469
4559
|
),
|
|
4470
|
-
/* @__PURE__ */ (0,
|
|
4471
|
-
|
|
4560
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4561
|
+
import_react_native49.View,
|
|
4472
4562
|
{
|
|
4473
|
-
style: [
|
|
4563
|
+
style: [styles45.panel, { backgroundColor: colors2.colorBg }],
|
|
4474
4564
|
accessibilityLabel,
|
|
4475
4565
|
children: content
|
|
4476
4566
|
}
|