@wistia/vhs 3.0.0-beta.ff894fc0.6b12330 → 3.0.1-beta.2845005a.68f1236

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.
@@ -1358,7 +1358,7 @@ type ButtonLinkProps = ComponentPropsWithRef<'a'> & {
1358
1358
  * A Promise to invoke before navigating to location.
1359
1359
  * _Caution: if used with `external` type prop a new window will **not** be opened_
1360
1360
  */
1361
- beforeAction?: () => unknown;
1361
+ beforeAction?: (() => Promise<void>) | (() => void);
1362
1362
  /**
1363
1363
  * The content that will be rendered inside the button
1364
1364
  */
@@ -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: {
package/dist/index.d.ts CHANGED
@@ -1358,7 +1358,7 @@ type ButtonLinkProps = ComponentPropsWithRef<'a'> & {
1358
1358
  * A Promise to invoke before navigating to location.
1359
1359
  * _Caution: if used with `external` type prop a new window will **not** be opened_
1360
1360
  */
1361
- beforeAction?: () => unknown;
1361
+ beforeAction?: (() => Promise<void>) | (() => void);
1362
1362
  /**
1363
1363
  * The content that will be rendered inside the button
1364
1364
  */
@@ -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: {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/vhs v3.0.0-beta.ff894fc0.6b12330
3
+ * @license @wistia/vhs v3.0.1-beta.2845005a.68f1236
4
4
  *
5
5
  * Copyright (c) 2021-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -10842,7 +10842,7 @@ import {
10842
10842
  DropdownMenuItemIndicator,
10843
10843
  DropdownMenuSubTrigger
10844
10844
  } from "@radix-ui/react-dropdown-menu";
10845
- import { isNonEmptyString as isNonEmptyString13, isNotNil as isNotNil31, isNotUndefined as isNotUndefined13, isUndefined as isUndefined3 } from "@wistia/type-guards";
10845
+ import { isNonEmptyString as isNonEmptyString13, isNotNil as isNotNil31, isNotUndefined as isNotUndefined13 } from "@wistia/type-guards";
10846
10846
  import styled51, { css as css24 } from "styled-components";
10847
10847
  import { darken as darken5 } from "polished";
10848
10848
  import { jsx as jsx194, jsxs as jsxs35 } from "react/jsx-runtime";
@@ -10953,10 +10953,7 @@ var MenuItem = ({
10953
10953
  variant = "primary",
10954
10954
  ...props
10955
10955
  }) => {
10956
- let as = renderAs;
10957
- if (isUndefined3(renderAs)) {
10958
- as = isNotUndefined13(href) ? "a" : "div";
10959
- }
10956
+ const as = renderAs ?? (isNotUndefined13(href) ? "a" : "div");
10960
10957
  const targetProp = as === "a" && isNonEmptyString13(target) ? { target } : {};
10961
10958
  return /* @__PURE__ */ jsx194(
10962
10959
  DropdownMenuItem,
@@ -12417,7 +12414,7 @@ RangeSelectorCalendar.displayName = "RangeSelectorCalendar";
12417
12414
  import { useCallback as useCallback14, useEffect as useEffect23, useRef as useRef15, useState as useState23 } from "react";
12418
12415
  import styled65 from "styled-components";
12419
12416
  import { endOfDay as endOfDay3 } from "date-fns";
12420
- import { isNotUndefined as isNotUndefined17, isUndefined as isUndefined5, isNotNil as isNotNil41 } from "@wistia/type-guards";
12417
+ import { isNotUndefined as isNotUndefined17, isUndefined as isUndefined4, isNotNil as isNotNil41 } from "@wistia/type-guards";
12421
12418
 
12422
12419
  // src/private/components/RangeSelectorInput/ErrorMessages.tsx
12423
12420
  import styled64 from "styled-components";
@@ -12626,7 +12623,7 @@ var orderRange = (range) => {
12626
12623
  };
12627
12624
 
12628
12625
  // src/private/components/RangeSelectorInput/selection.ts
12629
- import { isNotUndefined as isNotUndefined16, isUndefined as isUndefined4, isNotNil as isNotNil40 } from "@wistia/type-guards";
12626
+ import { isNotUndefined as isNotUndefined16, isUndefined as isUndefined3, isNotNil as isNotNil40 } from "@wistia/type-guards";
12630
12627
  var getCursorPosition = (ref) => {
12631
12628
  const startPos = ref.current?.selectionStart;
12632
12629
  const endPos = ref.current?.selectionEnd;
@@ -12653,7 +12650,7 @@ var getSelectionFromMove = (selection, move, positions) => {
12653
12650
  var getSelectionFromCursor = (ref, positions) => {
12654
12651
  const pos = getCursorPosition(ref);
12655
12652
  for (let i = 0; i < positions.length; i++) {
12656
- if (isUndefined4(positions[i])) {
12653
+ if (isUndefined3(positions[i])) {
12657
12654
  return [];
12658
12655
  }
12659
12656
  const { start, end, type } = positions[i];
@@ -12671,7 +12668,7 @@ var getFirstDefaultPosition = (value) => {
12671
12668
  const dvp = getValueParts(INITIAL_VALUE);
12672
12669
  const parts = ["month1", "day1", "year1", "month2", "day2", "year2"];
12673
12670
  for (let i = 0; i < parts.length; i++) {
12674
- if (isUndefined4(parts[i])) {
12671
+ if (isUndefined3(parts[i])) {
12675
12672
  return -1;
12676
12673
  }
12677
12674
  if (vp[parts[i]] === dvp[parts[i]]) {
@@ -12848,7 +12845,7 @@ var RangeSelectorInput = ({
12848
12845
  const [errorMessages, setErrorMessages] = useState23([]);
12849
12846
  const ref = useRef15(null);
12850
12847
  const [currentSelection, setCurrentSelection] = useState23([0, -1]);
12851
- const selectionLength = isUndefined5(currentSelection) || isUndefined5(currentSelection[1]) || isUndefined5(currentSelection[0]) ? 0 : currentSelection[1] - currentSelection[0];
12848
+ const selectionLength = isUndefined4(currentSelection) || isUndefined4(currentSelection[1]) || isUndefined4(currentSelection[0]) ? 0 : currentSelection[1] - currentSelection[0];
12852
12849
  const valueParts = getValueParts(value);
12853
12850
  const applyChange = useCallback14(
12854
12851
  (nextRange) => {
@@ -13391,32 +13388,26 @@ var Slider = ({
13391
13388
  );
13392
13389
  },
13393
13390
  renderThumb: (thumbProps, thumbState) => {
13394
- const { key, ...restProps } = thumbProps;
13395
- return (
13396
- // @ts-expect-error complains about styled-components `as` prop
13397
- /* @__PURE__ */ jsx209(
13398
- StyledThumb,
13399
- {
13400
- ...restProps,
13401
- "data-testid": `${dataTestId}-thumb-${thumbState.index}`
13402
- },
13403
- key
13404
- )
13391
+ const { key, as, ...restProps } = thumbProps;
13392
+ return /* @__PURE__ */ jsx209(
13393
+ StyledThumb,
13394
+ {
13395
+ ...restProps,
13396
+ "data-testid": `${dataTestId}-thumb-${thumbState.index}`
13397
+ },
13398
+ key
13405
13399
  );
13406
13400
  },
13407
13401
  renderTrack: (trackProps, trackState) => {
13408
- const { key, ...restProps } = trackProps;
13409
- return (
13410
- // @ts-expect-error complains about styled-components `as` prop
13411
- /* @__PURE__ */ jsx209(
13412
- StyledTrack,
13413
- {
13414
- ...restProps,
13415
- $isFilledTrack: checkIfFilledTrack(trackState),
13416
- "data-testid": `${dataTestId}-track-${trackState.index}`
13417
- },
13418
- key
13419
- )
13402
+ const { key, as, ...restProps } = trackProps;
13403
+ return /* @__PURE__ */ jsx209(
13404
+ StyledTrack,
13405
+ {
13406
+ ...restProps,
13407
+ $isFilledTrack: checkIfFilledTrack(trackState),
13408
+ "data-testid": `${dataTestId}-track-${trackState.index}`
13409
+ },
13410
+ key
13420
13411
  );
13421
13412
  },
13422
13413
  step,