@wistia/vhs 3.0.0 → 3.0.1-beta.5af3ebb3.c232538
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.cjs +52 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +58 -73
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -20
package/dist/index.d.mts
CHANGED
|
@@ -512,7 +512,7 @@ declare const Link: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps
|
|
|
512
512
|
* The visual type of Link to display
|
|
513
513
|
*/
|
|
514
514
|
variant?: "dangerous" | "primary" | "secondary";
|
|
515
|
-
} & react.RefAttributes<
|
|
515
|
+
} & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
516
516
|
|
|
517
517
|
type WrapperProviderLinkType = ((props: DefaultLinkWrapperProps) => JSX.Element) | undefined;
|
|
518
518
|
|
|
@@ -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?: () =>
|
|
1361
|
+
beforeAction?: (() => Promise<void>) | (() => void);
|
|
1362
1362
|
/**
|
|
1363
1363
|
* The content that will be rendered inside the button
|
|
1364
1364
|
*/
|
|
@@ -1444,7 +1444,7 @@ type ButtonLinkProps = ComponentPropsWithRef<'a'> & {
|
|
|
1444
1444
|
* **Note:** the props table below is incomplete; please
|
|
1445
1445
|
* refer to [Link](?path=/docs/link--link-stories) for additional props.
|
|
1446
1446
|
*/
|
|
1447
|
-
declare const ButtonLink: react.ForwardRefExoticComponent<Omit<ButtonLinkProps, "ref"> & react.RefAttributes<
|
|
1447
|
+
declare const ButtonLink: react.ForwardRefExoticComponent<Omit<ButtonLinkProps, "ref"> & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
1448
1448
|
|
|
1449
1449
|
type CheckboxProps = Omit<ComponentPropsWithRef<'label'>, 'onChange'> & {
|
|
1450
1450
|
/**
|
|
@@ -2389,7 +2389,7 @@ type MenuPropsWithLabel = DefaultMenuProps & {
|
|
|
2389
2389
|
type MenuPropsWithCustomTrigger = DefaultMenuProps & {
|
|
2390
2390
|
label?: never;
|
|
2391
2391
|
/** Replace the default trigger */
|
|
2392
|
-
trigger:
|
|
2392
|
+
trigger: JSX.Element;
|
|
2393
2393
|
};
|
|
2394
2394
|
type MenuProps = MenuPropsWithCustomTrigger | MenuPropsWithLabel;
|
|
2395
2395
|
declare const Menu: {
|
package/dist/index.d.ts
CHANGED
|
@@ -512,7 +512,7 @@ declare const Link: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps
|
|
|
512
512
|
* The visual type of Link to display
|
|
513
513
|
*/
|
|
514
514
|
variant?: "dangerous" | "primary" | "secondary";
|
|
515
|
-
} & react.RefAttributes<
|
|
515
|
+
} & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
516
516
|
|
|
517
517
|
type WrapperProviderLinkType = ((props: DefaultLinkWrapperProps) => JSX.Element) | undefined;
|
|
518
518
|
|
|
@@ -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?: () =>
|
|
1361
|
+
beforeAction?: (() => Promise<void>) | (() => void);
|
|
1362
1362
|
/**
|
|
1363
1363
|
* The content that will be rendered inside the button
|
|
1364
1364
|
*/
|
|
@@ -1444,7 +1444,7 @@ type ButtonLinkProps = ComponentPropsWithRef<'a'> & {
|
|
|
1444
1444
|
* **Note:** the props table below is incomplete; please
|
|
1445
1445
|
* refer to [Link](?path=/docs/link--link-stories) for additional props.
|
|
1446
1446
|
*/
|
|
1447
|
-
declare const ButtonLink: react.ForwardRefExoticComponent<Omit<ButtonLinkProps, "ref"> & react.RefAttributes<
|
|
1447
|
+
declare const ButtonLink: react.ForwardRefExoticComponent<Omit<ButtonLinkProps, "ref"> & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
1448
1448
|
|
|
1449
1449
|
type CheckboxProps = Omit<ComponentPropsWithRef<'label'>, 'onChange'> & {
|
|
1450
1450
|
/**
|
|
@@ -2389,7 +2389,7 @@ type MenuPropsWithLabel = DefaultMenuProps & {
|
|
|
2389
2389
|
type MenuPropsWithCustomTrigger = DefaultMenuProps & {
|
|
2390
2390
|
label?: never;
|
|
2391
2391
|
/** Replace the default trigger */
|
|
2392
|
-
trigger:
|
|
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.
|
|
3
|
+
* @license @wistia/vhs v3.0.1-beta.5af3ebb3.c232538
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -6549,45 +6549,39 @@ var ButtonLink = forwardRef6(
|
|
|
6549
6549
|
}
|
|
6550
6550
|
return null;
|
|
6551
6551
|
};
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
children: getContent()
|
|
6586
|
-
}
|
|
6587
|
-
)
|
|
6588
|
-
}
|
|
6589
|
-
)
|
|
6590
|
-
);
|
|
6552
|
+
const styledProps = {
|
|
6553
|
+
ref,
|
|
6554
|
+
$buttonColor: buttonColor,
|
|
6555
|
+
$forceState: forceState,
|
|
6556
|
+
$fullWidth: fullWidth,
|
|
6557
|
+
$icon: icon,
|
|
6558
|
+
$iconPosition: iconPosition,
|
|
6559
|
+
$isLoading: false,
|
|
6560
|
+
$labelWrap: labelWrap,
|
|
6561
|
+
$size: size,
|
|
6562
|
+
$square: square,
|
|
6563
|
+
$textAlign: textAlign,
|
|
6564
|
+
$variant: variant,
|
|
6565
|
+
beforeAction,
|
|
6566
|
+
disabled,
|
|
6567
|
+
href,
|
|
6568
|
+
params,
|
|
6569
|
+
type,
|
|
6570
|
+
unstyled: true,
|
|
6571
|
+
...otherProps
|
|
6572
|
+
};
|
|
6573
|
+
return /* @__PURE__ */ jsx140(StyledButtonLink, { ...styledProps, children: /* @__PURE__ */ jsx140(
|
|
6574
|
+
ButtonContent,
|
|
6575
|
+
{
|
|
6576
|
+
icon,
|
|
6577
|
+
iconName,
|
|
6578
|
+
iconPosition,
|
|
6579
|
+
isLoading: false,
|
|
6580
|
+
size,
|
|
6581
|
+
textAlign,
|
|
6582
|
+
children: getContent()
|
|
6583
|
+
}
|
|
6584
|
+
) });
|
|
6591
6585
|
}
|
|
6592
6586
|
);
|
|
6593
6587
|
ButtonLink.displayName = "ButtonLink_VHS";
|
|
@@ -10842,7 +10836,7 @@ import {
|
|
|
10842
10836
|
DropdownMenuItemIndicator,
|
|
10843
10837
|
DropdownMenuSubTrigger
|
|
10844
10838
|
} from "@radix-ui/react-dropdown-menu";
|
|
10845
|
-
import { isNonEmptyString as isNonEmptyString13, isNotNil as isNotNil31, isNotUndefined as isNotUndefined13
|
|
10839
|
+
import { isNonEmptyString as isNonEmptyString13, isNotNil as isNotNil31, isNotUndefined as isNotUndefined13 } from "@wistia/type-guards";
|
|
10846
10840
|
import styled51, { css as css24 } from "styled-components";
|
|
10847
10841
|
import { darken as darken5 } from "polished";
|
|
10848
10842
|
import { jsx as jsx194, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
@@ -10953,10 +10947,7 @@ var MenuItem = ({
|
|
|
10953
10947
|
variant = "primary",
|
|
10954
10948
|
...props
|
|
10955
10949
|
}) => {
|
|
10956
|
-
|
|
10957
|
-
if (isUndefined3(renderAs)) {
|
|
10958
|
-
as = isNotUndefined13(href) ? "a" : "div";
|
|
10959
|
-
}
|
|
10950
|
+
const as = renderAs ?? (isNotUndefined13(href) ? "a" : "div");
|
|
10960
10951
|
const targetProp = as === "a" && isNonEmptyString13(target) ? { target } : {};
|
|
10961
10952
|
return /* @__PURE__ */ jsx194(
|
|
10962
10953
|
DropdownMenuItem,
|
|
@@ -12417,7 +12408,7 @@ RangeSelectorCalendar.displayName = "RangeSelectorCalendar";
|
|
|
12417
12408
|
import { useCallback as useCallback14, useEffect as useEffect23, useRef as useRef15, useState as useState23 } from "react";
|
|
12418
12409
|
import styled65 from "styled-components";
|
|
12419
12410
|
import { endOfDay as endOfDay3 } from "date-fns";
|
|
12420
|
-
import { isNotUndefined as isNotUndefined17, isUndefined as
|
|
12411
|
+
import { isNotUndefined as isNotUndefined17, isUndefined as isUndefined4, isNotNil as isNotNil41 } from "@wistia/type-guards";
|
|
12421
12412
|
|
|
12422
12413
|
// src/private/components/RangeSelectorInput/ErrorMessages.tsx
|
|
12423
12414
|
import styled64 from "styled-components";
|
|
@@ -12626,7 +12617,7 @@ var orderRange = (range) => {
|
|
|
12626
12617
|
};
|
|
12627
12618
|
|
|
12628
12619
|
// src/private/components/RangeSelectorInput/selection.ts
|
|
12629
|
-
import { isNotUndefined as isNotUndefined16, isUndefined as
|
|
12620
|
+
import { isNotUndefined as isNotUndefined16, isUndefined as isUndefined3, isNotNil as isNotNil40 } from "@wistia/type-guards";
|
|
12630
12621
|
var getCursorPosition = (ref) => {
|
|
12631
12622
|
const startPos = ref.current?.selectionStart;
|
|
12632
12623
|
const endPos = ref.current?.selectionEnd;
|
|
@@ -12653,7 +12644,7 @@ var getSelectionFromMove = (selection, move, positions) => {
|
|
|
12653
12644
|
var getSelectionFromCursor = (ref, positions) => {
|
|
12654
12645
|
const pos = getCursorPosition(ref);
|
|
12655
12646
|
for (let i = 0; i < positions.length; i++) {
|
|
12656
|
-
if (
|
|
12647
|
+
if (isUndefined3(positions[i])) {
|
|
12657
12648
|
return [];
|
|
12658
12649
|
}
|
|
12659
12650
|
const { start, end, type } = positions[i];
|
|
@@ -12671,7 +12662,7 @@ var getFirstDefaultPosition = (value) => {
|
|
|
12671
12662
|
const dvp = getValueParts(INITIAL_VALUE);
|
|
12672
12663
|
const parts = ["month1", "day1", "year1", "month2", "day2", "year2"];
|
|
12673
12664
|
for (let i = 0; i < parts.length; i++) {
|
|
12674
|
-
if (
|
|
12665
|
+
if (isUndefined3(parts[i])) {
|
|
12675
12666
|
return -1;
|
|
12676
12667
|
}
|
|
12677
12668
|
if (vp[parts[i]] === dvp[parts[i]]) {
|
|
@@ -12848,7 +12839,7 @@ var RangeSelectorInput = ({
|
|
|
12848
12839
|
const [errorMessages, setErrorMessages] = useState23([]);
|
|
12849
12840
|
const ref = useRef15(null);
|
|
12850
12841
|
const [currentSelection, setCurrentSelection] = useState23([0, -1]);
|
|
12851
|
-
const selectionLength =
|
|
12842
|
+
const selectionLength = isUndefined4(currentSelection) || isUndefined4(currentSelection[1]) || isUndefined4(currentSelection[0]) ? 0 : currentSelection[1] - currentSelection[0];
|
|
12852
12843
|
const valueParts = getValueParts(value);
|
|
12853
12844
|
const applyChange = useCallback14(
|
|
12854
12845
|
(nextRange) => {
|
|
@@ -13391,32 +13382,26 @@ var Slider = ({
|
|
|
13391
13382
|
);
|
|
13392
13383
|
},
|
|
13393
13384
|
renderThumb: (thumbProps, thumbState) => {
|
|
13394
|
-
const { key, ...restProps } = thumbProps;
|
|
13395
|
-
return (
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
{
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
},
|
|
13403
|
-
key
|
|
13404
|
-
)
|
|
13385
|
+
const { key, as, ...restProps } = thumbProps;
|
|
13386
|
+
return /* @__PURE__ */ jsx209(
|
|
13387
|
+
StyledThumb,
|
|
13388
|
+
{
|
|
13389
|
+
...restProps,
|
|
13390
|
+
"data-testid": `${dataTestId}-thumb-${thumbState.index}`
|
|
13391
|
+
},
|
|
13392
|
+
key
|
|
13405
13393
|
);
|
|
13406
13394
|
},
|
|
13407
13395
|
renderTrack: (trackProps, trackState) => {
|
|
13408
|
-
const { key, ...restProps } = trackProps;
|
|
13409
|
-
return (
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13415
|
-
|
|
13416
|
-
|
|
13417
|
-
},
|
|
13418
|
-
key
|
|
13419
|
-
)
|
|
13396
|
+
const { key, as, ...restProps } = trackProps;
|
|
13397
|
+
return /* @__PURE__ */ jsx209(
|
|
13398
|
+
StyledTrack,
|
|
13399
|
+
{
|
|
13400
|
+
...restProps,
|
|
13401
|
+
$isFilledTrack: checkIfFilledTrack(trackState),
|
|
13402
|
+
"data-testid": `${dataTestId}-track-${trackState.index}`
|
|
13403
|
+
},
|
|
13404
|
+
key
|
|
13420
13405
|
);
|
|
13421
13406
|
},
|
|
13422
13407
|
step,
|