@dloizides/ui-forms 1.9.0 → 1.9.1
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 +280 -280
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -429,6 +429,16 @@ function useThemedInput(options = {}) {
|
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
431
|
var IS_WEB2 = reactNative.Platform.OS === "web";
|
|
432
|
+
function webFieldA11y({ describedById, hasError = false, required = false }) {
|
|
433
|
+
if (!IS_WEB2) {
|
|
434
|
+
return {};
|
|
435
|
+
}
|
|
436
|
+
return {
|
|
437
|
+
"aria-invalid": hasError ? true : void 0,
|
|
438
|
+
"aria-describedby": describedById,
|
|
439
|
+
"aria-required": required ? true : void 0
|
|
440
|
+
};
|
|
441
|
+
}
|
|
432
442
|
var ThemedTextInput = React__default.default.forwardRef(function ThemedTextInput2({ hasError = false, describedById, requiredField = false, onFocus, onBlur, style, placeholderTextColor, ...rest }, ref) {
|
|
433
443
|
const {
|
|
434
444
|
style: themedStyle,
|
|
@@ -436,11 +446,7 @@ var ThemedTextInput = React__default.default.forwardRef(function ThemedTextInput
|
|
|
436
446
|
focusBind,
|
|
437
447
|
hoverBind
|
|
438
448
|
} = useThemedInput({ hasError, onFocus, onBlur });
|
|
439
|
-
const webA11y =
|
|
440
|
-
"aria-invalid": hasError ? true : void 0,
|
|
441
|
-
"aria-describedby": describedById,
|
|
442
|
-
"aria-required": requiredField ? true : void 0
|
|
443
|
-
} : {};
|
|
449
|
+
const webA11y = webFieldA11y({ describedById, hasError, required: requiredField });
|
|
444
450
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
445
451
|
reactNative.TextInput,
|
|
446
452
|
{
|
|
@@ -622,11 +628,6 @@ function SolidChip({
|
|
|
622
628
|
}
|
|
623
629
|
);
|
|
624
630
|
}
|
|
625
|
-
var IS_WEB3 = reactNative.Platform.OS === "web";
|
|
626
|
-
function groupA11yProps(describedById, hasError) {
|
|
627
|
-
if (!IS_WEB3) return {};
|
|
628
|
-
return { "aria-invalid": hasError ? true : void 0, "aria-describedby": describedById };
|
|
629
|
-
}
|
|
630
631
|
var ChipSelector = ({
|
|
631
632
|
label,
|
|
632
633
|
options,
|
|
@@ -688,7 +689,7 @@ var ChipSelector = ({
|
|
|
688
689
|
required,
|
|
689
690
|
spacing,
|
|
690
691
|
testID,
|
|
691
|
-
children: ({ describedById, hasError }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles6.chipContainer, ...
|
|
692
|
+
children: ({ describedById, hasError }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles6.chipContainer, ...webFieldA11y({ describedById, hasError }), children: options.map(renderChip) })
|
|
692
693
|
}
|
|
693
694
|
);
|
|
694
695
|
};
|
|
@@ -934,13 +935,13 @@ var controlStyles = reactNative.StyleSheet.create({
|
|
|
934
935
|
optionText: { fontSize: OPTION_FONT },
|
|
935
936
|
error: { fontSize: ERROR_FONT, marginTop: ERROR_GAP }
|
|
936
937
|
});
|
|
937
|
-
var
|
|
938
|
+
var IS_WEB3 = typeof document !== "undefined";
|
|
938
939
|
var ESCAPE_KEY = "Escape";
|
|
939
940
|
var ACTIVE_WEIGHT = "700";
|
|
940
941
|
var IDLE_WEIGHT = "400";
|
|
941
942
|
function useDismiss(anchorRef, menuRef, onDismiss) {
|
|
942
943
|
React.useEffect(() => {
|
|
943
|
-
if (!
|
|
944
|
+
if (!IS_WEB3) return void 0;
|
|
944
945
|
const onMouseDown = (event) => {
|
|
945
946
|
const anchorNode = anchorRef.current;
|
|
946
947
|
const menuNode = menuRef.current;
|