@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.mjs CHANGED
@@ -2449,6 +2449,19 @@ var RowSelectedStyle = /* @__PURE__ */ ((RowSelectedStyle2) => {
2449
2449
  return RowSelectedStyle2;
2450
2450
  })(RowSelectedStyle || {});
2451
2451
 
2452
+ // src/ListRow/utils/focusVisible.ts
2453
+ function canMatch(target) {
2454
+ return typeof target === "object" && target !== null && typeof target.matches === "function";
2455
+ }
2456
+ function isFocusVisible(target) {
2457
+ if (!canMatch(target)) return true;
2458
+ try {
2459
+ return target.matches(":focus-visible");
2460
+ } catch {
2461
+ return true;
2462
+ }
2463
+ }
2464
+
2452
2465
  // src/ListRow/utils/rowLook.ts
2453
2466
  var BAR_WIDTH = 4;
2454
2467
  var OUTLINE_WIDTH = 2;
@@ -2543,6 +2556,9 @@ var styles22 = StyleSheet.create({
2543
2556
  function pressedProps(selected) {
2544
2557
  return { "aria-pressed": selected };
2545
2558
  }
2559
+ function focusTarget(event) {
2560
+ return event?.nativeEvent?.target;
2561
+ }
2546
2562
  function slot(node, color, strong) {
2547
2563
  if (typeof node !== "string") return node;
2548
2564
  return /* @__PURE__ */ jsx(Text, { style: [styles22.shrink, strong ? styles22.strong : null, { color }], children: node });
@@ -2583,8 +2599,8 @@ var ListRow = ({
2583
2599
  onBlur: () => {
2584
2600
  setFocused(false);
2585
2601
  },
2586
- onFocus: () => {
2587
- setFocused(true);
2602
+ onFocus: (event) => {
2603
+ setFocused(isFocusVisible(focusTarget(event)));
2588
2604
  },
2589
2605
  onPress,
2590
2606
  ...pressedProps(selected),