@lumx/react 3.6.5-alpha.2 → 3.6.5-alpha.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/package.json CHANGED
@@ -7,8 +7,8 @@
7
7
  },
8
8
  "dependencies": {
9
9
  "@juggle/resize-observer": "^3.2.0",
10
- "@lumx/core": "^3.6.5-alpha.2",
11
- "@lumx/icons": "^3.6.5-alpha.2",
10
+ "@lumx/core": "^3.6.5-alpha.3",
11
+ "@lumx/icons": "^3.6.5-alpha.3",
12
12
  "@popperjs/core": "^2.5.4",
13
13
  "body-scroll-lock": "^3.1.5",
14
14
  "classnames": "^2.3.2",
@@ -112,5 +112,5 @@
112
112
  "build:storybook": "storybook build"
113
113
  },
114
114
  "sideEffects": false,
115
- "version": "3.6.5-alpha.2"
115
+ "version": "3.6.5-alpha.3"
116
116
  }
@@ -5,7 +5,7 @@ import { useMergeRefs } from '@lumx/react/utils/mergeRefs';
5
5
  /**
6
6
  * Add ref and ARIA attribute(s) in tooltip children or wrapped children.
7
7
  * Button, IconButton, Icon and React HTML elements don't need to be wrapped but any other kind of children (array, fragment, custom components)
8
- * will be wrapped in a <span>.
8
+ * will be wrapped.
9
9
  *
10
10
  * @param children Original tooltip anchor.
11
11
  * @param setAnchorElement Set tooltip anchor element.
@@ -43,5 +43,5 @@ export const useInjectTooltipRef = (
43
43
  {children}
44
44
  </div>
45
45
  );
46
- }, [element, children, setAnchorElement, isOpen, id, ref, label]);
46
+ }, [element, children, isOpen, id, ref, label]);
47
47
  };
@@ -1,3 +1,9 @@
1
1
  /** Check if the focus is visible on the given element */
2
- export const isFocusVisible = (element?: HTMLElement) =>
3
- element?.matches?.(':focus-visible, [data-focus-visible-added]');
2
+ export const isFocusVisible = (element?: HTMLElement) => {
3
+ try {
4
+ return element?.matches?.(':focus-visible, [data-focus-visible-added]');
5
+ } catch (_ignored) {
6
+ // Can fail on non browser env
7
+ return false;
8
+ }
9
+ };