@dloizides/ui-forms 1.18.2 → 1.18.3
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.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1407,6 +1407,7 @@ var FormCheckbox = ({
|
|
|
1407
1407
|
const brand = palette.primary["500"];
|
|
1408
1408
|
const hintText = typeof hint === "string" && hint !== "" ? hint : description;
|
|
1409
1409
|
const hasHint = typeof hintText === "string" && hintText !== "";
|
|
1410
|
+
const { hintId } = useFieldIds();
|
|
1410
1411
|
const themeStyles = React2.useMemo(() => {
|
|
1411
1412
|
const boxOn = { backgroundColor: brand, borderColor: brand };
|
|
1412
1413
|
const boxOff = { backgroundColor: "transparent", borderColor: colors.border };
|
|
@@ -1435,6 +1436,7 @@ var FormCheckbox = ({
|
|
|
1435
1436
|
accessibilityRole: "checkbox",
|
|
1436
1437
|
accessibilityState: { checked: value, disabled },
|
|
1437
1438
|
"aria-checked": value,
|
|
1439
|
+
"aria-describedby": hasHint ? hintId : void 0,
|
|
1438
1440
|
disabled,
|
|
1439
1441
|
onPress: toggle,
|
|
1440
1442
|
role: "checkbox",
|
|
@@ -1450,7 +1452,7 @@ var FormCheckbox = ({
|
|
|
1450
1452
|
/* @__PURE__ */ jsx(View, { style: [styles7.box, value ? themeStyles.boxOn : themeStyles.boxOff], children: value ? /* @__PURE__ */ jsx(Text, { style: [styles7.check, { color: colors.surface }], accessibilityElementsHidden: true, children: "\u2713" }) : null }),
|
|
1451
1453
|
/* @__PURE__ */ jsxs(View, { style: styles7.textColumn, children: [
|
|
1452
1454
|
/* @__PURE__ */ jsx(Text, { style: [styles7.label, themeStyles.label], children: label }),
|
|
1453
|
-
hasHint ? /* @__PURE__ */ jsx(Text, { style: [styles7.hint, themeStyles.hint], children: hintText }) : null
|
|
1455
|
+
hasHint ? /* @__PURE__ */ jsx(Text, { nativeID: hintId, style: [styles7.hint, themeStyles.hint], children: hintText }) : null
|
|
1454
1456
|
] })
|
|
1455
1457
|
]
|
|
1456
1458
|
}
|