@dloizides/ui-layout 1.36.0 → 1.36.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/dist/index.js CHANGED
@@ -2455,6 +2455,19 @@ var RowSelectedStyle = /* @__PURE__ */ ((RowSelectedStyle2) => {
2455
2455
  return RowSelectedStyle2;
2456
2456
  })(RowSelectedStyle || {});
2457
2457
 
2458
+ // src/ListRow/utils/focusVisible.ts
2459
+ function canMatch(target) {
2460
+ return typeof target === "object" && target !== null && typeof target.matches === "function";
2461
+ }
2462
+ function isFocusVisible(target) {
2463
+ if (!canMatch(target)) return true;
2464
+ try {
2465
+ return target.matches(":focus-visible");
2466
+ } catch {
2467
+ return true;
2468
+ }
2469
+ }
2470
+
2458
2471
  // src/ListRow/utils/rowLook.ts
2459
2472
  var BAR_WIDTH = 4;
2460
2473
  var OUTLINE_WIDTH = 2;
@@ -2549,6 +2562,9 @@ var styles22 = reactNative.StyleSheet.create({
2549
2562
  function pressedProps(selected) {
2550
2563
  return { "aria-pressed": selected };
2551
2564
  }
2565
+ function focusTarget(event) {
2566
+ return event?.nativeEvent?.target;
2567
+ }
2552
2568
  function slot(node, color, strong) {
2553
2569
  if (typeof node !== "string") return node;
2554
2570
  return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles22.shrink, strong ? styles22.strong : null, { color }], children: node });
@@ -2589,8 +2605,8 @@ var ListRow = ({
2589
2605
  onBlur: () => {
2590
2606
  setFocused(false);
2591
2607
  },
2592
- onFocus: () => {
2593
- setFocused(true);
2608
+ onFocus: (event) => {
2609
+ setFocused(isFocusVisible(focusTarget(event)));
2594
2610
  },
2595
2611
  onPress,
2596
2612
  ...pressedProps(selected),