@dloizides/ui-forms 1.42.2 → 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 +248 -107
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +248 -108
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1888,6 +1888,61 @@ var FormCheckbox = ({
|
|
|
1888
1888
|
}
|
|
1889
1889
|
);
|
|
1890
1890
|
};
|
|
1891
|
+
var NATIVE_SELECT_BOX = {
|
|
1892
|
+
borderStyle: "solid",
|
|
1893
|
+
boxSizing: "border-box",
|
|
1894
|
+
fontFamily: "inherit",
|
|
1895
|
+
width: "100%"
|
|
1896
|
+
};
|
|
1897
|
+
function nativeSelectStyle(borderColor, backgroundColor, color) {
|
|
1898
|
+
const trigger = StyleSheet.flatten(controlStyles.selectTrigger);
|
|
1899
|
+
const text = StyleSheet.flatten(controlStyles.selectTriggerText);
|
|
1900
|
+
return {
|
|
1901
|
+
...NATIVE_SELECT_BOX,
|
|
1902
|
+
minHeight: trigger.minHeight,
|
|
1903
|
+
borderWidth: trigger.borderWidth,
|
|
1904
|
+
borderRadius: trigger.borderRadius,
|
|
1905
|
+
fontSize: text.fontSize,
|
|
1906
|
+
paddingBlock: trigger.paddingVertical,
|
|
1907
|
+
paddingInline: trigger.paddingHorizontal,
|
|
1908
|
+
borderColor,
|
|
1909
|
+
backgroundColor,
|
|
1910
|
+
color
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
function NativeSelect({
|
|
1914
|
+
options,
|
|
1915
|
+
value,
|
|
1916
|
+
onChange,
|
|
1917
|
+
placeholder = "",
|
|
1918
|
+
accessibilityLabel,
|
|
1919
|
+
accessibilityHint,
|
|
1920
|
+
labelledById,
|
|
1921
|
+
style,
|
|
1922
|
+
testID
|
|
1923
|
+
}) {
|
|
1924
|
+
const { theme } = useUi();
|
|
1925
|
+
const { colors } = theme;
|
|
1926
|
+
const hasMatch = options.some((o) => o.value === value);
|
|
1927
|
+
const textColor = hasMatch ? colors.text : colors.textSecondary;
|
|
1928
|
+
const handleChange = (event) => onChange(event.target.value);
|
|
1929
|
+
return /* @__PURE__ */ jsx(View, { style: [controlStyles.anchor, style], children: /* @__PURE__ */ jsxs(
|
|
1930
|
+
"select",
|
|
1931
|
+
{
|
|
1932
|
+
"aria-label": accessibilityLabel,
|
|
1933
|
+
"aria-labelledby": labelledById,
|
|
1934
|
+
"data-testid": `${testID}-trigger`,
|
|
1935
|
+
style: nativeSelectStyle(colors.border, colors.surfaceElevated, textColor),
|
|
1936
|
+
title: accessibilityHint,
|
|
1937
|
+
value,
|
|
1938
|
+
onChange: handleChange,
|
|
1939
|
+
children: [
|
|
1940
|
+
hasMatch ? null : /* @__PURE__ */ jsx("option", { disabled: true, value, children: placeholder }),
|
|
1941
|
+
options.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, children: o.label }, o.value))
|
|
1942
|
+
]
|
|
1943
|
+
}
|
|
1944
|
+
) });
|
|
1945
|
+
}
|
|
1891
1946
|
|
|
1892
1947
|
// src/controls/nextHighlight.ts
|
|
1893
1948
|
var NO_HIGHLIGHT = -1;
|
|
@@ -1920,6 +1975,7 @@ function useSelectListbox({ options, isOpen, open, toggle: toggle2, select }) {
|
|
|
1920
1975
|
};
|
|
1921
1976
|
return { highlighted, onKeyDown };
|
|
1922
1977
|
}
|
|
1978
|
+
var IS_WEB7 = Platform.OS === "web";
|
|
1923
1979
|
var CHEVRON_DOWN = "\u25BE";
|
|
1924
1980
|
var CHEVRON_UP = "\u25B4";
|
|
1925
1981
|
function listboxTriggerAria(testID, hasList, highlighted) {
|
|
@@ -1929,7 +1985,10 @@ function listboxTriggerAria(testID, hasList, highlighted) {
|
|
|
1929
1985
|
"aria-activedescendant": highlighted !== void 0 ? optionDomId(testID, highlighted.value) : void 0
|
|
1930
1986
|
};
|
|
1931
1987
|
}
|
|
1932
|
-
function SelectControl({
|
|
1988
|
+
function SelectControl(props) {
|
|
1989
|
+
return props.native === true && IS_WEB7 ? /* @__PURE__ */ jsx(NativeSelect, { ...props }) : /* @__PURE__ */ jsx(MenuSelectControl, { ...props });
|
|
1990
|
+
}
|
|
1991
|
+
function MenuSelectControl({
|
|
1933
1992
|
options,
|
|
1934
1993
|
value,
|
|
1935
1994
|
onChange,
|
|
@@ -2833,17 +2892,17 @@ var BOLD2 = 700;
|
|
|
2833
2892
|
var ROW = { display: "flex" };
|
|
2834
2893
|
var EMPTY = { width: DAY_CELL_PX, height: DAY_CELL_PX, flexShrink: 0 };
|
|
2835
2894
|
var FALLBACK = { year: 1970, month: 1};
|
|
2836
|
-
function MonthGrid({ month, selection, focusedDay, bounds, testID, onPick, onKey, showCaption = false, motion }) {
|
|
2895
|
+
function MonthGrid({ month, selection: selection2, focusedDay, bounds, testID, onPick, onKey, showCaption = false, motion }) {
|
|
2837
2896
|
const { labels, locale, today, firstDay } = useDatePickerConfig();
|
|
2838
2897
|
const colors = usePickerColors();
|
|
2839
2898
|
const parts = parseIso(month) ?? FALLBACK;
|
|
2840
2899
|
const weeks = useMemo(() => buildMonthGrid(parts.year, parts.month, firstDay), [parts.year, parts.month, firstDay]);
|
|
2841
2900
|
const weekdays = useMemo(() => weekdayNames(locale, firstDay), [locale, firstDay]);
|
|
2842
2901
|
const title = formatMonthYear(month, locale);
|
|
2843
|
-
const end =
|
|
2902
|
+
const end = selection2.to === "" ? selection2.from : selection2.to;
|
|
2844
2903
|
const stateOf = (iso) => ({
|
|
2845
|
-
inRange:
|
|
2846
|
-
isEnd: iso ===
|
|
2904
|
+
inRange: selection2.from !== "" && iso >= selection2.from && iso <= end,
|
|
2905
|
+
isEnd: iso === selection2.from || iso === selection2.to,
|
|
2847
2906
|
isToday: iso === today,
|
|
2848
2907
|
enabled: isWithinBounds(iso, bounds.min, bounds.max),
|
|
2849
2908
|
focusable: iso === focusedDay
|
|
@@ -3029,16 +3088,32 @@ function closedFieldMinWidth(text, iconRoom) {
|
|
|
3029
3088
|
|
|
3030
3089
|
// src/DatePicker/utils/typedEdit.ts
|
|
3031
3090
|
var DELETE_KEYS = /* @__PURE__ */ new Set(["Backspace", "Delete"]);
|
|
3032
|
-
function coversAll(input) {
|
|
3033
|
-
const { selectionStart, selectionEnd, value } = input;
|
|
3034
|
-
return value !== "" && selectionStart === 0 && selectionEnd === value.length;
|
|
3035
|
-
}
|
|
3036
3091
|
function isPrintable(event) {
|
|
3037
3092
|
return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
|
|
3038
3093
|
}
|
|
3094
|
+
function selection(input) {
|
|
3095
|
+
const end = input.selectionEnd ?? input.value.length;
|
|
3096
|
+
return [input.selectionStart ?? end, end];
|
|
3097
|
+
}
|
|
3098
|
+
function editedText(input, insert) {
|
|
3099
|
+
const [start, end] = selection(input);
|
|
3100
|
+
return { text: input.value.slice(0, start) + insert + input.value.slice(end), caret: start + insert.length };
|
|
3101
|
+
}
|
|
3102
|
+
function placeCaret(input, caret) {
|
|
3103
|
+
requestAnimationFrame(() => input.setSelectionRange(caret, caret));
|
|
3104
|
+
}
|
|
3039
3105
|
function typedEditBind(typed) {
|
|
3040
|
-
const start = (event,
|
|
3041
|
-
|
|
3106
|
+
const start = (event, insert) => {
|
|
3107
|
+
const input = event.currentTarget;
|
|
3108
|
+
const [from, to] = selection(input);
|
|
3109
|
+
if (from === to) {
|
|
3110
|
+
typed.onEdit();
|
|
3111
|
+
return;
|
|
3112
|
+
}
|
|
3113
|
+
const edit = editedText(input, insert);
|
|
3114
|
+
if (!typed.onEdit(edit.text)) return;
|
|
3115
|
+
event.preventDefault();
|
|
3116
|
+
placeCaret(input, edit.caret);
|
|
3042
3117
|
};
|
|
3043
3118
|
return {
|
|
3044
3119
|
onEditKey: (event) => {
|
|
@@ -3047,7 +3122,11 @@ function typedEditBind(typed) {
|
|
|
3047
3122
|
},
|
|
3048
3123
|
onPaste: (event) => start(event, event.clipboardData.getData("text")),
|
|
3049
3124
|
onCut: (event) => {
|
|
3050
|
-
|
|
3125
|
+
const input = event.currentTarget;
|
|
3126
|
+
const [from, to] = selection(input);
|
|
3127
|
+
if (from === to) return;
|
|
3128
|
+
event.clipboardData.setData("text/plain", input.value.slice(from, to));
|
|
3129
|
+
start(event, "");
|
|
3051
3130
|
}
|
|
3052
3131
|
};
|
|
3053
3132
|
}
|
|
@@ -3120,11 +3199,11 @@ function DatePickerInput({ fieldProps, context, onTypedError }) {
|
|
|
3120
3199
|
open ? /* @__PURE__ */ jsx(PickerSurface, { anchorRef, label: labels.dialog, minWidth: SINGLE_PICKER_WIDTH, phone, testID: `${testID}-picker`, onDismiss: close, children: /* @__PURE__ */ jsx(SingleCalendar, { bounds, testID: `${testID}-picker`, value, onCommit: commit }) }) : null
|
|
3121
3200
|
] });
|
|
3122
3201
|
}
|
|
3123
|
-
var
|
|
3202
|
+
var IS_WEB8 = Platform.OS === "web";
|
|
3124
3203
|
var DATE_TYPE = "date";
|
|
3125
3204
|
function TemporalInput({ fieldProps, context, webInputType, onTypedError }) {
|
|
3126
|
-
if (
|
|
3127
|
-
if (
|
|
3205
|
+
if (IS_WEB8 && webInputType === DATE_TYPE) return /* @__PURE__ */ jsx(DatePickerInput, { context, fieldProps, onTypedError });
|
|
3206
|
+
if (IS_WEB8) return /* @__PURE__ */ jsx(WebDateInput, { context, fieldProps, webInputType });
|
|
3128
3207
|
return /* @__PURE__ */ jsx(
|
|
3129
3208
|
ThemedTextInput,
|
|
3130
3209
|
{
|
|
@@ -3356,36 +3435,39 @@ function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, tes
|
|
|
3356
3435
|
const ready = [from.isReady(), to.isReady()].every(Boolean);
|
|
3357
3436
|
if (ready) onSubmit();
|
|
3358
3437
|
};
|
|
3359
|
-
const segment = (side, typed) =>
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
onKeyDown(event)
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3438
|
+
const segment = (side, typed) => {
|
|
3439
|
+
const edit = typedEditBind(typed);
|
|
3440
|
+
return /* @__PURE__ */ jsx(
|
|
3441
|
+
"input",
|
|
3442
|
+
{
|
|
3443
|
+
...webA11y,
|
|
3444
|
+
ref: side === "from" /* From */ ? fromRef : void 0,
|
|
3445
|
+
"aria-label": side === "from" /* From */ ? fromLabel : toLabel,
|
|
3446
|
+
autoComplete: "off",
|
|
3447
|
+
"data-testid": `${testID}-${side}`,
|
|
3448
|
+
id: side === "from" /* From */ ? context.controlId : void 0,
|
|
3449
|
+
style: SEGMENT,
|
|
3450
|
+
title: hint,
|
|
3451
|
+
type: "text",
|
|
3452
|
+
value: typed.display,
|
|
3453
|
+
onBlur: (event) => {
|
|
3454
|
+
focus.onBlur?.(event);
|
|
3455
|
+
typed.onBlur();
|
|
3456
|
+
},
|
|
3457
|
+
onChange: (event) => typed.onText(event.target.value),
|
|
3458
|
+
onFocus: (event) => {
|
|
3459
|
+
focus.onFocus?.(event);
|
|
3460
|
+
typed.onFocus();
|
|
3461
|
+
},
|
|
3462
|
+
onCut: edit.onCut,
|
|
3463
|
+
onKeyDown: (event) => {
|
|
3464
|
+
edit.onEditKey(event);
|
|
3465
|
+
onKeyDown(event);
|
|
3466
|
+
},
|
|
3467
|
+
onPaste: edit.onPaste
|
|
3468
|
+
}
|
|
3469
|
+
);
|
|
3470
|
+
};
|
|
3389
3471
|
return /* @__PURE__ */ jsxs(View, { ref: anchorRef, style: anchorStyles.wrap, children: [
|
|
3390
3472
|
/* @__PURE__ */ jsxs("div", { ...hoverBind, style: { ...buildNativeInputStyle(style), display: "flex", alignItems: "center", gap: GAP5, paddingInlineEnd: ICON_ROOM }, children: [
|
|
3391
3473
|
segment("from" /* From */, from),
|
|
@@ -3411,7 +3493,7 @@ function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, tes
|
|
|
3411
3493
|
) }) : null
|
|
3412
3494
|
] });
|
|
3413
3495
|
}
|
|
3414
|
-
var
|
|
3496
|
+
var IS_WEB9 = Platform.OS === "web";
|
|
3415
3497
|
function DateRangeControl({
|
|
3416
3498
|
value,
|
|
3417
3499
|
onChange,
|
|
@@ -3425,7 +3507,7 @@ function DateRangeControl({
|
|
|
3425
3507
|
const hint = accessibilityHint ?? `${fromLabel} \u2013 ${toLabel}`;
|
|
3426
3508
|
const { labels } = useDatePickerConfig();
|
|
3427
3509
|
const [typedError, setTypedError] = useState(void 0);
|
|
3428
|
-
if (!
|
|
3510
|
+
if (!IS_WEB9) {
|
|
3429
3511
|
return /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsx(NativeDateRange, { fromLabel, hint, style, testID, toLabel, value, onChange, onSubmit }) });
|
|
3430
3512
|
}
|
|
3431
3513
|
return /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsx(View, { style, testID: `${testID}-range`, children: /* @__PURE__ */ jsx(Field, { error: typedError, label: `${fromLabel}${labels.rangeSeparator}${toLabel}`, children: (context) => /* @__PURE__ */ jsx(WebDateRange, { context, fromLabel, hint, testID, toLabel, value, onChange, onSubmit, onTypedError: setTypedError }) }) }) });
|
|
@@ -3611,12 +3693,70 @@ function useKeepInView(trigger) {
|
|
|
3611
3693
|
}, [trigger]);
|
|
3612
3694
|
return ref;
|
|
3613
3695
|
}
|
|
3696
|
+
var IS_WEB10 = Platform.OS === "web";
|
|
3697
|
+
var INPUT_FONT2 = 14;
|
|
3698
|
+
var styles20 = StyleSheet.create({
|
|
3699
|
+
nativeButton: { minHeight: MIN_TOUCH_TARGET_PX, minWidth: MIN_TOUCH_TARGET_PX, justifyContent: "center" },
|
|
3700
|
+
nativeText: { fontSize: INPUT_FONT2 }
|
|
3701
|
+
});
|
|
3702
|
+
function FileInput({
|
|
3703
|
+
accessibilityLabel,
|
|
3704
|
+
accessibilityHint,
|
|
3705
|
+
onFiles,
|
|
3706
|
+
accept,
|
|
3707
|
+
multiple = false,
|
|
3708
|
+
disabled = false,
|
|
3709
|
+
id,
|
|
3710
|
+
describedById,
|
|
3711
|
+
nativeLabel,
|
|
3712
|
+
onNativePick,
|
|
3713
|
+
testID
|
|
3714
|
+
}) {
|
|
3715
|
+
const { theme } = useUi();
|
|
3716
|
+
const { colors } = theme;
|
|
3717
|
+
if (!IS_WEB10) {
|
|
3718
|
+
return /* @__PURE__ */ jsx(
|
|
3719
|
+
Pressable,
|
|
3720
|
+
{
|
|
3721
|
+
accessibilityHint,
|
|
3722
|
+
accessibilityLabel,
|
|
3723
|
+
accessibilityRole: "button",
|
|
3724
|
+
accessibilityState: { disabled },
|
|
3725
|
+
disabled,
|
|
3726
|
+
style: styles20.nativeButton,
|
|
3727
|
+
testID,
|
|
3728
|
+
onPress: onNativePick,
|
|
3729
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles20.nativeText, { color: colors.text }], children: nativeLabel ?? accessibilityLabel })
|
|
3730
|
+
}
|
|
3731
|
+
);
|
|
3732
|
+
}
|
|
3733
|
+
const handleChange = (event) => {
|
|
3734
|
+
const files = Array.from(event.target.files ?? []);
|
|
3735
|
+
if (files.length > 0) onFiles(files);
|
|
3736
|
+
};
|
|
3737
|
+
return /* @__PURE__ */ jsx(
|
|
3738
|
+
"input",
|
|
3739
|
+
{
|
|
3740
|
+
accept,
|
|
3741
|
+
"aria-describedby": describedById,
|
|
3742
|
+
"aria-label": accessibilityLabel,
|
|
3743
|
+
"data-testid": testID,
|
|
3744
|
+
disabled,
|
|
3745
|
+
id,
|
|
3746
|
+
multiple,
|
|
3747
|
+
style: { minHeight: MIN_TOUCH_TARGET_PX, color: colors.text, fontSize: INPUT_FONT2, fontFamily: "inherit" },
|
|
3748
|
+
title: accessibilityHint,
|
|
3749
|
+
type: "file",
|
|
3750
|
+
onChange: handleChange
|
|
3751
|
+
}
|
|
3752
|
+
);
|
|
3753
|
+
}
|
|
3614
3754
|
var DEFAULT_PREVIEW_PX = 48;
|
|
3615
3755
|
var PREVIEW_RADIUS = 8;
|
|
3616
3756
|
var GAP6 = 8;
|
|
3617
3757
|
var TITLE_FONT_SIZE = 14;
|
|
3618
3758
|
var HELP_FONT_SIZE = 13;
|
|
3619
|
-
var
|
|
3759
|
+
var styles21 = StyleSheet.create({
|
|
3620
3760
|
help: { flex: 1, fontSize: HELP_FONT_SIZE },
|
|
3621
3761
|
root: { gap: GAP6 },
|
|
3622
3762
|
tile: { alignItems: "center", flexDirection: "row", gap: GAP6 },
|
|
@@ -3638,11 +3778,11 @@ var UploadWithLinkField = ({
|
|
|
3638
3778
|
const url = value ?? "";
|
|
3639
3779
|
const [pasting, setPasting] = useState(url !== "");
|
|
3640
3780
|
const previewBox = { borderRadius: PREVIEW_RADIUS, height: previewSize, width: previewSize };
|
|
3641
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
3642
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3643
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3781
|
+
return /* @__PURE__ */ jsxs(View, { style: styles21.root, children: [
|
|
3782
|
+
/* @__PURE__ */ jsx(Text, { style: [styles21.title, { color: theme.colors.text }], children: labels.title }),
|
|
3783
|
+
/* @__PURE__ */ jsxs(View, { style: styles21.tile, children: [
|
|
3644
3784
|
url === "" ? /* @__PURE__ */ jsx(View, { style: [previewBox, { backgroundColor: theme.colors.border }] }) : /* @__PURE__ */ jsx(Image, { accessible: false, source: { uri: url }, style: previewBox, testID: `${testID}-preview` }),
|
|
3645
|
-
labels.help === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [
|
|
3785
|
+
labels.help === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [styles21.help, { color: theme.colors.text }], children: labels.help })
|
|
3646
3786
|
] }),
|
|
3647
3787
|
uploadControl,
|
|
3648
3788
|
/* @__PURE__ */ jsx(
|
|
@@ -3653,12 +3793,12 @@ var UploadWithLinkField = ({
|
|
|
3653
3793
|
accessibilityRole: "button",
|
|
3654
3794
|
accessibilityState: { expanded: pasting },
|
|
3655
3795
|
"aria-expanded": pasting,
|
|
3656
|
-
style: [
|
|
3796
|
+
style: [styles21.toggle, ring.ringStyle],
|
|
3657
3797
|
testID: `${testID}-paste`,
|
|
3658
3798
|
onBlur: ring.onBlur,
|
|
3659
3799
|
onFocus: ring.onFocus,
|
|
3660
3800
|
onPress: () => setPasting(!pasting),
|
|
3661
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
3801
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles21.toggleText, { color: theme.colors.text }], children: labels.pasteToggle })
|
|
3662
3802
|
}
|
|
3663
3803
|
),
|
|
3664
3804
|
pasting ? /* @__PURE__ */ jsx(
|
|
@@ -3677,7 +3817,7 @@ var UploadWithLinkField = ({
|
|
|
3677
3817
|
};
|
|
3678
3818
|
var ACTION_GAP = 8;
|
|
3679
3819
|
var GROUP_GAP = 16;
|
|
3680
|
-
var
|
|
3820
|
+
var styles22 = StyleSheet.create({
|
|
3681
3821
|
action: { alignItems: "flex-start", marginTop: ACTION_GAP },
|
|
3682
3822
|
group: { marginBottom: GROUP_GAP }
|
|
3683
3823
|
});
|
|
@@ -3700,7 +3840,7 @@ var AddOnRequest = ({
|
|
|
3700
3840
|
onRemove();
|
|
3701
3841
|
};
|
|
3702
3842
|
if (!isAddOnOpen(hasValue, requested))
|
|
3703
|
-
return /* @__PURE__ */ jsx(View, { style: [
|
|
3843
|
+
return /* @__PURE__ */ jsx(View, { style: [styles22.action, style], children: /* @__PURE__ */ jsx(
|
|
3704
3844
|
Button,
|
|
3705
3845
|
{
|
|
3706
3846
|
accessibilityHint: addHint,
|
|
@@ -3712,9 +3852,9 @@ var AddOnRequest = ({
|
|
|
3712
3852
|
onPress: () => setRequested(true)
|
|
3713
3853
|
}
|
|
3714
3854
|
) });
|
|
3715
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
3855
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles22.group, style], testID, children: [
|
|
3716
3856
|
children,
|
|
3717
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
3857
|
+
/* @__PURE__ */ jsx(View, { style: styles22.action, children: /* @__PURE__ */ jsx(
|
|
3718
3858
|
Button,
|
|
3719
3859
|
{
|
|
3720
3860
|
accessibilityHint: removeHint,
|
|
@@ -3731,7 +3871,7 @@ var AddOnRequest = ({
|
|
|
3731
3871
|
var ROW_GAP3 = 8;
|
|
3732
3872
|
var TEXT_SIZE = 13;
|
|
3733
3873
|
var TEXT_LINE = 18;
|
|
3734
|
-
var
|
|
3874
|
+
var styles23 = StyleSheet.create({
|
|
3735
3875
|
row: { alignItems: "center", columnGap: ROW_GAP3, flexDirection: "row", justifyContent: "space-between" },
|
|
3736
3876
|
text: { flexShrink: 1, fontSize: TEXT_SIZE, fontWeight: "700", lineHeight: TEXT_LINE }
|
|
3737
3877
|
});
|
|
@@ -3739,8 +3879,8 @@ var isFixBarVisible = (count) => count > 0;
|
|
|
3739
3879
|
var FixBar = ({ count, message, showLabel, showHint, onShow, testID, style }) => {
|
|
3740
3880
|
const { theme } = useUi();
|
|
3741
3881
|
if (!isFixBarVisible(count)) return null;
|
|
3742
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
3743
|
-
/* @__PURE__ */ jsx(Text, { role: "alert", style: [
|
|
3882
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles23.row, style], testID, children: [
|
|
3883
|
+
/* @__PURE__ */ jsx(Text, { role: "alert", style: [styles23.text, { color: fieldErrorInk(theme) }], testID: `${testID}-count`, children: message }),
|
|
3744
3884
|
/* @__PURE__ */ jsx(
|
|
3745
3885
|
Button,
|
|
3746
3886
|
{
|
|
@@ -3778,21 +3918,21 @@ function OptionRow2({ option, active, current, renderLeading, renderDetail, onPi
|
|
|
3778
3918
|
accessibilityLabel: option.label,
|
|
3779
3919
|
accessibilityRole: "button",
|
|
3780
3920
|
accessibilityState: { selected: active, checked: current },
|
|
3781
|
-
style: [
|
|
3921
|
+
style: [styles24.row, active ? { backgroundColor: colors.surface } : null],
|
|
3782
3922
|
testID: `${testID}-option-${option.value}`,
|
|
3783
3923
|
onPress: () => onPick(option),
|
|
3784
3924
|
children: [
|
|
3785
3925
|
renderLeading?.(option),
|
|
3786
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
3787
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
3788
|
-
detailBelow ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3926
|
+
/* @__PURE__ */ jsxs(View, { style: styles24.label, children: [
|
|
3927
|
+
/* @__PURE__ */ jsx(Text, { style: [styles24.primary, { color: colors.text }], children: option.label }),
|
|
3928
|
+
detailBelow ? /* @__PURE__ */ jsx(Text, { style: [styles24.secondary, { color: colors.textSecondary }], children: option.detail }) : null
|
|
3789
3929
|
] }),
|
|
3790
3930
|
renderDetail?.(option)
|
|
3791
3931
|
]
|
|
3792
3932
|
}
|
|
3793
3933
|
);
|
|
3794
3934
|
}
|
|
3795
|
-
var
|
|
3935
|
+
var styles24 = StyleSheet.create({
|
|
3796
3936
|
row: { minHeight: MIN_TOUCH_TARGET_PX, flexDirection: "row", alignItems: "center", gap: ROW_GAP4, paddingHorizontal: ROW_PAD_H },
|
|
3797
3937
|
label: { flex: 1 },
|
|
3798
3938
|
primary: { fontSize: OPTION_FONT2, flexShrink: 1 },
|
|
@@ -3806,11 +3946,11 @@ function OptionSection({ title, options, offset, highlight, selectedValue, ...ro
|
|
|
3806
3946
|
const { colors } = theme;
|
|
3807
3947
|
if (options.length === 0) return null;
|
|
3808
3948
|
return /* @__PURE__ */ jsxs(View, { children: [
|
|
3809
|
-
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [
|
|
3949
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles25.header, { color: colors.textSecondary }], children: title }),
|
|
3810
3950
|
options.map((option, index) => /* @__PURE__ */ jsx(OptionRow2, { ...row, active: offset + index === highlight, current: option.value === selectedValue, option }, option.value))
|
|
3811
3951
|
] });
|
|
3812
3952
|
}
|
|
3813
|
-
var
|
|
3953
|
+
var styles25 = StyleSheet.create({
|
|
3814
3954
|
header: { fontSize: HEADER_FONT, paddingHorizontal: ROW_PAD_H2, paddingTop: ROW_GAP5, textTransform: "uppercase" }
|
|
3815
3955
|
});
|
|
3816
3956
|
var KEY_ESCAPE = "Escape";
|
|
@@ -3840,7 +3980,7 @@ function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, re
|
|
|
3840
3980
|
const translateY = progress.interpolate({ inputRange: [0, 1], outputRange: [motion.fromY, 0] });
|
|
3841
3981
|
const isSheet = motion.surface === "sheet" /* Sheet */;
|
|
3842
3982
|
const shared = { selectedValue, renderLeading, renderDetail, onPick: pick, optionHint: labels.optionHint, testID, highlight };
|
|
3843
|
-
const list = /* @__PURE__ */ jsxs(View, { style: [
|
|
3983
|
+
const list = /* @__PURE__ */ jsxs(View, { style: [styles26.panel, { backgroundColor: colors.surfaceElevated, borderColor: colors.border }], testID: `${testID}-panel`, children: [
|
|
3844
3984
|
/* @__PURE__ */ jsx(
|
|
3845
3985
|
TextInput,
|
|
3846
3986
|
{
|
|
@@ -3857,16 +3997,16 @@ function SearchSelectPanel({ motion, state, labels, anchorRef, renderLeading, re
|
|
|
3857
3997
|
onSubmitEditing: submit
|
|
3858
3998
|
}
|
|
3859
3999
|
),
|
|
3860
|
-
/* @__PURE__ */ jsxs(ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ?
|
|
4000
|
+
/* @__PURE__ */ jsxs(ScrollView, { keyboardShouldPersistTaps: "handled", style: isSheet ? styles26.sheetList : styles26.dropList, children: [
|
|
3861
4001
|
/* @__PURE__ */ jsx(OptionSection, { ...shared, offset: 0, options: sections.recent, title: labels.recent }),
|
|
3862
4002
|
/* @__PURE__ */ jsx(OptionSection, { ...shared, offset: sections.recent.length, options: sections.all, title: labels.all }),
|
|
3863
|
-
sections.flat.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
4003
|
+
sections.flat.length === 0 ? /* @__PURE__ */ jsx(Text, { style: [styles26.empty, { color: colors.textSecondary }], children: labels.empty }) : null
|
|
3864
4004
|
] })
|
|
3865
4005
|
] });
|
|
3866
4006
|
if (!isSheet) return /* @__PURE__ */ jsx(DropdownSurface, { anchorRef, closeHint: labels.closeHint, closeLabel: labels.close, progress, testID, translateY, onDismiss: dismiss, children: list });
|
|
3867
4007
|
return /* @__PURE__ */ jsx(SheetSurface, { closeHint: labels.closeHint, closeLabel: labels.close, testID, translateY, onDismiss: dismiss, children: list });
|
|
3868
4008
|
}
|
|
3869
|
-
var
|
|
4009
|
+
var styles26 = StyleSheet.create({
|
|
3870
4010
|
panel: { borderWidth: 1, borderRadius: PANEL_RADIUS, padding: PANEL_PAD, gap: PANEL_PAD },
|
|
3871
4011
|
dropList: { maxHeight: MENU_MAX_HEIGHT },
|
|
3872
4012
|
sheetList: { maxHeight: SHEET_MAX_HEIGHT2 },
|
|
@@ -3976,7 +4116,7 @@ function SearchSelect(props) {
|
|
|
3976
4116
|
const onTriggerBlur = useCallback(() => {
|
|
3977
4117
|
if (!openRef.current) onBlur?.();
|
|
3978
4118
|
}, [onBlur]);
|
|
3979
|
-
return /* @__PURE__ */ jsxs(View, { ref: anchorRef, style:
|
|
4119
|
+
return /* @__PURE__ */ jsxs(View, { ref: anchorRef, style: styles27.anchor, children: [
|
|
3980
4120
|
/* @__PURE__ */ jsx(
|
|
3981
4121
|
Pressable,
|
|
3982
4122
|
{
|
|
@@ -3985,7 +4125,7 @@ function SearchSelect(props) {
|
|
|
3985
4125
|
accessibilityLabel,
|
|
3986
4126
|
accessibilityRole: "button",
|
|
3987
4127
|
accessibilityState: { expanded: state.open },
|
|
3988
|
-
style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] :
|
|
4128
|
+
style: renderTrigger === void 0 ? [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }] : styles27.customTrigger,
|
|
3989
4129
|
testID,
|
|
3990
4130
|
onBlur: onTriggerBlur,
|
|
3991
4131
|
onPress,
|
|
@@ -3997,7 +4137,7 @@ function SearchSelect(props) {
|
|
|
3997
4137
|
}
|
|
3998
4138
|
function FieldBoxContent({ selected, placeholder, colors, renderLeading, renderDetail }) {
|
|
3999
4139
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4000
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
4140
|
+
/* @__PURE__ */ jsxs(View, { style: styles27.value, children: [
|
|
4001
4141
|
selected !== null && renderLeading !== void 0 ? renderLeading(selected) : null,
|
|
4002
4142
|
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [controlStyles.selectTriggerText, { color: selected === null ? colors.textSecondary : colors.text }], children: selected?.label ?? placeholder }),
|
|
4003
4143
|
selected !== null ? /* @__PURE__ */ jsx(SelectedDetail, { colors, option: selected, renderDetail }) : null
|
|
@@ -4010,7 +4150,7 @@ function SelectedDetail({ option, colors, renderDetail }) {
|
|
|
4010
4150
|
if (option.detail === void 0) return null;
|
|
4011
4151
|
return /* @__PURE__ */ jsx(Text, { style: [controlStyles.selectTriggerText, { color: colors.textSecondary }], children: option.detail });
|
|
4012
4152
|
}
|
|
4013
|
-
var
|
|
4153
|
+
var styles27 = StyleSheet.create({
|
|
4014
4154
|
anchor: { position: "relative" },
|
|
4015
4155
|
customTrigger: { minHeight: MIN_TOUCH, minWidth: MIN_TOUCH, alignSelf: "flex-start", justifyContent: "center" },
|
|
4016
4156
|
value: { flex: 1, flexDirection: "row", alignItems: "center", gap: VALUE_GAP }
|
|
@@ -4787,7 +4927,7 @@ function CountryField({ value, onChange, accessibilityLabel, accessibilityHint,
|
|
|
4787
4927
|
const { theme } = useUi();
|
|
4788
4928
|
const { textSecondary } = theme.colors;
|
|
4789
4929
|
const options = useMemo(() => countryFieldOptions(countries, noneLabel), [countries, noneLabel]);
|
|
4790
|
-
const renderCode = useCallback((option) => /* @__PURE__ */ jsx(Text, { style: [
|
|
4930
|
+
const renderCode = useCallback((option) => /* @__PURE__ */ jsx(Text, { style: [styles28.code, { color: textSecondary }], children: option.detail }), [textSecondary]);
|
|
4791
4931
|
return /* @__PURE__ */ jsx(
|
|
4792
4932
|
SearchSelect,
|
|
4793
4933
|
{
|
|
@@ -4805,7 +4945,7 @@ function CountryField({ value, onChange, accessibilityLabel, accessibilityHint,
|
|
|
4805
4945
|
}
|
|
4806
4946
|
);
|
|
4807
4947
|
}
|
|
4808
|
-
var
|
|
4948
|
+
var styles28 = StyleSheet.create({
|
|
4809
4949
|
code: { fontSize: CODE_FONT }
|
|
4810
4950
|
});
|
|
4811
4951
|
function useBlurVerdict(validate) {
|
|
@@ -4965,15 +5105,15 @@ function rawCaretAfterChange(previous, previousCaret, next) {
|
|
|
4965
5105
|
|
|
4966
5106
|
// src/IbanInput/hooks/useIbanCaret.ts
|
|
4967
5107
|
function useIbanCaret(display) {
|
|
4968
|
-
const [
|
|
5108
|
+
const [selection2, setSelection] = useState({ start: display.length, end: display.length });
|
|
4969
5109
|
const onSelectionChange = useCallback((event) => {
|
|
4970
5110
|
setSelection(event.nativeEvent.selection);
|
|
4971
5111
|
}, []);
|
|
4972
5112
|
const placeAfterEdit = useCallback((text) => {
|
|
4973
|
-
const caret = caretAfterEdit(text, rawCaretAfterChange(display,
|
|
5113
|
+
const caret = caretAfterEdit(text, rawCaretAfterChange(display, selection2.end, text));
|
|
4974
5114
|
setSelection({ start: caret, end: caret });
|
|
4975
|
-
}, [display,
|
|
4976
|
-
const clamped = { start: Math.min(
|
|
5115
|
+
}, [display, selection2.end]);
|
|
5116
|
+
const clamped = { start: Math.min(selection2.start, display.length), end: Math.min(selection2.end, display.length) };
|
|
4977
5117
|
return { selection: clamped, onSelectionChange, placeAfterEdit };
|
|
4978
5118
|
}
|
|
4979
5119
|
var FONT_SIZE = 14;
|
|
@@ -5061,9 +5201,9 @@ var LINE_GAP = 4;
|
|
|
5061
5201
|
function RejectionLine({ message, testID }) {
|
|
5062
5202
|
const { theme } = useUi();
|
|
5063
5203
|
if (message === null) return null;
|
|
5064
|
-
return /* @__PURE__ */ jsx(Text, { accessibilityLiveRegion: "polite", style: [
|
|
5204
|
+
return /* @__PURE__ */ jsx(Text, { accessibilityLiveRegion: "polite", style: [styles29.line, { color: fieldErrorInk(theme) }], testID: `${testID}-rejection`, children: message });
|
|
5065
5205
|
}
|
|
5066
|
-
var
|
|
5206
|
+
var styles29 = StyleSheet.create({
|
|
5067
5207
|
line: { marginTop: LINE_GAP }
|
|
5068
5208
|
});
|
|
5069
5209
|
|
|
@@ -5080,7 +5220,7 @@ function IbanInput({ value, onChange, onVerdict, accessibilityLabel, accessibili
|
|
|
5080
5220
|
const { verdict, onEdit, onLeave } = useBlurVerdict(validate);
|
|
5081
5221
|
const message = value === "" ? null : rejectionMessage(verdict?.rejection ?? null, "None" /* None */, rejectionLabels);
|
|
5082
5222
|
const counter = ibanCounter(draft);
|
|
5083
|
-
const { selection, onSelectionChange, placeAfterEdit } = useIbanCaret(draft.display);
|
|
5223
|
+
const { selection: selection2, onSelectionChange, placeAfterEdit } = useIbanCaret(draft.display);
|
|
5084
5224
|
const onChangeText = useCallback((text) => {
|
|
5085
5225
|
onEdit();
|
|
5086
5226
|
onVerdict?.(null);
|
|
@@ -5109,7 +5249,7 @@ function IbanInput({ value, onChange, onVerdict, accessibilityLabel, accessibili
|
|
|
5109
5249
|
autoCorrect: false,
|
|
5110
5250
|
placeholder: draft.display === "" ? placeholder : void 0,
|
|
5111
5251
|
placeholderTextColor: colors.textSecondary,
|
|
5112
|
-
selection,
|
|
5252
|
+
selection: selection2,
|
|
5113
5253
|
spellCheck: false,
|
|
5114
5254
|
style: [ghostStyles.mono, ghostStyles.input, { color: colors.text }],
|
|
5115
5255
|
testID,
|
|
@@ -5210,7 +5350,7 @@ var PAD_V = 10;
|
|
|
5210
5350
|
var PAD_H = 16;
|
|
5211
5351
|
var TEXT_SIZE2 = 13;
|
|
5212
5352
|
var TEXT_LINE2 = 18;
|
|
5213
|
-
var
|
|
5353
|
+
var styles30 = StyleSheet.create({
|
|
5214
5354
|
bar: { borderTopWidth: 1, paddingHorizontal: PAD_H, paddingVertical: PAD_V, rowGap: BAR_GAP },
|
|
5215
5355
|
actions: { flexDirection: "row", flexWrap: "wrap", gap: BAR_GAP },
|
|
5216
5356
|
message: { fontSize: TEXT_SIZE2, fontWeight: "700", lineHeight: TEXT_LINE2 }
|
|
@@ -5222,9 +5362,9 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
|
|
|
5222
5362
|
const { colors } = theme;
|
|
5223
5363
|
const pinned = actionBarPosition(sticky, Platform.OS) === "sticky" ? PINNED : null;
|
|
5224
5364
|
const hasMessage = message !== void 0 && message !== "";
|
|
5225
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
5226
|
-
hasMessage ? /* @__PURE__ */ jsx(Text, { role: "status", style: [
|
|
5227
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
5365
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles30.bar, { backgroundColor: colors.surface, borderTopColor: colors.border }, pinned, style], testID, children: [
|
|
5366
|
+
hasMessage ? /* @__PURE__ */ jsx(Text, { role: "status", style: [styles30.message, { color: colors.text }], testID: `${testID}-message`, children: message }) : null,
|
|
5367
|
+
/* @__PURE__ */ jsx(View, { style: styles30.actions, children })
|
|
5228
5368
|
] });
|
|
5229
5369
|
};
|
|
5230
5370
|
|
|
@@ -5232,14 +5372,14 @@ var ActionBar = ({ children, message, sticky = false, testID, style }) => {
|
|
|
5232
5372
|
var isChecklistComplete = (items, checked) => items.every((item) => checked.includes(item.id));
|
|
5233
5373
|
var TITLE_SIZE = 13;
|
|
5234
5374
|
var TITLE_GAP = 6;
|
|
5235
|
-
var
|
|
5375
|
+
var styles31 = StyleSheet.create({
|
|
5236
5376
|
title: { fontSize: TITLE_SIZE, fontWeight: "700", marginBottom: TITLE_GAP }
|
|
5237
5377
|
});
|
|
5238
5378
|
var GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = false, children }) => {
|
|
5239
5379
|
const { theme } = useUi();
|
|
5240
5380
|
const complete = isChecklistComplete(items, checked);
|
|
5241
5381
|
return /* @__PURE__ */ jsxs(View, { testID, children: [
|
|
5242
|
-
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [
|
|
5382
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles31.title, { color: theme.colors.text }], children: title }),
|
|
5243
5383
|
items.map((item) => /* @__PURE__ */ jsx(
|
|
5244
5384
|
FormCheckbox,
|
|
5245
5385
|
{
|
|
@@ -5265,7 +5405,7 @@ var RADIUS2 = 8;
|
|
|
5265
5405
|
var LABEL_SIZE = 14;
|
|
5266
5406
|
var DESCRIPTION_SIZE = 12;
|
|
5267
5407
|
var DESCRIPTION_LINE = 16;
|
|
5268
|
-
var
|
|
5408
|
+
var styles32 = StyleSheet.create({
|
|
5269
5409
|
row: {
|
|
5270
5410
|
alignItems: "center",
|
|
5271
5411
|
borderRadius: RADIUS2,
|
|
@@ -5296,15 +5436,15 @@ function RadioRow({ option, identity, colors, tabIndex, hostRef, onPress }) {
|
|
|
5296
5436
|
accessibilityState: identity.accessibilityState,
|
|
5297
5437
|
"aria-checked": checked,
|
|
5298
5438
|
disabled,
|
|
5299
|
-
style: [
|
|
5439
|
+
style: [styles32.row, { borderColor: accent, backgroundColor: checked ? colors.tint : colors.muted }],
|
|
5300
5440
|
tabIndex,
|
|
5301
5441
|
testID: identity.testID,
|
|
5302
5442
|
onPress,
|
|
5303
5443
|
children: [
|
|
5304
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
5305
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
5306
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
5307
|
-
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [
|
|
5444
|
+
/* @__PURE__ */ jsx(View, { style: [styles32.dot, { borderColor: accent }], children: checked ? /* @__PURE__ */ jsx(View, { style: [styles32.dotInner, { backgroundColor: colors.primary }] }) : null }),
|
|
5445
|
+
/* @__PURE__ */ jsxs(View, { style: styles32.text, children: [
|
|
5446
|
+
/* @__PURE__ */ jsx(Text, { style: [styles32.label, { color: checked ? colors.primary : colors.textStrong }], children: option.label }),
|
|
5447
|
+
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [styles32.description, { color: colors.textMuted }], testID: `${identity.testID}-description`, children: option.description }) : null
|
|
5308
5448
|
] })
|
|
5309
5449
|
]
|
|
5310
5450
|
}
|
|
@@ -5321,7 +5461,7 @@ var radioRowIdentity = (option, selected, disabled, prefix) => {
|
|
|
5321
5461
|
};
|
|
5322
5462
|
};
|
|
5323
5463
|
var ROW_GAP7 = 8;
|
|
5324
|
-
var
|
|
5464
|
+
var styles33 = StyleSheet.create({
|
|
5325
5465
|
list: { rowGap: ROW_GAP7 }
|
|
5326
5466
|
});
|
|
5327
5467
|
function RadioList(props) {
|
|
@@ -5334,7 +5474,7 @@ function RadioList(props) {
|
|
|
5334
5474
|
View,
|
|
5335
5475
|
{
|
|
5336
5476
|
accessibilityRole: "radiogroup",
|
|
5337
|
-
style:
|
|
5477
|
+
style: styles33.list,
|
|
5338
5478
|
...webFieldA11y({ describedById, hasError }),
|
|
5339
5479
|
...radio.groupProps,
|
|
5340
5480
|
children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
@@ -5388,11 +5528,11 @@ function DecisionNote({ state, labels, testID, disabled }) {
|
|
|
5388
5528
|
);
|
|
5389
5529
|
}
|
|
5390
5530
|
var BUTTON_BASIS = "40%";
|
|
5391
|
-
var
|
|
5531
|
+
var styles34 = StyleSheet.create({
|
|
5392
5532
|
cell: { flexBasis: BUTTON_BASIS, flexGrow: 1 }
|
|
5393
5533
|
});
|
|
5394
5534
|
function OutcomeButtons({ outcomes, pending, disabled, testID, onPress }) {
|
|
5395
|
-
return /* @__PURE__ */ jsx(Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsx(View, { style:
|
|
5535
|
+
return /* @__PURE__ */ jsx(Fragment, { children: outcomes.map((item) => /* @__PURE__ */ jsx(View, { style: styles34.cell, children: /* @__PURE__ */ jsx(
|
|
5396
5536
|
Button,
|
|
5397
5537
|
{
|
|
5398
5538
|
fullWidth: true,
|
|
@@ -5473,12 +5613,12 @@ function StickyBarDecision(props) {
|
|
|
5473
5613
|
}
|
|
5474
5614
|
var TEXT_SIZE3 = 13;
|
|
5475
5615
|
var TEXT_LINE3 = 18;
|
|
5476
|
-
var
|
|
5616
|
+
var styles35 = StyleSheet.create({
|
|
5477
5617
|
text: { fontSize: TEXT_SIZE3, fontWeight: "700", lineHeight: TEXT_LINE3 }
|
|
5478
5618
|
});
|
|
5479
5619
|
var SubmitError = ({ message, testID }) => {
|
|
5480
5620
|
const { theme } = useUi();
|
|
5481
|
-
return /* @__PURE__ */ jsx(Text, { role: "alert", style: [
|
|
5621
|
+
return /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles35.text, { color: fieldErrorInk(theme) }], testID, children: message });
|
|
5482
5622
|
};
|
|
5483
5623
|
var toggle = (list, id) => list.includes(id) ? list.filter((item) => item !== id) : [...list, id];
|
|
5484
5624
|
function useDecisionPanel(outcomes, onSubmit) {
|
|
@@ -5521,7 +5661,7 @@ function useDecisionPanel(outcomes, onSubmit) {
|
|
|
5521
5661
|
}
|
|
5522
5662
|
var TITLE_SIZE2 = 15;
|
|
5523
5663
|
var PANEL_GAP = 12;
|
|
5524
|
-
var
|
|
5664
|
+
var styles36 = StyleSheet.create({
|
|
5525
5665
|
panel: { rowGap: PANEL_GAP },
|
|
5526
5666
|
title: { fontSize: TITLE_SIZE2, fontWeight: "700" }
|
|
5527
5667
|
});
|
|
@@ -5535,13 +5675,13 @@ function DecisionPanel(props) {
|
|
|
5535
5675
|
const { theme } = useUi();
|
|
5536
5676
|
const state = useDecisionPanel(outcomes, onSubmit);
|
|
5537
5677
|
const body = (locked) => renderVariant(variant, { state, outcomes, labels, testID, disabled: disabled || locked, reasons, leadOutcome });
|
|
5538
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
5539
|
-
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [
|
|
5678
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles36.panel, style], testID, children: [
|
|
5679
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles36.title, { color: theme.colors.text }], children: labels.title }),
|
|
5540
5680
|
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),
|
|
5541
5681
|
state.error === "submit" ? /* @__PURE__ */ jsx(SubmitError, { message: labels.submitError, testID: `${testID}-error` }) : null
|
|
5542
5682
|
] });
|
|
5543
5683
|
}
|
|
5544
5684
|
|
|
5545
|
-
export { ActionBar, AddOnRequest, AlignToControl, AnchoredMenu, BicInput, BicRejection, COUNTRIES, ChipLabelWrap, ChipSelector, CountryField, CountryFlag, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, DateInput, DatePickerProvider, DateRangeControl, DateTimeField, DecisionPanel, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, FixBar, FlagShapeKind, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, GatedChecklist, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, IbanInput, IbanRejection, InlineFieldRow, LINE_ITEMS_WIDE_MIN_WIDTH, LineItems, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, ResponsiveFormLayout, SearchSelect, SelectControl, SelectField, SelectSurface, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, actionBarPosition, buildSearchSelectSections, canRemoveLine, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateDecision, validateIban };
|
|
5685
|
+
export { ActionBar, AddOnRequest, AlignToControl, AnchoredMenu, BicInput, BicRejection, COUNTRIES, ChipLabelWrap, ChipSelector, CountryField, CountryFlag, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, DateInput, DatePickerProvider, DateRangeControl, DateTimeField, DecisionPanel, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, FileInput, FixBar, FlagShapeKind, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, GatedChecklist, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, IbanInput, IbanRejection, InlineFieldRow, LINE_ITEMS_WIDE_MIN_WIDTH, LineItems, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, ResponsiveFormLayout, SearchSelect, SelectControl, SelectField, SelectSurface, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, actionBarPosition, buildSearchSelectSections, canRemoveLine, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateDecision, validateIban };
|
|
5546
5686
|
//# sourceMappingURL=index.mjs.map
|
|
5547
5687
|
//# sourceMappingURL=index.mjs.map
|