@dloizides/ui-forms 1.18.1 → 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 +17 -0
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1267,6 +1267,12 @@ var styles6 = StyleSheet.create({
|
|
|
1267
1267
|
// `hitSlop`, so a pointer target smaller than the floor cannot be widened any other way.
|
|
1268
1268
|
minHeight: MIN_TOUCH_TARGET_PX
|
|
1269
1269
|
},
|
|
1270
|
+
switchSlot: {
|
|
1271
|
+
minWidth: MIN_TOUCH_TARGET_PX,
|
|
1272
|
+
minHeight: MIN_TOUCH_TARGET_PX,
|
|
1273
|
+
alignItems: "center",
|
|
1274
|
+
justifyContent: "center"
|
|
1275
|
+
},
|
|
1270
1276
|
textColumn: {
|
|
1271
1277
|
flex: 1
|
|
1272
1278
|
},
|
|
@@ -1320,7 +1326,7 @@ var FormSwitch = ({
|
|
|
1320
1326
|
/* @__PURE__ */ jsx(Text, { style: [styles6.label, themeStyles.label], children: label }),
|
|
1321
1327
|
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [styles6.description, themeStyles.description], children: description }) : null
|
|
1322
1328
|
] }),
|
|
1323
|
-
/* @__PURE__ */ jsx(View, { pointerEvents: "none", children: /* @__PURE__ */ jsx(
|
|
1329
|
+
/* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles6.switchSlot, testID: `${testID}-hitbox`, children: /* @__PURE__ */ jsx(
|
|
1324
1330
|
Switch,
|
|
1325
1331
|
{
|
|
1326
1332
|
accessibilityHint: accessibilityHint ?? label,
|
|
@@ -1401,6 +1407,7 @@ var FormCheckbox = ({
|
|
|
1401
1407
|
const brand = palette.primary["500"];
|
|
1402
1408
|
const hintText = typeof hint === "string" && hint !== "" ? hint : description;
|
|
1403
1409
|
const hasHint = typeof hintText === "string" && hintText !== "";
|
|
1410
|
+
const { hintId } = useFieldIds();
|
|
1404
1411
|
const themeStyles = React2.useMemo(() => {
|
|
1405
1412
|
const boxOn = { backgroundColor: brand, borderColor: brand };
|
|
1406
1413
|
const boxOff = { backgroundColor: "transparent", borderColor: colors.border };
|
|
@@ -1429,6 +1436,7 @@ var FormCheckbox = ({
|
|
|
1429
1436
|
accessibilityRole: "checkbox",
|
|
1430
1437
|
accessibilityState: { checked: value, disabled },
|
|
1431
1438
|
"aria-checked": value,
|
|
1439
|
+
"aria-describedby": hasHint ? hintId : void 0,
|
|
1432
1440
|
disabled,
|
|
1433
1441
|
onPress: toggle,
|
|
1434
1442
|
role: "checkbox",
|
|
@@ -1444,7 +1452,7 @@ var FormCheckbox = ({
|
|
|
1444
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 }),
|
|
1445
1453
|
/* @__PURE__ */ jsxs(View, { style: styles7.textColumn, children: [
|
|
1446
1454
|
/* @__PURE__ */ jsx(Text, { style: [styles7.label, themeStyles.label], children: label }),
|
|
1447
|
-
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
|
|
1448
1456
|
] })
|
|
1449
1457
|
]
|
|
1450
1458
|
}
|