@wistia/vhs 3.0.0-beta.e44cd07a.b6b08c6 → 3.0.0-beta.f99f584e.f50819f

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.d.mts CHANGED
@@ -546,7 +546,7 @@ type Rect = {
546
546
  x: number;
547
547
  y: number;
548
548
  };
549
- declare const useElementObserver: <T extends HTMLElement>() => [RefObject<T | null>, Rect];
549
+ declare const useElementObserver: <T extends HTMLElement>() => [RefObject<T>, Rect];
550
550
 
551
551
  type AddEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
552
552
  type RemoveEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
@@ -554,7 +554,7 @@ declare const useEvent: <T extends Event>(eventName: Parameters<AddEventListener
554
554
 
555
555
  type UseFocusTrapOptions = {
556
556
  disableAriaHider?: boolean;
557
- focusSelector?: HTMLElement | RefObject<HTMLElement | null> | string | null | undefined;
557
+ focusSelector?: HTMLElement | RefObject<HTMLElement> | string | null | undefined;
558
558
  };
559
559
  declare const useFocusTrap: (active?: boolean, options?: UseFocusTrapOptions) => (node: HTMLElement | null | undefined) => void;
560
560
 
@@ -2389,7 +2389,7 @@ type MenuPropsWithLabel = DefaultMenuProps & {
2389
2389
  type MenuPropsWithCustomTrigger = DefaultMenuProps & {
2390
2390
  label?: never;
2391
2391
  /** Replace the default trigger */
2392
- trigger: ReactNode;
2392
+ trigger: JSX.Element;
2393
2393
  };
2394
2394
  type MenuProps = MenuPropsWithCustomTrigger | MenuPropsWithLabel;
2395
2395
  declare const Menu: {
@@ -2531,7 +2531,7 @@ type ModalProps = ComponentPropsWithoutRef<'div'> & {
2531
2531
  /**
2532
2532
  * Ref to the element that should receive focus when the modal opens
2533
2533
  */
2534
- initialFocusRef?: RefObject<HTMLElement | null>;
2534
+ initialFocusRef?: RefObject<HTMLElement>;
2535
2535
  /**
2536
2536
  * Whether or not the modal is open, and should be rendered
2537
2537
  */
package/dist/index.d.ts CHANGED
@@ -546,7 +546,7 @@ type Rect = {
546
546
  x: number;
547
547
  y: number;
548
548
  };
549
- declare const useElementObserver: <T extends HTMLElement>() => [RefObject<T | null>, Rect];
549
+ declare const useElementObserver: <T extends HTMLElement>() => [RefObject<T>, Rect];
550
550
 
551
551
  type AddEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
552
552
  type RemoveEventListenerType = (type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions | boolean) => void;
@@ -554,7 +554,7 @@ declare const useEvent: <T extends Event>(eventName: Parameters<AddEventListener
554
554
 
555
555
  type UseFocusTrapOptions = {
556
556
  disableAriaHider?: boolean;
557
- focusSelector?: HTMLElement | RefObject<HTMLElement | null> | string | null | undefined;
557
+ focusSelector?: HTMLElement | RefObject<HTMLElement> | string | null | undefined;
558
558
  };
559
559
  declare const useFocusTrap: (active?: boolean, options?: UseFocusTrapOptions) => (node: HTMLElement | null | undefined) => void;
560
560
 
@@ -2389,7 +2389,7 @@ type MenuPropsWithLabel = DefaultMenuProps & {
2389
2389
  type MenuPropsWithCustomTrigger = DefaultMenuProps & {
2390
2390
  label?: never;
2391
2391
  /** Replace the default trigger */
2392
- trigger: ReactNode;
2392
+ trigger: JSX.Element;
2393
2393
  };
2394
2394
  type MenuProps = MenuPropsWithCustomTrigger | MenuPropsWithLabel;
2395
2395
  declare const Menu: {
@@ -2531,7 +2531,7 @@ type ModalProps = ComponentPropsWithoutRef<'div'> & {
2531
2531
  /**
2532
2532
  * Ref to the element that should receive focus when the modal opens
2533
2533
  */
2534
- initialFocusRef?: RefObject<HTMLElement | null>;
2534
+ initialFocusRef?: RefObject<HTMLElement>;
2535
2535
  /**
2536
2536
  * Whether or not the modal is open, and should be rendered
2537
2537
  */
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/vhs v3.0.0-beta.e44cd07a.b6b08c6
3
+ * @license @wistia/vhs v3.0.0-beta.f99f584e.f50819f
4
4
  *
5
5
  * Copyright (c) 2021-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -3937,7 +3937,7 @@ import { useCallback as useCallback5 } from "react";
3937
3937
  import { useEffect as useEffect2, useRef as useRef2, useState as useState5 } from "react";
3938
3938
  var useTimedToggle = (initialValue) => {
3939
3939
  const [value, setValue] = useState5(false);
3940
- const timeoutRef = useRef2(void 0);
3940
+ const timeoutRef = useRef2();
3941
3941
  const initialValueRef = useRef2(initialValue);
3942
3942
  const toggleValue = (timeout2) => {
3943
3943
  clearTimeout(timeoutRef.current);
@@ -4010,8 +4010,8 @@ var isEventTargetSupported = (eventTarget) => (
4010
4010
  Boolean(typeof eventTarget === "object" && eventTarget?.addEventListener)
4011
4011
  );
4012
4012
  var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}) => {
4013
- const savedEventHandler = useRef4(void 0);
4014
- const savedEventOptions = useRef4(void 0);
4013
+ const savedEventHandler = useRef4();
4014
+ const savedEventOptions = useRef4();
4015
4015
  useEffect3(() => {
4016
4016
  savedEventHandler.current = eventHandler;
4017
4017
  }, [eventHandler]);
@@ -4448,7 +4448,7 @@ var usePreventScroll = (locked) => {
4448
4448
  // src/hooks/usePreviousValue/usePreviousValue.ts
4449
4449
  import { useEffect as useEffect7, useRef as useRef7 } from "react";
4450
4450
  var usePreviousValue = (value) => {
4451
- const ref = useRef7(void 0);
4451
+ const ref = useRef7();
4452
4452
  useEffect7(() => {
4453
4453
  ref.current = value;
4454
4454
  });
@@ -4545,7 +4545,7 @@ var ModalBaseContent = ({
4545
4545
  const wasJustShown = usePreviousValue(isShown);
4546
4546
  const hide = () => setIsShownAttempted(false);
4547
4547
  const show = useCallback8(() => setIsShownAttempted(true), []);
4548
- const toggleButtonRef = useRef8(void 0);
4548
+ const toggleButtonRef = useRef8();
4549
4549
  const modalEl = document.createElement("div");
4550
4550
  modalEl.classList.add("Modal");
4551
4551
  if (isNotUndefined2(className)) {
@@ -7561,7 +7561,7 @@ import { useEffect as useEffect13 } from "react";
7561
7561
  import { useCallback as useCallback10, useEffect as useEffect12, useRef as useRef10 } from "react";
7562
7562
  var useTimeoutFunc = (func, timeout2 = 0) => {
7563
7563
  const readyRef = useRef10(false);
7564
- const timeoutRef = useRef10(void 0);
7564
+ const timeoutRef = useRef10();
7565
7565
  const callbackRef = useRef10(func);
7566
7566
  const isReady = useCallback10(() => readyRef.current, []);
7567
7567
  const set = useCallback10(() => {
@@ -11316,7 +11316,7 @@ var Menu2 = forwardRef16(
11316
11316
  onClose,
11317
11317
  ...otherProps
11318
11318
  }, ref) => {
11319
- const menuRef = useRef12(void 0);
11319
+ const menuRef = useRef12();
11320
11320
  const onClickOutsideFn = isNotNil32(onClickOutside) ? onClickOutside : () => {
11321
11321
  };
11322
11322
  useOnClickOutside(menuRef, onClickOutsideFn);