@dloizides/ui-forms 1.42.3 → 1.43.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.d.mts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.js +178 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +178 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1895,6 +1895,61 @@ var FormCheckbox = ({
|
|
|
1895
1895
|
}
|
|
1896
1896
|
);
|
|
1897
1897
|
};
|
|
1898
|
+
var NATIVE_SELECT_BOX = {
|
|
1899
|
+
borderStyle: "solid",
|
|
1900
|
+
boxSizing: "border-box",
|
|
1901
|
+
fontFamily: "inherit",
|
|
1902
|
+
width: "100%"
|
|
1903
|
+
};
|
|
1904
|
+
function nativeSelectStyle(borderColor, backgroundColor, color) {
|
|
1905
|
+
const trigger = reactNative.StyleSheet.flatten(controlStyles.selectTrigger);
|
|
1906
|
+
const text = reactNative.StyleSheet.flatten(controlStyles.selectTriggerText);
|
|
1907
|
+
return {
|
|
1908
|
+
...NATIVE_SELECT_BOX,
|
|
1909
|
+
minHeight: trigger.minHeight,
|
|
1910
|
+
borderWidth: trigger.borderWidth,
|
|
1911
|
+
borderRadius: trigger.borderRadius,
|
|
1912
|
+
fontSize: text.fontSize,
|
|
1913
|
+
paddingBlock: trigger.paddingVertical,
|
|
1914
|
+
paddingInline: trigger.paddingHorizontal,
|
|
1915
|
+
borderColor,
|
|
1916
|
+
backgroundColor,
|
|
1917
|
+
color
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
1920
|
+
function NativeSelect({
|
|
1921
|
+
options,
|
|
1922
|
+
value,
|
|
1923
|
+
onChange,
|
|
1924
|
+
placeholder = "",
|
|
1925
|
+
accessibilityLabel,
|
|
1926
|
+
accessibilityHint,
|
|
1927
|
+
labelledById,
|
|
1928
|
+
style,
|
|
1929
|
+
testID
|
|
1930
|
+
}) {
|
|
1931
|
+
const { theme } = uiFeedback.useUi();
|
|
1932
|
+
const { colors } = theme;
|
|
1933
|
+
const hasMatch = options.some((o) => o.value === value);
|
|
1934
|
+
const textColor = hasMatch ? colors.text : colors.textSecondary;
|
|
1935
|
+
const handleChange = (event) => onChange(event.target.value);
|
|
1936
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [controlStyles.anchor, style], children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1937
|
+
"select",
|
|
1938
|
+
{
|
|
1939
|
+
"aria-label": accessibilityLabel,
|
|
1940
|
+
"aria-labelledby": labelledById,
|
|
1941
|
+
"data-testid": `${testID}-trigger`,
|
|
1942
|
+
style: nativeSelectStyle(colors.border, colors.surfaceElevated, textColor),
|
|
1943
|
+
title: accessibilityHint,
|
|
1944
|
+
value,
|
|
1945
|
+
onChange: handleChange,
|
|
1946
|
+
children: [
|
|
1947
|
+
hasMatch ? null : /* @__PURE__ */ jsxRuntime.jsx("option", { disabled: true, value, children: placeholder }),
|
|
1948
|
+
options.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value))
|
|
1949
|
+
]
|
|
1950
|
+
}
|
|
1951
|
+
) });
|
|
1952
|
+
}
|
|
1898
1953
|
|
|
1899
1954
|
// src/controls/nextHighlight.ts
|
|
1900
1955
|
var NO_HIGHLIGHT = -1;
|
|
@@ -1927,6 +1982,7 @@ function useSelectListbox({ options, isOpen, open, toggle: toggle2, select }) {
|
|
|
1927
1982
|
};
|
|
1928
1983
|
return { highlighted, onKeyDown };
|
|
1929
1984
|
}
|
|
1985
|
+
var IS_WEB7 = reactNative.Platform.OS === "web";
|
|
1930
1986
|
var CHEVRON_DOWN = "\u25BE";
|
|
1931
1987
|
var CHEVRON_UP = "\u25B4";
|
|
1932
1988
|
function listboxTriggerAria(testID, hasList, highlighted) {
|
|
@@ -1936,7 +1992,10 @@ function listboxTriggerAria(testID, hasList, highlighted) {
|
|
|
1936
1992
|
"aria-activedescendant": highlighted !== void 0 ? optionDomId(testID, highlighted.value) : void 0
|
|
1937
1993
|
};
|
|
1938
1994
|
}
|
|
1939
|
-
function SelectControl({
|
|
1995
|
+
function SelectControl(props) {
|
|
1996
|
+
return props.native === true && IS_WEB7 ? /* @__PURE__ */ jsxRuntime.jsx(NativeSelect, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(MenuSelectControl, { ...props });
|
|
1997
|
+
}
|
|
1998
|
+
function MenuSelectControl({
|
|
1940
1999
|
options,
|
|
1941
2000
|
value,
|
|
1942
2001
|
onChange,
|
|
@@ -3147,11 +3206,11 @@ function DatePickerInput({ fieldProps, context, onTypedError }) {
|
|
|
3147
3206
|
open ? /* @__PURE__ */ jsxRuntime.jsx(PickerSurface, { anchorRef, label: labels.dialog, minWidth: SINGLE_PICKER_WIDTH, phone, testID: `${testID}-picker`, onDismiss: close, children: /* @__PURE__ */ jsxRuntime.jsx(SingleCalendar, { bounds, testID: `${testID}-picker`, value, onCommit: commit }) }) : null
|
|
3148
3207
|
] });
|
|
3149
3208
|
}
|
|
3150
|
-
var
|
|
3209
|
+
var IS_WEB8 = reactNative.Platform.OS === "web";
|
|
3151
3210
|
var DATE_TYPE = "date";
|
|
3152
3211
|
function TemporalInput({ fieldProps, context, webInputType, onTypedError }) {
|
|
3153
|
-
if (
|
|
3154
|
-
if (
|
|
3212
|
+
if (IS_WEB8 && webInputType === DATE_TYPE) return /* @__PURE__ */ jsxRuntime.jsx(DatePickerInput, { context, fieldProps, onTypedError });
|
|
3213
|
+
if (IS_WEB8) return /* @__PURE__ */ jsxRuntime.jsx(WebDateInput, { context, fieldProps, webInputType });
|
|
3155
3214
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3156
3215
|
ThemedTextInput,
|
|
3157
3216
|
{
|
|
@@ -3441,7 +3500,7 @@ function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, tes
|
|
|
3441
3500
|
) }) : null
|
|
3442
3501
|
] });
|
|
3443
3502
|
}
|
|
3444
|
-
var
|
|
3503
|
+
var IS_WEB9 = reactNative.Platform.OS === "web";
|
|
3445
3504
|
function DateRangeControl({
|
|
3446
3505
|
value,
|
|
3447
3506
|
onChange,
|
|
@@ -3455,7 +3514,7 @@ function DateRangeControl({
|
|
|
3455
3514
|
const hint = accessibilityHint ?? `${fromLabel} \u2013 ${toLabel}`;
|
|
3456
3515
|
const { labels } = useDatePickerConfig();
|
|
3457
3516
|
const [typedError, setTypedError] = React37.useState(void 0);
|
|
3458
|
-
if (!
|
|
3517
|
+
if (!IS_WEB9) {
|
|
3459
3518
|
return /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(NativeDateRange, { fromLabel, hint, style, testID, toLabel, value, onChange, onSubmit }) });
|
|
3460
3519
|
}
|
|
3461
3520
|
return /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style, testID: `${testID}-range`, children: /* @__PURE__ */ jsxRuntime.jsx(Field, { error: typedError, label: `${fromLabel}${labels.rangeSeparator}${toLabel}`, children: (context) => /* @__PURE__ */ jsxRuntime.jsx(WebDateRange, { context, fromLabel, hint, testID, toLabel, value, onChange, onSubmit, onTypedError: setTypedError }) }) }) });
|
|
@@ -3641,12 +3700,70 @@ function useKeepInView(trigger) {
|
|
|
3641
3700
|
}, [trigger]);
|
|
3642
3701
|
return ref;
|
|
3643
3702
|
}
|
|
3703
|
+
var IS_WEB10 = reactNative.Platform.OS === "web";
|
|
3704
|
+
var INPUT_FONT2 = 14;
|
|
3705
|
+
var styles20 = reactNative.StyleSheet.create({
|
|
3706
|
+
nativeButton: { minHeight: a11y.MIN_TOUCH_TARGET_PX, minWidth: a11y.MIN_TOUCH_TARGET_PX, justifyContent: "center" },
|
|
3707
|
+
nativeText: { fontSize: INPUT_FONT2 }
|
|
3708
|
+
});
|
|
3709
|
+
function FileInput({
|
|
3710
|
+
accessibilityLabel,
|
|
3711
|
+
accessibilityHint,
|
|
3712
|
+
onFiles,
|
|
3713
|
+
accept,
|
|
3714
|
+
multiple = false,
|
|
3715
|
+
disabled = false,
|
|
3716
|
+
id,
|
|
3717
|
+
describedById,
|
|
3718
|
+
nativeLabel,
|
|
3719
|
+
onNativePick,
|
|
3720
|
+
testID
|
|
3721
|
+
}) {
|
|
3722
|
+
const { theme } = uiFeedback.useUi();
|
|
3723
|
+
const { colors } = theme;
|
|
3724
|
+
if (!IS_WEB10) {
|
|
3725
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3726
|
+
reactNative.Pressable,
|
|
3727
|
+
{
|
|
3728
|
+
accessibilityHint,
|
|
3729
|
+
accessibilityLabel,
|
|
3730
|
+
accessibilityRole: "button",
|
|
3731
|
+
accessibilityState: { disabled },
|
|
3732
|
+
disabled,
|
|
3733
|
+
style: styles20.nativeButton,
|
|
3734
|
+
testID,
|
|
3735
|
+
onPress: onNativePick,
|
|
3736
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles20.nativeText, { color: colors.text }], children: nativeLabel ?? accessibilityLabel })
|
|
3737
|
+
}
|
|
3738
|
+
);
|
|
3739
|
+
}
|
|
3740
|
+
const handleChange = (event) => {
|
|
3741
|
+
const files = Array.from(event.target.files ?? []);
|
|
3742
|
+
if (files.length > 0) onFiles(files);
|
|
3743
|
+
};
|
|
3744
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3745
|
+
"input",
|
|
3746
|
+
{
|
|
3747
|
+
accept,
|
|
3748
|
+
"aria-describedby": describedById,
|
|
3749
|
+
"aria-label": accessibilityLabel,
|
|
3750
|
+
"data-testid": testID,
|
|
3751
|
+
disabled,
|
|
3752
|
+
id,
|
|
3753
|
+
multiple,
|
|
3754
|
+
style: { minHeight: a11y.MIN_TOUCH_TARGET_PX, color: colors.text, fontSize: INPUT_FONT2, fontFamily: "inherit" },
|
|
3755
|
+
title: accessibilityHint,
|
|
3756
|
+
type: "file",
|
|
3757
|
+
onChange: handleChange
|
|
3758
|
+
}
|
|
3759
|
+
);
|
|
3760
|
+
}
|
|
3644
3761
|
var DEFAULT_PREVIEW_PX = 48;
|
|
3645
3762
|
var PREVIEW_RADIUS = 8;
|
|
3646
3763
|
var GAP6 = 8;
|
|
3647
3764
|
var TITLE_FONT_SIZE = 14;
|
|
3648
3765
|
var HELP_FONT_SIZE = 13;
|
|
3649
|
-
var
|
|
3766
|
+
var styles21 = reactNative.StyleSheet.create({
|
|
3650
3767
|
help: { flex: 1, fontSize: HELP_FONT_SIZE },
|
|
3651
3768
|
root: { gap: GAP6 },
|
|
3652
3769
|
tile: { alignItems: "center", flexDirection: "row", gap: GAP6 },
|
|
@@ -3668,11 +3785,11 @@ var UploadWithLinkField = ({
|
|
|
3668
3785
|
const url = value ?? "";
|
|
3669
3786
|
const [pasting, setPasting] = React37.useState(url !== "");
|
|
3670
3787
|
const previewBox = { borderRadius: PREVIEW_RADIUS, height: previewSize, width: previewSize };
|
|
3671
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
3672
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3673
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
3788
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles21.root, children: [
|
|
3789
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles21.title, { color: theme.colors.text }], children: labels.title }),
|
|
3790
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles21.tile, children: [
|
|
3674
3791
|
url === "" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [previewBox, { backgroundColor: theme.colors.border }] }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { accessible: false, source: { uri: url }, style: previewBox, testID: `${testID}-preview` }),
|
|
3675
|
-
labels.help === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3792
|
+
labels.help === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles21.help, { color: theme.colors.text }], children: labels.help })
|
|
3676
3793
|
] }),
|
|
3677
3794
|
uploadControl,
|
|
3678
3795
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3683,12 +3800,12 @@ var UploadWithLinkField = ({
|
|
|
3683
3800
|
accessibilityRole: "button",
|
|
3684
3801
|
accessibilityState: { expanded: pasting },
|
|
3685
3802
|
"aria-expanded": pasting,
|
|
3686
|
-
style: [
|
|
3803
|
+
style: [styles21.toggle, ring.ringStyle],
|
|
3687
3804
|
testID: `${testID}-paste`,
|
|
3688
3805
|
onBlur: ring.onBlur,
|
|
3689
3806
|
onFocus: ring.onFocus,
|
|
3690
3807
|
onPress: () => setPasting(!pasting),
|
|
3691
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3808
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles21.toggleText, { color: theme.colors.text }], children: labels.pasteToggle })
|
|
3692
3809
|
}
|
|
3693
3810
|
),
|
|
3694
3811
|
pasting ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3707,7 +3824,7 @@ var UploadWithLinkField = ({
|
|
|
3707
3824
|
};
|
|
3708
3825
|
var ACTION_GAP = 8;
|
|
3709
3826
|
var GROUP_GAP = 16;
|
|
3710
|
-
var
|
|
3827
|
+
var styles22 = reactNative.StyleSheet.create({
|
|
3711
3828
|
action: { alignItems: "flex-start", marginTop: ACTION_GAP },
|
|
3712
3829
|
group: { marginBottom: GROUP_GAP }
|
|
3713
3830
|
});
|
|
@@ -3730,7 +3847,7 @@ var AddOnRequest = ({
|
|
|
3730
3847
|
onRemove();
|
|
3731
3848
|
};
|
|
3732
3849
|
if (!isAddOnOpen(hasValue, requested))
|
|
3733
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
3850
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles22.action, style], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3734
3851
|
uiButtons.Button,
|
|
3735
3852
|
{
|
|
3736
3853
|
accessibilityHint: addHint,
|
|
@@ -3742,9 +3859,9 @@ var AddOnRequest = ({
|
|
|
3742
3859
|
onPress: () => setRequested(true)
|
|
3743
3860
|
}
|
|
3744
3861
|
) });
|
|
3745
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
3862
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles22.group, style], testID, children: [
|
|
3746
3863
|
children,
|
|
3747
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
3864
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles22.action, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3748
3865
|
uiButtons.Button,
|
|
3749
3866
|
{
|
|
3750
3867
|
accessibilityHint: removeHint,
|
|
@@ -3761,7 +3878,7 @@ var AddOnRequest = ({
|
|
|
3761
3878
|
var ROW_GAP3 = 8;
|
|
3762
3879
|
var TEXT_SIZE = 13;
|
|
3763
3880
|
var TEXT_LINE = 18;
|
|
3764
|
-
var
|
|
3881
|
+
var styles23 = reactNative.StyleSheet.create({
|
|
3765
3882
|
row: { alignItems: "center", columnGap: ROW_GAP3, flexDirection: "row", justifyContent: "space-between" },
|
|
3766
3883
|
text: { flexShrink: 1, fontSize: TEXT_SIZE, fontWeight: "700", lineHeight: TEXT_LINE }
|
|
3767
3884
|
});
|
|
@@ -3769,8 +3886,8 @@ var isFixBarVisible = (count) => count > 0;
|
|
|
3769
3886
|
var FixBar = ({ count, message, showLabel, showHint, onShow, testID, style }) => {
|
|
3770
3887
|
const { theme } = uiFeedback.useUi();
|
|
3771
3888
|
if (!isFixBarVisible(count)) return null;
|
|
3772
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
3773
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [
|
|
3889
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles23.row, style], testID, children: [
|
|
3890
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [styles23.text, { color: fieldErrorInk(theme) }], testID: `${testID}-count`, children: message }),
|
|
3774
3891
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3775
3892
|
uiButtons.Button,
|
|
3776
3893
|
{
|
|
@@ -3808,21 +3925,21 @@ function OptionRow2({ option, active, current, renderLeading, renderDetail, onPi
|
|
|
3808
3925
|
accessibilityLabel: option.label,
|
|
3809
3926
|
accessibilityRole: "button",
|
|
3810
3927
|
accessibilityState: { selected: active, checked: current },
|
|
3811
|
-
style: [
|
|
3928
|
+
style: [styles24.row, active ? { backgroundColor: colors.surface } : null],
|
|
3812
3929
|
testID: `${testID}-option-${option.value}`,
|
|
3813
3930
|
onPress: () => onPick(option),
|
|
3814
3931
|
children: [
|
|
3815
3932
|
renderLeading?.(option),
|
|
3816
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
3817
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3818
|
-
detailBelow ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3933
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles24.label, children: [
|
|
3934
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles24.primary, { color: colors.text }], children: option.label }),
|
|
3935
|
+
detailBelow ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles24.secondary, { color: colors.textSecondary }], children: option.detail }) : null
|
|
3819
3936
|
] }),
|
|
3820
3937
|
renderDetail?.(option)
|
|
3821
3938
|
]
|
|
3822
3939
|
}
|
|
3823
3940
|
);
|
|
3824
3941
|
}
|
|
3825
|
-
var
|
|
3942
|
+
var styles24 = reactNative.StyleSheet.create({
|
|
3826
3943
|
row: { minHeight: a11y.MIN_TOUCH_TARGET_PX, flexDirection: "row", alignItems: "center", gap: ROW_GAP4, paddingHorizontal: ROW_PAD_H },
|
|
3827
3944
|
label: { flex: 1 },
|
|
3828
3945
|
primary: { fontSize: OPTION_FONT2, flexShrink: 1 },
|
|
@@ -3836,11 +3953,11 @@ function OptionSection({ title, options, offset, highlight, selectedValue, ...ro
|
|
|
3836
3953
|
const { colors } = theme;
|
|
3837
3954
|
if (options.length === 0) return null;
|
|
3838
3955
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
|
|
3839
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [
|
|
3956
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles25.header, { color: colors.textSecondary }], children: title }),
|
|
3840
3957
|
options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(OptionRow2, { ...row, active: offset + index === highlight, current: option.value === selectedValue, option }, option.value))
|
|
3841
3958
|
] });
|
|
3842
3959
|
}
|
|
3843
|
-
var
|
|
3960
|
+
var styles25 = reactNative.StyleSheet.create({
|
|
3844
3961
|
header: { fontSize: HEADER_FONT, paddingHorizontal: ROW_PAD_H2, paddingTop: ROW_GAP5, textTransform: "uppercase" }
|
|
3845
3962
|
});
|
|
3846
3963
|
var KEY_ESCAPE = "Escape";
|
|
@@ -3870,7 +3987,7 @@ function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, re
|
|
|
3870
3987
|
const translateY = progress.interpolate({ inputRange: [0, 1], outputRange: [motion.fromY, 0] });
|
|
3871
3988
|
const isSheet = motion.surface === "sheet" /* Sheet */;
|
|
3872
3989
|
const shared = { selectedValue, renderLeading, renderDetail, onPick: pick, optionHint: labels.optionHint, testID, highlight };
|
|
3873
|
-
const list = /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
3990
|
+
const list = /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles26.panel, { backgroundColor: colors.surfaceElevated, borderColor: colors.border }], testID: `${testID}-panel`, children: [
|
|
3874
3991
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3875
3992
|
reactNative.TextInput,
|
|
3876
3993
|
{
|
|
@@ -3887,16 +4004,16 @@ function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, re
|
|
|
3887
4004
|
onSubmitEditing: submit
|
|
3888
4005
|
}
|
|
3889
4006
|
),
|
|
3890
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ?
|
|
4007
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ? styles26.sheetList : styles26.dropList, children: [
|
|
3891
4008
|
/* @__PURE__ */ jsxRuntime.jsx(OptionSection, { ...shared, offset: 0, options: sections.recent, title: labels.recent }),
|
|
3892
4009
|
/* @__PURE__ */ jsxRuntime.jsx(OptionSection, { ...shared, offset: sections.recent.length, options: sections.all, title: labels.all }),
|
|
3893
|
-
sections.flat.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4010
|
+
sections.flat.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles26.empty, { color: colors.textSecondary }], children: labels.empty }) : null
|
|
3894
4011
|
] })
|
|
3895
4012
|
] });
|
|
3896
4013
|
if (!isSheet) return /* @__PURE__ */ jsxRuntime.jsx(DropdownSurface, { anchorRef, closeHint: labels.closeHint, closeLabel: labels.close, progress, testID, translateY, onDismiss: dismiss, children: list });
|
|
3897
4014
|
return /* @__PURE__ */ jsxRuntime.jsx(SheetSurface, { closeHint: labels.closeHint, closeLabel: labels.close, testID, translateY, onDismiss: dismiss, children: list });
|
|
3898
4015
|
}
|
|
3899
|
-
var
|
|
4016
|
+
var styles26 = reactNative.StyleSheet.create({
|
|
3900
4017
|
panel: { borderWidth: 1, borderRadius: PANEL_RADIUS, padding: PANEL_PAD, gap: PANEL_PAD },
|
|
3901
4018
|
dropList: { maxHeight: MENU_MAX_HEIGHT },
|
|
3902
4019
|
sheetList: { maxHeight: SHEET_MAX_HEIGHT2 },
|
|
@@ -4006,7 +4123,7 @@ function SearchSelect(props) {
|
|
|
4006
4123
|
const onTriggerBlur = React37.useCallback(() => {
|
|
4007
4124
|
if (!openRef.current) onBlur?.();
|
|
4008
4125
|
}, [onBlur]);
|
|
4009
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: anchorRef, style:
|
|
4126
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: anchorRef, style: styles27.anchor, children: [
|
|
4010
4127
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4011
4128
|
reactNative.Pressable,
|
|
4012
4129
|
{
|
|
@@ -4015,7 +4132,7 @@ function SearchSelect(props) {
|
|
|
4015
4132
|
accessibilityLabel,
|
|
4016
4133
|
accessibilityRole: "button",
|
|
4017
4134
|
accessibilityState: { expanded: state.open },
|
|
4018
|
-
style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] :
|
|
4135
|
+
style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] : styles27.customTrigger,
|
|
4019
4136
|
testID,
|
|
4020
4137
|
onBlur: onTriggerBlur,
|
|
4021
4138
|
onPress,
|
|
@@ -4027,7 +4144,7 @@ function SearchSelect(props) {
|
|
|
4027
4144
|
}
|
|
4028
4145
|
function FieldBoxContent({ selected, placeholder, colors, renderLeading, renderDetail }) {
|
|
4029
4146
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4030
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
4147
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles27.value, children: [
|
|
4031
4148
|
selected !== null && renderLeading !== void 0 ? renderLeading(selected) : null,
|
|
4032
4149
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [controlStyles.selectTriggerText, { color: selected === null ? colors.textSecondary : colors.text }], children: selected?.label ?? placeholder }),
|
|
4033
4150
|
selected !== null ? /* @__PURE__ */ jsxRuntime.jsx(SelectedDetail, { colors, option: selected, renderDetail }) : null
|
|
@@ -4040,7 +4157,7 @@ function SelectedDetail({ option, colors, renderDetail }) {
|
|
|
4040
4157
|
if (option.detail === void 0) return null;
|
|
4041
4158
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [controlStyles.selectTriggerText, { color: colors.textSecondary }], children: option.detail });
|
|
4042
4159
|
}
|
|
4043
|
-
var
|
|
4160
|
+
var styles27 = reactNative.StyleSheet.create({
|
|
4044
4161
|
anchor: { position: "relative" },
|
|
4045
4162
|
customTrigger: { minHeight: MIN_TOUCH, minWidth: MIN_TOUCH, alignSelf: "flex-start", justifyContent: "center" },
|
|
4046
4163
|
value: { flex: 1, flexDirection: "row", alignItems: "center", gap: VALUE_GAP }
|
|
@@ -4817,7 +4934,7 @@ function CountryField({ value, onChange, accessibilityLabel, accessibilityHint,
|
|
|
4817
4934
|
const { theme } = uiFeedback.useUi();
|
|
4818
4935
|
const { textSecondary } = theme.colors;
|
|
4819
4936
|
const options = React37.useMemo(() => countryFieldOptions(countries, noneLabel), [countries, noneLabel]);
|
|
4820
|
-
const renderCode = React37.useCallback((option) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
4937
|
+
const renderCode = React37.useCallback((option) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles28.code, { color: textSecondary }], children: option.detail }), [textSecondary]);
|
|
4821
4938
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4822
4939
|
SearchSelect,
|
|
4823
4940
|
{
|
|
@@ -4835,7 +4952,7 @@ function CountryField({ value, onChange, accessibilityLabel, accessibilityHint,
|
|
|
4835
4952
|
}
|
|
4836
4953
|
);
|
|
4837
4954
|
}
|
|
4838
|
-
var
|
|
4955
|
+
var styles28 = reactNative.StyleSheet.create({
|
|
4839
4956
|
code: { fontSize: CODE_FONT }
|
|
4840
4957
|
});
|
|
4841
4958
|
function useBlurVerdict(validate) {
|
|
@@ -5091,9 +5208,9 @@ var LINE_GAP = 4;
|
|
|
5091
5208
|
function RejectionLine({ message, testID }) {
|
|
5092
5209
|
const { theme } = uiFeedback.useUi();
|
|
5093
5210
|
if (message === null) return null;
|
|
5094
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityLiveRegion: "polite", style: [
|
|
5211
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityLiveRegion: "polite", style: [styles29.line, { color: fieldErrorInk(theme) }], testID: `${testID}-rejection`, children: message });
|
|
5095
5212
|
}
|
|
5096
|
-
var
|
|
5213
|
+
var styles29 = reactNative.StyleSheet.create({
|
|
5097
5214
|
line: { marginTop: LINE_GAP }
|
|
5098
5215
|
});
|
|
5099
5216
|
|
|
@@ -5240,7 +5357,7 @@ var PAD_V = 10;
|
|
|
5240
5357
|
var PAD_H = 16;
|
|
5241
5358
|
var TEXT_SIZE2 = 13;
|
|
5242
5359
|
var TEXT_LINE2 = 18;
|
|
5243
|
-
var
|
|
5360
|
+
var styles30 = reactNative.StyleSheet.create({
|
|
5244
5361
|
bar: { borderTopWidth: 1, paddingHorizontal: PAD_H, paddingVertical: PAD_V, rowGap: BAR_GAP },
|
|
5245
5362
|
actions: { flexDirection: "row", flexWrap: "wrap", gap: BAR_GAP },
|
|
5246
5363
|
message: { fontSize: TEXT_SIZE2, fontWeight: "700", lineHeight: TEXT_LINE2 }
|
|
@@ -5252,9 +5369,9 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
|
|
|
5252
5369
|
const { colors } = theme;
|
|
5253
5370
|
const pinned = actionBarPosition(sticky, reactNative.Platform.OS) === "sticky" ? PINNED : null;
|
|
5254
5371
|
const hasMessage = message !== void 0 && message !== "";
|
|
5255
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
5256
|
-
hasMessage ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "status", style: [
|
|
5257
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5372
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles30.bar, { backgroundColor: colors.surface, borderTopColor: colors.border }, pinned, style], testID, children: [
|
|
5373
|
+
hasMessage ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "status", style: [styles30.message, { color: colors.text }], testID: `${testID}-message`, children: message }) : null,
|
|
5374
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles30.actions, children })
|
|
5258
5375
|
] });
|
|
5259
5376
|
};
|
|
5260
5377
|
|
|
@@ -5262,14 +5379,14 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
|
|
|
5262
5379
|
var isChecklistComplete = (items, checked) => items.every((item) => checked.includes(item.id));
|
|
5263
5380
|
var TITLE_SIZE = 13;
|
|
5264
5381
|
var TITLE_GAP = 6;
|
|
5265
|
-
var
|
|
5382
|
+
var styles31 = reactNative.StyleSheet.create({
|
|
5266
5383
|
title: { fontSize: TITLE_SIZE, fontWeight: "700", marginBottom: TITLE_GAP }
|
|
5267
5384
|
});
|
|
5268
5385
|
var GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = false, children }) => {
|
|
5269
5386
|
const { theme } = uiFeedback.useUi();
|
|
5270
5387
|
const complete = isChecklistComplete(items, checked);
|
|
5271
5388
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { testID, children: [
|
|
5272
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [
|
|
5389
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles31.title, { color: theme.colors.text }], children: title }),
|
|
5273
5390
|
items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5274
5391
|
FormCheckbox,
|
|
5275
5392
|
{
|
|
@@ -5295,7 +5412,7 @@ var RADIUS2 = 8;
|
|
|
5295
5412
|
var LABEL_SIZE = 14;
|
|
5296
5413
|
var DESCRIPTION_SIZE = 12;
|
|
5297
5414
|
var DESCRIPTION_LINE = 16;
|
|
5298
|
-
var
|
|
5415
|
+
var styles32 = reactNative.StyleSheet.create({
|
|
5299
5416
|
row: {
|
|
5300
5417
|
alignItems: "center",
|
|
5301
5418
|
borderRadius: RADIUS2,
|
|
@@ -5326,15 +5443,15 @@ function RadioRow({ option, identity, colors, tabIndex, hostRef, onPress }) {
|
|
|
5326
5443
|
accessibilityState: identity.accessibilityState,
|
|
5327
5444
|
"aria-checked": checked,
|
|
5328
5445
|
disabled,
|
|
5329
|
-
style: [
|
|
5446
|
+
style: [styles32.row, { borderColor: accent, backgroundColor: checked ? colors.tint : colors.muted }],
|
|
5330
5447
|
tabIndex,
|
|
5331
5448
|
testID: identity.testID,
|
|
5332
5449
|
onPress,
|
|
5333
5450
|
children: [
|
|
5334
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
5335
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
5336
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
5337
|
-
hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
5451
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles32.dot, { borderColor: accent }], children: checked ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles32.dotInner, { backgroundColor: colors.primary }] }) : null }),
|
|
5452
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles32.text, children: [
|
|
5453
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles32.label, { color: checked ? colors.primary : colors.textStrong }], children: option.label }),
|
|
5454
|
+
hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles32.description, { color: colors.textMuted }], testID: `${identity.testID}-description`, children: option.description }) : null
|
|
5338
5455
|
] })
|
|
5339
5456
|
]
|
|
5340
5457
|
}
|
|
@@ -5351,7 +5468,7 @@ var radioRowIdentity = (option, selected, disabled, prefix) => {
|
|
|
5351
5468
|
};
|
|
5352
5469
|
};
|
|
5353
5470
|
var ROW_GAP7 = 8;
|
|
5354
|
-
var
|
|
5471
|
+
var styles33 = reactNative.StyleSheet.create({
|
|
5355
5472
|
list: { rowGap: ROW_GAP7 }
|
|
5356
5473
|
});
|
|
5357
5474
|
function RadioList(props) {
|
|
@@ -5364,7 +5481,7 @@ function RadioList(props) {
|
|
|
5364
5481
|
reactNative.View,
|
|
5365
5482
|
{
|
|
5366
5483
|
accessibilityRole: "radiogroup",
|
|
5367
|
-
style:
|
|
5484
|
+
style: styles33.list,
|
|
5368
5485
|
...webFieldA11y({ describedById, hasError }),
|
|
5369
5486
|
...radio.groupProps,
|
|
5370
5487
|
children: options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5418,11 +5535,11 @@ function DecisionNote({ state, labels, testID, disabled }) {
|
|
|
5418
5535
|
);
|
|
5419
5536
|
}
|
|
5420
5537
|
var BUTTON_BASIS = "40%";
|
|
5421
|
-
var
|
|
5538
|
+
var styles34 = reactNative.StyleSheet.create({
|
|
5422
5539
|
cell: { flexBasis: BUTTON_BASIS, flexGrow: 1 }
|
|
5423
5540
|
});
|
|
5424
5541
|
function OutcomeButtons({ outcomes, pending, disabled, testID, onPress }) {
|
|
5425
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
5542
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles34.cell, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5426
5543
|
uiButtons.Button,
|
|
5427
5544
|
{
|
|
5428
5545
|
fullWidth: true,
|
|
@@ -5503,12 +5620,12 @@ function StickyBarDecision(props) {
|
|
|
5503
5620
|
}
|
|
5504
5621
|
var TEXT_SIZE3 = 13;
|
|
5505
5622
|
var TEXT_LINE3 = 18;
|
|
5506
|
-
var
|
|
5623
|
+
var styles35 = reactNative.StyleSheet.create({
|
|
5507
5624
|
text: { fontSize: TEXT_SIZE3, fontWeight: "700", lineHeight: TEXT_LINE3 }
|
|
5508
5625
|
});
|
|
5509
5626
|
var SubmitError = ({ message, testID }) => {
|
|
5510
5627
|
const { theme } = uiFeedback.useUi();
|
|
5511
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [
|
|
5628
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [styles35.text, { color: fieldErrorInk(theme) }], testID, children: message });
|
|
5512
5629
|
};
|
|
5513
5630
|
var toggle = (list, id) => list.includes(id) ? list.filter((item) => item !== id) : [...list, id];
|
|
5514
5631
|
function useDecisionPanel(outcomes, onSubmit) {
|
|
@@ -5551,7 +5668,7 @@ function useDecisionPanel(outcomes, onSubmit) {
|
|
|
5551
5668
|
}
|
|
5552
5669
|
var TITLE_SIZE2 = 15;
|
|
5553
5670
|
var PANEL_GAP = 12;
|
|
5554
|
-
var
|
|
5671
|
+
var styles36 = reactNative.StyleSheet.create({
|
|
5555
5672
|
panel: { rowGap: PANEL_GAP },
|
|
5556
5673
|
title: { fontSize: TITLE_SIZE2, fontWeight: "700" }
|
|
5557
5674
|
});
|
|
@@ -5565,8 +5682,8 @@ function DecisionPanel(props) {
|
|
|
5565
5682
|
const { theme } = uiFeedback.useUi();
|
|
5566
5683
|
const state = useDecisionPanel(outcomes, onSubmit);
|
|
5567
5684
|
const body = (locked) => renderVariant(variant, { state, outcomes, labels, testID, disabled: disabled || locked, reasons, leadOutcome });
|
|
5568
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
5569
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [
|
|
5685
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles36.panel, style], testID, children: [
|
|
5686
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles36.title, { color: theme.colors.text }], children: labels.title }),
|
|
5570
5687
|
checklist !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(GatedChecklist, { checked: state.checked, items: checklist.items, testID: `${testID}-checklist`, title: checklist.title, onToggle: state.toggleCheck, children: (complete) => body(!complete) }) : body(false),
|
|
5571
5688
|
state.error === "submit" ? /* @__PURE__ */ jsxRuntime.jsx(SubmitError, { message: labels.submitError, testID: `${testID}-error` }) : null
|
|
5572
5689
|
] });
|
|
@@ -5598,6 +5715,7 @@ exports.DropdownPlacement = DropdownPlacement;
|
|
|
5598
5715
|
exports.FLAG_HEIGHT = FLAG_HEIGHT;
|
|
5599
5716
|
exports.FLAG_WIDTH = FLAG_WIDTH;
|
|
5600
5717
|
exports.Field = Field;
|
|
5718
|
+
exports.FileInput = FileInput;
|
|
5601
5719
|
exports.FixBar = FixBar;
|
|
5602
5720
|
exports.FlagShapeKind = FlagShapeKind;
|
|
5603
5721
|
exports.FormActions = FormActions;
|