@boostdev/design-system-react-native 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +10 -0
- package/dist/index.cjs +587 -535
- package/dist/index.d.cts +35 -4
- package/dist/index.d.ts +35 -4
- package/dist/index.js +440 -492
- package/package.json +1 -1
- package/src/components/interaction/Button/Button.spec.tsx +17 -0
- package/src/components/interaction/Button/Button.tsx +8 -2
- 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.tsx +2 -10
- package/src/components/interaction/form/FileInput/FileInput.tsx +2 -1
- package/src/components/interaction/form/FormInput/FormInput.spec.tsx +11 -9
- package/src/components/interaction/form/FormInput/FormInput.tsx +4 -10
- package/src/components/interaction/form/NumberInput/NumberInput.tsx +2 -9
- 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.tsx +2 -11
- package/src/components/interaction/form/Slider/Slider.tsx +2 -9
- package/src/components/interaction/form/Textarea/Textarea.tsx +2 -7
- 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.tsx +2 -12
- 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/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/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,13 @@ function Pagination({
|
|
|
1122
1161
|
}
|
|
1123
1162
|
|
|
1124
1163
|
// src/components/ui/Collapsible/Collapsible.tsx
|
|
1125
|
-
var
|
|
1126
|
-
var
|
|
1127
|
-
var
|
|
1128
|
-
if (
|
|
1129
|
-
|
|
1164
|
+
var import_react5 = require("react");
|
|
1165
|
+
var import_react_native18 = require("react-native");
|
|
1166
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1167
|
+
if (import_react_native18.Platform.OS === "android" && import_react_native18.UIManager.setLayoutAnimationEnabledExperimental) {
|
|
1168
|
+
import_react_native18.UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
1130
1169
|
}
|
|
1131
|
-
var styles15 =
|
|
1170
|
+
var styles15 = import_react_native18.StyleSheet.create({
|
|
1132
1171
|
container: {
|
|
1133
1172
|
borderRadius: import_native.border.radius.m,
|
|
1134
1173
|
overflow: "hidden"
|
|
@@ -1176,14 +1215,14 @@ function Collapsible({
|
|
|
1176
1215
|
style
|
|
1177
1216
|
}) {
|
|
1178
1217
|
const { colors: colors2 } = useTheme();
|
|
1179
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
1218
|
+
const [internalOpen, setInternalOpen] = (0, import_react5.useState)(defaultOpen);
|
|
1180
1219
|
const isControlled = controlledOpen !== void 0;
|
|
1181
1220
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
1182
|
-
const rotation = (0,
|
|
1183
|
-
const toggle = (0,
|
|
1221
|
+
const rotation = (0, import_react5.useRef)(new import_react_native18.Animated.Value(isOpen ? 1 : 0)).current;
|
|
1222
|
+
const toggle = (0, import_react5.useCallback)(() => {
|
|
1184
1223
|
const next = !isOpen;
|
|
1185
|
-
|
|
1186
|
-
|
|
1224
|
+
import_react_native18.LayoutAnimation.configureNext(import_react_native18.LayoutAnimation.Presets.easeInEaseOut);
|
|
1225
|
+
import_react_native18.Animated.timing(rotation, {
|
|
1187
1226
|
toValue: next ? 1 : 0,
|
|
1188
1227
|
duration: 200,
|
|
1189
1228
|
useNativeDriver: true
|
|
@@ -1197,14 +1236,14 @@ function Collapsible({
|
|
|
1197
1236
|
inputRange: [0, 1],
|
|
1198
1237
|
outputRange: ["-45deg", "45deg"]
|
|
1199
1238
|
});
|
|
1200
|
-
return /* @__PURE__ */ (0,
|
|
1201
|
-
|
|
1239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1240
|
+
import_react_native18.View,
|
|
1202
1241
|
{
|
|
1203
1242
|
style: [styles15.container, { borderBottomWidth: 1, borderBottomColor: colors2.colorBgSubtle }, style],
|
|
1204
1243
|
accessibilityRole: "summary",
|
|
1205
1244
|
children: [
|
|
1206
|
-
/* @__PURE__ */ (0,
|
|
1207
|
-
|
|
1245
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1246
|
+
import_react_native18.Pressable,
|
|
1208
1247
|
{
|
|
1209
1248
|
onPress: toggle,
|
|
1210
1249
|
accessibilityRole: "button",
|
|
@@ -1212,9 +1251,9 @@ function Collapsible({
|
|
|
1212
1251
|
accessibilityState: { expanded: isOpen },
|
|
1213
1252
|
style: ({ pressed }) => [styles15.header, pressed && styles15.pressed],
|
|
1214
1253
|
children: [
|
|
1215
|
-
/* @__PURE__ */ (0,
|
|
1216
|
-
/* @__PURE__ */ (0,
|
|
1217
|
-
|
|
1254
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ScaledText, { style: [styles15.summaryText, { color: colors2.colorOnBg }], children: summary }),
|
|
1255
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1256
|
+
import_react_native18.Animated.View,
|
|
1218
1257
|
{
|
|
1219
1258
|
testID: "bds-collapsible-chevron",
|
|
1220
1259
|
style: [styles15.chevron, { borderColor: colors2.colorOnBgSubtle, transform: [{ rotate }] }],
|
|
@@ -1225,20 +1264,20 @@ function Collapsible({
|
|
|
1225
1264
|
]
|
|
1226
1265
|
}
|
|
1227
1266
|
),
|
|
1228
|
-
isOpen && /* @__PURE__ */ (0,
|
|
1267
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native18.View, { style: styles15.content, children })
|
|
1229
1268
|
]
|
|
1230
1269
|
}
|
|
1231
1270
|
);
|
|
1232
1271
|
}
|
|
1233
1272
|
|
|
1234
1273
|
// src/components/ui/Accordion/Accordion.tsx
|
|
1235
|
-
var
|
|
1236
|
-
var
|
|
1237
|
-
var
|
|
1238
|
-
if (
|
|
1239
|
-
|
|
1274
|
+
var import_react6 = require("react");
|
|
1275
|
+
var import_react_native19 = require("react-native");
|
|
1276
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1277
|
+
if (import_react_native19.Platform.OS === "android" && import_react_native19.UIManager.setLayoutAnimationEnabledExperimental) {
|
|
1278
|
+
import_react_native19.UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
1240
1279
|
}
|
|
1241
|
-
var styles16 =
|
|
1280
|
+
var styles16 = import_react_native19.StyleSheet.create({
|
|
1242
1281
|
container: {
|
|
1243
1282
|
overflow: "hidden",
|
|
1244
1283
|
borderRadius: import_native.border.radius.s
|
|
@@ -1283,20 +1322,20 @@ function Accordion({
|
|
|
1283
1322
|
style
|
|
1284
1323
|
}) {
|
|
1285
1324
|
const { colors: colors2 } = useTheme();
|
|
1286
|
-
const [openIds, setOpenIds] = (0,
|
|
1325
|
+
const [openIds, setOpenIds] = (0, import_react6.useState)(defaultOpen);
|
|
1287
1326
|
const toggle = (id) => {
|
|
1288
|
-
|
|
1327
|
+
import_react_native19.LayoutAnimation.configureNext(import_react_native19.LayoutAnimation.Presets.easeInEaseOut);
|
|
1289
1328
|
setOpenIds((prev) => {
|
|
1290
1329
|
const isOpen = prev.includes(id);
|
|
1291
1330
|
if (isOpen) return prev.filter((i) => i !== id);
|
|
1292
1331
|
return allowMultiple ? [...prev, id] : [id];
|
|
1293
1332
|
});
|
|
1294
1333
|
};
|
|
1295
|
-
return /* @__PURE__ */ (0,
|
|
1334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native19.View, { style: [styles16.container, style], children: items.map((item, index) => {
|
|
1296
1335
|
const isOpen = openIds.includes(item.id);
|
|
1297
1336
|
const isLast = index === items.length - 1;
|
|
1298
|
-
return /* @__PURE__ */ (0,
|
|
1299
|
-
|
|
1337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1338
|
+
import_react_native19.View,
|
|
1300
1339
|
{
|
|
1301
1340
|
style: [
|
|
1302
1341
|
styles16.item,
|
|
@@ -1304,8 +1343,8 @@ function Accordion({
|
|
|
1304
1343
|
isLast && { borderBottomWidth: 0 }
|
|
1305
1344
|
],
|
|
1306
1345
|
children: [
|
|
1307
|
-
/* @__PURE__ */ (0,
|
|
1308
|
-
|
|
1346
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1347
|
+
import_react_native19.Pressable,
|
|
1309
1348
|
{
|
|
1310
1349
|
onPress: () => toggle(item.id),
|
|
1311
1350
|
disabled: item.disabled,
|
|
@@ -1317,9 +1356,9 @@ function Accordion({
|
|
|
1317
1356
|
pressed && !item.disabled && styles16.pressed
|
|
1318
1357
|
],
|
|
1319
1358
|
children: [
|
|
1320
|
-
/* @__PURE__ */ (0,
|
|
1321
|
-
/* @__PURE__ */ (0,
|
|
1322
|
-
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ScaledText, { style: [styles16.titleText, { color: colors2.colorOnBg }], children: typeof item.title === "string" ? item.title : item.title }),
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1361
|
+
ScaledText,
|
|
1323
1362
|
{
|
|
1324
1363
|
style: [styles16.chevron, { color: colors2.colorOnBgSubtle }],
|
|
1325
1364
|
importantForAccessibility: "no",
|
|
@@ -1330,7 +1369,7 @@ function Accordion({
|
|
|
1330
1369
|
]
|
|
1331
1370
|
}
|
|
1332
1371
|
),
|
|
1333
|
-
isOpen && /* @__PURE__ */ (0,
|
|
1372
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native19.View, { style: styles16.panel, accessibilityRole: "summary", children: item.content })
|
|
1334
1373
|
]
|
|
1335
1374
|
},
|
|
1336
1375
|
item.id
|
|
@@ -1339,10 +1378,10 @@ function Accordion({
|
|
|
1339
1378
|
}
|
|
1340
1379
|
|
|
1341
1380
|
// src/components/ui/Tabs/Tabs.tsx
|
|
1342
|
-
var
|
|
1343
|
-
var
|
|
1344
|
-
var
|
|
1345
|
-
var styles17 =
|
|
1381
|
+
var import_react7 = require("react");
|
|
1382
|
+
var import_react_native20 = require("react-native");
|
|
1383
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1384
|
+
var styles17 = import_react_native20.StyleSheet.create({
|
|
1346
1385
|
container: {
|
|
1347
1386
|
overflow: "hidden"
|
|
1348
1387
|
},
|
|
@@ -1380,10 +1419,10 @@ function Tabs({
|
|
|
1380
1419
|
style
|
|
1381
1420
|
}) {
|
|
1382
1421
|
const { colors: colors2 } = useTheme();
|
|
1383
|
-
const [activeTab, setActiveTab] = (0,
|
|
1384
|
-
return /* @__PURE__ */ (0,
|
|
1385
|
-
/* @__PURE__ */ (0,
|
|
1386
|
-
|
|
1422
|
+
const [activeTab, setActiveTab] = (0, import_react7.useState)(defaultTab ?? tabs[0]?.id);
|
|
1423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native20.View, { style: [styles17.container, style], children: [
|
|
1424
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1425
|
+
import_react_native20.ScrollView,
|
|
1387
1426
|
{
|
|
1388
1427
|
horizontal: true,
|
|
1389
1428
|
showsHorizontalScrollIndicator: false,
|
|
@@ -1391,8 +1430,8 @@ function Tabs({
|
|
|
1391
1430
|
accessibilityRole: "tabbar",
|
|
1392
1431
|
children: tabs.map((tab) => {
|
|
1393
1432
|
const isActive = activeTab === tab.id;
|
|
1394
|
-
return /* @__PURE__ */ (0,
|
|
1395
|
-
|
|
1433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1434
|
+
import_react_native20.Pressable,
|
|
1396
1435
|
{
|
|
1397
1436
|
onPress: () => setActiveTab(tab.id),
|
|
1398
1437
|
disabled: tab.disabled,
|
|
@@ -1410,8 +1449,8 @@ function Tabs({
|
|
|
1410
1449
|
tab.disabled && styles17.disabled,
|
|
1411
1450
|
pressed && !tab.disabled && styles17.pressed
|
|
1412
1451
|
],
|
|
1413
|
-
children: /* @__PURE__ */ (0,
|
|
1414
|
-
|
|
1452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1453
|
+
ScaledText,
|
|
1415
1454
|
{
|
|
1416
1455
|
style: [
|
|
1417
1456
|
styles17.tabLabel,
|
|
@@ -1432,15 +1471,15 @@ function Tabs({
|
|
|
1432
1471
|
tabs.map((tab) => {
|
|
1433
1472
|
const isActive = activeTab === tab.id;
|
|
1434
1473
|
if (!isActive) return null;
|
|
1435
|
-
return /* @__PURE__ */ (0,
|
|
1474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native20.View, { style: styles17.panel, accessibilityRole: "tabpanel", children: tab.content }, tab.id);
|
|
1436
1475
|
})
|
|
1437
1476
|
] });
|
|
1438
1477
|
}
|
|
1439
1478
|
|
|
1440
1479
|
// src/components/ui/Table/Table.tsx
|
|
1441
|
-
var
|
|
1442
|
-
var
|
|
1443
|
-
var styles18 =
|
|
1480
|
+
var import_react_native21 = require("react-native");
|
|
1481
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1482
|
+
var styles18 = import_react_native21.StyleSheet.create({
|
|
1444
1483
|
wrapper: {
|
|
1445
1484
|
borderRadius: import_native.border.radius.s,
|
|
1446
1485
|
overflow: "hidden"
|
|
@@ -1516,26 +1555,26 @@ function Table({
|
|
|
1516
1555
|
if (sortKey !== col.key) return base;
|
|
1517
1556
|
return `${base}, currently ${sortDirection === "asc" ? "ascending" : "descending"}`;
|
|
1518
1557
|
};
|
|
1519
|
-
return /* @__PURE__ */ (0,
|
|
1520
|
-
|
|
1558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1559
|
+
import_react_native21.ScrollView,
|
|
1521
1560
|
{
|
|
1522
1561
|
horizontal: true,
|
|
1523
1562
|
showsHorizontalScrollIndicator: true,
|
|
1524
1563
|
style: [styles18.wrapper, { backgroundColor: colors2.colorBg }, style],
|
|
1525
|
-
children: /* @__PURE__ */ (0,
|
|
1526
|
-
caption && /* @__PURE__ */ (0,
|
|
1527
|
-
/* @__PURE__ */ (0,
|
|
1528
|
-
(col) => col.sortable ? /* @__PURE__ */ (0,
|
|
1529
|
-
|
|
1564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native21.View, { children: [
|
|
1565
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScaledText, { style: [styles18.caption, { color: colors2.colorOnBgSubtle }], children: caption }),
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native21.View, { style: [styles18.headerRow, { backgroundColor: colors2.colorBgSubtle }], children: columns.map(
|
|
1567
|
+
(col) => col.sortable ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1568
|
+
import_react_native21.Pressable,
|
|
1530
1569
|
{
|
|
1531
1570
|
onPress: () => handleSort(col.key),
|
|
1532
1571
|
accessibilityRole: "button",
|
|
1533
1572
|
accessibilityLabel: getSortLabel(col),
|
|
1534
1573
|
style: ({ pressed }) => [styles18.headerCell, pressed && styles18.pressed],
|
|
1535
1574
|
children: [
|
|
1536
|
-
/* @__PURE__ */ (0,
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1538
|
-
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScaledText, { style: [styles18.headerText, { color: colors2.colorOnBg }], children: col.header }),
|
|
1576
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1577
|
+
ScaledText,
|
|
1539
1578
|
{
|
|
1540
1579
|
style: [
|
|
1541
1580
|
styles18.sortIndicator,
|
|
@@ -1551,10 +1590,10 @@ function Table({
|
|
|
1551
1590
|
]
|
|
1552
1591
|
},
|
|
1553
1592
|
col.key
|
|
1554
|
-
) : /* @__PURE__ */ (0,
|
|
1593
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native21.View, { style: styles18.headerCell, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScaledText, { style: [styles18.headerText, { color: colors2.colorOnBg }], children: col.header }) }, col.key)
|
|
1555
1594
|
) }),
|
|
1556
|
-
rows.map((row, rowIndex) => /* @__PURE__ */ (0,
|
|
1557
|
-
|
|
1595
|
+
rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1596
|
+
import_react_native21.View,
|
|
1558
1597
|
{
|
|
1559
1598
|
style: [
|
|
1560
1599
|
styles18.row,
|
|
@@ -1562,7 +1601,7 @@ function Table({
|
|
|
1562
1601
|
rowIndex % 2 === 1 && { backgroundColor: colors2.colorBgSubtle }
|
|
1563
1602
|
],
|
|
1564
1603
|
accessibilityRole: "none",
|
|
1565
|
-
children: columns.map((col) => /* @__PURE__ */ (0,
|
|
1604
|
+
children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native21.View, { style: styles18.cell, children: col.render ? typeof col.render(row) === "string" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScaledText, { style: [styles18.cellText, { color: colors2.colorOnBg }], children: col.render(row) }) : col.render(row) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScaledText, { style: [styles18.cellText, { color: colors2.colorOnBg }], children: String(row[col.key] ?? "") }) }, col.key))
|
|
1566
1605
|
},
|
|
1567
1606
|
rowIndex
|
|
1568
1607
|
))
|
|
@@ -1572,9 +1611,9 @@ function Table({
|
|
|
1572
1611
|
}
|
|
1573
1612
|
|
|
1574
1613
|
// src/components/ui/Calendar/Calendar.tsx
|
|
1575
|
-
var
|
|
1576
|
-
var
|
|
1577
|
-
var
|
|
1614
|
+
var import_react8 = require("react");
|
|
1615
|
+
var import_react_native22 = require("react-native");
|
|
1616
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1578
1617
|
var DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
1579
1618
|
var DAY_LABELS = {
|
|
1580
1619
|
Su: "Sunday",
|
|
@@ -1617,7 +1656,7 @@ function getFirstDayOfMonth(year, month) {
|
|
|
1617
1656
|
return new Date(year, month, 1).getDay();
|
|
1618
1657
|
}
|
|
1619
1658
|
var DAY_SIZE = 44;
|
|
1620
|
-
var styles19 =
|
|
1659
|
+
var styles19 = import_react_native22.StyleSheet.create({
|
|
1621
1660
|
container: {
|
|
1622
1661
|
alignSelf: "flex-start"
|
|
1623
1662
|
},
|
|
@@ -1699,12 +1738,12 @@ function Calendar({
|
|
|
1699
1738
|
const { colors: colors2 } = useTheme();
|
|
1700
1739
|
const today = /* @__PURE__ */ new Date();
|
|
1701
1740
|
const controlled = value !== void 0;
|
|
1702
|
-
const [internal, setInternal] = (0,
|
|
1741
|
+
const [internal, setInternal] = (0, import_react8.useState)(defaultValue);
|
|
1703
1742
|
const selected = controlled ? value : internal;
|
|
1704
|
-
const [viewYear, setViewYear] = (0,
|
|
1743
|
+
const [viewYear, setViewYear] = (0, import_react8.useState)(
|
|
1705
1744
|
selected?.getFullYear() ?? today.getFullYear()
|
|
1706
1745
|
);
|
|
1707
|
-
const [viewMonth, setViewMonth] = (0,
|
|
1746
|
+
const [viewMonth, setViewMonth] = (0, import_react8.useState)(
|
|
1708
1747
|
selected?.getMonth() ?? today.getMonth()
|
|
1709
1748
|
);
|
|
1710
1749
|
const daysInMonth = getDaysInMonth(viewYear, viewMonth);
|
|
@@ -1729,26 +1768,26 @@ function Calendar({
|
|
|
1729
1768
|
{ length: cells.length / 7 },
|
|
1730
1769
|
(_, i) => cells.slice(i * 7, i * 7 + 7)
|
|
1731
1770
|
);
|
|
1732
|
-
return /* @__PURE__ */ (0,
|
|
1733
|
-
|
|
1771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1772
|
+
import_react_native22.View,
|
|
1734
1773
|
{
|
|
1735
1774
|
style: [styles19.container, style],
|
|
1736
1775
|
accessibilityRole: "none",
|
|
1737
1776
|
accessibilityLabel: `${MONTHS[viewMonth]} ${viewYear} calendar`,
|
|
1738
1777
|
children: [
|
|
1739
|
-
/* @__PURE__ */ (0,
|
|
1740
|
-
/* @__PURE__ */ (0,
|
|
1741
|
-
|
|
1778
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react_native22.View, { style: styles19.header, children: [
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1780
|
+
import_react_native22.Pressable,
|
|
1742
1781
|
{
|
|
1743
1782
|
onPress: () => navigate(-1),
|
|
1744
1783
|
accessibilityRole: "button",
|
|
1745
1784
|
accessibilityLabel: "Previous month",
|
|
1746
1785
|
style: ({ pressed }) => [styles19.navButton, pressed && styles19.pressed],
|
|
1747
|
-
children: /* @__PURE__ */ (0,
|
|
1786
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScaledText, { style: [styles19.navText, { color: colors2.colorOnBg }], children: "\u2039" })
|
|
1748
1787
|
}
|
|
1749
1788
|
),
|
|
1750
|
-
/* @__PURE__ */ (0,
|
|
1751
|
-
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1790
|
+
ScaledText,
|
|
1752
1791
|
{
|
|
1753
1792
|
style: [styles19.monthYear, { color: colors2.colorOnBg }],
|
|
1754
1793
|
accessibilityRole: "text",
|
|
@@ -1760,35 +1799,35 @@ function Calendar({
|
|
|
1760
1799
|
]
|
|
1761
1800
|
}
|
|
1762
1801
|
),
|
|
1763
|
-
/* @__PURE__ */ (0,
|
|
1764
|
-
|
|
1802
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1803
|
+
import_react_native22.Pressable,
|
|
1765
1804
|
{
|
|
1766
1805
|
onPress: () => navigate(1),
|
|
1767
1806
|
accessibilityRole: "button",
|
|
1768
1807
|
accessibilityLabel: "Next month",
|
|
1769
1808
|
style: ({ pressed }) => [styles19.navButton, pressed && styles19.pressed],
|
|
1770
|
-
children: /* @__PURE__ */ (0,
|
|
1809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScaledText, { style: [styles19.navText, { color: colors2.colorOnBg }], children: "\u203A" })
|
|
1771
1810
|
}
|
|
1772
1811
|
)
|
|
1773
1812
|
] }),
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1775
|
-
|
|
1813
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native22.View, { style: styles19.weekRow, children: DAYS.map((d) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native22.View, { style: styles19.weekday, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1814
|
+
ScaledText,
|
|
1776
1815
|
{
|
|
1777
1816
|
style: [styles19.weekdayText, { color: colors2.colorOnBgSubtle }],
|
|
1778
1817
|
accessibilityLabel: DAY_LABELS[d],
|
|
1779
1818
|
children: d
|
|
1780
1819
|
}
|
|
1781
1820
|
) }, d)) }),
|
|
1782
|
-
/* @__PURE__ */ (0,
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native22.View, { style: styles19.grid, children: rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native22.View, { style: styles19.dayRow, children: row.map((cell, colIndex) => {
|
|
1783
1822
|
if (!cell) {
|
|
1784
|
-
return /* @__PURE__ */ (0,
|
|
1823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native22.View, { style: styles19.dayCell }, colIndex);
|
|
1785
1824
|
}
|
|
1786
1825
|
const date = new Date(viewYear, viewMonth, cell.day);
|
|
1787
1826
|
const isSelected = selected ? isSameDay(date, selected) : false;
|
|
1788
1827
|
const isToday = isSameDay(date, today);
|
|
1789
1828
|
const disabled = isOutOfRange(date, min, max);
|
|
1790
|
-
return /* @__PURE__ */ (0,
|
|
1791
|
-
|
|
1829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1830
|
+
import_react_native22.Pressable,
|
|
1792
1831
|
{
|
|
1793
1832
|
onPress: () => selectDay(cell.day),
|
|
1794
1833
|
disabled,
|
|
@@ -1814,8 +1853,8 @@ function Calendar({
|
|
|
1814
1853
|
disabled && styles19.disabled,
|
|
1815
1854
|
pressed && !disabled && styles19.pressed
|
|
1816
1855
|
],
|
|
1817
|
-
children: /* @__PURE__ */ (0,
|
|
1818
|
-
|
|
1856
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1857
|
+
ScaledText,
|
|
1819
1858
|
{
|
|
1820
1859
|
style: [
|
|
1821
1860
|
styles19.dayText,
|
|
@@ -1837,12 +1876,12 @@ function Calendar({
|
|
|
1837
1876
|
}
|
|
1838
1877
|
|
|
1839
1878
|
// src/components/ui/Carousel/Carousel.tsx
|
|
1840
|
-
var
|
|
1841
|
-
var
|
|
1842
|
-
var
|
|
1879
|
+
var import_react9 = require("react");
|
|
1880
|
+
var import_react_native23 = require("react-native");
|
|
1881
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1843
1882
|
var DOT_SIZE = 8;
|
|
1844
1883
|
var DOT_HIT_SIZE = 44;
|
|
1845
|
-
var styles20 =
|
|
1884
|
+
var styles20 = import_react_native23.StyleSheet.create({
|
|
1846
1885
|
container: {
|
|
1847
1886
|
width: "100%"
|
|
1848
1887
|
},
|
|
@@ -1897,10 +1936,10 @@ function Carousel({
|
|
|
1897
1936
|
style
|
|
1898
1937
|
}) {
|
|
1899
1938
|
const { colors: colors2 } = useTheme();
|
|
1900
|
-
const scrollRef = (0,
|
|
1901
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
1902
|
-
const [slideWidth, setSlideWidth] = (0,
|
|
1903
|
-
const handleScroll = (0,
|
|
1939
|
+
const scrollRef = (0, import_react9.useRef)(null);
|
|
1940
|
+
const [activeIndex, setActiveIndex] = (0, import_react9.useState)(0);
|
|
1941
|
+
const [slideWidth, setSlideWidth] = (0, import_react9.useState)(import_react_native23.Dimensions.get("window").width);
|
|
1942
|
+
const handleScroll = (0, import_react9.useCallback)(
|
|
1904
1943
|
(e) => {
|
|
1905
1944
|
const offset = e.nativeEvent.contentOffset.x;
|
|
1906
1945
|
const width = e.nativeEvent.layoutMeasurement.width;
|
|
@@ -1915,15 +1954,15 @@ function Carousel({
|
|
|
1915
1954
|
const clamped = Math.max(0, Math.min(index, items.length - 1));
|
|
1916
1955
|
scrollRef.current?.scrollTo({ x: clamped * slideWidth, animated: true });
|
|
1917
1956
|
};
|
|
1918
|
-
return /* @__PURE__ */ (0,
|
|
1919
|
-
|
|
1957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1958
|
+
import_react_native23.View,
|
|
1920
1959
|
{
|
|
1921
1960
|
style: [styles20.container, style],
|
|
1922
1961
|
accessibilityRole: "none",
|
|
1923
1962
|
accessibilityLabel: label,
|
|
1924
1963
|
children: [
|
|
1925
|
-
/* @__PURE__ */ (0,
|
|
1926
|
-
|
|
1964
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1965
|
+
import_react_native23.ScrollView,
|
|
1927
1966
|
{
|
|
1928
1967
|
ref: scrollRef,
|
|
1929
1968
|
horizontal: true,
|
|
@@ -1933,12 +1972,12 @@ function Carousel({
|
|
|
1933
1972
|
scrollEventThrottle: 16,
|
|
1934
1973
|
onLayout: (e) => setSlideWidth(e.nativeEvent.layout.width),
|
|
1935
1974
|
style: styles20.scrollView,
|
|
1936
|
-
children: items.map((item, index) => /* @__PURE__ */ (0,
|
|
1975
|
+
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native23.View, { style: [styles20.slide, { width: slideWidth }], children: item }, index))
|
|
1937
1976
|
}
|
|
1938
1977
|
),
|
|
1939
|
-
/* @__PURE__ */ (0,
|
|
1940
|
-
/* @__PURE__ */ (0,
|
|
1941
|
-
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_native23.View, { style: styles20.nav, children: [
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1980
|
+
import_react_native23.Pressable,
|
|
1942
1981
|
{
|
|
1943
1982
|
onPress: () => scrollTo(activeIndex - 1),
|
|
1944
1983
|
disabled: activeIndex <= 0,
|
|
@@ -1950,19 +1989,19 @@ function Carousel({
|
|
|
1950
1989
|
activeIndex <= 0 && { opacity: 0.4 },
|
|
1951
1990
|
pressed && styles20.pressed
|
|
1952
1991
|
],
|
|
1953
|
-
children: /* @__PURE__ */ (0,
|
|
1992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScaledText, { style: [styles20.navText, { color: colors2.colorOnBg }], children: "\u2039" })
|
|
1954
1993
|
}
|
|
1955
1994
|
),
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
1957
|
-
|
|
1995
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native23.View, { style: styles20.dots, children: items.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1996
|
+
import_react_native23.Pressable,
|
|
1958
1997
|
{
|
|
1959
1998
|
onPress: () => scrollTo(index),
|
|
1960
1999
|
accessibilityRole: "button",
|
|
1961
2000
|
accessibilityLabel: `Go to slide ${index + 1}`,
|
|
1962
2001
|
accessibilityState: { selected: activeIndex === index },
|
|
1963
2002
|
style: styles20.dotWrapper,
|
|
1964
|
-
children: /* @__PURE__ */ (0,
|
|
1965
|
-
|
|
2003
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2004
|
+
import_react_native23.View,
|
|
1966
2005
|
{
|
|
1967
2006
|
style: [
|
|
1968
2007
|
styles20.dot,
|
|
@@ -1975,8 +2014,8 @@ function Carousel({
|
|
|
1975
2014
|
},
|
|
1976
2015
|
index
|
|
1977
2016
|
)) }),
|
|
1978
|
-
/* @__PURE__ */ (0,
|
|
1979
|
-
|
|
2017
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2018
|
+
import_react_native23.Pressable,
|
|
1980
2019
|
{
|
|
1981
2020
|
onPress: () => scrollTo(activeIndex + 1),
|
|
1982
2021
|
disabled: activeIndex >= items.length - 1,
|
|
@@ -1988,7 +2027,7 @@ function Carousel({
|
|
|
1988
2027
|
activeIndex >= items.length - 1 && { opacity: 0.4 },
|
|
1989
2028
|
pressed && styles20.pressed
|
|
1990
2029
|
],
|
|
1991
|
-
children: /* @__PURE__ */ (0,
|
|
2030
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScaledText, { style: [styles20.navText, { color: colors2.colorOnBg }], children: "\u203A" })
|
|
1992
2031
|
}
|
|
1993
2032
|
)
|
|
1994
2033
|
] })
|
|
@@ -1998,8 +2037,8 @@ function Carousel({
|
|
|
1998
2037
|
}
|
|
1999
2038
|
|
|
2000
2039
|
// src/components/layout/Card/Card.tsx
|
|
2001
|
-
var
|
|
2002
|
-
var
|
|
2040
|
+
var import_react_native24 = require("react-native");
|
|
2041
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2003
2042
|
var paddingMap = {
|
|
2004
2043
|
none: 0,
|
|
2005
2044
|
small: import_native.spacing.s,
|
|
@@ -2011,7 +2050,7 @@ var alignMap = {
|
|
|
2011
2050
|
center: "center",
|
|
2012
2051
|
end: "flex-end"
|
|
2013
2052
|
};
|
|
2014
|
-
var styles21 =
|
|
2053
|
+
var styles21 = import_react_native24.StyleSheet.create({
|
|
2015
2054
|
card: {
|
|
2016
2055
|
borderRadius: import_native.border.radius.m,
|
|
2017
2056
|
overflow: "hidden"
|
|
@@ -2046,8 +2085,8 @@ function Card({
|
|
|
2046
2085
|
alignItems: alignMap[textAlign]
|
|
2047
2086
|
};
|
|
2048
2087
|
if (onPress) {
|
|
2049
|
-
return /* @__PURE__ */ (0,
|
|
2050
|
-
|
|
2088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2089
|
+
import_react_native24.Pressable,
|
|
2051
2090
|
{
|
|
2052
2091
|
onPress,
|
|
2053
2092
|
accessibilityRole: "button",
|
|
@@ -2057,18 +2096,18 @@ function Card({
|
|
|
2057
2096
|
}
|
|
2058
2097
|
);
|
|
2059
2098
|
}
|
|
2060
|
-
return /* @__PURE__ */ (0,
|
|
2099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native24.View, { style: [styles21.card, variantStyle, inner, style], children });
|
|
2061
2100
|
}
|
|
2062
2101
|
|
|
2063
2102
|
// src/components/layout/SectionHeader/SectionHeader.tsx
|
|
2064
|
-
var
|
|
2065
|
-
var
|
|
2103
|
+
var import_react_native25 = require("react-native");
|
|
2104
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2066
2105
|
var alignMap2 = {
|
|
2067
2106
|
start: "flex-start",
|
|
2068
2107
|
center: "center",
|
|
2069
2108
|
end: "flex-end"
|
|
2070
2109
|
};
|
|
2071
|
-
var titleStyles =
|
|
2110
|
+
var titleStyles = import_react_native25.StyleSheet.create({
|
|
2072
2111
|
small: {
|
|
2073
2112
|
fontSize: import_native.font.size.heading3,
|
|
2074
2113
|
fontFamily: import_native.font.family.heading,
|
|
@@ -2088,7 +2127,7 @@ var titleStyles = import_react_native24.StyleSheet.create({
|
|
|
2088
2127
|
lineHeight: lineHeight.heading1
|
|
2089
2128
|
}
|
|
2090
2129
|
});
|
|
2091
|
-
var styles22 =
|
|
2130
|
+
var styles22 = import_react_native25.StyleSheet.create({
|
|
2092
2131
|
container: {
|
|
2093
2132
|
gap: import_native.spacing.xxs
|
|
2094
2133
|
},
|
|
@@ -2107,25 +2146,25 @@ function SectionHeader({
|
|
|
2107
2146
|
}) {
|
|
2108
2147
|
const { colors: colors2 } = useTheme();
|
|
2109
2148
|
const align = alignMap2[alignment];
|
|
2110
|
-
return /* @__PURE__ */ (0,
|
|
2111
|
-
/* @__PURE__ */ (0,
|
|
2112
|
-
|
|
2149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native25.View, { style: [styles22.container, { alignItems: align }, style], children: [
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2151
|
+
ScaledText,
|
|
2113
2152
|
{
|
|
2114
2153
|
accessibilityRole: "header",
|
|
2115
2154
|
style: [titleStyles[size], { color: colors2.colorOnBg }],
|
|
2116
2155
|
children: title
|
|
2117
2156
|
}
|
|
2118
2157
|
),
|
|
2119
|
-
subtitle && /* @__PURE__ */ (0,
|
|
2158
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ScaledText, { style: [styles22.subtitle, { color: colors2.colorOnBgSubtle }], children: subtitle })
|
|
2120
2159
|
] });
|
|
2121
2160
|
}
|
|
2122
2161
|
|
|
2123
2162
|
// src/components/layout/IconWrapper/IconWrapper.tsx
|
|
2124
|
-
var
|
|
2125
|
-
var
|
|
2163
|
+
var import_react_native26 = require("react-native");
|
|
2164
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2126
2165
|
function IconWrapper({ children, style, accessibilityElementsHidden }) {
|
|
2127
|
-
return /* @__PURE__ */ (0,
|
|
2128
|
-
|
|
2166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2167
|
+
import_react_native26.View,
|
|
2129
2168
|
{
|
|
2130
2169
|
style: [{ alignItems: "center", justifyContent: "center" }, style],
|
|
2131
2170
|
importantForAccessibility: accessibilityElementsHidden ? "no-hide-descendants" : "auto",
|
|
@@ -2136,9 +2175,9 @@ function IconWrapper({ children, style, accessibilityElementsHidden }) {
|
|
|
2136
2175
|
}
|
|
2137
2176
|
|
|
2138
2177
|
// src/components/layout/ButtonGroup/ButtonGroup.tsx
|
|
2139
|
-
var
|
|
2140
|
-
var
|
|
2141
|
-
var styles23 =
|
|
2178
|
+
var import_react_native27 = require("react-native");
|
|
2179
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2180
|
+
var styles23 = import_react_native27.StyleSheet.create({
|
|
2142
2181
|
group: {
|
|
2143
2182
|
flexDirection: "row",
|
|
2144
2183
|
flexWrap: "wrap",
|
|
@@ -2151,8 +2190,8 @@ var styles23 = import_react_native26.StyleSheet.create({
|
|
|
2151
2190
|
});
|
|
2152
2191
|
function ButtonContainer({ children, variant, accessibilityLabel, style }) {
|
|
2153
2192
|
const isColumn = variant === "card" || variant === "modal";
|
|
2154
|
-
return /* @__PURE__ */ (0,
|
|
2155
|
-
|
|
2193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2194
|
+
import_react_native27.View,
|
|
2156
2195
|
{
|
|
2157
2196
|
accessibilityLabel,
|
|
2158
2197
|
style: [isColumn ? styles23.column : styles23.group, style],
|
|
@@ -2163,14 +2202,14 @@ function ButtonContainer({ children, variant, accessibilityLabel, style }) {
|
|
|
2163
2202
|
var ButtonGroup = ButtonContainer;
|
|
2164
2203
|
|
|
2165
2204
|
// src/components/interaction/Button/Button.tsx
|
|
2166
|
-
var
|
|
2167
|
-
var
|
|
2205
|
+
var import_react_native28 = require("react-native");
|
|
2206
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2168
2207
|
var sizeTokens = {
|
|
2169
2208
|
small: { height: 36, px: import_native.spacing.m, fontSize: import_native.font.size.bodyS, radius: import_native.border.radius.full },
|
|
2170
2209
|
medium: { height: 48, px: import_native.spacing.m, fontSize: import_native.font.size.body, radius: import_native.border.radius.full },
|
|
2171
2210
|
large: { height: 56, px: import_native.spacing.xxl, fontSize: import_native.font.size.heading3, radius: import_native.border.radius.full }
|
|
2172
2211
|
};
|
|
2173
|
-
var styles24 =
|
|
2212
|
+
var styles24 = import_react_native28.StyleSheet.create({
|
|
2174
2213
|
pressable: {
|
|
2175
2214
|
flexDirection: "row",
|
|
2176
2215
|
alignItems: "center",
|
|
@@ -2181,7 +2220,9 @@ var styles24 = import_react_native27.StyleSheet.create({
|
|
|
2181
2220
|
label: {
|
|
2182
2221
|
fontFamily: import_native.font.family.body,
|
|
2183
2222
|
fontWeight: import_native.font.weight.semibold,
|
|
2184
|
-
includeFontPadding: false
|
|
2223
|
+
includeFontPadding: false,
|
|
2224
|
+
flexShrink: 1,
|
|
2225
|
+
textAlign: "center"
|
|
2185
2226
|
}
|
|
2186
2227
|
});
|
|
2187
2228
|
function Button({
|
|
@@ -2203,12 +2244,15 @@ function Button({
|
|
|
2203
2244
|
const outlineTextColor = colors2.colorInteractiveOnBg;
|
|
2204
2245
|
const isOutline = variant === "outline" || variant === "ghost";
|
|
2205
2246
|
const containerStyle = {
|
|
2206
|
-
height,
|
|
2247
|
+
minHeight: height,
|
|
2207
2248
|
paddingHorizontal: isIconOnly ? import_native.spacing.xs : px,
|
|
2208
2249
|
borderRadius: radius,
|
|
2209
2250
|
opacity: disabled ? 0.4 : 1,
|
|
2210
2251
|
// Icon-only: square with equal xs padding on both axes.
|
|
2211
2252
|
...isIconOnly && { aspectRatio: 1, paddingVertical: import_native.spacing.xs },
|
|
2253
|
+
// Icon-only keeps a fixed height (stays square); a text button gets vertical padding
|
|
2254
|
+
// instead, so a wrapped label grows the button from minHeight rather than clipping.
|
|
2255
|
+
...isIconOnly ? { height } : { paddingVertical: import_native.spacing.xxs },
|
|
2212
2256
|
...variant === "default" && { backgroundColor: primaryColor },
|
|
2213
2257
|
...isOutline && {
|
|
2214
2258
|
backgroundColor: "transparent",
|
|
@@ -2217,8 +2261,8 @@ function Button({
|
|
|
2217
2261
|
}
|
|
2218
2262
|
};
|
|
2219
2263
|
const textColor = variant === "default" ? onPrimaryColor : outlineTextColor;
|
|
2220
|
-
return /* @__PURE__ */ (0,
|
|
2221
|
-
|
|
2264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2265
|
+
import_react_native28.Pressable,
|
|
2222
2266
|
{
|
|
2223
2267
|
onPress,
|
|
2224
2268
|
disabled,
|
|
@@ -2227,19 +2271,19 @@ function Button({
|
|
|
2227
2271
|
accessibilityState: { disabled },
|
|
2228
2272
|
style: ({ pressed }) => [styles24.pressable, containerStyle, pressed && { opacity: 0.75 }, style],
|
|
2229
2273
|
children: [
|
|
2230
|
-
iconStart && /* @__PURE__ */ (0,
|
|
2231
|
-
children && (isIconOnly ? children : /* @__PURE__ */ (0,
|
|
2232
|
-
iconEnd && /* @__PURE__ */ (0,
|
|
2274
|
+
iconStart && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_native28.View, { importantForAccessibility: "no-hide-descendants", accessibilityElementsHidden: true, children: iconStart }),
|
|
2275
|
+
children && (isIconOnly ? children : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ScaledText, { style: [styles24.label, { fontSize, color: textColor }], children })),
|
|
2276
|
+
iconEnd && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_native28.View, { importantForAccessibility: "no-hide-descendants", children: iconEnd })
|
|
2233
2277
|
]
|
|
2234
2278
|
}
|
|
2235
2279
|
);
|
|
2236
2280
|
}
|
|
2237
2281
|
|
|
2238
2282
|
// src/components/interaction/Rating/Rating.tsx
|
|
2239
|
-
var
|
|
2240
|
-
var
|
|
2283
|
+
var import_react_native29 = require("react-native");
|
|
2284
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2241
2285
|
var STAR_SIZE = 24;
|
|
2242
|
-
var styles25 =
|
|
2286
|
+
var styles25 = import_react_native29.StyleSheet.create({
|
|
2243
2287
|
container: {
|
|
2244
2288
|
flexDirection: "row",
|
|
2245
2289
|
alignItems: "center"
|
|
@@ -2252,14 +2296,14 @@ var styles25 = import_react_native28.StyleSheet.create({
|
|
|
2252
2296
|
function Rating({ value, max = 5, style, accessibilityLabel }) {
|
|
2253
2297
|
const { colors: colors2 } = useTheme();
|
|
2254
2298
|
const label = accessibilityLabel ?? `${value} out of ${max} stars`;
|
|
2255
|
-
return /* @__PURE__ */ (0,
|
|
2256
|
-
|
|
2299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2300
|
+
import_react_native29.View,
|
|
2257
2301
|
{
|
|
2258
2302
|
style: [styles25.container, style],
|
|
2259
2303
|
accessibilityRole: "image",
|
|
2260
2304
|
accessibilityLabel: label,
|
|
2261
|
-
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ (0,
|
|
2262
|
-
|
|
2305
|
+
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2306
|
+
ScaledText,
|
|
2263
2307
|
{
|
|
2264
2308
|
style: [
|
|
2265
2309
|
styles25.star,
|
|
@@ -2279,12 +2323,11 @@ function Rating({ value, max = 5, style, accessibilityLabel }) {
|
|
|
2279
2323
|
var import_react_native31 = require("react-native");
|
|
2280
2324
|
|
|
2281
2325
|
// src/components/interaction/form/atoms/Label.tsx
|
|
2282
|
-
var
|
|
2283
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2326
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2284
2327
|
function Label({ label, style }) {
|
|
2285
2328
|
const { colors: colors2 } = useTheme();
|
|
2286
|
-
return /* @__PURE__ */ (0,
|
|
2287
|
-
|
|
2329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2330
|
+
ScaledText,
|
|
2288
2331
|
{
|
|
2289
2332
|
style: [
|
|
2290
2333
|
{
|
|
@@ -2303,7 +2346,7 @@ function Label({ label, style }) {
|
|
|
2303
2346
|
|
|
2304
2347
|
// src/components/interaction/form/atoms/Message.tsx
|
|
2305
2348
|
var import_react_native30 = require("react-native");
|
|
2306
|
-
var
|
|
2349
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2307
2350
|
var styles26 = import_react_native30.StyleSheet.create({
|
|
2308
2351
|
base: {
|
|
2309
2352
|
fontFamily: import_native.font.family.body,
|
|
@@ -2315,8 +2358,8 @@ function Message({ message, type, style }) {
|
|
|
2315
2358
|
const { colors: colors2 } = useTheme();
|
|
2316
2359
|
if (!message) return null;
|
|
2317
2360
|
const color = type === "error" ? colors2.colorError : colors2.colorOnBgSubtle;
|
|
2318
|
-
return /* @__PURE__ */ (0,
|
|
2319
|
-
|
|
2361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2362
|
+
ScaledText,
|
|
2320
2363
|
{
|
|
2321
2364
|
accessibilityRole: type === "error" ? "alert" : "none",
|
|
2322
2365
|
accessibilityLiveRegion: type === "error" ? "assertive" : "polite",
|
|
@@ -2327,7 +2370,7 @@ function Message({ message, type, style }) {
|
|
|
2327
2370
|
}
|
|
2328
2371
|
|
|
2329
2372
|
// src/components/interaction/form/Switch/Switch.tsx
|
|
2330
|
-
var
|
|
2373
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2331
2374
|
var styles27 = import_react_native31.StyleSheet.create({
|
|
2332
2375
|
container: {
|
|
2333
2376
|
gap: import_native.spacing.xxs
|
|
@@ -2348,9 +2391,9 @@ function Switch({
|
|
|
2348
2391
|
style
|
|
2349
2392
|
}) {
|
|
2350
2393
|
const { colors: colors2 } = useTheme();
|
|
2351
|
-
return /* @__PURE__ */ (0,
|
|
2352
|
-
/* @__PURE__ */ (0,
|
|
2353
|
-
/* @__PURE__ */ (0,
|
|
2394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_native31.View, { style: [styles27.container, style], children: [
|
|
2395
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_native31.View, { style: styles27.row, children: [
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2354
2397
|
import_react_native31.Switch,
|
|
2355
2398
|
{
|
|
2356
2399
|
value,
|
|
@@ -2363,16 +2406,16 @@ function Switch({
|
|
|
2363
2406
|
trackColor: { false: colors2.colorBgSubtle, true: colors2.colorBlueSubtle }
|
|
2364
2407
|
}
|
|
2365
2408
|
),
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Label, { label })
|
|
2367
2410
|
] }),
|
|
2368
|
-
/* @__PURE__ */ (0,
|
|
2369
|
-
/* @__PURE__ */ (0,
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Message, { type: "error", message: error }),
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Message, { type: "hint", message: hint })
|
|
2370
2413
|
] });
|
|
2371
2414
|
}
|
|
2372
2415
|
|
|
2373
2416
|
// src/components/interaction/form/Checkbox/Checkbox.tsx
|
|
2374
2417
|
var import_react_native32 = require("react-native");
|
|
2375
|
-
var
|
|
2418
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2376
2419
|
var BOX = 22;
|
|
2377
2420
|
var styles28 = import_react_native32.StyleSheet.create({
|
|
2378
2421
|
container: {
|
|
@@ -2411,8 +2454,8 @@ function Checkbox({
|
|
|
2411
2454
|
const { colors: colors2 } = useTheme();
|
|
2412
2455
|
const borderColor = error ? colors2.colorError : checked ? colors2.colorInteractive : colors2.colorOnBg;
|
|
2413
2456
|
const bgColor = checked ? colors2.colorInteractive : "transparent";
|
|
2414
|
-
return /* @__PURE__ */ (0,
|
|
2415
|
-
/* @__PURE__ */ (0,
|
|
2457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_native32.View, { style: [styles28.container, style], children: [
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2416
2459
|
import_react_native32.Pressable,
|
|
2417
2460
|
{
|
|
2418
2461
|
onPress: () => !disabled && onChange?.(!checked),
|
|
@@ -2422,19 +2465,19 @@ function Checkbox({
|
|
|
2422
2465
|
disabled,
|
|
2423
2466
|
style: ({ pressed }) => [styles28.row, pressed && { opacity: 0.7 }, disabled && { opacity: 0.4 }],
|
|
2424
2467
|
children: [
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2426
|
-
/* @__PURE__ */ (0,
|
|
2468
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_native32.View, { style: [styles28.box, { borderColor, backgroundColor: bgColor }], children: checked && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Label, { label: "\u2713", style: [styles28.checkmark, { color: colors2.colorOnInteractive }] }) }),
|
|
2469
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Label, { label })
|
|
2427
2470
|
]
|
|
2428
2471
|
}
|
|
2429
2472
|
),
|
|
2430
|
-
/* @__PURE__ */ (0,
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Message, { type: "error", message: error }),
|
|
2474
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Message, { type: "hint", message: hint })
|
|
2432
2475
|
] });
|
|
2433
2476
|
}
|
|
2434
2477
|
|
|
2435
2478
|
// src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx
|
|
2436
2479
|
var import_react_native33 = require("react-native");
|
|
2437
|
-
var
|
|
2480
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2438
2481
|
var styles29 = import_react_native33.StyleSheet.create({
|
|
2439
2482
|
container: {
|
|
2440
2483
|
gap: import_native.spacing.xs
|
|
@@ -2462,20 +2505,20 @@ function CheckboxGroup({
|
|
|
2462
2505
|
style
|
|
2463
2506
|
}) {
|
|
2464
2507
|
const { colors: colors2 } = useTheme();
|
|
2465
|
-
return /* @__PURE__ */ (0,
|
|
2508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2466
2509
|
import_react_native33.View,
|
|
2467
2510
|
{
|
|
2468
2511
|
style: [styles29.container, disabled && { opacity: 0.4 }, style],
|
|
2469
2512
|
accessibilityRole: "none",
|
|
2470
2513
|
accessibilityLabel: legend,
|
|
2471
2514
|
children: [
|
|
2472
|
-
/* @__PURE__ */ (0,
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ScaledText, { style: [styles29.legend, { color: colors2.colorOnBg }], children: [
|
|
2473
2516
|
legend,
|
|
2474
|
-
required && /* @__PURE__ */ (0,
|
|
2517
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ScaledText, { style: [styles29.required, { color: colors2.colorOnBgSubtle }], children: " *" })
|
|
2475
2518
|
] }),
|
|
2476
|
-
/* @__PURE__ */ (0,
|
|
2477
|
-
/* @__PURE__ */ (0,
|
|
2478
|
-
/* @__PURE__ */ (0,
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_native33.View, { style: styles29.items, children }),
|
|
2520
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Message, { type: "error", message: error }),
|
|
2521
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Message, { type: "hint", message: hint })
|
|
2479
2522
|
]
|
|
2480
2523
|
}
|
|
2481
2524
|
);
|
|
@@ -2483,7 +2526,7 @@ function CheckboxGroup({
|
|
|
2483
2526
|
|
|
2484
2527
|
// src/components/interaction/form/Radio/Radio.tsx
|
|
2485
2528
|
var import_react_native34 = require("react-native");
|
|
2486
|
-
var
|
|
2529
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2487
2530
|
var DOT = 22;
|
|
2488
2531
|
var INNER = 10;
|
|
2489
2532
|
var styles30 = import_react_native34.StyleSheet.create({
|
|
@@ -2522,8 +2565,8 @@ function Radio({
|
|
|
2522
2565
|
}) {
|
|
2523
2566
|
const { colors: colors2 } = useTheme();
|
|
2524
2567
|
const borderColor = error ? colors2.colorError : checked ? colors2.colorInteractive : colors2.colorOnBg;
|
|
2525
|
-
return /* @__PURE__ */ (0,
|
|
2526
|
-
/* @__PURE__ */ (0,
|
|
2568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react_native34.View, { style: [styles30.container, style], children: [
|
|
2569
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2527
2570
|
import_react_native34.Pressable,
|
|
2528
2571
|
{
|
|
2529
2572
|
onPress: () => !disabled && onChange?.(),
|
|
@@ -2533,19 +2576,19 @@ function Radio({
|
|
|
2533
2576
|
disabled,
|
|
2534
2577
|
style: ({ pressed }) => [styles30.row, pressed && { opacity: 0.7 }, disabled && { opacity: 0.4 }],
|
|
2535
2578
|
children: [
|
|
2536
|
-
/* @__PURE__ */ (0,
|
|
2537
|
-
/* @__PURE__ */ (0,
|
|
2579
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_native34.View, { style: [styles30.outer, { borderColor }], children: checked && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_native34.View, { style: [styles30.inner, { backgroundColor: colors2.colorInteractive }] }) }),
|
|
2580
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Label, { label })
|
|
2538
2581
|
]
|
|
2539
2582
|
}
|
|
2540
2583
|
),
|
|
2541
|
-
/* @__PURE__ */ (0,
|
|
2542
|
-
/* @__PURE__ */ (0,
|
|
2584
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Message, { type: "error", message: error }),
|
|
2585
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Message, { type: "hint", message: hint })
|
|
2543
2586
|
] });
|
|
2544
2587
|
}
|
|
2545
2588
|
|
|
2546
2589
|
// src/components/interaction/form/RadioGroup/RadioGroup.tsx
|
|
2547
2590
|
var import_react_native35 = require("react-native");
|
|
2548
|
-
var
|
|
2591
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2549
2592
|
var styles31 = import_react_native35.StyleSheet.create({
|
|
2550
2593
|
container: {
|
|
2551
2594
|
gap: import_native.spacing.xs
|
|
@@ -2573,20 +2616,20 @@ function RadioGroup({
|
|
|
2573
2616
|
style
|
|
2574
2617
|
}) {
|
|
2575
2618
|
const { colors: colors2 } = useTheme();
|
|
2576
|
-
return /* @__PURE__ */ (0,
|
|
2619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2577
2620
|
import_react_native35.View,
|
|
2578
2621
|
{
|
|
2579
2622
|
style: [styles31.container, disabled && { opacity: 0.4 }, style],
|
|
2580
2623
|
accessibilityRole: "radiogroup",
|
|
2581
2624
|
accessibilityLabel: legend,
|
|
2582
2625
|
children: [
|
|
2583
|
-
/* @__PURE__ */ (0,
|
|
2626
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ScaledText, { style: [styles31.legend, { color: colors2.colorOnBg }], children: [
|
|
2584
2627
|
legend,
|
|
2585
|
-
required && /* @__PURE__ */ (0,
|
|
2628
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ScaledText, { style: [styles31.required, { color: colors2.colorOnBgSubtle }], children: " *" })
|
|
2586
2629
|
] }),
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2589
|
-
/* @__PURE__ */ (0,
|
|
2630
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_native35.View, { style: styles31.items, children }),
|
|
2631
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Message, { type: "error", message: error }),
|
|
2632
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Message, { type: "hint", message: hint })
|
|
2590
2633
|
]
|
|
2591
2634
|
}
|
|
2592
2635
|
);
|
|
@@ -2594,7 +2637,7 @@ function RadioGroup({
|
|
|
2594
2637
|
|
|
2595
2638
|
// src/components/interaction/form/FileInput/FileInput.tsx
|
|
2596
2639
|
var import_react_native36 = require("react-native");
|
|
2597
|
-
var
|
|
2640
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2598
2641
|
var styles32 = import_react_native36.StyleSheet.create({
|
|
2599
2642
|
container: {
|
|
2600
2643
|
gap: import_native.spacing.xxs
|
|
@@ -2650,14 +2693,14 @@ function FileInput({
|
|
|
2650
2693
|
}) {
|
|
2651
2694
|
const { colors: colors2 } = useTheme();
|
|
2652
2695
|
const borderColor = error ? colors2.colorError : colors2.colorBgSubtle;
|
|
2653
|
-
return /* @__PURE__ */ (0,
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
2696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react_native36.View, { style: [styles32.container, style], testID: name, children: [
|
|
2697
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2655
2698
|
Label,
|
|
2656
2699
|
{
|
|
2657
2700
|
label: required ? `${label} *` : label
|
|
2658
2701
|
}
|
|
2659
2702
|
),
|
|
2660
|
-
/* @__PURE__ */ (0,
|
|
2703
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2661
2704
|
import_react_native36.Pressable,
|
|
2662
2705
|
{
|
|
2663
2706
|
onPress: () => !disabled && onSelect?.(),
|
|
@@ -2675,27 +2718,27 @@ function FileInput({
|
|
|
2675
2718
|
disabled && { opacity: 0.4 }
|
|
2676
2719
|
],
|
|
2677
2720
|
children: [
|
|
2678
|
-
/* @__PURE__ */ (0,
|
|
2679
|
-
/* @__PURE__ */ (0,
|
|
2680
|
-
fileNames.length > 0 && /* @__PURE__ */ (0,
|
|
2681
|
-
accept && /* @__PURE__ */ (0,
|
|
2721
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScaledText, { style: [styles32.icon, { color: colors2.colorInteractive }], children: "\u2191" }),
|
|
2722
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScaledText, { style: [styles32.prompt, { color: colors2.colorOnBgSubtle }], children: fileNames.length > 0 ? "Selected files:" : "Tap to select file" }),
|
|
2723
|
+
fileNames.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native36.View, { style: styles32.fileList, children: fileNames.map((fileName) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScaledText, { style: [styles32.fileName, { color: colors2.colorOnBg }], children: fileName }, fileName)) }),
|
|
2724
|
+
accept && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScaledText, { style: [styles32.acceptHint, { color: colors2.colorOnBgSubtle }], children: accept })
|
|
2682
2725
|
]
|
|
2683
2726
|
}
|
|
2684
2727
|
),
|
|
2685
|
-
/* @__PURE__ */ (0,
|
|
2686
|
-
/* @__PURE__ */ (0,
|
|
2728
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Message, { type: "error", message: error }),
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Message, { type: "hint", message: hint })
|
|
2687
2730
|
] });
|
|
2688
2731
|
}
|
|
2689
2732
|
|
|
2690
2733
|
// src/components/interaction/form/Combobox/Combobox.tsx
|
|
2691
|
-
var
|
|
2734
|
+
var import_react10 = require("react");
|
|
2692
2735
|
var import_react_native37 = require("react-native");
|
|
2693
2736
|
|
|
2694
2737
|
// src/components/interaction/form/atoms/inputHelpers.ts
|
|
2695
2738
|
var OPTICAL_TEXT_SHIFT = -1.5;
|
|
2696
2739
|
|
|
2697
2740
|
// src/components/interaction/form/Combobox/Combobox.tsx
|
|
2698
|
-
var
|
|
2741
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2699
2742
|
var INPUT_HEIGHT = 44;
|
|
2700
2743
|
var MAX_DROPDOWN_HEIGHT = 200;
|
|
2701
2744
|
var styles33 = import_react_native37.StyleSheet.create({
|
|
@@ -2766,13 +2809,13 @@ function Combobox({
|
|
|
2766
2809
|
style
|
|
2767
2810
|
}) {
|
|
2768
2811
|
const { colors: colors2 } = useTheme();
|
|
2769
|
-
const selectedOption = (0,
|
|
2812
|
+
const selectedOption = (0, import_react10.useMemo)(
|
|
2770
2813
|
() => options.find((o) => o.value === value),
|
|
2771
2814
|
[options, value]
|
|
2772
2815
|
);
|
|
2773
|
-
const [inputValue, setInputValue] = (0,
|
|
2774
|
-
const [isOpen, setIsOpen] = (0,
|
|
2775
|
-
const filtered = (0,
|
|
2816
|
+
const [inputValue, setInputValue] = (0, import_react10.useState)(selectedOption?.label ?? "");
|
|
2817
|
+
const [isOpen, setIsOpen] = (0, import_react10.useState)(false);
|
|
2818
|
+
const filtered = (0, import_react10.useMemo)(
|
|
2776
2819
|
() => options.filter(
|
|
2777
2820
|
(o) => o.label.toLowerCase().includes(inputValue.toLowerCase())
|
|
2778
2821
|
),
|
|
@@ -2794,9 +2837,9 @@ function Combobox({
|
|
|
2794
2837
|
setTimeout(() => setIsOpen(false), 150);
|
|
2795
2838
|
};
|
|
2796
2839
|
const borderColor = error ? colors2.colorError : colors2.colorOnBg;
|
|
2797
|
-
return /* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2799
|
-
/* @__PURE__ */ (0,
|
|
2840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react_native37.View, { style: [styles33.container, style], children: [
|
|
2841
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Label, { label }),
|
|
2842
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2800
2843
|
import_react_native37.View,
|
|
2801
2844
|
{
|
|
2802
2845
|
style: [
|
|
@@ -2808,8 +2851,8 @@ function Combobox({
|
|
|
2808
2851
|
disabled && { opacity: 0.4 }
|
|
2809
2852
|
],
|
|
2810
2853
|
children: [
|
|
2811
|
-
/* @__PURE__ */ (0,
|
|
2812
|
-
|
|
2854
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2855
|
+
ScaledTextInput,
|
|
2813
2856
|
{
|
|
2814
2857
|
value: inputValue,
|
|
2815
2858
|
onChangeText: handleChangeText,
|
|
@@ -2827,7 +2870,7 @@ function Combobox({
|
|
|
2827
2870
|
]
|
|
2828
2871
|
}
|
|
2829
2872
|
),
|
|
2830
|
-
isOpen && filtered.length > 0 && /* @__PURE__ */ (0,
|
|
2873
|
+
isOpen && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2831
2874
|
import_react_native37.ScrollView,
|
|
2832
2875
|
{
|
|
2833
2876
|
style: [
|
|
@@ -2842,7 +2885,7 @@ function Combobox({
|
|
|
2842
2885
|
children: filtered.map((option) => {
|
|
2843
2886
|
const isSelected = option.value === value;
|
|
2844
2887
|
const isDisabled = option.disabled;
|
|
2845
|
-
return /* @__PURE__ */ (0,
|
|
2888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2846
2889
|
import_react_native37.Pressable,
|
|
2847
2890
|
{
|
|
2848
2891
|
onPress: () => !isDisabled && selectOption(option),
|
|
@@ -2856,8 +2899,8 @@ function Combobox({
|
|
|
2856
2899
|
pressed && !isDisabled && { backgroundColor: colors2.colorBgSubtle },
|
|
2857
2900
|
isDisabled && { opacity: 0.4 }
|
|
2858
2901
|
],
|
|
2859
|
-
children: /* @__PURE__ */ (0,
|
|
2860
|
-
|
|
2902
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2903
|
+
ScaledText,
|
|
2861
2904
|
{
|
|
2862
2905
|
style: [
|
|
2863
2906
|
styles33.optionText,
|
|
@@ -2878,15 +2921,15 @@ function Combobox({
|
|
|
2878
2921
|
]
|
|
2879
2922
|
}
|
|
2880
2923
|
),
|
|
2881
|
-
/* @__PURE__ */ (0,
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
2924
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Message, { type: "error", message: error }),
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Message, { type: "hint", message: hint })
|
|
2883
2926
|
] });
|
|
2884
2927
|
}
|
|
2885
2928
|
|
|
2886
2929
|
// src/components/interaction/form/SegmentedControl/SegmentedControl.tsx
|
|
2887
|
-
var
|
|
2930
|
+
var import_react11 = require("react");
|
|
2888
2931
|
var import_react_native38 = require("react-native");
|
|
2889
|
-
var
|
|
2932
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2890
2933
|
var TRACK_PADDING = import_native.spacing.xxxs;
|
|
2891
2934
|
var sizeTokens2 = {
|
|
2892
2935
|
small: { minHeight: 32, fontSize: import_native.font.size.bodyS, px: import_native.spacing.s, py: import_native.spacing.xxs },
|
|
@@ -2933,10 +2976,10 @@ function SegmentedControl({
|
|
|
2933
2976
|
}) {
|
|
2934
2977
|
const { colors: colors2 } = useTheme();
|
|
2935
2978
|
const { minHeight, fontSize, px, py } = sizeTokens2[size];
|
|
2936
|
-
const items =
|
|
2979
|
+
const items = import_react11.Children.toArray(children);
|
|
2937
2980
|
const trackBg = colors2.colorBgSubtle;
|
|
2938
2981
|
const thumbBg = variant === "outline" ? colors2.colorBg : colors2.colorInteractive;
|
|
2939
|
-
return /* @__PURE__ */ (0,
|
|
2982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2940
2983
|
import_react_native38.View,
|
|
2941
2984
|
{
|
|
2942
2985
|
style: [styles34.track, { backgroundColor: trackBg }, style],
|
|
@@ -2952,7 +2995,7 @@ function SegmentedControl({
|
|
|
2952
2995
|
paddingVertical: py,
|
|
2953
2996
|
...isActive ? { backgroundColor: thumbBg, ...thumbShadow } : { backgroundColor: "transparent" }
|
|
2954
2997
|
};
|
|
2955
|
-
return /* @__PURE__ */ (0,
|
|
2998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2956
2999
|
import_react_native38.Pressable,
|
|
2957
3000
|
{
|
|
2958
3001
|
onPress: () => !disabled && onValueChange?.(index),
|
|
@@ -2966,7 +3009,16 @@ function SegmentedControl({
|
|
|
2966
3009
|
pressed && !disabled && { opacity: 0.7 },
|
|
2967
3010
|
disabled && { opacity: 0.4 }
|
|
2968
3011
|
],
|
|
2969
|
-
children: label !== null ? /* @__PURE__ */ (0,
|
|
3012
|
+
children: label !== null ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3013
|
+
ScaledText,
|
|
3014
|
+
{
|
|
3015
|
+
style: [styles34.label, { fontSize, color: labelColor }],
|
|
3016
|
+
numberOfLines: 1,
|
|
3017
|
+
adjustsFontSizeToFit: true,
|
|
3018
|
+
minimumFontScale: 0.5,
|
|
3019
|
+
children: label
|
|
3020
|
+
}
|
|
3021
|
+
) : child
|
|
2970
3022
|
},
|
|
2971
3023
|
index
|
|
2972
3024
|
);
|
|
@@ -2976,9 +3028,9 @@ function SegmentedControl({
|
|
|
2976
3028
|
}
|
|
2977
3029
|
|
|
2978
3030
|
// src/components/interaction/form/FormInput/FormInput.tsx
|
|
2979
|
-
var
|
|
3031
|
+
var import_react12 = require("react");
|
|
2980
3032
|
var import_react_native39 = require("react-native");
|
|
2981
|
-
var
|
|
3033
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2982
3034
|
var INPUT_HEIGHT2 = 44;
|
|
2983
3035
|
var keyboardTypeMap = {
|
|
2984
3036
|
text: "default",
|
|
@@ -2994,11 +3046,11 @@ var styles35 = import_react_native39.StyleSheet.create({
|
|
|
2994
3046
|
gap: import_native.spacing.xxs
|
|
2995
3047
|
},
|
|
2996
3048
|
/**
|
|
2997
|
-
* The wrapper draws the pill border and provides
|
|
3049
|
+
* The wrapper draws the pill border and provides at least 44pt touch-target height.
|
|
2998
3050
|
* justifyContent: 'center' vertically centers the inner TextInput on both iOS and Android.
|
|
2999
3051
|
*/
|
|
3000
3052
|
inputWrapper: {
|
|
3001
|
-
|
|
3053
|
+
minHeight: INPUT_HEIGHT2,
|
|
3002
3054
|
justifyContent: "center",
|
|
3003
3055
|
borderWidth: 1,
|
|
3004
3056
|
borderRadius: import_native.border.radius.full
|
|
@@ -3035,11 +3087,11 @@ function FormInput({
|
|
|
3035
3087
|
style
|
|
3036
3088
|
}) {
|
|
3037
3089
|
const { colors: colors2 } = useTheme();
|
|
3038
|
-
const [focused, setFocused] = (0,
|
|
3090
|
+
const [focused, setFocused] = (0, import_react12.useState)(false);
|
|
3039
3091
|
const borderColor = error ? colors2.colorError : focused ? colors2.colorInteractive : colors2.colorOnBg;
|
|
3040
|
-
return /* @__PURE__ */ (0,
|
|
3041
|
-
/* @__PURE__ */ (0,
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
3092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react_native39.View, { style: [styles35.container, style], children: [
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Label, { label }),
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3043
3095
|
import_react_native39.View,
|
|
3044
3096
|
{
|
|
3045
3097
|
style: [
|
|
@@ -3050,8 +3102,8 @@ function FormInput({
|
|
|
3050
3102
|
},
|
|
3051
3103
|
disabled && { opacity: 0.4 }
|
|
3052
3104
|
],
|
|
3053
|
-
children: /* @__PURE__ */ (0,
|
|
3054
|
-
|
|
3105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3106
|
+
ScaledTextInput,
|
|
3055
3107
|
{
|
|
3056
3108
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
3057
3109
|
accessibilityState: { disabled },
|
|
@@ -3082,15 +3134,15 @@ function FormInput({
|
|
|
3082
3134
|
)
|
|
3083
3135
|
}
|
|
3084
3136
|
),
|
|
3085
|
-
/* @__PURE__ */ (0,
|
|
3086
|
-
/* @__PURE__ */ (0,
|
|
3137
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Message, { type: "error", message: error }),
|
|
3138
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Message, { type: "hint", message: hint })
|
|
3087
3139
|
] });
|
|
3088
3140
|
}
|
|
3089
3141
|
|
|
3090
3142
|
// src/components/interaction/form/Textarea/Textarea.tsx
|
|
3091
|
-
var
|
|
3143
|
+
var import_react13 = require("react");
|
|
3092
3144
|
var import_react_native40 = require("react-native");
|
|
3093
|
-
var
|
|
3145
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3094
3146
|
var styles36 = import_react_native40.StyleSheet.create({
|
|
3095
3147
|
container: {
|
|
3096
3148
|
gap: import_native.spacing.xxs
|
|
@@ -3123,12 +3175,12 @@ function Textarea({
|
|
|
3123
3175
|
style
|
|
3124
3176
|
}) {
|
|
3125
3177
|
const { colors: colors2 } = useTheme();
|
|
3126
|
-
const [focused, setFocused] = (0,
|
|
3178
|
+
const [focused, setFocused] = (0, import_react13.useState)(false);
|
|
3127
3179
|
const borderColor = error ? colors2.colorError : focused ? colors2.colorInteractive : colors2.colorOnBg;
|
|
3128
|
-
return /* @__PURE__ */ (0,
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3131
|
-
|
|
3180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_react_native40.View, { style: [styles36.container, style], children: [
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Label, { label }),
|
|
3182
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3183
|
+
ScaledTextInput,
|
|
3132
3184
|
{
|
|
3133
3185
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
3134
3186
|
accessibilityState: { disabled },
|
|
@@ -3160,15 +3212,15 @@ function Textarea({
|
|
|
3160
3212
|
]
|
|
3161
3213
|
}
|
|
3162
3214
|
),
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3164
|
-
/* @__PURE__ */ (0,
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Message, { type: "error", message: error }),
|
|
3216
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Message, { type: "hint", message: hint })
|
|
3165
3217
|
] });
|
|
3166
3218
|
}
|
|
3167
3219
|
|
|
3168
3220
|
// src/components/interaction/form/Select/Select.tsx
|
|
3169
|
-
var
|
|
3221
|
+
var import_react14 = require("react");
|
|
3170
3222
|
var import_react_native41 = require("react-native");
|
|
3171
|
-
var
|
|
3223
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3172
3224
|
var styles37 = import_react_native41.StyleSheet.create({
|
|
3173
3225
|
container: {
|
|
3174
3226
|
gap: import_native.spacing.xxs
|
|
@@ -3248,7 +3300,7 @@ function Select({
|
|
|
3248
3300
|
style
|
|
3249
3301
|
}) {
|
|
3250
3302
|
const { colors: colors2 } = useTheme();
|
|
3251
|
-
const [open, setOpen] = (0,
|
|
3303
|
+
const [open, setOpen] = (0, import_react14.useState)(false);
|
|
3252
3304
|
const selectedOption = options.find((o) => o.value === value);
|
|
3253
3305
|
const displayText = selectedOption?.label ?? placeholder;
|
|
3254
3306
|
const isPlaceholder = !selectedOption;
|
|
@@ -3257,9 +3309,9 @@ function Select({
|
|
|
3257
3309
|
onChange?.(optionValue);
|
|
3258
3310
|
setOpen(false);
|
|
3259
3311
|
};
|
|
3260
|
-
return /* @__PURE__ */ (0,
|
|
3261
|
-
/* @__PURE__ */ (0,
|
|
3262
|
-
/* @__PURE__ */ (0,
|
|
3312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_react_native41.View, { style: [styles37.container, style], children: [
|
|
3313
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Label, { label }),
|
|
3314
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3263
3315
|
import_react_native41.Pressable,
|
|
3264
3316
|
{
|
|
3265
3317
|
accessibilityRole: "button",
|
|
@@ -3277,8 +3329,8 @@ function Select({
|
|
|
3277
3329
|
disabled && { opacity: 0.4 }
|
|
3278
3330
|
],
|
|
3279
3331
|
children: [
|
|
3280
|
-
/* @__PURE__ */ (0,
|
|
3281
|
-
|
|
3332
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3333
|
+
ScaledText,
|
|
3282
3334
|
{
|
|
3283
3335
|
style: [
|
|
3284
3336
|
styles37.triggerText,
|
|
@@ -3289,52 +3341,52 @@ function Select({
|
|
|
3289
3341
|
children: displayText
|
|
3290
3342
|
}
|
|
3291
3343
|
),
|
|
3292
|
-
/* @__PURE__ */ (0,
|
|
3344
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ScaledText, { style: [styles37.chevron, { color: colors2.colorOnBgSubtle }], "aria-hidden": true, children: "\u25BE" })
|
|
3293
3345
|
]
|
|
3294
3346
|
}
|
|
3295
3347
|
),
|
|
3296
|
-
/* @__PURE__ */ (0,
|
|
3348
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3297
3349
|
import_react_native41.Modal,
|
|
3298
3350
|
{
|
|
3299
3351
|
visible: open,
|
|
3300
3352
|
transparent: true,
|
|
3301
3353
|
animationType: "slide",
|
|
3302
3354
|
onRequestClose: () => setOpen(false),
|
|
3303
|
-
children: /* @__PURE__ */ (0,
|
|
3355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3304
3356
|
import_react_native41.Pressable,
|
|
3305
3357
|
{
|
|
3306
3358
|
style: styles37.overlay,
|
|
3307
3359
|
onPress: () => setOpen(false),
|
|
3308
3360
|
accessibilityRole: "button",
|
|
3309
3361
|
accessibilityLabel: "Close options",
|
|
3310
|
-
children: /* @__PURE__ */ (0,
|
|
3362
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3311
3363
|
import_react_native41.Pressable,
|
|
3312
3364
|
{
|
|
3313
3365
|
style: [styles37.sheet, { backgroundColor: colors2.colorBg }],
|
|
3314
3366
|
onPress: () => {
|
|
3315
3367
|
},
|
|
3316
|
-
children: /* @__PURE__ */ (0,
|
|
3317
|
-
/* @__PURE__ */ (0,
|
|
3318
|
-
/* @__PURE__ */ (0,
|
|
3319
|
-
/* @__PURE__ */ (0,
|
|
3368
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_react_native41.SafeAreaView, { children: [
|
|
3369
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_react_native41.View, { style: styles37.sheetHeader, children: [
|
|
3370
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ScaledText, { style: [styles37.sheetTitle, { color: colors2.colorOnBg }], children: typeof label === "string" ? label : "Select" }),
|
|
3371
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3320
3372
|
import_react_native41.Pressable,
|
|
3321
3373
|
{
|
|
3322
3374
|
accessibilityRole: "button",
|
|
3323
3375
|
accessibilityLabel: "Close",
|
|
3324
3376
|
onPress: () => setOpen(false),
|
|
3325
3377
|
hitSlop: 8,
|
|
3326
|
-
children: /* @__PURE__ */ (0,
|
|
3378
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ScaledText, { style: [styles37.closeText, { color: colors2.colorInteractive }], children: "Done" })
|
|
3327
3379
|
}
|
|
3328
3380
|
)
|
|
3329
3381
|
] }),
|
|
3330
|
-
/* @__PURE__ */ (0,
|
|
3382
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3331
3383
|
import_react_native41.FlatList,
|
|
3332
3384
|
{
|
|
3333
3385
|
data: options,
|
|
3334
3386
|
keyExtractor: (item) => item.value,
|
|
3335
3387
|
renderItem: ({ item }) => {
|
|
3336
3388
|
const isSelected = item.value === value;
|
|
3337
|
-
return /* @__PURE__ */ (0,
|
|
3389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3338
3390
|
import_react_native41.Pressable,
|
|
3339
3391
|
{
|
|
3340
3392
|
accessibilityRole: "button",
|
|
@@ -3351,8 +3403,8 @@ function Select({
|
|
|
3351
3403
|
pressed && { opacity: 0.7 },
|
|
3352
3404
|
item.disabled && { opacity: 0.4 }
|
|
3353
3405
|
],
|
|
3354
|
-
children: /* @__PURE__ */ (0,
|
|
3355
|
-
|
|
3406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3407
|
+
ScaledText,
|
|
3356
3408
|
{
|
|
3357
3409
|
style: [
|
|
3358
3410
|
styles37.optionText,
|
|
@@ -3376,15 +3428,15 @@ function Select({
|
|
|
3376
3428
|
)
|
|
3377
3429
|
}
|
|
3378
3430
|
),
|
|
3379
|
-
/* @__PURE__ */ (0,
|
|
3380
|
-
/* @__PURE__ */ (0,
|
|
3431
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Message, { type: "error", message: error }),
|
|
3432
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Message, { type: "hint", message: hint })
|
|
3381
3433
|
] });
|
|
3382
3434
|
}
|
|
3383
3435
|
|
|
3384
3436
|
// src/components/interaction/form/Slider/Slider.tsx
|
|
3385
|
-
var
|
|
3437
|
+
var import_react15 = require("react");
|
|
3386
3438
|
var import_react_native42 = require("react-native");
|
|
3387
|
-
var
|
|
3439
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3388
3440
|
var TRACK_HEIGHT = 6;
|
|
3389
3441
|
var THUMB_SIZE = 24;
|
|
3390
3442
|
var styles38 = import_react_native42.StyleSheet.create({
|
|
@@ -3450,8 +3502,8 @@ function Slider({
|
|
|
3450
3502
|
}) {
|
|
3451
3503
|
const { colors: colors2 } = useTheme();
|
|
3452
3504
|
const isControlled = value !== void 0;
|
|
3453
|
-
const [internalValue, setInternalValue] = (0,
|
|
3454
|
-
const [trackWidth, setTrackWidth] = (0,
|
|
3505
|
+
const [internalValue, setInternalValue] = (0, import_react15.useState)(defaultValue ?? min);
|
|
3506
|
+
const [trackWidth, setTrackWidth] = (0, import_react15.useState)(0);
|
|
3455
3507
|
const currentValue = isControlled ? value : internalValue;
|
|
3456
3508
|
const fillPct = max > min ? (currentValue - min) / (max - min) * 100 : 0;
|
|
3457
3509
|
const updateValue = (v) => {
|
|
@@ -3481,7 +3533,7 @@ function Slider({
|
|
|
3481
3533
|
updateValue(valueFromTouch(e.nativeEvent.pageX, pageX));
|
|
3482
3534
|
});
|
|
3483
3535
|
};
|
|
3484
|
-
return /* @__PURE__ */ (0,
|
|
3536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3485
3537
|
import_react_native42.View,
|
|
3486
3538
|
{
|
|
3487
3539
|
style: [styles38.container, style],
|
|
@@ -3490,11 +3542,11 @@ function Slider({
|
|
|
3490
3542
|
accessibilityValue: { min, max, now: currentValue, text: String(currentValue) },
|
|
3491
3543
|
accessibilityState: { disabled },
|
|
3492
3544
|
children: [
|
|
3493
|
-
/* @__PURE__ */ (0,
|
|
3494
|
-
/* @__PURE__ */ (0,
|
|
3495
|
-
showValue && /* @__PURE__ */ (0,
|
|
3545
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_react_native42.View, { style: styles38.labelRow, children: [
|
|
3546
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Label, { label }),
|
|
3547
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ScaledText, { style: [styles38.valueText, { color: colors2.colorOnBg }], children: currentValue })
|
|
3496
3548
|
] }),
|
|
3497
|
-
/* @__PURE__ */ (0,
|
|
3549
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3498
3550
|
import_react_native42.View,
|
|
3499
3551
|
{
|
|
3500
3552
|
style: [styles38.trackContainer, disabled && { opacity: 0.4 }],
|
|
@@ -3504,7 +3556,7 @@ function Slider({
|
|
|
3504
3556
|
onResponderGrant: handleResponderGrant,
|
|
3505
3557
|
onResponderMove: handleResponderMove,
|
|
3506
3558
|
children: [
|
|
3507
|
-
/* @__PURE__ */ (0,
|
|
3559
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react_native42.View, { style: [styles38.track, { backgroundColor: colors2.colorBgSubtle }], children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3508
3560
|
import_react_native42.View,
|
|
3509
3561
|
{
|
|
3510
3562
|
style: [
|
|
@@ -3516,7 +3568,7 @@ function Slider({
|
|
|
3516
3568
|
]
|
|
3517
3569
|
}
|
|
3518
3570
|
) }),
|
|
3519
|
-
/* @__PURE__ */ (0,
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3520
3572
|
import_react_native42.View,
|
|
3521
3573
|
{
|
|
3522
3574
|
style: [
|
|
@@ -3533,17 +3585,17 @@ function Slider({
|
|
|
3533
3585
|
]
|
|
3534
3586
|
}
|
|
3535
3587
|
),
|
|
3536
|
-
/* @__PURE__ */ (0,
|
|
3537
|
-
/* @__PURE__ */ (0,
|
|
3588
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Message, { type: "error", message: error }),
|
|
3589
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Message, { type: "hint", message: hint })
|
|
3538
3590
|
]
|
|
3539
3591
|
}
|
|
3540
3592
|
);
|
|
3541
3593
|
}
|
|
3542
3594
|
|
|
3543
3595
|
// src/components/interaction/form/NumberInput/NumberInput.tsx
|
|
3544
|
-
var
|
|
3596
|
+
var import_react16 = require("react");
|
|
3545
3597
|
var import_react_native43 = require("react-native");
|
|
3546
|
-
var
|
|
3598
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3547
3599
|
var STEPPER_SIZE = 44;
|
|
3548
3600
|
var styles39 = import_react_native43.StyleSheet.create({
|
|
3549
3601
|
container: {
|
|
@@ -3620,7 +3672,7 @@ function NumberInput({
|
|
|
3620
3672
|
}) {
|
|
3621
3673
|
const { colors: colors2 } = useTheme();
|
|
3622
3674
|
const isControlled = value !== void 0;
|
|
3623
|
-
const [internalValue, setInternalValue] = (0,
|
|
3675
|
+
const [internalValue, setInternalValue] = (0, import_react16.useState)(defaultValue ?? 0);
|
|
3624
3676
|
const currentValue = isControlled ? value : internalValue;
|
|
3625
3677
|
const clamp = (v) => {
|
|
3626
3678
|
const withMin = min !== void 0 ? Math.max(min, v) : v;
|
|
@@ -3634,10 +3686,10 @@ function NumberInput({
|
|
|
3634
3686
|
const canDecrease = min === void 0 || currentValue > min;
|
|
3635
3687
|
const canIncrease = max === void 0 || currentValue < max;
|
|
3636
3688
|
const borderColor = error ? colors2.colorError : colors2.colorOnBg;
|
|
3637
|
-
return /* @__PURE__ */ (0,
|
|
3638
|
-
/* @__PURE__ */ (0,
|
|
3639
|
-
/* @__PURE__ */ (0,
|
|
3640
|
-
/* @__PURE__ */ (0,
|
|
3689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_native43.View, { style: [styles39.container, style], children: [
|
|
3690
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Label, { label }),
|
|
3691
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_native43.View, { style: [styles39.inputRow, disabled && { opacity: 0.4 }], children: [
|
|
3692
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3641
3693
|
import_react_native43.Pressable,
|
|
3642
3694
|
{
|
|
3643
3695
|
accessibilityRole: "button",
|
|
@@ -3655,8 +3707,8 @@ function NumberInput({
|
|
|
3655
3707
|
pressed && { opacity: 0.7 },
|
|
3656
3708
|
(disabled || !canDecrease) && { opacity: 0.4 }
|
|
3657
3709
|
],
|
|
3658
|
-
children: /* @__PURE__ */ (0,
|
|
3659
|
-
|
|
3710
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3711
|
+
ScaledText,
|
|
3660
3712
|
{
|
|
3661
3713
|
style: [styles39.stepperText, { color: colors2.colorOnBg }],
|
|
3662
3714
|
"aria-hidden": true,
|
|
@@ -3665,7 +3717,7 @@ function NumberInput({
|
|
|
3665
3717
|
)
|
|
3666
3718
|
}
|
|
3667
3719
|
),
|
|
3668
|
-
/* @__PURE__ */ (0,
|
|
3720
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3669
3721
|
import_react_native43.View,
|
|
3670
3722
|
{
|
|
3671
3723
|
style: [
|
|
@@ -3675,8 +3727,8 @@ function NumberInput({
|
|
|
3675
3727
|
backgroundColor: colors2.colorBg
|
|
3676
3728
|
}
|
|
3677
3729
|
],
|
|
3678
|
-
children: /* @__PURE__ */ (0,
|
|
3679
|
-
|
|
3730
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3731
|
+
ScaledTextInput,
|
|
3680
3732
|
{
|
|
3681
3733
|
accessibilityLabel: label,
|
|
3682
3734
|
accessibilityState: { disabled },
|
|
@@ -3702,7 +3754,7 @@ function NumberInput({
|
|
|
3702
3754
|
)
|
|
3703
3755
|
}
|
|
3704
3756
|
),
|
|
3705
|
-
/* @__PURE__ */ (0,
|
|
3757
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3706
3758
|
import_react_native43.Pressable,
|
|
3707
3759
|
{
|
|
3708
3760
|
accessibilityRole: "button",
|
|
@@ -3720,8 +3772,8 @@ function NumberInput({
|
|
|
3720
3772
|
pressed && { opacity: 0.7 },
|
|
3721
3773
|
(disabled || !canIncrease) && { opacity: 0.4 }
|
|
3722
3774
|
],
|
|
3723
|
-
children: /* @__PURE__ */ (0,
|
|
3724
|
-
|
|
3775
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3776
|
+
ScaledText,
|
|
3725
3777
|
{
|
|
3726
3778
|
style: [styles39.stepperText, { color: colors2.colorOnBg }],
|
|
3727
3779
|
"aria-hidden": true,
|
|
@@ -3731,14 +3783,14 @@ function NumberInput({
|
|
|
3731
3783
|
}
|
|
3732
3784
|
)
|
|
3733
3785
|
] }),
|
|
3734
|
-
/* @__PURE__ */ (0,
|
|
3735
|
-
/* @__PURE__ */ (0,
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Message, { type: "error", message: error }),
|
|
3787
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Message, { type: "hint", message: hint })
|
|
3736
3788
|
] });
|
|
3737
3789
|
}
|
|
3738
3790
|
|
|
3739
3791
|
// src/components/interaction/Dialog/Dialog.tsx
|
|
3740
3792
|
var import_react_native44 = require("react-native");
|
|
3741
|
-
var
|
|
3793
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3742
3794
|
var styles40 = import_react_native44.StyleSheet.create({
|
|
3743
3795
|
overlay: {
|
|
3744
3796
|
flex: 1,
|
|
@@ -3795,15 +3847,15 @@ function Dialog({
|
|
|
3795
3847
|
style
|
|
3796
3848
|
}) {
|
|
3797
3849
|
const { colors: colors2 } = useTheme();
|
|
3798
|
-
return /* @__PURE__ */ (0,
|
|
3850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3799
3851
|
import_react_native44.Modal,
|
|
3800
3852
|
{
|
|
3801
3853
|
visible: isOpen,
|
|
3802
3854
|
transparent: true,
|
|
3803
3855
|
animationType: "fade",
|
|
3804
3856
|
onRequestClose: onClose,
|
|
3805
|
-
children: /* @__PURE__ */ (0,
|
|
3806
|
-
/* @__PURE__ */ (0,
|
|
3857
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_react_native44.View, { style: styles40.overlay, children: [
|
|
3858
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3807
3859
|
import_react_native44.Pressable,
|
|
3808
3860
|
{
|
|
3809
3861
|
testID: "bds-dialog-backdrop",
|
|
@@ -3813,14 +3865,14 @@ function Dialog({
|
|
|
3813
3865
|
importantForAccessibility: "no"
|
|
3814
3866
|
}
|
|
3815
3867
|
),
|
|
3816
|
-
/* @__PURE__ */ (0,
|
|
3868
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3817
3869
|
import_react_native44.View,
|
|
3818
3870
|
{
|
|
3819
3871
|
style: [styles40.panel, { backgroundColor: colors2.colorGreySubtle }, style],
|
|
3820
3872
|
accessibilityViewIsModal: true,
|
|
3821
3873
|
onAccessibilityEscape: onClose,
|
|
3822
3874
|
children: [
|
|
3823
|
-
/* @__PURE__ */ (0,
|
|
3875
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3824
3876
|
import_react_native44.Pressable,
|
|
3825
3877
|
{
|
|
3826
3878
|
style: styles40.closeButton,
|
|
@@ -3828,8 +3880,8 @@ function Dialog({
|
|
|
3828
3880
|
accessibilityRole: "button",
|
|
3829
3881
|
accessibilityLabel: "Close dialog",
|
|
3830
3882
|
hitSlop: 8,
|
|
3831
|
-
children: /* @__PURE__ */ (0,
|
|
3832
|
-
|
|
3883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3884
|
+
ScaledText,
|
|
3833
3885
|
{
|
|
3834
3886
|
style: [styles40.closeText, { color: colors2.colorOnBgSubtle }],
|
|
3835
3887
|
"aria-hidden": true,
|
|
@@ -3838,7 +3890,7 @@ function Dialog({
|
|
|
3838
3890
|
)
|
|
3839
3891
|
}
|
|
3840
3892
|
),
|
|
3841
|
-
!!title && /* @__PURE__ */ (0,
|
|
3893
|
+
!!title && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_native44.View, { style: styles40.header, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ScaledText, { style: [styles40.title, { color: colors2.colorOnGreySubtle }], children: title }) }),
|
|
3842
3894
|
children
|
|
3843
3895
|
]
|
|
3844
3896
|
}
|
|
@@ -3849,9 +3901,9 @@ function Dialog({
|
|
|
3849
3901
|
}
|
|
3850
3902
|
|
|
3851
3903
|
// src/components/interaction/SideSheet/SideSheet.tsx
|
|
3852
|
-
var
|
|
3904
|
+
var import_react17 = require("react");
|
|
3853
3905
|
var import_react_native45 = require("react-native");
|
|
3854
|
-
var
|
|
3906
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3855
3907
|
var styles41 = import_react_native45.StyleSheet.create({
|
|
3856
3908
|
overlay: {
|
|
3857
3909
|
flex: 1,
|
|
@@ -3910,9 +3962,9 @@ function SideSheet({
|
|
|
3910
3962
|
}) {
|
|
3911
3963
|
const { colors: colors2 } = useTheme();
|
|
3912
3964
|
const screenHeight = import_react_native45.Dimensions.get("window").height;
|
|
3913
|
-
const slideAnim = (0,
|
|
3914
|
-
const backdropAnim = (0,
|
|
3915
|
-
(0,
|
|
3965
|
+
const slideAnim = (0, import_react17.useRef)(new import_react_native45.Animated.Value(screenHeight)).current;
|
|
3966
|
+
const backdropAnim = (0, import_react17.useRef)(new import_react_native45.Animated.Value(0)).current;
|
|
3967
|
+
(0, import_react17.useEffect)(() => {
|
|
3916
3968
|
if (isOpen) {
|
|
3917
3969
|
import_react_native45.Animated.parallel([
|
|
3918
3970
|
import_react_native45.Animated.timing(slideAnim, {
|
|
@@ -3941,22 +3993,22 @@ function SideSheet({
|
|
|
3941
3993
|
]).start();
|
|
3942
3994
|
}
|
|
3943
3995
|
}, [isOpen, slideAnim, backdropAnim, screenHeight]);
|
|
3944
|
-
return /* @__PURE__ */ (0,
|
|
3996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3945
3997
|
import_react_native45.Modal,
|
|
3946
3998
|
{
|
|
3947
3999
|
visible: isOpen,
|
|
3948
4000
|
transparent: true,
|
|
3949
4001
|
animationType: "none",
|
|
3950
4002
|
onRequestClose: onClose,
|
|
3951
|
-
children: /* @__PURE__ */ (0,
|
|
3952
|
-
/* @__PURE__ */ (0,
|
|
4003
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react_native45.View, { style: styles41.overlay, children: [
|
|
4004
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3953
4005
|
import_react_native45.Animated.View,
|
|
3954
4006
|
{
|
|
3955
4007
|
style: [
|
|
3956
4008
|
import_react_native45.StyleSheet.absoluteFill,
|
|
3957
4009
|
{ backgroundColor: "rgba(0, 0, 0, 0.5)", opacity: backdropAnim }
|
|
3958
4010
|
],
|
|
3959
|
-
children: /* @__PURE__ */ (0,
|
|
4011
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3960
4012
|
import_react_native45.Pressable,
|
|
3961
4013
|
{
|
|
3962
4014
|
style: import_react_native45.StyleSheet.absoluteFill,
|
|
@@ -3968,7 +4020,7 @@ function SideSheet({
|
|
|
3968
4020
|
)
|
|
3969
4021
|
}
|
|
3970
4022
|
),
|
|
3971
|
-
/* @__PURE__ */ (0,
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3972
4024
|
import_react_native45.Animated.View,
|
|
3973
4025
|
{
|
|
3974
4026
|
style: [
|
|
@@ -3982,13 +4034,13 @@ function SideSheet({
|
|
|
3982
4034
|
accessibilityViewIsModal: true,
|
|
3983
4035
|
onAccessibilityEscape: onClose,
|
|
3984
4036
|
children: [
|
|
3985
|
-
/* @__PURE__ */ (0,
|
|
4037
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3986
4038
|
import_react_native45.View,
|
|
3987
4039
|
{
|
|
3988
4040
|
style: [styles41.header, { borderBottomColor: colors2.colorBgSubtle }],
|
|
3989
4041
|
children: [
|
|
3990
|
-
!!title && /* @__PURE__ */ (0,
|
|
3991
|
-
/* @__PURE__ */ (0,
|
|
4042
|
+
!!title && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ScaledText, { style: [styles41.title, { color: colors2.colorOnBg }], children: title }),
|
|
4043
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3992
4044
|
import_react_native45.Pressable,
|
|
3993
4045
|
{
|
|
3994
4046
|
style: styles41.closeButton,
|
|
@@ -3996,8 +4048,8 @@ function SideSheet({
|
|
|
3996
4048
|
accessibilityRole: "button",
|
|
3997
4049
|
accessibilityLabel: "Close side sheet",
|
|
3998
4050
|
hitSlop: 8,
|
|
3999
|
-
children: /* @__PURE__ */ (0,
|
|
4000
|
-
|
|
4051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4052
|
+
ScaledText,
|
|
4001
4053
|
{
|
|
4002
4054
|
style: [styles41.closeText, { color: colors2.colorOnBgSubtle }],
|
|
4003
4055
|
"aria-hidden": true,
|
|
@@ -4009,7 +4061,7 @@ function SideSheet({
|
|
|
4009
4061
|
]
|
|
4010
4062
|
}
|
|
4011
4063
|
),
|
|
4012
|
-
/* @__PURE__ */ (0,
|
|
4064
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_native45.View, { style: styles41.body, testID: "bds-sidesheet-body", children })
|
|
4013
4065
|
]
|
|
4014
4066
|
}
|
|
4015
4067
|
)
|
|
@@ -4019,10 +4071,10 @@ function SideSheet({
|
|
|
4019
4071
|
}
|
|
4020
4072
|
|
|
4021
4073
|
// src/components/interaction/Toast/Toast.tsx
|
|
4022
|
-
var
|
|
4074
|
+
var import_react18 = require("react");
|
|
4023
4075
|
var import_react_native46 = require("react-native");
|
|
4024
|
-
var
|
|
4025
|
-
var ToastContext = (0,
|
|
4076
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4077
|
+
var ToastContext = (0, import_react18.createContext)(void 0);
|
|
4026
4078
|
var styles42 = import_react_native46.StyleSheet.create({
|
|
4027
4079
|
container: {
|
|
4028
4080
|
position: "absolute",
|
|
@@ -4068,9 +4120,9 @@ function ToastItem({
|
|
|
4068
4120
|
onRemove
|
|
4069
4121
|
}) {
|
|
4070
4122
|
const { colors: colors2 } = useTheme();
|
|
4071
|
-
const slideAnim = (0,
|
|
4072
|
-
const opacityAnim = (0,
|
|
4073
|
-
const variantColors = (0,
|
|
4123
|
+
const slideAnim = (0, import_react18.useRef)(new import_react_native46.Animated.Value(-100)).current;
|
|
4124
|
+
const opacityAnim = (0, import_react18.useRef)(new import_react_native46.Animated.Value(0)).current;
|
|
4125
|
+
const variantColors = (0, import_react18.useMemo)(
|
|
4074
4126
|
() => ({
|
|
4075
4127
|
success: { bg: colors2.colorSuccess, text: colors2.colorOnSuccess },
|
|
4076
4128
|
error: { bg: colors2.colorError, text: colors2.colorOnError },
|
|
@@ -4078,7 +4130,7 @@ function ToastItem({
|
|
|
4078
4130
|
}),
|
|
4079
4131
|
[colors2]
|
|
4080
4132
|
);
|
|
4081
|
-
(0,
|
|
4133
|
+
(0, import_react18.useEffect)(() => {
|
|
4082
4134
|
import_react_native46.Animated.parallel([
|
|
4083
4135
|
import_react_native46.Animated.timing(slideAnim, {
|
|
4084
4136
|
toValue: 0,
|
|
@@ -4092,12 +4144,12 @@ function ToastItem({
|
|
|
4092
4144
|
})
|
|
4093
4145
|
]).start();
|
|
4094
4146
|
}, [slideAnim, opacityAnim]);
|
|
4095
|
-
(0,
|
|
4147
|
+
(0, import_react18.useEffect)(() => {
|
|
4096
4148
|
const timer = setTimeout(onRemove, 5e3);
|
|
4097
4149
|
return () => clearTimeout(timer);
|
|
4098
4150
|
}, [onRemove]);
|
|
4099
4151
|
const { bg, text } = variantColors[toast.variant];
|
|
4100
|
-
return /* @__PURE__ */ (0,
|
|
4152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4101
4153
|
import_react_native46.Animated.View,
|
|
4102
4154
|
{
|
|
4103
4155
|
style: [
|
|
@@ -4111,8 +4163,8 @@ function ToastItem({
|
|
|
4111
4163
|
accessibilityRole: "alert",
|
|
4112
4164
|
accessibilityLiveRegion: "polite",
|
|
4113
4165
|
children: [
|
|
4114
|
-
/* @__PURE__ */ (0,
|
|
4115
|
-
/* @__PURE__ */ (0,
|
|
4166
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ScaledText, { style: [styles42.message, { color: text }], children: toast.message }),
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4116
4168
|
import_react_native46.Pressable,
|
|
4117
4169
|
{
|
|
4118
4170
|
style: styles42.closeButton,
|
|
@@ -4120,7 +4172,7 @@ function ToastItem({
|
|
|
4120
4172
|
accessibilityRole: "button",
|
|
4121
4173
|
accessibilityLabel: "Dismiss",
|
|
4122
4174
|
hitSlop: 8,
|
|
4123
|
-
children: /* @__PURE__ */ (0,
|
|
4175
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ScaledText, { style: [styles42.closeText, { color: text }], "aria-hidden": true, children: "\u2715" })
|
|
4124
4176
|
}
|
|
4125
4177
|
)
|
|
4126
4178
|
]
|
|
@@ -4131,24 +4183,24 @@ function ToastProvider({
|
|
|
4131
4183
|
children,
|
|
4132
4184
|
style
|
|
4133
4185
|
}) {
|
|
4134
|
-
const [toasts, setToasts] = (0,
|
|
4135
|
-
const showToast = (0,
|
|
4186
|
+
const [toasts, setToasts] = (0, import_react18.useState)([]);
|
|
4187
|
+
const showToast = (0, import_react18.useCallback)((message, variant) => {
|
|
4136
4188
|
const id = Math.random().toString(36).substring(2, 9);
|
|
4137
4189
|
setToasts((prev) => [...prev, { id, message, variant }]);
|
|
4138
4190
|
}, []);
|
|
4139
|
-
const removeToast = (0,
|
|
4191
|
+
const removeToast = (0, import_react18.useCallback)((id) => {
|
|
4140
4192
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
4141
4193
|
}, []);
|
|
4142
|
-
const value = (0,
|
|
4143
|
-
return /* @__PURE__ */ (0,
|
|
4194
|
+
const value = (0, import_react18.useMemo)(() => ({ showToast }), [showToast]);
|
|
4195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ToastContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react_native46.View, { style: [{ flex: 1 }, style], children: [
|
|
4144
4196
|
children,
|
|
4145
|
-
toasts.length > 0 && /* @__PURE__ */ (0,
|
|
4197
|
+
toasts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4146
4198
|
import_react_native46.View,
|
|
4147
4199
|
{
|
|
4148
4200
|
style: styles42.container,
|
|
4149
4201
|
accessibilityRole: "summary",
|
|
4150
4202
|
accessibilityLabel: "Notifications",
|
|
4151
|
-
children: toasts.map((toast) => /* @__PURE__ */ (0,
|
|
4203
|
+
children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4152
4204
|
ToastItem,
|
|
4153
4205
|
{
|
|
4154
4206
|
toast,
|
|
@@ -4161,7 +4213,7 @@ function ToastProvider({
|
|
|
4161
4213
|
] }) });
|
|
4162
4214
|
}
|
|
4163
4215
|
function useToast() {
|
|
4164
|
-
const context = (0,
|
|
4216
|
+
const context = (0, import_react18.useContext)(ToastContext);
|
|
4165
4217
|
if (!context) {
|
|
4166
4218
|
throw new Error("useToast must be used within a ToastProvider");
|
|
4167
4219
|
}
|
|
@@ -4169,9 +4221,9 @@ function useToast() {
|
|
|
4169
4221
|
}
|
|
4170
4222
|
|
|
4171
4223
|
// src/components/interaction/DropdownMenu/DropdownMenu.tsx
|
|
4172
|
-
var
|
|
4224
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
4173
4225
|
var import_react_native47 = require("react-native");
|
|
4174
|
-
var
|
|
4226
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4175
4227
|
var styles43 = import_react_native47.StyleSheet.create({
|
|
4176
4228
|
overlay: {
|
|
4177
4229
|
flex: 1,
|
|
@@ -4229,11 +4281,11 @@ function DropdownMenu({
|
|
|
4229
4281
|
style
|
|
4230
4282
|
}) {
|
|
4231
4283
|
const { colors: colors2 } = useTheme();
|
|
4232
|
-
const [open, setOpen] = (0,
|
|
4284
|
+
const [open, setOpen] = (0, import_react19.useState)(false);
|
|
4233
4285
|
const screenHeight = import_react_native47.Dimensions.get("window").height;
|
|
4234
|
-
const slideAnim = (0,
|
|
4235
|
-
const backdropAnim = (0,
|
|
4236
|
-
(0,
|
|
4286
|
+
const slideAnim = (0, import_react19.useRef)(new import_react_native47.Animated.Value(screenHeight)).current;
|
|
4287
|
+
const backdropAnim = (0, import_react19.useRef)(new import_react_native47.Animated.Value(0)).current;
|
|
4288
|
+
(0, import_react19.useEffect)(() => {
|
|
4237
4289
|
if (open) {
|
|
4238
4290
|
import_react_native47.Animated.parallel([
|
|
4239
4291
|
import_react_native47.Animated.timing(slideAnim, {
|
|
@@ -4266,28 +4318,28 @@ function DropdownMenu({
|
|
|
4266
4318
|
item.onPress?.();
|
|
4267
4319
|
setOpen(false);
|
|
4268
4320
|
};
|
|
4269
|
-
return /* @__PURE__ */ (0,
|
|
4270
|
-
|
|
4321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native47.View, { style, children: [
|
|
4322
|
+
import_react19.default.cloneElement(trigger, {
|
|
4271
4323
|
onPress: () => setOpen(true),
|
|
4272
4324
|
accessibilityRole: "button",
|
|
4273
4325
|
accessibilityLabel: title
|
|
4274
4326
|
}),
|
|
4275
|
-
/* @__PURE__ */ (0,
|
|
4327
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4276
4328
|
import_react_native47.Modal,
|
|
4277
4329
|
{
|
|
4278
4330
|
visible: open,
|
|
4279
4331
|
transparent: true,
|
|
4280
4332
|
animationType: "none",
|
|
4281
4333
|
onRequestClose: () => setOpen(false),
|
|
4282
|
-
children: /* @__PURE__ */ (0,
|
|
4283
|
-
/* @__PURE__ */ (0,
|
|
4334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native47.View, { style: styles43.overlay, children: [
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4284
4336
|
import_react_native47.Animated.View,
|
|
4285
4337
|
{
|
|
4286
4338
|
style: [
|
|
4287
4339
|
import_react_native47.StyleSheet.absoluteFill,
|
|
4288
4340
|
{ backgroundColor: "rgba(0, 0, 0, 0.5)", opacity: backdropAnim }
|
|
4289
4341
|
],
|
|
4290
|
-
children: /* @__PURE__ */ (0,
|
|
4342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4291
4343
|
import_react_native47.Pressable,
|
|
4292
4344
|
{
|
|
4293
4345
|
style: import_react_native47.StyleSheet.absoluteFill,
|
|
@@ -4299,7 +4351,7 @@ function DropdownMenu({
|
|
|
4299
4351
|
)
|
|
4300
4352
|
}
|
|
4301
4353
|
),
|
|
4302
|
-
/* @__PURE__ */ (0,
|
|
4354
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4303
4355
|
import_react_native47.Animated.View,
|
|
4304
4356
|
{
|
|
4305
4357
|
style: [
|
|
@@ -4311,8 +4363,8 @@ function DropdownMenu({
|
|
|
4311
4363
|
],
|
|
4312
4364
|
accessibilityViewIsModal: true,
|
|
4313
4365
|
onAccessibilityEscape: () => setOpen(false),
|
|
4314
|
-
children: /* @__PURE__ */ (0,
|
|
4315
|
-
/* @__PURE__ */ (0,
|
|
4366
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native47.SafeAreaView, { children: [
|
|
4367
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
4316
4368
|
import_react_native47.View,
|
|
4317
4369
|
{
|
|
4318
4370
|
style: [
|
|
@@ -4320,16 +4372,16 @@ function DropdownMenu({
|
|
|
4320
4372
|
{ borderBottomColor: colors2.colorBgSubtle }
|
|
4321
4373
|
],
|
|
4322
4374
|
children: [
|
|
4323
|
-
/* @__PURE__ */ (0,
|
|
4324
|
-
/* @__PURE__ */ (0,
|
|
4375
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScaledText, { style: [styles43.sheetTitle, { color: colors2.colorOnBg }], children: title }),
|
|
4376
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4325
4377
|
import_react_native47.Pressable,
|
|
4326
4378
|
{
|
|
4327
4379
|
accessibilityRole: "button",
|
|
4328
4380
|
accessibilityLabel: "Close",
|
|
4329
4381
|
onPress: () => setOpen(false),
|
|
4330
4382
|
hitSlop: 8,
|
|
4331
|
-
children: /* @__PURE__ */ (0,
|
|
4332
|
-
|
|
4383
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4384
|
+
ScaledText,
|
|
4333
4385
|
{
|
|
4334
4386
|
style: [
|
|
4335
4387
|
styles43.closeText,
|
|
@@ -4343,13 +4395,13 @@ function DropdownMenu({
|
|
|
4343
4395
|
]
|
|
4344
4396
|
}
|
|
4345
4397
|
),
|
|
4346
|
-
/* @__PURE__ */ (0,
|
|
4398
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4347
4399
|
import_react_native47.FlatList,
|
|
4348
4400
|
{
|
|
4349
4401
|
data: items,
|
|
4350
4402
|
keyExtractor: (item) => item.id,
|
|
4351
|
-
renderItem: ({ item }) => /* @__PURE__ */ (0,
|
|
4352
|
-
item.separator && /* @__PURE__ */ (0,
|
|
4403
|
+
renderItem: ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
4404
|
+
item.separator && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4353
4405
|
import_react_native47.View,
|
|
4354
4406
|
{
|
|
4355
4407
|
style: [
|
|
@@ -4359,7 +4411,7 @@ function DropdownMenu({
|
|
|
4359
4411
|
accessibilityRole: "none"
|
|
4360
4412
|
}
|
|
4361
4413
|
),
|
|
4362
|
-
/* @__PURE__ */ (0,
|
|
4414
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
4363
4415
|
import_react_native47.Pressable,
|
|
4364
4416
|
{
|
|
4365
4417
|
accessibilityRole: "menuitem",
|
|
@@ -4373,7 +4425,7 @@ function DropdownMenu({
|
|
|
4373
4425
|
item.disabled && { opacity: 0.4 }
|
|
4374
4426
|
],
|
|
4375
4427
|
children: [
|
|
4376
|
-
!!item.icon && /* @__PURE__ */ (0,
|
|
4428
|
+
!!item.icon && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4377
4429
|
import_react_native47.View,
|
|
4378
4430
|
{
|
|
4379
4431
|
importantForAccessibility: "no-hide-descendants",
|
|
@@ -4381,8 +4433,8 @@ function DropdownMenu({
|
|
|
4381
4433
|
children: item.icon
|
|
4382
4434
|
}
|
|
4383
4435
|
),
|
|
4384
|
-
/* @__PURE__ */ (0,
|
|
4385
|
-
|
|
4436
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4437
|
+
ScaledText,
|
|
4386
4438
|
{
|
|
4387
4439
|
style: [
|
|
4388
4440
|
styles43.itemText,
|
|
@@ -4407,9 +4459,9 @@ function DropdownMenu({
|
|
|
4407
4459
|
}
|
|
4408
4460
|
|
|
4409
4461
|
// src/components/interaction/Popover/Popover.tsx
|
|
4410
|
-
var
|
|
4462
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
4411
4463
|
var import_react_native48 = require("react-native");
|
|
4412
|
-
var
|
|
4464
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4413
4465
|
var styles44 = import_react_native48.StyleSheet.create({
|
|
4414
4466
|
wrapper: {
|
|
4415
4467
|
alignSelf: "flex-start"
|
|
@@ -4440,23 +4492,23 @@ function Popover({
|
|
|
4440
4492
|
style
|
|
4441
4493
|
}) {
|
|
4442
4494
|
const { colors: colors2 } = useTheme();
|
|
4443
|
-
const [isOpen, setIsOpen] = (0,
|
|
4495
|
+
const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
|
|
4444
4496
|
const close = () => setIsOpen(false);
|
|
4445
|
-
return /* @__PURE__ */ (0,
|
|
4446
|
-
|
|
4497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react_native48.View, { style: [styles44.wrapper, style], children: [
|
|
4498
|
+
import_react20.default.cloneElement(children, {
|
|
4447
4499
|
onPress: () => setIsOpen(true),
|
|
4448
4500
|
accessibilityRole: "button",
|
|
4449
4501
|
accessibilityLabel: accessibilityLabel ?? "Open popover"
|
|
4450
4502
|
}),
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4503
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4452
4504
|
import_react_native48.Modal,
|
|
4453
4505
|
{
|
|
4454
4506
|
visible: isOpen,
|
|
4455
4507
|
transparent: true,
|
|
4456
4508
|
animationType: "fade",
|
|
4457
4509
|
onRequestClose: close,
|
|
4458
|
-
children: /* @__PURE__ */ (0,
|
|
4459
|
-
/* @__PURE__ */ (0,
|
|
4510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react_native48.View, { style: styles44.overlay, onAccessibilityEscape: close, children: [
|
|
4511
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4460
4512
|
import_react_native48.Pressable,
|
|
4461
4513
|
{
|
|
4462
4514
|
testID: "bds-popover-backdrop",
|
|
@@ -4467,7 +4519,7 @@ function Popover({
|
|
|
4467
4519
|
accessibilityLabel: "Close popover"
|
|
4468
4520
|
}
|
|
4469
4521
|
),
|
|
4470
|
-
/* @__PURE__ */ (0,
|
|
4522
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4471
4523
|
import_react_native48.View,
|
|
4472
4524
|
{
|
|
4473
4525
|
style: [styles44.panel, { backgroundColor: colors2.colorBg }],
|