@boostdev/design-system-react-native 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/index.cjs +572 -534
- package/dist/index.js +464 -426
- package/package.json +1 -1
- package/src/components/interaction/Button/Button.mdx +5 -1
- package/src/components/interaction/Button/Button.spec.tsx +23 -0
- package/src/components/interaction/Button/Button.tsx +7 -6
- package/src/components/interaction/form/Combobox/Combobox.spec.tsx +9 -0
- package/src/components/interaction/form/Combobox/Combobox.tsx +2 -2
- package/src/components/interaction/form/FileInput/FileInput.spec.tsx +6 -0
- package/src/components/interaction/form/FileInput/FileInput.tsx +1 -1
- package/src/components/interaction/form/FormInput/FormInput.spec.tsx +7 -0
- package/src/components/interaction/form/FormInput/FormInput.tsx +2 -2
- package/src/components/interaction/form/NumberInput/NumberInput.spec.tsx +8 -0
- package/src/components/interaction/form/NumberInput/NumberInput.tsx +4 -4
- package/src/components/interaction/form/Select/Select.mdx +2 -1
- package/src/components/interaction/form/Select/Select.spec.tsx +22 -1
- package/src/components/interaction/form/Select/Select.tsx +7 -6
- package/src/components/interaction/form/Textarea/Textarea.spec.tsx +6 -0
- package/src/components/interaction/form/Textarea/Textarea.tsx +1 -1
- package/src/components/ui/Collapsible/Collapsible.spec.tsx +1 -1
- package/src/components/ui/Collapsible/Collapsible.tsx +5 -10
- package/src/native/Chevron.spec.tsx +34 -0
- package/src/native/Chevron.tsx +50 -0
- package/src/test/cornerRadii.ts +15 -0
package/dist/index.js
CHANGED
|
@@ -1063,12 +1063,50 @@ function Pagination({
|
|
|
1063
1063
|
|
|
1064
1064
|
// src/components/ui/Collapsible/Collapsible.tsx
|
|
1065
1065
|
import { useCallback, useRef as useRef2, useState as useState2 } from "react";
|
|
1066
|
-
import { StyleSheet as
|
|
1067
|
-
|
|
1066
|
+
import { StyleSheet as StyleSheet17, View as View12, Pressable as Pressable7, Animated as Animated3, LayoutAnimation, Platform, UIManager } from "react-native";
|
|
1067
|
+
|
|
1068
|
+
// src/native/Chevron.tsx
|
|
1069
|
+
import { Animated as Animated2, StyleSheet as StyleSheet16 } from "react-native";
|
|
1070
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1071
|
+
var SIZE = 8;
|
|
1072
|
+
var STROKE = 1.5;
|
|
1073
|
+
var CENTRE_SHIFT = -(SIZE - STROKE) / 4;
|
|
1074
|
+
var styles15 = StyleSheet16.create({
|
|
1075
|
+
chevron: {
|
|
1076
|
+
// Border-box chevron (no glyph font dependency): a small square with two
|
|
1077
|
+
// adjacent borders, rotated to form a crisp "›" / "⌄" indicator.
|
|
1078
|
+
width: SIZE,
|
|
1079
|
+
height: SIZE,
|
|
1080
|
+
borderRightWidth: STROKE,
|
|
1081
|
+
borderBottomWidth: STROKE
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
function Chevron({ color, rotate = "45deg", testID, style }) {
|
|
1085
|
+
return /* @__PURE__ */ jsx18(
|
|
1086
|
+
Animated2.View,
|
|
1087
|
+
{
|
|
1088
|
+
testID,
|
|
1089
|
+
style: [
|
|
1090
|
+
styles15.chevron,
|
|
1091
|
+
{
|
|
1092
|
+
borderColor: color,
|
|
1093
|
+
transform: [{ rotate }, { translateX: CENTRE_SHIFT }, { translateY: CENTRE_SHIFT }]
|
|
1094
|
+
},
|
|
1095
|
+
style
|
|
1096
|
+
],
|
|
1097
|
+
"aria-hidden": true,
|
|
1098
|
+
importantForAccessibility: "no-hide-descendants",
|
|
1099
|
+
accessibilityElementsHidden: true
|
|
1100
|
+
}
|
|
1101
|
+
);
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
// src/components/ui/Collapsible/Collapsible.tsx
|
|
1105
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1068
1106
|
if (Platform.OS === "android" && UIManager.setLayoutAnimationEnabledExperimental) {
|
|
1069
1107
|
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
1070
1108
|
}
|
|
1071
|
-
var
|
|
1109
|
+
var styles16 = StyleSheet17.create({
|
|
1072
1110
|
container: {
|
|
1073
1111
|
borderRadius: border.radius.m,
|
|
1074
1112
|
overflow: "hidden"
|
|
@@ -1089,12 +1127,6 @@ var styles15 = StyleSheet16.create({
|
|
|
1089
1127
|
lineHeight: lineHeight.body
|
|
1090
1128
|
},
|
|
1091
1129
|
chevron: {
|
|
1092
|
-
// Border-box chevron (no glyph font dependency): a small square with two
|
|
1093
|
-
// adjacent borders, rotated to form a crisp "›" / "⌄" disclosure indicator.
|
|
1094
|
-
width: 8,
|
|
1095
|
-
height: 8,
|
|
1096
|
-
borderRightWidth: 2,
|
|
1097
|
-
borderBottomWidth: 2,
|
|
1098
1130
|
marginStart: spacing.xs
|
|
1099
1131
|
},
|
|
1100
1132
|
content: {
|
|
@@ -1119,11 +1151,11 @@ function Collapsible({
|
|
|
1119
1151
|
const [internalOpen, setInternalOpen] = useState2(defaultOpen);
|
|
1120
1152
|
const isControlled = controlledOpen !== void 0;
|
|
1121
1153
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
1122
|
-
const rotation = useRef2(new
|
|
1154
|
+
const rotation = useRef2(new Animated3.Value(isOpen ? 1 : 0)).current;
|
|
1123
1155
|
const toggle = useCallback(() => {
|
|
1124
1156
|
const next = !isOpen;
|
|
1125
1157
|
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
1126
|
-
|
|
1158
|
+
Animated3.timing(rotation, {
|
|
1127
1159
|
toValue: next ? 1 : 0,
|
|
1128
1160
|
duration: 200,
|
|
1129
1161
|
useNativeDriver: true
|
|
@@ -1140,7 +1172,7 @@ function Collapsible({
|
|
|
1140
1172
|
return /* @__PURE__ */ jsxs9(
|
|
1141
1173
|
View12,
|
|
1142
1174
|
{
|
|
1143
|
-
style: [
|
|
1175
|
+
style: [styles16.container, { borderBottomWidth: 1, borderBottomColor: colors2.colorBgSubtle }, style],
|
|
1144
1176
|
accessibilityRole: "summary",
|
|
1145
1177
|
children: [
|
|
1146
1178
|
/* @__PURE__ */ jsxs9(
|
|
@@ -1150,22 +1182,22 @@ function Collapsible({
|
|
|
1150
1182
|
accessibilityRole: "button",
|
|
1151
1183
|
accessibilityLabel: summary,
|
|
1152
1184
|
accessibilityState: { expanded: isOpen },
|
|
1153
|
-
style: ({ pressed }) => [
|
|
1185
|
+
style: ({ pressed }) => [styles16.header, pressed && styles16.pressed],
|
|
1154
1186
|
children: [
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
|
|
1187
|
+
/* @__PURE__ */ jsx19(ScaledText, { style: [styles16.summaryText, { color: colors2.colorOnBg }], children: summary }),
|
|
1188
|
+
/* @__PURE__ */ jsx19(
|
|
1189
|
+
Chevron,
|
|
1158
1190
|
{
|
|
1159
1191
|
testID: "bds-collapsible-chevron",
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1192
|
+
color: colors2.colorOnBgSubtle,
|
|
1193
|
+
rotate,
|
|
1194
|
+
style: styles16.chevron
|
|
1163
1195
|
}
|
|
1164
1196
|
)
|
|
1165
1197
|
]
|
|
1166
1198
|
}
|
|
1167
1199
|
),
|
|
1168
|
-
isOpen && /* @__PURE__ */
|
|
1200
|
+
isOpen && /* @__PURE__ */ jsx19(View12, { style: styles16.content, children })
|
|
1169
1201
|
]
|
|
1170
1202
|
}
|
|
1171
1203
|
);
|
|
@@ -1173,12 +1205,12 @@ function Collapsible({
|
|
|
1173
1205
|
|
|
1174
1206
|
// src/components/ui/Accordion/Accordion.tsx
|
|
1175
1207
|
import { useState as useState3 } from "react";
|
|
1176
|
-
import { StyleSheet as
|
|
1177
|
-
import { jsx as
|
|
1208
|
+
import { StyleSheet as StyleSheet18, View as View13, Pressable as Pressable8, LayoutAnimation as LayoutAnimation2, Platform as Platform2, UIManager as UIManager2 } from "react-native";
|
|
1209
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1178
1210
|
if (Platform2.OS === "android" && UIManager2.setLayoutAnimationEnabledExperimental) {
|
|
1179
1211
|
UIManager2.setLayoutAnimationEnabledExperimental(true);
|
|
1180
1212
|
}
|
|
1181
|
-
var
|
|
1213
|
+
var styles17 = StyleSheet18.create({
|
|
1182
1214
|
container: {
|
|
1183
1215
|
overflow: "hidden",
|
|
1184
1216
|
borderRadius: border.radius.s
|
|
@@ -1232,14 +1264,14 @@ function Accordion({
|
|
|
1232
1264
|
return allowMultiple ? [...prev, id] : [id];
|
|
1233
1265
|
});
|
|
1234
1266
|
};
|
|
1235
|
-
return /* @__PURE__ */
|
|
1267
|
+
return /* @__PURE__ */ jsx20(View13, { style: [styles17.container, style], children: items.map((item, index) => {
|
|
1236
1268
|
const isOpen = openIds.includes(item.id);
|
|
1237
1269
|
const isLast = index === items.length - 1;
|
|
1238
1270
|
return /* @__PURE__ */ jsxs10(
|
|
1239
1271
|
View13,
|
|
1240
1272
|
{
|
|
1241
1273
|
style: [
|
|
1242
|
-
|
|
1274
|
+
styles17.item,
|
|
1243
1275
|
{ borderBottomColor: colors2.colorBgSubtle },
|
|
1244
1276
|
isLast && { borderBottomWidth: 0 }
|
|
1245
1277
|
],
|
|
@@ -1252,16 +1284,16 @@ function Accordion({
|
|
|
1252
1284
|
accessibilityRole: "button",
|
|
1253
1285
|
accessibilityState: { expanded: isOpen, disabled: item.disabled },
|
|
1254
1286
|
style: ({ pressed }) => [
|
|
1255
|
-
|
|
1256
|
-
item.disabled &&
|
|
1257
|
-
pressed && !item.disabled &&
|
|
1287
|
+
styles17.header,
|
|
1288
|
+
item.disabled && styles17.disabled,
|
|
1289
|
+
pressed && !item.disabled && styles17.pressed
|
|
1258
1290
|
],
|
|
1259
1291
|
children: [
|
|
1260
|
-
/* @__PURE__ */
|
|
1261
|
-
/* @__PURE__ */
|
|
1292
|
+
/* @__PURE__ */ jsx20(ScaledText, { style: [styles17.titleText, { color: colors2.colorOnBg }], children: typeof item.title === "string" ? item.title : item.title }),
|
|
1293
|
+
/* @__PURE__ */ jsx20(
|
|
1262
1294
|
ScaledText,
|
|
1263
1295
|
{
|
|
1264
|
-
style: [
|
|
1296
|
+
style: [styles17.chevron, { color: colors2.colorOnBgSubtle }],
|
|
1265
1297
|
importantForAccessibility: "no",
|
|
1266
1298
|
accessibilityElementsHidden: true,
|
|
1267
1299
|
children: isOpen ? "\u25BE" : "\u25B8"
|
|
@@ -1270,7 +1302,7 @@ function Accordion({
|
|
|
1270
1302
|
]
|
|
1271
1303
|
}
|
|
1272
1304
|
),
|
|
1273
|
-
isOpen && /* @__PURE__ */
|
|
1305
|
+
isOpen && /* @__PURE__ */ jsx20(View13, { style: styles17.panel, accessibilityRole: "summary", children: item.content })
|
|
1274
1306
|
]
|
|
1275
1307
|
},
|
|
1276
1308
|
item.id
|
|
@@ -1280,9 +1312,9 @@ function Accordion({
|
|
|
1280
1312
|
|
|
1281
1313
|
// src/components/ui/Tabs/Tabs.tsx
|
|
1282
1314
|
import { useState as useState4 } from "react";
|
|
1283
|
-
import { StyleSheet as
|
|
1284
|
-
import { jsx as
|
|
1285
|
-
var
|
|
1315
|
+
import { StyleSheet as StyleSheet19, View as View14, Pressable as Pressable9, ScrollView } from "react-native";
|
|
1316
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1317
|
+
var styles18 = StyleSheet19.create({
|
|
1286
1318
|
container: {
|
|
1287
1319
|
overflow: "hidden"
|
|
1288
1320
|
},
|
|
@@ -1321,17 +1353,17 @@ function Tabs({
|
|
|
1321
1353
|
}) {
|
|
1322
1354
|
const { colors: colors2 } = useTheme();
|
|
1323
1355
|
const [activeTab, setActiveTab] = useState4(defaultTab ?? tabs[0]?.id);
|
|
1324
|
-
return /* @__PURE__ */ jsxs11(View14, { style: [
|
|
1325
|
-
/* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ jsxs11(View14, { style: [styles18.container, style], children: [
|
|
1357
|
+
/* @__PURE__ */ jsx21(
|
|
1326
1358
|
ScrollView,
|
|
1327
1359
|
{
|
|
1328
1360
|
horizontal: true,
|
|
1329
1361
|
showsHorizontalScrollIndicator: false,
|
|
1330
|
-
contentContainerStyle: [
|
|
1362
|
+
contentContainerStyle: [styles18.tabList, { borderBottomColor: colors2.colorBgSubtle }],
|
|
1331
1363
|
accessibilityRole: "tabbar",
|
|
1332
1364
|
children: tabs.map((tab) => {
|
|
1333
1365
|
const isActive = activeTab === tab.id;
|
|
1334
|
-
return /* @__PURE__ */
|
|
1366
|
+
return /* @__PURE__ */ jsx21(
|
|
1335
1367
|
Pressable9,
|
|
1336
1368
|
{
|
|
1337
1369
|
onPress: () => setActiveTab(tab.id),
|
|
@@ -1343,18 +1375,18 @@ function Tabs({
|
|
|
1343
1375
|
},
|
|
1344
1376
|
accessibilityLabel: typeof tab.label === "string" ? tab.label : void 0,
|
|
1345
1377
|
style: ({ pressed }) => [
|
|
1346
|
-
|
|
1378
|
+
styles18.tabButton,
|
|
1347
1379
|
{
|
|
1348
1380
|
borderBottomColor: isActive ? colors2.colorInteractive : "transparent"
|
|
1349
1381
|
},
|
|
1350
|
-
tab.disabled &&
|
|
1351
|
-
pressed && !tab.disabled &&
|
|
1382
|
+
tab.disabled && styles18.disabled,
|
|
1383
|
+
pressed && !tab.disabled && styles18.pressed
|
|
1352
1384
|
],
|
|
1353
|
-
children: /* @__PURE__ */
|
|
1385
|
+
children: /* @__PURE__ */ jsx21(
|
|
1354
1386
|
ScaledText,
|
|
1355
1387
|
{
|
|
1356
1388
|
style: [
|
|
1357
|
-
|
|
1389
|
+
styles18.tabLabel,
|
|
1358
1390
|
{
|
|
1359
1391
|
color: isActive ? colors2.colorInteractive : colors2.colorOnBgSubtle,
|
|
1360
1392
|
fontWeight: isActive ? font.weight.semibold : font.weight.body
|
|
@@ -1372,15 +1404,15 @@ function Tabs({
|
|
|
1372
1404
|
tabs.map((tab) => {
|
|
1373
1405
|
const isActive = activeTab === tab.id;
|
|
1374
1406
|
if (!isActive) return null;
|
|
1375
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ jsx21(View14, { style: styles18.panel, accessibilityRole: "tabpanel", children: tab.content }, tab.id);
|
|
1376
1408
|
})
|
|
1377
1409
|
] });
|
|
1378
1410
|
}
|
|
1379
1411
|
|
|
1380
1412
|
// src/components/ui/Table/Table.tsx
|
|
1381
|
-
import { StyleSheet as
|
|
1382
|
-
import { jsx as
|
|
1383
|
-
var
|
|
1413
|
+
import { StyleSheet as StyleSheet20, View as View15, ScrollView as ScrollView2, Pressable as Pressable10 } from "react-native";
|
|
1414
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1415
|
+
var styles19 = StyleSheet20.create({
|
|
1384
1416
|
wrapper: {
|
|
1385
1417
|
borderRadius: border.radius.s,
|
|
1386
1418
|
overflow: "hidden"
|
|
@@ -1456,29 +1488,29 @@ function Table({
|
|
|
1456
1488
|
if (sortKey !== col.key) return base;
|
|
1457
1489
|
return `${base}, currently ${sortDirection === "asc" ? "ascending" : "descending"}`;
|
|
1458
1490
|
};
|
|
1459
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ jsx22(
|
|
1460
1492
|
ScrollView2,
|
|
1461
1493
|
{
|
|
1462
1494
|
horizontal: true,
|
|
1463
1495
|
showsHorizontalScrollIndicator: true,
|
|
1464
|
-
style: [
|
|
1496
|
+
style: [styles19.wrapper, { backgroundColor: colors2.colorBg }, style],
|
|
1465
1497
|
children: /* @__PURE__ */ jsxs12(View15, { children: [
|
|
1466
|
-
caption && /* @__PURE__ */
|
|
1467
|
-
/* @__PURE__ */
|
|
1498
|
+
caption && /* @__PURE__ */ jsx22(ScaledText, { style: [styles19.caption, { color: colors2.colorOnBgSubtle }], children: caption }),
|
|
1499
|
+
/* @__PURE__ */ jsx22(View15, { style: [styles19.headerRow, { backgroundColor: colors2.colorBgSubtle }], children: columns.map(
|
|
1468
1500
|
(col) => col.sortable ? /* @__PURE__ */ jsxs12(
|
|
1469
1501
|
Pressable10,
|
|
1470
1502
|
{
|
|
1471
1503
|
onPress: () => handleSort(col.key),
|
|
1472
1504
|
accessibilityRole: "button",
|
|
1473
1505
|
accessibilityLabel: getSortLabel(col),
|
|
1474
|
-
style: ({ pressed }) => [
|
|
1506
|
+
style: ({ pressed }) => [styles19.headerCell, pressed && styles19.pressed],
|
|
1475
1507
|
children: [
|
|
1476
|
-
/* @__PURE__ */
|
|
1477
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ jsx22(ScaledText, { style: [styles19.headerText, { color: colors2.colorOnBg }], children: col.header }),
|
|
1509
|
+
/* @__PURE__ */ jsx22(
|
|
1478
1510
|
ScaledText,
|
|
1479
1511
|
{
|
|
1480
1512
|
style: [
|
|
1481
|
-
|
|
1513
|
+
styles19.sortIndicator,
|
|
1482
1514
|
{
|
|
1483
1515
|
color: sortKey === col.key ? colors2.colorInteractive : colors2.colorOnBgSubtle
|
|
1484
1516
|
}
|
|
@@ -1491,18 +1523,18 @@ function Table({
|
|
|
1491
1523
|
]
|
|
1492
1524
|
},
|
|
1493
1525
|
col.key
|
|
1494
|
-
) : /* @__PURE__ */
|
|
1526
|
+
) : /* @__PURE__ */ jsx22(View15, { style: styles19.headerCell, children: /* @__PURE__ */ jsx22(ScaledText, { style: [styles19.headerText, { color: colors2.colorOnBg }], children: col.header }) }, col.key)
|
|
1495
1527
|
) }),
|
|
1496
|
-
rows.map((row, rowIndex) => /* @__PURE__ */
|
|
1528
|
+
rows.map((row, rowIndex) => /* @__PURE__ */ jsx22(
|
|
1497
1529
|
View15,
|
|
1498
1530
|
{
|
|
1499
1531
|
style: [
|
|
1500
|
-
|
|
1532
|
+
styles19.row,
|
|
1501
1533
|
{ borderTopColor: colors2.colorBgSubtle },
|
|
1502
1534
|
rowIndex % 2 === 1 && { backgroundColor: colors2.colorBgSubtle }
|
|
1503
1535
|
],
|
|
1504
1536
|
accessibilityRole: "none",
|
|
1505
|
-
children: columns.map((col) => /* @__PURE__ */
|
|
1537
|
+
children: columns.map((col) => /* @__PURE__ */ jsx22(View15, { style: styles19.cell, children: col.render ? typeof col.render(row) === "string" ? /* @__PURE__ */ jsx22(ScaledText, { style: [styles19.cellText, { color: colors2.colorOnBg }], children: col.render(row) }) : col.render(row) : /* @__PURE__ */ jsx22(ScaledText, { style: [styles19.cellText, { color: colors2.colorOnBg }], children: String(row[col.key] ?? "") }) }, col.key))
|
|
1506
1538
|
},
|
|
1507
1539
|
rowIndex
|
|
1508
1540
|
))
|
|
@@ -1513,8 +1545,8 @@ function Table({
|
|
|
1513
1545
|
|
|
1514
1546
|
// src/components/ui/Calendar/Calendar.tsx
|
|
1515
1547
|
import { useState as useState5 } from "react";
|
|
1516
|
-
import { StyleSheet as
|
|
1517
|
-
import { jsx as
|
|
1548
|
+
import { StyleSheet as StyleSheet21, View as View16, Pressable as Pressable11 } from "react-native";
|
|
1549
|
+
import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1518
1550
|
var DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
1519
1551
|
var DAY_LABELS = {
|
|
1520
1552
|
Su: "Sunday",
|
|
@@ -1557,7 +1589,7 @@ function getFirstDayOfMonth(year, month) {
|
|
|
1557
1589
|
return new Date(year, month, 1).getDay();
|
|
1558
1590
|
}
|
|
1559
1591
|
var DAY_SIZE = 44;
|
|
1560
|
-
var
|
|
1592
|
+
var styles20 = StyleSheet21.create({
|
|
1561
1593
|
container: {
|
|
1562
1594
|
alignSelf: "flex-start"
|
|
1563
1595
|
},
|
|
@@ -1672,25 +1704,25 @@ function Calendar({
|
|
|
1672
1704
|
return /* @__PURE__ */ jsxs13(
|
|
1673
1705
|
View16,
|
|
1674
1706
|
{
|
|
1675
|
-
style: [
|
|
1707
|
+
style: [styles20.container, style],
|
|
1676
1708
|
accessibilityRole: "none",
|
|
1677
1709
|
accessibilityLabel: `${MONTHS[viewMonth]} ${viewYear} calendar`,
|
|
1678
1710
|
children: [
|
|
1679
|
-
/* @__PURE__ */ jsxs13(View16, { style:
|
|
1680
|
-
/* @__PURE__ */
|
|
1711
|
+
/* @__PURE__ */ jsxs13(View16, { style: styles20.header, children: [
|
|
1712
|
+
/* @__PURE__ */ jsx23(
|
|
1681
1713
|
Pressable11,
|
|
1682
1714
|
{
|
|
1683
1715
|
onPress: () => navigate(-1),
|
|
1684
1716
|
accessibilityRole: "button",
|
|
1685
1717
|
accessibilityLabel: "Previous month",
|
|
1686
|
-
style: ({ pressed }) => [
|
|
1687
|
-
children: /* @__PURE__ */
|
|
1718
|
+
style: ({ pressed }) => [styles20.navButton, pressed && styles20.pressed],
|
|
1719
|
+
children: /* @__PURE__ */ jsx23(ScaledText, { style: [styles20.navText, { color: colors2.colorOnBg }], children: "\u2039" })
|
|
1688
1720
|
}
|
|
1689
1721
|
),
|
|
1690
1722
|
/* @__PURE__ */ jsxs13(
|
|
1691
1723
|
ScaledText,
|
|
1692
1724
|
{
|
|
1693
|
-
style: [
|
|
1725
|
+
style: [styles20.monthYear, { color: colors2.colorOnBg }],
|
|
1694
1726
|
accessibilityRole: "text",
|
|
1695
1727
|
accessibilityLiveRegion: "polite",
|
|
1696
1728
|
children: [
|
|
@@ -1700,34 +1732,34 @@ function Calendar({
|
|
|
1700
1732
|
]
|
|
1701
1733
|
}
|
|
1702
1734
|
),
|
|
1703
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ jsx23(
|
|
1704
1736
|
Pressable11,
|
|
1705
1737
|
{
|
|
1706
1738
|
onPress: () => navigate(1),
|
|
1707
1739
|
accessibilityRole: "button",
|
|
1708
1740
|
accessibilityLabel: "Next month",
|
|
1709
|
-
style: ({ pressed }) => [
|
|
1710
|
-
children: /* @__PURE__ */
|
|
1741
|
+
style: ({ pressed }) => [styles20.navButton, pressed && styles20.pressed],
|
|
1742
|
+
children: /* @__PURE__ */ jsx23(ScaledText, { style: [styles20.navText, { color: colors2.colorOnBg }], children: "\u203A" })
|
|
1711
1743
|
}
|
|
1712
1744
|
)
|
|
1713
1745
|
] }),
|
|
1714
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ jsx23(View16, { style: styles20.weekRow, children: DAYS.map((d) => /* @__PURE__ */ jsx23(View16, { style: styles20.weekday, children: /* @__PURE__ */ jsx23(
|
|
1715
1747
|
ScaledText,
|
|
1716
1748
|
{
|
|
1717
|
-
style: [
|
|
1749
|
+
style: [styles20.weekdayText, { color: colors2.colorOnBgSubtle }],
|
|
1718
1750
|
accessibilityLabel: DAY_LABELS[d],
|
|
1719
1751
|
children: d
|
|
1720
1752
|
}
|
|
1721
1753
|
) }, d)) }),
|
|
1722
|
-
/* @__PURE__ */
|
|
1754
|
+
/* @__PURE__ */ jsx23(View16, { style: styles20.grid, children: rows.map((row, rowIndex) => /* @__PURE__ */ jsx23(View16, { style: styles20.dayRow, children: row.map((cell, colIndex) => {
|
|
1723
1755
|
if (!cell) {
|
|
1724
|
-
return /* @__PURE__ */
|
|
1756
|
+
return /* @__PURE__ */ jsx23(View16, { style: styles20.dayCell }, colIndex);
|
|
1725
1757
|
}
|
|
1726
1758
|
const date = new Date(viewYear, viewMonth, cell.day);
|
|
1727
1759
|
const isSelected = selected ? isSameDay(date, selected) : false;
|
|
1728
1760
|
const isToday = isSameDay(date, today);
|
|
1729
1761
|
const disabled = isOutOfRange(date, min, max);
|
|
1730
|
-
return /* @__PURE__ */
|
|
1762
|
+
return /* @__PURE__ */ jsx23(
|
|
1731
1763
|
Pressable11,
|
|
1732
1764
|
{
|
|
1733
1765
|
onPress: () => selectDay(cell.day),
|
|
@@ -1743,22 +1775,22 @@ function Calendar({
|
|
|
1743
1775
|
disabled
|
|
1744
1776
|
},
|
|
1745
1777
|
style: ({ pressed }) => [
|
|
1746
|
-
|
|
1778
|
+
styles20.dayCell,
|
|
1747
1779
|
isSelected && {
|
|
1748
1780
|
backgroundColor: colors2.colorInteractive
|
|
1749
1781
|
},
|
|
1750
1782
|
isToday && !isSelected && [
|
|
1751
|
-
|
|
1783
|
+
styles20.today,
|
|
1752
1784
|
{ borderColor: colors2.colorInteractive }
|
|
1753
1785
|
],
|
|
1754
|
-
disabled &&
|
|
1755
|
-
pressed && !disabled &&
|
|
1786
|
+
disabled && styles20.disabled,
|
|
1787
|
+
pressed && !disabled && styles20.pressed
|
|
1756
1788
|
],
|
|
1757
|
-
children: /* @__PURE__ */
|
|
1789
|
+
children: /* @__PURE__ */ jsx23(
|
|
1758
1790
|
ScaledText,
|
|
1759
1791
|
{
|
|
1760
1792
|
style: [
|
|
1761
|
-
|
|
1793
|
+
styles20.dayText,
|
|
1762
1794
|
{
|
|
1763
1795
|
color: isSelected ? colors2.colorOnInteractive : colors2.colorOnBg,
|
|
1764
1796
|
fontWeight: isToday ? font.weight.semibold : font.weight.body
|
|
@@ -1778,11 +1810,11 @@ function Calendar({
|
|
|
1778
1810
|
|
|
1779
1811
|
// src/components/ui/Carousel/Carousel.tsx
|
|
1780
1812
|
import { useCallback as useCallback2, useRef as useRef3, useState as useState6 } from "react";
|
|
1781
|
-
import { StyleSheet as
|
|
1782
|
-
import { jsx as
|
|
1813
|
+
import { StyleSheet as StyleSheet22, View as View17, Pressable as Pressable12, ScrollView as ScrollView3, Dimensions } from "react-native";
|
|
1814
|
+
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1783
1815
|
var DOT_SIZE = 8;
|
|
1784
1816
|
var DOT_HIT_SIZE = 44;
|
|
1785
|
-
var
|
|
1817
|
+
var styles21 = StyleSheet22.create({
|
|
1786
1818
|
container: {
|
|
1787
1819
|
width: "100%"
|
|
1788
1820
|
},
|
|
@@ -1858,11 +1890,11 @@ function Carousel({
|
|
|
1858
1890
|
return /* @__PURE__ */ jsxs14(
|
|
1859
1891
|
View17,
|
|
1860
1892
|
{
|
|
1861
|
-
style: [
|
|
1893
|
+
style: [styles21.container, style],
|
|
1862
1894
|
accessibilityRole: "none",
|
|
1863
1895
|
accessibilityLabel: label,
|
|
1864
1896
|
children: [
|
|
1865
|
-
/* @__PURE__ */
|
|
1897
|
+
/* @__PURE__ */ jsx24(
|
|
1866
1898
|
ScrollView3,
|
|
1867
1899
|
{
|
|
1868
1900
|
ref: scrollRef,
|
|
@@ -1872,12 +1904,12 @@ function Carousel({
|
|
|
1872
1904
|
onScroll: handleScroll,
|
|
1873
1905
|
scrollEventThrottle: 16,
|
|
1874
1906
|
onLayout: (e) => setSlideWidth(e.nativeEvent.layout.width),
|
|
1875
|
-
style:
|
|
1876
|
-
children: items.map((item, index) => /* @__PURE__ */
|
|
1907
|
+
style: styles21.scrollView,
|
|
1908
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx24(View17, { style: [styles21.slide, { width: slideWidth }], children: item }, index))
|
|
1877
1909
|
}
|
|
1878
1910
|
),
|
|
1879
|
-
/* @__PURE__ */ jsxs14(View17, { style:
|
|
1880
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ jsxs14(View17, { style: styles21.nav, children: [
|
|
1912
|
+
/* @__PURE__ */ jsx24(
|
|
1881
1913
|
Pressable12,
|
|
1882
1914
|
{
|
|
1883
1915
|
onPress: () => scrollTo(activeIndex - 1),
|
|
@@ -1886,26 +1918,26 @@ function Carousel({
|
|
|
1886
1918
|
accessibilityLabel: "Previous",
|
|
1887
1919
|
accessibilityState: { disabled: activeIndex <= 0 },
|
|
1888
1920
|
style: ({ pressed }) => [
|
|
1889
|
-
|
|
1921
|
+
styles21.navButton,
|
|
1890
1922
|
activeIndex <= 0 && { opacity: 0.4 },
|
|
1891
|
-
pressed &&
|
|
1923
|
+
pressed && styles21.pressed
|
|
1892
1924
|
],
|
|
1893
|
-
children: /* @__PURE__ */
|
|
1925
|
+
children: /* @__PURE__ */ jsx24(ScaledText, { style: [styles21.navText, { color: colors2.colorOnBg }], children: "\u2039" })
|
|
1894
1926
|
}
|
|
1895
1927
|
),
|
|
1896
|
-
/* @__PURE__ */
|
|
1928
|
+
/* @__PURE__ */ jsx24(View17, { style: styles21.dots, children: items.map((_, index) => /* @__PURE__ */ jsx24(
|
|
1897
1929
|
Pressable12,
|
|
1898
1930
|
{
|
|
1899
1931
|
onPress: () => scrollTo(index),
|
|
1900
1932
|
accessibilityRole: "button",
|
|
1901
1933
|
accessibilityLabel: `Go to slide ${index + 1}`,
|
|
1902
1934
|
accessibilityState: { selected: activeIndex === index },
|
|
1903
|
-
style:
|
|
1904
|
-
children: /* @__PURE__ */
|
|
1935
|
+
style: styles21.dotWrapper,
|
|
1936
|
+
children: /* @__PURE__ */ jsx24(
|
|
1905
1937
|
View17,
|
|
1906
1938
|
{
|
|
1907
1939
|
style: [
|
|
1908
|
-
|
|
1940
|
+
styles21.dot,
|
|
1909
1941
|
{
|
|
1910
1942
|
backgroundColor: activeIndex === index ? colors2.colorInteractive : colors2.colorBgSubtle
|
|
1911
1943
|
}
|
|
@@ -1915,7 +1947,7 @@ function Carousel({
|
|
|
1915
1947
|
},
|
|
1916
1948
|
index
|
|
1917
1949
|
)) }),
|
|
1918
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ jsx24(
|
|
1919
1951
|
Pressable12,
|
|
1920
1952
|
{
|
|
1921
1953
|
onPress: () => scrollTo(activeIndex + 1),
|
|
@@ -1924,11 +1956,11 @@ function Carousel({
|
|
|
1924
1956
|
accessibilityLabel: "Next",
|
|
1925
1957
|
accessibilityState: { disabled: activeIndex >= items.length - 1 },
|
|
1926
1958
|
style: ({ pressed }) => [
|
|
1927
|
-
|
|
1959
|
+
styles21.navButton,
|
|
1928
1960
|
activeIndex >= items.length - 1 && { opacity: 0.4 },
|
|
1929
|
-
pressed &&
|
|
1961
|
+
pressed && styles21.pressed
|
|
1930
1962
|
],
|
|
1931
|
-
children: /* @__PURE__ */
|
|
1963
|
+
children: /* @__PURE__ */ jsx24(ScaledText, { style: [styles21.navText, { color: colors2.colorOnBg }], children: "\u203A" })
|
|
1932
1964
|
}
|
|
1933
1965
|
)
|
|
1934
1966
|
] })
|
|
@@ -1938,8 +1970,8 @@ function Carousel({
|
|
|
1938
1970
|
}
|
|
1939
1971
|
|
|
1940
1972
|
// src/components/layout/Card/Card.tsx
|
|
1941
|
-
import { StyleSheet as
|
|
1942
|
-
import { jsx as
|
|
1973
|
+
import { StyleSheet as StyleSheet23, View as View18, Pressable as Pressable13 } from "react-native";
|
|
1974
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1943
1975
|
var paddingMap = {
|
|
1944
1976
|
none: 0,
|
|
1945
1977
|
small: spacing.s,
|
|
@@ -1951,7 +1983,7 @@ var alignMap = {
|
|
|
1951
1983
|
center: "center",
|
|
1952
1984
|
end: "flex-end"
|
|
1953
1985
|
};
|
|
1954
|
-
var
|
|
1986
|
+
var styles22 = StyleSheet23.create({
|
|
1955
1987
|
card: {
|
|
1956
1988
|
borderRadius: border.radius.m,
|
|
1957
1989
|
overflow: "hidden"
|
|
@@ -1986,29 +2018,29 @@ function Card({
|
|
|
1986
2018
|
alignItems: alignMap[textAlign]
|
|
1987
2019
|
};
|
|
1988
2020
|
if (onPress) {
|
|
1989
|
-
return /* @__PURE__ */
|
|
2021
|
+
return /* @__PURE__ */ jsx25(
|
|
1990
2022
|
Pressable13,
|
|
1991
2023
|
{
|
|
1992
2024
|
onPress,
|
|
1993
2025
|
accessibilityRole: "button",
|
|
1994
2026
|
accessibilityLabel,
|
|
1995
|
-
style: ({ pressed }) => [
|
|
2027
|
+
style: ({ pressed }) => [styles22.card, variantStyle, inner, pressed && { opacity: 0.8 }, style],
|
|
1996
2028
|
children
|
|
1997
2029
|
}
|
|
1998
2030
|
);
|
|
1999
2031
|
}
|
|
2000
|
-
return /* @__PURE__ */
|
|
2032
|
+
return /* @__PURE__ */ jsx25(View18, { style: [styles22.card, variantStyle, inner, style], children });
|
|
2001
2033
|
}
|
|
2002
2034
|
|
|
2003
2035
|
// src/components/layout/SectionHeader/SectionHeader.tsx
|
|
2004
|
-
import { StyleSheet as
|
|
2005
|
-
import { jsx as
|
|
2036
|
+
import { StyleSheet as StyleSheet24, View as View19 } from "react-native";
|
|
2037
|
+
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2006
2038
|
var alignMap2 = {
|
|
2007
2039
|
start: "flex-start",
|
|
2008
2040
|
center: "center",
|
|
2009
2041
|
end: "flex-end"
|
|
2010
2042
|
};
|
|
2011
|
-
var titleStyles =
|
|
2043
|
+
var titleStyles = StyleSheet24.create({
|
|
2012
2044
|
small: {
|
|
2013
2045
|
fontSize: font.size.heading3,
|
|
2014
2046
|
fontFamily: font.family.heading,
|
|
@@ -2028,7 +2060,7 @@ var titleStyles = StyleSheet23.create({
|
|
|
2028
2060
|
lineHeight: lineHeight.heading1
|
|
2029
2061
|
}
|
|
2030
2062
|
});
|
|
2031
|
-
var
|
|
2063
|
+
var styles23 = StyleSheet24.create({
|
|
2032
2064
|
container: {
|
|
2033
2065
|
gap: spacing.xxs
|
|
2034
2066
|
},
|
|
@@ -2047,8 +2079,8 @@ function SectionHeader({
|
|
|
2047
2079
|
}) {
|
|
2048
2080
|
const { colors: colors2 } = useTheme();
|
|
2049
2081
|
const align = alignMap2[alignment];
|
|
2050
|
-
return /* @__PURE__ */ jsxs15(View19, { style: [
|
|
2051
|
-
/* @__PURE__ */
|
|
2082
|
+
return /* @__PURE__ */ jsxs15(View19, { style: [styles23.container, { alignItems: align }, style], children: [
|
|
2083
|
+
/* @__PURE__ */ jsx26(
|
|
2052
2084
|
ScaledText,
|
|
2053
2085
|
{
|
|
2054
2086
|
accessibilityRole: "header",
|
|
@@ -2056,15 +2088,15 @@ function SectionHeader({
|
|
|
2056
2088
|
children: title
|
|
2057
2089
|
}
|
|
2058
2090
|
),
|
|
2059
|
-
subtitle && /* @__PURE__ */
|
|
2091
|
+
subtitle && /* @__PURE__ */ jsx26(ScaledText, { style: [styles23.subtitle, { color: colors2.colorOnBgSubtle }], children: subtitle })
|
|
2060
2092
|
] });
|
|
2061
2093
|
}
|
|
2062
2094
|
|
|
2063
2095
|
// src/components/layout/IconWrapper/IconWrapper.tsx
|
|
2064
2096
|
import { View as View20 } from "react-native";
|
|
2065
|
-
import { jsx as
|
|
2097
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2066
2098
|
function IconWrapper({ children, style, accessibilityElementsHidden }) {
|
|
2067
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ jsx27(
|
|
2068
2100
|
View20,
|
|
2069
2101
|
{
|
|
2070
2102
|
style: [{ alignItems: "center", justifyContent: "center" }, style],
|
|
@@ -2076,9 +2108,9 @@ function IconWrapper({ children, style, accessibilityElementsHidden }) {
|
|
|
2076
2108
|
}
|
|
2077
2109
|
|
|
2078
2110
|
// src/components/layout/ButtonGroup/ButtonGroup.tsx
|
|
2079
|
-
import { StyleSheet as
|
|
2080
|
-
import { jsx as
|
|
2081
|
-
var
|
|
2111
|
+
import { StyleSheet as StyleSheet25, View as View21 } from "react-native";
|
|
2112
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2113
|
+
var styles24 = StyleSheet25.create({
|
|
2082
2114
|
group: {
|
|
2083
2115
|
flexDirection: "row",
|
|
2084
2116
|
flexWrap: "wrap",
|
|
@@ -2091,11 +2123,11 @@ var styles23 = StyleSheet24.create({
|
|
|
2091
2123
|
});
|
|
2092
2124
|
function ButtonContainer({ children, variant, accessibilityLabel, style }) {
|
|
2093
2125
|
const isColumn = variant === "card" || variant === "modal";
|
|
2094
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ jsx28(
|
|
2095
2127
|
View21,
|
|
2096
2128
|
{
|
|
2097
2129
|
accessibilityLabel,
|
|
2098
|
-
style: [isColumn ?
|
|
2130
|
+
style: [isColumn ? styles24.column : styles24.group, style],
|
|
2099
2131
|
children
|
|
2100
2132
|
}
|
|
2101
2133
|
);
|
|
@@ -2103,14 +2135,14 @@ function ButtonContainer({ children, variant, accessibilityLabel, style }) {
|
|
|
2103
2135
|
var ButtonGroup = ButtonContainer;
|
|
2104
2136
|
|
|
2105
2137
|
// src/components/interaction/Button/Button.tsx
|
|
2106
|
-
import { StyleSheet as
|
|
2107
|
-
import { jsx as
|
|
2138
|
+
import { StyleSheet as StyleSheet26, Pressable as Pressable14, View as View22 } from "react-native";
|
|
2139
|
+
import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2108
2140
|
var sizeTokens = {
|
|
2109
|
-
small: { height: 36, px: spacing.m, fontSize: font.size.bodyS
|
|
2110
|
-
medium: { height: 48, px: spacing.m, fontSize: font.size.body
|
|
2111
|
-
large: { height: 56, px: spacing.xxl, fontSize: font.size.heading3
|
|
2141
|
+
small: { height: 36, px: spacing.m, fontSize: font.size.bodyS },
|
|
2142
|
+
medium: { height: 48, px: spacing.m, fontSize: font.size.body },
|
|
2143
|
+
large: { height: 56, px: spacing.xxl, fontSize: font.size.heading3 }
|
|
2112
2144
|
};
|
|
2113
|
-
var
|
|
2145
|
+
var styles25 = StyleSheet26.create({
|
|
2114
2146
|
pressable: {
|
|
2115
2147
|
flexDirection: "row",
|
|
2116
2148
|
alignItems: "center",
|
|
@@ -2139,7 +2171,7 @@ function Button({
|
|
|
2139
2171
|
style
|
|
2140
2172
|
}) {
|
|
2141
2173
|
const { colors: colors2 } = useTheme();
|
|
2142
|
-
const { height, px, fontSize
|
|
2174
|
+
const { height, px, fontSize } = sizeTokens[size];
|
|
2143
2175
|
const primaryColor = colors2.colorInteractive;
|
|
2144
2176
|
const onPrimaryColor = colors2.colorOnInteractive;
|
|
2145
2177
|
const outlineTextColor = colors2.colorInteractiveOnBg;
|
|
@@ -2147,7 +2179,8 @@ function Button({
|
|
|
2147
2179
|
const containerStyle = {
|
|
2148
2180
|
minHeight: height,
|
|
2149
2181
|
paddingHorizontal: isIconOnly ? spacing.xs : px,
|
|
2150
|
-
|
|
2182
|
+
// A text button has medium corners on every size; an icon-only button stays round.
|
|
2183
|
+
borderRadius: isIconOnly ? border.radius.full : border.radius.m,
|
|
2151
2184
|
opacity: disabled ? 0.4 : 1,
|
|
2152
2185
|
// Icon-only: square with equal xs padding on both axes.
|
|
2153
2186
|
...isIconOnly && { aspectRatio: 1, paddingVertical: spacing.xs },
|
|
@@ -2170,21 +2203,21 @@ function Button({
|
|
|
2170
2203
|
accessibilityRole: "button",
|
|
2171
2204
|
accessibilityLabel,
|
|
2172
2205
|
accessibilityState: { disabled },
|
|
2173
|
-
style: ({ pressed }) => [
|
|
2206
|
+
style: ({ pressed }) => [styles25.pressable, containerStyle, pressed && { opacity: 0.75 }, style],
|
|
2174
2207
|
children: [
|
|
2175
|
-
iconStart && /* @__PURE__ */
|
|
2176
|
-
children && (isIconOnly ? children : /* @__PURE__ */
|
|
2177
|
-
iconEnd && /* @__PURE__ */
|
|
2208
|
+
iconStart && /* @__PURE__ */ jsx29(View22, { importantForAccessibility: "no-hide-descendants", accessibilityElementsHidden: true, children: iconStart }),
|
|
2209
|
+
children && (isIconOnly ? children : /* @__PURE__ */ jsx29(ScaledText, { style: [styles25.label, { fontSize, color: textColor }], children })),
|
|
2210
|
+
iconEnd && /* @__PURE__ */ jsx29(View22, { importantForAccessibility: "no-hide-descendants", children: iconEnd })
|
|
2178
2211
|
]
|
|
2179
2212
|
}
|
|
2180
2213
|
);
|
|
2181
2214
|
}
|
|
2182
2215
|
|
|
2183
2216
|
// src/components/interaction/Rating/Rating.tsx
|
|
2184
|
-
import { StyleSheet as
|
|
2185
|
-
import { jsx as
|
|
2217
|
+
import { StyleSheet as StyleSheet27, View as View23 } from "react-native";
|
|
2218
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2186
2219
|
var STAR_SIZE = 24;
|
|
2187
|
-
var
|
|
2220
|
+
var styles26 = StyleSheet27.create({
|
|
2188
2221
|
container: {
|
|
2189
2222
|
flexDirection: "row",
|
|
2190
2223
|
alignItems: "center"
|
|
@@ -2197,17 +2230,17 @@ var styles25 = StyleSheet26.create({
|
|
|
2197
2230
|
function Rating({ value, max = 5, style, accessibilityLabel }) {
|
|
2198
2231
|
const { colors: colors2 } = useTheme();
|
|
2199
2232
|
const label = accessibilityLabel ?? `${value} out of ${max} stars`;
|
|
2200
|
-
return /* @__PURE__ */
|
|
2233
|
+
return /* @__PURE__ */ jsx30(
|
|
2201
2234
|
View23,
|
|
2202
2235
|
{
|
|
2203
|
-
style: [
|
|
2236
|
+
style: [styles26.container, style],
|
|
2204
2237
|
accessibilityRole: "image",
|
|
2205
2238
|
accessibilityLabel: label,
|
|
2206
|
-
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */
|
|
2239
|
+
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ jsx30(
|
|
2207
2240
|
ScaledText,
|
|
2208
2241
|
{
|
|
2209
2242
|
style: [
|
|
2210
|
-
|
|
2243
|
+
styles26.star,
|
|
2211
2244
|
{ color: i < value ? colors2.colorWarning : colors2.colorBgSubtle }
|
|
2212
2245
|
],
|
|
2213
2246
|
importantForAccessibility: "no",
|
|
@@ -2221,13 +2254,13 @@ function Rating({ value, max = 5, style, accessibilityLabel }) {
|
|
|
2221
2254
|
}
|
|
2222
2255
|
|
|
2223
2256
|
// src/components/interaction/form/Switch/Switch.tsx
|
|
2224
|
-
import { Switch as RNSwitch, View as View24, StyleSheet as
|
|
2257
|
+
import { Switch as RNSwitch, View as View24, StyleSheet as StyleSheet29 } from "react-native";
|
|
2225
2258
|
|
|
2226
2259
|
// src/components/interaction/form/atoms/Label.tsx
|
|
2227
|
-
import { jsx as
|
|
2260
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2228
2261
|
function Label({ label, style }) {
|
|
2229
2262
|
const { colors: colors2 } = useTheme();
|
|
2230
|
-
return /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ jsx31(
|
|
2231
2264
|
ScaledText,
|
|
2232
2265
|
{
|
|
2233
2266
|
style: [
|
|
@@ -2246,9 +2279,9 @@ function Label({ label, style }) {
|
|
|
2246
2279
|
}
|
|
2247
2280
|
|
|
2248
2281
|
// src/components/interaction/form/atoms/Message.tsx
|
|
2249
|
-
import { StyleSheet as
|
|
2250
|
-
import { jsx as
|
|
2251
|
-
var
|
|
2282
|
+
import { StyleSheet as StyleSheet28 } from "react-native";
|
|
2283
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2284
|
+
var styles27 = StyleSheet28.create({
|
|
2252
2285
|
base: {
|
|
2253
2286
|
fontFamily: font.family.body,
|
|
2254
2287
|
fontSize: font.size.bodyS,
|
|
@@ -2259,20 +2292,20 @@ function Message({ message, type, style }) {
|
|
|
2259
2292
|
const { colors: colors2 } = useTheme();
|
|
2260
2293
|
if (!message) return null;
|
|
2261
2294
|
const color = type === "error" ? colors2.colorError : colors2.colorOnBgSubtle;
|
|
2262
|
-
return /* @__PURE__ */
|
|
2295
|
+
return /* @__PURE__ */ jsx32(
|
|
2263
2296
|
ScaledText,
|
|
2264
2297
|
{
|
|
2265
2298
|
accessibilityRole: type === "error" ? "alert" : "none",
|
|
2266
2299
|
accessibilityLiveRegion: type === "error" ? "assertive" : "polite",
|
|
2267
|
-
style: [
|
|
2300
|
+
style: [styles27.base, { color }, style],
|
|
2268
2301
|
children: message
|
|
2269
2302
|
}
|
|
2270
2303
|
);
|
|
2271
2304
|
}
|
|
2272
2305
|
|
|
2273
2306
|
// src/components/interaction/form/Switch/Switch.tsx
|
|
2274
|
-
import { jsx as
|
|
2275
|
-
var
|
|
2307
|
+
import { jsx as jsx33, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2308
|
+
var styles28 = StyleSheet29.create({
|
|
2276
2309
|
container: {
|
|
2277
2310
|
gap: spacing.xxs
|
|
2278
2311
|
},
|
|
@@ -2292,9 +2325,9 @@ function Switch({
|
|
|
2292
2325
|
style
|
|
2293
2326
|
}) {
|
|
2294
2327
|
const { colors: colors2 } = useTheme();
|
|
2295
|
-
return /* @__PURE__ */ jsxs17(View24, { style: [
|
|
2296
|
-
/* @__PURE__ */ jsxs17(View24, { style:
|
|
2297
|
-
/* @__PURE__ */
|
|
2328
|
+
return /* @__PURE__ */ jsxs17(View24, { style: [styles28.container, style], children: [
|
|
2329
|
+
/* @__PURE__ */ jsxs17(View24, { style: styles28.row, children: [
|
|
2330
|
+
/* @__PURE__ */ jsx33(
|
|
2298
2331
|
RNSwitch,
|
|
2299
2332
|
{
|
|
2300
2333
|
value,
|
|
@@ -2307,18 +2340,18 @@ function Switch({
|
|
|
2307
2340
|
trackColor: { false: colors2.colorBgSubtle, true: colors2.colorBlueSubtle }
|
|
2308
2341
|
}
|
|
2309
2342
|
),
|
|
2310
|
-
/* @__PURE__ */
|
|
2343
|
+
/* @__PURE__ */ jsx33(Label, { label })
|
|
2311
2344
|
] }),
|
|
2312
|
-
/* @__PURE__ */
|
|
2313
|
-
/* @__PURE__ */
|
|
2345
|
+
/* @__PURE__ */ jsx33(Message, { type: "error", message: error }),
|
|
2346
|
+
/* @__PURE__ */ jsx33(Message, { type: "hint", message: hint })
|
|
2314
2347
|
] });
|
|
2315
2348
|
}
|
|
2316
2349
|
|
|
2317
2350
|
// src/components/interaction/form/Checkbox/Checkbox.tsx
|
|
2318
|
-
import { StyleSheet as
|
|
2319
|
-
import { jsx as
|
|
2351
|
+
import { StyleSheet as StyleSheet30, View as View25, Pressable as Pressable15 } from "react-native";
|
|
2352
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2320
2353
|
var BOX = 22;
|
|
2321
|
-
var
|
|
2354
|
+
var styles29 = StyleSheet30.create({
|
|
2322
2355
|
container: {
|
|
2323
2356
|
gap: spacing.xxs
|
|
2324
2357
|
},
|
|
@@ -2355,7 +2388,7 @@ function Checkbox({
|
|
|
2355
2388
|
const { colors: colors2 } = useTheme();
|
|
2356
2389
|
const borderColor = error ? colors2.colorError : checked ? colors2.colorInteractive : colors2.colorOnBg;
|
|
2357
2390
|
const bgColor = checked ? colors2.colorInteractive : "transparent";
|
|
2358
|
-
return /* @__PURE__ */ jsxs18(View25, { style: [
|
|
2391
|
+
return /* @__PURE__ */ jsxs18(View25, { style: [styles29.container, style], children: [
|
|
2359
2392
|
/* @__PURE__ */ jsxs18(
|
|
2360
2393
|
Pressable15,
|
|
2361
2394
|
{
|
|
@@ -2364,22 +2397,22 @@ function Checkbox({
|
|
|
2364
2397
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
2365
2398
|
accessibilityState: { checked, disabled },
|
|
2366
2399
|
disabled,
|
|
2367
|
-
style: ({ pressed }) => [
|
|
2400
|
+
style: ({ pressed }) => [styles29.row, pressed && { opacity: 0.7 }, disabled && { opacity: 0.4 }],
|
|
2368
2401
|
children: [
|
|
2369
|
-
/* @__PURE__ */
|
|
2370
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ jsx34(View25, { style: [styles29.box, { borderColor, backgroundColor: bgColor }], children: checked && /* @__PURE__ */ jsx34(Label, { label: "\u2713", style: [styles29.checkmark, { color: colors2.colorOnInteractive }] }) }),
|
|
2403
|
+
/* @__PURE__ */ jsx34(Label, { label })
|
|
2371
2404
|
]
|
|
2372
2405
|
}
|
|
2373
2406
|
),
|
|
2374
|
-
/* @__PURE__ */
|
|
2375
|
-
/* @__PURE__ */
|
|
2407
|
+
/* @__PURE__ */ jsx34(Message, { type: "error", message: error }),
|
|
2408
|
+
/* @__PURE__ */ jsx34(Message, { type: "hint", message: hint })
|
|
2376
2409
|
] });
|
|
2377
2410
|
}
|
|
2378
2411
|
|
|
2379
2412
|
// src/components/interaction/form/CheckboxGroup/CheckboxGroup.tsx
|
|
2380
|
-
import { StyleSheet as
|
|
2381
|
-
import { jsx as
|
|
2382
|
-
var
|
|
2413
|
+
import { StyleSheet as StyleSheet31, View as View26 } from "react-native";
|
|
2414
|
+
import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2415
|
+
var styles30 = StyleSheet31.create({
|
|
2383
2416
|
container: {
|
|
2384
2417
|
gap: spacing.xs
|
|
2385
2418
|
},
|
|
@@ -2409,28 +2442,28 @@ function CheckboxGroup({
|
|
|
2409
2442
|
return /* @__PURE__ */ jsxs19(
|
|
2410
2443
|
View26,
|
|
2411
2444
|
{
|
|
2412
|
-
style: [
|
|
2445
|
+
style: [styles30.container, disabled && { opacity: 0.4 }, style],
|
|
2413
2446
|
accessibilityRole: "none",
|
|
2414
2447
|
accessibilityLabel: legend,
|
|
2415
2448
|
children: [
|
|
2416
|
-
/* @__PURE__ */ jsxs19(ScaledText, { style: [
|
|
2449
|
+
/* @__PURE__ */ jsxs19(ScaledText, { style: [styles30.legend, { color: colors2.colorOnBg }], children: [
|
|
2417
2450
|
legend,
|
|
2418
|
-
required && /* @__PURE__ */
|
|
2451
|
+
required && /* @__PURE__ */ jsx35(ScaledText, { style: [styles30.required, { color: colors2.colorOnBgSubtle }], children: " *" })
|
|
2419
2452
|
] }),
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ jsx35(View26, { style: styles30.items, children }),
|
|
2454
|
+
/* @__PURE__ */ jsx35(Message, { type: "error", message: error }),
|
|
2455
|
+
/* @__PURE__ */ jsx35(Message, { type: "hint", message: hint })
|
|
2423
2456
|
]
|
|
2424
2457
|
}
|
|
2425
2458
|
);
|
|
2426
2459
|
}
|
|
2427
2460
|
|
|
2428
2461
|
// src/components/interaction/form/Radio/Radio.tsx
|
|
2429
|
-
import { StyleSheet as
|
|
2430
|
-
import { jsx as
|
|
2462
|
+
import { StyleSheet as StyleSheet32, View as View27, Pressable as Pressable16 } from "react-native";
|
|
2463
|
+
import { jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2431
2464
|
var DOT = 22;
|
|
2432
2465
|
var INNER = 10;
|
|
2433
|
-
var
|
|
2466
|
+
var styles31 = StyleSheet32.create({
|
|
2434
2467
|
container: {
|
|
2435
2468
|
gap: spacing.xxs
|
|
2436
2469
|
},
|
|
@@ -2466,7 +2499,7 @@ function Radio({
|
|
|
2466
2499
|
}) {
|
|
2467
2500
|
const { colors: colors2 } = useTheme();
|
|
2468
2501
|
const borderColor = error ? colors2.colorError : checked ? colors2.colorInteractive : colors2.colorOnBg;
|
|
2469
|
-
return /* @__PURE__ */ jsxs20(View27, { style: [
|
|
2502
|
+
return /* @__PURE__ */ jsxs20(View27, { style: [styles31.container, style], children: [
|
|
2470
2503
|
/* @__PURE__ */ jsxs20(
|
|
2471
2504
|
Pressable16,
|
|
2472
2505
|
{
|
|
@@ -2475,22 +2508,22 @@ function Radio({
|
|
|
2475
2508
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
2476
2509
|
accessibilityState: { checked, disabled },
|
|
2477
2510
|
disabled,
|
|
2478
|
-
style: ({ pressed }) => [
|
|
2511
|
+
style: ({ pressed }) => [styles31.row, pressed && { opacity: 0.7 }, disabled && { opacity: 0.4 }],
|
|
2479
2512
|
children: [
|
|
2480
|
-
/* @__PURE__ */
|
|
2481
|
-
/* @__PURE__ */
|
|
2513
|
+
/* @__PURE__ */ jsx36(View27, { style: [styles31.outer, { borderColor }], children: checked && /* @__PURE__ */ jsx36(View27, { style: [styles31.inner, { backgroundColor: colors2.colorInteractive }] }) }),
|
|
2514
|
+
/* @__PURE__ */ jsx36(Label, { label })
|
|
2482
2515
|
]
|
|
2483
2516
|
}
|
|
2484
2517
|
),
|
|
2485
|
-
/* @__PURE__ */
|
|
2486
|
-
/* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ jsx36(Message, { type: "error", message: error }),
|
|
2519
|
+
/* @__PURE__ */ jsx36(Message, { type: "hint", message: hint })
|
|
2487
2520
|
] });
|
|
2488
2521
|
}
|
|
2489
2522
|
|
|
2490
2523
|
// src/components/interaction/form/RadioGroup/RadioGroup.tsx
|
|
2491
|
-
import { StyleSheet as
|
|
2492
|
-
import { jsx as
|
|
2493
|
-
var
|
|
2524
|
+
import { StyleSheet as StyleSheet33, View as View28 } from "react-native";
|
|
2525
|
+
import { jsx as jsx37, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2526
|
+
var styles32 = StyleSheet33.create({
|
|
2494
2527
|
container: {
|
|
2495
2528
|
gap: spacing.xs
|
|
2496
2529
|
},
|
|
@@ -2520,26 +2553,26 @@ function RadioGroup({
|
|
|
2520
2553
|
return /* @__PURE__ */ jsxs21(
|
|
2521
2554
|
View28,
|
|
2522
2555
|
{
|
|
2523
|
-
style: [
|
|
2556
|
+
style: [styles32.container, disabled && { opacity: 0.4 }, style],
|
|
2524
2557
|
accessibilityRole: "radiogroup",
|
|
2525
2558
|
accessibilityLabel: legend,
|
|
2526
2559
|
children: [
|
|
2527
|
-
/* @__PURE__ */ jsxs21(ScaledText, { style: [
|
|
2560
|
+
/* @__PURE__ */ jsxs21(ScaledText, { style: [styles32.legend, { color: colors2.colorOnBg }], children: [
|
|
2528
2561
|
legend,
|
|
2529
|
-
required && /* @__PURE__ */
|
|
2562
|
+
required && /* @__PURE__ */ jsx37(ScaledText, { style: [styles32.required, { color: colors2.colorOnBgSubtle }], children: " *" })
|
|
2530
2563
|
] }),
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2533
|
-
/* @__PURE__ */
|
|
2564
|
+
/* @__PURE__ */ jsx37(View28, { style: styles32.items, children }),
|
|
2565
|
+
/* @__PURE__ */ jsx37(Message, { type: "error", message: error }),
|
|
2566
|
+
/* @__PURE__ */ jsx37(Message, { type: "hint", message: hint })
|
|
2534
2567
|
]
|
|
2535
2568
|
}
|
|
2536
2569
|
);
|
|
2537
2570
|
}
|
|
2538
2571
|
|
|
2539
2572
|
// src/components/interaction/form/FileInput/FileInput.tsx
|
|
2540
|
-
import { StyleSheet as
|
|
2541
|
-
import { jsx as
|
|
2542
|
-
var
|
|
2573
|
+
import { StyleSheet as StyleSheet34, View as View29, Pressable as Pressable17 } from "react-native";
|
|
2574
|
+
import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2575
|
+
var styles33 = StyleSheet34.create({
|
|
2543
2576
|
container: {
|
|
2544
2577
|
gap: spacing.xxs
|
|
2545
2578
|
},
|
|
@@ -2551,7 +2584,7 @@ var styles32 = StyleSheet33.create({
|
|
|
2551
2584
|
paddingHorizontal: spacing.m,
|
|
2552
2585
|
borderWidth: 2,
|
|
2553
2586
|
borderStyle: "dashed",
|
|
2554
|
-
borderRadius: border.radius.
|
|
2587
|
+
borderRadius: border.radius.m,
|
|
2555
2588
|
minHeight: 120
|
|
2556
2589
|
},
|
|
2557
2590
|
icon: {
|
|
@@ -2594,8 +2627,8 @@ function FileInput({
|
|
|
2594
2627
|
}) {
|
|
2595
2628
|
const { colors: colors2 } = useTheme();
|
|
2596
2629
|
const borderColor = error ? colors2.colorError : colors2.colorBgSubtle;
|
|
2597
|
-
return /* @__PURE__ */ jsxs22(View29, { style: [
|
|
2598
|
-
/* @__PURE__ */
|
|
2630
|
+
return /* @__PURE__ */ jsxs22(View29, { style: [styles33.container, style], testID: name, children: [
|
|
2631
|
+
/* @__PURE__ */ jsx38(
|
|
2599
2632
|
Label,
|
|
2600
2633
|
{
|
|
2601
2634
|
label: required ? `${label} *` : label
|
|
@@ -2610,7 +2643,7 @@ function FileInput({
|
|
|
2610
2643
|
accessibilityLabel: `${label}, tap to select file`,
|
|
2611
2644
|
accessibilityState: { disabled },
|
|
2612
2645
|
style: ({ pressed }) => [
|
|
2613
|
-
|
|
2646
|
+
styles33.dropZone,
|
|
2614
2647
|
{
|
|
2615
2648
|
borderColor,
|
|
2616
2649
|
backgroundColor: "transparent"
|
|
@@ -2619,35 +2652,35 @@ function FileInput({
|
|
|
2619
2652
|
disabled && { opacity: 0.4 }
|
|
2620
2653
|
],
|
|
2621
2654
|
children: [
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
/* @__PURE__ */
|
|
2624
|
-
fileNames.length > 0 && /* @__PURE__ */
|
|
2625
|
-
accept && /* @__PURE__ */
|
|
2655
|
+
/* @__PURE__ */ jsx38(ScaledText, { style: [styles33.icon, { color: colors2.colorInteractive }], children: "\u2191" }),
|
|
2656
|
+
/* @__PURE__ */ jsx38(ScaledText, { style: [styles33.prompt, { color: colors2.colorOnBgSubtle }], children: fileNames.length > 0 ? "Selected files:" : "Tap to select file" }),
|
|
2657
|
+
fileNames.length > 0 && /* @__PURE__ */ jsx38(View29, { style: styles33.fileList, children: fileNames.map((fileName) => /* @__PURE__ */ jsx38(ScaledText, { style: [styles33.fileName, { color: colors2.colorOnBg }], children: fileName }, fileName)) }),
|
|
2658
|
+
accept && /* @__PURE__ */ jsx38(ScaledText, { style: [styles33.acceptHint, { color: colors2.colorOnBgSubtle }], children: accept })
|
|
2626
2659
|
]
|
|
2627
2660
|
}
|
|
2628
2661
|
),
|
|
2629
|
-
/* @__PURE__ */
|
|
2630
|
-
/* @__PURE__ */
|
|
2662
|
+
/* @__PURE__ */ jsx38(Message, { type: "error", message: error }),
|
|
2663
|
+
/* @__PURE__ */ jsx38(Message, { type: "hint", message: hint })
|
|
2631
2664
|
] });
|
|
2632
2665
|
}
|
|
2633
2666
|
|
|
2634
2667
|
// src/components/interaction/form/Combobox/Combobox.tsx
|
|
2635
2668
|
import { useState as useState7, useMemo as useMemo2 } from "react";
|
|
2636
|
-
import { StyleSheet as
|
|
2669
|
+
import { StyleSheet as StyleSheet35, View as View30, Pressable as Pressable18, ScrollView as ScrollView4 } from "react-native";
|
|
2637
2670
|
|
|
2638
2671
|
// src/components/interaction/form/atoms/inputHelpers.ts
|
|
2639
2672
|
var OPTICAL_TEXT_SHIFT = -1.5;
|
|
2640
2673
|
|
|
2641
2674
|
// src/components/interaction/form/Combobox/Combobox.tsx
|
|
2642
|
-
import { jsx as
|
|
2675
|
+
import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2643
2676
|
var INPUT_HEIGHT = 44;
|
|
2644
2677
|
var MAX_DROPDOWN_HEIGHT = 200;
|
|
2645
|
-
var
|
|
2678
|
+
var styles34 = StyleSheet35.create({
|
|
2646
2679
|
container: {
|
|
2647
2680
|
gap: spacing.xxs
|
|
2648
2681
|
},
|
|
2649
2682
|
/**
|
|
2650
|
-
* Draws the
|
|
2683
|
+
* Draws the rounded border and provides the fixed 44pt touch-target height.
|
|
2651
2684
|
* justifyContent: 'center' vertically centers the inner TextInput.
|
|
2652
2685
|
* position: 'relative' is required for the dropdown's absolute positioning.
|
|
2653
2686
|
*/
|
|
@@ -2656,7 +2689,7 @@ var styles33 = StyleSheet34.create({
|
|
|
2656
2689
|
height: INPUT_HEIGHT,
|
|
2657
2690
|
justifyContent: "center",
|
|
2658
2691
|
borderWidth: 1,
|
|
2659
|
-
borderRadius: border.radius.
|
|
2692
|
+
borderRadius: border.radius.m
|
|
2660
2693
|
},
|
|
2661
2694
|
/**
|
|
2662
2695
|
* No vertical padding: iOS centers text automatically inside the wrapper height.
|
|
@@ -2738,13 +2771,13 @@ function Combobox({
|
|
|
2738
2771
|
setTimeout(() => setIsOpen(false), 150);
|
|
2739
2772
|
};
|
|
2740
2773
|
const borderColor = error ? colors2.colorError : colors2.colorOnBg;
|
|
2741
|
-
return /* @__PURE__ */ jsxs23(View30, { style: [
|
|
2742
|
-
/* @__PURE__ */
|
|
2774
|
+
return /* @__PURE__ */ jsxs23(View30, { style: [styles34.container, style], children: [
|
|
2775
|
+
/* @__PURE__ */ jsx39(Label, { label }),
|
|
2743
2776
|
/* @__PURE__ */ jsxs23(
|
|
2744
2777
|
View30,
|
|
2745
2778
|
{
|
|
2746
2779
|
style: [
|
|
2747
|
-
|
|
2780
|
+
styles34.inputWrapper,
|
|
2748
2781
|
{
|
|
2749
2782
|
borderColor,
|
|
2750
2783
|
backgroundColor: colors2.colorBg
|
|
@@ -2752,7 +2785,7 @@ function Combobox({
|
|
|
2752
2785
|
disabled && { opacity: 0.4 }
|
|
2753
2786
|
],
|
|
2754
2787
|
children: [
|
|
2755
|
-
/* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ jsx39(
|
|
2756
2789
|
ScaledTextInput,
|
|
2757
2790
|
{
|
|
2758
2791
|
value: inputValue,
|
|
@@ -2766,16 +2799,16 @@ function Combobox({
|
|
|
2766
2799
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
2767
2800
|
accessibilityState: { disabled, expanded: isOpen },
|
|
2768
2801
|
style: [
|
|
2769
|
-
|
|
2802
|
+
styles34.input,
|
|
2770
2803
|
{ color: colors2.colorOnBg }
|
|
2771
2804
|
]
|
|
2772
2805
|
}
|
|
2773
2806
|
),
|
|
2774
|
-
isOpen && filtered.length > 0 && /* @__PURE__ */
|
|
2807
|
+
isOpen && filtered.length > 0 && /* @__PURE__ */ jsx39(
|
|
2775
2808
|
ScrollView4,
|
|
2776
2809
|
{
|
|
2777
2810
|
style: [
|
|
2778
|
-
|
|
2811
|
+
styles34.dropdown,
|
|
2779
2812
|
{
|
|
2780
2813
|
borderColor: colors2.colorBgSubtle,
|
|
2781
2814
|
backgroundColor: colors2.colorBg
|
|
@@ -2786,7 +2819,7 @@ function Combobox({
|
|
|
2786
2819
|
children: filtered.map((option) => {
|
|
2787
2820
|
const isSelected = option.value === value;
|
|
2788
2821
|
const isDisabled = option.disabled;
|
|
2789
|
-
return /* @__PURE__ */
|
|
2822
|
+
return /* @__PURE__ */ jsx39(
|
|
2790
2823
|
Pressable18,
|
|
2791
2824
|
{
|
|
2792
2825
|
onPress: () => !isDisabled && selectOption(option),
|
|
@@ -2795,16 +2828,16 @@ function Combobox({
|
|
|
2795
2828
|
accessibilityLabel: option.label,
|
|
2796
2829
|
accessibilityState: { selected: isSelected, disabled: isDisabled },
|
|
2797
2830
|
style: ({ pressed }) => [
|
|
2798
|
-
|
|
2831
|
+
styles34.option,
|
|
2799
2832
|
isSelected && { backgroundColor: colors2.colorBlueSubtle },
|
|
2800
2833
|
pressed && !isDisabled && { backgroundColor: colors2.colorBgSubtle },
|
|
2801
2834
|
isDisabled && { opacity: 0.4 }
|
|
2802
2835
|
],
|
|
2803
|
-
children: /* @__PURE__ */
|
|
2836
|
+
children: /* @__PURE__ */ jsx39(
|
|
2804
2837
|
ScaledText,
|
|
2805
2838
|
{
|
|
2806
2839
|
style: [
|
|
2807
|
-
|
|
2840
|
+
styles34.optionText,
|
|
2808
2841
|
{
|
|
2809
2842
|
color: isSelected ? colors2.colorInteractive : colors2.colorOnBg
|
|
2810
2843
|
},
|
|
@@ -2822,15 +2855,15 @@ function Combobox({
|
|
|
2822
2855
|
]
|
|
2823
2856
|
}
|
|
2824
2857
|
),
|
|
2825
|
-
/* @__PURE__ */
|
|
2826
|
-
/* @__PURE__ */
|
|
2858
|
+
/* @__PURE__ */ jsx39(Message, { type: "error", message: error }),
|
|
2859
|
+
/* @__PURE__ */ jsx39(Message, { type: "hint", message: hint })
|
|
2827
2860
|
] });
|
|
2828
2861
|
}
|
|
2829
2862
|
|
|
2830
2863
|
// src/components/interaction/form/SegmentedControl/SegmentedControl.tsx
|
|
2831
2864
|
import { Children } from "react";
|
|
2832
|
-
import { StyleSheet as
|
|
2833
|
-
import { jsx as
|
|
2865
|
+
import { StyleSheet as StyleSheet36, View as View31, Pressable as Pressable19 } from "react-native";
|
|
2866
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
2834
2867
|
var TRACK_PADDING = spacing.xxxs;
|
|
2835
2868
|
var sizeTokens2 = {
|
|
2836
2869
|
small: { minHeight: 32, fontSize: font.size.bodyS, px: spacing.s, py: spacing.xxs },
|
|
@@ -2845,7 +2878,7 @@ var thumbShadow = {
|
|
|
2845
2878
|
shadowRadius: 2,
|
|
2846
2879
|
elevation: 2
|
|
2847
2880
|
};
|
|
2848
|
-
var
|
|
2881
|
+
var styles35 = StyleSheet36.create({
|
|
2849
2882
|
track: {
|
|
2850
2883
|
flexDirection: "row",
|
|
2851
2884
|
borderRadius: border.radius.full,
|
|
@@ -2880,10 +2913,10 @@ function SegmentedControl({
|
|
|
2880
2913
|
const items = Children.toArray(children);
|
|
2881
2914
|
const trackBg = colors2.colorBgSubtle;
|
|
2882
2915
|
const thumbBg = variant === "outline" ? colors2.colorBg : colors2.colorInteractive;
|
|
2883
|
-
return /* @__PURE__ */
|
|
2916
|
+
return /* @__PURE__ */ jsx40(
|
|
2884
2917
|
View31,
|
|
2885
2918
|
{
|
|
2886
|
-
style: [
|
|
2919
|
+
style: [styles35.track, { backgroundColor: trackBg }, style],
|
|
2887
2920
|
accessibilityRole: "tablist",
|
|
2888
2921
|
accessibilityLabel,
|
|
2889
2922
|
children: items.map((child, index) => {
|
|
@@ -2896,7 +2929,7 @@ function SegmentedControl({
|
|
|
2896
2929
|
paddingVertical: py,
|
|
2897
2930
|
...isActive ? { backgroundColor: thumbBg, ...thumbShadow } : { backgroundColor: "transparent" }
|
|
2898
2931
|
};
|
|
2899
|
-
return /* @__PURE__ */
|
|
2932
|
+
return /* @__PURE__ */ jsx40(
|
|
2900
2933
|
Pressable19,
|
|
2901
2934
|
{
|
|
2902
2935
|
onPress: () => !disabled && onValueChange?.(index),
|
|
@@ -2905,15 +2938,15 @@ function SegmentedControl({
|
|
|
2905
2938
|
accessibilityLabel: label ?? void 0,
|
|
2906
2939
|
accessibilityState: { selected: isActive, disabled },
|
|
2907
2940
|
style: ({ pressed }) => [
|
|
2908
|
-
|
|
2941
|
+
styles35.segment,
|
|
2909
2942
|
segmentStyle,
|
|
2910
2943
|
pressed && !disabled && { opacity: 0.7 },
|
|
2911
2944
|
disabled && { opacity: 0.4 }
|
|
2912
2945
|
],
|
|
2913
|
-
children: label !== null ? /* @__PURE__ */
|
|
2946
|
+
children: label !== null ? /* @__PURE__ */ jsx40(
|
|
2914
2947
|
ScaledText,
|
|
2915
2948
|
{
|
|
2916
|
-
style: [
|
|
2949
|
+
style: [styles35.label, { fontSize, color: labelColor }],
|
|
2917
2950
|
numberOfLines: 1,
|
|
2918
2951
|
adjustsFontSizeToFit: true,
|
|
2919
2952
|
minimumFontScale: 0.5,
|
|
@@ -2930,8 +2963,8 @@ function SegmentedControl({
|
|
|
2930
2963
|
|
|
2931
2964
|
// src/components/interaction/form/FormInput/FormInput.tsx
|
|
2932
2965
|
import { useState as useState8 } from "react";
|
|
2933
|
-
import { StyleSheet as
|
|
2934
|
-
import { jsx as
|
|
2966
|
+
import { StyleSheet as StyleSheet37, View as View32 } from "react-native";
|
|
2967
|
+
import { jsx as jsx41, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2935
2968
|
var INPUT_HEIGHT2 = 44;
|
|
2936
2969
|
var keyboardTypeMap = {
|
|
2937
2970
|
text: "default",
|
|
@@ -2942,19 +2975,19 @@ var keyboardTypeMap = {
|
|
|
2942
2975
|
number: "numeric",
|
|
2943
2976
|
search: "default"
|
|
2944
2977
|
};
|
|
2945
|
-
var
|
|
2978
|
+
var styles36 = StyleSheet37.create({
|
|
2946
2979
|
container: {
|
|
2947
2980
|
gap: spacing.xxs
|
|
2948
2981
|
},
|
|
2949
2982
|
/**
|
|
2950
|
-
* The wrapper draws the
|
|
2983
|
+
* The wrapper draws the rounded border and provides at least 44pt touch-target height.
|
|
2951
2984
|
* justifyContent: 'center' vertically centers the inner TextInput on both iOS and Android.
|
|
2952
2985
|
*/
|
|
2953
2986
|
inputWrapper: {
|
|
2954
2987
|
minHeight: INPUT_HEIGHT2,
|
|
2955
2988
|
justifyContent: "center",
|
|
2956
2989
|
borderWidth: 1,
|
|
2957
|
-
borderRadius: border.radius.
|
|
2990
|
+
borderRadius: border.radius.m
|
|
2958
2991
|
},
|
|
2959
2992
|
/**
|
|
2960
2993
|
* No vertical padding: iOS centers text automatically inside the wrapper height.
|
|
@@ -2990,20 +3023,20 @@ function FormInput({
|
|
|
2990
3023
|
const { colors: colors2 } = useTheme();
|
|
2991
3024
|
const [focused, setFocused] = useState8(false);
|
|
2992
3025
|
const borderColor = error ? colors2.colorError : focused ? colors2.colorInteractive : colors2.colorOnBg;
|
|
2993
|
-
return /* @__PURE__ */ jsxs24(View32, { style: [
|
|
2994
|
-
/* @__PURE__ */
|
|
2995
|
-
/* @__PURE__ */
|
|
3026
|
+
return /* @__PURE__ */ jsxs24(View32, { style: [styles36.container, style], children: [
|
|
3027
|
+
/* @__PURE__ */ jsx41(Label, { label }),
|
|
3028
|
+
/* @__PURE__ */ jsx41(
|
|
2996
3029
|
View32,
|
|
2997
3030
|
{
|
|
2998
3031
|
style: [
|
|
2999
|
-
|
|
3032
|
+
styles36.inputWrapper,
|
|
3000
3033
|
{
|
|
3001
3034
|
borderColor,
|
|
3002
3035
|
backgroundColor: colors2.colorBg
|
|
3003
3036
|
},
|
|
3004
3037
|
disabled && { opacity: 0.4 }
|
|
3005
3038
|
],
|
|
3006
|
-
children: /* @__PURE__ */
|
|
3039
|
+
children: /* @__PURE__ */ jsx41(
|
|
3007
3040
|
ScaledTextInput,
|
|
3008
3041
|
{
|
|
3009
3042
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
@@ -3028,23 +3061,23 @@ function FormInput({
|
|
|
3028
3061
|
onBlur?.();
|
|
3029
3062
|
},
|
|
3030
3063
|
style: [
|
|
3031
|
-
|
|
3064
|
+
styles36.input,
|
|
3032
3065
|
{ color: colors2.colorOnBg }
|
|
3033
3066
|
]
|
|
3034
3067
|
}
|
|
3035
3068
|
)
|
|
3036
3069
|
}
|
|
3037
3070
|
),
|
|
3038
|
-
/* @__PURE__ */
|
|
3039
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ jsx41(Message, { type: "error", message: error }),
|
|
3072
|
+
/* @__PURE__ */ jsx41(Message, { type: "hint", message: hint })
|
|
3040
3073
|
] });
|
|
3041
3074
|
}
|
|
3042
3075
|
|
|
3043
3076
|
// src/components/interaction/form/Textarea/Textarea.tsx
|
|
3044
3077
|
import { useState as useState9 } from "react";
|
|
3045
|
-
import { StyleSheet as
|
|
3046
|
-
import { jsx as
|
|
3047
|
-
var
|
|
3078
|
+
import { StyleSheet as StyleSheet38, View as View33 } from "react-native";
|
|
3079
|
+
import { jsx as jsx42, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3080
|
+
var styles37 = StyleSheet38.create({
|
|
3048
3081
|
container: {
|
|
3049
3082
|
gap: spacing.xxs
|
|
3050
3083
|
},
|
|
@@ -3055,7 +3088,7 @@ var styles36 = StyleSheet37.create({
|
|
|
3055
3088
|
paddingHorizontal: spacing.s,
|
|
3056
3089
|
paddingVertical: spacing.xs,
|
|
3057
3090
|
borderWidth: 1,
|
|
3058
|
-
borderRadius: border.radius.
|
|
3091
|
+
borderRadius: border.radius.m,
|
|
3059
3092
|
minHeight: 100,
|
|
3060
3093
|
textAlignVertical: "top"
|
|
3061
3094
|
}
|
|
@@ -3078,9 +3111,9 @@ function Textarea({
|
|
|
3078
3111
|
const { colors: colors2 } = useTheme();
|
|
3079
3112
|
const [focused, setFocused] = useState9(false);
|
|
3080
3113
|
const borderColor = error ? colors2.colorError : focused ? colors2.colorInteractive : colors2.colorOnBg;
|
|
3081
|
-
return /* @__PURE__ */ jsxs25(View33, { style: [
|
|
3082
|
-
/* @__PURE__ */
|
|
3083
|
-
/* @__PURE__ */
|
|
3114
|
+
return /* @__PURE__ */ jsxs25(View33, { style: [styles37.container, style], children: [
|
|
3115
|
+
/* @__PURE__ */ jsx42(Label, { label }),
|
|
3116
|
+
/* @__PURE__ */ jsx42(
|
|
3084
3117
|
ScaledTextInput,
|
|
3085
3118
|
{
|
|
3086
3119
|
accessibilityLabel: typeof label === "string" ? label : name,
|
|
@@ -3103,7 +3136,7 @@ function Textarea({
|
|
|
3103
3136
|
onBlur?.();
|
|
3104
3137
|
},
|
|
3105
3138
|
style: [
|
|
3106
|
-
|
|
3139
|
+
styles37.textarea,
|
|
3107
3140
|
{
|
|
3108
3141
|
borderColor,
|
|
3109
3142
|
color: colors2.colorOnBg,
|
|
@@ -3113,16 +3146,16 @@ function Textarea({
|
|
|
3113
3146
|
]
|
|
3114
3147
|
}
|
|
3115
3148
|
),
|
|
3116
|
-
/* @__PURE__ */
|
|
3117
|
-
/* @__PURE__ */
|
|
3149
|
+
/* @__PURE__ */ jsx42(Message, { type: "error", message: error }),
|
|
3150
|
+
/* @__PURE__ */ jsx42(Message, { type: "hint", message: hint })
|
|
3118
3151
|
] });
|
|
3119
3152
|
}
|
|
3120
3153
|
|
|
3121
3154
|
// src/components/interaction/form/Select/Select.tsx
|
|
3122
3155
|
import { useState as useState10 } from "react";
|
|
3123
|
-
import { StyleSheet as
|
|
3124
|
-
import { jsx as
|
|
3125
|
-
var
|
|
3156
|
+
import { StyleSheet as StyleSheet39, View as View34, Pressable as Pressable20, Modal, FlatList, SafeAreaView } from "react-native";
|
|
3157
|
+
import { jsx as jsx43, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3158
|
+
var styles38 = StyleSheet39.create({
|
|
3126
3159
|
container: {
|
|
3127
3160
|
gap: spacing.xxs
|
|
3128
3161
|
},
|
|
@@ -3133,7 +3166,7 @@ var styles37 = StyleSheet38.create({
|
|
|
3133
3166
|
paddingHorizontal: spacing.s,
|
|
3134
3167
|
paddingVertical: spacing.xs,
|
|
3135
3168
|
borderWidth: 1,
|
|
3136
|
-
borderRadius: border.radius.
|
|
3169
|
+
borderRadius: border.radius.m,
|
|
3137
3170
|
minHeight: 44
|
|
3138
3171
|
},
|
|
3139
3172
|
triggerText: {
|
|
@@ -3143,8 +3176,6 @@ var styles37 = StyleSheet38.create({
|
|
|
3143
3176
|
flex: 1
|
|
3144
3177
|
},
|
|
3145
3178
|
chevron: {
|
|
3146
|
-
fontFamily: font.family.body,
|
|
3147
|
-
fontSize: font.size.body,
|
|
3148
3179
|
marginStart: spacing.xs
|
|
3149
3180
|
},
|
|
3150
3181
|
overlay: {
|
|
@@ -3210,8 +3241,8 @@ function Select({
|
|
|
3210
3241
|
onChange?.(optionValue);
|
|
3211
3242
|
setOpen(false);
|
|
3212
3243
|
};
|
|
3213
|
-
return /* @__PURE__ */ jsxs26(View34, { style: [
|
|
3214
|
-
/* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ jsxs26(View34, { style: [styles38.container, style], children: [
|
|
3245
|
+
/* @__PURE__ */ jsx43(Label, { label }),
|
|
3215
3246
|
/* @__PURE__ */ jsxs26(
|
|
3216
3247
|
Pressable20,
|
|
3217
3248
|
{
|
|
@@ -3222,7 +3253,7 @@ function Select({
|
|
|
3222
3253
|
disabled,
|
|
3223
3254
|
onPress: () => setOpen(true),
|
|
3224
3255
|
style: [
|
|
3225
|
-
|
|
3256
|
+
styles38.trigger,
|
|
3226
3257
|
{
|
|
3227
3258
|
borderColor,
|
|
3228
3259
|
backgroundColor: colors2.colorBg
|
|
@@ -3230,11 +3261,11 @@ function Select({
|
|
|
3230
3261
|
disabled && { opacity: 0.4 }
|
|
3231
3262
|
],
|
|
3232
3263
|
children: [
|
|
3233
|
-
/* @__PURE__ */
|
|
3264
|
+
/* @__PURE__ */ jsx43(
|
|
3234
3265
|
ScaledText,
|
|
3235
3266
|
{
|
|
3236
3267
|
style: [
|
|
3237
|
-
|
|
3268
|
+
styles38.triggerText,
|
|
3238
3269
|
{
|
|
3239
3270
|
color: isPlaceholder ? colors2.colorOnBgSubtle : colors2.colorOnBg
|
|
3240
3271
|
}
|
|
@@ -3242,52 +3273,59 @@ function Select({
|
|
|
3242
3273
|
children: displayText
|
|
3243
3274
|
}
|
|
3244
3275
|
),
|
|
3245
|
-
/* @__PURE__ */
|
|
3276
|
+
/* @__PURE__ */ jsx43(
|
|
3277
|
+
Chevron,
|
|
3278
|
+
{
|
|
3279
|
+
testID: "bds-select-chevron",
|
|
3280
|
+
color: colors2.colorOnBgSubtle,
|
|
3281
|
+
style: styles38.chevron
|
|
3282
|
+
}
|
|
3283
|
+
)
|
|
3246
3284
|
]
|
|
3247
3285
|
}
|
|
3248
3286
|
),
|
|
3249
|
-
/* @__PURE__ */
|
|
3287
|
+
/* @__PURE__ */ jsx43(
|
|
3250
3288
|
Modal,
|
|
3251
3289
|
{
|
|
3252
3290
|
visible: open,
|
|
3253
3291
|
transparent: true,
|
|
3254
3292
|
animationType: "slide",
|
|
3255
3293
|
onRequestClose: () => setOpen(false),
|
|
3256
|
-
children: /* @__PURE__ */
|
|
3294
|
+
children: /* @__PURE__ */ jsx43(
|
|
3257
3295
|
Pressable20,
|
|
3258
3296
|
{
|
|
3259
|
-
style:
|
|
3297
|
+
style: styles38.overlay,
|
|
3260
3298
|
onPress: () => setOpen(false),
|
|
3261
3299
|
accessibilityRole: "button",
|
|
3262
3300
|
accessibilityLabel: "Close options",
|
|
3263
|
-
children: /* @__PURE__ */
|
|
3301
|
+
children: /* @__PURE__ */ jsx43(
|
|
3264
3302
|
Pressable20,
|
|
3265
3303
|
{
|
|
3266
|
-
style: [
|
|
3304
|
+
style: [styles38.sheet, { backgroundColor: colors2.colorBg }],
|
|
3267
3305
|
onPress: () => {
|
|
3268
3306
|
},
|
|
3269
3307
|
children: /* @__PURE__ */ jsxs26(SafeAreaView, { children: [
|
|
3270
|
-
/* @__PURE__ */ jsxs26(View34, { style:
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
/* @__PURE__ */
|
|
3308
|
+
/* @__PURE__ */ jsxs26(View34, { style: styles38.sheetHeader, children: [
|
|
3309
|
+
/* @__PURE__ */ jsx43(ScaledText, { style: [styles38.sheetTitle, { color: colors2.colorOnBg }], children: typeof label === "string" ? label : "Select" }),
|
|
3310
|
+
/* @__PURE__ */ jsx43(
|
|
3273
3311
|
Pressable20,
|
|
3274
3312
|
{
|
|
3275
3313
|
accessibilityRole: "button",
|
|
3276
3314
|
accessibilityLabel: "Close",
|
|
3277
3315
|
onPress: () => setOpen(false),
|
|
3278
3316
|
hitSlop: 8,
|
|
3279
|
-
children: /* @__PURE__ */
|
|
3317
|
+
children: /* @__PURE__ */ jsx43(ScaledText, { style: [styles38.closeText, { color: colors2.colorInteractive }], children: "Done" })
|
|
3280
3318
|
}
|
|
3281
3319
|
)
|
|
3282
3320
|
] }),
|
|
3283
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ jsx43(
|
|
3284
3322
|
FlatList,
|
|
3285
3323
|
{
|
|
3286
3324
|
data: options,
|
|
3287
3325
|
keyExtractor: (item) => item.value,
|
|
3288
3326
|
renderItem: ({ item }) => {
|
|
3289
3327
|
const isSelected = item.value === value;
|
|
3290
|
-
return /* @__PURE__ */
|
|
3328
|
+
return /* @__PURE__ */ jsx43(
|
|
3291
3329
|
Pressable20,
|
|
3292
3330
|
{
|
|
3293
3331
|
accessibilityRole: "button",
|
|
@@ -3299,16 +3337,16 @@ function Select({
|
|
|
3299
3337
|
disabled: item.disabled,
|
|
3300
3338
|
onPress: () => handleSelect(item.value),
|
|
3301
3339
|
style: ({ pressed }) => [
|
|
3302
|
-
|
|
3340
|
+
styles38.optionItem,
|
|
3303
3341
|
isSelected && { backgroundColor: colors2.colorBgSubtle },
|
|
3304
3342
|
pressed && { opacity: 0.7 },
|
|
3305
3343
|
item.disabled && { opacity: 0.4 }
|
|
3306
3344
|
],
|
|
3307
|
-
children: /* @__PURE__ */
|
|
3345
|
+
children: /* @__PURE__ */ jsx43(
|
|
3308
3346
|
ScaledText,
|
|
3309
3347
|
{
|
|
3310
3348
|
style: [
|
|
3311
|
-
|
|
3349
|
+
styles38.optionText,
|
|
3312
3350
|
{
|
|
3313
3351
|
color: isSelected ? colors2.colorInteractive : colors2.colorOnBg,
|
|
3314
3352
|
fontWeight: isSelected ? font.weight.semibold : font.weight.body
|
|
@@ -3329,18 +3367,18 @@ function Select({
|
|
|
3329
3367
|
)
|
|
3330
3368
|
}
|
|
3331
3369
|
),
|
|
3332
|
-
/* @__PURE__ */
|
|
3333
|
-
/* @__PURE__ */
|
|
3370
|
+
/* @__PURE__ */ jsx43(Message, { type: "error", message: error }),
|
|
3371
|
+
/* @__PURE__ */ jsx43(Message, { type: "hint", message: hint })
|
|
3334
3372
|
] });
|
|
3335
3373
|
}
|
|
3336
3374
|
|
|
3337
3375
|
// src/components/interaction/form/Slider/Slider.tsx
|
|
3338
3376
|
import { useState as useState11 } from "react";
|
|
3339
|
-
import { StyleSheet as
|
|
3340
|
-
import { jsx as
|
|
3377
|
+
import { StyleSheet as StyleSheet40, View as View35 } from "react-native";
|
|
3378
|
+
import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3341
3379
|
var TRACK_HEIGHT = 6;
|
|
3342
3380
|
var THUMB_SIZE = 24;
|
|
3343
|
-
var
|
|
3381
|
+
var styles39 = StyleSheet40.create({
|
|
3344
3382
|
container: {
|
|
3345
3383
|
gap: spacing.xxs
|
|
3346
3384
|
},
|
|
@@ -3437,31 +3475,31 @@ function Slider({
|
|
|
3437
3475
|
return /* @__PURE__ */ jsxs27(
|
|
3438
3476
|
View35,
|
|
3439
3477
|
{
|
|
3440
|
-
style: [
|
|
3478
|
+
style: [styles39.container, style],
|
|
3441
3479
|
accessibilityRole: "adjustable",
|
|
3442
3480
|
accessibilityLabel: label,
|
|
3443
3481
|
accessibilityValue: { min, max, now: currentValue, text: String(currentValue) },
|
|
3444
3482
|
accessibilityState: { disabled },
|
|
3445
3483
|
children: [
|
|
3446
|
-
/* @__PURE__ */ jsxs27(View35, { style:
|
|
3447
|
-
/* @__PURE__ */
|
|
3448
|
-
showValue && /* @__PURE__ */
|
|
3484
|
+
/* @__PURE__ */ jsxs27(View35, { style: styles39.labelRow, children: [
|
|
3485
|
+
/* @__PURE__ */ jsx44(Label, { label }),
|
|
3486
|
+
showValue && /* @__PURE__ */ jsx44(ScaledText, { style: [styles39.valueText, { color: colors2.colorOnBg }], children: currentValue })
|
|
3449
3487
|
] }),
|
|
3450
3488
|
/* @__PURE__ */ jsxs27(
|
|
3451
3489
|
View35,
|
|
3452
3490
|
{
|
|
3453
|
-
style: [
|
|
3491
|
+
style: [styles39.trackContainer, disabled && { opacity: 0.4 }],
|
|
3454
3492
|
onLayout: handleTrackLayout,
|
|
3455
3493
|
onStartShouldSetResponder: handleStartShouldSetResponder,
|
|
3456
3494
|
onMoveShouldSetResponder: handleStartShouldSetResponder,
|
|
3457
3495
|
onResponderGrant: handleResponderGrant,
|
|
3458
3496
|
onResponderMove: handleResponderMove,
|
|
3459
3497
|
children: [
|
|
3460
|
-
/* @__PURE__ */
|
|
3498
|
+
/* @__PURE__ */ jsx44(View35, { style: [styles39.track, { backgroundColor: colors2.colorBgSubtle }], children: /* @__PURE__ */ jsx44(
|
|
3461
3499
|
View35,
|
|
3462
3500
|
{
|
|
3463
3501
|
style: [
|
|
3464
|
-
|
|
3502
|
+
styles39.fill,
|
|
3465
3503
|
{
|
|
3466
3504
|
width: `${fillPct}%`,
|
|
3467
3505
|
backgroundColor: error ? colors2.colorError : colors2.colorInteractive
|
|
@@ -3469,11 +3507,11 @@ function Slider({
|
|
|
3469
3507
|
]
|
|
3470
3508
|
}
|
|
3471
3509
|
) }),
|
|
3472
|
-
/* @__PURE__ */
|
|
3510
|
+
/* @__PURE__ */ jsx44(
|
|
3473
3511
|
View35,
|
|
3474
3512
|
{
|
|
3475
3513
|
style: [
|
|
3476
|
-
|
|
3514
|
+
styles39.thumb,
|
|
3477
3515
|
{
|
|
3478
3516
|
start: `${fillPct}%`,
|
|
3479
3517
|
marginStart: -(THUMB_SIZE / 2),
|
|
@@ -3486,8 +3524,8 @@ function Slider({
|
|
|
3486
3524
|
]
|
|
3487
3525
|
}
|
|
3488
3526
|
),
|
|
3489
|
-
/* @__PURE__ */
|
|
3490
|
-
/* @__PURE__ */
|
|
3527
|
+
/* @__PURE__ */ jsx44(Message, { type: "error", message: error }),
|
|
3528
|
+
/* @__PURE__ */ jsx44(Message, { type: "hint", message: hint })
|
|
3491
3529
|
]
|
|
3492
3530
|
}
|
|
3493
3531
|
);
|
|
@@ -3495,10 +3533,10 @@ function Slider({
|
|
|
3495
3533
|
|
|
3496
3534
|
// src/components/interaction/form/NumberInput/NumberInput.tsx
|
|
3497
3535
|
import { useState as useState12 } from "react";
|
|
3498
|
-
import { StyleSheet as
|
|
3499
|
-
import { jsx as
|
|
3536
|
+
import { StyleSheet as StyleSheet41, View as View36, Pressable as Pressable21 } from "react-native";
|
|
3537
|
+
import { jsx as jsx45, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3500
3538
|
var STEPPER_SIZE = 44;
|
|
3501
|
-
var
|
|
3539
|
+
var styles40 = StyleSheet41.create({
|
|
3502
3540
|
container: {
|
|
3503
3541
|
gap: spacing.xxs
|
|
3504
3542
|
},
|
|
@@ -3514,13 +3552,13 @@ var styles39 = StyleSheet40.create({
|
|
|
3514
3552
|
borderWidth: 1
|
|
3515
3553
|
},
|
|
3516
3554
|
stepperStart: {
|
|
3517
|
-
borderTopStartRadius: border.radius.
|
|
3518
|
-
borderBottomStartRadius: border.radius.
|
|
3555
|
+
borderTopStartRadius: border.radius.m,
|
|
3556
|
+
borderBottomStartRadius: border.radius.m,
|
|
3519
3557
|
borderEndWidth: 0
|
|
3520
3558
|
},
|
|
3521
3559
|
stepperEnd: {
|
|
3522
|
-
borderTopEndRadius: border.radius.
|
|
3523
|
-
borderBottomEndRadius: border.radius.
|
|
3560
|
+
borderTopEndRadius: border.radius.m,
|
|
3561
|
+
borderBottomEndRadius: border.radius.m,
|
|
3524
3562
|
borderStartWidth: 0
|
|
3525
3563
|
},
|
|
3526
3564
|
stepperText: {
|
|
@@ -3587,10 +3625,10 @@ function NumberInput({
|
|
|
3587
3625
|
const canDecrease = min === void 0 || currentValue > min;
|
|
3588
3626
|
const canIncrease = max === void 0 || currentValue < max;
|
|
3589
3627
|
const borderColor = error ? colors2.colorError : colors2.colorOnBg;
|
|
3590
|
-
return /* @__PURE__ */ jsxs28(View36, { style: [
|
|
3591
|
-
/* @__PURE__ */
|
|
3592
|
-
/* @__PURE__ */ jsxs28(View36, { style: [
|
|
3593
|
-
/* @__PURE__ */
|
|
3628
|
+
return /* @__PURE__ */ jsxs28(View36, { style: [styles40.container, style], children: [
|
|
3629
|
+
/* @__PURE__ */ jsx45(Label, { label }),
|
|
3630
|
+
/* @__PURE__ */ jsxs28(View36, { style: [styles40.inputRow, disabled && { opacity: 0.4 }], children: [
|
|
3631
|
+
/* @__PURE__ */ jsx45(
|
|
3594
3632
|
Pressable21,
|
|
3595
3633
|
{
|
|
3596
3634
|
accessibilityRole: "button",
|
|
@@ -3599,8 +3637,8 @@ function NumberInput({
|
|
|
3599
3637
|
disabled: disabled || !canDecrease,
|
|
3600
3638
|
onPress: () => update(currentValue - step),
|
|
3601
3639
|
style: ({ pressed }) => [
|
|
3602
|
-
|
|
3603
|
-
|
|
3640
|
+
styles40.stepper,
|
|
3641
|
+
styles40.stepperStart,
|
|
3604
3642
|
{
|
|
3605
3643
|
borderColor,
|
|
3606
3644
|
backgroundColor: colors2.colorBgSubtle
|
|
@@ -3608,27 +3646,27 @@ function NumberInput({
|
|
|
3608
3646
|
pressed && { opacity: 0.7 },
|
|
3609
3647
|
(disabled || !canDecrease) && { opacity: 0.4 }
|
|
3610
3648
|
],
|
|
3611
|
-
children: /* @__PURE__ */
|
|
3649
|
+
children: /* @__PURE__ */ jsx45(
|
|
3612
3650
|
ScaledText,
|
|
3613
3651
|
{
|
|
3614
|
-
style: [
|
|
3652
|
+
style: [styles40.stepperText, { color: colors2.colorOnBg }],
|
|
3615
3653
|
"aria-hidden": true,
|
|
3616
3654
|
children: "\u2212"
|
|
3617
3655
|
}
|
|
3618
3656
|
)
|
|
3619
3657
|
}
|
|
3620
3658
|
),
|
|
3621
|
-
/* @__PURE__ */
|
|
3659
|
+
/* @__PURE__ */ jsx45(
|
|
3622
3660
|
View36,
|
|
3623
3661
|
{
|
|
3624
3662
|
style: [
|
|
3625
|
-
|
|
3663
|
+
styles40.inputWrapper,
|
|
3626
3664
|
{
|
|
3627
3665
|
borderColor,
|
|
3628
3666
|
backgroundColor: colors2.colorBg
|
|
3629
3667
|
}
|
|
3630
3668
|
],
|
|
3631
|
-
children: /* @__PURE__ */
|
|
3669
|
+
children: /* @__PURE__ */ jsx45(
|
|
3632
3670
|
ScaledTextInput,
|
|
3633
3671
|
{
|
|
3634
3672
|
accessibilityLabel: label,
|
|
@@ -3648,14 +3686,14 @@ function NumberInput({
|
|
|
3648
3686
|
update(safe);
|
|
3649
3687
|
},
|
|
3650
3688
|
style: [
|
|
3651
|
-
|
|
3689
|
+
styles40.input,
|
|
3652
3690
|
{ color: colors2.colorOnBg }
|
|
3653
3691
|
]
|
|
3654
3692
|
}
|
|
3655
3693
|
)
|
|
3656
3694
|
}
|
|
3657
3695
|
),
|
|
3658
|
-
/* @__PURE__ */
|
|
3696
|
+
/* @__PURE__ */ jsx45(
|
|
3659
3697
|
Pressable21,
|
|
3660
3698
|
{
|
|
3661
3699
|
accessibilityRole: "button",
|
|
@@ -3664,8 +3702,8 @@ function NumberInput({
|
|
|
3664
3702
|
disabled: disabled || !canIncrease,
|
|
3665
3703
|
onPress: () => update(currentValue + step),
|
|
3666
3704
|
style: ({ pressed }) => [
|
|
3667
|
-
|
|
3668
|
-
|
|
3705
|
+
styles40.stepper,
|
|
3706
|
+
styles40.stepperEnd,
|
|
3669
3707
|
{
|
|
3670
3708
|
borderColor,
|
|
3671
3709
|
backgroundColor: colors2.colorBgSubtle
|
|
@@ -3673,10 +3711,10 @@ function NumberInput({
|
|
|
3673
3711
|
pressed && { opacity: 0.7 },
|
|
3674
3712
|
(disabled || !canIncrease) && { opacity: 0.4 }
|
|
3675
3713
|
],
|
|
3676
|
-
children: /* @__PURE__ */
|
|
3714
|
+
children: /* @__PURE__ */ jsx45(
|
|
3677
3715
|
ScaledText,
|
|
3678
3716
|
{
|
|
3679
|
-
style: [
|
|
3717
|
+
style: [styles40.stepperText, { color: colors2.colorOnBg }],
|
|
3680
3718
|
"aria-hidden": true,
|
|
3681
3719
|
children: "+"
|
|
3682
3720
|
}
|
|
@@ -3684,15 +3722,15 @@ function NumberInput({
|
|
|
3684
3722
|
}
|
|
3685
3723
|
)
|
|
3686
3724
|
] }),
|
|
3687
|
-
/* @__PURE__ */
|
|
3688
|
-
/* @__PURE__ */
|
|
3725
|
+
/* @__PURE__ */ jsx45(Message, { type: "error", message: error }),
|
|
3726
|
+
/* @__PURE__ */ jsx45(Message, { type: "hint", message: hint })
|
|
3689
3727
|
] });
|
|
3690
3728
|
}
|
|
3691
3729
|
|
|
3692
3730
|
// src/components/interaction/Dialog/Dialog.tsx
|
|
3693
|
-
import { Modal as Modal2, View as View37, Pressable as Pressable22, StyleSheet as
|
|
3694
|
-
import { jsx as
|
|
3695
|
-
var
|
|
3731
|
+
import { Modal as Modal2, View as View37, Pressable as Pressable22, StyleSheet as StyleSheet42 } from "react-native";
|
|
3732
|
+
import { jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3733
|
+
var styles41 = StyleSheet42.create({
|
|
3696
3734
|
overlay: {
|
|
3697
3735
|
flex: 1,
|
|
3698
3736
|
justifyContent: "center",
|
|
@@ -3748,19 +3786,19 @@ function Dialog({
|
|
|
3748
3786
|
style
|
|
3749
3787
|
}) {
|
|
3750
3788
|
const { colors: colors2 } = useTheme();
|
|
3751
|
-
return /* @__PURE__ */
|
|
3789
|
+
return /* @__PURE__ */ jsx46(
|
|
3752
3790
|
Modal2,
|
|
3753
3791
|
{
|
|
3754
3792
|
visible: isOpen,
|
|
3755
3793
|
transparent: true,
|
|
3756
3794
|
animationType: "fade",
|
|
3757
3795
|
onRequestClose: onClose,
|
|
3758
|
-
children: /* @__PURE__ */ jsxs29(View37, { style:
|
|
3759
|
-
/* @__PURE__ */
|
|
3796
|
+
children: /* @__PURE__ */ jsxs29(View37, { style: styles41.overlay, children: [
|
|
3797
|
+
/* @__PURE__ */ jsx46(
|
|
3760
3798
|
Pressable22,
|
|
3761
3799
|
{
|
|
3762
3800
|
testID: "bds-dialog-backdrop",
|
|
3763
|
-
style:
|
|
3801
|
+
style: StyleSheet42.absoluteFill,
|
|
3764
3802
|
onPress: onClose,
|
|
3765
3803
|
accessible: false,
|
|
3766
3804
|
importantForAccessibility: "no"
|
|
@@ -3769,29 +3807,29 @@ function Dialog({
|
|
|
3769
3807
|
/* @__PURE__ */ jsxs29(
|
|
3770
3808
|
View37,
|
|
3771
3809
|
{
|
|
3772
|
-
style: [
|
|
3810
|
+
style: [styles41.panel, { backgroundColor: colors2.colorGreySubtle }, style],
|
|
3773
3811
|
accessibilityViewIsModal: true,
|
|
3774
3812
|
onAccessibilityEscape: onClose,
|
|
3775
3813
|
children: [
|
|
3776
|
-
/* @__PURE__ */
|
|
3814
|
+
/* @__PURE__ */ jsx46(
|
|
3777
3815
|
Pressable22,
|
|
3778
3816
|
{
|
|
3779
|
-
style:
|
|
3817
|
+
style: styles41.closeButton,
|
|
3780
3818
|
onPress: onClose,
|
|
3781
3819
|
accessibilityRole: "button",
|
|
3782
3820
|
accessibilityLabel: "Close dialog",
|
|
3783
3821
|
hitSlop: 8,
|
|
3784
|
-
children: /* @__PURE__ */
|
|
3822
|
+
children: /* @__PURE__ */ jsx46(
|
|
3785
3823
|
ScaledText,
|
|
3786
3824
|
{
|
|
3787
|
-
style: [
|
|
3825
|
+
style: [styles41.closeText, { color: colors2.colorOnBgSubtle }],
|
|
3788
3826
|
"aria-hidden": true,
|
|
3789
3827
|
children: "\u2715"
|
|
3790
3828
|
}
|
|
3791
3829
|
)
|
|
3792
3830
|
}
|
|
3793
3831
|
),
|
|
3794
|
-
!!title && /* @__PURE__ */
|
|
3832
|
+
!!title && /* @__PURE__ */ jsx46(View37, { style: styles41.header, children: /* @__PURE__ */ jsx46(ScaledText, { style: [styles41.title, { color: colors2.colorOnGreySubtle }], children: title }) }),
|
|
3795
3833
|
children
|
|
3796
3834
|
]
|
|
3797
3835
|
}
|
|
@@ -3803,9 +3841,9 @@ function Dialog({
|
|
|
3803
3841
|
|
|
3804
3842
|
// src/components/interaction/SideSheet/SideSheet.tsx
|
|
3805
3843
|
import { useEffect as useEffect2, useRef as useRef4 } from "react";
|
|
3806
|
-
import { Modal as Modal3, View as View38, Pressable as Pressable23, Animated as
|
|
3807
|
-
import { jsx as
|
|
3808
|
-
var
|
|
3844
|
+
import { Modal as Modal3, View as View38, Pressable as Pressable23, Animated as Animated4, StyleSheet as StyleSheet43, Dimensions as Dimensions2 } from "react-native";
|
|
3845
|
+
import { jsx as jsx47, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3846
|
+
var styles42 = StyleSheet43.create({
|
|
3809
3847
|
overlay: {
|
|
3810
3848
|
flex: 1,
|
|
3811
3849
|
justifyContent: "flex-end"
|
|
@@ -3863,30 +3901,30 @@ function SideSheet({
|
|
|
3863
3901
|
}) {
|
|
3864
3902
|
const { colors: colors2 } = useTheme();
|
|
3865
3903
|
const screenHeight = Dimensions2.get("window").height;
|
|
3866
|
-
const slideAnim = useRef4(new
|
|
3867
|
-
const backdropAnim = useRef4(new
|
|
3904
|
+
const slideAnim = useRef4(new Animated4.Value(screenHeight)).current;
|
|
3905
|
+
const backdropAnim = useRef4(new Animated4.Value(0)).current;
|
|
3868
3906
|
useEffect2(() => {
|
|
3869
3907
|
if (isOpen) {
|
|
3870
|
-
|
|
3871
|
-
|
|
3908
|
+
Animated4.parallel([
|
|
3909
|
+
Animated4.timing(slideAnim, {
|
|
3872
3910
|
toValue: 0,
|
|
3873
3911
|
duration: 250,
|
|
3874
3912
|
useNativeDriver: true
|
|
3875
3913
|
}),
|
|
3876
|
-
|
|
3914
|
+
Animated4.timing(backdropAnim, {
|
|
3877
3915
|
toValue: 1,
|
|
3878
3916
|
duration: 250,
|
|
3879
3917
|
useNativeDriver: true
|
|
3880
3918
|
})
|
|
3881
3919
|
]).start();
|
|
3882
3920
|
} else {
|
|
3883
|
-
|
|
3884
|
-
|
|
3921
|
+
Animated4.parallel([
|
|
3922
|
+
Animated4.timing(slideAnim, {
|
|
3885
3923
|
toValue: screenHeight,
|
|
3886
3924
|
duration: 200,
|
|
3887
3925
|
useNativeDriver: true
|
|
3888
3926
|
}),
|
|
3889
|
-
|
|
3927
|
+
Animated4.timing(backdropAnim, {
|
|
3890
3928
|
toValue: 0,
|
|
3891
3929
|
duration: 200,
|
|
3892
3930
|
useNativeDriver: true
|
|
@@ -3894,25 +3932,25 @@ function SideSheet({
|
|
|
3894
3932
|
]).start();
|
|
3895
3933
|
}
|
|
3896
3934
|
}, [isOpen, slideAnim, backdropAnim, screenHeight]);
|
|
3897
|
-
return /* @__PURE__ */
|
|
3935
|
+
return /* @__PURE__ */ jsx47(
|
|
3898
3936
|
Modal3,
|
|
3899
3937
|
{
|
|
3900
3938
|
visible: isOpen,
|
|
3901
3939
|
transparent: true,
|
|
3902
3940
|
animationType: "none",
|
|
3903
3941
|
onRequestClose: onClose,
|
|
3904
|
-
children: /* @__PURE__ */ jsxs30(View38, { style:
|
|
3905
|
-
/* @__PURE__ */
|
|
3906
|
-
|
|
3942
|
+
children: /* @__PURE__ */ jsxs30(View38, { style: styles42.overlay, children: [
|
|
3943
|
+
/* @__PURE__ */ jsx47(
|
|
3944
|
+
Animated4.View,
|
|
3907
3945
|
{
|
|
3908
3946
|
style: [
|
|
3909
|
-
|
|
3947
|
+
StyleSheet43.absoluteFill,
|
|
3910
3948
|
{ backgroundColor: "rgba(0, 0, 0, 0.5)", opacity: backdropAnim }
|
|
3911
3949
|
],
|
|
3912
|
-
children: /* @__PURE__ */
|
|
3950
|
+
children: /* @__PURE__ */ jsx47(
|
|
3913
3951
|
Pressable23,
|
|
3914
3952
|
{
|
|
3915
|
-
style:
|
|
3953
|
+
style: StyleSheet43.absoluteFill,
|
|
3916
3954
|
onPress: onClose,
|
|
3917
3955
|
testID: "bds-sidesheet-backdrop",
|
|
3918
3956
|
accessible: false,
|
|
@@ -3922,10 +3960,10 @@ function SideSheet({
|
|
|
3922
3960
|
}
|
|
3923
3961
|
),
|
|
3924
3962
|
/* @__PURE__ */ jsxs30(
|
|
3925
|
-
|
|
3963
|
+
Animated4.View,
|
|
3926
3964
|
{
|
|
3927
3965
|
style: [
|
|
3928
|
-
|
|
3966
|
+
styles42.panel,
|
|
3929
3967
|
{
|
|
3930
3968
|
backgroundColor: colors2.colorBg,
|
|
3931
3969
|
transform: [{ translateY: slideAnim }]
|
|
@@ -3938,21 +3976,21 @@ function SideSheet({
|
|
|
3938
3976
|
/* @__PURE__ */ jsxs30(
|
|
3939
3977
|
View38,
|
|
3940
3978
|
{
|
|
3941
|
-
style: [
|
|
3979
|
+
style: [styles42.header, { borderBottomColor: colors2.colorBgSubtle }],
|
|
3942
3980
|
children: [
|
|
3943
|
-
!!title && /* @__PURE__ */
|
|
3944
|
-
/* @__PURE__ */
|
|
3981
|
+
!!title && /* @__PURE__ */ jsx47(ScaledText, { style: [styles42.title, { color: colors2.colorOnBg }], children: title }),
|
|
3982
|
+
/* @__PURE__ */ jsx47(
|
|
3945
3983
|
Pressable23,
|
|
3946
3984
|
{
|
|
3947
|
-
style:
|
|
3985
|
+
style: styles42.closeButton,
|
|
3948
3986
|
onPress: onClose,
|
|
3949
3987
|
accessibilityRole: "button",
|
|
3950
3988
|
accessibilityLabel: "Close side sheet",
|
|
3951
3989
|
hitSlop: 8,
|
|
3952
|
-
children: /* @__PURE__ */
|
|
3990
|
+
children: /* @__PURE__ */ jsx47(
|
|
3953
3991
|
ScaledText,
|
|
3954
3992
|
{
|
|
3955
|
-
style: [
|
|
3993
|
+
style: [styles42.closeText, { color: colors2.colorOnBgSubtle }],
|
|
3956
3994
|
"aria-hidden": true,
|
|
3957
3995
|
children: "\u2715"
|
|
3958
3996
|
}
|
|
@@ -3962,7 +4000,7 @@ function SideSheet({
|
|
|
3962
4000
|
]
|
|
3963
4001
|
}
|
|
3964
4002
|
),
|
|
3965
|
-
/* @__PURE__ */
|
|
4003
|
+
/* @__PURE__ */ jsx47(View38, { style: styles42.body, testID: "bds-sidesheet-body", children })
|
|
3966
4004
|
]
|
|
3967
4005
|
}
|
|
3968
4006
|
)
|
|
@@ -3981,10 +4019,10 @@ import {
|
|
|
3981
4019
|
createContext as createContext2,
|
|
3982
4020
|
useContext as useContext2
|
|
3983
4021
|
} from "react";
|
|
3984
|
-
import { View as View39, Pressable as Pressable24, Animated as
|
|
3985
|
-
import { jsx as
|
|
4022
|
+
import { View as View39, Pressable as Pressable24, Animated as Animated5, StyleSheet as StyleSheet44 } from "react-native";
|
|
4023
|
+
import { jsx as jsx48, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3986
4024
|
var ToastContext = createContext2(void 0);
|
|
3987
|
-
var
|
|
4025
|
+
var styles43 = StyleSheet44.create({
|
|
3988
4026
|
container: {
|
|
3989
4027
|
position: "absolute",
|
|
3990
4028
|
top: 0,
|
|
@@ -4029,8 +4067,8 @@ function ToastItem({
|
|
|
4029
4067
|
onRemove
|
|
4030
4068
|
}) {
|
|
4031
4069
|
const { colors: colors2 } = useTheme();
|
|
4032
|
-
const slideAnim = useRef5(new
|
|
4033
|
-
const opacityAnim = useRef5(new
|
|
4070
|
+
const slideAnim = useRef5(new Animated5.Value(-100)).current;
|
|
4071
|
+
const opacityAnim = useRef5(new Animated5.Value(0)).current;
|
|
4034
4072
|
const variantColors = useMemo3(
|
|
4035
4073
|
() => ({
|
|
4036
4074
|
success: { bg: colors2.colorSuccess, text: colors2.colorOnSuccess },
|
|
@@ -4040,13 +4078,13 @@ function ToastItem({
|
|
|
4040
4078
|
[colors2]
|
|
4041
4079
|
);
|
|
4042
4080
|
useEffect3(() => {
|
|
4043
|
-
|
|
4044
|
-
|
|
4081
|
+
Animated5.parallel([
|
|
4082
|
+
Animated5.timing(slideAnim, {
|
|
4045
4083
|
toValue: 0,
|
|
4046
4084
|
duration: 200,
|
|
4047
4085
|
useNativeDriver: true
|
|
4048
4086
|
}),
|
|
4049
|
-
|
|
4087
|
+
Animated5.timing(opacityAnim, {
|
|
4050
4088
|
toValue: 1,
|
|
4051
4089
|
duration: 200,
|
|
4052
4090
|
useNativeDriver: true
|
|
@@ -4059,10 +4097,10 @@ function ToastItem({
|
|
|
4059
4097
|
}, [onRemove]);
|
|
4060
4098
|
const { bg, text } = variantColors[toast.variant];
|
|
4061
4099
|
return /* @__PURE__ */ jsxs31(
|
|
4062
|
-
|
|
4100
|
+
Animated5.View,
|
|
4063
4101
|
{
|
|
4064
4102
|
style: [
|
|
4065
|
-
|
|
4103
|
+
styles43.toast,
|
|
4066
4104
|
{
|
|
4067
4105
|
backgroundColor: bg,
|
|
4068
4106
|
transform: [{ translateY: slideAnim }],
|
|
@@ -4072,16 +4110,16 @@ function ToastItem({
|
|
|
4072
4110
|
accessibilityRole: "alert",
|
|
4073
4111
|
accessibilityLiveRegion: "polite",
|
|
4074
4112
|
children: [
|
|
4075
|
-
/* @__PURE__ */
|
|
4076
|
-
/* @__PURE__ */
|
|
4113
|
+
/* @__PURE__ */ jsx48(ScaledText, { style: [styles43.message, { color: text }], children: toast.message }),
|
|
4114
|
+
/* @__PURE__ */ jsx48(
|
|
4077
4115
|
Pressable24,
|
|
4078
4116
|
{
|
|
4079
|
-
style:
|
|
4117
|
+
style: styles43.closeButton,
|
|
4080
4118
|
onPress: onRemove,
|
|
4081
4119
|
accessibilityRole: "button",
|
|
4082
4120
|
accessibilityLabel: "Dismiss",
|
|
4083
4121
|
hitSlop: 8,
|
|
4084
|
-
children: /* @__PURE__ */
|
|
4122
|
+
children: /* @__PURE__ */ jsx48(ScaledText, { style: [styles43.closeText, { color: text }], "aria-hidden": true, children: "\u2715" })
|
|
4085
4123
|
}
|
|
4086
4124
|
)
|
|
4087
4125
|
]
|
|
@@ -4101,15 +4139,15 @@ function ToastProvider({
|
|
|
4101
4139
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
4102
4140
|
}, []);
|
|
4103
4141
|
const value = useMemo3(() => ({ showToast }), [showToast]);
|
|
4104
|
-
return /* @__PURE__ */
|
|
4142
|
+
return /* @__PURE__ */ jsx48(ToastContext.Provider, { value, children: /* @__PURE__ */ jsxs31(View39, { style: [{ flex: 1 }, style], children: [
|
|
4105
4143
|
children,
|
|
4106
|
-
toasts.length > 0 && /* @__PURE__ */
|
|
4144
|
+
toasts.length > 0 && /* @__PURE__ */ jsx48(
|
|
4107
4145
|
View39,
|
|
4108
4146
|
{
|
|
4109
|
-
style:
|
|
4147
|
+
style: styles43.container,
|
|
4110
4148
|
accessibilityRole: "summary",
|
|
4111
4149
|
accessibilityLabel: "Notifications",
|
|
4112
|
-
children: toasts.map((toast) => /* @__PURE__ */
|
|
4150
|
+
children: toasts.map((toast) => /* @__PURE__ */ jsx48(
|
|
4113
4151
|
ToastItem,
|
|
4114
4152
|
{
|
|
4115
4153
|
toast,
|
|
@@ -4131,9 +4169,9 @@ function useToast() {
|
|
|
4131
4169
|
|
|
4132
4170
|
// src/components/interaction/DropdownMenu/DropdownMenu.tsx
|
|
4133
4171
|
import React, { useState as useState14, useEffect as useEffect4, useRef as useRef6 } from "react";
|
|
4134
|
-
import { Modal as Modal4, View as View40, Pressable as Pressable25, FlatList as FlatList2, Animated as
|
|
4135
|
-
import { Fragment as Fragment2, jsx as
|
|
4136
|
-
var
|
|
4172
|
+
import { Modal as Modal4, View as View40, Pressable as Pressable25, FlatList as FlatList2, Animated as Animated6, StyleSheet as StyleSheet45, Dimensions as Dimensions3, SafeAreaView as SafeAreaView2 } from "react-native";
|
|
4173
|
+
import { Fragment as Fragment2, jsx as jsx49, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4174
|
+
var styles44 = StyleSheet45.create({
|
|
4137
4175
|
overlay: {
|
|
4138
4176
|
flex: 1,
|
|
4139
4177
|
justifyContent: "flex-end"
|
|
@@ -4192,30 +4230,30 @@ function DropdownMenu({
|
|
|
4192
4230
|
const { colors: colors2 } = useTheme();
|
|
4193
4231
|
const [open, setOpen] = useState14(false);
|
|
4194
4232
|
const screenHeight = Dimensions3.get("window").height;
|
|
4195
|
-
const slideAnim = useRef6(new
|
|
4196
|
-
const backdropAnim = useRef6(new
|
|
4233
|
+
const slideAnim = useRef6(new Animated6.Value(screenHeight)).current;
|
|
4234
|
+
const backdropAnim = useRef6(new Animated6.Value(0)).current;
|
|
4197
4235
|
useEffect4(() => {
|
|
4198
4236
|
if (open) {
|
|
4199
|
-
|
|
4200
|
-
|
|
4237
|
+
Animated6.parallel([
|
|
4238
|
+
Animated6.timing(slideAnim, {
|
|
4201
4239
|
toValue: 0,
|
|
4202
4240
|
duration: 250,
|
|
4203
4241
|
useNativeDriver: true
|
|
4204
4242
|
}),
|
|
4205
|
-
|
|
4243
|
+
Animated6.timing(backdropAnim, {
|
|
4206
4244
|
toValue: 1,
|
|
4207
4245
|
duration: 250,
|
|
4208
4246
|
useNativeDriver: true
|
|
4209
4247
|
})
|
|
4210
4248
|
]).start();
|
|
4211
4249
|
} else {
|
|
4212
|
-
|
|
4213
|
-
|
|
4250
|
+
Animated6.parallel([
|
|
4251
|
+
Animated6.timing(slideAnim, {
|
|
4214
4252
|
toValue: screenHeight,
|
|
4215
4253
|
duration: 200,
|
|
4216
4254
|
useNativeDriver: true
|
|
4217
4255
|
}),
|
|
4218
|
-
|
|
4256
|
+
Animated6.timing(backdropAnim, {
|
|
4219
4257
|
toValue: 0,
|
|
4220
4258
|
duration: 200,
|
|
4221
4259
|
useNativeDriver: true
|
|
@@ -4233,25 +4271,25 @@ function DropdownMenu({
|
|
|
4233
4271
|
accessibilityRole: "button",
|
|
4234
4272
|
accessibilityLabel: title
|
|
4235
4273
|
}),
|
|
4236
|
-
/* @__PURE__ */
|
|
4274
|
+
/* @__PURE__ */ jsx49(
|
|
4237
4275
|
Modal4,
|
|
4238
4276
|
{
|
|
4239
4277
|
visible: open,
|
|
4240
4278
|
transparent: true,
|
|
4241
4279
|
animationType: "none",
|
|
4242
4280
|
onRequestClose: () => setOpen(false),
|
|
4243
|
-
children: /* @__PURE__ */ jsxs32(View40, { style:
|
|
4244
|
-
/* @__PURE__ */
|
|
4245
|
-
|
|
4281
|
+
children: /* @__PURE__ */ jsxs32(View40, { style: styles44.overlay, children: [
|
|
4282
|
+
/* @__PURE__ */ jsx49(
|
|
4283
|
+
Animated6.View,
|
|
4246
4284
|
{
|
|
4247
4285
|
style: [
|
|
4248
|
-
|
|
4286
|
+
StyleSheet45.absoluteFill,
|
|
4249
4287
|
{ backgroundColor: "rgba(0, 0, 0, 0.5)", opacity: backdropAnim }
|
|
4250
4288
|
],
|
|
4251
|
-
children: /* @__PURE__ */
|
|
4289
|
+
children: /* @__PURE__ */ jsx49(
|
|
4252
4290
|
Pressable25,
|
|
4253
4291
|
{
|
|
4254
|
-
style:
|
|
4292
|
+
style: StyleSheet45.absoluteFill,
|
|
4255
4293
|
onPress: () => setOpen(false),
|
|
4256
4294
|
testID: "bds-dropdownmenu-backdrop",
|
|
4257
4295
|
accessible: false,
|
|
@@ -4260,11 +4298,11 @@ function DropdownMenu({
|
|
|
4260
4298
|
)
|
|
4261
4299
|
}
|
|
4262
4300
|
),
|
|
4263
|
-
/* @__PURE__ */
|
|
4264
|
-
|
|
4301
|
+
/* @__PURE__ */ jsx49(
|
|
4302
|
+
Animated6.View,
|
|
4265
4303
|
{
|
|
4266
4304
|
style: [
|
|
4267
|
-
|
|
4305
|
+
styles44.sheet,
|
|
4268
4306
|
{
|
|
4269
4307
|
backgroundColor: colors2.colorBg,
|
|
4270
4308
|
transform: [{ translateY: slideAnim }]
|
|
@@ -4277,23 +4315,23 @@ function DropdownMenu({
|
|
|
4277
4315
|
View40,
|
|
4278
4316
|
{
|
|
4279
4317
|
style: [
|
|
4280
|
-
|
|
4318
|
+
styles44.sheetHeader,
|
|
4281
4319
|
{ borderBottomColor: colors2.colorBgSubtle }
|
|
4282
4320
|
],
|
|
4283
4321
|
children: [
|
|
4284
|
-
/* @__PURE__ */
|
|
4285
|
-
/* @__PURE__ */
|
|
4322
|
+
/* @__PURE__ */ jsx49(ScaledText, { style: [styles44.sheetTitle, { color: colors2.colorOnBg }], children: title }),
|
|
4323
|
+
/* @__PURE__ */ jsx49(
|
|
4286
4324
|
Pressable25,
|
|
4287
4325
|
{
|
|
4288
4326
|
accessibilityRole: "button",
|
|
4289
4327
|
accessibilityLabel: "Close",
|
|
4290
4328
|
onPress: () => setOpen(false),
|
|
4291
4329
|
hitSlop: 8,
|
|
4292
|
-
children: /* @__PURE__ */
|
|
4330
|
+
children: /* @__PURE__ */ jsx49(
|
|
4293
4331
|
ScaledText,
|
|
4294
4332
|
{
|
|
4295
4333
|
style: [
|
|
4296
|
-
|
|
4334
|
+
styles44.closeText,
|
|
4297
4335
|
{ color: colors2.colorInteractive }
|
|
4298
4336
|
],
|
|
4299
4337
|
children: "Done"
|
|
@@ -4304,17 +4342,17 @@ function DropdownMenu({
|
|
|
4304
4342
|
]
|
|
4305
4343
|
}
|
|
4306
4344
|
),
|
|
4307
|
-
/* @__PURE__ */
|
|
4345
|
+
/* @__PURE__ */ jsx49(
|
|
4308
4346
|
FlatList2,
|
|
4309
4347
|
{
|
|
4310
4348
|
data: items,
|
|
4311
4349
|
keyExtractor: (item) => item.id,
|
|
4312
4350
|
renderItem: ({ item }) => /* @__PURE__ */ jsxs32(Fragment2, { children: [
|
|
4313
|
-
item.separator && /* @__PURE__ */
|
|
4351
|
+
item.separator && /* @__PURE__ */ jsx49(
|
|
4314
4352
|
View40,
|
|
4315
4353
|
{
|
|
4316
4354
|
style: [
|
|
4317
|
-
|
|
4355
|
+
styles44.separator,
|
|
4318
4356
|
{ backgroundColor: colors2.colorBgSubtle }
|
|
4319
4357
|
],
|
|
4320
4358
|
accessibilityRole: "none"
|
|
@@ -4329,12 +4367,12 @@ function DropdownMenu({
|
|
|
4329
4367
|
disabled: item.disabled,
|
|
4330
4368
|
onPress: () => handleItemPress(item),
|
|
4331
4369
|
style: ({ pressed }) => [
|
|
4332
|
-
|
|
4370
|
+
styles44.item,
|
|
4333
4371
|
pressed && { backgroundColor: colors2.colorBgSubtle },
|
|
4334
4372
|
item.disabled && { opacity: 0.4 }
|
|
4335
4373
|
],
|
|
4336
4374
|
children: [
|
|
4337
|
-
!!item.icon && /* @__PURE__ */
|
|
4375
|
+
!!item.icon && /* @__PURE__ */ jsx49(
|
|
4338
4376
|
View40,
|
|
4339
4377
|
{
|
|
4340
4378
|
importantForAccessibility: "no-hide-descendants",
|
|
@@ -4342,11 +4380,11 @@ function DropdownMenu({
|
|
|
4342
4380
|
children: item.icon
|
|
4343
4381
|
}
|
|
4344
4382
|
),
|
|
4345
|
-
/* @__PURE__ */
|
|
4383
|
+
/* @__PURE__ */ jsx49(
|
|
4346
4384
|
ScaledText,
|
|
4347
4385
|
{
|
|
4348
4386
|
style: [
|
|
4349
|
-
|
|
4387
|
+
styles44.itemText,
|
|
4350
4388
|
{ color: colors2.colorOnBg }
|
|
4351
4389
|
],
|
|
4352
4390
|
children: item.label
|
|
@@ -4373,10 +4411,10 @@ import {
|
|
|
4373
4411
|
Modal as Modal5,
|
|
4374
4412
|
View as View41,
|
|
4375
4413
|
Pressable as Pressable26,
|
|
4376
|
-
StyleSheet as
|
|
4414
|
+
StyleSheet as StyleSheet46
|
|
4377
4415
|
} from "react-native";
|
|
4378
|
-
import { jsx as
|
|
4379
|
-
var
|
|
4416
|
+
import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4417
|
+
var styles45 = StyleSheet46.create({
|
|
4380
4418
|
wrapper: {
|
|
4381
4419
|
alignSelf: "flex-start"
|
|
4382
4420
|
},
|
|
@@ -4408,35 +4446,35 @@ function Popover({
|
|
|
4408
4446
|
const { colors: colors2 } = useTheme();
|
|
4409
4447
|
const [isOpen, setIsOpen] = useState15(false);
|
|
4410
4448
|
const close = () => setIsOpen(false);
|
|
4411
|
-
return /* @__PURE__ */ jsxs33(View41, { style: [
|
|
4449
|
+
return /* @__PURE__ */ jsxs33(View41, { style: [styles45.wrapper, style], children: [
|
|
4412
4450
|
React2.cloneElement(children, {
|
|
4413
4451
|
onPress: () => setIsOpen(true),
|
|
4414
4452
|
accessibilityRole: "button",
|
|
4415
4453
|
accessibilityLabel: accessibilityLabel ?? "Open popover"
|
|
4416
4454
|
}),
|
|
4417
|
-
/* @__PURE__ */
|
|
4455
|
+
/* @__PURE__ */ jsx50(
|
|
4418
4456
|
Modal5,
|
|
4419
4457
|
{
|
|
4420
4458
|
visible: isOpen,
|
|
4421
4459
|
transparent: true,
|
|
4422
4460
|
animationType: "fade",
|
|
4423
4461
|
onRequestClose: close,
|
|
4424
|
-
children: /* @__PURE__ */ jsxs33(View41, { style:
|
|
4425
|
-
/* @__PURE__ */
|
|
4462
|
+
children: /* @__PURE__ */ jsxs33(View41, { style: styles45.overlay, onAccessibilityEscape: close, children: [
|
|
4463
|
+
/* @__PURE__ */ jsx50(
|
|
4426
4464
|
Pressable26,
|
|
4427
4465
|
{
|
|
4428
4466
|
testID: "bds-popover-backdrop",
|
|
4429
|
-
style:
|
|
4467
|
+
style: StyleSheet46.absoluteFill,
|
|
4430
4468
|
onPress: close,
|
|
4431
4469
|
onAccessibilityTap: close,
|
|
4432
4470
|
accessibilityRole: "button",
|
|
4433
4471
|
accessibilityLabel: "Close popover"
|
|
4434
4472
|
}
|
|
4435
4473
|
),
|
|
4436
|
-
/* @__PURE__ */
|
|
4474
|
+
/* @__PURE__ */ jsx50(
|
|
4437
4475
|
View41,
|
|
4438
4476
|
{
|
|
4439
|
-
style: [
|
|
4477
|
+
style: [styles45.panel, { backgroundColor: colors2.colorBg }],
|
|
4440
4478
|
accessibilityLabel,
|
|
4441
4479
|
children: content
|
|
4442
4480
|
}
|