@wistia/ui 0.8.26-beta.eca3d970.0a51bfe → 0.8.27

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
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.8.26-beta.eca3d970.0a51bfe
3
+ * @license @wistia/ui v0.8.27
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -8369,6 +8369,11 @@ Checkbox.displayName = "Checkbox";
8369
8369
 
8370
8370
  // src/components/ClickRegion/ClickRegion.tsx
8371
8371
  import { Children as Children3, cloneElement as cloneElement3, useCallback as useCallback8, useEffect as useEffect8 } from "react";
8372
+ var isClickableElement = (element) => {
8373
+ if (!element) return false;
8374
+ const el = element;
8375
+ return el.closest("button") !== null || el.closest("a") !== null || el.closest("input") !== null || el.closest("select") !== null || el.closest("textarea") !== null || el.closest("label") !== null || el.closest("[data-wui-faux-input]") !== null;
8376
+ };
8372
8377
  var ClickRegion = ({ children, targetRef }) => {
8373
8378
  useEffect8(() => {
8374
8379
  if (targetRef.current && targetRef.current.tagName === "A") {
@@ -8381,7 +8386,10 @@ var ClickRegion = ({ children, targetRef }) => {
8381
8386
  const handleClick = useCallback8(
8382
8387
  (event) => {
8383
8388
  const node = targetRef.current;
8384
- if (event.target instanceof HTMLAnchorElement && !event.target.hasAttribute("data-click-region-target-link") || event.target instanceof HTMLButtonElement && !event.target.hasAttribute("data-click-region-target-button")) {
8389
+ if (event.target === node) {
8390
+ return;
8391
+ }
8392
+ if (isClickableElement(event.target) && event.target !== node) {
8385
8393
  event.stopPropagation();
8386
8394
  return;
8387
8395
  }