@wistia/vhs 3.0.0-beta.8cc6ddc1.61c0e71 → 3.0.0-beta.d266577b.54a8aff

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
@@ -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?: (() => Promise<void>) | (() => void);
1361
+ beforeAction?: () => unknown;
1362
1362
  /**
1363
1363
  * The content that will be rendered inside the button
1364
1364
  */
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?: (() => Promise<void>) | (() => void);
1361
+ beforeAction?: () => unknown;
1362
1362
  /**
1363
1363
  * The content that will be rendered inside the button
1364
1364
  */
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/vhs v3.0.0-beta.8cc6ddc1.61c0e71
3
+ * @license @wistia/vhs v3.0.0-beta.d266577b.54a8aff
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 } from "@wistia/type-guards";
10845
+ import { isNonEmptyString as isNonEmptyString13, isNotNil as isNotNil31, isNotUndefined as isNotUndefined13, isUndefined as isUndefined3 } 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,7 +10953,10 @@ var MenuItem = ({
10953
10953
  variant = "primary",
10954
10954
  ...props
10955
10955
  }) => {
10956
- const as = renderAs ?? (isNotUndefined13(href) ? "a" : "div");
10956
+ let as = renderAs;
10957
+ if (isUndefined3(renderAs)) {
10958
+ as = isNotUndefined13(href) ? "a" : "div";
10959
+ }
10957
10960
  const targetProp = as === "a" && isNonEmptyString13(target) ? { target } : {};
10958
10961
  return /* @__PURE__ */ jsx194(
10959
10962
  DropdownMenuItem,
@@ -12414,7 +12417,7 @@ RangeSelectorCalendar.displayName = "RangeSelectorCalendar";
12414
12417
  import { useCallback as useCallback14, useEffect as useEffect23, useRef as useRef15, useState as useState23 } from "react";
12415
12418
  import styled65 from "styled-components";
12416
12419
  import { endOfDay as endOfDay3 } from "date-fns";
12417
- import { isNotUndefined as isNotUndefined17, isUndefined as isUndefined4, isNotNil as isNotNil41 } from "@wistia/type-guards";
12420
+ import { isNotUndefined as isNotUndefined17, isUndefined as isUndefined5, isNotNil as isNotNil41 } from "@wistia/type-guards";
12418
12421
 
12419
12422
  // src/private/components/RangeSelectorInput/ErrorMessages.tsx
12420
12423
  import styled64 from "styled-components";
@@ -12623,7 +12626,7 @@ var orderRange = (range) => {
12623
12626
  };
12624
12627
 
12625
12628
  // src/private/components/RangeSelectorInput/selection.ts
12626
- import { isNotUndefined as isNotUndefined16, isUndefined as isUndefined3, isNotNil as isNotNil40 } from "@wistia/type-guards";
12629
+ import { isNotUndefined as isNotUndefined16, isUndefined as isUndefined4, isNotNil as isNotNil40 } from "@wistia/type-guards";
12627
12630
  var getCursorPosition = (ref) => {
12628
12631
  const startPos = ref.current?.selectionStart;
12629
12632
  const endPos = ref.current?.selectionEnd;
@@ -12650,7 +12653,7 @@ var getSelectionFromMove = (selection, move, positions) => {
12650
12653
  var getSelectionFromCursor = (ref, positions) => {
12651
12654
  const pos = getCursorPosition(ref);
12652
12655
  for (let i = 0; i < positions.length; i++) {
12653
- if (isUndefined3(positions[i])) {
12656
+ if (isUndefined4(positions[i])) {
12654
12657
  return [];
12655
12658
  }
12656
12659
  const { start, end, type } = positions[i];
@@ -12668,7 +12671,7 @@ var getFirstDefaultPosition = (value) => {
12668
12671
  const dvp = getValueParts(INITIAL_VALUE);
12669
12672
  const parts = ["month1", "day1", "year1", "month2", "day2", "year2"];
12670
12673
  for (let i = 0; i < parts.length; i++) {
12671
- if (isUndefined3(parts[i])) {
12674
+ if (isUndefined4(parts[i])) {
12672
12675
  return -1;
12673
12676
  }
12674
12677
  if (vp[parts[i]] === dvp[parts[i]]) {
@@ -12845,7 +12848,7 @@ var RangeSelectorInput = ({
12845
12848
  const [errorMessages, setErrorMessages] = useState23([]);
12846
12849
  const ref = useRef15(null);
12847
12850
  const [currentSelection, setCurrentSelection] = useState23([0, -1]);
12848
- const selectionLength = isUndefined4(currentSelection) || isUndefined4(currentSelection[1]) || isUndefined4(currentSelection[0]) ? 0 : currentSelection[1] - currentSelection[0];
12851
+ const selectionLength = isUndefined5(currentSelection) || isUndefined5(currentSelection[1]) || isUndefined5(currentSelection[0]) ? 0 : currentSelection[1] - currentSelection[0];
12849
12852
  const valueParts = getValueParts(value);
12850
12853
  const applyChange = useCallback14(
12851
12854
  (nextRange) => {
@@ -13388,26 +13391,32 @@ var Slider = ({
13388
13391
  );
13389
13392
  },
13390
13393
  renderThumb: (thumbProps, thumbState) => {
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
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
+ )
13399
13405
  );
13400
13406
  },
13401
13407
  renderTrack: (trackProps, trackState) => {
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
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
+ )
13411
13420
  );
13412
13421
  },
13413
13422
  step,