@dloizides/ui-forms 1.47.0 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.d.mts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +525 -376
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +337 -188
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React39 = require('react');
|
|
4
4
|
var reactNative = require('react-native');
|
|
5
5
|
var uiFeedback = require('@dloizides/ui-feedback');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -8,18 +8,18 @@ var designTokens = require('@dloizides/design-tokens');
|
|
|
8
8
|
var uiButtons = require('@dloizides/ui-buttons');
|
|
9
9
|
var reactDom = require('react-dom');
|
|
10
10
|
var a11y = require('@dloizides/a11y');
|
|
11
|
+
var uiIcons = require('@dloizides/ui-icons');
|
|
11
12
|
var apiClientBase = require('@dloizides/api-client-base');
|
|
12
13
|
var Svg = require('react-native-svg');
|
|
13
|
-
var uiIcons = require('@dloizides/ui-icons');
|
|
14
14
|
|
|
15
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var React39__default = /*#__PURE__*/_interopDefault(React39);
|
|
18
18
|
var Svg__default = /*#__PURE__*/_interopDefault(Svg);
|
|
19
19
|
|
|
20
20
|
// src/Field/Field.tsx
|
|
21
21
|
function attachControlId(child, candidateId, describedById) {
|
|
22
|
-
if (!
|
|
22
|
+
if (!React39__default.default.isValidElement(child) || child.type === React39__default.default.Fragment) {
|
|
23
23
|
return { node: child };
|
|
24
24
|
}
|
|
25
25
|
const props = child.props;
|
|
@@ -30,15 +30,15 @@ function attachControlId(child, candidateId, describedById) {
|
|
|
30
30
|
if (describedById !== void 0 && props.describedById === void 0) {
|
|
31
31
|
injected.describedById = describedById;
|
|
32
32
|
}
|
|
33
|
-
return { node:
|
|
33
|
+
return { node: React39__default.default.cloneElement(element, injected), controlId };
|
|
34
34
|
}
|
|
35
35
|
var IS_WEB = reactNative.Platform.OS === "web";
|
|
36
36
|
function isAttributeHost(node) {
|
|
37
37
|
return typeof node === "object" && node !== null && typeof node.setAttribute === "function";
|
|
38
38
|
}
|
|
39
39
|
function useHtmlFor(controlId) {
|
|
40
|
-
const ref =
|
|
41
|
-
|
|
40
|
+
const ref = React39.useRef(null);
|
|
41
|
+
React39.useEffect(() => {
|
|
42
42
|
const node = ref.current;
|
|
43
43
|
if (!IS_WEB || !isAttributeHost(node)) return;
|
|
44
44
|
const target = controlId !== void 0 && controlId !== "" ? node.ownerDocument?.getElementById(controlId) : null;
|
|
@@ -148,15 +148,15 @@ var labelVariantStyles = reactNative.StyleSheet.create({
|
|
|
148
148
|
function resolveLabelVariantStyle(variant) {
|
|
149
149
|
return labelVariantStyles[variant ?? "field"] ?? labelVariantStyles.field;
|
|
150
150
|
}
|
|
151
|
-
var FormGridContext =
|
|
152
|
-
var GapOwnedContext =
|
|
151
|
+
var FormGridContext = React39__default.default.createContext(null);
|
|
152
|
+
var GapOwnedContext = React39__default.default.createContext(false);
|
|
153
153
|
var FormGridProvider = FormGridContext.Provider;
|
|
154
154
|
var GapOwnedProvider = GapOwnedContext.Provider;
|
|
155
155
|
function useFormGridMetrics() {
|
|
156
|
-
return
|
|
156
|
+
return React39__default.default.useContext(FormGridContext);
|
|
157
157
|
}
|
|
158
158
|
function useIsGapOwned() {
|
|
159
|
-
return
|
|
159
|
+
return React39__default.default.useContext(GapOwnedContext);
|
|
160
160
|
}
|
|
161
161
|
var ERROR_LIGHT_STEPS = ["500", "600", "700"];
|
|
162
162
|
var ERROR_DARK_STEPS = ["300", "200", "400", "100", "500"];
|
|
@@ -179,7 +179,7 @@ var styles = reactNative.StyleSheet.create({
|
|
|
179
179
|
});
|
|
180
180
|
var fieldSeq = 0;
|
|
181
181
|
function useFieldIds() {
|
|
182
|
-
const [ids] =
|
|
182
|
+
const [ids] = React39__default.default.useState(() => {
|
|
183
183
|
fieldSeq += 1;
|
|
184
184
|
const seq = String(fieldSeq);
|
|
185
185
|
return {
|
|
@@ -226,7 +226,7 @@ var Field = ({
|
|
|
226
226
|
const hasLabel = labelText !== "";
|
|
227
227
|
const marker = resolveFieldMarker(required, optional);
|
|
228
228
|
const { hintId, errorId, controlId, labelId } = useFieldIds();
|
|
229
|
-
const themeStyles =
|
|
229
|
+
const themeStyles = React39__default.default.useMemo(
|
|
230
230
|
() => ({
|
|
231
231
|
label: { color: colors.textSecondary },
|
|
232
232
|
requiredMark: { color: errorColor },
|
|
@@ -278,7 +278,7 @@ var FormGrid = ({
|
|
|
278
278
|
style,
|
|
279
279
|
testID
|
|
280
280
|
}) => {
|
|
281
|
-
const metrics =
|
|
281
|
+
const metrics = React39__default.default.useMemo(() => ({ minWidth, basis }), [minWidth, basis]);
|
|
282
282
|
return /* @__PURE__ */ jsxRuntime.jsx(FormGridProvider, { value: metrics, children: /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles2.grid, { gap }, style], testID, children }) }) });
|
|
283
283
|
};
|
|
284
284
|
var LABEL_LINE_PLACEHOLDER = "\xA0";
|
|
@@ -363,8 +363,8 @@ var InlineFieldRow = ({
|
|
|
363
363
|
}) => {
|
|
364
364
|
const { width } = reactNative.useWindowDimensions();
|
|
365
365
|
const layout = inlineFieldRowLayout(width, fieldMaxWidth, inlineMinWidth);
|
|
366
|
-
const rowStyle =
|
|
367
|
-
const fieldStyle =
|
|
366
|
+
const rowStyle = React39.useMemo(() => [styles4.row, { gap }], [gap]);
|
|
367
|
+
const fieldStyle = React39.useMemo(() => [styles4.field, { maxWidth: layout.fieldMaxWidth }], [layout.fieldMaxWidth]);
|
|
368
368
|
if (!layout.inline)
|
|
369
369
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
370
370
|
field2,
|
|
@@ -545,7 +545,7 @@ var styles9 = reactNative.StyleSheet.create({
|
|
|
545
545
|
});
|
|
546
546
|
var sectionSeq = 0;
|
|
547
547
|
function useSectionLegendId() {
|
|
548
|
-
const [id] =
|
|
548
|
+
const [id] = React39__default.default.useState(() => {
|
|
549
549
|
sectionSeq += 1;
|
|
550
550
|
return `form-section-legend-${String(sectionSeq)}`;
|
|
551
551
|
});
|
|
@@ -803,8 +803,8 @@ function horizontalPlacement(rect2, viewportWidth) {
|
|
|
803
803
|
return { left, width };
|
|
804
804
|
}
|
|
805
805
|
function useAnchorRect(ref, enabled) {
|
|
806
|
-
const [rect2, setRect] =
|
|
807
|
-
|
|
806
|
+
const [rect2, setRect] = React39.useState(null);
|
|
807
|
+
React39.useLayoutEffect(() => {
|
|
808
808
|
if (!IS_WEB3 || !enabled) {
|
|
809
809
|
setRect(null);
|
|
810
810
|
return void 0;
|
|
@@ -853,8 +853,8 @@ function readViewportBottom() {
|
|
|
853
853
|
return viewport === null ? window.innerHeight : viewport.offsetTop + viewport.height;
|
|
854
854
|
}
|
|
855
855
|
function useVisualViewportBottom(enabled) {
|
|
856
|
-
const [bottom, setBottom] =
|
|
857
|
-
|
|
856
|
+
const [bottom, setBottom] = React39.useState(null);
|
|
857
|
+
React39.useLayoutEffect(() => {
|
|
858
858
|
if (!IS_WEB3 || !enabled) {
|
|
859
859
|
setBottom(null);
|
|
860
860
|
return void 0;
|
|
@@ -884,7 +884,7 @@ function scrollAnchorIntoView(ref, marginTop) {
|
|
|
884
884
|
scrollNodeIntoView(node, anchorScrollBlock(node.getBoundingClientRect().bottom, readViewportBottom()));
|
|
885
885
|
}
|
|
886
886
|
function useKeepAnchorInRoom(ref, marginTop, enabled) {
|
|
887
|
-
|
|
887
|
+
React39.useLayoutEffect(() => {
|
|
888
888
|
if (!IS_WEB3 || !enabled) return void 0;
|
|
889
889
|
const place = () => scrollAnchorIntoView(ref, marginTop);
|
|
890
890
|
place();
|
|
@@ -898,7 +898,7 @@ var ESCAPE_KEY = "Escape";
|
|
|
898
898
|
var LISTBOX_ROLE = { role: "listbox" };
|
|
899
899
|
var KEEP_FIELD_FOCUS = { onMouseDown: (event) => event.preventDefault() };
|
|
900
900
|
function useDismiss(anchorRef, menuRef, onDismiss) {
|
|
901
|
-
|
|
901
|
+
React39.useEffect(() => {
|
|
902
902
|
if (!IS_WEB4) return void 0;
|
|
903
903
|
const onMouseDown = (event) => {
|
|
904
904
|
const anchorNode = anchorRef.current;
|
|
@@ -920,7 +920,7 @@ function useDismiss(anchorRef, menuRef, onDismiss) {
|
|
|
920
920
|
}, [anchorRef, menuRef, onDismiss]);
|
|
921
921
|
}
|
|
922
922
|
function useKeepHighlightInView(testID, highlightedValue) {
|
|
923
|
-
|
|
923
|
+
React39.useEffect(() => {
|
|
924
924
|
if (!IS_WEB4 || highlightedValue === void 0 || highlightedValue === "") return;
|
|
925
925
|
scrollNodeIntoView(document.getElementById(optionDomId(testID, highlightedValue)), "nearest");
|
|
926
926
|
}, [testID, highlightedValue]);
|
|
@@ -939,7 +939,7 @@ function AnchoredMenu({
|
|
|
939
939
|
listbox,
|
|
940
940
|
placement
|
|
941
941
|
}) {
|
|
942
|
-
const menuRef =
|
|
942
|
+
const menuRef = React39__default.default.useRef(null);
|
|
943
943
|
useDismiss(anchorRef, menuRef, onDismiss);
|
|
944
944
|
useKeepHighlightInView(testID, listbox?.highlightedValue);
|
|
945
945
|
const rect2 = useAnchorRect(placement?.positionRef ?? anchorRef, usePortal);
|
|
@@ -1014,27 +1014,27 @@ function useThemedInput(options = {}) {
|
|
|
1014
1014
|
const { hasError = false, onFocus, onBlur, editable = true } = options;
|
|
1015
1015
|
const { theme } = uiFeedback.useUi();
|
|
1016
1016
|
const { colors, palette } = theme;
|
|
1017
|
-
const [isFocused, setIsFocused] =
|
|
1018
|
-
const [isHovered, setIsHovered] =
|
|
1019
|
-
const handleFocus =
|
|
1017
|
+
const [isFocused, setIsFocused] = React39.useState(false);
|
|
1018
|
+
const [isHovered, setIsHovered] = React39.useState(false);
|
|
1019
|
+
const handleFocus = React39.useCallback(
|
|
1020
1020
|
(e) => {
|
|
1021
1021
|
setIsFocused(true);
|
|
1022
1022
|
onFocus?.(e);
|
|
1023
1023
|
},
|
|
1024
1024
|
[onFocus]
|
|
1025
1025
|
);
|
|
1026
|
-
const handleBlur =
|
|
1026
|
+
const handleBlur = React39.useCallback(
|
|
1027
1027
|
(e) => {
|
|
1028
1028
|
setIsFocused(false);
|
|
1029
1029
|
onBlur?.(e);
|
|
1030
1030
|
},
|
|
1031
1031
|
[onBlur]
|
|
1032
1032
|
);
|
|
1033
|
-
const handleHoverIn =
|
|
1034
|
-
const handleHoverOut =
|
|
1033
|
+
const handleHoverIn = React39.useCallback(() => setIsHovered(true), []);
|
|
1034
|
+
const handleHoverOut = React39.useCallback(() => setIsHovered(false), []);
|
|
1035
1035
|
const primary = palette.primary["500"];
|
|
1036
1036
|
const errorColor = fieldErrorInk(theme);
|
|
1037
|
-
const style =
|
|
1037
|
+
const style = React39.useMemo(() => {
|
|
1038
1038
|
const restBorder = hasError ? errorColor : colors.border;
|
|
1039
1039
|
const focusBorder = hasError ? errorColor : primary;
|
|
1040
1040
|
const editableBorder = isFocused ? focusBorder : isHovered ? withAlpha(colors.text, HOVER_BORDER_ALPHA) : restBorder;
|
|
@@ -1067,8 +1067,8 @@ function useThemedInput(options = {}) {
|
|
|
1067
1067
|
errorColor,
|
|
1068
1068
|
theme
|
|
1069
1069
|
]);
|
|
1070
|
-
const focusBind =
|
|
1071
|
-
const hoverBind =
|
|
1070
|
+
const focusBind = React39.useMemo(() => ({ onFocus: handleFocus, onBlur: handleBlur }), [handleFocus, handleBlur]);
|
|
1071
|
+
const hoverBind = React39.useMemo(
|
|
1072
1072
|
() => IS_WEB5 ? { onMouseEnter: handleHoverIn, onMouseLeave: handleHoverOut } : {},
|
|
1073
1073
|
[handleHoverIn, handleHoverOut]
|
|
1074
1074
|
);
|
|
@@ -1099,7 +1099,7 @@ var boxStyles = reactNative.StyleSheet.create({
|
|
|
1099
1099
|
textAlignVertical: "top"
|
|
1100
1100
|
}
|
|
1101
1101
|
});
|
|
1102
|
-
var ThemedTextInput =
|
|
1102
|
+
var ThemedTextInput = React39__default.default.forwardRef(function ThemedTextInput2({
|
|
1103
1103
|
hasError = false,
|
|
1104
1104
|
describedById,
|
|
1105
1105
|
requiredField = false,
|
|
@@ -1194,11 +1194,11 @@ function recentsEqual(a, b) {
|
|
|
1194
1194
|
|
|
1195
1195
|
// src/useRecentValues/useRecentValues.ts
|
|
1196
1196
|
function useRecentValues(key, max = DEFAULT_MAX_RECENTS) {
|
|
1197
|
-
const [recents, setRecents] =
|
|
1198
|
-
|
|
1197
|
+
const [recents, setRecents] = React39.useState(() => readRecents(key).slice(0, max));
|
|
1198
|
+
React39.useEffect(() => {
|
|
1199
1199
|
setRecents(readRecents(key).slice(0, max));
|
|
1200
1200
|
}, [key, max]);
|
|
1201
|
-
const remember =
|
|
1201
|
+
const remember = React39.useCallback(
|
|
1202
1202
|
(value) => {
|
|
1203
1203
|
setRecents((current) => {
|
|
1204
1204
|
const next = computeNextRecents(current, value, max);
|
|
@@ -1209,7 +1209,7 @@ function useRecentValues(key, max = DEFAULT_MAX_RECENTS) {
|
|
|
1209
1209
|
},
|
|
1210
1210
|
[key, max]
|
|
1211
1211
|
);
|
|
1212
|
-
const clear =
|
|
1212
|
+
const clear = React39.useCallback(() => {
|
|
1213
1213
|
clearRecents(key);
|
|
1214
1214
|
setRecents([]);
|
|
1215
1215
|
}, [key]);
|
|
@@ -1231,24 +1231,24 @@ function RecentInputField({
|
|
|
1231
1231
|
const { theme } = uiFeedback.useUi();
|
|
1232
1232
|
const { colors, palette } = theme;
|
|
1233
1233
|
const { recents, remember } = useRecentValues(recentKey, recentMax);
|
|
1234
|
-
const anchorRef =
|
|
1235
|
-
const latestText =
|
|
1236
|
-
const [isOpen, setIsOpen] =
|
|
1237
|
-
const handleChange =
|
|
1234
|
+
const anchorRef = React39.useRef(null);
|
|
1235
|
+
const latestText = React39.useRef(typeof value === "string" ? value : "");
|
|
1236
|
+
const [isOpen, setIsOpen] = React39.useState(false);
|
|
1237
|
+
const handleChange = React39.useCallback(
|
|
1238
1238
|
(text) => {
|
|
1239
1239
|
latestText.current = text;
|
|
1240
1240
|
onChangeText?.(text);
|
|
1241
1241
|
},
|
|
1242
1242
|
[onChangeText]
|
|
1243
1243
|
);
|
|
1244
|
-
const handleFocus =
|
|
1244
|
+
const handleFocus = React39.useCallback(
|
|
1245
1245
|
(event) => {
|
|
1246
1246
|
setIsOpen(true);
|
|
1247
1247
|
onFocus?.(event);
|
|
1248
1248
|
},
|
|
1249
1249
|
[onFocus]
|
|
1250
1250
|
);
|
|
1251
|
-
const handleBlur =
|
|
1251
|
+
const handleBlur = React39.useCallback(
|
|
1252
1252
|
(event) => {
|
|
1253
1253
|
const blurredText = latestText.current;
|
|
1254
1254
|
setTimeout(() => {
|
|
@@ -1259,7 +1259,7 @@ function RecentInputField({
|
|
|
1259
1259
|
},
|
|
1260
1260
|
[remember, onBlur]
|
|
1261
1261
|
);
|
|
1262
|
-
const handleSubmit =
|
|
1262
|
+
const handleSubmit = React39.useCallback(
|
|
1263
1263
|
(event) => {
|
|
1264
1264
|
remember(latestText.current);
|
|
1265
1265
|
setIsOpen(false);
|
|
@@ -1267,7 +1267,7 @@ function RecentInputField({
|
|
|
1267
1267
|
},
|
|
1268
1268
|
[remember, onSubmitEditing]
|
|
1269
1269
|
);
|
|
1270
|
-
const pick =
|
|
1270
|
+
const pick = React39.useCallback(
|
|
1271
1271
|
(picked) => {
|
|
1272
1272
|
latestText.current = picked;
|
|
1273
1273
|
onChangeText?.(picked);
|
|
@@ -1323,8 +1323,8 @@ function rowsForText(text, inputWidth, minRows) {
|
|
|
1323
1323
|
|
|
1324
1324
|
// src/FormField/useAutoGrowRows.ts
|
|
1325
1325
|
function useAutoGrowRows(text, minRows) {
|
|
1326
|
-
const [inputWidth, setInputWidth] =
|
|
1327
|
-
const onLayout =
|
|
1326
|
+
const [inputWidth, setInputWidth] = React39.useState(NARROWEST_INPUT_WIDTH);
|
|
1327
|
+
const onLayout = React39.useCallback((event) => {
|
|
1328
1328
|
setInputWidth(event.nativeEvent.layout.width);
|
|
1329
1329
|
}, []);
|
|
1330
1330
|
return { numberOfLines: rowsForText(text, inputWidth, minRows), onLayout };
|
|
@@ -1417,19 +1417,57 @@ function chipLabelLayout(labelWrap) {
|
|
|
1417
1417
|
return { boxStyle: CAPPED_BOX, textStyle: SHRINKING_TEXT, numberOfLines: SINGLE_LINE };
|
|
1418
1418
|
return { boxStyle: void 0, textStyle: void 0, numberOfLines: void 0 };
|
|
1419
1419
|
}
|
|
1420
|
+
var MIN_TARGET_PX = 44;
|
|
1421
|
+
var COMPACT_PAD_V = 4;
|
|
1422
|
+
var COMPACT_PAD_H = 10;
|
|
1423
|
+
var COMPACT_FONT_SIZE = 12;
|
|
1424
|
+
var COMPACT_LINE_HEIGHT = 18;
|
|
1425
|
+
var CHIP_BORDER = 1;
|
|
1426
|
+
var chipSizeStyles = reactNative.StyleSheet.create({
|
|
1427
|
+
compactHitBox: {
|
|
1428
|
+
minHeight: MIN_TARGET_PX,
|
|
1429
|
+
minWidth: MIN_TARGET_PX,
|
|
1430
|
+
justifyContent: "center",
|
|
1431
|
+
alignItems: "center"
|
|
1432
|
+
},
|
|
1433
|
+
compactVisual: {
|
|
1434
|
+
paddingVertical: COMPACT_PAD_V,
|
|
1435
|
+
paddingHorizontal: COMPACT_PAD_H,
|
|
1436
|
+
minHeight: 0,
|
|
1437
|
+
minWidth: 0,
|
|
1438
|
+
borderWidth: CHIP_BORDER
|
|
1439
|
+
},
|
|
1440
|
+
compactText: {
|
|
1441
|
+
fontSize: COMPACT_FONT_SIZE,
|
|
1442
|
+
fontWeight: "600",
|
|
1443
|
+
lineHeight: COMPACT_LINE_HEIGHT
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1446
|
+
|
|
1447
|
+
// src/ChipSelector/utils/chipLook.ts
|
|
1448
|
+
function chipFill({ selected, selectedFill, ink, rest }) {
|
|
1449
|
+
if (!selected || selectedFill === void 0)
|
|
1450
|
+
return { ...rest, checkColor: void 0 };
|
|
1451
|
+
return { backgroundColor: selectedFill, textColor: ink, checkColor: ink };
|
|
1452
|
+
}
|
|
1453
|
+
function chipSizeLook(size) {
|
|
1454
|
+
if (size !== "compact")
|
|
1455
|
+
return { hitBox: void 0, visual: void 0, text: void 0 };
|
|
1456
|
+
return { hitBox: chipSizeStyles.compactHitBox, visual: chipSizeStyles.compactVisual, text: chipSizeStyles.compactText };
|
|
1457
|
+
}
|
|
1420
1458
|
var SOLID_RADIUS = 20;
|
|
1421
1459
|
var OUTLINE_RADIUS = 999;
|
|
1422
1460
|
var OUTLINE_PAD_H = 12;
|
|
1423
1461
|
var OUTLINE_PAD_V = 5;
|
|
1424
1462
|
var OUTLINE_FONT_SIZE = 13;
|
|
1425
1463
|
var CHIP_ICON_GAP = 6;
|
|
1426
|
-
var
|
|
1464
|
+
var MIN_TARGET_PX2 = 44;
|
|
1427
1465
|
var chipStyles = reactNative.StyleSheet.create({
|
|
1428
1466
|
chip: {
|
|
1429
1467
|
paddingHorizontal: 12,
|
|
1430
1468
|
paddingVertical: 6,
|
|
1431
|
-
minHeight:
|
|
1432
|
-
minWidth:
|
|
1469
|
+
minHeight: MIN_TARGET_PX2,
|
|
1470
|
+
minWidth: MIN_TARGET_PX2,
|
|
1433
1471
|
justifyContent: "center",
|
|
1434
1472
|
borderRadius: SOLID_RADIUS,
|
|
1435
1473
|
backgroundColor: TRANSPARENT_COLOR,
|
|
@@ -1438,8 +1476,8 @@ var chipStyles = reactNative.StyleSheet.create({
|
|
|
1438
1476
|
chipOutline: {
|
|
1439
1477
|
paddingHorizontal: OUTLINE_PAD_H,
|
|
1440
1478
|
paddingVertical: OUTLINE_PAD_V,
|
|
1441
|
-
minHeight:
|
|
1442
|
-
minWidth:
|
|
1479
|
+
minHeight: MIN_TARGET_PX2,
|
|
1480
|
+
minWidth: MIN_TARGET_PX2,
|
|
1443
1481
|
justifyContent: "center",
|
|
1444
1482
|
borderRadius: OUTLINE_RADIUS,
|
|
1445
1483
|
borderWidth: 1
|
|
@@ -1448,22 +1486,31 @@ var chipStyles = reactNative.StyleSheet.create({
|
|
|
1448
1486
|
chipText: {},
|
|
1449
1487
|
chipTextOutline: { fontSize: OUTLINE_FONT_SIZE }
|
|
1450
1488
|
});
|
|
1451
|
-
|
|
1489
|
+
var CHECK_SIZE = 12;
|
|
1490
|
+
function ChipContent(props) {
|
|
1491
|
+
const { icon, label, textStyle, numberOfLines, checkColor } = props;
|
|
1452
1492
|
const text = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines, style: textStyle, children: label });
|
|
1453
|
-
|
|
1493
|
+
const hasIcon = icon !== void 0 && icon !== null;
|
|
1494
|
+
if (!hasIcon && checkColor === void 0)
|
|
1454
1495
|
return text;
|
|
1455
1496
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: chipStyles.chipContent, children: [
|
|
1456
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, children:
|
|
1497
|
+
checkColor === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, testID: props.checkTestID, children: /* @__PURE__ */ jsxRuntime.jsx(uiIcons.SvgIcon, { color: checkColor, name: "check", size: CHECK_SIZE }) }),
|
|
1498
|
+
hasIcon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, children: icon }) : null,
|
|
1457
1499
|
text
|
|
1458
1500
|
] });
|
|
1459
1501
|
}
|
|
1460
1502
|
function OutlineChip(props) {
|
|
1461
1503
|
const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;
|
|
1462
|
-
const [hovered, setHovered] =
|
|
1504
|
+
const [hovered, setHovered] = React39__default.default.useState(false);
|
|
1463
1505
|
const active = selected || hovered;
|
|
1464
1506
|
const borderColor = active ? colors.primary : colors.border;
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1507
|
+
const fill = chipFill({
|
|
1508
|
+
selected,
|
|
1509
|
+
selectedFill: props.selectedFill,
|
|
1510
|
+
ink: colors.textStrong,
|
|
1511
|
+
rest: { backgroundColor: selected ? colors.tint : colors.muted, textColor: active ? colors.primary : colors.textMuted }
|
|
1512
|
+
});
|
|
1513
|
+
const sized = chipSizeLook(props.size);
|
|
1467
1514
|
const layout = chipLabelLayout(option.labelWrap);
|
|
1468
1515
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1469
1516
|
reactNative.Pressable,
|
|
@@ -1477,19 +1524,21 @@ function OutlineChip(props) {
|
|
|
1477
1524
|
"aria-pressed": props.ariaPressed,
|
|
1478
1525
|
disabled,
|
|
1479
1526
|
hitSlop: CHIP_HIT_SLOP,
|
|
1480
|
-
style: layout.boxStyle,
|
|
1527
|
+
style: [sized.hitBox, layout.boxStyle],
|
|
1481
1528
|
tabIndex: props.tabIndex,
|
|
1482
1529
|
testID,
|
|
1483
1530
|
onHoverIn: () => setHovered(true),
|
|
1484
1531
|
onHoverOut: () => setHovered(false),
|
|
1485
1532
|
onPress,
|
|
1486
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chipOutline, { borderColor, backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1533
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chipOutline, sized.visual, { borderColor, backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1487
1534
|
ChipContent,
|
|
1488
1535
|
{
|
|
1536
|
+
checkColor: fill.checkColor,
|
|
1537
|
+
checkTestID: `${testID}-check`,
|
|
1489
1538
|
icon: option.icon,
|
|
1490
1539
|
label: option.label,
|
|
1491
1540
|
numberOfLines: layout.numberOfLines,
|
|
1492
|
-
textStyle: [chipStyles.chipText, chipStyles.chipTextOutline, { color: textColor }, layout.textStyle]
|
|
1541
|
+
textStyle: [chipStyles.chipText, chipStyles.chipTextOutline, sized.text, { color: fill.textColor }, layout.textStyle]
|
|
1493
1542
|
}
|
|
1494
1543
|
) })
|
|
1495
1544
|
}
|
|
@@ -1497,8 +1546,13 @@ function OutlineChip(props) {
|
|
|
1497
1546
|
}
|
|
1498
1547
|
function SolidChip(props) {
|
|
1499
1548
|
const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1549
|
+
const fill = chipFill({
|
|
1550
|
+
selected,
|
|
1551
|
+
selectedFill: props.selectedFill,
|
|
1552
|
+
ink: colors.textStrong,
|
|
1553
|
+
rest: { backgroundColor: selected ? colors.primary : TRANSPARENT_COLOR, textColor: selected ? colors.onPrimary : colors.textStrong }
|
|
1554
|
+
});
|
|
1555
|
+
const sized = chipSizeLook(props.size);
|
|
1502
1556
|
const layout = chipLabelLayout(option.labelWrap);
|
|
1503
1557
|
const rovingTabStop = { tabIndex: props.tabIndex };
|
|
1504
1558
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1513,17 +1567,19 @@ function SolidChip(props) {
|
|
|
1513
1567
|
"aria-pressed": props.ariaPressed,
|
|
1514
1568
|
disabled,
|
|
1515
1569
|
hitSlop: CHIP_HIT_SLOP,
|
|
1516
|
-
style: layout.boxStyle,
|
|
1570
|
+
style: [sized.hitBox, layout.boxStyle],
|
|
1517
1571
|
testID,
|
|
1518
1572
|
onPress,
|
|
1519
1573
|
...rovingTabStop,
|
|
1520
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chip, { borderColor: colors.border, backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1574
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chip, sized.visual, { borderColor: colors.border, backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1521
1575
|
ChipContent,
|
|
1522
1576
|
{
|
|
1577
|
+
checkColor: fill.checkColor,
|
|
1578
|
+
checkTestID: `${testID}-check`,
|
|
1523
1579
|
icon: option.icon,
|
|
1524
1580
|
label: option.label,
|
|
1525
1581
|
numberOfLines: layout.numberOfLines,
|
|
1526
|
-
textStyle: [chipStyles.chipText, { color: textColor }, layout.textStyle]
|
|
1582
|
+
textStyle: [chipStyles.chipText, sized.text, { color: fill.textColor }, layout.textStyle]
|
|
1527
1583
|
}
|
|
1528
1584
|
) })
|
|
1529
1585
|
}
|
|
@@ -1559,8 +1615,8 @@ function radioTabIndex(index, selectedIndex, disabled) {
|
|
|
1559
1615
|
var NO_GROUP_PROPS = {};
|
|
1560
1616
|
function useRadioKeyboard(config) {
|
|
1561
1617
|
const { enabled, disabled, values, selectedIndex, onChange } = config;
|
|
1562
|
-
const nodes =
|
|
1563
|
-
const chipRef =
|
|
1618
|
+
const nodes = React39__default.default.useRef([]);
|
|
1619
|
+
const chipRef = React39__default.default.useCallback((index) => (node) => {
|
|
1564
1620
|
nodes.current[index] = node;
|
|
1565
1621
|
}, []);
|
|
1566
1622
|
const onKeyDown = (event) => {
|
|
@@ -1668,12 +1724,14 @@ var ChipSelector = ({
|
|
|
1668
1724
|
testID,
|
|
1669
1725
|
chipTestIDPrefix = DEFAULT_CHIP_TESTID_PREFIX,
|
|
1670
1726
|
optionAccessibilityHint,
|
|
1671
|
-
singleSelectRole = "button"
|
|
1727
|
+
singleSelectRole = "button",
|
|
1728
|
+
size = "default",
|
|
1729
|
+
selectedFill
|
|
1672
1730
|
}) => {
|
|
1673
1731
|
const isRadioGroup = !multiple && singleSelectRole === "radio";
|
|
1674
1732
|
const { theme } = uiFeedback.useUi();
|
|
1675
1733
|
const { colors, palette } = theme;
|
|
1676
|
-
const chipColors =
|
|
1734
|
+
const chipColors = React39__default.default.useMemo(() => buildChipColors(colors, palette), [colors, palette]);
|
|
1677
1735
|
function isSelected(optionValue) {
|
|
1678
1736
|
if (multiple && Array.isArray(value))
|
|
1679
1737
|
return value.includes(optionValue);
|
|
@@ -1693,6 +1751,8 @@ var ChipSelector = ({
|
|
|
1693
1751
|
disabled,
|
|
1694
1752
|
option,
|
|
1695
1753
|
selected,
|
|
1754
|
+
size,
|
|
1755
|
+
selectedFill,
|
|
1696
1756
|
...chipIdentity(option, selected, {
|
|
1697
1757
|
prefix: chipTestIDPrefix,
|
|
1698
1758
|
hint: optionAccessibilityHint,
|
|
@@ -1730,8 +1790,95 @@ var ChipSelector = ({
|
|
|
1730
1790
|
}
|
|
1731
1791
|
);
|
|
1732
1792
|
};
|
|
1733
|
-
var
|
|
1793
|
+
var BOX_SLOT_PAD_H = 10;
|
|
1734
1794
|
var styles14 = reactNative.StyleSheet.create({
|
|
1795
|
+
row: {
|
|
1796
|
+
minWidth: a11y.MIN_TOUCH_TARGET_PX,
|
|
1797
|
+
minHeight: a11y.MIN_TOUCH_TARGET_PX,
|
|
1798
|
+
alignItems: "center",
|
|
1799
|
+
justifyContent: "center"
|
|
1800
|
+
},
|
|
1801
|
+
box: {
|
|
1802
|
+
alignSelf: "stretch",
|
|
1803
|
+
alignItems: "center",
|
|
1804
|
+
justifyContent: "center",
|
|
1805
|
+
paddingHorizontal: BOX_SLOT_PAD_H
|
|
1806
|
+
}
|
|
1807
|
+
});
|
|
1808
|
+
var SwitchSlot = ({
|
|
1809
|
+
label,
|
|
1810
|
+
value,
|
|
1811
|
+
onValueChange,
|
|
1812
|
+
disabled,
|
|
1813
|
+
testID,
|
|
1814
|
+
accessibilityHint,
|
|
1815
|
+
activeTrackColor,
|
|
1816
|
+
inBox = false
|
|
1817
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style: inBox ? styles14.box : styles14.row, testID: `${testID}-hitbox`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1818
|
+
reactNative.Switch,
|
|
1819
|
+
{
|
|
1820
|
+
accessibilityHint: accessibilityHint ?? label,
|
|
1821
|
+
accessibilityLabel: label,
|
|
1822
|
+
accessibilityState: { checked: value, disabled },
|
|
1823
|
+
disabled,
|
|
1824
|
+
testID: `${testID}-switch`,
|
|
1825
|
+
trackColor: activeTrackColor === void 0 ? void 0 : { true: activeTrackColor },
|
|
1826
|
+
value,
|
|
1827
|
+
onValueChange
|
|
1828
|
+
}
|
|
1829
|
+
) });
|
|
1830
|
+
var BOX_RADIUS = 8;
|
|
1831
|
+
var BOX_PAD_LEFT = 10;
|
|
1832
|
+
var BOX_BORDER = 1;
|
|
1833
|
+
var STATE_FONT_SIZE = 13;
|
|
1834
|
+
var styles15 = reactNative.StyleSheet.create({
|
|
1835
|
+
box: {
|
|
1836
|
+
flexDirection: "row",
|
|
1837
|
+
alignItems: "center",
|
|
1838
|
+
justifyContent: "space-between",
|
|
1839
|
+
minHeight: a11y.MIN_TOUCH_TARGET_PX,
|
|
1840
|
+
borderWidth: BOX_BORDER,
|
|
1841
|
+
borderRadius: BOX_RADIUS,
|
|
1842
|
+
paddingLeft: BOX_PAD_LEFT
|
|
1843
|
+
},
|
|
1844
|
+
state: {
|
|
1845
|
+
flex: 1,
|
|
1846
|
+
fontSize: STATE_FONT_SIZE
|
|
1847
|
+
}
|
|
1848
|
+
});
|
|
1849
|
+
var FormSwitchBox = ({
|
|
1850
|
+
stateLabel,
|
|
1851
|
+
description,
|
|
1852
|
+
containerStyle,
|
|
1853
|
+
...slot
|
|
1854
|
+
}) => {
|
|
1855
|
+
const { colors } = uiFeedback.useUi().theme;
|
|
1856
|
+
const { disabled, onValueChange, value } = slot;
|
|
1857
|
+
const toggle2 = React39__default.default.useCallback(() => {
|
|
1858
|
+
if (!disabled) onValueChange(!value);
|
|
1859
|
+
}, [disabled, onValueChange, value]);
|
|
1860
|
+
const boxColors = React39__default.default.useMemo(
|
|
1861
|
+
() => ({ borderColor: colors.border, backgroundColor: colors.surface }),
|
|
1862
|
+
[colors.border, colors.surface]
|
|
1863
|
+
);
|
|
1864
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field, { containerStyle, hint: description, label: slot.label, labelVariant: "control", children: () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1865
|
+
reactNative.Pressable,
|
|
1866
|
+
{
|
|
1867
|
+
accessible: false,
|
|
1868
|
+
disabled,
|
|
1869
|
+
style: [styles15.box, boxColors],
|
|
1870
|
+
tabIndex: -1,
|
|
1871
|
+
testID: slot.testID,
|
|
1872
|
+
onPress: toggle2,
|
|
1873
|
+
children: [
|
|
1874
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [styles15.state, { color: colors.text }], children: stateLabel ?? "" }),
|
|
1875
|
+
/* @__PURE__ */ jsxRuntime.jsx(SwitchSlot, { ...slot, inBox: true })
|
|
1876
|
+
]
|
|
1877
|
+
}
|
|
1878
|
+
) });
|
|
1879
|
+
};
|
|
1880
|
+
var DESCRIPTION_FONT_SIZE2 = 12;
|
|
1881
|
+
var styles16 = reactNative.StyleSheet.create({
|
|
1735
1882
|
container: {
|
|
1736
1883
|
flexDirection: "row",
|
|
1737
1884
|
justifyContent: "space-between",
|
|
@@ -1741,12 +1888,6 @@ var styles14 = reactNative.StyleSheet.create({
|
|
|
1741
1888
|
// `hitSlop`, so a pointer target smaller than the floor cannot be widened any other way.
|
|
1742
1889
|
minHeight: a11y.MIN_TOUCH_TARGET_PX
|
|
1743
1890
|
},
|
|
1744
|
-
switchSlot: {
|
|
1745
|
-
minWidth: a11y.MIN_TOUCH_TARGET_PX,
|
|
1746
|
-
minHeight: a11y.MIN_TOUCH_TARGET_PX,
|
|
1747
|
-
alignItems: "center",
|
|
1748
|
-
justifyContent: "center"
|
|
1749
|
-
},
|
|
1750
1891
|
textColumn: {
|
|
1751
1892
|
flex: 1
|
|
1752
1893
|
},
|
|
@@ -1758,23 +1899,24 @@ var styles14 = reactNative.StyleSheet.create({
|
|
|
1758
1899
|
marginTop: 2
|
|
1759
1900
|
}
|
|
1760
1901
|
});
|
|
1761
|
-
var
|
|
1902
|
+
var FormSwitchRow = ({
|
|
1762
1903
|
label,
|
|
1763
1904
|
value,
|
|
1764
1905
|
onValueChange,
|
|
1765
1906
|
disabled = false,
|
|
1766
1907
|
description,
|
|
1767
1908
|
containerStyle,
|
|
1768
|
-
testID
|
|
1769
|
-
accessibilityHint
|
|
1909
|
+
testID,
|
|
1910
|
+
accessibilityHint,
|
|
1911
|
+
activeTrackColor
|
|
1770
1912
|
}) => {
|
|
1771
1913
|
const { theme } = uiFeedback.useUi();
|
|
1772
|
-
const toggle2 =
|
|
1914
|
+
const toggle2 = React39__default.default.useCallback(() => {
|
|
1773
1915
|
if (!disabled) onValueChange(!value);
|
|
1774
1916
|
}, [disabled, onValueChange, value]);
|
|
1775
1917
|
const { colors } = theme;
|
|
1776
1918
|
const hasDescription = typeof description === "string" && description !== "";
|
|
1777
|
-
const themeStyles =
|
|
1919
|
+
const themeStyles = React39__default.default.useMemo(() => {
|
|
1778
1920
|
const labelStyle = { color: colors.text };
|
|
1779
1921
|
const descriptionStyle = { color: colors.textSecondary };
|
|
1780
1922
|
return { label: labelStyle, description: descriptionStyle };
|
|
@@ -1792,38 +1934,45 @@ var FormSwitch = ({
|
|
|
1792
1934
|
accessible: false,
|
|
1793
1935
|
disabled,
|
|
1794
1936
|
onPress: toggle2,
|
|
1795
|
-
style: [
|
|
1937
|
+
style: [styles16.container, containerStyle],
|
|
1796
1938
|
tabIndex: -1,
|
|
1797
1939
|
testID,
|
|
1798
1940
|
children: [
|
|
1799
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1800
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1801
|
-
hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1941
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles16.textColumn, children: [
|
|
1942
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles16.label, themeStyles.label], children: label }),
|
|
1943
|
+
hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles16.description, themeStyles.description], children: description }) : null
|
|
1802
1944
|
] }),
|
|
1803
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1804
|
-
|
|
1945
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1946
|
+
SwitchSlot,
|
|
1805
1947
|
{
|
|
1806
|
-
accessibilityHint
|
|
1807
|
-
|
|
1808
|
-
accessibilityState: { checked: value, disabled },
|
|
1948
|
+
accessibilityHint,
|
|
1949
|
+
activeTrackColor,
|
|
1809
1950
|
disabled,
|
|
1810
|
-
|
|
1951
|
+
label,
|
|
1952
|
+
testID,
|
|
1811
1953
|
value,
|
|
1812
1954
|
onValueChange
|
|
1813
1955
|
}
|
|
1814
|
-
)
|
|
1956
|
+
)
|
|
1815
1957
|
]
|
|
1816
1958
|
}
|
|
1817
1959
|
)
|
|
1818
1960
|
);
|
|
1819
1961
|
};
|
|
1962
|
+
var FormSwitch = ({
|
|
1963
|
+
variant = "row",
|
|
1964
|
+
stateLabel,
|
|
1965
|
+
testID = "form-switch",
|
|
1966
|
+
disabled = false,
|
|
1967
|
+
...props
|
|
1968
|
+
}) => variant === "box" ? /* @__PURE__ */ jsxRuntime.jsx(FormSwitchBox, { ...props, disabled, stateLabel, testID }) : /* @__PURE__ */ jsxRuntime.jsx(FormSwitchRow, { ...props, disabled, testID });
|
|
1820
1969
|
|
|
1821
1970
|
// src/FormCheckbox/checkboxColors.ts
|
|
1822
1971
|
var checkboxBoxColors = (colors, brand, checked) => checked ? { backgroundColor: brand, borderColor: brand } : { backgroundColor: "transparent", borderColor: colors.textSecondary };
|
|
1823
1972
|
var ACTIVATION_KEYS = ["Enter", " ", "Spacebar"];
|
|
1824
1973
|
var HINT_FONT_SIZE2 = 12;
|
|
1825
1974
|
var BOX_SIZE = 20;
|
|
1826
|
-
var
|
|
1975
|
+
var BOX_RADIUS2 = 5;
|
|
1827
1976
|
var TICK_WIDTH = 6;
|
|
1828
1977
|
var TICK_HEIGHT = 10;
|
|
1829
1978
|
var TICK_STROKE = 2;
|
|
@@ -1832,7 +1981,7 @@ var DISABLED_OPACITY = 0.5;
|
|
|
1832
1981
|
var FOCUS_RING_WIDTH = 2;
|
|
1833
1982
|
var WEB_NO_DEFAULT_OUTLINE = { outlineStyle: "none" };
|
|
1834
1983
|
var FOCUS_RING_INSET = -6;
|
|
1835
|
-
var
|
|
1984
|
+
var styles17 = reactNative.StyleSheet.create({
|
|
1836
1985
|
container: {
|
|
1837
1986
|
flexDirection: "row",
|
|
1838
1987
|
alignItems: "flex-start",
|
|
@@ -1849,7 +1998,7 @@ var styles15 = reactNative.StyleSheet.create({
|
|
|
1849
1998
|
box: {
|
|
1850
1999
|
width: BOX_SIZE,
|
|
1851
2000
|
height: BOX_SIZE,
|
|
1852
|
-
borderRadius:
|
|
2001
|
+
borderRadius: BOX_RADIUS2,
|
|
1853
2002
|
borderWidth: 2,
|
|
1854
2003
|
alignItems: "center",
|
|
1855
2004
|
justifyContent: "center",
|
|
@@ -1863,7 +2012,7 @@ var styles15 = reactNative.StyleSheet.create({
|
|
|
1863
2012
|
right: FOCUS_RING_INSET,
|
|
1864
2013
|
bottom: FOCUS_RING_INSET,
|
|
1865
2014
|
borderWidth: FOCUS_RING_WIDTH,
|
|
1866
|
-
borderRadius:
|
|
2015
|
+
borderRadius: BOX_RADIUS2 - FOCUS_RING_INSET
|
|
1867
2016
|
},
|
|
1868
2017
|
tick: {
|
|
1869
2018
|
width: TICK_WIDTH,
|
|
@@ -1903,8 +2052,8 @@ var FormCheckbox = ({
|
|
|
1903
2052
|
const hintText = typeof hint === "string" && hint !== "" ? hint : description;
|
|
1904
2053
|
const hasHint = typeof hintText === "string" && hintText !== "";
|
|
1905
2054
|
const { hintId } = useFieldIds();
|
|
1906
|
-
const [focused, setFocused] =
|
|
1907
|
-
const themeStyles =
|
|
2055
|
+
const [focused, setFocused] = React39__default.default.useState(false);
|
|
2056
|
+
const themeStyles = React39__default.default.useMemo(() => {
|
|
1908
2057
|
const boxOn = checkboxBoxColors(colors, brand, true);
|
|
1909
2058
|
const boxOff = checkboxBoxColors(colors, brand, false);
|
|
1910
2059
|
const ring = { borderColor: brand };
|
|
@@ -1940,8 +2089,8 @@ var FormCheckbox = ({
|
|
|
1940
2089
|
onPress: toggle2,
|
|
1941
2090
|
role: "checkbox",
|
|
1942
2091
|
style: [
|
|
1943
|
-
|
|
1944
|
-
hasHint ? null :
|
|
2092
|
+
styles17.container,
|
|
2093
|
+
hasHint ? null : styles17.centered,
|
|
1945
2094
|
containerStyle,
|
|
1946
2095
|
disabled ? { opacity: DISABLED_OPACITY } : null,
|
|
1947
2096
|
reactNative.Platform.OS === "web" ? WEB_NO_DEFAULT_OUTLINE : null
|
|
@@ -1949,13 +2098,13 @@ var FormCheckbox = ({
|
|
|
1949
2098
|
testID,
|
|
1950
2099
|
...keyboardProps,
|
|
1951
2100
|
children: [
|
|
1952
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
1953
|
-
focused ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style: [
|
|
1954
|
-
value ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityElementsHidden: true, pointerEvents: "none", style: [
|
|
2101
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles17.box, value ? themeStyles.boxOn : themeStyles.boxOff], testID: `${testID}-box`, children: [
|
|
2102
|
+
focused ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style: [styles17.focusRing, themeStyles.ring], testID: `${testID}-focus-ring` }) : null,
|
|
2103
|
+
value ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityElementsHidden: true, pointerEvents: "none", style: [styles17.tick, { borderColor: colors.surface }], testID: `${testID}-tick` }) : null
|
|
1955
2104
|
] }),
|
|
1956
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1957
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1958
|
-
hasHint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { nativeID: hintId, style: [
|
|
2105
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles17.textColumn, children: [
|
|
2106
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles17.label, themeStyles.label], children: label }),
|
|
2107
|
+
hasHint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { nativeID: hintId, style: [styles17.hint, themeStyles.hint], children: hintText }) : null
|
|
1959
2108
|
] })
|
|
1960
2109
|
]
|
|
1961
2110
|
}
|
|
@@ -2029,9 +2178,9 @@ function nextHighlight(current, count, delta) {
|
|
|
2029
2178
|
var FORWARD = 1;
|
|
2030
2179
|
var BACKWARD = -1;
|
|
2031
2180
|
function useSelectListbox({ options, isOpen, open, toggle: toggle2, select }) {
|
|
2032
|
-
const [row, setRow] =
|
|
2181
|
+
const [row, setRow] = React39.useState(NO_HIGHLIGHT);
|
|
2033
2182
|
const highlighted = isOpen ? options[row] : void 0;
|
|
2034
|
-
|
|
2183
|
+
React39.useEffect(() => {
|
|
2035
2184
|
if (!isOpen) setRow(NO_HIGHLIGHT);
|
|
2036
2185
|
}, [isOpen]);
|
|
2037
2186
|
const onKeyDown = (event) => {
|
|
@@ -2076,22 +2225,22 @@ function MenuSelectControl({
|
|
|
2076
2225
|
}) {
|
|
2077
2226
|
const { theme } = uiFeedback.useUi();
|
|
2078
2227
|
const { colors, palette } = theme;
|
|
2079
|
-
const anchorRef =
|
|
2080
|
-
const [isOpen, setIsOpen] =
|
|
2081
|
-
const selectedLabel =
|
|
2228
|
+
const anchorRef = React39.useRef(null);
|
|
2229
|
+
const [isOpen, setIsOpen] = React39.useState(false);
|
|
2230
|
+
const selectedLabel = React39.useMemo(() => {
|
|
2082
2231
|
const found = options.find((o) => o.value === value);
|
|
2083
2232
|
return found?.label ?? placeholder;
|
|
2084
2233
|
}, [options, placeholder, value]);
|
|
2085
|
-
const close =
|
|
2234
|
+
const close = React39.useCallback(() => {
|
|
2086
2235
|
setIsOpen(false);
|
|
2087
2236
|
}, []);
|
|
2088
|
-
const open =
|
|
2237
|
+
const open = React39.useCallback(() => {
|
|
2089
2238
|
setIsOpen(true);
|
|
2090
2239
|
}, []);
|
|
2091
|
-
const toggle2 =
|
|
2240
|
+
const toggle2 = React39.useCallback(() => {
|
|
2092
2241
|
setIsOpen((prev) => !prev);
|
|
2093
2242
|
}, []);
|
|
2094
|
-
const select =
|
|
2243
|
+
const select = React39.useCallback(
|
|
2095
2244
|
(next) => {
|
|
2096
2245
|
onChange(next);
|
|
2097
2246
|
setIsOpen(false);
|
|
@@ -2171,7 +2320,7 @@ var CHIP_PAD_H = 8;
|
|
|
2171
2320
|
var CHIP_PAD_V = 4;
|
|
2172
2321
|
var CHIP_RADIUS = 999;
|
|
2173
2322
|
var CHIP_FONT = 13;
|
|
2174
|
-
var
|
|
2323
|
+
var styles18 = reactNative.StyleSheet.create({
|
|
2175
2324
|
chip: {
|
|
2176
2325
|
flexDirection: "row",
|
|
2177
2326
|
alignItems: "center",
|
|
@@ -2192,12 +2341,12 @@ function SelectedChip({ option, colors, removeLabel, removeHint, onRemove, testI
|
|
|
2192
2341
|
accessibilityLabel: removeLabel,
|
|
2193
2342
|
accessibilityRole: "button",
|
|
2194
2343
|
hitSlop: CHIP_HIT_SLOP,
|
|
2195
|
-
style: [
|
|
2344
|
+
style: [styles18.chip, { borderColor: colors.border, backgroundColor: colors.surface }],
|
|
2196
2345
|
testID,
|
|
2197
2346
|
onPress: () => onRemove(option.value),
|
|
2198
2347
|
children: [
|
|
2199
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [
|
|
2200
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-hidden": true, style: [
|
|
2348
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [styles18.text, { color: colors.text }], children: option.label }),
|
|
2349
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-hidden": true, style: [styles18.text, { color: colors.text }], children: REMOVE_GLYPH })
|
|
2201
2350
|
]
|
|
2202
2351
|
}
|
|
2203
2352
|
);
|
|
@@ -2220,7 +2369,7 @@ var CHEVRON_DOWN2 = "\u25BE";
|
|
|
2220
2369
|
var CHEVRON_UP2 = "\u25B4";
|
|
2221
2370
|
var BOX_GAP = 6;
|
|
2222
2371
|
var TRIGGER_MIN_WIDTH = 96;
|
|
2223
|
-
var
|
|
2372
|
+
var styles19 = reactNative.StyleSheet.create({
|
|
2224
2373
|
box: { flexWrap: "wrap", justifyContent: "flex-start", gap: BOX_GAP },
|
|
2225
2374
|
trigger: {
|
|
2226
2375
|
flexGrow: 1,
|
|
@@ -2234,27 +2383,27 @@ var styles17 = reactNative.StyleSheet.create({
|
|
|
2234
2383
|
function MultiSelectBox(props) {
|
|
2235
2384
|
const { label, accessibilityHint, values, options, onChange, placeholder, chipLabels, testID, labelId } = props;
|
|
2236
2385
|
const { colors, palette } = uiFeedback.useUi().theme;
|
|
2237
|
-
const anchorRef =
|
|
2238
|
-
const [isOpen, setIsOpen] =
|
|
2386
|
+
const anchorRef = React39.useRef(null);
|
|
2387
|
+
const [isOpen, setIsOpen] = React39.useState(false);
|
|
2239
2388
|
const chosen = selectedOptions(options, values);
|
|
2240
2389
|
const remaining = remainingOptions(options, values);
|
|
2241
|
-
const close =
|
|
2390
|
+
const close = React39.useCallback(() => {
|
|
2242
2391
|
setIsOpen(false);
|
|
2243
2392
|
}, []);
|
|
2244
|
-
const toggle2 =
|
|
2393
|
+
const toggle2 = React39.useCallback(() => {
|
|
2245
2394
|
setIsOpen((prev) => !prev);
|
|
2246
2395
|
}, []);
|
|
2247
|
-
const add =
|
|
2396
|
+
const add = React39.useCallback((next) => {
|
|
2248
2397
|
onChange(addValue(values, next));
|
|
2249
2398
|
setIsOpen(false);
|
|
2250
2399
|
}, [onChange, values]);
|
|
2251
|
-
const remove =
|
|
2400
|
+
const remove = React39.useCallback((value) => {
|
|
2252
2401
|
onChange(removeValue(values, value));
|
|
2253
2402
|
}, [onChange, values]);
|
|
2254
2403
|
const chipColors = { text: colors.text, border: colors.border, surface: colors.surface };
|
|
2255
2404
|
const summary = chosen.map((option) => option.label).join(", ");
|
|
2256
2405
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: anchorRef, style: controlStyles.anchor, children: [
|
|
2257
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [controlStyles.selectTrigger,
|
|
2406
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [controlStyles.selectTrigger, styles19.box, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }], testID: `${testID}-box`, children: [
|
|
2258
2407
|
chosen.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2259
2408
|
SelectedChip,
|
|
2260
2409
|
{
|
|
@@ -2278,7 +2427,7 @@ function MultiSelectBox(props) {
|
|
|
2278
2427
|
"aria-haspopup": "menu",
|
|
2279
2428
|
"aria-labelledby": labelId,
|
|
2280
2429
|
disabled: remaining.length === 0,
|
|
2281
|
-
style:
|
|
2430
|
+
style: styles19.trigger,
|
|
2282
2431
|
testID: `${testID}-trigger`,
|
|
2283
2432
|
onPress: toggle2,
|
|
2284
2433
|
children: [
|
|
@@ -2306,17 +2455,17 @@ function MultiSelectBox(props) {
|
|
|
2306
2455
|
var MultiSelectField = ({ labelVariant, hint, error, ...boxProps }) => /* @__PURE__ */ jsxRuntime.jsx(Field, { error, hint, label: boxProps.label, labelVariant, children: ({ labelId }) => /* @__PURE__ */ jsxRuntime.jsx(MultiSelectBox, { ...boxProps, labelId }) });
|
|
2307
2456
|
var CLOSE_DELAY_MS2 = 140;
|
|
2308
2457
|
function useDelayedBlurClose(open, close) {
|
|
2309
|
-
const timerRef =
|
|
2310
|
-
const cancelClose =
|
|
2458
|
+
const timerRef = React39.useRef(null);
|
|
2459
|
+
const cancelClose = React39.useCallback(() => {
|
|
2311
2460
|
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
2312
2461
|
timerRef.current = null;
|
|
2313
2462
|
}, []);
|
|
2314
|
-
|
|
2315
|
-
const handleFocus =
|
|
2463
|
+
React39.useEffect(() => cancelClose, [cancelClose]);
|
|
2464
|
+
const handleFocus = React39.useCallback(() => {
|
|
2316
2465
|
cancelClose();
|
|
2317
2466
|
open();
|
|
2318
2467
|
}, [cancelClose, open]);
|
|
2319
|
-
const handleBlur =
|
|
2468
|
+
const handleBlur = React39.useCallback(() => {
|
|
2320
2469
|
cancelClose();
|
|
2321
2470
|
timerRef.current = setTimeout(close, CLOSE_DELAY_MS2);
|
|
2322
2471
|
}, [cancelClose, close]);
|
|
@@ -2359,10 +2508,10 @@ function isUnmatched(options, text) {
|
|
|
2359
2508
|
var DEFAULT_TYPEAHEAD_DEBOUNCE_MS = 250;
|
|
2360
2509
|
var IDLE = { results: [], isLoading: false, hasFailed: false, hasSettled: false };
|
|
2361
2510
|
function useTypeaheadSearch(load, query, enabled, debounceMs) {
|
|
2362
|
-
const [state, setState] =
|
|
2363
|
-
const loadRef =
|
|
2511
|
+
const [state, setState] = React39.useState(IDLE);
|
|
2512
|
+
const loadRef = React39.useRef(load);
|
|
2364
2513
|
loadRef.current = load;
|
|
2365
|
-
|
|
2514
|
+
React39.useEffect(() => {
|
|
2366
2515
|
if (!enabled) {
|
|
2367
2516
|
setState(IDLE);
|
|
2368
2517
|
return void 0;
|
|
@@ -2401,30 +2550,30 @@ function useTypeaheadRows(input, isOpen, isPicked) {
|
|
|
2401
2550
|
const query = value.trim();
|
|
2402
2551
|
const isSearching = search !== void 0 && isOpen && !isPicked && query.length >= minChars;
|
|
2403
2552
|
const found = useTypeaheadSearch(search?.load, query, isSearching, search?.debounceMs ?? DEFAULT_TYPEAHEAD_DEBOUNCE_MS);
|
|
2404
|
-
const staticRows =
|
|
2553
|
+
const staticRows = React39.useMemo(() => {
|
|
2405
2554
|
if (options === void 0 || options.some((o) => o.label === value)) return NO_ROWS;
|
|
2406
2555
|
return suggestOptions(options, value, minChars, maxSuggestions);
|
|
2407
2556
|
}, [options, value, minChars, maxSuggestions]);
|
|
2408
|
-
const foundRows =
|
|
2557
|
+
const foundRows = React39.useMemo(() => found.results.slice(0, maxSuggestions), [found.results, maxSuggestions]);
|
|
2409
2558
|
if (search === void 0) return { rows: staticRows, statusText: void 0 };
|
|
2410
2559
|
return { rows: foundRows, statusText: searchStatusText(found, search) };
|
|
2411
2560
|
}
|
|
2412
2561
|
function useTypeaheadState(input) {
|
|
2413
2562
|
const { search, value, onChange, onSubmit } = input;
|
|
2414
|
-
const [isOpen, setIsOpen] =
|
|
2415
|
-
const [picked, setPicked] =
|
|
2416
|
-
const [highlightIndex, setHighlightIndex] =
|
|
2563
|
+
const [isOpen, setIsOpen] = React39.useState(false);
|
|
2564
|
+
const [picked, setPicked] = React39.useState(null);
|
|
2565
|
+
const [highlightIndex, setHighlightIndex] = React39.useState(NO_HIGHLIGHT);
|
|
2417
2566
|
const { rows, statusText } = useTypeaheadRows(input, isOpen, picked !== null && picked.label === value);
|
|
2418
2567
|
const rowKey = rows.map((row) => row.value).join("\n");
|
|
2419
2568
|
const highlighted = isOpen ? rows[highlightIndex] : void 0;
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
const open =
|
|
2423
|
-
const close =
|
|
2569
|
+
React39.useEffect(() => setHighlightIndex(NO_HIGHLIGHT), [rowKey]);
|
|
2570
|
+
React39.useEffect(() => setPicked((current) => current !== null && current.label !== value ? null : current), [value]);
|
|
2571
|
+
const open = React39.useCallback(() => setIsOpen(true), []);
|
|
2572
|
+
const close = React39.useCallback(() => {
|
|
2424
2573
|
setIsOpen(false);
|
|
2425
2574
|
setHighlightIndex(NO_HIGHLIGHT);
|
|
2426
2575
|
}, []);
|
|
2427
|
-
const pick =
|
|
2576
|
+
const pick = React39.useCallback(
|
|
2428
2577
|
(option) => {
|
|
2429
2578
|
setPicked(option);
|
|
2430
2579
|
onChange(option.label);
|
|
@@ -2433,14 +2582,14 @@ function useTypeaheadState(input) {
|
|
|
2433
2582
|
},
|
|
2434
2583
|
[onChange, search, close]
|
|
2435
2584
|
);
|
|
2436
|
-
const selectValue =
|
|
2585
|
+
const selectValue = React39.useCallback(
|
|
2437
2586
|
(optionValue) => {
|
|
2438
2587
|
const option = rows.find((row) => row.value === optionValue);
|
|
2439
2588
|
if (option !== void 0) pick(option);
|
|
2440
2589
|
},
|
|
2441
2590
|
[rows, pick]
|
|
2442
2591
|
);
|
|
2443
|
-
const handleChange =
|
|
2592
|
+
const handleChange = React39.useCallback(
|
|
2444
2593
|
(next) => {
|
|
2445
2594
|
if (picked !== null) {
|
|
2446
2595
|
setPicked(null);
|
|
@@ -2453,7 +2602,7 @@ function useTypeaheadState(input) {
|
|
|
2453
2602
|
[picked, search, onChange]
|
|
2454
2603
|
);
|
|
2455
2604
|
const handleKeyPress = useTypeaheadKeys({ rowCount: rows.length, isOpen, highlighted, setIsOpen, setHighlightIndex, close, pick });
|
|
2456
|
-
const handleSubmit =
|
|
2605
|
+
const handleSubmit = React39.useCallback(() => {
|
|
2457
2606
|
if (highlighted !== void 0) {
|
|
2458
2607
|
pick(highlighted);
|
|
2459
2608
|
return;
|
|
@@ -2465,7 +2614,7 @@ function useTypeaheadState(input) {
|
|
|
2465
2614
|
}
|
|
2466
2615
|
function useTypeaheadKeys(input) {
|
|
2467
2616
|
const { rowCount, isOpen, highlighted, setIsOpen, setHighlightIndex, close, pick } = input;
|
|
2468
|
-
return
|
|
2617
|
+
return React39.useCallback(
|
|
2469
2618
|
(event) => {
|
|
2470
2619
|
const { key } = event.nativeEvent;
|
|
2471
2620
|
if (key === "ArrowDown" || key === "ArrowUp") {
|
|
@@ -2502,7 +2651,7 @@ function TypeaheadControlImpl(props, ref) {
|
|
|
2502
2651
|
const maxSuggestions = ("search" in props ? props.search.maxResults : props.maxSuggestions) ?? DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS;
|
|
2503
2652
|
const { theme } = uiFeedback.useUi();
|
|
2504
2653
|
const { colors, palette } = theme;
|
|
2505
|
-
const anchorRef =
|
|
2654
|
+
const anchorRef = React39.useRef(null);
|
|
2506
2655
|
const state = useTypeaheadState({ options, search, value, minChars, maxSuggestions, onChange, onSubmit });
|
|
2507
2656
|
const { handleFocus, handleBlur } = useDelayedBlurClose(state.open, state.close);
|
|
2508
2657
|
const showMenu = state.isOpen && (state.rows.length > 0 || state.statusText !== void 0);
|
|
@@ -2555,7 +2704,7 @@ function TypeaheadControlImpl(props, ref) {
|
|
|
2555
2704
|
hasError ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [controlStyles.error, { color: fieldErrorInk(theme) }], testID: `${testID}-error`, children: error }) : null
|
|
2556
2705
|
] });
|
|
2557
2706
|
}
|
|
2558
|
-
var TypeaheadControl =
|
|
2707
|
+
var TypeaheadControl = React39.forwardRef(TypeaheadControlImpl);
|
|
2559
2708
|
var NATIVE_INPUT_BOX = {
|
|
2560
2709
|
borderStyle: "solid",
|
|
2561
2710
|
boxSizing: "border-box",
|
|
@@ -2643,7 +2792,7 @@ function tabStops(container) {
|
|
|
2643
2792
|
}
|
|
2644
2793
|
function PickerDialog({ testID, sheet, onDismiss, children }) {
|
|
2645
2794
|
const colors = usePickerColors();
|
|
2646
|
-
const ref =
|
|
2795
|
+
const ref = React39.useRef(null);
|
|
2647
2796
|
const onKeyDown = (event) => {
|
|
2648
2797
|
if (event.key === "Escape") {
|
|
2649
2798
|
event.preventDefault();
|
|
@@ -2666,8 +2815,8 @@ function PickerDialog({ testID, sheet, onDismiss, children }) {
|
|
|
2666
2815
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-testid": testID, "data-variant": sheet ? "sheet" : "popover", style, onKeyDown, children });
|
|
2667
2816
|
}
|
|
2668
2817
|
function useAnchorRect2(anchorRef) {
|
|
2669
|
-
const [rect2, setRect] =
|
|
2670
|
-
|
|
2818
|
+
const [rect2, setRect] = React39.useState(null);
|
|
2819
|
+
React39.useEffect(() => {
|
|
2671
2820
|
anchorRef.current?.measureInWindow((x, y, width, height) => setRect({ x, y, width, height }));
|
|
2672
2821
|
}, [anchorRef]);
|
|
2673
2822
|
return rect2;
|
|
@@ -2710,32 +2859,32 @@ function fitDropdownWidth(frame, viewportWidth, minWidth = MIN_PANEL_WIDTH) {
|
|
|
2710
2859
|
function DropdownSurface({ progress, translateY, anchorRef, onDismiss, closeLabel, closeHint, testID, children, minWidth, scale, accessibilityLabel, preferBelow = false }) {
|
|
2711
2860
|
const { height: viewportHeight, width: viewportWidth } = reactNative.useWindowDimensions();
|
|
2712
2861
|
const anchor = useAnchorRect2(anchorRef);
|
|
2713
|
-
const [panelHeight, setPanelHeight] =
|
|
2714
|
-
const onLayout =
|
|
2862
|
+
const [panelHeight, setPanelHeight] = React39.useState(0);
|
|
2863
|
+
const onLayout = React39.useCallback((event) => setPanelHeight(event.nativeEvent.layout.height), []);
|
|
2715
2864
|
const frame = anchor === null ? null : fitDropdownWidth(dropdownFrame(anchor, panelHeight, viewportHeight, preferBelow), viewportWidth, minWidth);
|
|
2716
2865
|
const place = frame === null ? null : { left: frame.left, width: frame.width, top: frame.top, bottom: frame.bottom };
|
|
2717
2866
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Modal, { transparent: true, visible: true, animationType: "none", "aria-label": accessibilityLabel, onRequestClose: onDismiss, children: [
|
|
2718
2867
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { accessibilityHint: closeHint, accessibilityLabel: closeLabel, accessibilityRole: "button", style: reactNative.StyleSheet.absoluteFill, testID: `${testID}-backdrop`, onPress: onDismiss }),
|
|
2719
|
-
frame !== null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: [
|
|
2868
|
+
frame !== null ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: [styles20.dropdown, place, { opacity: progress, transform: scale === void 0 ? [{ translateY }] : [{ translateY }, { scale }] }, scale === void 0 ? null : styles20.growFromField], testID: `${testID}-dropdown-${frame.placement}`, onLayout, children }) : null
|
|
2720
2869
|
] });
|
|
2721
2870
|
}
|
|
2722
|
-
var
|
|
2871
|
+
var styles20 = reactNative.StyleSheet.create({
|
|
2723
2872
|
dropdown: { position: "absolute" },
|
|
2724
2873
|
growFromField: { transformOrigin: "top left" }
|
|
2725
2874
|
});
|
|
2726
2875
|
function SheetSurface({ translateY, onDismiss, closeLabel, closeHint, testID, children, progress, scale, accessibilityLabel }) {
|
|
2727
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Modal, { transparent: true, visible: true, animationType: "none", "aria-label": accessibilityLabel, onRequestClose: onDismiss, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
2876
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Modal, { transparent: true, visible: true, animationType: "none", "aria-label": accessibilityLabel, onRequestClose: onDismiss, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles21.backdrop, children: [
|
|
2728
2877
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { accessibilityHint: closeHint, accessibilityLabel: closeLabel, accessibilityRole: "button", style: reactNative.StyleSheet.absoluteFill, testID: `${testID}-backdrop`, onPress: onDismiss }),
|
|
2729
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { testID: `${testID}-sheet`, style: [
|
|
2878
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { testID: `${testID}-sheet`, style: [styles21.sheet, { transform: scale === void 0 ? [{ translateY }] : [{ translateY }, { scale }] }, progress === void 0 ? null : { opacity: progress }], children })
|
|
2730
2879
|
] }) });
|
|
2731
2880
|
}
|
|
2732
|
-
var
|
|
2881
|
+
var styles21 = reactNative.StyleSheet.create({
|
|
2733
2882
|
backdrop: { flex: 1, justifyContent: "flex-end" },
|
|
2734
2883
|
sheet: { width: "100%", alignSelf: "stretch" }
|
|
2735
2884
|
});
|
|
2736
2885
|
function useReducedMotion() {
|
|
2737
|
-
const [reduced, setReduced] =
|
|
2738
|
-
|
|
2886
|
+
const [reduced, setReduced] = React39.useState(false);
|
|
2887
|
+
React39.useEffect(() => {
|
|
2739
2888
|
let active = true;
|
|
2740
2889
|
reactNative.AccessibilityInfo.isReduceMotionEnabled().then((value) => {
|
|
2741
2890
|
if (active) setReduced(value);
|
|
@@ -2946,14 +3095,14 @@ function weekFirstDay(locale) {
|
|
|
2946
3095
|
return MONDAY3;
|
|
2947
3096
|
}
|
|
2948
3097
|
}
|
|
2949
|
-
var DatePickerContext =
|
|
3098
|
+
var DatePickerContext = React39.createContext({ labels: DEFAULT_DATE_PICKER_LABELS });
|
|
2950
3099
|
function DatePickerProvider({ labels, locale, today, display, children }) {
|
|
2951
|
-
const value =
|
|
3100
|
+
const value = React39.useMemo(() => ({ labels: { ...DEFAULT_DATE_PICKER_LABELS, ...labels }, locale, today, display }), [labels, locale, today, display]);
|
|
2952
3101
|
return /* @__PURE__ */ jsxRuntime.jsx(DatePickerContext.Provider, { value, children });
|
|
2953
3102
|
}
|
|
2954
3103
|
function useDatePickerConfig() {
|
|
2955
|
-
const config =
|
|
2956
|
-
const firstDay =
|
|
3104
|
+
const config = React39.useContext(DatePickerContext);
|
|
3105
|
+
const firstDay = React39.useMemo(() => weekFirstDay(config.locale), [config.locale]);
|
|
2957
3106
|
return { labels: config.labels, locale: config.locale, today: config.today ?? todayIso(), firstDay, display: config.display ?? "long" /* Long */ };
|
|
2958
3107
|
}
|
|
2959
3108
|
|
|
@@ -2976,8 +3125,8 @@ function monthSlideStyle(entered, reduced, direction) {
|
|
|
2976
3125
|
}
|
|
2977
3126
|
function useOpenProgress() {
|
|
2978
3127
|
const { durationMs, fromScale } = resolveOpenMotion(useReducedMotion());
|
|
2979
|
-
const progress =
|
|
2980
|
-
|
|
3128
|
+
const progress = React39.useRef(new reactNative.Animated.Value(0)).current;
|
|
3129
|
+
React39.useEffect(() => {
|
|
2981
3130
|
reactNative.Animated.timing(progress, { toValue: 1, duration: durationMs, useNativeDriver: false }).start();
|
|
2982
3131
|
}, [progress, durationMs]);
|
|
2983
3132
|
return {
|
|
@@ -3023,16 +3172,16 @@ function dayDomId(testID, iso) {
|
|
|
3023
3172
|
}
|
|
3024
3173
|
function useGridFocus(initial, bounds, testID, onPick) {
|
|
3025
3174
|
const { firstDay } = useDatePickerConfig();
|
|
3026
|
-
const [focusedDay, setFocusedDay] =
|
|
3027
|
-
const focusPending =
|
|
3175
|
+
const [focusedDay, setFocusedDay] = React39.useState(initial);
|
|
3176
|
+
const focusPending = React39.useRef(true);
|
|
3028
3177
|
const { min, max } = bounds;
|
|
3029
|
-
|
|
3178
|
+
React39.useEffect(() => {
|
|
3030
3179
|
if (!focusPending.current) return;
|
|
3031
3180
|
focusPending.current = false;
|
|
3032
3181
|
document.getElementById(dayDomId(testID, focusedDay))?.focus();
|
|
3033
3182
|
}, [focusedDay, testID]);
|
|
3034
|
-
const moveTo =
|
|
3035
|
-
const onDayKey =
|
|
3183
|
+
const moveTo = React39.useCallback((iso) => setFocusedDay(clampToBounds(iso, min, max)), [min, max]);
|
|
3184
|
+
const onDayKey = React39.useCallback(
|
|
3036
3185
|
(event, iso) => {
|
|
3037
3186
|
if (event.key === "Enter" || event.key === " ") {
|
|
3038
3187
|
event.preventDefault();
|
|
@@ -3119,8 +3268,8 @@ function MonthGrid({ month, selection: selection2, focusedDay, bounds, testID, o
|
|
|
3119
3268
|
const { labels, locale, today, firstDay } = useDatePickerConfig();
|
|
3120
3269
|
const colors = usePickerColors();
|
|
3121
3270
|
const parts = parseIso(month) ?? FALLBACK;
|
|
3122
|
-
const weeks =
|
|
3123
|
-
const weekdays =
|
|
3271
|
+
const weeks = React39.useMemo(() => buildMonthGrid(parts.year, parts.month, firstDay), [parts.year, parts.month, firstDay]);
|
|
3272
|
+
const weekdays = React39.useMemo(() => weekdayNames(locale, firstDay), [locale, firstDay]);
|
|
3124
3273
|
const title = formatMonthYear(month, locale);
|
|
3125
3274
|
const end = selection2.to === "" ? selection2.from : selection2.to;
|
|
3126
3275
|
const stateOf = (iso) => ({
|
|
@@ -3159,7 +3308,7 @@ function MonthHeader({ focusedDay, bounds, testID, onMove }) {
|
|
|
3159
3308
|
const { labels, locale } = useDatePickerConfig();
|
|
3160
3309
|
const colors = usePickerColors();
|
|
3161
3310
|
const parts = parseIso(focusedDay) ?? FALLBACK2;
|
|
3162
|
-
const names =
|
|
3311
|
+
const names = React39.useMemo(() => monthNames(locale), [locale]);
|
|
3163
3312
|
const setMonthYear = (year, month) => onMove(toIso({ year, month, day: Math.min(parts.day, daysInMonth(year, month)) }));
|
|
3164
3313
|
const selectStyle = { minHeight: a11y.MIN_TOUCH_TARGET_PX, border: "none", background: "transparent", color: colors.text, fontWeight: BOLD3, fontSize: FONT2, fontFamily: "inherit", cursor: "pointer" };
|
|
3165
3314
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
@@ -3180,8 +3329,8 @@ function PickerFooter({ summary, children }) {
|
|
|
3180
3329
|
] });
|
|
3181
3330
|
}
|
|
3182
3331
|
function useEntered(key, reduced) {
|
|
3183
|
-
const [enteredKey, setEnteredKey] =
|
|
3184
|
-
|
|
3332
|
+
const [enteredKey, setEnteredKey] = React39.useState(null);
|
|
3333
|
+
React39.useEffect(() => {
|
|
3185
3334
|
if (reduced) return void 0;
|
|
3186
3335
|
let inner = 0;
|
|
3187
3336
|
const outer = requestAnimationFrame(() => {
|
|
@@ -3196,8 +3345,8 @@ function useEntered(key, reduced) {
|
|
|
3196
3345
|
}
|
|
3197
3346
|
function useMonthSlide(month) {
|
|
3198
3347
|
const reduced = useReducedMotion();
|
|
3199
|
-
const previous =
|
|
3200
|
-
const direction =
|
|
3348
|
+
const previous = React39.useRef(month);
|
|
3349
|
+
const direction = React39.useRef(0);
|
|
3201
3350
|
if (previous.current !== month) {
|
|
3202
3351
|
direction.current = month > previous.current ? 1 : -1;
|
|
3203
3352
|
previous.current = month;
|
|
@@ -3207,7 +3356,7 @@ function useMonthSlide(month) {
|
|
|
3207
3356
|
}
|
|
3208
3357
|
function SingleCalendar({ value, bounds, testID, onCommit }) {
|
|
3209
3358
|
const { labels, today } = useDatePickerConfig();
|
|
3210
|
-
const [draft, setDraft] =
|
|
3359
|
+
const [draft, setDraft] = React39.useState(value);
|
|
3211
3360
|
const grid = useGridFocus(clampToBounds(value !== "" ? value : today, bounds.min, bounds.max), bounds, testID, setDraft);
|
|
3212
3361
|
const month = monthStart(grid.focusedDay);
|
|
3213
3362
|
const motion = useMonthSlide(month);
|
|
@@ -3228,8 +3377,8 @@ function useIsPhone() {
|
|
|
3228
3377
|
return !isWideFormLayout(reactNative.useWindowDimensions().width);
|
|
3229
3378
|
}
|
|
3230
3379
|
function useReturnFocus(open, target) {
|
|
3231
|
-
const wasOpen =
|
|
3232
|
-
|
|
3380
|
+
const wasOpen = React39.useRef(open);
|
|
3381
|
+
React39.useEffect(() => {
|
|
3233
3382
|
const closed = wasOpen.current && !open;
|
|
3234
3383
|
wasOpen.current = open;
|
|
3235
3384
|
if (!closed) return void 0;
|
|
@@ -3239,9 +3388,9 @@ function useReturnFocus(open, target) {
|
|
|
3239
3388
|
}
|
|
3240
3389
|
function useTypedDate({ value, onChange, bounds, format, onError, rangeMessage, editOnType = false }) {
|
|
3241
3390
|
const { labels, locale } = useDatePickerConfig();
|
|
3242
|
-
const [editing, setEditing] =
|
|
3243
|
-
const [text, setText] =
|
|
3244
|
-
|
|
3391
|
+
const [editing, setEditing] = React39.useState(false);
|
|
3392
|
+
const [text, setText] = React39.useState("");
|
|
3393
|
+
React39.useEffect(() => {
|
|
3245
3394
|
setText((current) => {
|
|
3246
3395
|
const parsed = current.trim() === "" ? "" : parseTyped(current, locale);
|
|
3247
3396
|
if (parsed === null || parsed === value) return current;
|
|
@@ -3361,16 +3510,16 @@ function DatePickerInput({ fieldProps, context, onTypedError }) {
|
|
|
3361
3510
|
const { label, value, onChange, onSubmit, accessibilityHint, testID, required, disabled = false, min, max } = fieldProps;
|
|
3362
3511
|
const { labels, display } = useDatePickerConfig();
|
|
3363
3512
|
const phone = useIsPhone();
|
|
3364
|
-
const [open, setOpen] =
|
|
3365
|
-
const anchorRef =
|
|
3366
|
-
const inputRef =
|
|
3513
|
+
const [open, setOpen] = React39.useState(false);
|
|
3514
|
+
const anchorRef = React39.useRef(null);
|
|
3515
|
+
const inputRef = React39.useRef(null);
|
|
3367
3516
|
const bounds = { min, max };
|
|
3368
3517
|
const typed = useTypedDate({ value, onChange, bounds, format: displayFormatter(display), onError: onTypedError, editOnType: true });
|
|
3369
3518
|
const edit = typedEditBind(typed);
|
|
3370
3519
|
const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: !disabled });
|
|
3371
3520
|
const focus = focusBind;
|
|
3372
3521
|
const webA11y = webFieldA11y({ describedById: context.describedById, hasError: context.hasError, required });
|
|
3373
|
-
const close =
|
|
3522
|
+
const close = React39.useCallback(() => setOpen(false), []);
|
|
3374
3523
|
useReturnFocus(open, inputRef);
|
|
3375
3524
|
const commit = (iso) => {
|
|
3376
3525
|
onTypedError?.(void 0);
|
|
@@ -3446,7 +3595,7 @@ function TemporalInput({ fieldProps, context, webInputType, onTypedError }) {
|
|
|
3446
3595
|
}
|
|
3447
3596
|
function TemporalField({ fieldProps, webInputType }) {
|
|
3448
3597
|
const { label, required, hint, error } = fieldProps;
|
|
3449
|
-
const [typedError, setTypedError] =
|
|
3598
|
+
const [typedError, setTypedError] = React39.useState(void 0);
|
|
3450
3599
|
return /* @__PURE__ */ jsxRuntime.jsx(Field, { error: error ?? typedError, hint, label, required, children: (context) => /* @__PURE__ */ jsxRuntime.jsx(TemporalInput, { context, fieldProps, webInputType, onTypedError: setTypedError }) });
|
|
3451
3600
|
}
|
|
3452
3601
|
function DateField(props) {
|
|
@@ -3575,17 +3724,17 @@ function useRangeSummary(draft) {
|
|
|
3575
3724
|
}
|
|
3576
3725
|
function RangeCalendar({ value, bounds, phone, testID, onApply, onCancel }) {
|
|
3577
3726
|
const { labels, today } = useDatePickerConfig();
|
|
3578
|
-
const [draft, setDraft] =
|
|
3727
|
+
const [draft, setDraft] = React39.useState(value);
|
|
3579
3728
|
const initialDay = clampToBounds(value.from !== "" ? value.from : today, bounds.min, bounds.max);
|
|
3580
|
-
const pickDraft =
|
|
3729
|
+
const pickDraft = React39.useCallback((iso) => setDraft((current) => pickRangeDay(current, iso)), []);
|
|
3581
3730
|
const focus = useGridFocus(initialDay, bounds, testID, pickDraft);
|
|
3582
3731
|
const visible = phone ? PHONE_MONTHS : DESKTOP_MONTHS;
|
|
3583
|
-
const [first, setFirst] =
|
|
3732
|
+
const [first, setFirst] = React39.useState(() => monthStart(phone ? initialDay : addMonths(initialDay, 1 - DESKTOP_MONTHS)));
|
|
3584
3733
|
const focusMonth = monthStart(focus.focusedDay);
|
|
3585
3734
|
const last = addMonths(first, visible - 1);
|
|
3586
3735
|
const motion = useMonthSlide(first);
|
|
3587
3736
|
const summary = useRangeSummary(draft);
|
|
3588
|
-
|
|
3737
|
+
React39.useEffect(() => {
|
|
3589
3738
|
if (focusMonth < first) setFirst(focusMonth);
|
|
3590
3739
|
else if (focusMonth > last) setFirst(addMonths(focusMonth, 1 - visible));
|
|
3591
3740
|
}, [focusMonth, first, last, visible]);
|
|
@@ -3634,18 +3783,18 @@ function orNone(value) {
|
|
|
3634
3783
|
function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, testID, context, onTypedError }) {
|
|
3635
3784
|
const { labels } = useDatePickerConfig();
|
|
3636
3785
|
const phone = useIsPhone();
|
|
3637
|
-
const [open, setOpen] =
|
|
3638
|
-
const [fromError, setFromError] =
|
|
3639
|
-
const [toError, setToError] =
|
|
3640
|
-
const anchorRef =
|
|
3641
|
-
const fromRef =
|
|
3786
|
+
const [open, setOpen] = React39.useState(false);
|
|
3787
|
+
const [fromError, setFromError] = React39.useState(void 0);
|
|
3788
|
+
const [toError, setToError] = React39.useState(void 0);
|
|
3789
|
+
const anchorRef = React39.useRef(null);
|
|
3790
|
+
const fromRef = React39.useRef(null);
|
|
3642
3791
|
const from = useTypedDate({ value: value.from, onChange: (next) => onChange({ from: next, to: value.to }), bounds: { max: orNone(value.to) }, format: formatShort, onError: setFromError, rangeMessage: labels.rangeOrder, editOnType: true });
|
|
3643
3792
|
const to = useTypedDate({ value: value.to, onChange: (next) => onChange({ from: value.from, to: next }), bounds: { min: orNone(value.from) }, format: formatShort, onError: setToError, rangeMessage: labels.rangeOrder, editOnType: true });
|
|
3644
3793
|
const { style, focusBind, hoverBind } = useThemedInput({ hasError: context.hasError, editable: true });
|
|
3645
3794
|
const focus = focusBind;
|
|
3646
3795
|
const webA11y = webFieldA11y({ describedById: context.describedById, hasError: context.hasError });
|
|
3647
|
-
|
|
3648
|
-
const close =
|
|
3796
|
+
React39.useEffect(() => onTypedError(fromError ?? toError), [fromError, toError, onTypedError]);
|
|
3797
|
+
const close = React39.useCallback(() => setOpen(false), []);
|
|
3649
3798
|
useReturnFocus(open, fromRef);
|
|
3650
3799
|
const onKeyDown = (event) => {
|
|
3651
3800
|
if (event.key === "ArrowDown" && event.altKey) {
|
|
@@ -3729,7 +3878,7 @@ function DateRangeControl({
|
|
|
3729
3878
|
}) {
|
|
3730
3879
|
const hint = accessibilityHint ?? `${fromLabel} \u2013 ${toLabel}`;
|
|
3731
3880
|
const { labels } = useDatePickerConfig();
|
|
3732
|
-
const [typedError, setTypedError] =
|
|
3881
|
+
const [typedError, setTypedError] = React39.useState(void 0);
|
|
3733
3882
|
if (!IS_WEB9) {
|
|
3734
3883
|
return /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(NativeDateRange, { fromLabel, hint, style, testID, toLabel, value, onChange, onSubmit }) });
|
|
3735
3884
|
}
|
|
@@ -3769,7 +3918,7 @@ var ROW_GAP = 4;
|
|
|
3769
3918
|
var TAB_PADDING = 4;
|
|
3770
3919
|
var INDICATOR_WIDTH = 2;
|
|
3771
3920
|
var TAB_FONT_SIZE = 12;
|
|
3772
|
-
var
|
|
3921
|
+
var styles22 = reactNative.StyleSheet.create({
|
|
3773
3922
|
row: { flexDirection: "row", flexWrap: "nowrap", gap: ROW_GAP },
|
|
3774
3923
|
tab: {
|
|
3775
3924
|
borderBottomWidth: INDICATOR_WIDTH,
|
|
@@ -3809,13 +3958,13 @@ var StepperTab = ({
|
|
|
3809
3958
|
accessibilityRole: "tab",
|
|
3810
3959
|
accessibilityState: { selected },
|
|
3811
3960
|
"aria-selected": selected,
|
|
3812
|
-
style: [
|
|
3961
|
+
style: [styles22.tab, { borderBottomColor: indicator }, ring.ringStyle],
|
|
3813
3962
|
testID,
|
|
3814
3963
|
onBlur: ring.onBlur,
|
|
3815
3964
|
onFocus: ring.onFocus,
|
|
3816
3965
|
onPress: () => onStep(step.key),
|
|
3817
3966
|
...webKeyProps,
|
|
3818
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3967
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles22.text, { color: theme.colors.text }, selected ? styles22.textSelected : void 0], children: step.label })
|
|
3819
3968
|
}
|
|
3820
3969
|
);
|
|
3821
3970
|
};
|
|
@@ -3825,7 +3974,7 @@ var StepperTabs = ({
|
|
|
3825
3974
|
onStep,
|
|
3826
3975
|
stepHint,
|
|
3827
3976
|
testID
|
|
3828
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityRole: "tablist", style:
|
|
3977
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityRole: "tablist", style: styles22.row, testID, children: steps.map((step) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3829
3978
|
StepperTab,
|
|
3830
3979
|
{
|
|
3831
3980
|
hint: stepHint,
|
|
@@ -3844,7 +3993,7 @@ function resolveStepNeighbours(steps, current) {
|
|
|
3844
3993
|
return { previous: steps[index - 1] ?? null, next: steps[index + 1] ?? null };
|
|
3845
3994
|
}
|
|
3846
3995
|
var ROW_GAP2 = 8;
|
|
3847
|
-
var
|
|
3996
|
+
var styles23 = reactNative.StyleSheet.create({
|
|
3848
3997
|
cell: { flex: 1, minWidth: 0 },
|
|
3849
3998
|
row: { flexDirection: "row", gap: ROW_GAP2 }
|
|
3850
3999
|
});
|
|
@@ -3856,8 +4005,8 @@ var StepperNav = ({
|
|
|
3856
4005
|
testID
|
|
3857
4006
|
}) => {
|
|
3858
4007
|
const { previous, next } = resolveStepNeighbours(steps, current);
|
|
3859
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
3860
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
4008
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles23.row, testID, children: [
|
|
4009
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles23.cell, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3861
4010
|
uiButtons.Button,
|
|
3862
4011
|
{
|
|
3863
4012
|
fullWidth: true,
|
|
@@ -3873,7 +4022,7 @@ var StepperNav = ({
|
|
|
3873
4022
|
}
|
|
3874
4023
|
}
|
|
3875
4024
|
) }),
|
|
3876
|
-
next === null ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
4025
|
+
next === null ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles23.cell, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3877
4026
|
uiButtons.Button,
|
|
3878
4027
|
{
|
|
3879
4028
|
fullWidth: true,
|
|
@@ -3888,18 +4037,18 @@ var StepperNav = ({
|
|
|
3888
4037
|
] });
|
|
3889
4038
|
};
|
|
3890
4039
|
var STATUS_FONT = 16;
|
|
3891
|
-
var
|
|
4040
|
+
var styles24 = reactNative.StyleSheet.create({
|
|
3892
4041
|
line: { fontSize: STATUS_FONT }
|
|
3893
4042
|
});
|
|
3894
4043
|
function FormStatusLine({ message, testID, style }) {
|
|
3895
4044
|
const { theme } = uiFeedback.useUi();
|
|
3896
4045
|
if (message === null || message === void 0 || message === "") return null;
|
|
3897
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [
|
|
4046
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [styles24.line, { color: theme.colors.text }, style], testID, children: message });
|
|
3898
4047
|
}
|
|
3899
4048
|
function useFocusFirstInvalid(refs) {
|
|
3900
|
-
const latest =
|
|
4049
|
+
const latest = React39.useRef(refs);
|
|
3901
4050
|
latest.current = refs;
|
|
3902
|
-
return
|
|
4051
|
+
return React39.useCallback((invalid) => {
|
|
3903
4052
|
const first = invalid.map((field2) => latest.current[field2].current).find((node) => node !== null);
|
|
3904
4053
|
first?.focus();
|
|
3905
4054
|
}, []);
|
|
@@ -3950,10 +4099,10 @@ function withoutField(state, field2) {
|
|
|
3950
4099
|
}
|
|
3951
4100
|
function useServerFieldErrors(options) {
|
|
3952
4101
|
const { fields, refs, formatCode } = options;
|
|
3953
|
-
const [state, setState] =
|
|
4102
|
+
const [state, setState] = React39.useState(EMPTY_STATE);
|
|
3954
4103
|
const focusFirst = useFocusFirstInvalid(refs ?? NO_REFS);
|
|
3955
4104
|
const hasRefs = refs !== void 0;
|
|
3956
|
-
const apply =
|
|
4105
|
+
const apply = React39.useCallback(
|
|
3957
4106
|
(error) => {
|
|
3958
4107
|
const assigned = assignServerErrors(apiClientBase.parseFieldErrors(error), fields, formatCode);
|
|
3959
4108
|
setState({ byField: assigned.byField, formError: assigned.formError });
|
|
@@ -3964,17 +4113,17 @@ function useServerFieldErrors(options) {
|
|
|
3964
4113
|
},
|
|
3965
4114
|
[fields, formatCode, focusFirst, hasRefs]
|
|
3966
4115
|
);
|
|
3967
|
-
const clear =
|
|
3968
|
-
const reset =
|
|
3969
|
-
const errorFor =
|
|
4116
|
+
const clear = React39.useCallback((field2) => setState((current) => withoutField(current, field2)), []);
|
|
4117
|
+
const reset = React39.useCallback(() => setState(EMPTY_STATE), []);
|
|
4118
|
+
const errorFor = React39.useCallback((field2) => state.byField[field2], [state.byField]);
|
|
3970
4119
|
return { errorFor, apply, clear, formError: state.formError, reset };
|
|
3971
4120
|
}
|
|
3972
4121
|
function isScrollable(node) {
|
|
3973
4122
|
return "scrollIntoView" in Object(node);
|
|
3974
4123
|
}
|
|
3975
4124
|
function useKeepInView(trigger) {
|
|
3976
|
-
const ref =
|
|
3977
|
-
|
|
4125
|
+
const ref = React39.useRef(null);
|
|
4126
|
+
React39.useEffect(() => {
|
|
3978
4127
|
const node = ref.current;
|
|
3979
4128
|
const hasTrigger = trigger !== void 0 && trigger !== null;
|
|
3980
4129
|
if (hasTrigger && isScrollable(node)) node.scrollIntoView({ block: "nearest" });
|
|
@@ -3983,7 +4132,7 @@ function useKeepInView(trigger) {
|
|
|
3983
4132
|
}
|
|
3984
4133
|
var IS_WEB10 = reactNative.Platform.OS === "web";
|
|
3985
4134
|
var INPUT_FONT2 = 14;
|
|
3986
|
-
var
|
|
4135
|
+
var styles25 = reactNative.StyleSheet.create({
|
|
3987
4136
|
nativeButton: { minHeight: a11y.MIN_TOUCH_TARGET_PX, minWidth: a11y.MIN_TOUCH_TARGET_PX, justifyContent: "center" },
|
|
3988
4137
|
nativeText: { fontSize: INPUT_FONT2 }
|
|
3989
4138
|
});
|
|
@@ -4011,10 +4160,10 @@ function FileInput({
|
|
|
4011
4160
|
accessibilityRole: "button",
|
|
4012
4161
|
accessibilityState: { disabled },
|
|
4013
4162
|
disabled,
|
|
4014
|
-
style:
|
|
4163
|
+
style: styles25.nativeButton,
|
|
4015
4164
|
testID,
|
|
4016
4165
|
onPress: onNativePick,
|
|
4017
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4166
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles25.nativeText, { color: colors.text }], children: nativeLabel ?? accessibilityLabel })
|
|
4018
4167
|
}
|
|
4019
4168
|
);
|
|
4020
4169
|
}
|
|
@@ -4044,7 +4193,7 @@ var PREVIEW_RADIUS = 8;
|
|
|
4044
4193
|
var GAP6 = 8;
|
|
4045
4194
|
var TITLE_FONT_SIZE = 14;
|
|
4046
4195
|
var HELP_FONT_SIZE = 13;
|
|
4047
|
-
var
|
|
4196
|
+
var styles26 = reactNative.StyleSheet.create({
|
|
4048
4197
|
help: { flex: 1, fontSize: HELP_FONT_SIZE },
|
|
4049
4198
|
root: { gap: GAP6 },
|
|
4050
4199
|
tile: { alignItems: "center", flexDirection: "row", gap: GAP6 },
|
|
@@ -4064,13 +4213,13 @@ var UploadWithLinkField = ({
|
|
|
4064
4213
|
const { theme } = uiFeedback.useUi();
|
|
4065
4214
|
const ring = uiButtons.useFocusRing();
|
|
4066
4215
|
const url = value ?? "";
|
|
4067
|
-
const [pasting, setPasting] =
|
|
4216
|
+
const [pasting, setPasting] = React39.useState(url !== "");
|
|
4068
4217
|
const previewBox = { borderRadius: PREVIEW_RADIUS, height: previewSize, width: previewSize };
|
|
4069
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4070
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4071
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4218
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles26.root, children: [
|
|
4219
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles26.title, { color: theme.colors.text }], children: labels.title }),
|
|
4220
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles26.tile, children: [
|
|
4072
4221
|
url === "" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [previewBox, { backgroundColor: theme.colors.border }] }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { accessible: false, source: { uri: url }, style: previewBox, testID: `${testID}-preview` }),
|
|
4073
|
-
labels.help === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4222
|
+
labels.help === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles26.help, { color: theme.colors.text }], children: labels.help })
|
|
4074
4223
|
] }),
|
|
4075
4224
|
uploadControl,
|
|
4076
4225
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4081,12 +4230,12 @@ var UploadWithLinkField = ({
|
|
|
4081
4230
|
accessibilityRole: "button",
|
|
4082
4231
|
accessibilityState: { expanded: pasting },
|
|
4083
4232
|
"aria-expanded": pasting,
|
|
4084
|
-
style: [
|
|
4233
|
+
style: [styles26.toggle, ring.ringStyle],
|
|
4085
4234
|
testID: `${testID}-paste`,
|
|
4086
4235
|
onBlur: ring.onBlur,
|
|
4087
4236
|
onFocus: ring.onFocus,
|
|
4088
4237
|
onPress: () => setPasting(!pasting),
|
|
4089
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4238
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles26.toggleText, { color: theme.colors.text }], children: labels.pasteToggle })
|
|
4090
4239
|
}
|
|
4091
4240
|
),
|
|
4092
4241
|
pasting ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4105,7 +4254,7 @@ var UploadWithLinkField = ({
|
|
|
4105
4254
|
};
|
|
4106
4255
|
var ACTION_GAP = 8;
|
|
4107
4256
|
var GROUP_GAP = 16;
|
|
4108
|
-
var
|
|
4257
|
+
var styles27 = reactNative.StyleSheet.create({
|
|
4109
4258
|
action: { alignItems: "flex-start", marginTop: ACTION_GAP },
|
|
4110
4259
|
group: { marginBottom: GROUP_GAP }
|
|
4111
4260
|
});
|
|
@@ -4122,13 +4271,13 @@ var AddOnRequest = ({
|
|
|
4122
4271
|
disabled = false,
|
|
4123
4272
|
style
|
|
4124
4273
|
}) => {
|
|
4125
|
-
const [requested, setRequested] =
|
|
4274
|
+
const [requested, setRequested] = React39.useState(false);
|
|
4126
4275
|
const remove = () => {
|
|
4127
4276
|
setRequested(false);
|
|
4128
4277
|
onRemove();
|
|
4129
4278
|
};
|
|
4130
4279
|
if (!isAddOnOpen(hasValue, requested))
|
|
4131
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
4280
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles27.action, style], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4132
4281
|
uiButtons.Button,
|
|
4133
4282
|
{
|
|
4134
4283
|
accessibilityHint: addHint,
|
|
@@ -4140,9 +4289,9 @@ var AddOnRequest = ({
|
|
|
4140
4289
|
onPress: () => setRequested(true)
|
|
4141
4290
|
}
|
|
4142
4291
|
) });
|
|
4143
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
4292
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles27.group, style], testID, children: [
|
|
4144
4293
|
children,
|
|
4145
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
4294
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles27.action, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4146
4295
|
uiButtons.Button,
|
|
4147
4296
|
{
|
|
4148
4297
|
accessibilityHint: removeHint,
|
|
@@ -4159,7 +4308,7 @@ var AddOnRequest = ({
|
|
|
4159
4308
|
var ROW_GAP3 = 8;
|
|
4160
4309
|
var TEXT_SIZE = 13;
|
|
4161
4310
|
var TEXT_LINE = 18;
|
|
4162
|
-
var
|
|
4311
|
+
var styles28 = reactNative.StyleSheet.create({
|
|
4163
4312
|
row: { alignItems: "center", columnGap: ROW_GAP3, flexDirection: "row", justifyContent: "space-between" },
|
|
4164
4313
|
text: { flexShrink: 1, fontSize: TEXT_SIZE, fontWeight: "700", lineHeight: TEXT_LINE }
|
|
4165
4314
|
});
|
|
@@ -4167,8 +4316,8 @@ var isFixBarVisible = (count) => count > 0;
|
|
|
4167
4316
|
var FixBar = ({ count, message, showLabel, showHint, onShow, testID, style }) => {
|
|
4168
4317
|
const { theme } = uiFeedback.useUi();
|
|
4169
4318
|
if (!isFixBarVisible(count)) return null;
|
|
4170
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
4171
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [
|
|
4319
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles28.row, style], testID, children: [
|
|
4320
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [styles28.text, { color: fieldErrorInk(theme) }], testID: `${testID}-count`, children: message }),
|
|
4172
4321
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4173
4322
|
uiButtons.Button,
|
|
4174
4323
|
{
|
|
@@ -4206,21 +4355,21 @@ function OptionRow2({ option, active, current, renderLeading, renderDetail, onPi
|
|
|
4206
4355
|
accessibilityLabel: option.label,
|
|
4207
4356
|
accessibilityRole: "button",
|
|
4208
4357
|
accessibilityState: { selected: active, checked: current },
|
|
4209
|
-
style: [
|
|
4358
|
+
style: [styles29.row, active ? { backgroundColor: colors.surface } : null],
|
|
4210
4359
|
testID: `${testID}-option-${option.value}`,
|
|
4211
4360
|
onPress: () => onPick(option),
|
|
4212
4361
|
children: [
|
|
4213
4362
|
renderLeading?.(option),
|
|
4214
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4215
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4216
|
-
detailBelow ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4363
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles29.label, children: [
|
|
4364
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles29.primary, { color: colors.text }], children: option.label }),
|
|
4365
|
+
detailBelow ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles29.secondary, { color: colors.textSecondary }], children: option.detail }) : null
|
|
4217
4366
|
] }),
|
|
4218
4367
|
renderDetail?.(option)
|
|
4219
4368
|
]
|
|
4220
4369
|
}
|
|
4221
4370
|
);
|
|
4222
4371
|
}
|
|
4223
|
-
var
|
|
4372
|
+
var styles29 = reactNative.StyleSheet.create({
|
|
4224
4373
|
row: { minHeight: a11y.MIN_TOUCH_TARGET_PX, flexDirection: "row", alignItems: "center", gap: ROW_GAP4, paddingHorizontal: ROW_PAD_H },
|
|
4225
4374
|
label: { flex: 1 },
|
|
4226
4375
|
primary: { fontSize: OPTION_FONT2, flexShrink: 1 },
|
|
@@ -4234,11 +4383,11 @@ function OptionSection({ title, options, offset, highlight, selectedValue, ...ro
|
|
|
4234
4383
|
const { colors } = theme;
|
|
4235
4384
|
if (options.length === 0) return null;
|
|
4236
4385
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
|
|
4237
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [
|
|
4386
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles30.header, { color: colors.textSecondary }], children: title }),
|
|
4238
4387
|
options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(OptionRow2, { ...row, active: offset + index === highlight, current: option.value === selectedValue, option }, option.value))
|
|
4239
4388
|
] });
|
|
4240
4389
|
}
|
|
4241
|
-
var
|
|
4390
|
+
var styles30 = reactNative.StyleSheet.create({
|
|
4242
4391
|
header: { fontSize: HEADER_FONT, paddingHorizontal: ROW_PAD_H2, paddingTop: ROW_GAP5, textTransform: "uppercase" }
|
|
4243
4392
|
});
|
|
4244
4393
|
var KEY_ESCAPE = "Escape";
|
|
@@ -4248,27 +4397,27 @@ var SHEET_MAX_HEIGHT2 = 480;
|
|
|
4248
4397
|
function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, renderDetail, selectedValue, testID }) {
|
|
4249
4398
|
const { theme } = uiFeedback.useUi();
|
|
4250
4399
|
const { colors } = theme;
|
|
4251
|
-
const progress =
|
|
4400
|
+
const progress = React39.useRef(new reactNative.Animated.Value(0)).current;
|
|
4252
4401
|
const { durationMs } = motion;
|
|
4253
|
-
|
|
4402
|
+
React39.useEffect(() => {
|
|
4254
4403
|
reactNative.Animated.timing(progress, { toValue: 1, duration: durationMs, useNativeDriver: false }).start();
|
|
4255
4404
|
}, [progress, durationMs]);
|
|
4256
|
-
const leaving =
|
|
4257
|
-
const leave =
|
|
4405
|
+
const leaving = React39.useRef(false);
|
|
4406
|
+
const leave = React39.useCallback((after) => {
|
|
4258
4407
|
if (leaving.current) return;
|
|
4259
4408
|
leaving.current = true;
|
|
4260
4409
|
if (durationMs === 0) return after();
|
|
4261
4410
|
reactNative.Animated.timing(progress, { toValue: 0, duration: durationMs, useNativeDriver: false }).start(() => after());
|
|
4262
4411
|
}, [progress, durationMs]);
|
|
4263
4412
|
const { close, pick: pickNow, submit: submitNow, onKey, sections, highlight } = state;
|
|
4264
|
-
const dismiss =
|
|
4265
|
-
const pick =
|
|
4266
|
-
const submit =
|
|
4267
|
-
const onKeyPress =
|
|
4413
|
+
const dismiss = React39.useCallback(() => leave(close), [leave, close]);
|
|
4414
|
+
const pick = React39.useCallback((option) => leave(() => pickNow(option)), [leave, pickNow]);
|
|
4415
|
+
const submit = React39.useCallback(() => submitNow(pick), [submitNow, pick]);
|
|
4416
|
+
const onKeyPress = React39.useCallback((key) => key === KEY_ESCAPE ? dismiss() : onKey(key), [dismiss, onKey]);
|
|
4268
4417
|
const translateY = progress.interpolate({ inputRange: [0, 1], outputRange: [motion.fromY, 0] });
|
|
4269
4418
|
const isSheet = motion.surface === "sheet" /* Sheet */;
|
|
4270
4419
|
const shared = { selectedValue, renderLeading, renderDetail, onPick: pick, optionHint: labels.optionHint, testID, highlight };
|
|
4271
|
-
const list = /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
4420
|
+
const list = /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles31.panel, { backgroundColor: colors.surfaceElevated, borderColor: colors.border }], testID: `${testID}-panel`, children: [
|
|
4272
4421
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4273
4422
|
reactNative.TextInput,
|
|
4274
4423
|
{
|
|
@@ -4285,24 +4434,24 @@ function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, re
|
|
|
4285
4434
|
onSubmitEditing: submit
|
|
4286
4435
|
}
|
|
4287
4436
|
),
|
|
4288
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ?
|
|
4437
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ? styles31.sheetList : styles31.dropList, children: [
|
|
4289
4438
|
/* @__PURE__ */ jsxRuntime.jsx(OptionSection, { ...shared, offset: 0, options: sections.recent, title: labels.recent }),
|
|
4290
4439
|
/* @__PURE__ */ jsxRuntime.jsx(OptionSection, { ...shared, offset: sections.recent.length, options: sections.all, title: labels.all }),
|
|
4291
|
-
sections.flat.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4440
|
+
sections.flat.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles31.empty, { color: colors.textSecondary }], children: labels.empty }) : null
|
|
4292
4441
|
] })
|
|
4293
4442
|
] });
|
|
4294
4443
|
if (!isSheet) return /* @__PURE__ */ jsxRuntime.jsx(DropdownSurface, { anchorRef, closeHint: labels.closeHint, closeLabel: labels.close, progress, testID, translateY, onDismiss: dismiss, children: list });
|
|
4295
4444
|
return /* @__PURE__ */ jsxRuntime.jsx(SheetSurface, { closeHint: labels.closeHint, closeLabel: labels.close, testID, translateY, onDismiss: dismiss, children: list });
|
|
4296
4445
|
}
|
|
4297
|
-
var
|
|
4446
|
+
var styles31 = reactNative.StyleSheet.create({
|
|
4298
4447
|
panel: { borderWidth: 1, borderRadius: PANEL_RADIUS, padding: PANEL_PAD, gap: PANEL_PAD },
|
|
4299
4448
|
dropList: { maxHeight: MENU_MAX_HEIGHT },
|
|
4300
4449
|
sheetList: { maxHeight: SHEET_MAX_HEIGHT2 },
|
|
4301
4450
|
empty: { padding: PANEL_PAD }
|
|
4302
4451
|
});
|
|
4303
4452
|
function useRefocusOnClose(open, ref) {
|
|
4304
|
-
const wasOpen =
|
|
4305
|
-
|
|
4453
|
+
const wasOpen = React39.useRef(false);
|
|
4454
|
+
React39.useEffect(() => {
|
|
4306
4455
|
if (wasOpen.current && !open) ref.current?.focus();
|
|
4307
4456
|
wasOpen.current = open;
|
|
4308
4457
|
}, [open, ref]);
|
|
@@ -4335,38 +4484,38 @@ var KEY_DOWN = "ArrowDown";
|
|
|
4335
4484
|
var KEY_UP = "ArrowUp";
|
|
4336
4485
|
var KEY_ESCAPE2 = "Escape";
|
|
4337
4486
|
function useSearchSelectState(options, recents, onChange, onClosed) {
|
|
4338
|
-
const [open, setOpen] =
|
|
4339
|
-
const [query, setQueryState] =
|
|
4340
|
-
const [rawHighlight, setHighlight] =
|
|
4341
|
-
const sections =
|
|
4487
|
+
const [open, setOpen] = React39.useState(false);
|
|
4488
|
+
const [query, setQueryState] = React39.useState("");
|
|
4489
|
+
const [rawHighlight, setHighlight] = React39.useState(-1);
|
|
4490
|
+
const sections = React39.useMemo(() => buildSearchSelectSections(options, query, recents.recents), [options, query, recents.recents]);
|
|
4342
4491
|
const highlight = rawHighlight < sections.flat.length ? rawHighlight : -1;
|
|
4343
4492
|
const active = sections.flat[highlight];
|
|
4344
4493
|
const { remember } = recents;
|
|
4345
|
-
const close =
|
|
4494
|
+
const close = React39.useCallback(() => {
|
|
4346
4495
|
setOpen(false);
|
|
4347
4496
|
setQueryState("");
|
|
4348
4497
|
setHighlight(-1);
|
|
4349
4498
|
onClosed();
|
|
4350
4499
|
}, [onClosed]);
|
|
4351
|
-
const pick =
|
|
4500
|
+
const pick = React39.useCallback((option) => {
|
|
4352
4501
|
remember(option.value);
|
|
4353
4502
|
onChange(option.value);
|
|
4354
4503
|
close();
|
|
4355
4504
|
}, [remember, onChange, close]);
|
|
4356
|
-
const submit =
|
|
4505
|
+
const submit = React39.useCallback((via = pick) => {
|
|
4357
4506
|
if (active !== void 0) via(active);
|
|
4358
4507
|
}, [active, pick]);
|
|
4359
|
-
const setQuery =
|
|
4508
|
+
const setQuery = React39.useCallback((next) => {
|
|
4360
4509
|
setQueryState(next);
|
|
4361
4510
|
setHighlight(highlightAfterQuery(next));
|
|
4362
4511
|
}, []);
|
|
4363
|
-
const onKey =
|
|
4512
|
+
const onKey = React39.useCallback((key) => {
|
|
4364
4513
|
const count = sections.flat.length;
|
|
4365
4514
|
if (key === KEY_DOWN) setHighlight(moveHighlight(highlight, count, 1));
|
|
4366
4515
|
if (key === KEY_UP) setHighlight(moveHighlight(highlight, count, -1));
|
|
4367
4516
|
if (key === KEY_ESCAPE2) close();
|
|
4368
4517
|
}, [sections.flat.length, highlight, close]);
|
|
4369
|
-
const openList =
|
|
4518
|
+
const openList = React39.useCallback(() => setOpen(true), []);
|
|
4370
4519
|
return { open, query, highlight, active, sections, openList, close, setQuery, pick, submit, onKey };
|
|
4371
4520
|
}
|
|
4372
4521
|
|
|
@@ -4390,8 +4539,8 @@ function SearchSelect(props) {
|
|
|
4390
4539
|
const { options, value, onChange, accessibilityLabel, accessibilityHint, labels, testID, recentKey, renderLeading, renderDetail, renderTrigger, onBlur } = props;
|
|
4391
4540
|
const { theme } = uiFeedback.useUi();
|
|
4392
4541
|
const { colors } = theme;
|
|
4393
|
-
const triggerRef =
|
|
4394
|
-
const anchorRef =
|
|
4542
|
+
const triggerRef = React39.useRef(null);
|
|
4543
|
+
const anchorRef = React39.useRef(null);
|
|
4395
4544
|
const { width } = reactNative.useWindowDimensions();
|
|
4396
4545
|
const motion = resolveSelectMotion(width, useReducedMotion());
|
|
4397
4546
|
const recents = useRecentValues(recentKey ?? `search-select:${testID}`);
|
|
@@ -4399,12 +4548,12 @@ function SearchSelect(props) {
|
|
|
4399
4548
|
useRefocusOnClose(state.open, triggerRef);
|
|
4400
4549
|
const selected = findOption(options, value);
|
|
4401
4550
|
const onPress = state.open ? state.close : state.openList;
|
|
4402
|
-
const openRef =
|
|
4551
|
+
const openRef = React39.useRef(state.open);
|
|
4403
4552
|
openRef.current = state.open;
|
|
4404
|
-
const onTriggerBlur =
|
|
4553
|
+
const onTriggerBlur = React39.useCallback(() => {
|
|
4405
4554
|
if (!openRef.current) onBlur?.();
|
|
4406
4555
|
}, [onBlur]);
|
|
4407
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: anchorRef, style:
|
|
4556
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: anchorRef, style: styles32.anchor, children: [
|
|
4408
4557
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4409
4558
|
reactNative.Pressable,
|
|
4410
4559
|
{
|
|
@@ -4413,7 +4562,7 @@ function SearchSelect(props) {
|
|
|
4413
4562
|
accessibilityLabel,
|
|
4414
4563
|
accessibilityRole: "button",
|
|
4415
4564
|
accessibilityState: { expanded: state.open },
|
|
4416
|
-
style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] :
|
|
4565
|
+
style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] : styles32.customTrigger,
|
|
4417
4566
|
testID,
|
|
4418
4567
|
onBlur: onTriggerBlur,
|
|
4419
4568
|
onPress,
|
|
@@ -4425,7 +4574,7 @@ function SearchSelect(props) {
|
|
|
4425
4574
|
}
|
|
4426
4575
|
function FieldBoxContent({ selected, placeholder, colors, renderLeading, renderDetail }) {
|
|
4427
4576
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4428
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4577
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles32.value, children: [
|
|
4429
4578
|
selected !== null && renderLeading !== void 0 ? renderLeading(selected) : null,
|
|
4430
4579
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [controlStyles.selectTriggerText, { color: selected === null ? colors.textSecondary : colors.text }], children: selected?.label ?? placeholder }),
|
|
4431
4580
|
selected !== null ? /* @__PURE__ */ jsxRuntime.jsx(SelectedDetail, { colors, option: selected, renderDetail }) : null
|
|
@@ -4438,7 +4587,7 @@ function SelectedDetail({ option, colors, renderDetail }) {
|
|
|
4438
4587
|
if (option.detail === void 0) return null;
|
|
4439
4588
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [controlStyles.selectTriggerText, { color: colors.textSecondary }], children: option.detail });
|
|
4440
4589
|
}
|
|
4441
|
-
var
|
|
4590
|
+
var styles32 = reactNative.StyleSheet.create({
|
|
4442
4591
|
anchor: { position: "relative" },
|
|
4443
4592
|
customTrigger: { minHeight: MIN_TOUCH, minWidth: MIN_TOUCH, alignSelf: "flex-start", justifyContent: "center" },
|
|
4444
4593
|
value: { flex: 1, flexDirection: "row", alignItems: "center", gap: VALUE_GAP }
|
|
@@ -4451,7 +4600,7 @@ function isOutside(container, target) {
|
|
|
4451
4600
|
return !(target instanceof Node && container.contains(target));
|
|
4452
4601
|
}
|
|
4453
4602
|
function useOutsidePress(ref, onOutside) {
|
|
4454
|
-
|
|
4603
|
+
React39.useEffect(() => {
|
|
4455
4604
|
if (reactNative.Platform.OS !== "web" || typeof document === "undefined") return void 0;
|
|
4456
4605
|
const onPointerDown = (event) => {
|
|
4457
4606
|
if (isOutside(ref.current, event.target)) onOutside();
|
|
@@ -4462,7 +4611,7 @@ function useOutsidePress(ref, onOutside) {
|
|
|
4462
4611
|
}
|
|
4463
4612
|
var AFTER_SURFACE_UNMOUNT_MS = 0;
|
|
4464
4613
|
function useDeferredFocus(ref) {
|
|
4465
|
-
return
|
|
4614
|
+
return React39.useCallback(() => {
|
|
4466
4615
|
setTimeout(() => ref.current?.focus(), AFTER_SURFACE_UNMOUNT_MS);
|
|
4467
4616
|
}, [ref]);
|
|
4468
4617
|
}
|
|
@@ -5214,8 +5363,8 @@ var renderFlag = (option) => option.value === NO_COUNTRY2 ? null : /* @__PURE__
|
|
|
5214
5363
|
function CountryField({ value, onChange, accessibilityLabel, accessibilityHint, labels, testID, countries, noneLabel, onBlur }) {
|
|
5215
5364
|
const { theme } = uiFeedback.useUi();
|
|
5216
5365
|
const { textSecondary } = theme.colors;
|
|
5217
|
-
const options =
|
|
5218
|
-
const renderCode =
|
|
5366
|
+
const options = React39.useMemo(() => countryFieldOptions(countries, noneLabel), [countries, noneLabel]);
|
|
5367
|
+
const renderCode = React39.useCallback((option) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles33.code, { color: textSecondary }], children: option.detail }), [textSecondary]);
|
|
5219
5368
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5220
5369
|
SearchSelect,
|
|
5221
5370
|
{
|
|
@@ -5233,13 +5382,13 @@ function CountryField({ value, onChange, accessibilityLabel, accessibilityHint,
|
|
|
5233
5382
|
}
|
|
5234
5383
|
);
|
|
5235
5384
|
}
|
|
5236
|
-
var
|
|
5385
|
+
var styles33 = reactNative.StyleSheet.create({
|
|
5237
5386
|
code: { fontSize: CODE_FONT }
|
|
5238
5387
|
});
|
|
5239
5388
|
function useBlurVerdict(validate) {
|
|
5240
|
-
const [verdict, setVerdict] =
|
|
5241
|
-
const onEdit =
|
|
5242
|
-
const onLeave =
|
|
5389
|
+
const [verdict, setVerdict] = React39.useState(null);
|
|
5390
|
+
const onEdit = React39.useCallback(() => setVerdict(null), []);
|
|
5391
|
+
const onLeave = React39.useCallback(() => {
|
|
5243
5392
|
const next = validate();
|
|
5244
5393
|
setVerdict(next);
|
|
5245
5394
|
return next;
|
|
@@ -5393,11 +5542,11 @@ function rawCaretAfterChange(previous, previousCaret, next) {
|
|
|
5393
5542
|
|
|
5394
5543
|
// src/IbanInput/hooks/useIbanCaret.ts
|
|
5395
5544
|
function useIbanCaret(display) {
|
|
5396
|
-
const [selection2, setSelection] =
|
|
5397
|
-
const onSelectionChange =
|
|
5545
|
+
const [selection2, setSelection] = React39.useState({ start: display.length, end: display.length });
|
|
5546
|
+
const onSelectionChange = React39.useCallback((event) => {
|
|
5398
5547
|
setSelection(event.nativeEvent.selection);
|
|
5399
5548
|
}, []);
|
|
5400
|
-
const placeAfterEdit =
|
|
5549
|
+
const placeAfterEdit = React39.useCallback((text) => {
|
|
5401
5550
|
const caret = caretAfterEdit(text, rawCaretAfterChange(display, selection2.end, text));
|
|
5402
5551
|
setSelection({ start: caret, end: caret });
|
|
5403
5552
|
}, [display, selection2.end]);
|
|
@@ -5489,9 +5638,9 @@ var LINE_GAP = 4;
|
|
|
5489
5638
|
function RejectionLine({ message, testID }) {
|
|
5490
5639
|
const { theme } = uiFeedback.useUi();
|
|
5491
5640
|
if (message === null) return null;
|
|
5492
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityLiveRegion: "polite", style: [
|
|
5641
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityLiveRegion: "polite", style: [styles34.line, { color: fieldErrorInk(theme) }], testID: `${testID}-rejection`, children: message });
|
|
5493
5642
|
}
|
|
5494
|
-
var
|
|
5643
|
+
var styles34 = reactNative.StyleSheet.create({
|
|
5495
5644
|
line: { marginTop: LINE_GAP }
|
|
5496
5645
|
});
|
|
5497
5646
|
|
|
@@ -5503,19 +5652,19 @@ function rejectionMessage(rejection, none, labels) {
|
|
|
5503
5652
|
function IbanInput({ value, onChange, onVerdict, accessibilityLabel, accessibilityHint, testID, rejectionLabels, placeholder, onBlur: onLeft }) {
|
|
5504
5653
|
const { theme } = uiFeedback.useUi();
|
|
5505
5654
|
const { colors } = theme;
|
|
5506
|
-
const draft =
|
|
5507
|
-
const validate =
|
|
5655
|
+
const draft = React39.useMemo(() => draftIban(value), [value]);
|
|
5656
|
+
const validate = React39.useCallback(() => validateIban(value), [value]);
|
|
5508
5657
|
const { verdict, onEdit, onLeave } = useBlurVerdict(validate);
|
|
5509
5658
|
const message = value === "" ? null : rejectionMessage(verdict?.rejection ?? null, "None" /* None */, rejectionLabels);
|
|
5510
5659
|
const counter = ibanCounter(draft);
|
|
5511
5660
|
const { selection: selection2, onSelectionChange, placeAfterEdit } = useIbanCaret(draft.display);
|
|
5512
|
-
const onChangeText =
|
|
5661
|
+
const onChangeText = React39.useCallback((text) => {
|
|
5513
5662
|
onEdit();
|
|
5514
5663
|
onVerdict?.(null);
|
|
5515
5664
|
placeAfterEdit(text);
|
|
5516
5665
|
onChange(draftIban(text).electronic);
|
|
5517
5666
|
}, [onEdit, onVerdict, placeAfterEdit, onChange]);
|
|
5518
|
-
const onBlur =
|
|
5667
|
+
const onBlur = React39.useCallback(() => {
|
|
5519
5668
|
const verdict2 = onLeave();
|
|
5520
5669
|
onVerdict?.(value === "" ? null : verdict2);
|
|
5521
5670
|
onLeft?.();
|
|
@@ -5590,16 +5739,16 @@ function validateBic(raw) {
|
|
|
5590
5739
|
function BicInput({ value, onChange, onVerdict, accessibilityLabel, accessibilityHint, testID, rejectionLabels, placeholder, onBlur: onLeft }) {
|
|
5591
5740
|
const { theme } = uiFeedback.useUi();
|
|
5592
5741
|
const { colors } = theme;
|
|
5593
|
-
const draft =
|
|
5594
|
-
const validate =
|
|
5742
|
+
const draft = React39.useMemo(() => draftBic(value), [value]);
|
|
5743
|
+
const validate = React39.useCallback(() => validateBic(value), [value]);
|
|
5595
5744
|
const { verdict, onEdit, onLeave } = useBlurVerdict(validate);
|
|
5596
5745
|
const message = value === "" ? null : rejectionMessage(verdict?.rejection ?? null, "None" /* None */, rejectionLabels);
|
|
5597
|
-
const onChangeText =
|
|
5746
|
+
const onChangeText = React39.useCallback((text) => {
|
|
5598
5747
|
onEdit();
|
|
5599
5748
|
onVerdict?.(null);
|
|
5600
5749
|
onChange(draftBic(text).value);
|
|
5601
5750
|
}, [onEdit, onVerdict, onChange]);
|
|
5602
|
-
const onBlur =
|
|
5751
|
+
const onBlur = React39.useCallback(() => {
|
|
5603
5752
|
const verdict2 = onLeave();
|
|
5604
5753
|
onVerdict?.(value === "" ? null : verdict2);
|
|
5605
5754
|
onLeft?.();
|
|
@@ -5638,7 +5787,7 @@ var PAD_V = 10;
|
|
|
5638
5787
|
var PAD_H = 16;
|
|
5639
5788
|
var TEXT_SIZE2 = 13;
|
|
5640
5789
|
var TEXT_LINE2 = 18;
|
|
5641
|
-
var
|
|
5790
|
+
var styles35 = reactNative.StyleSheet.create({
|
|
5642
5791
|
bar: { borderTopWidth: 1, paddingHorizontal: PAD_H, paddingVertical: PAD_V, rowGap: BAR_GAP },
|
|
5643
5792
|
actions: { flexDirection: "row", flexWrap: "wrap", gap: BAR_GAP },
|
|
5644
5793
|
message: { fontSize: TEXT_SIZE2, fontWeight: "700", lineHeight: TEXT_LINE2 }
|
|
@@ -5650,9 +5799,9 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
|
|
|
5650
5799
|
const { colors } = theme;
|
|
5651
5800
|
const pinned = actionBarPosition(sticky, reactNative.Platform.OS) === "sticky" ? PINNED : null;
|
|
5652
5801
|
const hasMessage = message !== void 0 && message !== "";
|
|
5653
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
5654
|
-
hasMessage ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "status", style: [
|
|
5655
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5802
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles35.bar, { backgroundColor: colors.surface, borderTopColor: colors.border }, pinned, style], testID, children: [
|
|
5803
|
+
hasMessage ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "status", style: [styles35.message, { color: colors.text }], testID: `${testID}-message`, children: message }) : null,
|
|
5804
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles35.actions, children })
|
|
5656
5805
|
] });
|
|
5657
5806
|
};
|
|
5658
5807
|
|
|
@@ -5660,14 +5809,14 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
|
|
|
5660
5809
|
var isChecklistComplete = (items, checked) => items.every((item) => checked.includes(item.id));
|
|
5661
5810
|
var TITLE_SIZE = 13;
|
|
5662
5811
|
var TITLE_GAP = 6;
|
|
5663
|
-
var
|
|
5812
|
+
var styles36 = reactNative.StyleSheet.create({
|
|
5664
5813
|
title: { fontSize: TITLE_SIZE, fontWeight: "700", marginBottom: TITLE_GAP }
|
|
5665
5814
|
});
|
|
5666
5815
|
var GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = false, children }) => {
|
|
5667
5816
|
const { theme } = uiFeedback.useUi();
|
|
5668
5817
|
const complete = isChecklistComplete(items, checked);
|
|
5669
5818
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { testID, children: [
|
|
5670
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [
|
|
5819
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles36.title, { color: theme.colors.text }], children: title }),
|
|
5671
5820
|
items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5672
5821
|
FormCheckbox,
|
|
5673
5822
|
{
|
|
@@ -5683,7 +5832,7 @@ var GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = fals
|
|
|
5683
5832
|
children?.(complete)
|
|
5684
5833
|
] });
|
|
5685
5834
|
};
|
|
5686
|
-
var
|
|
5835
|
+
var MIN_TARGET_PX3 = 44;
|
|
5687
5836
|
var DOT_SIZE = 18;
|
|
5688
5837
|
var DOT_INNER = 8;
|
|
5689
5838
|
var ROW_GAP6 = 10;
|
|
@@ -5693,14 +5842,14 @@ var RADIUS2 = 8;
|
|
|
5693
5842
|
var LABEL_SIZE = 14;
|
|
5694
5843
|
var DESCRIPTION_SIZE = 12;
|
|
5695
5844
|
var DESCRIPTION_LINE = 16;
|
|
5696
|
-
var
|
|
5845
|
+
var styles37 = reactNative.StyleSheet.create({
|
|
5697
5846
|
row: {
|
|
5698
5847
|
alignItems: "center",
|
|
5699
5848
|
borderRadius: RADIUS2,
|
|
5700
5849
|
borderWidth: 1,
|
|
5701
5850
|
columnGap: ROW_GAP6,
|
|
5702
5851
|
flexDirection: "row",
|
|
5703
|
-
minHeight:
|
|
5852
|
+
minHeight: MIN_TARGET_PX3,
|
|
5704
5853
|
paddingHorizontal: PAD_H2,
|
|
5705
5854
|
paddingVertical: PAD_V2
|
|
5706
5855
|
},
|
|
@@ -5724,15 +5873,15 @@ function RadioRow({ option, identity, colors, tabIndex, hostRef, onPress }) {
|
|
|
5724
5873
|
accessibilityState: identity.accessibilityState,
|
|
5725
5874
|
"aria-checked": checked,
|
|
5726
5875
|
disabled,
|
|
5727
|
-
style: [
|
|
5876
|
+
style: [styles37.row, { borderColor: accent, backgroundColor: checked ? colors.tint : colors.muted }],
|
|
5728
5877
|
tabIndex,
|
|
5729
5878
|
testID: identity.testID,
|
|
5730
5879
|
onPress,
|
|
5731
5880
|
children: [
|
|
5732
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
5733
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5734
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
5735
|
-
hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
5881
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles37.dot, { borderColor: accent }], children: checked ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles37.dotInner, { backgroundColor: colors.primary }] }) : null }),
|
|
5882
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles37.text, children: [
|
|
5883
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles37.label, { color: checked ? colors.primary : colors.textStrong }], children: option.label }),
|
|
5884
|
+
hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles37.description, { color: colors.textMuted }], testID: `${identity.testID}-description`, children: option.description }) : null
|
|
5736
5885
|
] })
|
|
5737
5886
|
]
|
|
5738
5887
|
}
|
|
@@ -5749,20 +5898,20 @@ var radioRowIdentity = (option, selected, disabled, prefix) => {
|
|
|
5749
5898
|
};
|
|
5750
5899
|
};
|
|
5751
5900
|
var ROW_GAP7 = 8;
|
|
5752
|
-
var
|
|
5901
|
+
var styles38 = reactNative.StyleSheet.create({
|
|
5753
5902
|
list: { rowGap: ROW_GAP7 }
|
|
5754
5903
|
});
|
|
5755
5904
|
function RadioList(props) {
|
|
5756
5905
|
const { options, value, onChange, optionTestIDPrefix, label, error, required = false, disabled = false, testID } = props;
|
|
5757
5906
|
const { theme } = uiFeedback.useUi();
|
|
5758
|
-
const colors =
|
|
5907
|
+
const colors = React39__default.default.useMemo(() => buildChipColors(theme.colors, theme.palette), [theme.colors, theme.palette]);
|
|
5759
5908
|
const selectedIndex = options.findIndex((option) => option.value === value);
|
|
5760
5909
|
const radio = useRadioKeyboard({ enabled: true, disabled, values: options.map((option) => option.value), selectedIndex, onChange });
|
|
5761
5910
|
return /* @__PURE__ */ jsxRuntime.jsx(Field, { error, label, required, testID, children: ({ describedById, hasError }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5762
5911
|
reactNative.View,
|
|
5763
5912
|
{
|
|
5764
5913
|
accessibilityRole: "radiogroup",
|
|
5765
|
-
style:
|
|
5914
|
+
style: styles38.list,
|
|
5766
5915
|
...webFieldA11y({ describedById, hasError }),
|
|
5767
5916
|
...radio.groupProps,
|
|
5768
5917
|
children: options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5816,11 +5965,11 @@ function DecisionNote({ state, labels, testID, disabled }) {
|
|
|
5816
5965
|
);
|
|
5817
5966
|
}
|
|
5818
5967
|
var BUTTON_BASIS = "40%";
|
|
5819
|
-
var
|
|
5968
|
+
var styles39 = reactNative.StyleSheet.create({
|
|
5820
5969
|
cell: { flexBasis: BUTTON_BASIS, flexGrow: 1 }
|
|
5821
5970
|
});
|
|
5822
5971
|
function OutcomeButtons({ outcomes, pending, disabled, testID, onPress }) {
|
|
5823
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5972
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles39.cell, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5824
5973
|
uiButtons.Button,
|
|
5825
5974
|
{
|
|
5826
5975
|
fullWidth: true,
|
|
@@ -5901,21 +6050,21 @@ function StickyBarDecision(props) {
|
|
|
5901
6050
|
}
|
|
5902
6051
|
var TEXT_SIZE3 = 13;
|
|
5903
6052
|
var TEXT_LINE3 = 18;
|
|
5904
|
-
var
|
|
6053
|
+
var styles40 = reactNative.StyleSheet.create({
|
|
5905
6054
|
text: { fontSize: TEXT_SIZE3, fontWeight: "700", lineHeight: TEXT_LINE3 }
|
|
5906
6055
|
});
|
|
5907
6056
|
var SubmitError = ({ message, testID }) => {
|
|
5908
6057
|
const { theme } = uiFeedback.useUi();
|
|
5909
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [
|
|
6058
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [styles40.text, { color: fieldErrorInk(theme) }], testID, children: message });
|
|
5910
6059
|
};
|
|
5911
6060
|
var toggle = (list, id) => list.includes(id) ? list.filter((item) => item !== id) : [...list, id];
|
|
5912
6061
|
function useDecisionPanel(outcomes, onSubmit) {
|
|
5913
|
-
const [outcome, setOutcome] =
|
|
5914
|
-
const [note, setNote] =
|
|
5915
|
-
const [reasons, setReasons] =
|
|
5916
|
-
const [checked, setChecked] =
|
|
5917
|
-
const [error, setError] =
|
|
5918
|
-
const [pending, setPending] =
|
|
6062
|
+
const [outcome, setOutcome] = React39__default.default.useState("");
|
|
6063
|
+
const [note, setNote] = React39__default.default.useState("");
|
|
6064
|
+
const [reasons, setReasons] = React39__default.default.useState([]);
|
|
6065
|
+
const [checked, setChecked] = React39__default.default.useState([]);
|
|
6066
|
+
const [error, setError] = React39__default.default.useState(null);
|
|
6067
|
+
const [pending, setPending] = React39__default.default.useState(null);
|
|
5919
6068
|
const submit = async (override) => {
|
|
5920
6069
|
const target = override ?? outcome;
|
|
5921
6070
|
const problem = validateDecision(outcomes, target, note);
|
|
@@ -5949,7 +6098,7 @@ function useDecisionPanel(outcomes, onSubmit) {
|
|
|
5949
6098
|
}
|
|
5950
6099
|
var TITLE_SIZE2 = 15;
|
|
5951
6100
|
var PANEL_GAP = 12;
|
|
5952
|
-
var
|
|
6101
|
+
var styles41 = reactNative.StyleSheet.create({
|
|
5953
6102
|
panel: { rowGap: PANEL_GAP },
|
|
5954
6103
|
title: { fontSize: TITLE_SIZE2, fontWeight: "700" }
|
|
5955
6104
|
});
|
|
@@ -5963,8 +6112,8 @@ function DecisionPanel(props) {
|
|
|
5963
6112
|
const { theme } = uiFeedback.useUi();
|
|
5964
6113
|
const state = useDecisionPanel(outcomes, onSubmit);
|
|
5965
6114
|
const body = (locked) => renderVariant(variant, { state, outcomes, labels, testID, disabled: disabled || locked, reasons, leadOutcome });
|
|
5966
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
5967
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [
|
|
6115
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles41.panel, style], testID, children: [
|
|
6116
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles41.title, { color: theme.colors.text }], children: labels.title }),
|
|
5968
6117
|
checklist !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(GatedChecklist, { checked: state.checked, items: checklist.items, testID: `${testID}-checklist`, title: checklist.title, onToggle: state.toggleCheck, children: (complete) => body(!complete) }) : body(false),
|
|
5969
6118
|
state.error === "submit" ? /* @__PURE__ */ jsxRuntime.jsx(SubmitError, { message: labels.submitError, testID: `${testID}-error` }) : null
|
|
5970
6119
|
] });
|
|
@@ -5991,22 +6140,22 @@ function ruleTone(met, flagUnmet) {
|
|
|
5991
6140
|
return flagUnmet ? "refused" /* Refused */ : "unmet" /* Unmet */;
|
|
5992
6141
|
}
|
|
5993
6142
|
var MARK_SIZE = 16;
|
|
5994
|
-
var
|
|
6143
|
+
var CHECK_SIZE2 = 12;
|
|
5995
6144
|
var RING_WIDTH = 1.5;
|
|
5996
6145
|
var POP_FROM = 0.6;
|
|
5997
6146
|
var POP_PEAK = 1.12;
|
|
5998
6147
|
var POP_UP_MS = 160;
|
|
5999
6148
|
var POP_SETTLE_MS = 100;
|
|
6000
|
-
var
|
|
6149
|
+
var styles42 = reactNative.StyleSheet.create({
|
|
6001
6150
|
mark: { width: MARK_SIZE, height: MARK_SIZE, borderRadius: MARK_SIZE / 2, alignItems: "center", justifyContent: "center" },
|
|
6002
6151
|
ring: { borderWidth: RING_WIDTH }
|
|
6003
6152
|
});
|
|
6004
6153
|
function RuleMark({ tone, colors }) {
|
|
6005
6154
|
const reduced = useReducedMotion();
|
|
6006
|
-
const scale =
|
|
6007
|
-
const wasMet =
|
|
6155
|
+
const scale = React39.useRef(new reactNative.Animated.Value(1)).current;
|
|
6156
|
+
const wasMet = React39.useRef(tone === "met" /* Met */);
|
|
6008
6157
|
const met = tone === "met" /* Met */;
|
|
6009
|
-
|
|
6158
|
+
React39.useEffect(() => {
|
|
6010
6159
|
const turnedMet = met && !wasMet.current;
|
|
6011
6160
|
wasMet.current = met;
|
|
6012
6161
|
if (!turnedMet || reduced) return;
|
|
@@ -6017,8 +6166,8 @@ function RuleMark({ tone, colors }) {
|
|
|
6017
6166
|
]).start();
|
|
6018
6167
|
}, [met, reduced, scale]);
|
|
6019
6168
|
const color = colors.mark[tone];
|
|
6020
|
-
const shape = met ? { backgroundColor: color } : [
|
|
6021
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: { transform: [{ scale }] }, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
6169
|
+
const shape = met ? { backgroundColor: color } : [styles42.ring, { borderColor: color }];
|
|
6170
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: { transform: [{ scale }] }, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles42.mark, shape], children: met ? /* @__PURE__ */ jsxRuntime.jsx(uiIcons.SvgIcon, { color: colors.onMark, name: "check", size: CHECK_SIZE2 }) : null }) });
|
|
6022
6171
|
}
|
|
6023
6172
|
var GAP8 = 6;
|
|
6024
6173
|
var ROW_GAP8 = 8;
|
|
@@ -6028,9 +6177,9 @@ var METER_HEIGHT = 4;
|
|
|
6028
6177
|
var RADIUS3 = 999;
|
|
6029
6178
|
var CHIP_PAD_V2 = 4;
|
|
6030
6179
|
var CHIP_PAD_H2 = 10;
|
|
6031
|
-
var
|
|
6180
|
+
var CHIP_BORDER2 = 1;
|
|
6032
6181
|
var HALF4 = "50%";
|
|
6033
|
-
var
|
|
6182
|
+
var styles43 = reactNative.StyleSheet.create({
|
|
6034
6183
|
column: { gap: GAP8 },
|
|
6035
6184
|
row: { flexDirection: "row", alignItems: "center", gap: ROW_GAP8 },
|
|
6036
6185
|
text: { fontSize: FONT5, lineHeight: LINE, flexShrink: 1 },
|
|
@@ -6039,38 +6188,38 @@ var styles41 = reactNative.StyleSheet.create({
|
|
|
6039
6188
|
grid: { flexDirection: "row", flexWrap: "wrap", rowGap: GAP8 },
|
|
6040
6189
|
cell: { flexBasis: HALF4, maxWidth: HALF4, paddingRight: GAP8 },
|
|
6041
6190
|
chips: { flexDirection: "row", flexWrap: "wrap", gap: GAP8 },
|
|
6042
|
-
chip: { borderRadius: RADIUS3, borderWidth:
|
|
6191
|
+
chip: { borderRadius: RADIUS3, borderWidth: CHIP_BORDER2, paddingVertical: CHIP_PAD_V2, paddingHorizontal: CHIP_PAD_H2 },
|
|
6043
6192
|
metPhrase: { fontWeight: "700", textDecorationLine: "underline" }
|
|
6044
6193
|
});
|
|
6045
6194
|
function RuleList({ rules, flagUnmet, colors, testID, listStyle, itemStyle, outlined = false }) {
|
|
6046
6195
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { role: "list", style: listStyle, testID, children: rules.map((rule) => {
|
|
6047
6196
|
const tone = ruleTone(rule.met, flagUnmet);
|
|
6048
6197
|
const outline = outlined ? { borderColor: colors.mark[tone] } : null;
|
|
6049
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { role: "listitem", style: [
|
|
6198
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { role: "listitem", style: [styles43.row, itemStyle, outline], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
|
|
6050
6199
|
/* @__PURE__ */ jsxRuntime.jsx(RuleMark, { colors, tone }),
|
|
6051
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
6200
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles43.text, { color: colors.text[tone] }], children: rule.label })
|
|
6052
6201
|
] }, rule.id);
|
|
6053
6202
|
}) });
|
|
6054
6203
|
}
|
|
6055
6204
|
function RulesChecklist(props) {
|
|
6056
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RuleList, { ...props, listStyle:
|
|
6205
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RuleList, { ...props, listStyle: styles43.column });
|
|
6057
6206
|
}
|
|
6058
6207
|
function RulesChips(props) {
|
|
6059
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RuleList, { ...props, outlined: true, itemStyle:
|
|
6208
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RuleList, { ...props, outlined: true, itemStyle: styles43.chip, listStyle: styles43.chips });
|
|
6060
6209
|
}
|
|
6061
6210
|
function RulesMeterGrid(props) {
|
|
6062
6211
|
const { rules, flagUnmet, colors, testID } = props;
|
|
6063
6212
|
const metCount = rules.filter((rule) => rule.met).length;
|
|
6064
6213
|
const unfilled = flagUnmet ? colors.mark.refused : colors.track;
|
|
6065
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
6066
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
6067
|
-
/* @__PURE__ */ jsxRuntime.jsx(RuleList, { ...props, itemStyle:
|
|
6214
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles43.column, children: [
|
|
6215
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles43.meter, testID: `${testID}-meter`, children: rules.map((rule, index) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles43.segment, { backgroundColor: index < metCount ? colors.mark.met : unfilled }] }, rule.id)) }),
|
|
6216
|
+
/* @__PURE__ */ jsxRuntime.jsx(RuleList, { ...props, itemStyle: styles43.cell, listStyle: styles43.grid })
|
|
6068
6217
|
] });
|
|
6069
6218
|
}
|
|
6070
6219
|
function RulesSentence({ rules, flagUnmet, colors, testID }) {
|
|
6071
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
6220
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles43.text, { color: colors.text.unmet }], testID, children: rules.map((rule, index) => {
|
|
6072
6221
|
const tone = ruleTone(rule.met, flagUnmet);
|
|
6073
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [{ color: colors.text[tone] }, rule.met ?
|
|
6222
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [{ color: colors.text[tone] }, rule.met ? styles43.metPhrase : null], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
|
|
6074
6223
|
index > 0 ? ", " : "",
|
|
6075
6224
|
rule.label
|
|
6076
6225
|
] }, rule.id);
|
|
@@ -6089,7 +6238,7 @@ function PasswordRules({ display, ...variant }) {
|
|
|
6089
6238
|
}
|
|
6090
6239
|
}
|
|
6091
6240
|
var ICON_SIZE = 20;
|
|
6092
|
-
var
|
|
6241
|
+
var styles44 = reactNative.StyleSheet.create({
|
|
6093
6242
|
button: { width: a11y.MIN_TOUCH_TARGET_PX, height: a11y.MIN_TOUCH_TARGET_PX, alignItems: "center", justifyContent: "center" }
|
|
6094
6243
|
});
|
|
6095
6244
|
function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, color, testID }) {
|
|
@@ -6101,7 +6250,7 @@ function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, col
|
|
|
6101
6250
|
accessibilityLabel: label,
|
|
6102
6251
|
accessibilityRole: "button",
|
|
6103
6252
|
"aria-pressed": revealed,
|
|
6104
|
-
style:
|
|
6253
|
+
style: styles44.button,
|
|
6105
6254
|
testID,
|
|
6106
6255
|
onPress: onToggle,
|
|
6107
6256
|
onPressIn,
|
|
@@ -6121,9 +6270,9 @@ function ruleAnnouncement(changed, labels) {
|
|
|
6121
6270
|
|
|
6122
6271
|
// src/PasswordField/usePasswordRuleAnnouncement.ts
|
|
6123
6272
|
function usePasswordRuleAnnouncement(rules, labels) {
|
|
6124
|
-
const previous =
|
|
6125
|
-
const [message, setMessage] =
|
|
6126
|
-
|
|
6273
|
+
const previous = React39.useRef(rules);
|
|
6274
|
+
const [message, setMessage] = React39.useState("");
|
|
6275
|
+
React39.useEffect(() => {
|
|
6127
6276
|
const changed = changedRules(previous.current, rules);
|
|
6128
6277
|
previous.current = rules;
|
|
6129
6278
|
if (changed.length > 0) setMessage(ruleAnnouncement(changed, labels));
|
|
@@ -6140,7 +6289,7 @@ function ruleColorsFrom(palette) {
|
|
|
6140
6289
|
}
|
|
6141
6290
|
function useRuleColors(override) {
|
|
6142
6291
|
const { theme } = uiFeedback.useUi();
|
|
6143
|
-
return
|
|
6292
|
+
return React39.useMemo(() => {
|
|
6144
6293
|
if (override !== void 0) return ruleColorsFrom(override);
|
|
6145
6294
|
return ruleColorsFrom({
|
|
6146
6295
|
success: theme.semantic.success?.["500"] ?? theme.colors.text,
|
|
@@ -6155,7 +6304,7 @@ function useRuleColors(override) {
|
|
|
6155
6304
|
var RULES_GAP = 8;
|
|
6156
6305
|
var TOGGLE_INSET = 48;
|
|
6157
6306
|
var NO_RULES = [];
|
|
6158
|
-
var
|
|
6307
|
+
var styles45 = reactNative.StyleSheet.create({
|
|
6159
6308
|
inputRow: { position: "relative", justifyContent: "center" },
|
|
6160
6309
|
input: { paddingRight: TOGGLE_INSET },
|
|
6161
6310
|
toggle: { position: "absolute", right: 0, top: 0, bottom: 0, justifyContent: "center" },
|
|
@@ -6167,16 +6316,16 @@ function joinIds(...ids) {
|
|
|
6167
6316
|
return joined === "" ? void 0 : joined;
|
|
6168
6317
|
}
|
|
6169
6318
|
function useCaretKeepingToggle(inputRef, initialLength) {
|
|
6170
|
-
const [revealed, setRevealed] =
|
|
6171
|
-
const selection2 =
|
|
6172
|
-
const hadFocus =
|
|
6173
|
-
const onSelectionChange =
|
|
6319
|
+
const [revealed, setRevealed] = React39.useState(false);
|
|
6320
|
+
const selection2 = React39.useRef({ start: initialLength, end: initialLength });
|
|
6321
|
+
const hadFocus = React39.useRef(false);
|
|
6322
|
+
const onSelectionChange = React39.useCallback((event) => {
|
|
6174
6323
|
selection2.current = event.nativeEvent.selection;
|
|
6175
6324
|
}, []);
|
|
6176
|
-
const onPressIn =
|
|
6325
|
+
const onPressIn = React39.useCallback(() => {
|
|
6177
6326
|
hadFocus.current = inputRef.current?.isFocused?.() ?? false;
|
|
6178
6327
|
}, [inputRef]);
|
|
6179
|
-
const onToggle =
|
|
6328
|
+
const onToggle = React39.useCallback(() => {
|
|
6180
6329
|
setRevealed((current) => !current);
|
|
6181
6330
|
if (!hadFocus.current) return;
|
|
6182
6331
|
const node = inputRef.current;
|
|
@@ -6188,16 +6337,16 @@ function useCaretKeepingToggle(inputRef, initialLength) {
|
|
|
6188
6337
|
}, [inputRef]);
|
|
6189
6338
|
return { revealed, onPressIn, onToggle, onSelectionChange };
|
|
6190
6339
|
}
|
|
6191
|
-
var PasswordField =
|
|
6192
|
-
const inputRef =
|
|
6193
|
-
|
|
6340
|
+
var PasswordField = React39__default.default.forwardRef(function PasswordField2({ label, value, onChangeText, labels, testID, rules = NO_RULES, rulesDisplay = "meterGrid" /* MeterGrid */, flagUnmet = false, error, colors: colorOverride, inputProps }, ref) {
|
|
6341
|
+
const inputRef = React39.useRef(null);
|
|
6342
|
+
React39.useImperativeHandle(ref, () => inputRef.current);
|
|
6194
6343
|
const toggle2 = useCaretKeepingToggle(inputRef, value.length);
|
|
6195
6344
|
const colors = useRuleColors(colorOverride);
|
|
6196
6345
|
const announcement = usePasswordRuleAnnouncement(rules, labels);
|
|
6197
6346
|
const rulesId = `${testID}-rules`;
|
|
6198
6347
|
const hasRules = rules.length > 0;
|
|
6199
6348
|
return /* @__PURE__ */ jsxRuntime.jsx(Field, { error, label, testID: `${testID}-field`, children: (context) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
|
|
6200
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
6349
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles45.inputRow, children: [
|
|
6201
6350
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6202
6351
|
ThemedTextInput,
|
|
6203
6352
|
{
|
|
@@ -6209,18 +6358,18 @@ var PasswordField = React38__default.default.forwardRef(function PasswordField2(
|
|
|
6209
6358
|
hasError: context.hasError || flagUnmet && rules.some((rule) => !rule.met),
|
|
6210
6359
|
id: context.controlId,
|
|
6211
6360
|
secureTextEntry: !toggle2.revealed,
|
|
6212
|
-
style: [
|
|
6361
|
+
style: [styles45.input, inputProps?.style],
|
|
6213
6362
|
testID,
|
|
6214
6363
|
value,
|
|
6215
6364
|
onChangeText,
|
|
6216
6365
|
onSelectionChange: toggle2.onSelectionChange
|
|
6217
6366
|
}
|
|
6218
6367
|
),
|
|
6219
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
6368
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles45.toggle, children: /* @__PURE__ */ jsxRuntime.jsx(RevealToggle, { color: colors.text.unmet, hideLabel: labels.hide, revealed: toggle2.revealed, showLabel: labels.show, testID: `${testID}-reveal`, onPressIn: toggle2.onPressIn, onToggle: toggle2.onToggle }) })
|
|
6220
6369
|
] }),
|
|
6221
|
-
hasRules ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { nativeID: rulesId, style:
|
|
6370
|
+
hasRules ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { nativeID: rulesId, style: styles45.rules, children: [
|
|
6222
6371
|
/* @__PURE__ */ jsxRuntime.jsx(PasswordRules, { colors, display: rulesDisplay, flagUnmet, rules, testID: rulesId }),
|
|
6223
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-live": "polite", accessibilityLiveRegion: "polite", style:
|
|
6372
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-live": "polite", accessibilityLiveRegion: "polite", style: styles45.live, testID: `${testID}-announce`, children: announcement })
|
|
6224
6373
|
] }) : null
|
|
6225
6374
|
] }) });
|
|
6226
6375
|
});
|