@dloizides/ui-forms 1.45.0 → 1.46.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 +7 -0
- package/dist/index.d.mts +109 -1
- package/dist/index.d.ts +109 -1
- package/dist/index.js +333 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +325 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import React37, { forwardRef, createContext, useState, useCallback, useMemo,
|
|
2
|
-
import { Platform, StyleSheet, TextInput, View, Text, useWindowDimensions, ScrollView,
|
|
1
|
+
import React37, { 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, Switch, Image, TouchableOpacity, Modal } from 'react-native';
|
|
3
3
|
import { useUi } from '@dloizides/ui-feedback';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { Z_INDEX, focusRingOutline, readableScaleInk, resolveOnBrand } from '@dloizides/design-tokens';
|
|
6
6
|
import { themeFocusRingColor, Button, useFocusRing, IconButton } from '@dloizides/ui-buttons';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';
|
|
9
|
+
import { parseFieldErrors } from '@dloizides/api-client-base';
|
|
9
10
|
import Svg, { Rect, Circle, Polygon } from 'react-native-svg';
|
|
11
|
+
import { SvgIcon } from '@dloizides/ui-icons';
|
|
10
12
|
|
|
11
13
|
// src/Field/Field.tsx
|
|
12
14
|
function attachControlId(child, candidateId, describedById) {
|
|
@@ -3745,6 +3747,71 @@ function useFocusFirstInvalid(refs) {
|
|
|
3745
3747
|
first?.focus();
|
|
3746
3748
|
}, []);
|
|
3747
3749
|
}
|
|
3750
|
+
|
|
3751
|
+
// src/useServerFieldErrors/assignServerErrors.ts
|
|
3752
|
+
function lastSegment(path) {
|
|
3753
|
+
return path.slice(path.lastIndexOf(".") + 1).toLowerCase();
|
|
3754
|
+
}
|
|
3755
|
+
function matchField(path, fields) {
|
|
3756
|
+
const exact = fields.find((field2) => field2 === path);
|
|
3757
|
+
if (exact !== void 0) {
|
|
3758
|
+
return exact;
|
|
3759
|
+
}
|
|
3760
|
+
const key = lastSegment(path);
|
|
3761
|
+
return key === "" ? null : fields.find((field2) => field2.toLowerCase() === key) ?? null;
|
|
3762
|
+
}
|
|
3763
|
+
function messageOf(error, formatCode) {
|
|
3764
|
+
const formatted = error.code !== void 0 && formatCode !== void 0 ? formatCode(error.code, error) : null;
|
|
3765
|
+
return typeof formatted === "string" && formatted !== "" ? formatted : error.message;
|
|
3766
|
+
}
|
|
3767
|
+
function assignServerErrors(errors, fields, formatCode) {
|
|
3768
|
+
const byField = {};
|
|
3769
|
+
let formError = null;
|
|
3770
|
+
for (const error of errors) {
|
|
3771
|
+
const field2 = matchField(error.path, fields);
|
|
3772
|
+
const message = messageOf(error, formatCode);
|
|
3773
|
+
if (field2 === null) {
|
|
3774
|
+
formError = formError ?? message;
|
|
3775
|
+
} else if (byField[field2] === void 0) {
|
|
3776
|
+
byField[field2] = message;
|
|
3777
|
+
}
|
|
3778
|
+
}
|
|
3779
|
+
const matched = fields.filter((field2) => byField[field2] !== void 0);
|
|
3780
|
+
return { byField, formError, matched };
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
// src/useServerFieldErrors/useServerFieldErrors.ts
|
|
3784
|
+
var EMPTY_STATE = { byField: {}, formError: null };
|
|
3785
|
+
var NO_REFS = {};
|
|
3786
|
+
function withoutField(state, field2) {
|
|
3787
|
+
if (state.byField[field2] === void 0) {
|
|
3788
|
+
return state;
|
|
3789
|
+
}
|
|
3790
|
+
const byField = { ...state.byField };
|
|
3791
|
+
delete byField[field2];
|
|
3792
|
+
return { ...state, byField };
|
|
3793
|
+
}
|
|
3794
|
+
function useServerFieldErrors(options) {
|
|
3795
|
+
const { fields, refs, formatCode } = options;
|
|
3796
|
+
const [state, setState] = useState(EMPTY_STATE);
|
|
3797
|
+
const focusFirst = useFocusFirstInvalid(refs ?? NO_REFS);
|
|
3798
|
+
const hasRefs = refs !== void 0;
|
|
3799
|
+
const apply = useCallback(
|
|
3800
|
+
(error) => {
|
|
3801
|
+
const assigned = assignServerErrors(parseFieldErrors(error), fields, formatCode);
|
|
3802
|
+
setState({ byField: assigned.byField, formError: assigned.formError });
|
|
3803
|
+
if (hasRefs && assigned.matched.length > 0) {
|
|
3804
|
+
focusFirst(assigned.matched);
|
|
3805
|
+
}
|
|
3806
|
+
return assigned.matched.length > 0;
|
|
3807
|
+
},
|
|
3808
|
+
[fields, formatCode, focusFirst, hasRefs]
|
|
3809
|
+
);
|
|
3810
|
+
const clear = useCallback((field2) => setState((current) => withoutField(current, field2)), []);
|
|
3811
|
+
const reset = useCallback(() => setState(EMPTY_STATE), []);
|
|
3812
|
+
const errorFor = useCallback((field2) => state.byField[field2], [state.byField]);
|
|
3813
|
+
return { errorFor, apply, clear, formError: state.formError, reset };
|
|
3814
|
+
}
|
|
3748
3815
|
function isScrollable(node) {
|
|
3749
3816
|
return "scrollIntoView" in Object(node);
|
|
3750
3817
|
}
|
|
@@ -5746,6 +5813,261 @@ function DecisionPanel(props) {
|
|
|
5746
5813
|
] });
|
|
5747
5814
|
}
|
|
5748
5815
|
|
|
5749
|
-
|
|
5816
|
+
// src/PasswordField/PasswordRulesDisplay.ts
|
|
5817
|
+
var PasswordRulesDisplay = /* @__PURE__ */ ((PasswordRulesDisplay2) => {
|
|
5818
|
+
PasswordRulesDisplay2["Checklist"] = "checklist";
|
|
5819
|
+
PasswordRulesDisplay2["MeterGrid"] = "meterGrid";
|
|
5820
|
+
PasswordRulesDisplay2["Chips"] = "chips";
|
|
5821
|
+
PasswordRulesDisplay2["Sentence"] = "sentence";
|
|
5822
|
+
return PasswordRulesDisplay2;
|
|
5823
|
+
})(PasswordRulesDisplay || {});
|
|
5824
|
+
|
|
5825
|
+
// src/PasswordField/RuleTone.ts
|
|
5826
|
+
var RuleTone = /* @__PURE__ */ ((RuleTone2) => {
|
|
5827
|
+
RuleTone2["Met"] = "met";
|
|
5828
|
+
RuleTone2["Unmet"] = "unmet";
|
|
5829
|
+
RuleTone2["Refused"] = "refused";
|
|
5830
|
+
return RuleTone2;
|
|
5831
|
+
})(RuleTone || {});
|
|
5832
|
+
function ruleTone(met, flagUnmet) {
|
|
5833
|
+
if (met) return "met" /* Met */;
|
|
5834
|
+
return flagUnmet ? "refused" /* Refused */ : "unmet" /* Unmet */;
|
|
5835
|
+
}
|
|
5836
|
+
var MARK_SIZE = 16;
|
|
5837
|
+
var CHECK_SIZE = 12;
|
|
5838
|
+
var RING_WIDTH = 1.5;
|
|
5839
|
+
var POP_FROM = 0.6;
|
|
5840
|
+
var POP_PEAK = 1.12;
|
|
5841
|
+
var POP_UP_MS = 160;
|
|
5842
|
+
var POP_SETTLE_MS = 100;
|
|
5843
|
+
var styles38 = StyleSheet.create({
|
|
5844
|
+
mark: { width: MARK_SIZE, height: MARK_SIZE, borderRadius: MARK_SIZE / 2, alignItems: "center", justifyContent: "center" },
|
|
5845
|
+
ring: { borderWidth: RING_WIDTH }
|
|
5846
|
+
});
|
|
5847
|
+
function RuleMark({ tone, colors }) {
|
|
5848
|
+
const reduced = useReducedMotion();
|
|
5849
|
+
const scale = useRef(new Animated.Value(1)).current;
|
|
5850
|
+
const wasMet = useRef(tone === "met" /* Met */);
|
|
5851
|
+
const met = tone === "met" /* Met */;
|
|
5852
|
+
useEffect(() => {
|
|
5853
|
+
const turnedMet = met && !wasMet.current;
|
|
5854
|
+
wasMet.current = met;
|
|
5855
|
+
if (!turnedMet || reduced) return;
|
|
5856
|
+
scale.setValue(POP_FROM);
|
|
5857
|
+
Animated.sequence([
|
|
5858
|
+
Animated.timing(scale, { toValue: POP_PEAK, duration: POP_UP_MS, easing: Easing.out(Easing.cubic), useNativeDriver: false }),
|
|
5859
|
+
Animated.timing(scale, { toValue: 1, duration: POP_SETTLE_MS, easing: Easing.out(Easing.cubic), useNativeDriver: false })
|
|
5860
|
+
]).start();
|
|
5861
|
+
}, [met, reduced, scale]);
|
|
5862
|
+
const color = colors.mark[tone];
|
|
5863
|
+
const shape = met ? { backgroundColor: color } : [styles38.ring, { borderColor: color }];
|
|
5864
|
+
return /* @__PURE__ */ jsx(Animated.View, { style: { transform: [{ scale }] }, children: /* @__PURE__ */ jsx(View, { style: [styles38.mark, shape], children: met ? /* @__PURE__ */ jsx(SvgIcon, { color: colors.onMark, name: "check", size: CHECK_SIZE }) : null }) });
|
|
5865
|
+
}
|
|
5866
|
+
var GAP8 = 6;
|
|
5867
|
+
var ROW_GAP8 = 8;
|
|
5868
|
+
var FONT5 = 14;
|
|
5869
|
+
var LINE = 20;
|
|
5870
|
+
var METER_HEIGHT = 4;
|
|
5871
|
+
var RADIUS3 = 999;
|
|
5872
|
+
var CHIP_PAD_V = 4;
|
|
5873
|
+
var CHIP_PAD_H = 10;
|
|
5874
|
+
var CHIP_BORDER = 1;
|
|
5875
|
+
var HALF4 = "50%";
|
|
5876
|
+
var styles39 = StyleSheet.create({
|
|
5877
|
+
column: { gap: GAP8 },
|
|
5878
|
+
row: { flexDirection: "row", alignItems: "center", gap: ROW_GAP8 },
|
|
5879
|
+
text: { fontSize: FONT5, lineHeight: LINE, flexShrink: 1 },
|
|
5880
|
+
meter: { flexDirection: "row", gap: GAP8 },
|
|
5881
|
+
segment: { flex: 1, height: METER_HEIGHT, borderRadius: RADIUS3 },
|
|
5882
|
+
grid: { flexDirection: "row", flexWrap: "wrap", rowGap: GAP8 },
|
|
5883
|
+
cell: { flexBasis: HALF4, maxWidth: HALF4, paddingRight: GAP8 },
|
|
5884
|
+
chips: { flexDirection: "row", flexWrap: "wrap", gap: GAP8 },
|
|
5885
|
+
chip: { borderRadius: RADIUS3, borderWidth: CHIP_BORDER, paddingVertical: CHIP_PAD_V, paddingHorizontal: CHIP_PAD_H },
|
|
5886
|
+
metPhrase: { fontWeight: "700", textDecorationLine: "underline" }
|
|
5887
|
+
});
|
|
5888
|
+
function RuleList({ rules, flagUnmet, colors, testID, listStyle, itemStyle, outlined = false }) {
|
|
5889
|
+
return /* @__PURE__ */ jsx(View, { role: "list", style: listStyle, testID, children: rules.map((rule) => {
|
|
5890
|
+
const tone = ruleTone(rule.met, flagUnmet);
|
|
5891
|
+
const outline = outlined ? { borderColor: colors.mark[tone] } : null;
|
|
5892
|
+
return /* @__PURE__ */ jsxs(View, { role: "listitem", style: [styles39.row, itemStyle, outline], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
|
|
5893
|
+
/* @__PURE__ */ jsx(RuleMark, { colors, tone }),
|
|
5894
|
+
/* @__PURE__ */ jsx(Text, { style: [styles39.text, { color: colors.text[tone] }], children: rule.label })
|
|
5895
|
+
] }, rule.id);
|
|
5896
|
+
}) });
|
|
5897
|
+
}
|
|
5898
|
+
function RulesChecklist(props) {
|
|
5899
|
+
return /* @__PURE__ */ jsx(RuleList, { ...props, listStyle: styles39.column });
|
|
5900
|
+
}
|
|
5901
|
+
function RulesChips(props) {
|
|
5902
|
+
return /* @__PURE__ */ jsx(RuleList, { ...props, outlined: true, itemStyle: styles39.chip, listStyle: styles39.chips });
|
|
5903
|
+
}
|
|
5904
|
+
function RulesMeterGrid(props) {
|
|
5905
|
+
const { rules, flagUnmet, colors, testID } = props;
|
|
5906
|
+
const metCount = rules.filter((rule) => rule.met).length;
|
|
5907
|
+
const unfilled = flagUnmet ? colors.mark.refused : colors.track;
|
|
5908
|
+
return /* @__PURE__ */ jsxs(View, { style: styles39.column, children: [
|
|
5909
|
+
/* @__PURE__ */ jsx(View, { style: styles39.meter, testID: `${testID}-meter`, children: rules.map((rule, index) => /* @__PURE__ */ jsx(View, { style: [styles39.segment, { backgroundColor: index < metCount ? colors.mark.met : unfilled }] }, rule.id)) }),
|
|
5910
|
+
/* @__PURE__ */ jsx(RuleList, { ...props, itemStyle: styles39.cell, listStyle: styles39.grid })
|
|
5911
|
+
] });
|
|
5912
|
+
}
|
|
5913
|
+
function RulesSentence({ rules, flagUnmet, colors, testID }) {
|
|
5914
|
+
return /* @__PURE__ */ jsx(Text, { style: [styles39.text, { color: colors.text.unmet }], testID, children: rules.map((rule, index) => {
|
|
5915
|
+
const tone = ruleTone(rule.met, flagUnmet);
|
|
5916
|
+
return /* @__PURE__ */ jsxs(Text, { style: [{ color: colors.text[tone] }, rule.met ? styles39.metPhrase : null], testID: `${testID}-${rule.id}`, ...{ dataSet: { tone } }, children: [
|
|
5917
|
+
index > 0 ? ", " : "",
|
|
5918
|
+
rule.label
|
|
5919
|
+
] }, rule.id);
|
|
5920
|
+
}) });
|
|
5921
|
+
}
|
|
5922
|
+
function PasswordRules({ display, ...variant }) {
|
|
5923
|
+
switch (display) {
|
|
5924
|
+
case "checklist" /* Checklist */:
|
|
5925
|
+
return /* @__PURE__ */ jsx(RulesChecklist, { ...variant });
|
|
5926
|
+
case "chips" /* Chips */:
|
|
5927
|
+
return /* @__PURE__ */ jsx(RulesChips, { ...variant });
|
|
5928
|
+
case "sentence" /* Sentence */:
|
|
5929
|
+
return /* @__PURE__ */ jsx(RulesSentence, { ...variant });
|
|
5930
|
+
default:
|
|
5931
|
+
return /* @__PURE__ */ jsx(RulesMeterGrid, { ...variant });
|
|
5932
|
+
}
|
|
5933
|
+
}
|
|
5934
|
+
var ICON_SIZE = 20;
|
|
5935
|
+
var styles40 = StyleSheet.create({
|
|
5936
|
+
button: { width: MIN_TOUCH_TARGET_PX, height: MIN_TOUCH_TARGET_PX, alignItems: "center", justifyContent: "center" }
|
|
5937
|
+
});
|
|
5938
|
+
function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLabel, color, testID }) {
|
|
5939
|
+
const label = revealed ? hideLabel : showLabel;
|
|
5940
|
+
return /* @__PURE__ */ jsx(
|
|
5941
|
+
Pressable,
|
|
5942
|
+
{
|
|
5943
|
+
accessibilityHint: label,
|
|
5944
|
+
accessibilityLabel: label,
|
|
5945
|
+
accessibilityRole: "button",
|
|
5946
|
+
"aria-pressed": revealed,
|
|
5947
|
+
style: styles40.button,
|
|
5948
|
+
testID,
|
|
5949
|
+
onPress: onToggle,
|
|
5950
|
+
onPressIn,
|
|
5951
|
+
children: /* @__PURE__ */ jsx(SvgIcon, { color, name: revealed ? "eyeOff" : "eye", size: ICON_SIZE })
|
|
5952
|
+
}
|
|
5953
|
+
);
|
|
5954
|
+
}
|
|
5955
|
+
|
|
5956
|
+
// src/PasswordField/ruleAnnouncement.ts
|
|
5957
|
+
function changedRules(previous, next) {
|
|
5958
|
+
const before = new Map(previous.map((rule) => [rule.id, rule.met]));
|
|
5959
|
+
return next.filter((rule) => before.has(rule.id) && before.get(rule.id) !== rule.met);
|
|
5960
|
+
}
|
|
5961
|
+
function ruleAnnouncement(changed, labels) {
|
|
5962
|
+
return changed.map((rule) => `${rule.label}: ${rule.met ? labels.met : labels.unmet}`).join(". ");
|
|
5963
|
+
}
|
|
5964
|
+
|
|
5965
|
+
// src/PasswordField/usePasswordRuleAnnouncement.ts
|
|
5966
|
+
function usePasswordRuleAnnouncement(rules, labels) {
|
|
5967
|
+
const previous = useRef(rules);
|
|
5968
|
+
const [message, setMessage] = useState("");
|
|
5969
|
+
useEffect(() => {
|
|
5970
|
+
const changed = changedRules(previous.current, rules);
|
|
5971
|
+
previous.current = rules;
|
|
5972
|
+
if (changed.length > 0) setMessage(ruleAnnouncement(changed, labels));
|
|
5973
|
+
}, [rules, labels]);
|
|
5974
|
+
return message;
|
|
5975
|
+
}
|
|
5976
|
+
function ruleColorsFrom(palette) {
|
|
5977
|
+
return {
|
|
5978
|
+
mark: { ["met" /* Met */]: palette.success, ["unmet" /* Unmet */]: palette.textSecondary, ["refused" /* Refused */]: palette.error },
|
|
5979
|
+
text: { ["met" /* Met */]: palette.text, ["unmet" /* Unmet */]: palette.textSecondary, ["refused" /* Refused */]: palette.error },
|
|
5980
|
+
track: palette.border,
|
|
5981
|
+
onMark: palette.background
|
|
5982
|
+
};
|
|
5983
|
+
}
|
|
5984
|
+
function useRuleColors(override) {
|
|
5985
|
+
const { theme } = useUi();
|
|
5986
|
+
return useMemo(() => {
|
|
5987
|
+
if (override !== void 0) return ruleColorsFrom(override);
|
|
5988
|
+
return ruleColorsFrom({
|
|
5989
|
+
success: theme.semantic.success?.["500"] ?? theme.colors.text,
|
|
5990
|
+
error: theme.semantic.error["500"],
|
|
5991
|
+
text: theme.colors.text,
|
|
5992
|
+
textSecondary: theme.colors.textSecondary,
|
|
5993
|
+
border: theme.colors.border,
|
|
5994
|
+
background: theme.colors.background
|
|
5995
|
+
});
|
|
5996
|
+
}, [theme, override]);
|
|
5997
|
+
}
|
|
5998
|
+
var RULES_GAP = 8;
|
|
5999
|
+
var TOGGLE_INSET = 48;
|
|
6000
|
+
var NO_RULES = [];
|
|
6001
|
+
var styles41 = StyleSheet.create({
|
|
6002
|
+
inputRow: { position: "relative", justifyContent: "center" },
|
|
6003
|
+
input: { paddingRight: TOGGLE_INSET },
|
|
6004
|
+
toggle: { position: "absolute", right: 0, top: 0, bottom: 0, justifyContent: "center" },
|
|
6005
|
+
rules: { marginTop: RULES_GAP },
|
|
6006
|
+
live: { position: "absolute", width: 1, height: 1, overflow: "hidden", opacity: 0 }
|
|
6007
|
+
});
|
|
6008
|
+
function joinIds(...ids) {
|
|
6009
|
+
const joined = ids.filter((id) => id !== void 0 && id !== "").join(" ");
|
|
6010
|
+
return joined === "" ? void 0 : joined;
|
|
6011
|
+
}
|
|
6012
|
+
function useCaretKeepingToggle(inputRef, initialLength) {
|
|
6013
|
+
const [revealed, setRevealed] = useState(false);
|
|
6014
|
+
const selection2 = useRef({ start: initialLength, end: initialLength });
|
|
6015
|
+
const hadFocus = useRef(false);
|
|
6016
|
+
const onSelectionChange = useCallback((event) => {
|
|
6017
|
+
selection2.current = event.nativeEvent.selection;
|
|
6018
|
+
}, []);
|
|
6019
|
+
const onPressIn = useCallback(() => {
|
|
6020
|
+
hadFocus.current = inputRef.current?.isFocused?.() ?? false;
|
|
6021
|
+
}, [inputRef]);
|
|
6022
|
+
const onToggle = useCallback(() => {
|
|
6023
|
+
setRevealed((current) => !current);
|
|
6024
|
+
if (!hadFocus.current) return;
|
|
6025
|
+
const node = inputRef.current;
|
|
6026
|
+
const { start, end } = selection2.current;
|
|
6027
|
+
requestAnimationFrame(() => {
|
|
6028
|
+
node?.focus();
|
|
6029
|
+
node?.setSelectionRange?.(start, end);
|
|
6030
|
+
});
|
|
6031
|
+
}, [inputRef]);
|
|
6032
|
+
return { revealed, onPressIn, onToggle, onSelectionChange };
|
|
6033
|
+
}
|
|
6034
|
+
var PasswordField = React37.forwardRef(function PasswordField2({ label, value, onChangeText, labels, testID, rules = NO_RULES, rulesDisplay = "meterGrid" /* MeterGrid */, flagUnmet = false, error, colors: colorOverride, inputProps }, ref) {
|
|
6035
|
+
const inputRef = useRef(null);
|
|
6036
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
6037
|
+
const toggle2 = useCaretKeepingToggle(inputRef, value.length);
|
|
6038
|
+
const colors = useRuleColors(colorOverride);
|
|
6039
|
+
const announcement = usePasswordRuleAnnouncement(rules, labels);
|
|
6040
|
+
const rulesId = `${testID}-rules`;
|
|
6041
|
+
const hasRules = rules.length > 0;
|
|
6042
|
+
return /* @__PURE__ */ jsx(Field, { error, label, testID: `${testID}-field`, children: (context) => /* @__PURE__ */ jsxs(View, { children: [
|
|
6043
|
+
/* @__PURE__ */ jsxs(View, { style: styles41.inputRow, children: [
|
|
6044
|
+
/* @__PURE__ */ jsx(
|
|
6045
|
+
ThemedTextInput,
|
|
6046
|
+
{
|
|
6047
|
+
autoCapitalize: "none",
|
|
6048
|
+
autoCorrect: false,
|
|
6049
|
+
...inputProps,
|
|
6050
|
+
ref: inputRef,
|
|
6051
|
+
describedById: joinIds(context.describedById, hasRules ? rulesId : void 0),
|
|
6052
|
+
hasError: context.hasError || flagUnmet && rules.some((rule) => !rule.met),
|
|
6053
|
+
id: context.controlId,
|
|
6054
|
+
secureTextEntry: !toggle2.revealed,
|
|
6055
|
+
style: [styles41.input, inputProps?.style],
|
|
6056
|
+
testID,
|
|
6057
|
+
value,
|
|
6058
|
+
onChangeText,
|
|
6059
|
+
onSelectionChange: toggle2.onSelectionChange
|
|
6060
|
+
}
|
|
6061
|
+
),
|
|
6062
|
+
/* @__PURE__ */ jsx(View, { style: styles41.toggle, children: /* @__PURE__ */ jsx(RevealToggle, { color: colors.text.unmet, hideLabel: labels.hide, revealed: toggle2.revealed, showLabel: labels.show, testID: `${testID}-reveal`, onPressIn: toggle2.onPressIn, onToggle: toggle2.onToggle }) })
|
|
6063
|
+
] }),
|
|
6064
|
+
hasRules ? /* @__PURE__ */ jsxs(View, { nativeID: rulesId, style: styles41.rules, children: [
|
|
6065
|
+
/* @__PURE__ */ jsx(PasswordRules, { colors, display: rulesDisplay, flagUnmet, rules, testID: rulesId }),
|
|
6066
|
+
/* @__PURE__ */ jsx(Text, { "aria-live": "polite", accessibilityLiveRegion: "polite", style: styles41.live, testID: `${testID}-announce`, children: announcement })
|
|
6067
|
+
] }) : null
|
|
6068
|
+
] }) });
|
|
6069
|
+
});
|
|
6070
|
+
|
|
6071
|
+
export { ActionBar, AddOnRequest, AlignToControl, AnchoredMenu, BicInput, BicRejection, COUNTRIES, ChipLabelWrap, ChipSelector, CountryField, CountryFlag, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateDisplay, DateField, DateInput, DatePickerProvider, DateRangeControl, DateTimeField, DecisionPanel, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, FileInput, FixBar, FlagShapeKind, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, GatedChecklist, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, IbanInput, IbanRejection, InlineFieldRow, LINE_ITEMS_WIDE_MIN_WIDTH, LineItems, PHONE_MAX_WIDTH, PasswordField, PasswordRules, PasswordRulesDisplay, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, ResponsiveFormLayout, RevealToggle, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, SelectControl, SelectField, SelectSurface, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
|
|
5750
6072
|
//# sourceMappingURL=index.mjs.map
|
|
5751
6073
|
//# sourceMappingURL=index.mjs.map
|