@dloizides/ui-forms 1.18.0 → 1.18.2
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 +10 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.18.2
|
|
4
|
+
|
|
5
|
+
**FormSwitch: the switch now sits in a 44x44 (MIN_TOUCH_TARGET_PX) pressable slot on web.**
|
|
6
|
+
|
|
7
|
+
Visual QA on kefi-web Site settings (360 and 1280) measured the switch at 40x20: react-native-web sizes the
|
|
8
|
+
native input to the Switch root, and `hitSlop` is inert on web. The switch is now centred in a slot with
|
|
9
|
+
`minWidth`/`minHeight` MIN_TOUCH_TARGET_PX inside the pressable row, so the row stays at least 44 tall even when a
|
|
10
|
+
`containerStyle` overrides `minHeight`. The track and thumb are unchanged; the switch gains a few px of horizontal gutter.
|
|
11
|
+
New testID: `<testID>-hitbox`.
|
|
12
|
+
|
|
3
13
|
## 1.17.0
|
|
4
14
|
|
|
5
15
|
**Chips now have a 44px minimum touch target on web. `hitSlop` never did that — it is native-only.**
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var uiButtons = require('@dloizides/ui-buttons');
|
|
8
8
|
var reactDom = require('react-dom');
|
|
9
9
|
var a11y = require('@dloizides/a11y');
|
|
10
|
+
var designTokens = require('@dloizides/design-tokens');
|
|
10
11
|
|
|
11
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
|
|
@@ -398,7 +399,6 @@ var MENU_OPT_PAD_H = 12;
|
|
|
398
399
|
var MENU_OPT_PAD_V = 8;
|
|
399
400
|
var MENU_MIN_WIDTH = 160;
|
|
400
401
|
var MENU_MAX_HEIGHT = 260;
|
|
401
|
-
var MENU_Z = 1e3;
|
|
402
402
|
var MENU_ELEVATION = 8;
|
|
403
403
|
var MENU_BOX_SHADOW = "0px 2px 8px rgba(0, 0, 0, 0.15)";
|
|
404
404
|
var OPTION_FONT = 14;
|
|
@@ -455,7 +455,7 @@ var controlStyles = reactNative.StyleSheet.create({
|
|
|
455
455
|
borderWidth: INPUT_BORDER,
|
|
456
456
|
borderRadius: MENU_RADIUS,
|
|
457
457
|
paddingVertical: MENU_PAD_V,
|
|
458
|
-
zIndex:
|
|
458
|
+
zIndex: designTokens.Z_INDEX.dropdown,
|
|
459
459
|
boxShadow: MENU_BOX_SHADOW,
|
|
460
460
|
elevation: MENU_ELEVATION,
|
|
461
461
|
overflow: "hidden"
|
|
@@ -471,7 +471,7 @@ var controlStyles = reactNative.StyleSheet.create({
|
|
|
471
471
|
error: { fontSize: ERROR_FONT, marginTop: ERROR_GAP }
|
|
472
472
|
});
|
|
473
473
|
var IS_WEB3 = reactNative.Platform.OS === "web";
|
|
474
|
-
var MENU_PORTAL_Z_INDEX =
|
|
474
|
+
var MENU_PORTAL_Z_INDEX = designTokens.Z_INDEX.popover;
|
|
475
475
|
var MENU_TOP_GAP2 = 4;
|
|
476
476
|
function toDomNode(ref) {
|
|
477
477
|
const node = ref.current;
|
|
@@ -1273,6 +1273,12 @@ var styles6 = reactNative.StyleSheet.create({
|
|
|
1273
1273
|
// `hitSlop`, so a pointer target smaller than the floor cannot be widened any other way.
|
|
1274
1274
|
minHeight: a11y.MIN_TOUCH_TARGET_PX
|
|
1275
1275
|
},
|
|
1276
|
+
switchSlot: {
|
|
1277
|
+
minWidth: a11y.MIN_TOUCH_TARGET_PX,
|
|
1278
|
+
minHeight: a11y.MIN_TOUCH_TARGET_PX,
|
|
1279
|
+
alignItems: "center",
|
|
1280
|
+
justifyContent: "center"
|
|
1281
|
+
},
|
|
1276
1282
|
textColumn: {
|
|
1277
1283
|
flex: 1
|
|
1278
1284
|
},
|
|
@@ -1326,7 +1332,7 @@ var FormSwitch = ({
|
|
|
1326
1332
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.label, themeStyles.label], children: label }),
|
|
1327
1333
|
hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.description, themeStyles.description], children: description }) : null
|
|
1328
1334
|
] }),
|
|
1329
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1335
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style: styles6.switchSlot, testID: `${testID}-hitbox`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1330
1336
|
reactNative.Switch,
|
|
1331
1337
|
{
|
|
1332
1338
|
accessibilityHint: accessibilityHint ?? label,
|