@dloizides/ui-forms 1.48.0 → 1.50.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 +13 -0
- package/dist/index.d.mts +17 -3
- package/dist/index.d.ts +17 -3
- package/dist/index.js +449 -354
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +261 -166
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Platform, StyleSheet, TextInput, View, Text, Pressable, useWindowDimensions, ScrollView, Animated, Easing, AccessibilityInfo,
|
|
1
|
+
import React39, { forwardRef, createContext, useRef, useImperativeHandle, useState, useCallback, useMemo, useEffect, useLayoutEffect, useContext } from 'react';
|
|
2
|
+
import { Platform, StyleSheet, TextInput, View, Text, Pressable, useWindowDimensions, ScrollView, Animated, Easing, AccessibilityInfo, Image, TouchableOpacity, Switch, Modal } from 'react-native';
|
|
3
3
|
import { useUi } from '@dloizides/ui-feedback';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { Z_INDEX, focusRingOutline, readableScaleInk, resolveOnBrand } from '@dloizides/design-tokens';
|
|
@@ -12,7 +12,7 @@ import Svg, { Rect, Circle, Polygon } from 'react-native-svg';
|
|
|
12
12
|
|
|
13
13
|
// src/Field/Field.tsx
|
|
14
14
|
function attachControlId(child, candidateId, describedById) {
|
|
15
|
-
if (!
|
|
15
|
+
if (!React39.isValidElement(child) || child.type === React39.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:
|
|
26
|
+
return { node: React39.cloneElement(element, injected), controlId };
|
|
27
27
|
}
|
|
28
28
|
var IS_WEB = Platform.OS === "web";
|
|
29
29
|
function isAttributeHost(node) {
|
|
@@ -141,15 +141,15 @@ var labelVariantStyles = StyleSheet.create({
|
|
|
141
141
|
function resolveLabelVariantStyle(variant) {
|
|
142
142
|
return labelVariantStyles[variant ?? "field"] ?? labelVariantStyles.field;
|
|
143
143
|
}
|
|
144
|
-
var FormGridContext =
|
|
145
|
-
var GapOwnedContext =
|
|
144
|
+
var FormGridContext = React39.createContext(null);
|
|
145
|
+
var GapOwnedContext = React39.createContext(false);
|
|
146
146
|
var FormGridProvider = FormGridContext.Provider;
|
|
147
147
|
var GapOwnedProvider = GapOwnedContext.Provider;
|
|
148
148
|
function useFormGridMetrics() {
|
|
149
|
-
return
|
|
149
|
+
return React39.useContext(FormGridContext);
|
|
150
150
|
}
|
|
151
151
|
function useIsGapOwned() {
|
|
152
|
-
return
|
|
152
|
+
return React39.useContext(GapOwnedContext);
|
|
153
153
|
}
|
|
154
154
|
var ERROR_LIGHT_STEPS = ["500", "600", "700"];
|
|
155
155
|
var ERROR_DARK_STEPS = ["300", "200", "400", "100", "500"];
|
|
@@ -172,7 +172,7 @@ var styles = StyleSheet.create({
|
|
|
172
172
|
});
|
|
173
173
|
var fieldSeq = 0;
|
|
174
174
|
function useFieldIds() {
|
|
175
|
-
const [ids] =
|
|
175
|
+
const [ids] = React39.useState(() => {
|
|
176
176
|
fieldSeq += 1;
|
|
177
177
|
const seq = String(fieldSeq);
|
|
178
178
|
return {
|
|
@@ -219,7 +219,7 @@ var Field = ({
|
|
|
219
219
|
const hasLabel = labelText !== "";
|
|
220
220
|
const marker = resolveFieldMarker(required, optional);
|
|
221
221
|
const { hintId, errorId, controlId, labelId } = useFieldIds();
|
|
222
|
-
const themeStyles =
|
|
222
|
+
const themeStyles = React39.useMemo(
|
|
223
223
|
() => ({
|
|
224
224
|
label: { color: colors.textSecondary },
|
|
225
225
|
requiredMark: { color: errorColor },
|
|
@@ -271,7 +271,7 @@ var FormGrid = ({
|
|
|
271
271
|
style,
|
|
272
272
|
testID
|
|
273
273
|
}) => {
|
|
274
|
-
const metrics =
|
|
274
|
+
const metrics = React39.useMemo(() => ({ minWidth, basis }), [minWidth, basis]);
|
|
275
275
|
return /* @__PURE__ */ jsx(FormGridProvider, { value: metrics, children: /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsx(View, { style: [styles2.grid, { gap }, style], testID, children }) }) });
|
|
276
276
|
};
|
|
277
277
|
var LABEL_LINE_PLACEHOLDER = "\xA0";
|
|
@@ -538,7 +538,7 @@ var styles9 = StyleSheet.create({
|
|
|
538
538
|
});
|
|
539
539
|
var sectionSeq = 0;
|
|
540
540
|
function useSectionLegendId() {
|
|
541
|
-
const [id] =
|
|
541
|
+
const [id] = React39.useState(() => {
|
|
542
542
|
sectionSeq += 1;
|
|
543
543
|
return `form-section-legend-${String(sectionSeq)}`;
|
|
544
544
|
});
|
|
@@ -932,7 +932,7 @@ function AnchoredMenu({
|
|
|
932
932
|
listbox,
|
|
933
933
|
placement
|
|
934
934
|
}) {
|
|
935
|
-
const menuRef =
|
|
935
|
+
const menuRef = React39.useRef(null);
|
|
936
936
|
useDismiss(anchorRef, menuRef, onDismiss);
|
|
937
937
|
useKeepHighlightInView(testID, listbox?.highlightedValue);
|
|
938
938
|
const rect2 = useAnchorRect(placement?.positionRef ?? anchorRef, usePortal);
|
|
@@ -1092,7 +1092,7 @@ var boxStyles = StyleSheet.create({
|
|
|
1092
1092
|
textAlignVertical: "top"
|
|
1093
1093
|
}
|
|
1094
1094
|
});
|
|
1095
|
-
var ThemedTextInput =
|
|
1095
|
+
var ThemedTextInput = React39.forwardRef(function ThemedTextInput2({
|
|
1096
1096
|
hasError = false,
|
|
1097
1097
|
describedById,
|
|
1098
1098
|
requiredField = false,
|
|
@@ -1448,6 +1448,9 @@ function chipSizeLook(size) {
|
|
|
1448
1448
|
return { hitBox: void 0, visual: void 0, text: void 0 };
|
|
1449
1449
|
return { hitBox: chipSizeStyles.compactHitBox, visual: chipSizeStyles.compactVisual, text: chipSizeStyles.compactText };
|
|
1450
1450
|
}
|
|
1451
|
+
function restBorderColor(colors, tone) {
|
|
1452
|
+
return tone === "strong" ? colors.borderStrong : colors.border;
|
|
1453
|
+
}
|
|
1451
1454
|
var SOLID_RADIUS = 20;
|
|
1452
1455
|
var OUTLINE_RADIUS = 999;
|
|
1453
1456
|
var OUTLINE_PAD_H = 12;
|
|
@@ -1494,9 +1497,9 @@ function ChipContent(props) {
|
|
|
1494
1497
|
}
|
|
1495
1498
|
function OutlineChip(props) {
|
|
1496
1499
|
const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;
|
|
1497
|
-
const [hovered, setHovered] =
|
|
1500
|
+
const [hovered, setHovered] = React39.useState(false);
|
|
1498
1501
|
const active = selected || hovered;
|
|
1499
|
-
const borderColor = active ? colors.primary : colors.
|
|
1502
|
+
const borderColor = active ? colors.primary : restBorderColor(colors, props.outlineTone);
|
|
1500
1503
|
const fill = chipFill({
|
|
1501
1504
|
selected,
|
|
1502
1505
|
selectedFill: props.selectedFill,
|
|
@@ -1564,7 +1567,7 @@ function SolidChip(props) {
|
|
|
1564
1567
|
testID,
|
|
1565
1568
|
onPress,
|
|
1566
1569
|
...rovingTabStop,
|
|
1567
|
-
children: /* @__PURE__ */ jsx(View, { style: [chipStyles.chip, sized.visual, { borderColor: colors.border, backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsx(
|
|
1570
|
+
children: /* @__PURE__ */ jsx(View, { style: [chipStyles.chip, sized.visual, { borderColor: selected ? colors.border : restBorderColor(colors, props.outlineTone), backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsx(
|
|
1568
1571
|
ChipContent,
|
|
1569
1572
|
{
|
|
1570
1573
|
checkColor: fill.checkColor,
|
|
@@ -1608,8 +1611,8 @@ function radioTabIndex(index, selectedIndex, disabled) {
|
|
|
1608
1611
|
var NO_GROUP_PROPS = {};
|
|
1609
1612
|
function useRadioKeyboard(config) {
|
|
1610
1613
|
const { enabled, disabled, values, selectedIndex, onChange } = config;
|
|
1611
|
-
const nodes =
|
|
1612
|
-
const chipRef =
|
|
1614
|
+
const nodes = React39.useRef([]);
|
|
1615
|
+
const chipRef = React39.useCallback((index) => (node) => {
|
|
1613
1616
|
nodes.current[index] = node;
|
|
1614
1617
|
}, []);
|
|
1615
1618
|
const onKeyDown = (event) => {
|
|
@@ -1662,6 +1665,7 @@ function buildChipColors(colors, palette) {
|
|
|
1662
1665
|
const primary = palette.primary[500];
|
|
1663
1666
|
return {
|
|
1664
1667
|
border: colors.border,
|
|
1668
|
+
borderStrong: colors.textSecondary,
|
|
1665
1669
|
textStrong: colors.text,
|
|
1666
1670
|
textMuted: colors.textSecondary,
|
|
1667
1671
|
primary,
|
|
@@ -1719,12 +1723,13 @@ var ChipSelector = ({
|
|
|
1719
1723
|
optionAccessibilityHint,
|
|
1720
1724
|
singleSelectRole = "button",
|
|
1721
1725
|
size = "default",
|
|
1722
|
-
selectedFill
|
|
1726
|
+
selectedFill,
|
|
1727
|
+
outlineTone = "default"
|
|
1723
1728
|
}) => {
|
|
1724
1729
|
const isRadioGroup = !multiple && singleSelectRole === "radio";
|
|
1725
1730
|
const { theme } = useUi();
|
|
1726
1731
|
const { colors, palette } = theme;
|
|
1727
|
-
const chipColors =
|
|
1732
|
+
const chipColors = React39.useMemo(() => buildChipColors(colors, palette), [colors, palette]);
|
|
1728
1733
|
function isSelected(optionValue) {
|
|
1729
1734
|
if (multiple && Array.isArray(value))
|
|
1730
1735
|
return value.includes(optionValue);
|
|
@@ -1746,6 +1751,7 @@ var ChipSelector = ({
|
|
|
1746
1751
|
selected,
|
|
1747
1752
|
size,
|
|
1748
1753
|
selectedFill,
|
|
1754
|
+
outlineTone,
|
|
1749
1755
|
...chipIdentity(option, selected, {
|
|
1750
1756
|
prefix: chipTestIDPrefix,
|
|
1751
1757
|
hint: optionAccessibilityHint,
|
|
@@ -1783,8 +1789,95 @@ var ChipSelector = ({
|
|
|
1783
1789
|
}
|
|
1784
1790
|
);
|
|
1785
1791
|
};
|
|
1786
|
-
var
|
|
1792
|
+
var BOX_SLOT_PAD_H = 10;
|
|
1787
1793
|
var styles14 = StyleSheet.create({
|
|
1794
|
+
row: {
|
|
1795
|
+
minWidth: MIN_TOUCH_TARGET_PX,
|
|
1796
|
+
minHeight: MIN_TOUCH_TARGET_PX,
|
|
1797
|
+
alignItems: "center",
|
|
1798
|
+
justifyContent: "center"
|
|
1799
|
+
},
|
|
1800
|
+
box: {
|
|
1801
|
+
alignSelf: "stretch",
|
|
1802
|
+
alignItems: "center",
|
|
1803
|
+
justifyContent: "center",
|
|
1804
|
+
paddingHorizontal: BOX_SLOT_PAD_H
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
var SwitchSlot = ({
|
|
1808
|
+
label,
|
|
1809
|
+
value,
|
|
1810
|
+
onValueChange,
|
|
1811
|
+
disabled,
|
|
1812
|
+
testID,
|
|
1813
|
+
accessibilityHint,
|
|
1814
|
+
activeTrackColor,
|
|
1815
|
+
inBox = false
|
|
1816
|
+
}) => /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: inBox ? styles14.box : styles14.row, testID: `${testID}-hitbox`, children: /* @__PURE__ */ jsx(
|
|
1817
|
+
Switch,
|
|
1818
|
+
{
|
|
1819
|
+
accessibilityHint: accessibilityHint ?? label,
|
|
1820
|
+
accessibilityLabel: label,
|
|
1821
|
+
accessibilityState: { checked: value, disabled },
|
|
1822
|
+
disabled,
|
|
1823
|
+
testID: `${testID}-switch`,
|
|
1824
|
+
trackColor: activeTrackColor === void 0 ? void 0 : { true: activeTrackColor },
|
|
1825
|
+
value,
|
|
1826
|
+
onValueChange
|
|
1827
|
+
}
|
|
1828
|
+
) });
|
|
1829
|
+
var BOX_RADIUS = 8;
|
|
1830
|
+
var BOX_PAD_LEFT = 10;
|
|
1831
|
+
var BOX_BORDER = 1;
|
|
1832
|
+
var STATE_FONT_SIZE = 13;
|
|
1833
|
+
var styles15 = StyleSheet.create({
|
|
1834
|
+
box: {
|
|
1835
|
+
flexDirection: "row",
|
|
1836
|
+
alignItems: "center",
|
|
1837
|
+
justifyContent: "space-between",
|
|
1838
|
+
minHeight: MIN_TOUCH_TARGET_PX,
|
|
1839
|
+
borderWidth: BOX_BORDER,
|
|
1840
|
+
borderRadius: BOX_RADIUS,
|
|
1841
|
+
paddingLeft: BOX_PAD_LEFT
|
|
1842
|
+
},
|
|
1843
|
+
state: {
|
|
1844
|
+
flex: 1,
|
|
1845
|
+
fontSize: STATE_FONT_SIZE
|
|
1846
|
+
}
|
|
1847
|
+
});
|
|
1848
|
+
var FormSwitchBox = ({
|
|
1849
|
+
stateLabel,
|
|
1850
|
+
description,
|
|
1851
|
+
containerStyle,
|
|
1852
|
+
...slot
|
|
1853
|
+
}) => {
|
|
1854
|
+
const { colors } = useUi().theme;
|
|
1855
|
+
const { disabled, onValueChange, value } = slot;
|
|
1856
|
+
const toggle2 = React39.useCallback(() => {
|
|
1857
|
+
if (!disabled) onValueChange(!value);
|
|
1858
|
+
}, [disabled, onValueChange, value]);
|
|
1859
|
+
const boxColors = React39.useMemo(
|
|
1860
|
+
() => ({ borderColor: colors.border, backgroundColor: colors.surface }),
|
|
1861
|
+
[colors.border, colors.surface]
|
|
1862
|
+
);
|
|
1863
|
+
return /* @__PURE__ */ jsx(Field, { containerStyle, hint: description, label: slot.label, labelVariant: "control", children: () => /* @__PURE__ */ jsxs(
|
|
1864
|
+
Pressable,
|
|
1865
|
+
{
|
|
1866
|
+
accessible: false,
|
|
1867
|
+
disabled,
|
|
1868
|
+
style: [styles15.box, boxColors],
|
|
1869
|
+
tabIndex: -1,
|
|
1870
|
+
testID: slot.testID,
|
|
1871
|
+
onPress: toggle2,
|
|
1872
|
+
children: [
|
|
1873
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles15.state, { color: colors.text }], children: stateLabel ?? "" }),
|
|
1874
|
+
/* @__PURE__ */ jsx(SwitchSlot, { ...slot, inBox: true })
|
|
1875
|
+
]
|
|
1876
|
+
}
|
|
1877
|
+
) });
|
|
1878
|
+
};
|
|
1879
|
+
var DESCRIPTION_FONT_SIZE2 = 12;
|
|
1880
|
+
var styles16 = StyleSheet.create({
|
|
1788
1881
|
container: {
|
|
1789
1882
|
flexDirection: "row",
|
|
1790
1883
|
justifyContent: "space-between",
|
|
@@ -1794,12 +1887,6 @@ var styles14 = StyleSheet.create({
|
|
|
1794
1887
|
// `hitSlop`, so a pointer target smaller than the floor cannot be widened any other way.
|
|
1795
1888
|
minHeight: MIN_TOUCH_TARGET_PX
|
|
1796
1889
|
},
|
|
1797
|
-
switchSlot: {
|
|
1798
|
-
minWidth: MIN_TOUCH_TARGET_PX,
|
|
1799
|
-
minHeight: MIN_TOUCH_TARGET_PX,
|
|
1800
|
-
alignItems: "center",
|
|
1801
|
-
justifyContent: "center"
|
|
1802
|
-
},
|
|
1803
1890
|
textColumn: {
|
|
1804
1891
|
flex: 1
|
|
1805
1892
|
},
|
|
@@ -1811,23 +1898,24 @@ var styles14 = StyleSheet.create({
|
|
|
1811
1898
|
marginTop: 2
|
|
1812
1899
|
}
|
|
1813
1900
|
});
|
|
1814
|
-
var
|
|
1901
|
+
var FormSwitchRow = ({
|
|
1815
1902
|
label,
|
|
1816
1903
|
value,
|
|
1817
1904
|
onValueChange,
|
|
1818
1905
|
disabled = false,
|
|
1819
1906
|
description,
|
|
1820
1907
|
containerStyle,
|
|
1821
|
-
testID
|
|
1822
|
-
accessibilityHint
|
|
1908
|
+
testID,
|
|
1909
|
+
accessibilityHint,
|
|
1910
|
+
activeTrackColor
|
|
1823
1911
|
}) => {
|
|
1824
1912
|
const { theme } = useUi();
|
|
1825
|
-
const toggle2 =
|
|
1913
|
+
const toggle2 = React39.useCallback(() => {
|
|
1826
1914
|
if (!disabled) onValueChange(!value);
|
|
1827
1915
|
}, [disabled, onValueChange, value]);
|
|
1828
1916
|
const { colors } = theme;
|
|
1829
1917
|
const hasDescription = typeof description === "string" && description !== "";
|
|
1830
|
-
const themeStyles =
|
|
1918
|
+
const themeStyles = React39.useMemo(() => {
|
|
1831
1919
|
const labelStyle = { color: colors.text };
|
|
1832
1920
|
const descriptionStyle = { color: colors.textSecondary };
|
|
1833
1921
|
return { label: labelStyle, description: descriptionStyle };
|
|
@@ -1845,38 +1933,45 @@ var FormSwitch = ({
|
|
|
1845
1933
|
accessible: false,
|
|
1846
1934
|
disabled,
|
|
1847
1935
|
onPress: toggle2,
|
|
1848
|
-
style: [
|
|
1936
|
+
style: [styles16.container, containerStyle],
|
|
1849
1937
|
tabIndex: -1,
|
|
1850
1938
|
testID,
|
|
1851
1939
|
children: [
|
|
1852
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1853
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1854
|
-
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1940
|
+
/* @__PURE__ */ jsxs(View, { style: styles16.textColumn, children: [
|
|
1941
|
+
/* @__PURE__ */ jsx(Text, { style: [styles16.label, themeStyles.label], children: label }),
|
|
1942
|
+
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [styles16.description, themeStyles.description], children: description }) : null
|
|
1855
1943
|
] }),
|
|
1856
|
-
/* @__PURE__ */ jsx(
|
|
1857
|
-
|
|
1944
|
+
/* @__PURE__ */ jsx(
|
|
1945
|
+
SwitchSlot,
|
|
1858
1946
|
{
|
|
1859
|
-
accessibilityHint
|
|
1860
|
-
|
|
1861
|
-
accessibilityState: { checked: value, disabled },
|
|
1947
|
+
accessibilityHint,
|
|
1948
|
+
activeTrackColor,
|
|
1862
1949
|
disabled,
|
|
1863
|
-
|
|
1950
|
+
label,
|
|
1951
|
+
testID,
|
|
1864
1952
|
value,
|
|
1865
1953
|
onValueChange
|
|
1866
1954
|
}
|
|
1867
|
-
)
|
|
1955
|
+
)
|
|
1868
1956
|
]
|
|
1869
1957
|
}
|
|
1870
1958
|
)
|
|
1871
1959
|
);
|
|
1872
1960
|
};
|
|
1961
|
+
var FormSwitch = ({
|
|
1962
|
+
variant = "row",
|
|
1963
|
+
stateLabel,
|
|
1964
|
+
testID = "form-switch",
|
|
1965
|
+
disabled = false,
|
|
1966
|
+
...props
|
|
1967
|
+
}) => variant === "box" ? /* @__PURE__ */ jsx(FormSwitchBox, { ...props, disabled, stateLabel, testID }) : /* @__PURE__ */ jsx(FormSwitchRow, { ...props, disabled, testID });
|
|
1873
1968
|
|
|
1874
1969
|
// src/FormCheckbox/checkboxColors.ts
|
|
1875
1970
|
var checkboxBoxColors = (colors, brand, checked) => checked ? { backgroundColor: brand, borderColor: brand } : { backgroundColor: "transparent", borderColor: colors.textSecondary };
|
|
1876
1971
|
var ACTIVATION_KEYS = ["Enter", " ", "Spacebar"];
|
|
1877
1972
|
var HINT_FONT_SIZE2 = 12;
|
|
1878
1973
|
var BOX_SIZE = 20;
|
|
1879
|
-
var
|
|
1974
|
+
var BOX_RADIUS2 = 5;
|
|
1880
1975
|
var TICK_WIDTH = 6;
|
|
1881
1976
|
var TICK_HEIGHT = 10;
|
|
1882
1977
|
var TICK_STROKE = 2;
|
|
@@ -1885,7 +1980,7 @@ var DISABLED_OPACITY = 0.5;
|
|
|
1885
1980
|
var FOCUS_RING_WIDTH = 2;
|
|
1886
1981
|
var WEB_NO_DEFAULT_OUTLINE = { outlineStyle: "none" };
|
|
1887
1982
|
var FOCUS_RING_INSET = -6;
|
|
1888
|
-
var
|
|
1983
|
+
var styles17 = StyleSheet.create({
|
|
1889
1984
|
container: {
|
|
1890
1985
|
flexDirection: "row",
|
|
1891
1986
|
alignItems: "flex-start",
|
|
@@ -1902,7 +1997,7 @@ var styles15 = StyleSheet.create({
|
|
|
1902
1997
|
box: {
|
|
1903
1998
|
width: BOX_SIZE,
|
|
1904
1999
|
height: BOX_SIZE,
|
|
1905
|
-
borderRadius:
|
|
2000
|
+
borderRadius: BOX_RADIUS2,
|
|
1906
2001
|
borderWidth: 2,
|
|
1907
2002
|
alignItems: "center",
|
|
1908
2003
|
justifyContent: "center",
|
|
@@ -1916,7 +2011,7 @@ var styles15 = StyleSheet.create({
|
|
|
1916
2011
|
right: FOCUS_RING_INSET,
|
|
1917
2012
|
bottom: FOCUS_RING_INSET,
|
|
1918
2013
|
borderWidth: FOCUS_RING_WIDTH,
|
|
1919
|
-
borderRadius:
|
|
2014
|
+
borderRadius: BOX_RADIUS2 - FOCUS_RING_INSET
|
|
1920
2015
|
},
|
|
1921
2016
|
tick: {
|
|
1922
2017
|
width: TICK_WIDTH,
|
|
@@ -1956,8 +2051,8 @@ var FormCheckbox = ({
|
|
|
1956
2051
|
const hintText = typeof hint === "string" && hint !== "" ? hint : description;
|
|
1957
2052
|
const hasHint = typeof hintText === "string" && hintText !== "";
|
|
1958
2053
|
const { hintId } = useFieldIds();
|
|
1959
|
-
const [focused, setFocused] =
|
|
1960
|
-
const themeStyles =
|
|
2054
|
+
const [focused, setFocused] = React39.useState(false);
|
|
2055
|
+
const themeStyles = React39.useMemo(() => {
|
|
1961
2056
|
const boxOn = checkboxBoxColors(colors, brand, true);
|
|
1962
2057
|
const boxOff = checkboxBoxColors(colors, brand, false);
|
|
1963
2058
|
const ring = { borderColor: brand };
|
|
@@ -1993,8 +2088,8 @@ var FormCheckbox = ({
|
|
|
1993
2088
|
onPress: toggle2,
|
|
1994
2089
|
role: "checkbox",
|
|
1995
2090
|
style: [
|
|
1996
|
-
|
|
1997
|
-
hasHint ? null :
|
|
2091
|
+
styles17.container,
|
|
2092
|
+
hasHint ? null : styles17.centered,
|
|
1998
2093
|
containerStyle,
|
|
1999
2094
|
disabled ? { opacity: DISABLED_OPACITY } : null,
|
|
2000
2095
|
Platform.OS === "web" ? WEB_NO_DEFAULT_OUTLINE : null
|
|
@@ -2002,13 +2097,13 @@ var FormCheckbox = ({
|
|
|
2002
2097
|
testID,
|
|
2003
2098
|
...keyboardProps,
|
|
2004
2099
|
children: [
|
|
2005
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
2006
|
-
focused ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: [
|
|
2007
|
-
value ? /* @__PURE__ */ jsx(View, { accessibilityElementsHidden: true, pointerEvents: "none", style: [
|
|
2100
|
+
/* @__PURE__ */ jsxs(View, { style: [styles17.box, value ? themeStyles.boxOn : themeStyles.boxOff], testID: `${testID}-box`, children: [
|
|
2101
|
+
focused ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: [styles17.focusRing, themeStyles.ring], testID: `${testID}-focus-ring` }) : null,
|
|
2102
|
+
value ? /* @__PURE__ */ jsx(View, { accessibilityElementsHidden: true, pointerEvents: "none", style: [styles17.tick, { borderColor: colors.surface }], testID: `${testID}-tick` }) : null
|
|
2008
2103
|
] }),
|
|
2009
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2010
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2011
|
-
hasHint ? /* @__PURE__ */ jsx(Text, { nativeID: hintId, style: [
|
|
2104
|
+
/* @__PURE__ */ jsxs(View, { style: styles17.textColumn, children: [
|
|
2105
|
+
/* @__PURE__ */ jsx(Text, { style: [styles17.label, themeStyles.label], children: label }),
|
|
2106
|
+
hasHint ? /* @__PURE__ */ jsx(Text, { nativeID: hintId, style: [styles17.hint, themeStyles.hint], children: hintText }) : null
|
|
2012
2107
|
] })
|
|
2013
2108
|
]
|
|
2014
2109
|
}
|
|
@@ -2224,7 +2319,7 @@ var CHIP_PAD_H = 8;
|
|
|
2224
2319
|
var CHIP_PAD_V = 4;
|
|
2225
2320
|
var CHIP_RADIUS = 999;
|
|
2226
2321
|
var CHIP_FONT = 13;
|
|
2227
|
-
var
|
|
2322
|
+
var styles18 = StyleSheet.create({
|
|
2228
2323
|
chip: {
|
|
2229
2324
|
flexDirection: "row",
|
|
2230
2325
|
alignItems: "center",
|
|
@@ -2245,12 +2340,12 @@ function SelectedChip({ option, colors, removeLabel, removeHint, onRemove, testI
|
|
|
2245
2340
|
accessibilityLabel: removeLabel,
|
|
2246
2341
|
accessibilityRole: "button",
|
|
2247
2342
|
hitSlop: CHIP_HIT_SLOP,
|
|
2248
|
-
style: [
|
|
2343
|
+
style: [styles18.chip, { borderColor: colors.border, backgroundColor: colors.surface }],
|
|
2249
2344
|
testID,
|
|
2250
2345
|
onPress: () => onRemove(option.value),
|
|
2251
2346
|
children: [
|
|
2252
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [
|
|
2253
|
-
/* @__PURE__ */ jsx(Text, { "aria-hidden": true, style: [
|
|
2347
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles18.text, { color: colors.text }], children: option.label }),
|
|
2348
|
+
/* @__PURE__ */ jsx(Text, { "aria-hidden": true, style: [styles18.text, { color: colors.text }], children: REMOVE_GLYPH })
|
|
2254
2349
|
]
|
|
2255
2350
|
}
|
|
2256
2351
|
);
|
|
@@ -2273,7 +2368,7 @@ var CHEVRON_DOWN2 = "\u25BE";
|
|
|
2273
2368
|
var CHEVRON_UP2 = "\u25B4";
|
|
2274
2369
|
var BOX_GAP = 6;
|
|
2275
2370
|
var TRIGGER_MIN_WIDTH = 96;
|
|
2276
|
-
var
|
|
2371
|
+
var styles19 = StyleSheet.create({
|
|
2277
2372
|
box: { flexWrap: "wrap", justifyContent: "flex-start", gap: BOX_GAP },
|
|
2278
2373
|
trigger: {
|
|
2279
2374
|
flexGrow: 1,
|
|
@@ -2307,7 +2402,7 @@ function MultiSelectBox(props) {
|
|
|
2307
2402
|
const chipColors = { text: colors.text, border: colors.border, surface: colors.surface };
|
|
2308
2403
|
const summary = chosen.map((option) => option.label).join(", ");
|
|
2309
2404
|
return /* @__PURE__ */ jsxs(View, { ref: anchorRef, style: controlStyles.anchor, children: [
|
|
2310
|
-
/* @__PURE__ */ jsxs(View, { style: [controlStyles.selectTrigger,
|
|
2405
|
+
/* @__PURE__ */ jsxs(View, { style: [controlStyles.selectTrigger, styles19.box, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }], testID: `${testID}-box`, children: [
|
|
2311
2406
|
chosen.map((option) => /* @__PURE__ */ jsx(
|
|
2312
2407
|
SelectedChip,
|
|
2313
2408
|
{
|
|
@@ -2331,7 +2426,7 @@ function MultiSelectBox(props) {
|
|
|
2331
2426
|
"aria-haspopup": "menu",
|
|
2332
2427
|
"aria-labelledby": labelId,
|
|
2333
2428
|
disabled: remaining.length === 0,
|
|
2334
|
-
style:
|
|
2429
|
+
style: styles19.trigger,
|
|
2335
2430
|
testID: `${testID}-trigger`,
|
|
2336
2431
|
onPress: toggle2,
|
|
2337
2432
|
children: [
|
|
@@ -2769,20 +2864,20 @@ function DropdownSurface({ progress, translateY, anchorRef, onDismiss, closeLabe
|
|
|
2769
2864
|
const place = frame === null ? null : { left: frame.left, width: frame.width, top: frame.top, bottom: frame.bottom };
|
|
2770
2865
|
return /* @__PURE__ */ jsxs(Modal, { transparent: true, visible: true, animationType: "none", "aria-label": accessibilityLabel, onRequestClose: onDismiss, children: [
|
|
2771
2866
|
/* @__PURE__ */ jsx(Pressable, { accessibilityHint: closeHint, accessibilityLabel: closeLabel, accessibilityRole: "button", style: StyleSheet.absoluteFill, testID: `${testID}-backdrop`, onPress: onDismiss }),
|
|
2772
|
-
frame !== null ? /* @__PURE__ */ jsx(Animated.View, { style: [
|
|
2867
|
+
frame !== null ? /* @__PURE__ */ jsx(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
|
|
2773
2868
|
] });
|
|
2774
2869
|
}
|
|
2775
|
-
var
|
|
2870
|
+
var styles20 = StyleSheet.create({
|
|
2776
2871
|
dropdown: { position: "absolute" },
|
|
2777
2872
|
growFromField: { transformOrigin: "top left" }
|
|
2778
2873
|
});
|
|
2779
2874
|
function SheetSurface({ translateY, onDismiss, closeLabel, closeHint, testID, children, progress, scale, accessibilityLabel }) {
|
|
2780
|
-
return /* @__PURE__ */ jsx(Modal, { transparent: true, visible: true, animationType: "none", "aria-label": accessibilityLabel, onRequestClose: onDismiss, children: /* @__PURE__ */ jsxs(View, { style:
|
|
2875
|
+
return /* @__PURE__ */ jsx(Modal, { transparent: true, visible: true, animationType: "none", "aria-label": accessibilityLabel, onRequestClose: onDismiss, children: /* @__PURE__ */ jsxs(View, { style: styles21.backdrop, children: [
|
|
2781
2876
|
/* @__PURE__ */ jsx(Pressable, { accessibilityHint: closeHint, accessibilityLabel: closeLabel, accessibilityRole: "button", style: StyleSheet.absoluteFill, testID: `${testID}-backdrop`, onPress: onDismiss }),
|
|
2782
|
-
/* @__PURE__ */ jsx(Animated.View, { testID: `${testID}-sheet`, style: [
|
|
2877
|
+
/* @__PURE__ */ jsx(Animated.View, { testID: `${testID}-sheet`, style: [styles21.sheet, { transform: scale === void 0 ? [{ translateY }] : [{ translateY }, { scale }] }, progress === void 0 ? null : { opacity: progress }], children })
|
|
2783
2878
|
] }) });
|
|
2784
2879
|
}
|
|
2785
|
-
var
|
|
2880
|
+
var styles21 = StyleSheet.create({
|
|
2786
2881
|
backdrop: { flex: 1, justifyContent: "flex-end" },
|
|
2787
2882
|
sheet: { width: "100%", alignSelf: "stretch" }
|
|
2788
2883
|
});
|
|
@@ -3822,7 +3917,7 @@ var ROW_GAP = 4;
|
|
|
3822
3917
|
var TAB_PADDING = 4;
|
|
3823
3918
|
var INDICATOR_WIDTH = 2;
|
|
3824
3919
|
var TAB_FONT_SIZE = 12;
|
|
3825
|
-
var
|
|
3920
|
+
var styles22 = StyleSheet.create({
|
|
3826
3921
|
row: { flexDirection: "row", flexWrap: "nowrap", gap: ROW_GAP },
|
|
3827
3922
|
tab: {
|
|
3828
3923
|
borderBottomWidth: INDICATOR_WIDTH,
|
|
@@ -3862,13 +3957,13 @@ var StepperTab = ({
|
|
|
3862
3957
|
accessibilityRole: "tab",
|
|
3863
3958
|
accessibilityState: { selected },
|
|
3864
3959
|
"aria-selected": selected,
|
|
3865
|
-
style: [
|
|
3960
|
+
style: [styles22.tab, { borderBottomColor: indicator }, ring.ringStyle],
|
|
3866
3961
|
testID,
|
|
3867
3962
|
onBlur: ring.onBlur,
|
|
3868
3963
|
onFocus: ring.onFocus,
|
|
3869
3964
|
onPress: () => onStep(step.key),
|
|
3870
3965
|
...webKeyProps,
|
|
3871
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
3966
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles22.text, { color: theme.colors.text }, selected ? styles22.textSelected : void 0], children: step.label })
|
|
3872
3967
|
}
|
|
3873
3968
|
);
|
|
3874
3969
|
};
|
|
@@ -3878,7 +3973,7 @@ var StepperTabs = ({
|
|
|
3878
3973
|
onStep,
|
|
3879
3974
|
stepHint,
|
|
3880
3975
|
testID
|
|
3881
|
-
}) => /* @__PURE__ */ jsx(View, { accessibilityRole: "tablist", style:
|
|
3976
|
+
}) => /* @__PURE__ */ jsx(View, { accessibilityRole: "tablist", style: styles22.row, testID, children: steps.map((step) => /* @__PURE__ */ jsx(
|
|
3882
3977
|
StepperTab,
|
|
3883
3978
|
{
|
|
3884
3979
|
hint: stepHint,
|
|
@@ -3897,7 +3992,7 @@ function resolveStepNeighbours(steps, current) {
|
|
|
3897
3992
|
return { previous: steps[index - 1] ?? null, next: steps[index + 1] ?? null };
|
|
3898
3993
|
}
|
|
3899
3994
|
var ROW_GAP2 = 8;
|
|
3900
|
-
var
|
|
3995
|
+
var styles23 = StyleSheet.create({
|
|
3901
3996
|
cell: { flex: 1, minWidth: 0 },
|
|
3902
3997
|
row: { flexDirection: "row", gap: ROW_GAP2 }
|
|
3903
3998
|
});
|
|
@@ -3909,8 +4004,8 @@ var StepperNav = ({
|
|
|
3909
4004
|
testID
|
|
3910
4005
|
}) => {
|
|
3911
4006
|
const { previous, next } = resolveStepNeighbours(steps, current);
|
|
3912
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
3913
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
4007
|
+
return /* @__PURE__ */ jsxs(View, { style: styles23.row, testID, children: [
|
|
4008
|
+
/* @__PURE__ */ jsx(View, { style: styles23.cell, children: /* @__PURE__ */ jsx(
|
|
3914
4009
|
Button,
|
|
3915
4010
|
{
|
|
3916
4011
|
fullWidth: true,
|
|
@@ -3926,7 +4021,7 @@ var StepperNav = ({
|
|
|
3926
4021
|
}
|
|
3927
4022
|
}
|
|
3928
4023
|
) }),
|
|
3929
|
-
next === null ? null : /* @__PURE__ */ jsx(View, { style:
|
|
4024
|
+
next === null ? null : /* @__PURE__ */ jsx(View, { style: styles23.cell, children: /* @__PURE__ */ jsx(
|
|
3930
4025
|
Button,
|
|
3931
4026
|
{
|
|
3932
4027
|
fullWidth: true,
|
|
@@ -3941,13 +4036,13 @@ var StepperNav = ({
|
|
|
3941
4036
|
] });
|
|
3942
4037
|
};
|
|
3943
4038
|
var STATUS_FONT = 16;
|
|
3944
|
-
var
|
|
4039
|
+
var styles24 = StyleSheet.create({
|
|
3945
4040
|
line: { fontSize: STATUS_FONT }
|
|
3946
4041
|
});
|
|
3947
4042
|
function FormStatusLine({ message, testID, style }) {
|
|
3948
4043
|
const { theme } = useUi();
|
|
3949
4044
|
if (message === null || message === void 0 || message === "") return null;
|
|
3950
|
-
return /* @__PURE__ */ jsx(Text, { role: "alert", style: [
|
|
4045
|
+
return /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles24.line, { color: theme.colors.text }, style], testID, children: message });
|
|
3951
4046
|
}
|
|
3952
4047
|
function useFocusFirstInvalid(refs) {
|
|
3953
4048
|
const latest = useRef(refs);
|
|
@@ -4036,7 +4131,7 @@ function useKeepInView(trigger) {
|
|
|
4036
4131
|
}
|
|
4037
4132
|
var IS_WEB10 = Platform.OS === "web";
|
|
4038
4133
|
var INPUT_FONT2 = 14;
|
|
4039
|
-
var
|
|
4134
|
+
var styles25 = StyleSheet.create({
|
|
4040
4135
|
nativeButton: { minHeight: MIN_TOUCH_TARGET_PX, minWidth: MIN_TOUCH_TARGET_PX, justifyContent: "center" },
|
|
4041
4136
|
nativeText: { fontSize: INPUT_FONT2 }
|
|
4042
4137
|
});
|
|
@@ -4064,10 +4159,10 @@ function FileInput({
|
|
|
4064
4159
|
accessibilityRole: "button",
|
|
4065
4160
|
accessibilityState: { disabled },
|
|
4066
4161
|
disabled,
|
|
4067
|
-
style:
|
|
4162
|
+
style: styles25.nativeButton,
|
|
4068
4163
|
testID,
|
|
4069
4164
|
onPress: onNativePick,
|
|
4070
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
4165
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles25.nativeText, { color: colors.text }], children: nativeLabel ?? accessibilityLabel })
|
|
4071
4166
|
}
|
|
4072
4167
|
);
|
|
4073
4168
|
}
|
|
@@ -4097,7 +4192,7 @@ var PREVIEW_RADIUS = 8;
|
|
|
4097
4192
|
var GAP6 = 8;
|
|
4098
4193
|
var TITLE_FONT_SIZE = 14;
|
|
4099
4194
|
var HELP_FONT_SIZE = 13;
|
|
4100
|
-
var
|
|
4195
|
+
var styles26 = StyleSheet.create({
|
|
4101
4196
|
help: { flex: 1, fontSize: HELP_FONT_SIZE },
|
|
4102
4197
|
root: { gap: GAP6 },
|
|
4103
4198
|
tile: { alignItems: "center", flexDirection: "row", gap: GAP6 },
|
|
@@ -4119,11 +4214,11 @@ var UploadWithLinkField = ({
|
|
|
4119
4214
|
const url = value ?? "";
|
|
4120
4215
|
const [pasting, setPasting] = useState(url !== "");
|
|
4121
4216
|
const previewBox = { borderRadius: PREVIEW_RADIUS, height: previewSize, width: previewSize };
|
|
4122
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
4123
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
4124
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4217
|
+
return /* @__PURE__ */ jsxs(View, { style: styles26.root, children: [
|
|
4218
|
+
/* @__PURE__ */ jsx(Text, { style: [styles26.title, { color: theme.colors.text }], children: labels.title }),
|
|
4219
|
+
/* @__PURE__ */ jsxs(View, { style: styles26.tile, children: [
|
|
4125
4220
|
url === "" ? /* @__PURE__ */ jsx(View, { style: [previewBox, { backgroundColor: theme.colors.border }] }) : /* @__PURE__ */ jsx(Image, { accessible: false, source: { uri: url }, style: previewBox, testID: `${testID}-preview` }),
|
|
4126
|
-
labels.help === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [
|
|
4221
|
+
labels.help === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [styles26.help, { color: theme.colors.text }], children: labels.help })
|
|
4127
4222
|
] }),
|
|
4128
4223
|
uploadControl,
|
|
4129
4224
|
/* @__PURE__ */ jsx(
|
|
@@ -4134,12 +4229,12 @@ var UploadWithLinkField = ({
|
|
|
4134
4229
|
accessibilityRole: "button",
|
|
4135
4230
|
accessibilityState: { expanded: pasting },
|
|
4136
4231
|
"aria-expanded": pasting,
|
|
4137
|
-
style: [
|
|
4232
|
+
style: [styles26.toggle, ring.ringStyle],
|
|
4138
4233
|
testID: `${testID}-paste`,
|
|
4139
4234
|
onBlur: ring.onBlur,
|
|
4140
4235
|
onFocus: ring.onFocus,
|
|
4141
4236
|
onPress: () => setPasting(!pasting),
|
|
4142
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
4237
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles26.toggleText, { color: theme.colors.text }], children: labels.pasteToggle })
|
|
4143
4238
|
}
|
|
4144
4239
|
),
|
|
4145
4240
|
pasting ? /* @__PURE__ */ jsx(
|
|
@@ -4158,7 +4253,7 @@ var UploadWithLinkField = ({
|
|
|
4158
4253
|
};
|
|
4159
4254
|
var ACTION_GAP = 8;
|
|
4160
4255
|
var GROUP_GAP = 16;
|
|
4161
|
-
var
|
|
4256
|
+
var styles27 = StyleSheet.create({
|
|
4162
4257
|
action: { alignItems: "flex-start", marginTop: ACTION_GAP },
|
|
4163
4258
|
group: { marginBottom: GROUP_GAP }
|
|
4164
4259
|
});
|
|
@@ -4181,7 +4276,7 @@ var AddOnRequest = ({
|
|
|
4181
4276
|
onRemove();
|
|
4182
4277
|
};
|
|
4183
4278
|
if (!isAddOnOpen(hasValue, requested))
|
|
4184
|
-
return /* @__PURE__ */ jsx(View, { style: [
|
|
4279
|
+
return /* @__PURE__ */ jsx(View, { style: [styles27.action, style], children: /* @__PURE__ */ jsx(
|
|
4185
4280
|
Button,
|
|
4186
4281
|
{
|
|
4187
4282
|
accessibilityHint: addHint,
|
|
@@ -4193,9 +4288,9 @@ var AddOnRequest = ({
|
|
|
4193
4288
|
onPress: () => setRequested(true)
|
|
4194
4289
|
}
|
|
4195
4290
|
) });
|
|
4196
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
4291
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles27.group, style], testID, children: [
|
|
4197
4292
|
children,
|
|
4198
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
4293
|
+
/* @__PURE__ */ jsx(View, { style: styles27.action, children: /* @__PURE__ */ jsx(
|
|
4199
4294
|
Button,
|
|
4200
4295
|
{
|
|
4201
4296
|
accessibilityHint: removeHint,
|
|
@@ -4212,7 +4307,7 @@ var AddOnRequest = ({
|
|
|
4212
4307
|
var ROW_GAP3 = 8;
|
|
4213
4308
|
var TEXT_SIZE = 13;
|
|
4214
4309
|
var TEXT_LINE = 18;
|
|
4215
|
-
var
|
|
4310
|
+
var styles28 = StyleSheet.create({
|
|
4216
4311
|
row: { alignItems: "center", columnGap: ROW_GAP3, flexDirection: "row", justifyContent: "space-between" },
|
|
4217
4312
|
text: { flexShrink: 1, fontSize: TEXT_SIZE, fontWeight: "700", lineHeight: TEXT_LINE }
|
|
4218
4313
|
});
|
|
@@ -4220,8 +4315,8 @@ var isFixBarVisible = (count) => count > 0;
|
|
|
4220
4315
|
var FixBar = ({ count, message, showLabel, showHint, onShow, testID, style }) => {
|
|
4221
4316
|
const { theme } = useUi();
|
|
4222
4317
|
if (!isFixBarVisible(count)) return null;
|
|
4223
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
4224
|
-
/* @__PURE__ */ jsx(Text, { role: "alert", style: [
|
|
4318
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles28.row, style], testID, children: [
|
|
4319
|
+
/* @__PURE__ */ jsx(Text, { role: "alert", style: [styles28.text, { color: fieldErrorInk(theme) }], testID: `${testID}-count`, children: message }),
|
|
4225
4320
|
/* @__PURE__ */ jsx(
|
|
4226
4321
|
Button,
|
|
4227
4322
|
{
|
|
@@ -4259,21 +4354,21 @@ function OptionRow2({ option, active, current, renderLeading, renderDetail, onPi
|
|
|
4259
4354
|
accessibilityLabel: option.label,
|
|
4260
4355
|
accessibilityRole: "button",
|
|
4261
4356
|
accessibilityState: { selected: active, checked: current },
|
|
4262
|
-
style: [
|
|
4357
|
+
style: [styles29.row, active ? { backgroundColor: colors.surface } : null],
|
|
4263
4358
|
testID: `${testID}-option-${option.value}`,
|
|
4264
4359
|
onPress: () => onPick(option),
|
|
4265
4360
|
children: [
|
|
4266
4361
|
renderLeading?.(option),
|
|
4267
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4268
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
4269
|
-
detailBelow ? /* @__PURE__ */ jsx(Text, { style: [
|
|
4362
|
+
/* @__PURE__ */ jsxs(View, { style: styles29.label, children: [
|
|
4363
|
+
/* @__PURE__ */ jsx(Text, { style: [styles29.primary, { color: colors.text }], children: option.label }),
|
|
4364
|
+
detailBelow ? /* @__PURE__ */ jsx(Text, { style: [styles29.secondary, { color: colors.textSecondary }], children: option.detail }) : null
|
|
4270
4365
|
] }),
|
|
4271
4366
|
renderDetail?.(option)
|
|
4272
4367
|
]
|
|
4273
4368
|
}
|
|
4274
4369
|
);
|
|
4275
4370
|
}
|
|
4276
|
-
var
|
|
4371
|
+
var styles29 = StyleSheet.create({
|
|
4277
4372
|
row: { minHeight: MIN_TOUCH_TARGET_PX, flexDirection: "row", alignItems: "center", gap: ROW_GAP4, paddingHorizontal: ROW_PAD_H },
|
|
4278
4373
|
label: { flex: 1 },
|
|
4279
4374
|
primary: { fontSize: OPTION_FONT2, flexShrink: 1 },
|
|
@@ -4287,11 +4382,11 @@ function OptionSection({ title, options, offset, highlight, selectedValue, ...ro
|
|
|
4287
4382
|
const { colors } = theme;
|
|
4288
4383
|
if (options.length === 0) return null;
|
|
4289
4384
|
return /* @__PURE__ */ jsxs(View, { children: [
|
|
4290
|
-
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [
|
|
4385
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles30.header, { color: colors.textSecondary }], children: title }),
|
|
4291
4386
|
options.map((option, index) => /* @__PURE__ */ jsx(OptionRow2, { ...row, active: offset + index === highlight, current: option.value === selectedValue, option }, option.value))
|
|
4292
4387
|
] });
|
|
4293
4388
|
}
|
|
4294
|
-
var
|
|
4389
|
+
var styles30 = StyleSheet.create({
|
|
4295
4390
|
header: { fontSize: HEADER_FONT, paddingHorizontal: ROW_PAD_H2, paddingTop: ROW_GAP5, textTransform: "uppercase" }
|
|
4296
4391
|
});
|
|
4297
4392
|
var KEY_ESCAPE = "Escape";
|
|
@@ -4321,7 +4416,7 @@ function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, re
|
|
|
4321
4416
|
const translateY = progress.interpolate({ inputRange: [0, 1], outputRange: [motion.fromY, 0] });
|
|
4322
4417
|
const isSheet = motion.surface === "sheet" /* Sheet */;
|
|
4323
4418
|
const shared = { selectedValue, renderLeading, renderDetail, onPick: pick, optionHint: labels.optionHint, testID, highlight };
|
|
4324
|
-
const list = /* @__PURE__ */ jsxs(View, { style: [
|
|
4419
|
+
const list = /* @__PURE__ */ jsxs(View, { style: [styles31.panel, { backgroundColor: colors.surfaceElevated, borderColor: colors.border }], testID: `${testID}-panel`, children: [
|
|
4325
4420
|
/* @__PURE__ */ jsx(
|
|
4326
4421
|
TextInput,
|
|
4327
4422
|
{
|
|
@@ -4338,16 +4433,16 @@ function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, re
|
|
|
4338
4433
|
onSubmitEditing: submit
|
|
4339
4434
|
}
|
|
4340
4435
|
),
|
|
4341
|
-
/* @__PURE__ */ jsxs(ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ?
|
|
4436
|
+
/* @__PURE__ */ jsxs(ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ? styles31.sheetList : styles31.dropList, children: [
|
|
4342
4437
|
/* @__PURE__ */ jsx(OptionSection, { ...shared, offset: 0, options: sections.recent, title: labels.recent }),
|
|
4343
4438
|
/* @__PURE__ */ jsx(OptionSection, { ...shared, offset: sections.recent.length, options: sections.all, title: labels.all }),
|
|
4344
|
-
sections.flat.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
4439
|
+
sections.flat.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [styles31.empty, { color: colors.textSecondary }], children: labels.empty }) : null
|
|
4345
4440
|
] })
|
|
4346
4441
|
] });
|
|
4347
4442
|
if (!isSheet) return /* @__PURE__ */ jsx(DropdownSurface, { anchorRef, closeHint: labels.closeHint, closeLabel: labels.close, progress, testID, translateY, onDismiss: dismiss, children: list });
|
|
4348
4443
|
return /* @__PURE__ */ jsx(SheetSurface, { closeHint: labels.closeHint, closeLabel: labels.close, testID, translateY, onDismiss: dismiss, children: list });
|
|
4349
4444
|
}
|
|
4350
|
-
var
|
|
4445
|
+
var styles31 = StyleSheet.create({
|
|
4351
4446
|
panel: { borderWidth: 1, borderRadius: PANEL_RADIUS, padding: PANEL_PAD, gap: PANEL_PAD },
|
|
4352
4447
|
dropList: { maxHeight: MENU_MAX_HEIGHT },
|
|
4353
4448
|
sheetList: { maxHeight: SHEET_MAX_HEIGHT2 },
|
|
@@ -4457,7 +4552,7 @@ function SearchSelect(props) {
|
|
|
4457
4552
|
const onTriggerBlur = useCallback(() => {
|
|
4458
4553
|
if (!openRef.current) onBlur?.();
|
|
4459
4554
|
}, [onBlur]);
|
|
4460
|
-
return /* @__PURE__ */ jsxs(View, { ref: anchorRef, style:
|
|
4555
|
+
return /* @__PURE__ */ jsxs(View, { ref: anchorRef, style: styles32.anchor, children: [
|
|
4461
4556
|
/* @__PURE__ */ jsx(
|
|
4462
4557
|
Pressable,
|
|
4463
4558
|
{
|
|
@@ -4466,7 +4561,7 @@ function SearchSelect(props) {
|
|
|
4466
4561
|
accessibilityLabel,
|
|
4467
4562
|
accessibilityRole: "button",
|
|
4468
4563
|
accessibilityState: { expanded: state.open },
|
|
4469
|
-
style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] :
|
|
4564
|
+
style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] : styles32.customTrigger,
|
|
4470
4565
|
testID,
|
|
4471
4566
|
onBlur: onTriggerBlur,
|
|
4472
4567
|
onPress,
|
|
@@ -4478,7 +4573,7 @@ function SearchSelect(props) {
|
|
|
4478
4573
|
}
|
|
4479
4574
|
function FieldBoxContent({ selected, placeholder, colors, renderLeading, renderDetail }) {
|
|
4480
4575
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4481
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4576
|
+
/* @__PURE__ */ jsxs(View, { style: styles32.value, children: [
|
|
4482
4577
|
selected !== null && renderLeading !== void 0 ? renderLeading(selected) : null,
|
|
4483
4578
|
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [controlStyles.selectTriggerText, { color: selected === null ? colors.textSecondary : colors.text }], children: selected?.label ?? placeholder }),
|
|
4484
4579
|
selected !== null ? /* @__PURE__ */ jsx(SelectedDetail, { colors, option: selected, renderDetail }) : null
|
|
@@ -4491,7 +4586,7 @@ function SelectedDetail({ option, colors, renderDetail }) {
|
|
|
4491
4586
|
if (option.detail === void 0) return null;
|
|
4492
4587
|
return /* @__PURE__ */ jsx(Text, { style: [controlStyles.selectTriggerText, { color: colors.textSecondary }], children: option.detail });
|
|
4493
4588
|
}
|
|
4494
|
-
var
|
|
4589
|
+
var styles32 = StyleSheet.create({
|
|
4495
4590
|
anchor: { position: "relative" },
|
|
4496
4591
|
customTrigger: { minHeight: MIN_TOUCH, minWidth: MIN_TOUCH, alignSelf: "flex-start", justifyContent: "center" },
|
|
4497
4592
|
value: { flex: 1, flexDirection: "row", alignItems: "center", gap: VALUE_GAP }
|
|
@@ -5268,7 +5363,7 @@ function CountryField({ value, onChange, accessibilityLabel, accessibilityHint,
|
|
|
5268
5363
|
const { theme } = useUi();
|
|
5269
5364
|
const { textSecondary } = theme.colors;
|
|
5270
5365
|
const options = useMemo(() => countryFieldOptions(countries, noneLabel), [countries, noneLabel]);
|
|
5271
|
-
const renderCode = useCallback((option) => /* @__PURE__ */ jsx(Text, { style: [
|
|
5366
|
+
const renderCode = useCallback((option) => /* @__PURE__ */ jsx(Text, { style: [styles33.code, { color: textSecondary }], children: option.detail }), [textSecondary]);
|
|
5272
5367
|
return /* @__PURE__ */ jsx(
|
|
5273
5368
|
SearchSelect,
|
|
5274
5369
|
{
|
|
@@ -5286,7 +5381,7 @@ function CountryField({ value, onChange, accessibilityLabel, accessibilityHint,
|
|
|
5286
5381
|
}
|
|
5287
5382
|
);
|
|
5288
5383
|
}
|
|
5289
|
-
var
|
|
5384
|
+
var styles33 = StyleSheet.create({
|
|
5290
5385
|
code: { fontSize: CODE_FONT }
|
|
5291
5386
|
});
|
|
5292
5387
|
function useBlurVerdict(validate) {
|
|
@@ -5542,9 +5637,9 @@ var LINE_GAP = 4;
|
|
|
5542
5637
|
function RejectionLine({ message, testID }) {
|
|
5543
5638
|
const { theme } = useUi();
|
|
5544
5639
|
if (message === null) return null;
|
|
5545
|
-
return /* @__PURE__ */ jsx(Text, { accessibilityLiveRegion: "polite", style: [
|
|
5640
|
+
return /* @__PURE__ */ jsx(Text, { accessibilityLiveRegion: "polite", style: [styles34.line, { color: fieldErrorInk(theme) }], testID: `${testID}-rejection`, children: message });
|
|
5546
5641
|
}
|
|
5547
|
-
var
|
|
5642
|
+
var styles34 = StyleSheet.create({
|
|
5548
5643
|
line: { marginTop: LINE_GAP }
|
|
5549
5644
|
});
|
|
5550
5645
|
|
|
@@ -5691,7 +5786,7 @@ var PAD_V = 10;
|
|
|
5691
5786
|
var PAD_H = 16;
|
|
5692
5787
|
var TEXT_SIZE2 = 13;
|
|
5693
5788
|
var TEXT_LINE2 = 18;
|
|
5694
|
-
var
|
|
5789
|
+
var styles35 = StyleSheet.create({
|
|
5695
5790
|
bar: { borderTopWidth: 1, paddingHorizontal: PAD_H, paddingVertical: PAD_V, rowGap: BAR_GAP },
|
|
5696
5791
|
actions: { flexDirection: "row", flexWrap: "wrap", gap: BAR_GAP },
|
|
5697
5792
|
message: { fontSize: TEXT_SIZE2, fontWeight: "700", lineHeight: TEXT_LINE2 }
|
|
@@ -5703,9 +5798,9 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
|
|
|
5703
5798
|
const { colors } = theme;
|
|
5704
5799
|
const pinned = actionBarPosition(sticky, Platform.OS) === "sticky" ? PINNED : null;
|
|
5705
5800
|
const hasMessage = message !== void 0 && message !== "";
|
|
5706
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
5707
|
-
hasMessage ? /* @__PURE__ */ jsx(Text, { role: "status", style: [
|
|
5708
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
5801
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles35.bar, { backgroundColor: colors.surface, borderTopColor: colors.border }, pinned, style], testID, children: [
|
|
5802
|
+
hasMessage ? /* @__PURE__ */ jsx(Text, { role: "status", style: [styles35.message, { color: colors.text }], testID: `${testID}-message`, children: message }) : null,
|
|
5803
|
+
/* @__PURE__ */ jsx(View, { style: styles35.actions, children })
|
|
5709
5804
|
] });
|
|
5710
5805
|
};
|
|
5711
5806
|
|
|
@@ -5713,14 +5808,14 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
|
|
|
5713
5808
|
var isChecklistComplete = (items, checked) => items.every((item) => checked.includes(item.id));
|
|
5714
5809
|
var TITLE_SIZE = 13;
|
|
5715
5810
|
var TITLE_GAP = 6;
|
|
5716
|
-
var
|
|
5811
|
+
var styles36 = StyleSheet.create({
|
|
5717
5812
|
title: { fontSize: TITLE_SIZE, fontWeight: "700", marginBottom: TITLE_GAP }
|
|
5718
5813
|
});
|
|
5719
5814
|
var GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = false, children }) => {
|
|
5720
5815
|
const { theme } = useUi();
|
|
5721
5816
|
const complete = isChecklistComplete(items, checked);
|
|
5722
5817
|
return /* @__PURE__ */ jsxs(View, { testID, children: [
|
|
5723
|
-
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [
|
|
5818
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles36.title, { color: theme.colors.text }], children: title }),
|
|
5724
5819
|
items.map((item) => /* @__PURE__ */ jsx(
|
|
5725
5820
|
FormCheckbox,
|
|
5726
5821
|
{
|
|
@@ -5746,7 +5841,7 @@ var RADIUS2 = 8;
|
|
|
5746
5841
|
var LABEL_SIZE = 14;
|
|
5747
5842
|
var DESCRIPTION_SIZE = 12;
|
|
5748
5843
|
var DESCRIPTION_LINE = 16;
|
|
5749
|
-
var
|
|
5844
|
+
var styles37 = StyleSheet.create({
|
|
5750
5845
|
row: {
|
|
5751
5846
|
alignItems: "center",
|
|
5752
5847
|
borderRadius: RADIUS2,
|
|
@@ -5777,15 +5872,15 @@ function RadioRow({ option, identity, colors, tabIndex, hostRef, onPress }) {
|
|
|
5777
5872
|
accessibilityState: identity.accessibilityState,
|
|
5778
5873
|
"aria-checked": checked,
|
|
5779
5874
|
disabled,
|
|
5780
|
-
style: [
|
|
5875
|
+
style: [styles37.row, { borderColor: accent, backgroundColor: checked ? colors.tint : colors.muted }],
|
|
5781
5876
|
tabIndex,
|
|
5782
5877
|
testID: identity.testID,
|
|
5783
5878
|
onPress,
|
|
5784
5879
|
children: [
|
|
5785
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
5786
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
5787
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
5788
|
-
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [
|
|
5880
|
+
/* @__PURE__ */ jsx(View, { style: [styles37.dot, { borderColor: accent }], children: checked ? /* @__PURE__ */ jsx(View, { style: [styles37.dotInner, { backgroundColor: colors.primary }] }) : null }),
|
|
5881
|
+
/* @__PURE__ */ jsxs(View, { style: styles37.text, children: [
|
|
5882
|
+
/* @__PURE__ */ jsx(Text, { style: [styles37.label, { color: checked ? colors.primary : colors.textStrong }], children: option.label }),
|
|
5883
|
+
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [styles37.description, { color: colors.textMuted }], testID: `${identity.testID}-description`, children: option.description }) : null
|
|
5789
5884
|
] })
|
|
5790
5885
|
]
|
|
5791
5886
|
}
|
|
@@ -5802,20 +5897,20 @@ var radioRowIdentity = (option, selected, disabled, prefix) => {
|
|
|
5802
5897
|
};
|
|
5803
5898
|
};
|
|
5804
5899
|
var ROW_GAP7 = 8;
|
|
5805
|
-
var
|
|
5900
|
+
var styles38 = StyleSheet.create({
|
|
5806
5901
|
list: { rowGap: ROW_GAP7 }
|
|
5807
5902
|
});
|
|
5808
5903
|
function RadioList(props) {
|
|
5809
5904
|
const { options, value, onChange, optionTestIDPrefix, label, error, required = false, disabled = false, testID } = props;
|
|
5810
5905
|
const { theme } = useUi();
|
|
5811
|
-
const colors =
|
|
5906
|
+
const colors = React39.useMemo(() => buildChipColors(theme.colors, theme.palette), [theme.colors, theme.palette]);
|
|
5812
5907
|
const selectedIndex = options.findIndex((option) => option.value === value);
|
|
5813
5908
|
const radio = useRadioKeyboard({ enabled: true, disabled, values: options.map((option) => option.value), selectedIndex, onChange });
|
|
5814
5909
|
return /* @__PURE__ */ jsx(Field, { error, label, required, testID, children: ({ describedById, hasError }) => /* @__PURE__ */ jsx(
|
|
5815
5910
|
View,
|
|
5816
5911
|
{
|
|
5817
5912
|
accessibilityRole: "radiogroup",
|
|
5818
|
-
style:
|
|
5913
|
+
style: styles38.list,
|
|
5819
5914
|
...webFieldA11y({ describedById, hasError }),
|
|
5820
5915
|
...radio.groupProps,
|
|
5821
5916
|
children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
@@ -5869,11 +5964,11 @@ function DecisionNote({ state, labels, testID, disabled }) {
|
|
|
5869
5964
|
);
|
|
5870
5965
|
}
|
|
5871
5966
|
var BUTTON_BASIS = "40%";
|
|
5872
|
-
var
|
|
5967
|
+
var styles39 = StyleSheet.create({
|
|
5873
5968
|
cell: { flexBasis: BUTTON_BASIS, flexGrow: 1 }
|
|
5874
5969
|
});
|
|
5875
5970
|
function OutcomeButtons({ outcomes, pending, disabled, testID, onPress }) {
|
|
5876
|
-
return /* @__PURE__ */ jsx(Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsx(View, { style:
|
|
5971
|
+
return /* @__PURE__ */ jsx(Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsx(View, { style: styles39.cell, children: /* @__PURE__ */ jsx(
|
|
5877
5972
|
Button,
|
|
5878
5973
|
{
|
|
5879
5974
|
fullWidth: true,
|
|
@@ -5954,21 +6049,21 @@ function StickyBarDecision(props) {
|
|
|
5954
6049
|
}
|
|
5955
6050
|
var TEXT_SIZE3 = 13;
|
|
5956
6051
|
var TEXT_LINE3 = 18;
|
|
5957
|
-
var
|
|
6052
|
+
var styles40 = StyleSheet.create({
|
|
5958
6053
|
text: { fontSize: TEXT_SIZE3, fontWeight: "700", lineHeight: TEXT_LINE3 }
|
|
5959
6054
|
});
|
|
5960
6055
|
var SubmitError = ({ message, testID }) => {
|
|
5961
6056
|
const { theme } = useUi();
|
|
5962
|
-
return /* @__PURE__ */ jsx(Text, { role: "alert", style: [
|
|
6057
|
+
return /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles40.text, { color: fieldErrorInk(theme) }], testID, children: message });
|
|
5963
6058
|
};
|
|
5964
6059
|
var toggle = (list, id) => list.includes(id) ? list.filter((item) => item !== id) : [...list, id];
|
|
5965
6060
|
function useDecisionPanel(outcomes, onSubmit) {
|
|
5966
|
-
const [outcome, setOutcome] =
|
|
5967
|
-
const [note, setNote] =
|
|
5968
|
-
const [reasons, setReasons] =
|
|
5969
|
-
const [checked, setChecked] =
|
|
5970
|
-
const [error, setError] =
|
|
5971
|
-
const [pending, setPending] =
|
|
6061
|
+
const [outcome, setOutcome] = React39.useState("");
|
|
6062
|
+
const [note, setNote] = React39.useState("");
|
|
6063
|
+
const [reasons, setReasons] = React39.useState([]);
|
|
6064
|
+
const [checked, setChecked] = React39.useState([]);
|
|
6065
|
+
const [error, setError] = React39.useState(null);
|
|
6066
|
+
const [pending, setPending] = React39.useState(null);
|
|
5972
6067
|
const submit = async (override) => {
|
|
5973
6068
|
const target = override ?? outcome;
|
|
5974
6069
|
const problem = validateDecision(outcomes, target, note);
|
|
@@ -6002,7 +6097,7 @@ function useDecisionPanel(outcomes, onSubmit) {
|
|
|
6002
6097
|
}
|
|
6003
6098
|
var TITLE_SIZE2 = 15;
|
|
6004
6099
|
var PANEL_GAP = 12;
|
|
6005
|
-
var
|
|
6100
|
+
var styles41 = StyleSheet.create({
|
|
6006
6101
|
panel: { rowGap: PANEL_GAP },
|
|
6007
6102
|
title: { fontSize: TITLE_SIZE2, fontWeight: "700" }
|
|
6008
6103
|
});
|
|
@@ -6016,8 +6111,8 @@ function DecisionPanel(props) {
|
|
|
6016
6111
|
const { theme } = useUi();
|
|
6017
6112
|
const state = useDecisionPanel(outcomes, onSubmit);
|
|
6018
6113
|
const body = (locked) => renderVariant(variant, { state, outcomes, labels, testID, disabled: disabled || locked, reasons, leadOutcome });
|
|
6019
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
6020
|
-
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [
|
|
6114
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles41.panel, style], testID, children: [
|
|
6115
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles41.title, { color: theme.colors.text }], children: labels.title }),
|
|
6021
6116
|
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),
|
|
6022
6117
|
state.error === "submit" ? /* @__PURE__ */ jsx(SubmitError, { message: labels.submitError, testID: `${testID}-error` }) : null
|
|
6023
6118
|
] });
|
|
@@ -6050,7 +6145,7 @@ var POP_FROM = 0.6;
|
|
|
6050
6145
|
var POP_PEAK = 1.12;
|
|
6051
6146
|
var POP_UP_MS = 160;
|
|
6052
6147
|
var POP_SETTLE_MS = 100;
|
|
6053
|
-
var
|
|
6148
|
+
var styles42 = StyleSheet.create({
|
|
6054
6149
|
mark: { width: MARK_SIZE, height: MARK_SIZE, borderRadius: MARK_SIZE / 2, alignItems: "center", justifyContent: "center" },
|
|
6055
6150
|
ring: { borderWidth: RING_WIDTH }
|
|
6056
6151
|
});
|
|
@@ -6070,8 +6165,8 @@ function RuleMark({ tone, colors }) {
|
|
|
6070
6165
|
]).start();
|
|
6071
6166
|
}, [met, reduced, scale]);
|
|
6072
6167
|
const color = colors.mark[tone];
|
|
6073
|
-
const shape = met ? { backgroundColor: color } : [
|
|
6074
|
-
return /* @__PURE__ */ jsx(Animated.View, { style: { transform: [{ scale }] }, children: /* @__PURE__ */ jsx(View, { style: [
|
|
6168
|
+
const shape = met ? { backgroundColor: color } : [styles42.ring, { borderColor: color }];
|
|
6169
|
+
return /* @__PURE__ */ jsx(Animated.View, { style: { transform: [{ scale }] }, children: /* @__PURE__ */ jsx(View, { style: [styles42.mark, shape], children: met ? /* @__PURE__ */ jsx(SvgIcon, { color: colors.onMark, name: "check", size: CHECK_SIZE2 }) : null }) });
|
|
6075
6170
|
}
|
|
6076
6171
|
var GAP8 = 6;
|
|
6077
6172
|
var ROW_GAP8 = 8;
|
|
@@ -6083,7 +6178,7 @@ var CHIP_PAD_V2 = 4;
|
|
|
6083
6178
|
var CHIP_PAD_H2 = 10;
|
|
6084
6179
|
var CHIP_BORDER2 = 1;
|
|
6085
6180
|
var HALF4 = "50%";
|
|
6086
|
-
var
|
|
6181
|
+
var styles43 = StyleSheet.create({
|
|
6087
6182
|
column: { gap: GAP8 },
|
|
6088
6183
|
row: { flexDirection: "row", alignItems: "center", gap: ROW_GAP8 },
|
|
6089
6184
|
text: { fontSize: FONT5, lineHeight: LINE, flexShrink: 1 },
|
|
@@ -6099,31 +6194,31 @@ function RuleList({ rules, flagUnmet, colors, testID, listStyle, itemStyle, outl
|
|
|
6099
6194
|
return /* @__PURE__ */ jsx(View, { role: "list", style: listStyle, testID, children: rules.map((rule) => {
|
|
6100
6195
|
const tone = ruleTone(rule.met, flagUnmet);
|
|
6101
6196
|
const outline = outlined ? { borderColor: colors.mark[tone] } : null;
|
|
6102
|
-
return /* @__PURE__ */ jsxs(View, { role: "listitem", style: [
|
|
6197
|
+
return /* @__PURE__ */ jsxs(View, { role: "listitem", style: [styles43.row, itemStyle, outline], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
|
|
6103
6198
|
/* @__PURE__ */ jsx(RuleMark, { colors, tone }),
|
|
6104
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
6199
|
+
/* @__PURE__ */ jsx(Text, { style: [styles43.text, { color: colors.text[tone] }], children: rule.label })
|
|
6105
6200
|
] }, rule.id);
|
|
6106
6201
|
}) });
|
|
6107
6202
|
}
|
|
6108
6203
|
function RulesChecklist(props) {
|
|
6109
|
-
return /* @__PURE__ */ jsx(RuleList, { ...props, listStyle:
|
|
6204
|
+
return /* @__PURE__ */ jsx(RuleList, { ...props, listStyle: styles43.column });
|
|
6110
6205
|
}
|
|
6111
6206
|
function RulesChips(props) {
|
|
6112
|
-
return /* @__PURE__ */ jsx(RuleList, { ...props, outlined: true, itemStyle:
|
|
6207
|
+
return /* @__PURE__ */ jsx(RuleList, { ...props, outlined: true, itemStyle: styles43.chip, listStyle: styles43.chips });
|
|
6113
6208
|
}
|
|
6114
6209
|
function RulesMeterGrid(props) {
|
|
6115
6210
|
const { rules, flagUnmet, colors, testID } = props;
|
|
6116
6211
|
const metCount = rules.filter((rule) => rule.met).length;
|
|
6117
6212
|
const unfilled = flagUnmet ? colors.mark.refused : colors.track;
|
|
6118
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
6119
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
6120
|
-
/* @__PURE__ */ jsx(RuleList, { ...props, itemStyle:
|
|
6213
|
+
return /* @__PURE__ */ jsxs(View, { style: styles43.column, children: [
|
|
6214
|
+
/* @__PURE__ */ jsx(View, { style: styles43.meter, testID: `${testID}-meter`, children: rules.map((rule, index) => /* @__PURE__ */ jsx(View, { style: [styles43.segment, { backgroundColor: index < metCount ? colors.mark.met : unfilled }] }, rule.id)) }),
|
|
6215
|
+
/* @__PURE__ */ jsx(RuleList, { ...props, itemStyle: styles43.cell, listStyle: styles43.grid })
|
|
6121
6216
|
] });
|
|
6122
6217
|
}
|
|
6123
6218
|
function RulesSentence({ rules, flagUnmet, colors, testID }) {
|
|
6124
|
-
return /* @__PURE__ */ jsx(Text, { style: [
|
|
6219
|
+
return /* @__PURE__ */ jsx(Text, { style: [styles43.text, { color: colors.text.unmet }], testID, children: rules.map((rule, index) => {
|
|
6125
6220
|
const tone = ruleTone(rule.met, flagUnmet);
|
|
6126
|
-
return /* @__PURE__ */ jsxs(Text, { style: [{ color: colors.text[tone] }, rule.met ?
|
|
6221
|
+
return /* @__PURE__ */ jsxs(Text, { style: [{ color: colors.text[tone] }, rule.met ? styles43.metPhrase : null], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
|
|
6127
6222
|
index > 0 ? ", " : "",
|
|
6128
6223
|
rule.label
|
|
6129
6224
|
] }, rule.id);
|
|
@@ -6142,7 +6237,7 @@ function PasswordRules({ display, ...variant }) {
|
|
|
6142
6237
|
}
|
|
6143
6238
|
}
|
|
6144
6239
|
var ICON_SIZE = 20;
|
|
6145
|
-
var
|
|
6240
|
+
var styles44 = StyleSheet.create({
|
|
6146
6241
|
button: { width: MIN_TOUCH_TARGET_PX, height: MIN_TOUCH_TARGET_PX, alignItems: "center", justifyContent: "center" }
|
|
6147
6242
|
});
|
|
6148
6243
|
function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, color, testID }) {
|
|
@@ -6154,7 +6249,7 @@ function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, col
|
|
|
6154
6249
|
accessibilityLabel: label,
|
|
6155
6250
|
accessibilityRole: "button",
|
|
6156
6251
|
"aria-pressed": revealed,
|
|
6157
|
-
style:
|
|
6252
|
+
style: styles44.button,
|
|
6158
6253
|
testID,
|
|
6159
6254
|
onPress: onToggle,
|
|
6160
6255
|
onPressIn,
|
|
@@ -6208,7 +6303,7 @@ function useRuleColors(override) {
|
|
|
6208
6303
|
var RULES_GAP = 8;
|
|
6209
6304
|
var TOGGLE_INSET = 48;
|
|
6210
6305
|
var NO_RULES = [];
|
|
6211
|
-
var
|
|
6306
|
+
var styles45 = StyleSheet.create({
|
|
6212
6307
|
inputRow: { position: "relative", justifyContent: "center" },
|
|
6213
6308
|
input: { paddingRight: TOGGLE_INSET },
|
|
6214
6309
|
toggle: { position: "absolute", right: 0, top: 0, bottom: 0, justifyContent: "center" },
|
|
@@ -6241,7 +6336,7 @@ function useCaretKeepingToggle(inputRef, initialLength) {
|
|
|
6241
6336
|
}, [inputRef]);
|
|
6242
6337
|
return { revealed, onPressIn, onToggle, onSelectionChange };
|
|
6243
6338
|
}
|
|
6244
|
-
var PasswordField =
|
|
6339
|
+
var PasswordField = React39.forwardRef(function PasswordField2({ label, value, onChangeText, labels, testID, rules = NO_RULES, rulesDisplay = "meterGrid" /* MeterGrid */, flagUnmet = false, error, colors: colorOverride, inputProps }, ref) {
|
|
6245
6340
|
const inputRef = useRef(null);
|
|
6246
6341
|
useImperativeHandle(ref, () => inputRef.current);
|
|
6247
6342
|
const toggle2 = useCaretKeepingToggle(inputRef, value.length);
|
|
@@ -6250,7 +6345,7 @@ var PasswordField = React38.forwardRef(function PasswordField2({ label, value, o
|
|
|
6250
6345
|
const rulesId = `${testID}-rules`;
|
|
6251
6346
|
const hasRules = rules.length > 0;
|
|
6252
6347
|
return /* @__PURE__ */ jsx(Field, { error, label, testID: `${testID}-field`, children: (context) => /* @__PURE__ */ jsxs(View, { children: [
|
|
6253
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
6348
|
+
/* @__PURE__ */ jsxs(View, { style: styles45.inputRow, children: [
|
|
6254
6349
|
/* @__PURE__ */ jsx(
|
|
6255
6350
|
ThemedTextInput,
|
|
6256
6351
|
{
|
|
@@ -6262,18 +6357,18 @@ var PasswordField = React38.forwardRef(function PasswordField2({ label, value, o
|
|
|
6262
6357
|
hasError: context.hasError || flagUnmet && rules.some((rule) => !rule.met),
|
|
6263
6358
|
id: context.controlId,
|
|
6264
6359
|
secureTextEntry: !toggle2.revealed,
|
|
6265
|
-
style: [
|
|
6360
|
+
style: [styles45.input, inputProps?.style],
|
|
6266
6361
|
testID,
|
|
6267
6362
|
value,
|
|
6268
6363
|
onChangeText,
|
|
6269
6364
|
onSelectionChange: toggle2.onSelectionChange
|
|
6270
6365
|
}
|
|
6271
6366
|
),
|
|
6272
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
6367
|
+
/* @__PURE__ */ jsx(View, { style: styles45.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 }) })
|
|
6273
6368
|
] }),
|
|
6274
|
-
hasRules ? /* @__PURE__ */ jsxs(View, { nativeID: rulesId, style:
|
|
6369
|
+
hasRules ? /* @__PURE__ */ jsxs(View, { nativeID: rulesId, style: styles45.rules, children: [
|
|
6275
6370
|
/* @__PURE__ */ jsx(PasswordRules, { colors, display: rulesDisplay, flagUnmet, rules, testID: rulesId }),
|
|
6276
|
-
/* @__PURE__ */ jsx(Text, { "aria-live": "polite", accessibilityLiveRegion: "polite", style:
|
|
6371
|
+
/* @__PURE__ */ jsx(Text, { "aria-live": "polite", accessibilityLiveRegion: "polite", style: styles45.live, testID: `${testID}-announce`, children: announcement })
|
|
6277
6372
|
] }) : null
|
|
6278
6373
|
] }) });
|
|
6279
6374
|
});
|