@dloizides/ui-forms 1.46.0 → 1.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import React37, { forwardRef, createContext, useRef, useImperativeHandle, useState, useCallback, useMemo, useEffect, useLayoutEffect, useContext } from 'react';
1
+ import React38, { forwardRef, createContext, useRef, useImperativeHandle, useState, useCallback, useMemo, useEffect, useLayoutEffect, useContext } from 'react';
2
2
  import { Platform, StyleSheet, TextInput, View, Text, Pressable, useWindowDimensions, ScrollView, Animated, Easing, AccessibilityInfo, Switch, Image, TouchableOpacity, Modal } from 'react-native';
3
3
  import { useUi } from '@dloizides/ui-feedback';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -6,13 +6,13 @@ import { Z_INDEX, focusRingOutline, readableScaleInk, resolveOnBrand } from '@dl
6
6
  import { themeFocusRingColor, Button, useFocusRing, IconButton } from '@dloizides/ui-buttons';
7
7
  import { createPortal } from 'react-dom';
8
8
  import { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';
9
+ import { SvgIcon } from '@dloizides/ui-icons';
9
10
  import { parseFieldErrors } from '@dloizides/api-client-base';
10
11
  import Svg, { Rect, Circle, Polygon } from 'react-native-svg';
11
- import { SvgIcon } from '@dloizides/ui-icons';
12
12
 
13
13
  // src/Field/Field.tsx
14
14
  function attachControlId(child, candidateId, describedById) {
15
- if (!React37.isValidElement(child) || child.type === React37.Fragment) {
15
+ if (!React38.isValidElement(child) || child.type === React38.Fragment) {
16
16
  return { node: child };
17
17
  }
18
18
  const props = child.props;
@@ -23,7 +23,7 @@ function attachControlId(child, candidateId, describedById) {
23
23
  if (describedById !== void 0 && props.describedById === void 0) {
24
24
  injected.describedById = describedById;
25
25
  }
26
- return { node: React37.cloneElement(element, injected), controlId };
26
+ return { node: React38.cloneElement(element, injected), controlId };
27
27
  }
28
28
  var IS_WEB = Platform.OS === "web";
29
29
  function isAttributeHost(node) {
@@ -118,6 +118,8 @@ var FIELD_FONT_WEIGHT = "600";
118
118
  var CONTROL_FONT_SIZE = 11;
119
119
  var CONTROL_FONT_WEIGHT = "700";
120
120
  var CONTROL_LETTER_SPACING = 0.4;
121
+ var CAPTION_FONT_SIZE = 12;
122
+ var CAPTION_FONT_WEIGHT = "600";
121
123
  var labelVariantStyles = StyleSheet.create({
122
124
  field: {
123
125
  fontSize: FIELD_FONT_SIZE,
@@ -128,20 +130,26 @@ var labelVariantStyles = StyleSheet.create({
128
130
  fontWeight: CONTROL_FONT_WEIGHT,
129
131
  letterSpacing: CONTROL_LETTER_SPACING,
130
132
  textTransform: "uppercase"
133
+ },
134
+ caption: {
135
+ fontSize: CAPTION_FONT_SIZE,
136
+ fontWeight: CAPTION_FONT_WEIGHT,
137
+ letterSpacing: CONTROL_LETTER_SPACING,
138
+ textTransform: "uppercase"
131
139
  }
132
140
  });
133
141
  function resolveLabelVariantStyle(variant) {
134
- return variant === "control" ? labelVariantStyles.control : labelVariantStyles.field;
142
+ return labelVariantStyles[variant ?? "field"] ?? labelVariantStyles.field;
135
143
  }
136
- var FormGridContext = React37.createContext(null);
137
- var GapOwnedContext = React37.createContext(false);
144
+ var FormGridContext = React38.createContext(null);
145
+ var GapOwnedContext = React38.createContext(false);
138
146
  var FormGridProvider = FormGridContext.Provider;
139
147
  var GapOwnedProvider = GapOwnedContext.Provider;
140
148
  function useFormGridMetrics() {
141
- return React37.useContext(FormGridContext);
149
+ return React38.useContext(FormGridContext);
142
150
  }
143
151
  function useIsGapOwned() {
144
- return React37.useContext(GapOwnedContext);
152
+ return React38.useContext(GapOwnedContext);
145
153
  }
146
154
  var ERROR_LIGHT_STEPS = ["500", "600", "700"];
147
155
  var ERROR_DARK_STEPS = ["300", "200", "400", "100", "500"];
@@ -164,7 +172,7 @@ var styles = StyleSheet.create({
164
172
  });
165
173
  var fieldSeq = 0;
166
174
  function useFieldIds() {
167
- const [ids] = React37.useState(() => {
175
+ const [ids] = React38.useState(() => {
168
176
  fieldSeq += 1;
169
177
  const seq = String(fieldSeq);
170
178
  return {
@@ -211,7 +219,7 @@ var Field = ({
211
219
  const hasLabel = labelText !== "";
212
220
  const marker = resolveFieldMarker(required, optional);
213
221
  const { hintId, errorId, controlId, labelId } = useFieldIds();
214
- const themeStyles = React37.useMemo(
222
+ const themeStyles = React38.useMemo(
215
223
  () => ({
216
224
  label: { color: colors.textSecondary },
217
225
  requiredMark: { color: errorColor },
@@ -263,7 +271,7 @@ var FormGrid = ({
263
271
  style,
264
272
  testID
265
273
  }) => {
266
- const metrics = React37.useMemo(() => ({ minWidth, basis }), [minWidth, basis]);
274
+ const metrics = React38.useMemo(() => ({ minWidth, basis }), [minWidth, basis]);
267
275
  return /* @__PURE__ */ jsx(FormGridProvider, { value: metrics, children: /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsx(View, { style: [styles2.grid, { gap }, style], testID, children }) }) });
268
276
  };
269
277
  var LABEL_LINE_PLACEHOLDER = "\xA0";
@@ -530,7 +538,7 @@ var styles9 = StyleSheet.create({
530
538
  });
531
539
  var sectionSeq = 0;
532
540
  function useSectionLegendId() {
533
- const [id] = React37.useState(() => {
541
+ const [id] = React38.useState(() => {
534
542
  sectionSeq += 1;
535
543
  return `form-section-legend-${String(sectionSeq)}`;
536
544
  });
@@ -924,7 +932,7 @@ function AnchoredMenu({
924
932
  listbox,
925
933
  placement
926
934
  }) {
927
- const menuRef = React37.useRef(null);
935
+ const menuRef = React38.useRef(null);
928
936
  useDismiss(anchorRef, menuRef, onDismiss);
929
937
  useKeepHighlightInView(testID, listbox?.highlightedValue);
930
938
  const rect2 = useAnchorRect(placement?.positionRef ?? anchorRef, usePortal);
@@ -1084,7 +1092,7 @@ var boxStyles = StyleSheet.create({
1084
1092
  textAlignVertical: "top"
1085
1093
  }
1086
1094
  });
1087
- var ThemedTextInput = React37.forwardRef(function ThemedTextInput2({
1095
+ var ThemedTextInput = React38.forwardRef(function ThemedTextInput2({
1088
1096
  hasError = false,
1089
1097
  describedById,
1090
1098
  requiredField = false,
@@ -1323,6 +1331,7 @@ var PlainFormField = ({
1323
1331
  recentKey,
1324
1332
  recentMax,
1325
1333
  inputRef,
1334
+ labelVariant,
1326
1335
  ...textInputProps
1327
1336
  }) => /* @__PURE__ */ jsx(
1328
1337
  Field,
@@ -1330,6 +1339,7 @@ var PlainFormField = ({
1330
1339
  containerStyle,
1331
1340
  error,
1332
1341
  label: labelHidden ? void 0 : label,
1342
+ labelVariant,
1333
1343
  required,
1334
1344
  children: ({ describedById, hasError, controlId }) => {
1335
1345
  const inputProps = {
@@ -1400,19 +1410,57 @@ function chipLabelLayout(labelWrap) {
1400
1410
  return { boxStyle: CAPPED_BOX, textStyle: SHRINKING_TEXT, numberOfLines: SINGLE_LINE };
1401
1411
  return { boxStyle: void 0, textStyle: void 0, numberOfLines: void 0 };
1402
1412
  }
1413
+ var MIN_TARGET_PX = 44;
1414
+ var COMPACT_PAD_V = 4;
1415
+ var COMPACT_PAD_H = 10;
1416
+ var COMPACT_FONT_SIZE = 12;
1417
+ var COMPACT_LINE_HEIGHT = 18;
1418
+ var CHIP_BORDER = 1;
1419
+ var chipSizeStyles = StyleSheet.create({
1420
+ compactHitBox: {
1421
+ minHeight: MIN_TARGET_PX,
1422
+ minWidth: MIN_TARGET_PX,
1423
+ justifyContent: "center",
1424
+ alignItems: "center"
1425
+ },
1426
+ compactVisual: {
1427
+ paddingVertical: COMPACT_PAD_V,
1428
+ paddingHorizontal: COMPACT_PAD_H,
1429
+ minHeight: 0,
1430
+ minWidth: 0,
1431
+ borderWidth: CHIP_BORDER
1432
+ },
1433
+ compactText: {
1434
+ fontSize: COMPACT_FONT_SIZE,
1435
+ fontWeight: "600",
1436
+ lineHeight: COMPACT_LINE_HEIGHT
1437
+ }
1438
+ });
1439
+
1440
+ // src/ChipSelector/utils/chipLook.ts
1441
+ function chipFill({ selected, selectedFill, ink, rest }) {
1442
+ if (!selected || selectedFill === void 0)
1443
+ return { ...rest, checkColor: void 0 };
1444
+ return { backgroundColor: selectedFill, textColor: ink, checkColor: ink };
1445
+ }
1446
+ function chipSizeLook(size) {
1447
+ if (size !== "compact")
1448
+ return { hitBox: void 0, visual: void 0, text: void 0 };
1449
+ return { hitBox: chipSizeStyles.compactHitBox, visual: chipSizeStyles.compactVisual, text: chipSizeStyles.compactText };
1450
+ }
1403
1451
  var SOLID_RADIUS = 20;
1404
1452
  var OUTLINE_RADIUS = 999;
1405
1453
  var OUTLINE_PAD_H = 12;
1406
1454
  var OUTLINE_PAD_V = 5;
1407
1455
  var OUTLINE_FONT_SIZE = 13;
1408
1456
  var CHIP_ICON_GAP = 6;
1409
- var MIN_TARGET_PX = 44;
1457
+ var MIN_TARGET_PX2 = 44;
1410
1458
  var chipStyles = StyleSheet.create({
1411
1459
  chip: {
1412
1460
  paddingHorizontal: 12,
1413
1461
  paddingVertical: 6,
1414
- minHeight: MIN_TARGET_PX,
1415
- minWidth: MIN_TARGET_PX,
1462
+ minHeight: MIN_TARGET_PX2,
1463
+ minWidth: MIN_TARGET_PX2,
1416
1464
  justifyContent: "center",
1417
1465
  borderRadius: SOLID_RADIUS,
1418
1466
  backgroundColor: TRANSPARENT_COLOR,
@@ -1421,8 +1469,8 @@ var chipStyles = StyleSheet.create({
1421
1469
  chipOutline: {
1422
1470
  paddingHorizontal: OUTLINE_PAD_H,
1423
1471
  paddingVertical: OUTLINE_PAD_V,
1424
- minHeight: MIN_TARGET_PX,
1425
- minWidth: MIN_TARGET_PX,
1472
+ minHeight: MIN_TARGET_PX2,
1473
+ minWidth: MIN_TARGET_PX2,
1426
1474
  justifyContent: "center",
1427
1475
  borderRadius: OUTLINE_RADIUS,
1428
1476
  borderWidth: 1
@@ -1431,22 +1479,31 @@ var chipStyles = StyleSheet.create({
1431
1479
  chipText: {},
1432
1480
  chipTextOutline: { fontSize: OUTLINE_FONT_SIZE }
1433
1481
  });
1434
- function ChipContent({ icon, label, textStyle, numberOfLines }) {
1482
+ var CHECK_SIZE = 12;
1483
+ function ChipContent(props) {
1484
+ const { icon, label, textStyle, numberOfLines, checkColor } = props;
1435
1485
  const text = /* @__PURE__ */ jsx(Text, { numberOfLines, style: textStyle, children: label });
1436
- if (icon === void 0 || icon === null)
1486
+ const hasIcon = icon !== void 0 && icon !== null;
1487
+ if (!hasIcon && checkColor === void 0)
1437
1488
  return text;
1438
1489
  return /* @__PURE__ */ jsxs(View, { style: chipStyles.chipContent, children: [
1439
- /* @__PURE__ */ jsx(View, { "aria-hidden": true, children: icon }),
1490
+ checkColor === void 0 ? null : /* @__PURE__ */ jsx(View, { "aria-hidden": true, testID: props.checkTestID, children: /* @__PURE__ */ jsx(SvgIcon, { color: checkColor, name: "check", size: CHECK_SIZE }) }),
1491
+ hasIcon ? /* @__PURE__ */ jsx(View, { "aria-hidden": true, children: icon }) : null,
1440
1492
  text
1441
1493
  ] });
1442
1494
  }
1443
1495
  function OutlineChip(props) {
1444
1496
  const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;
1445
- const [hovered, setHovered] = React37.useState(false);
1497
+ const [hovered, setHovered] = React38.useState(false);
1446
1498
  const active = selected || hovered;
1447
1499
  const borderColor = active ? colors.primary : colors.border;
1448
- const backgroundColor = selected ? colors.tint : colors.muted;
1449
- const textColor = active ? colors.primary : colors.textMuted;
1500
+ const fill = chipFill({
1501
+ selected,
1502
+ selectedFill: props.selectedFill,
1503
+ ink: colors.textStrong,
1504
+ rest: { backgroundColor: selected ? colors.tint : colors.muted, textColor: active ? colors.primary : colors.textMuted }
1505
+ });
1506
+ const sized = chipSizeLook(props.size);
1450
1507
  const layout = chipLabelLayout(option.labelWrap);
1451
1508
  return /* @__PURE__ */ jsx(
1452
1509
  Pressable,
@@ -1460,19 +1517,21 @@ function OutlineChip(props) {
1460
1517
  "aria-pressed": props.ariaPressed,
1461
1518
  disabled,
1462
1519
  hitSlop: CHIP_HIT_SLOP,
1463
- style: layout.boxStyle,
1520
+ style: [sized.hitBox, layout.boxStyle],
1464
1521
  tabIndex: props.tabIndex,
1465
1522
  testID,
1466
1523
  onHoverIn: () => setHovered(true),
1467
1524
  onHoverOut: () => setHovered(false),
1468
1525
  onPress,
1469
- children: /* @__PURE__ */ jsx(View, { style: [chipStyles.chipOutline, { borderColor, backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsx(
1526
+ children: /* @__PURE__ */ jsx(View, { style: [chipStyles.chipOutline, sized.visual, { borderColor, backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsx(
1470
1527
  ChipContent,
1471
1528
  {
1529
+ checkColor: fill.checkColor,
1530
+ checkTestID: `${testID}-check`,
1472
1531
  icon: option.icon,
1473
1532
  label: option.label,
1474
1533
  numberOfLines: layout.numberOfLines,
1475
- textStyle: [chipStyles.chipText, chipStyles.chipTextOutline, { color: textColor }, layout.textStyle]
1534
+ textStyle: [chipStyles.chipText, chipStyles.chipTextOutline, sized.text, { color: fill.textColor }, layout.textStyle]
1476
1535
  }
1477
1536
  ) })
1478
1537
  }
@@ -1480,8 +1539,13 @@ function OutlineChip(props) {
1480
1539
  }
1481
1540
  function SolidChip(props) {
1482
1541
  const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;
1483
- const backgroundColor = selected ? colors.primary : TRANSPARENT_COLOR;
1484
- const textColor = selected ? colors.onPrimary : colors.textStrong;
1542
+ const fill = chipFill({
1543
+ selected,
1544
+ selectedFill: props.selectedFill,
1545
+ ink: colors.textStrong,
1546
+ rest: { backgroundColor: selected ? colors.primary : TRANSPARENT_COLOR, textColor: selected ? colors.onPrimary : colors.textStrong }
1547
+ });
1548
+ const sized = chipSizeLook(props.size);
1485
1549
  const layout = chipLabelLayout(option.labelWrap);
1486
1550
  const rovingTabStop = { tabIndex: props.tabIndex };
1487
1551
  return /* @__PURE__ */ jsx(
@@ -1496,17 +1560,19 @@ function SolidChip(props) {
1496
1560
  "aria-pressed": props.ariaPressed,
1497
1561
  disabled,
1498
1562
  hitSlop: CHIP_HIT_SLOP,
1499
- style: layout.boxStyle,
1563
+ style: [sized.hitBox, layout.boxStyle],
1500
1564
  testID,
1501
1565
  onPress,
1502
1566
  ...rovingTabStop,
1503
- children: /* @__PURE__ */ jsx(View, { style: [chipStyles.chip, { borderColor: colors.border, backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsx(
1567
+ children: /* @__PURE__ */ jsx(View, { style: [chipStyles.chip, sized.visual, { borderColor: colors.border, backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsx(
1504
1568
  ChipContent,
1505
1569
  {
1570
+ checkColor: fill.checkColor,
1571
+ checkTestID: `${testID}-check`,
1506
1572
  icon: option.icon,
1507
1573
  label: option.label,
1508
1574
  numberOfLines: layout.numberOfLines,
1509
- textStyle: [chipStyles.chipText, { color: textColor }, layout.textStyle]
1575
+ textStyle: [chipStyles.chipText, sized.text, { color: fill.textColor }, layout.textStyle]
1510
1576
  }
1511
1577
  ) })
1512
1578
  }
@@ -1542,8 +1608,8 @@ function radioTabIndex(index, selectedIndex, disabled) {
1542
1608
  var NO_GROUP_PROPS = {};
1543
1609
  function useRadioKeyboard(config) {
1544
1610
  const { enabled, disabled, values, selectedIndex, onChange } = config;
1545
- const nodes = React37.useRef([]);
1546
- const chipRef = React37.useCallback((index) => (node) => {
1611
+ const nodes = React38.useRef([]);
1612
+ const chipRef = React38.useCallback((index) => (node) => {
1547
1613
  nodes.current[index] = node;
1548
1614
  }, []);
1549
1615
  const onKeyDown = (event) => {
@@ -1651,12 +1717,14 @@ var ChipSelector = ({
1651
1717
  testID,
1652
1718
  chipTestIDPrefix = DEFAULT_CHIP_TESTID_PREFIX,
1653
1719
  optionAccessibilityHint,
1654
- singleSelectRole = "button"
1720
+ singleSelectRole = "button",
1721
+ size = "default",
1722
+ selectedFill
1655
1723
  }) => {
1656
1724
  const isRadioGroup = !multiple && singleSelectRole === "radio";
1657
1725
  const { theme } = useUi();
1658
1726
  const { colors, palette } = theme;
1659
- const chipColors = React37.useMemo(() => buildChipColors(colors, palette), [colors, palette]);
1727
+ const chipColors = React38.useMemo(() => buildChipColors(colors, palette), [colors, palette]);
1660
1728
  function isSelected(optionValue) {
1661
1729
  if (multiple && Array.isArray(value))
1662
1730
  return value.includes(optionValue);
@@ -1676,6 +1744,8 @@ var ChipSelector = ({
1676
1744
  disabled,
1677
1745
  option,
1678
1746
  selected,
1747
+ size,
1748
+ selectedFill,
1679
1749
  ...chipIdentity(option, selected, {
1680
1750
  prefix: chipTestIDPrefix,
1681
1751
  hint: optionAccessibilityHint,
@@ -1752,12 +1822,12 @@ var FormSwitch = ({
1752
1822
  accessibilityHint
1753
1823
  }) => {
1754
1824
  const { theme } = useUi();
1755
- const toggle2 = React37.useCallback(() => {
1825
+ const toggle2 = React38.useCallback(() => {
1756
1826
  if (!disabled) onValueChange(!value);
1757
1827
  }, [disabled, onValueChange, value]);
1758
1828
  const { colors } = theme;
1759
1829
  const hasDescription = typeof description === "string" && description !== "";
1760
- const themeStyles = React37.useMemo(() => {
1830
+ const themeStyles = React38.useMemo(() => {
1761
1831
  const labelStyle = { color: colors.text };
1762
1832
  const descriptionStyle = { color: colors.textSecondary };
1763
1833
  return { label: labelStyle, description: descriptionStyle };
@@ -1886,8 +1956,8 @@ var FormCheckbox = ({
1886
1956
  const hintText = typeof hint === "string" && hint !== "" ? hint : description;
1887
1957
  const hasHint = typeof hintText === "string" && hintText !== "";
1888
1958
  const { hintId } = useFieldIds();
1889
- const [focused, setFocused] = React37.useState(false);
1890
- const themeStyles = React37.useMemo(() => {
1959
+ const [focused, setFocused] = React38.useState(false);
1960
+ const themeStyles = React38.useMemo(() => {
1891
1961
  const boxOn = checkboxBoxColors(colors, brand, true);
1892
1962
  const boxOff = checkboxBoxColors(colors, brand, false);
1893
1963
  const ring = { borderColor: brand };
@@ -2131,10 +2201,11 @@ var SelectField = ({
2131
2201
  value,
2132
2202
  options,
2133
2203
  onChange,
2134
- testID
2204
+ testID,
2205
+ labelVariant
2135
2206
  }) => {
2136
2207
  const selected = options.find((option) => option.value === value)?.label ?? "";
2137
- return /* @__PURE__ */ jsx(Field, { label, children: ({ labelId }) => /* @__PURE__ */ jsx(
2208
+ return /* @__PURE__ */ jsx(Field, { label, labelVariant, children: ({ labelId }) => /* @__PURE__ */ jsx(
2138
2209
  SelectControl,
2139
2210
  {
2140
2211
  accessibilityHint,
@@ -2147,6 +2218,145 @@ var SelectField = ({
2147
2218
  }
2148
2219
  ) });
2149
2220
  };
2221
+ var REMOVE_GLYPH = "\xD7";
2222
+ var CHIP_GAP = 4;
2223
+ var CHIP_PAD_H = 8;
2224
+ var CHIP_PAD_V = 4;
2225
+ var CHIP_RADIUS = 999;
2226
+ var CHIP_FONT = 13;
2227
+ var styles16 = StyleSheet.create({
2228
+ chip: {
2229
+ flexDirection: "row",
2230
+ alignItems: "center",
2231
+ gap: CHIP_GAP,
2232
+ paddingHorizontal: CHIP_PAD_H,
2233
+ paddingVertical: CHIP_PAD_V,
2234
+ borderWidth: 1,
2235
+ borderRadius: CHIP_RADIUS,
2236
+ maxWidth: "100%"
2237
+ },
2238
+ text: { fontSize: CHIP_FONT, flexShrink: 1 }
2239
+ });
2240
+ function SelectedChip({ option, colors, removeLabel, removeHint, onRemove, testID }) {
2241
+ return /* @__PURE__ */ jsxs(
2242
+ Pressable,
2243
+ {
2244
+ accessibilityHint: removeHint,
2245
+ accessibilityLabel: removeLabel,
2246
+ accessibilityRole: "button",
2247
+ hitSlop: CHIP_HIT_SLOP,
2248
+ style: [styles16.chip, { borderColor: colors.border, backgroundColor: colors.surface }],
2249
+ testID,
2250
+ onPress: () => onRemove(option.value),
2251
+ children: [
2252
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles16.text, { color: colors.text }], children: option.label }),
2253
+ /* @__PURE__ */ jsx(Text, { "aria-hidden": true, style: [styles16.text, { color: colors.text }], children: REMOVE_GLYPH })
2254
+ ]
2255
+ }
2256
+ );
2257
+ }
2258
+
2259
+ // src/MultiSelectField/utils/multiSelectValues.ts
2260
+ function addValue(values, value) {
2261
+ return values.includes(value) ? [...values] : [...values, value];
2262
+ }
2263
+ function removeValue(values, value) {
2264
+ return values.filter((current) => current !== value);
2265
+ }
2266
+ function selectedOptions(options, values) {
2267
+ return values.flatMap((value) => options.filter((option) => option.value === value));
2268
+ }
2269
+ function remainingOptions(options, values) {
2270
+ return options.filter((option) => !values.includes(option.value));
2271
+ }
2272
+ var CHEVRON_DOWN2 = "\u25BE";
2273
+ var CHEVRON_UP2 = "\u25B4";
2274
+ var BOX_GAP = 6;
2275
+ var TRIGGER_MIN_WIDTH = 96;
2276
+ var styles17 = StyleSheet.create({
2277
+ box: { flexWrap: "wrap", justifyContent: "flex-start", gap: BOX_GAP },
2278
+ trigger: {
2279
+ flexGrow: 1,
2280
+ flexDirection: "row",
2281
+ alignItems: "center",
2282
+ justifyContent: "space-between",
2283
+ minHeight: MIN_TOUCH_TARGET_PX,
2284
+ minWidth: TRIGGER_MIN_WIDTH
2285
+ }
2286
+ });
2287
+ function MultiSelectBox(props) {
2288
+ const { label, accessibilityHint, values, options, onChange, placeholder, chipLabels, testID, labelId } = props;
2289
+ const { colors, palette } = useUi().theme;
2290
+ const anchorRef = useRef(null);
2291
+ const [isOpen, setIsOpen] = useState(false);
2292
+ const chosen = selectedOptions(options, values);
2293
+ const remaining = remainingOptions(options, values);
2294
+ const close = useCallback(() => {
2295
+ setIsOpen(false);
2296
+ }, []);
2297
+ const toggle2 = useCallback(() => {
2298
+ setIsOpen((prev) => !prev);
2299
+ }, []);
2300
+ const add = useCallback((next) => {
2301
+ onChange(addValue(values, next));
2302
+ setIsOpen(false);
2303
+ }, [onChange, values]);
2304
+ const remove = useCallback((value) => {
2305
+ onChange(removeValue(values, value));
2306
+ }, [onChange, values]);
2307
+ const chipColors = { text: colors.text, border: colors.border, surface: colors.surface };
2308
+ const summary = chosen.map((option) => option.label).join(", ");
2309
+ return /* @__PURE__ */ jsxs(View, { ref: anchorRef, style: controlStyles.anchor, children: [
2310
+ /* @__PURE__ */ jsxs(View, { style: [controlStyles.selectTrigger, styles17.box, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }], testID: `${testID}-box`, children: [
2311
+ chosen.map((option) => /* @__PURE__ */ jsx(
2312
+ SelectedChip,
2313
+ {
2314
+ colors: chipColors,
2315
+ option,
2316
+ removeHint: chipLabels.removeHint,
2317
+ removeLabel: chipLabels.removeLabel(option.label),
2318
+ testID: `${testID}-chip-${option.value}`,
2319
+ onRemove: remove
2320
+ },
2321
+ option.value
2322
+ )),
2323
+ /* @__PURE__ */ jsxs(
2324
+ Pressable,
2325
+ {
2326
+ accessibilityHint,
2327
+ accessibilityLabel: `${label}: ${summary}`,
2328
+ accessibilityRole: "button",
2329
+ accessibilityState: { expanded: isOpen, disabled: remaining.length === 0 },
2330
+ "aria-expanded": isOpen,
2331
+ "aria-haspopup": "menu",
2332
+ "aria-labelledby": labelId,
2333
+ disabled: remaining.length === 0,
2334
+ style: styles17.trigger,
2335
+ testID: `${testID}-trigger`,
2336
+ onPress: toggle2,
2337
+ children: [
2338
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [controlStyles.selectTriggerText, { color: colors.textSecondary }], children: placeholder }),
2339
+ /* @__PURE__ */ jsx(Text, { "aria-hidden": true, style: [controlStyles.chevron, { color: colors.textSecondary }], children: isOpen ? CHEVRON_UP2 : CHEVRON_DOWN2 })
2340
+ ]
2341
+ }
2342
+ )
2343
+ ] }),
2344
+ isOpen ? /* @__PURE__ */ jsx(
2345
+ AnchoredMenu,
2346
+ {
2347
+ anchorRef,
2348
+ colors: { text: colors.text, border: colors.border, surface: colors.surface, brand: palette.primary["500"] },
2349
+ optionHint: accessibilityHint,
2350
+ options: remaining,
2351
+ selectedValue: "",
2352
+ testID,
2353
+ onDismiss: close,
2354
+ onSelect: add
2355
+ }
2356
+ ) : null
2357
+ ] });
2358
+ }
2359
+ var MultiSelectField = ({ labelVariant, hint, error, ...boxProps }) => /* @__PURE__ */ jsx(Field, { error, hint, label: boxProps.label, labelVariant, children: ({ labelId }) => /* @__PURE__ */ jsx(MultiSelectBox, { ...boxProps, labelId }) });
2150
2360
  var CLOSE_DELAY_MS2 = 140;
2151
2361
  function useDelayedBlurClose(open, close) {
2152
2362
  const timerRef = useRef(null);
@@ -2559,20 +2769,20 @@ function DropdownSurface({ progress, translateY, anchorRef, onDismiss, closeLabe
2559
2769
  const place = frame === null ? null : { left: frame.left, width: frame.width, top: frame.top, bottom: frame.bottom };
2560
2770
  return /* @__PURE__ */ jsxs(Modal, { transparent: true, visible: true, animationType: "none", "aria-label": accessibilityLabel, onRequestClose: onDismiss, children: [
2561
2771
  /* @__PURE__ */ jsx(Pressable, { accessibilityHint: closeHint, accessibilityLabel: closeLabel, accessibilityRole: "button", style: StyleSheet.absoluteFill, testID: `${testID}-backdrop`, onPress: onDismiss }),
2562
- frame !== null ? /* @__PURE__ */ jsx(Animated.View, { style: [styles16.dropdown, place, { opacity: progress, transform: scale === void 0 ? [{ translateY }] : [{ translateY }, { scale }] }, scale === void 0 ? null : styles16.growFromField], testID: `${testID}-dropdown-${frame.placement}`, onLayout, children }) : null
2772
+ frame !== null ? /* @__PURE__ */ jsx(Animated.View, { style: [styles18.dropdown, place, { opacity: progress, transform: scale === void 0 ? [{ translateY }] : [{ translateY }, { scale }] }, scale === void 0 ? null : styles18.growFromField], testID: `${testID}-dropdown-${frame.placement}`, onLayout, children }) : null
2563
2773
  ] });
2564
2774
  }
2565
- var styles16 = StyleSheet.create({
2775
+ var styles18 = StyleSheet.create({
2566
2776
  dropdown: { position: "absolute" },
2567
2777
  growFromField: { transformOrigin: "top left" }
2568
2778
  });
2569
2779
  function SheetSurface({ translateY, onDismiss, closeLabel, closeHint, testID, children, progress, scale, accessibilityLabel }) {
2570
- return /* @__PURE__ */ jsx(Modal, { transparent: true, visible: true, animationType: "none", "aria-label": accessibilityLabel, onRequestClose: onDismiss, children: /* @__PURE__ */ jsxs(View, { style: styles17.backdrop, children: [
2780
+ return /* @__PURE__ */ jsx(Modal, { transparent: true, visible: true, animationType: "none", "aria-label": accessibilityLabel, onRequestClose: onDismiss, children: /* @__PURE__ */ jsxs(View, { style: styles19.backdrop, children: [
2571
2781
  /* @__PURE__ */ jsx(Pressable, { accessibilityHint: closeHint, accessibilityLabel: closeLabel, accessibilityRole: "button", style: StyleSheet.absoluteFill, testID: `${testID}-backdrop`, onPress: onDismiss }),
2572
- /* @__PURE__ */ jsx(Animated.View, { testID: `${testID}-sheet`, style: [styles17.sheet, { transform: scale === void 0 ? [{ translateY }] : [{ translateY }, { scale }] }, progress === void 0 ? null : { opacity: progress }], children })
2782
+ /* @__PURE__ */ jsx(Animated.View, { testID: `${testID}-sheet`, style: [styles19.sheet, { transform: scale === void 0 ? [{ translateY }] : [{ translateY }, { scale }] }, progress === void 0 ? null : { opacity: progress }], children })
2573
2783
  ] }) });
2574
2784
  }
2575
- var styles17 = StyleSheet.create({
2785
+ var styles19 = StyleSheet.create({
2576
2786
  backdrop: { flex: 1, justifyContent: "flex-end" },
2577
2787
  sheet: { width: "100%", alignSelf: "stretch" }
2578
2788
  });
@@ -3612,7 +3822,7 @@ var ROW_GAP = 4;
3612
3822
  var TAB_PADDING = 4;
3613
3823
  var INDICATOR_WIDTH = 2;
3614
3824
  var TAB_FONT_SIZE = 12;
3615
- var styles18 = StyleSheet.create({
3825
+ var styles20 = StyleSheet.create({
3616
3826
  row: { flexDirection: "row", flexWrap: "nowrap", gap: ROW_GAP },
3617
3827
  tab: {
3618
3828
  borderBottomWidth: INDICATOR_WIDTH,
@@ -3652,13 +3862,13 @@ var StepperTab = ({
3652
3862
  accessibilityRole: "tab",
3653
3863
  accessibilityState: { selected },
3654
3864
  "aria-selected": selected,
3655
- style: [styles18.tab, { borderBottomColor: indicator }, ring.ringStyle],
3865
+ style: [styles20.tab, { borderBottomColor: indicator }, ring.ringStyle],
3656
3866
  testID,
3657
3867
  onBlur: ring.onBlur,
3658
3868
  onFocus: ring.onFocus,
3659
3869
  onPress: () => onStep(step.key),
3660
3870
  ...webKeyProps,
3661
- children: /* @__PURE__ */ jsx(Text, { style: [styles18.text, { color: theme.colors.text }, selected ? styles18.textSelected : void 0], children: step.label })
3871
+ children: /* @__PURE__ */ jsx(Text, { style: [styles20.text, { color: theme.colors.text }, selected ? styles20.textSelected : void 0], children: step.label })
3662
3872
  }
3663
3873
  );
3664
3874
  };
@@ -3668,7 +3878,7 @@ var StepperTabs = ({
3668
3878
  onStep,
3669
3879
  stepHint,
3670
3880
  testID
3671
- }) => /* @__PURE__ */ jsx(View, { accessibilityRole: "tablist", style: styles18.row, testID, children: steps.map((step) => /* @__PURE__ */ jsx(
3881
+ }) => /* @__PURE__ */ jsx(View, { accessibilityRole: "tablist", style: styles20.row, testID, children: steps.map((step) => /* @__PURE__ */ jsx(
3672
3882
  StepperTab,
3673
3883
  {
3674
3884
  hint: stepHint,
@@ -3687,7 +3897,7 @@ function resolveStepNeighbours(steps, current) {
3687
3897
  return { previous: steps[index - 1] ?? null, next: steps[index + 1] ?? null };
3688
3898
  }
3689
3899
  var ROW_GAP2 = 8;
3690
- var styles19 = StyleSheet.create({
3900
+ var styles21 = StyleSheet.create({
3691
3901
  cell: { flex: 1, minWidth: 0 },
3692
3902
  row: { flexDirection: "row", gap: ROW_GAP2 }
3693
3903
  });
@@ -3699,8 +3909,8 @@ var StepperNav = ({
3699
3909
  testID
3700
3910
  }) => {
3701
3911
  const { previous, next } = resolveStepNeighbours(steps, current);
3702
- return /* @__PURE__ */ jsxs(View, { style: styles19.row, testID, children: [
3703
- /* @__PURE__ */ jsx(View, { style: styles19.cell, children: /* @__PURE__ */ jsx(
3912
+ return /* @__PURE__ */ jsxs(View, { style: styles21.row, testID, children: [
3913
+ /* @__PURE__ */ jsx(View, { style: styles21.cell, children: /* @__PURE__ */ jsx(
3704
3914
  Button,
3705
3915
  {
3706
3916
  fullWidth: true,
@@ -3716,7 +3926,7 @@ var StepperNav = ({
3716
3926
  }
3717
3927
  }
3718
3928
  ) }),
3719
- next === null ? null : /* @__PURE__ */ jsx(View, { style: styles19.cell, children: /* @__PURE__ */ jsx(
3929
+ next === null ? null : /* @__PURE__ */ jsx(View, { style: styles21.cell, children: /* @__PURE__ */ jsx(
3720
3930
  Button,
3721
3931
  {
3722
3932
  fullWidth: true,
@@ -3731,13 +3941,13 @@ var StepperNav = ({
3731
3941
  ] });
3732
3942
  };
3733
3943
  var STATUS_FONT = 16;
3734
- var styles20 = StyleSheet.create({
3944
+ var styles22 = StyleSheet.create({
3735
3945
  line: { fontSize: STATUS_FONT }
3736
3946
  });
3737
3947
  function FormStatusLine({ message, testID, style }) {
3738
3948
  const { theme } = useUi();
3739
3949
  if (message === null || message === void 0 || message === "") return null;
3740
- return /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles20.line, { color: theme.colors.text }, style], testID, children: message });
3950
+ return /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles22.line, { color: theme.colors.text }, style], testID, children: message });
3741
3951
  }
3742
3952
  function useFocusFirstInvalid(refs) {
3743
3953
  const latest = useRef(refs);
@@ -3826,7 +4036,7 @@ function useKeepInView(trigger) {
3826
4036
  }
3827
4037
  var IS_WEB10 = Platform.OS === "web";
3828
4038
  var INPUT_FONT2 = 14;
3829
- var styles21 = StyleSheet.create({
4039
+ var styles23 = StyleSheet.create({
3830
4040
  nativeButton: { minHeight: MIN_TOUCH_TARGET_PX, minWidth: MIN_TOUCH_TARGET_PX, justifyContent: "center" },
3831
4041
  nativeText: { fontSize: INPUT_FONT2 }
3832
4042
  });
@@ -3854,10 +4064,10 @@ function FileInput({
3854
4064
  accessibilityRole: "button",
3855
4065
  accessibilityState: { disabled },
3856
4066
  disabled,
3857
- style: styles21.nativeButton,
4067
+ style: styles23.nativeButton,
3858
4068
  testID,
3859
4069
  onPress: onNativePick,
3860
- children: /* @__PURE__ */ jsx(Text, { style: [styles21.nativeText, { color: colors.text }], children: nativeLabel ?? accessibilityLabel })
4070
+ children: /* @__PURE__ */ jsx(Text, { style: [styles23.nativeText, { color: colors.text }], children: nativeLabel ?? accessibilityLabel })
3861
4071
  }
3862
4072
  );
3863
4073
  }
@@ -3887,7 +4097,7 @@ var PREVIEW_RADIUS = 8;
3887
4097
  var GAP6 = 8;
3888
4098
  var TITLE_FONT_SIZE = 14;
3889
4099
  var HELP_FONT_SIZE = 13;
3890
- var styles22 = StyleSheet.create({
4100
+ var styles24 = StyleSheet.create({
3891
4101
  help: { flex: 1, fontSize: HELP_FONT_SIZE },
3892
4102
  root: { gap: GAP6 },
3893
4103
  tile: { alignItems: "center", flexDirection: "row", gap: GAP6 },
@@ -3909,11 +4119,11 @@ var UploadWithLinkField = ({
3909
4119
  const url = value ?? "";
3910
4120
  const [pasting, setPasting] = useState(url !== "");
3911
4121
  const previewBox = { borderRadius: PREVIEW_RADIUS, height: previewSize, width: previewSize };
3912
- return /* @__PURE__ */ jsxs(View, { style: styles22.root, children: [
3913
- /* @__PURE__ */ jsx(Text, { style: [styles22.title, { color: theme.colors.text }], children: labels.title }),
3914
- /* @__PURE__ */ jsxs(View, { style: styles22.tile, children: [
4122
+ return /* @__PURE__ */ jsxs(View, { style: styles24.root, children: [
4123
+ /* @__PURE__ */ jsx(Text, { style: [styles24.title, { color: theme.colors.text }], children: labels.title }),
4124
+ /* @__PURE__ */ jsxs(View, { style: styles24.tile, children: [
3915
4125
  url === "" ? /* @__PURE__ */ jsx(View, { style: [previewBox, { backgroundColor: theme.colors.border }] }) : /* @__PURE__ */ jsx(Image, { accessible: false, source: { uri: url }, style: previewBox, testID: `${testID}-preview` }),
3916
- labels.help === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [styles22.help, { color: theme.colors.text }], children: labels.help })
4126
+ labels.help === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [styles24.help, { color: theme.colors.text }], children: labels.help })
3917
4127
  ] }),
3918
4128
  uploadControl,
3919
4129
  /* @__PURE__ */ jsx(
@@ -3924,12 +4134,12 @@ var UploadWithLinkField = ({
3924
4134
  accessibilityRole: "button",
3925
4135
  accessibilityState: { expanded: pasting },
3926
4136
  "aria-expanded": pasting,
3927
- style: [styles22.toggle, ring.ringStyle],
4137
+ style: [styles24.toggle, ring.ringStyle],
3928
4138
  testID: `${testID}-paste`,
3929
4139
  onBlur: ring.onBlur,
3930
4140
  onFocus: ring.onFocus,
3931
4141
  onPress: () => setPasting(!pasting),
3932
- children: /* @__PURE__ */ jsx(Text, { style: [styles22.toggleText, { color: theme.colors.text }], children: labels.pasteToggle })
4142
+ children: /* @__PURE__ */ jsx(Text, { style: [styles24.toggleText, { color: theme.colors.text }], children: labels.pasteToggle })
3933
4143
  }
3934
4144
  ),
3935
4145
  pasting ? /* @__PURE__ */ jsx(
@@ -3948,7 +4158,7 @@ var UploadWithLinkField = ({
3948
4158
  };
3949
4159
  var ACTION_GAP = 8;
3950
4160
  var GROUP_GAP = 16;
3951
- var styles23 = StyleSheet.create({
4161
+ var styles25 = StyleSheet.create({
3952
4162
  action: { alignItems: "flex-start", marginTop: ACTION_GAP },
3953
4163
  group: { marginBottom: GROUP_GAP }
3954
4164
  });
@@ -3971,7 +4181,7 @@ var AddOnRequest = ({
3971
4181
  onRemove();
3972
4182
  };
3973
4183
  if (!isAddOnOpen(hasValue, requested))
3974
- return /* @__PURE__ */ jsx(View, { style: [styles23.action, style], children: /* @__PURE__ */ jsx(
4184
+ return /* @__PURE__ */ jsx(View, { style: [styles25.action, style], children: /* @__PURE__ */ jsx(
3975
4185
  Button,
3976
4186
  {
3977
4187
  accessibilityHint: addHint,
@@ -3983,9 +4193,9 @@ var AddOnRequest = ({
3983
4193
  onPress: () => setRequested(true)
3984
4194
  }
3985
4195
  ) });
3986
- return /* @__PURE__ */ jsxs(View, { style: [styles23.group, style], testID, children: [
4196
+ return /* @__PURE__ */ jsxs(View, { style: [styles25.group, style], testID, children: [
3987
4197
  children,
3988
- /* @__PURE__ */ jsx(View, { style: styles23.action, children: /* @__PURE__ */ jsx(
4198
+ /* @__PURE__ */ jsx(View, { style: styles25.action, children: /* @__PURE__ */ jsx(
3989
4199
  Button,
3990
4200
  {
3991
4201
  accessibilityHint: removeHint,
@@ -4002,7 +4212,7 @@ var AddOnRequest = ({
4002
4212
  var ROW_GAP3 = 8;
4003
4213
  var TEXT_SIZE = 13;
4004
4214
  var TEXT_LINE = 18;
4005
- var styles24 = StyleSheet.create({
4215
+ var styles26 = StyleSheet.create({
4006
4216
  row: { alignItems: "center", columnGap: ROW_GAP3, flexDirection: "row", justifyContent: "space-between" },
4007
4217
  text: { flexShrink: 1, fontSize: TEXT_SIZE, fontWeight: "700", lineHeight: TEXT_LINE }
4008
4218
  });
@@ -4010,8 +4220,8 @@ var isFixBarVisible = (count) => count > 0;
4010
4220
  var FixBar = ({ count, message, showLabel, showHint, onShow, testID, style }) => {
4011
4221
  const { theme } = useUi();
4012
4222
  if (!isFixBarVisible(count)) return null;
4013
- return /* @__PURE__ */ jsxs(View, { style: [styles24.row, style], testID, children: [
4014
- /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles24.text, { color: fieldErrorInk(theme) }], testID: `${testID}-count`, children: message }),
4223
+ return /* @__PURE__ */ jsxs(View, { style: [styles26.row, style], testID, children: [
4224
+ /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles26.text, { color: fieldErrorInk(theme) }], testID: `${testID}-count`, children: message }),
4015
4225
  /* @__PURE__ */ jsx(
4016
4226
  Button,
4017
4227
  {
@@ -4049,21 +4259,21 @@ function OptionRow2({ option, active, current, renderLeading, renderDetail, onPi
4049
4259
  accessibilityLabel: option.label,
4050
4260
  accessibilityRole: "button",
4051
4261
  accessibilityState: { selected: active, checked: current },
4052
- style: [styles25.row, active ? { backgroundColor: colors.surface } : null],
4262
+ style: [styles27.row, active ? { backgroundColor: colors.surface } : null],
4053
4263
  testID: `${testID}-option-${option.value}`,
4054
4264
  onPress: () => onPick(option),
4055
4265
  children: [
4056
4266
  renderLeading?.(option),
4057
- /* @__PURE__ */ jsxs(View, { style: styles25.label, children: [
4058
- /* @__PURE__ */ jsx(Text, { style: [styles25.primary, { color: colors.text }], children: option.label }),
4059
- detailBelow ? /* @__PURE__ */ jsx(Text, { style: [styles25.secondary, { color: colors.textSecondary }], children: option.detail }) : null
4267
+ /* @__PURE__ */ jsxs(View, { style: styles27.label, children: [
4268
+ /* @__PURE__ */ jsx(Text, { style: [styles27.primary, { color: colors.text }], children: option.label }),
4269
+ detailBelow ? /* @__PURE__ */ jsx(Text, { style: [styles27.secondary, { color: colors.textSecondary }], children: option.detail }) : null
4060
4270
  ] }),
4061
4271
  renderDetail?.(option)
4062
4272
  ]
4063
4273
  }
4064
4274
  );
4065
4275
  }
4066
- var styles25 = StyleSheet.create({
4276
+ var styles27 = StyleSheet.create({
4067
4277
  row: { minHeight: MIN_TOUCH_TARGET_PX, flexDirection: "row", alignItems: "center", gap: ROW_GAP4, paddingHorizontal: ROW_PAD_H },
4068
4278
  label: { flex: 1 },
4069
4279
  primary: { fontSize: OPTION_FONT2, flexShrink: 1 },
@@ -4077,11 +4287,11 @@ function OptionSection({ title, options, offset, highlight, selectedValue, ...ro
4077
4287
  const { colors } = theme;
4078
4288
  if (options.length === 0) return null;
4079
4289
  return /* @__PURE__ */ jsxs(View, { children: [
4080
- /* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles26.header, { color: colors.textSecondary }], children: title }),
4290
+ /* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles28.header, { color: colors.textSecondary }], children: title }),
4081
4291
  options.map((option, index) => /* @__PURE__ */ jsx(OptionRow2, { ...row, active: offset + index === highlight, current: option.value === selectedValue, option }, option.value))
4082
4292
  ] });
4083
4293
  }
4084
- var styles26 = StyleSheet.create({
4294
+ var styles28 = StyleSheet.create({
4085
4295
  header: { fontSize: HEADER_FONT, paddingHorizontal: ROW_PAD_H2, paddingTop: ROW_GAP5, textTransform: "uppercase" }
4086
4296
  });
4087
4297
  var KEY_ESCAPE = "Escape";
@@ -4111,7 +4321,7 @@ function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, re
4111
4321
  const translateY = progress.interpolate({ inputRange: [0, 1], outputRange: [motion.fromY, 0] });
4112
4322
  const isSheet = motion.surface === "sheet" /* Sheet */;
4113
4323
  const shared = { selectedValue, renderLeading, renderDetail, onPick: pick, optionHint: labels.optionHint, testID, highlight };
4114
- const list = /* @__PURE__ */ jsxs(View, { style: [styles27.panel, { backgroundColor: colors.surfaceElevated, borderColor: colors.border }], testID: `${testID}-panel`, children: [
4324
+ const list = /* @__PURE__ */ jsxs(View, { style: [styles29.panel, { backgroundColor: colors.surfaceElevated, borderColor: colors.border }], testID: `${testID}-panel`, children: [
4115
4325
  /* @__PURE__ */ jsx(
4116
4326
  TextInput,
4117
4327
  {
@@ -4128,16 +4338,16 @@ function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, re
4128
4338
  onSubmitEditing: submit
4129
4339
  }
4130
4340
  ),
4131
- /* @__PURE__ */ jsxs(ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ? styles27.sheetList : styles27.dropList, children: [
4341
+ /* @__PURE__ */ jsxs(ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ? styles29.sheetList : styles29.dropList, children: [
4132
4342
  /* @__PURE__ */ jsx(OptionSection, { ...shared, offset: 0, options: sections.recent, title: labels.recent }),
4133
4343
  /* @__PURE__ */ jsx(OptionSection, { ...shared, offset: sections.recent.length, options: sections.all, title: labels.all }),
4134
- sections.flat.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [styles27.empty, { color: colors.textSecondary }], children: labels.empty }) : null
4344
+ sections.flat.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [styles29.empty, { color: colors.textSecondary }], children: labels.empty }) : null
4135
4345
  ] })
4136
4346
  ] });
4137
4347
  if (!isSheet) return /* @__PURE__ */ jsx(DropdownSurface, { anchorRef, closeHint: labels.closeHint, closeLabel: labels.close, progress, testID, translateY, onDismiss: dismiss, children: list });
4138
4348
  return /* @__PURE__ */ jsx(SheetSurface, { closeHint: labels.closeHint, closeLabel: labels.close, testID, translateY, onDismiss: dismiss, children: list });
4139
4349
  }
4140
- var styles27 = StyleSheet.create({
4350
+ var styles29 = StyleSheet.create({
4141
4351
  panel: { borderWidth: 1, borderRadius: PANEL_RADIUS, padding: PANEL_PAD, gap: PANEL_PAD },
4142
4352
  dropList: { maxHeight: MENU_MAX_HEIGHT },
4143
4353
  sheetList: { maxHeight: SHEET_MAX_HEIGHT2 },
@@ -4247,7 +4457,7 @@ function SearchSelect(props) {
4247
4457
  const onTriggerBlur = useCallback(() => {
4248
4458
  if (!openRef.current) onBlur?.();
4249
4459
  }, [onBlur]);
4250
- return /* @__PURE__ */ jsxs(View, { ref: anchorRef, style: styles28.anchor, children: [
4460
+ return /* @__PURE__ */ jsxs(View, { ref: anchorRef, style: styles30.anchor, children: [
4251
4461
  /* @__PURE__ */ jsx(
4252
4462
  Pressable,
4253
4463
  {
@@ -4256,7 +4466,7 @@ function SearchSelect(props) {
4256
4466
  accessibilityLabel,
4257
4467
  accessibilityRole: "button",
4258
4468
  accessibilityState: { expanded: state.open },
4259
- style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] : styles28.customTrigger,
4469
+ style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] : styles30.customTrigger,
4260
4470
  testID,
4261
4471
  onBlur: onTriggerBlur,
4262
4472
  onPress,
@@ -4268,7 +4478,7 @@ function SearchSelect(props) {
4268
4478
  }
4269
4479
  function FieldBoxContent({ selected, placeholder, colors, renderLeading, renderDetail }) {
4270
4480
  return /* @__PURE__ */ jsxs(Fragment, { children: [
4271
- /* @__PURE__ */ jsxs(View, { style: styles28.value, children: [
4481
+ /* @__PURE__ */ jsxs(View, { style: styles30.value, children: [
4272
4482
  selected !== null && renderLeading !== void 0 ? renderLeading(selected) : null,
4273
4483
  /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [controlStyles.selectTriggerText, { color: selected === null ? colors.textSecondary : colors.text }], children: selected?.label ?? placeholder }),
4274
4484
  selected !== null ? /* @__PURE__ */ jsx(SelectedDetail, { colors, option: selected, renderDetail }) : null
@@ -4281,7 +4491,7 @@ function SelectedDetail({ option, colors, renderDetail }) {
4281
4491
  if (option.detail === void 0) return null;
4282
4492
  return /* @__PURE__ */ jsx(Text, { style: [controlStyles.selectTriggerText, { color: colors.textSecondary }], children: option.detail });
4283
4493
  }
4284
- var styles28 = StyleSheet.create({
4494
+ var styles30 = StyleSheet.create({
4285
4495
  anchor: { position: "relative" },
4286
4496
  customTrigger: { minHeight: MIN_TOUCH, minWidth: MIN_TOUCH, alignSelf: "flex-start", justifyContent: "center" },
4287
4497
  value: { flex: 1, flexDirection: "row", alignItems: "center", gap: VALUE_GAP }
@@ -5058,7 +5268,7 @@ function CountryField({ value, onChange, accessibilityLabel, accessibilityHint,
5058
5268
  const { theme } = useUi();
5059
5269
  const { textSecondary } = theme.colors;
5060
5270
  const options = useMemo(() => countryFieldOptions(countries, noneLabel), [countries, noneLabel]);
5061
- const renderCode = useCallback((option) => /* @__PURE__ */ jsx(Text, { style: [styles29.code, { color: textSecondary }], children: option.detail }), [textSecondary]);
5271
+ const renderCode = useCallback((option) => /* @__PURE__ */ jsx(Text, { style: [styles31.code, { color: textSecondary }], children: option.detail }), [textSecondary]);
5062
5272
  return /* @__PURE__ */ jsx(
5063
5273
  SearchSelect,
5064
5274
  {
@@ -5076,7 +5286,7 @@ function CountryField({ value, onChange, accessibilityLabel, accessibilityHint,
5076
5286
  }
5077
5287
  );
5078
5288
  }
5079
- var styles29 = StyleSheet.create({
5289
+ var styles31 = StyleSheet.create({
5080
5290
  code: { fontSize: CODE_FONT }
5081
5291
  });
5082
5292
  function useBlurVerdict(validate) {
@@ -5332,9 +5542,9 @@ var LINE_GAP = 4;
5332
5542
  function RejectionLine({ message, testID }) {
5333
5543
  const { theme } = useUi();
5334
5544
  if (message === null) return null;
5335
- return /* @__PURE__ */ jsx(Text, { accessibilityLiveRegion: "polite", style: [styles30.line, { color: fieldErrorInk(theme) }], testID: `${testID}-rejection`, children: message });
5545
+ return /* @__PURE__ */ jsx(Text, { accessibilityLiveRegion: "polite", style: [styles32.line, { color: fieldErrorInk(theme) }], testID: `${testID}-rejection`, children: message });
5336
5546
  }
5337
- var styles30 = StyleSheet.create({
5547
+ var styles32 = StyleSheet.create({
5338
5548
  line: { marginTop: LINE_GAP }
5339
5549
  });
5340
5550
 
@@ -5481,7 +5691,7 @@ var PAD_V = 10;
5481
5691
  var PAD_H = 16;
5482
5692
  var TEXT_SIZE2 = 13;
5483
5693
  var TEXT_LINE2 = 18;
5484
- var styles31 = StyleSheet.create({
5694
+ var styles33 = StyleSheet.create({
5485
5695
  bar: { borderTopWidth: 1, paddingHorizontal: PAD_H, paddingVertical: PAD_V, rowGap: BAR_GAP },
5486
5696
  actions: { flexDirection: "row", flexWrap: "wrap", gap: BAR_GAP },
5487
5697
  message: { fontSize: TEXT_SIZE2, fontWeight: "700", lineHeight: TEXT_LINE2 }
@@ -5493,9 +5703,9 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
5493
5703
  const { colors } = theme;
5494
5704
  const pinned = actionBarPosition(sticky, Platform.OS) === "sticky" ? PINNED : null;
5495
5705
  const hasMessage = message !== void 0 && message !== "";
5496
- return /* @__PURE__ */ jsxs(View, { style: [styles31.bar, { backgroundColor: colors.surface, borderTopColor: colors.border }, pinned, style], testID, children: [
5497
- hasMessage ? /* @__PURE__ */ jsx(Text, { role: "status", style: [styles31.message, { color: colors.text }], testID: `${testID}-message`, children: message }) : null,
5498
- /* @__PURE__ */ jsx(View, { style: styles31.actions, children })
5706
+ return /* @__PURE__ */ jsxs(View, { style: [styles33.bar, { backgroundColor: colors.surface, borderTopColor: colors.border }, pinned, style], testID, children: [
5707
+ hasMessage ? /* @__PURE__ */ jsx(Text, { role: "status", style: [styles33.message, { color: colors.text }], testID: `${testID}-message`, children: message }) : null,
5708
+ /* @__PURE__ */ jsx(View, { style: styles33.actions, children })
5499
5709
  ] });
5500
5710
  };
5501
5711
 
@@ -5503,14 +5713,14 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
5503
5713
  var isChecklistComplete = (items, checked) => items.every((item) => checked.includes(item.id));
5504
5714
  var TITLE_SIZE = 13;
5505
5715
  var TITLE_GAP = 6;
5506
- var styles32 = StyleSheet.create({
5716
+ var styles34 = StyleSheet.create({
5507
5717
  title: { fontSize: TITLE_SIZE, fontWeight: "700", marginBottom: TITLE_GAP }
5508
5718
  });
5509
5719
  var GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = false, children }) => {
5510
5720
  const { theme } = useUi();
5511
5721
  const complete = isChecklistComplete(items, checked);
5512
5722
  return /* @__PURE__ */ jsxs(View, { testID, children: [
5513
- /* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles32.title, { color: theme.colors.text }], children: title }),
5723
+ /* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles34.title, { color: theme.colors.text }], children: title }),
5514
5724
  items.map((item) => /* @__PURE__ */ jsx(
5515
5725
  FormCheckbox,
5516
5726
  {
@@ -5526,7 +5736,7 @@ var GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = fals
5526
5736
  children?.(complete)
5527
5737
  ] });
5528
5738
  };
5529
- var MIN_TARGET_PX2 = 44;
5739
+ var MIN_TARGET_PX3 = 44;
5530
5740
  var DOT_SIZE = 18;
5531
5741
  var DOT_INNER = 8;
5532
5742
  var ROW_GAP6 = 10;
@@ -5536,14 +5746,14 @@ var RADIUS2 = 8;
5536
5746
  var LABEL_SIZE = 14;
5537
5747
  var DESCRIPTION_SIZE = 12;
5538
5748
  var DESCRIPTION_LINE = 16;
5539
- var styles33 = StyleSheet.create({
5749
+ var styles35 = StyleSheet.create({
5540
5750
  row: {
5541
5751
  alignItems: "center",
5542
5752
  borderRadius: RADIUS2,
5543
5753
  borderWidth: 1,
5544
5754
  columnGap: ROW_GAP6,
5545
5755
  flexDirection: "row",
5546
- minHeight: MIN_TARGET_PX2,
5756
+ minHeight: MIN_TARGET_PX3,
5547
5757
  paddingHorizontal: PAD_H2,
5548
5758
  paddingVertical: PAD_V2
5549
5759
  },
@@ -5567,15 +5777,15 @@ function RadioRow({ option, identity, colors, tabIndex, hostRef, onPress }) {
5567
5777
  accessibilityState: identity.accessibilityState,
5568
5778
  "aria-checked": checked,
5569
5779
  disabled,
5570
- style: [styles33.row, { borderColor: accent, backgroundColor: checked ? colors.tint : colors.muted }],
5780
+ style: [styles35.row, { borderColor: accent, backgroundColor: checked ? colors.tint : colors.muted }],
5571
5781
  tabIndex,
5572
5782
  testID: identity.testID,
5573
5783
  onPress,
5574
5784
  children: [
5575
- /* @__PURE__ */ jsx(View, { style: [styles33.dot, { borderColor: accent }], children: checked ? /* @__PURE__ */ jsx(View, { style: [styles33.dotInner, { backgroundColor: colors.primary }] }) : null }),
5576
- /* @__PURE__ */ jsxs(View, { style: styles33.text, children: [
5577
- /* @__PURE__ */ jsx(Text, { style: [styles33.label, { color: checked ? colors.primary : colors.textStrong }], children: option.label }),
5578
- hasDescription ? /* @__PURE__ */ jsx(Text, { style: [styles33.description, { color: colors.textMuted }], testID: `${identity.testID}-description`, children: option.description }) : null
5785
+ /* @__PURE__ */ jsx(View, { style: [styles35.dot, { borderColor: accent }], children: checked ? /* @__PURE__ */ jsx(View, { style: [styles35.dotInner, { backgroundColor: colors.primary }] }) : null }),
5786
+ /* @__PURE__ */ jsxs(View, { style: styles35.text, children: [
5787
+ /* @__PURE__ */ jsx(Text, { style: [styles35.label, { color: checked ? colors.primary : colors.textStrong }], children: option.label }),
5788
+ hasDescription ? /* @__PURE__ */ jsx(Text, { style: [styles35.description, { color: colors.textMuted }], testID: `${identity.testID}-description`, children: option.description }) : null
5579
5789
  ] })
5580
5790
  ]
5581
5791
  }
@@ -5592,20 +5802,20 @@ var radioRowIdentity = (option, selected, disabled, prefix) => {
5592
5802
  };
5593
5803
  };
5594
5804
  var ROW_GAP7 = 8;
5595
- var styles34 = StyleSheet.create({
5805
+ var styles36 = StyleSheet.create({
5596
5806
  list: { rowGap: ROW_GAP7 }
5597
5807
  });
5598
5808
  function RadioList(props) {
5599
5809
  const { options, value, onChange, optionTestIDPrefix, label, error, required = false, disabled = false, testID } = props;
5600
5810
  const { theme } = useUi();
5601
- const colors = React37.useMemo(() => buildChipColors(theme.colors, theme.palette), [theme.colors, theme.palette]);
5811
+ const colors = React38.useMemo(() => buildChipColors(theme.colors, theme.palette), [theme.colors, theme.palette]);
5602
5812
  const selectedIndex = options.findIndex((option) => option.value === value);
5603
5813
  const radio = useRadioKeyboard({ enabled: true, disabled, values: options.map((option) => option.value), selectedIndex, onChange });
5604
5814
  return /* @__PURE__ */ jsx(Field, { error, label, required, testID, children: ({ describedById, hasError }) => /* @__PURE__ */ jsx(
5605
5815
  View,
5606
5816
  {
5607
5817
  accessibilityRole: "radiogroup",
5608
- style: styles34.list,
5818
+ style: styles36.list,
5609
5819
  ...webFieldA11y({ describedById, hasError }),
5610
5820
  ...radio.groupProps,
5611
5821
  children: options.map((option, index) => /* @__PURE__ */ jsx(
@@ -5659,11 +5869,11 @@ function DecisionNote({ state, labels, testID, disabled }) {
5659
5869
  );
5660
5870
  }
5661
5871
  var BUTTON_BASIS = "40%";
5662
- var styles35 = StyleSheet.create({
5872
+ var styles37 = StyleSheet.create({
5663
5873
  cell: { flexBasis: BUTTON_BASIS, flexGrow: 1 }
5664
5874
  });
5665
5875
  function OutcomeButtons({ outcomes, pending, disabled, testID, onPress }) {
5666
- return /* @__PURE__ */ jsx(Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsx(View, { style: styles35.cell, children: /* @__PURE__ */ jsx(
5876
+ return /* @__PURE__ */ jsx(Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsx(View, { style: styles37.cell, children: /* @__PURE__ */ jsx(
5667
5877
  Button,
5668
5878
  {
5669
5879
  fullWidth: true,
@@ -5744,21 +5954,21 @@ function StickyBarDecision(props) {
5744
5954
  }
5745
5955
  var TEXT_SIZE3 = 13;
5746
5956
  var TEXT_LINE3 = 18;
5747
- var styles36 = StyleSheet.create({
5957
+ var styles38 = StyleSheet.create({
5748
5958
  text: { fontSize: TEXT_SIZE3, fontWeight: "700", lineHeight: TEXT_LINE3 }
5749
5959
  });
5750
5960
  var SubmitError = ({ message, testID }) => {
5751
5961
  const { theme } = useUi();
5752
- return /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles36.text, { color: fieldErrorInk(theme) }], testID, children: message });
5962
+ return /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles38.text, { color: fieldErrorInk(theme) }], testID, children: message });
5753
5963
  };
5754
5964
  var toggle = (list, id) => list.includes(id) ? list.filter((item) => item !== id) : [...list, id];
5755
5965
  function useDecisionPanel(outcomes, onSubmit) {
5756
- const [outcome, setOutcome] = React37.useState("");
5757
- const [note, setNote] = React37.useState("");
5758
- const [reasons, setReasons] = React37.useState([]);
5759
- const [checked, setChecked] = React37.useState([]);
5760
- const [error, setError] = React37.useState(null);
5761
- const [pending, setPending] = React37.useState(null);
5966
+ const [outcome, setOutcome] = React38.useState("");
5967
+ const [note, setNote] = React38.useState("");
5968
+ const [reasons, setReasons] = React38.useState([]);
5969
+ const [checked, setChecked] = React38.useState([]);
5970
+ const [error, setError] = React38.useState(null);
5971
+ const [pending, setPending] = React38.useState(null);
5762
5972
  const submit = async (override) => {
5763
5973
  const target = override ?? outcome;
5764
5974
  const problem = validateDecision(outcomes, target, note);
@@ -5792,7 +6002,7 @@ function useDecisionPanel(outcomes, onSubmit) {
5792
6002
  }
5793
6003
  var TITLE_SIZE2 = 15;
5794
6004
  var PANEL_GAP = 12;
5795
- var styles37 = StyleSheet.create({
6005
+ var styles39 = StyleSheet.create({
5796
6006
  panel: { rowGap: PANEL_GAP },
5797
6007
  title: { fontSize: TITLE_SIZE2, fontWeight: "700" }
5798
6008
  });
@@ -5806,8 +6016,8 @@ function DecisionPanel(props) {
5806
6016
  const { theme } = useUi();
5807
6017
  const state = useDecisionPanel(outcomes, onSubmit);
5808
6018
  const body = (locked) => renderVariant(variant, { state, outcomes, labels, testID, disabled: disabled || locked, reasons, leadOutcome });
5809
- return /* @__PURE__ */ jsxs(View, { style: [styles37.panel, style], testID, children: [
5810
- /* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles37.title, { color: theme.colors.text }], children: labels.title }),
6019
+ return /* @__PURE__ */ jsxs(View, { style: [styles39.panel, style], testID, children: [
6020
+ /* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles39.title, { color: theme.colors.text }], children: labels.title }),
5811
6021
  checklist !== void 0 ? /* @__PURE__ */ jsx(GatedChecklist, { checked: state.checked, items: checklist.items, testID: `${testID}-checklist`, title: checklist.title, onToggle: state.toggleCheck, children: (complete) => body(!complete) }) : body(false),
5812
6022
  state.error === "submit" ? /* @__PURE__ */ jsx(SubmitError, { message: labels.submitError, testID: `${testID}-error` }) : null
5813
6023
  ] });
@@ -5834,13 +6044,13 @@ function ruleTone(met, flagUnmet) {
5834
6044
  return flagUnmet ? "refused" /* Refused */ : "unmet" /* Unmet */;
5835
6045
  }
5836
6046
  var MARK_SIZE = 16;
5837
- var CHECK_SIZE = 12;
6047
+ var CHECK_SIZE2 = 12;
5838
6048
  var RING_WIDTH = 1.5;
5839
6049
  var POP_FROM = 0.6;
5840
6050
  var POP_PEAK = 1.12;
5841
6051
  var POP_UP_MS = 160;
5842
6052
  var POP_SETTLE_MS = 100;
5843
- var styles38 = StyleSheet.create({
6053
+ var styles40 = StyleSheet.create({
5844
6054
  mark: { width: MARK_SIZE, height: MARK_SIZE, borderRadius: MARK_SIZE / 2, alignItems: "center", justifyContent: "center" },
5845
6055
  ring: { borderWidth: RING_WIDTH }
5846
6056
  });
@@ -5860,8 +6070,8 @@ function RuleMark({ tone, colors }) {
5860
6070
  ]).start();
5861
6071
  }, [met, reduced, scale]);
5862
6072
  const color = colors.mark[tone];
5863
- const shape = met ? { backgroundColor: color } : [styles38.ring, { borderColor: color }];
5864
- return /* @__PURE__ */ jsx(Animated.View, { style: { transform: [{ scale }] }, children: /* @__PURE__ */ jsx(View, { style: [styles38.mark, shape], children: met ? /* @__PURE__ */ jsx(SvgIcon, { color: colors.onMark, name: "check", size: CHECK_SIZE }) : null }) });
6073
+ const shape = met ? { backgroundColor: color } : [styles40.ring, { borderColor: color }];
6074
+ return /* @__PURE__ */ jsx(Animated.View, { style: { transform: [{ scale }] }, children: /* @__PURE__ */ jsx(View, { style: [styles40.mark, shape], children: met ? /* @__PURE__ */ jsx(SvgIcon, { color: colors.onMark, name: "check", size: CHECK_SIZE2 }) : null }) });
5865
6075
  }
5866
6076
  var GAP8 = 6;
5867
6077
  var ROW_GAP8 = 8;
@@ -5869,11 +6079,11 @@ var FONT5 = 14;
5869
6079
  var LINE = 20;
5870
6080
  var METER_HEIGHT = 4;
5871
6081
  var RADIUS3 = 999;
5872
- var CHIP_PAD_V = 4;
5873
- var CHIP_PAD_H = 10;
5874
- var CHIP_BORDER = 1;
6082
+ var CHIP_PAD_V2 = 4;
6083
+ var CHIP_PAD_H2 = 10;
6084
+ var CHIP_BORDER2 = 1;
5875
6085
  var HALF4 = "50%";
5876
- var styles39 = StyleSheet.create({
6086
+ var styles41 = StyleSheet.create({
5877
6087
  column: { gap: GAP8 },
5878
6088
  row: { flexDirection: "row", alignItems: "center", gap: ROW_GAP8 },
5879
6089
  text: { fontSize: FONT5, lineHeight: LINE, flexShrink: 1 },
@@ -5882,38 +6092,38 @@ var styles39 = StyleSheet.create({
5882
6092
  grid: { flexDirection: "row", flexWrap: "wrap", rowGap: GAP8 },
5883
6093
  cell: { flexBasis: HALF4, maxWidth: HALF4, paddingRight: GAP8 },
5884
6094
  chips: { flexDirection: "row", flexWrap: "wrap", gap: GAP8 },
5885
- chip: { borderRadius: RADIUS3, borderWidth: CHIP_BORDER, paddingVertical: CHIP_PAD_V, paddingHorizontal: CHIP_PAD_H },
6095
+ chip: { borderRadius: RADIUS3, borderWidth: CHIP_BORDER2, paddingVertical: CHIP_PAD_V2, paddingHorizontal: CHIP_PAD_H2 },
5886
6096
  metPhrase: { fontWeight: "700", textDecorationLine: "underline" }
5887
6097
  });
5888
6098
  function RuleList({ rules, flagUnmet, colors, testID, listStyle, itemStyle, outlined = false }) {
5889
6099
  return /* @__PURE__ */ jsx(View, { role: "list", style: listStyle, testID, children: rules.map((rule) => {
5890
6100
  const tone = ruleTone(rule.met, flagUnmet);
5891
6101
  const outline = outlined ? { borderColor: colors.mark[tone] } : null;
5892
- return /* @__PURE__ */ jsxs(View, { role: "listitem", style: [styles39.row, itemStyle, outline], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
6102
+ return /* @__PURE__ */ jsxs(View, { role: "listitem", style: [styles41.row, itemStyle, outline], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
5893
6103
  /* @__PURE__ */ jsx(RuleMark, { colors, tone }),
5894
- /* @__PURE__ */ jsx(Text, { style: [styles39.text, { color: colors.text[tone] }], children: rule.label })
6104
+ /* @__PURE__ */ jsx(Text, { style: [styles41.text, { color: colors.text[tone] }], children: rule.label })
5895
6105
  ] }, rule.id);
5896
6106
  }) });
5897
6107
  }
5898
6108
  function RulesChecklist(props) {
5899
- return /* @__PURE__ */ jsx(RuleList, { ...props, listStyle: styles39.column });
6109
+ return /* @__PURE__ */ jsx(RuleList, { ...props, listStyle: styles41.column });
5900
6110
  }
5901
6111
  function RulesChips(props) {
5902
- return /* @__PURE__ */ jsx(RuleList, { ...props, outlined: true, itemStyle: styles39.chip, listStyle: styles39.chips });
6112
+ return /* @__PURE__ */ jsx(RuleList, { ...props, outlined: true, itemStyle: styles41.chip, listStyle: styles41.chips });
5903
6113
  }
5904
6114
  function RulesMeterGrid(props) {
5905
6115
  const { rules, flagUnmet, colors, testID } = props;
5906
6116
  const metCount = rules.filter((rule) => rule.met).length;
5907
6117
  const unfilled = flagUnmet ? colors.mark.refused : colors.track;
5908
- return /* @__PURE__ */ jsxs(View, { style: styles39.column, children: [
5909
- /* @__PURE__ */ jsx(View, { style: styles39.meter, testID: `${testID}-meter`, children: rules.map((rule, index) => /* @__PURE__ */ jsx(View, { style: [styles39.segment, { backgroundColor: index < metCount ? colors.mark.met : unfilled }] }, rule.id)) }),
5910
- /* @__PURE__ */ jsx(RuleList, { ...props, itemStyle: styles39.cell, listStyle: styles39.grid })
6118
+ return /* @__PURE__ */ jsxs(View, { style: styles41.column, children: [
6119
+ /* @__PURE__ */ jsx(View, { style: styles41.meter, testID: `${testID}-meter`, children: rules.map((rule, index) => /* @__PURE__ */ jsx(View, { style: [styles41.segment, { backgroundColor: index < metCount ? colors.mark.met : unfilled }] }, rule.id)) }),
6120
+ /* @__PURE__ */ jsx(RuleList, { ...props, itemStyle: styles41.cell, listStyle: styles41.grid })
5911
6121
  ] });
5912
6122
  }
5913
6123
  function RulesSentence({ rules, flagUnmet, colors, testID }) {
5914
- return /* @__PURE__ */ jsx(Text, { style: [styles39.text, { color: colors.text.unmet }], testID, children: rules.map((rule, index) => {
6124
+ return /* @__PURE__ */ jsx(Text, { style: [styles41.text, { color: colors.text.unmet }], testID, children: rules.map((rule, index) => {
5915
6125
  const tone = ruleTone(rule.met, flagUnmet);
5916
- return /* @__PURE__ */ jsxs(Text, { style: [{ color: colors.text[tone] }, rule.met ? styles39.metPhrase : null], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
6126
+ return /* @__PURE__ */ jsxs(Text, { style: [{ color: colors.text[tone] }, rule.met ? styles41.metPhrase : null], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
5917
6127
  index > 0 ? ", " : "",
5918
6128
  rule.label
5919
6129
  ] }, rule.id);
@@ -5932,7 +6142,7 @@ function PasswordRules({ display, ...variant }) {
5932
6142
  }
5933
6143
  }
5934
6144
  var ICON_SIZE = 20;
5935
- var styles40 = StyleSheet.create({
6145
+ var styles42 = StyleSheet.create({
5936
6146
  button: { width: MIN_TOUCH_TARGET_PX, height: MIN_TOUCH_TARGET_PX, alignItems: "center", justifyContent: "center" }
5937
6147
  });
5938
6148
  function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, color, testID }) {
@@ -5944,7 +6154,7 @@ function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, col
5944
6154
  accessibilityLabel: label,
5945
6155
  accessibilityRole: "button",
5946
6156
  "aria-pressed": revealed,
5947
- style: styles40.button,
6157
+ style: styles42.button,
5948
6158
  testID,
5949
6159
  onPress: onToggle,
5950
6160
  onPressIn,
@@ -5998,7 +6208,7 @@ function useRuleColors(override) {
5998
6208
  var RULES_GAP = 8;
5999
6209
  var TOGGLE_INSET = 48;
6000
6210
  var NO_RULES = [];
6001
- var styles41 = StyleSheet.create({
6211
+ var styles43 = StyleSheet.create({
6002
6212
  inputRow: { position: "relative", justifyContent: "center" },
6003
6213
  input: { paddingRight: TOGGLE_INSET },
6004
6214
  toggle: { position: "absolute", right: 0, top: 0, bottom: 0, justifyContent: "center" },
@@ -6031,7 +6241,7 @@ function useCaretKeepingToggle(inputRef, initialLength) {
6031
6241
  }, [inputRef]);
6032
6242
  return { revealed, onPressIn, onToggle, onSelectionChange };
6033
6243
  }
6034
- var PasswordField = React37.forwardRef(function PasswordField2({ label, value, onChangeText, labels, testID, rules = NO_RULES, rulesDisplay = "meterGrid" /* MeterGrid */, flagUnmet = false, error, colors: colorOverride, inputProps }, ref) {
6244
+ var PasswordField = React38.forwardRef(function PasswordField2({ label, value, onChangeText, labels, testID, rules = NO_RULES, rulesDisplay = "meterGrid" /* MeterGrid */, flagUnmet = false, error, colors: colorOverride, inputProps }, ref) {
6035
6245
  const inputRef = useRef(null);
6036
6246
  useImperativeHandle(ref, () => inputRef.current);
6037
6247
  const toggle2 = useCaretKeepingToggle(inputRef, value.length);
@@ -6040,7 +6250,7 @@ var PasswordField = React37.forwardRef(function PasswordField2({ label, value, o
6040
6250
  const rulesId = `${testID}-rules`;
6041
6251
  const hasRules = rules.length > 0;
6042
6252
  return /* @__PURE__ */ jsx(Field, { error, label, testID: `${testID}-field`, children: (context) => /* @__PURE__ */ jsxs(View, { children: [
6043
- /* @__PURE__ */ jsxs(View, { style: styles41.inputRow, children: [
6253
+ /* @__PURE__ */ jsxs(View, { style: styles43.inputRow, children: [
6044
6254
  /* @__PURE__ */ jsx(
6045
6255
  ThemedTextInput,
6046
6256
  {
@@ -6052,22 +6262,22 @@ var PasswordField = React37.forwardRef(function PasswordField2({ label, value, o
6052
6262
  hasError: context.hasError || flagUnmet && rules.some((rule) => !rule.met),
6053
6263
  id: context.controlId,
6054
6264
  secureTextEntry: !toggle2.revealed,
6055
- style: [styles41.input, inputProps?.style],
6265
+ style: [styles43.input, inputProps?.style],
6056
6266
  testID,
6057
6267
  value,
6058
6268
  onChangeText,
6059
6269
  onSelectionChange: toggle2.onSelectionChange
6060
6270
  }
6061
6271
  ),
6062
- /* @__PURE__ */ jsx(View, { style: styles41.toggle, children: /* @__PURE__ */ jsx(RevealToggle, { color: colors.text.unmet, hideLabel: labels.hide, revealed: toggle2.revealed, showLabel: labels.show, testID: `${testID}-reveal`, onPressIn: toggle2.onPressIn, onToggle: toggle2.onToggle }) })
6272
+ /* @__PURE__ */ jsx(View, { style: styles43.toggle, children: /* @__PURE__ */ jsx(RevealToggle, { color: colors.text.unmet, hideLabel: labels.hide, revealed: toggle2.revealed, showLabel: labels.show, testID: `${testID}-reveal`, onPressIn: toggle2.onPressIn, onToggle: toggle2.onToggle }) })
6063
6273
  ] }),
6064
- hasRules ? /* @__PURE__ */ jsxs(View, { nativeID: rulesId, style: styles41.rules, children: [
6274
+ hasRules ? /* @__PURE__ */ jsxs(View, { nativeID: rulesId, style: styles43.rules, children: [
6065
6275
  /* @__PURE__ */ jsx(PasswordRules, { colors, display: rulesDisplay, flagUnmet, rules, testID: rulesId }),
6066
- /* @__PURE__ */ jsx(Text, { "aria-live": "polite", accessibilityLiveRegion: "polite", style: styles41.live, testID: `${testID}-announce`, children: announcement })
6276
+ /* @__PURE__ */ jsx(Text, { "aria-live": "polite", accessibilityLiveRegion: "polite", style: styles43.live, testID: `${testID}-announce`, children: announcement })
6067
6277
  ] }) : null
6068
6278
  ] }) });
6069
6279
  });
6070
6280
 
6071
- export { ActionBar, AddOnRequest, AlignToControl, AnchoredMenu, BicInput, BicRejection, COUNTRIES, ChipLabelWrap, ChipSelector, CountryField, CountryFlag, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateDisplay, DateField, DateInput, DatePickerProvider, DateRangeControl, DateTimeField, DecisionPanel, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, FileInput, FixBar, FlagShapeKind, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, GatedChecklist, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, IbanInput, IbanRejection, InlineFieldRow, LINE_ITEMS_WIDE_MIN_WIDTH, LineItems, PHONE_MAX_WIDTH, PasswordField, PasswordRules, PasswordRulesDisplay, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, ResponsiveFormLayout, RevealToggle, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, SelectControl, SelectField, SelectSurface, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
6281
+ export { ActionBar, AddOnRequest, AlignToControl, AnchoredMenu, BicInput, BicRejection, COUNTRIES, ChipLabelWrap, ChipSelector, CountryField, CountryFlag, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateDisplay, DateField, DateInput, DatePickerProvider, DateRangeControl, DateTimeField, DecisionPanel, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, FileInput, FixBar, FlagShapeKind, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, GatedChecklist, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, IbanInput, IbanRejection, InlineFieldRow, LINE_ITEMS_WIDE_MIN_WIDTH, LineItems, MultiSelectField, PHONE_MAX_WIDTH, PasswordField, PasswordRules, PasswordRulesDisplay, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, ResponsiveFormLayout, RevealToggle, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, SelectControl, SelectField, SelectSurface, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
6072
6282
  //# sourceMappingURL=index.mjs.map
6073
6283
  //# sourceMappingURL=index.mjs.map