@wistia/ui 0.20.13 → 0.20.14-beta.205376ec.54074ac
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.ts +13 -1
- package/dist/index.js +113 -74
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -158,7 +158,11 @@ type UseKeyOptions = {
|
|
|
158
158
|
declare const useKey: (key: KeyFilter, eventHandler: EventHandler, { eventName, eventTarget, eventOptions }?: UseKeyOptions) => void;
|
|
159
159
|
|
|
160
160
|
type KeyPressState = [boolean, KeyboardEvent | null];
|
|
161
|
-
|
|
161
|
+
type UseKeyPressOptions = {
|
|
162
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
163
|
+
onKeyUp?: (event: KeyboardEvent) => void;
|
|
164
|
+
};
|
|
165
|
+
declare const useKeyPress: (keyFilter: Parameters<typeof useKey>[0], options?: UseKeyPressOptions) => KeyPressState;
|
|
162
166
|
|
|
163
167
|
type SetItemType = Storage['setItem'];
|
|
164
168
|
declare const useLocalStorage: <T, _>(key: Parameters<SetItemType>[0], initialValue: T, storage?: Storage) => [T | undefined, (newValue: T) => void, () => void];
|
|
@@ -240,6 +244,10 @@ type BaseProps$2 = {
|
|
|
240
244
|
* Disables the link
|
|
241
245
|
*/
|
|
242
246
|
disabled?: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* When true, the link will inherit its color from the parent element instead of using the default link color
|
|
249
|
+
*/
|
|
250
|
+
inheritColor?: boolean;
|
|
243
251
|
/**
|
|
244
252
|
* Icon to display on the left side of the link. Must be an instance of [Icon](?path=/docs/components-icon--docs)
|
|
245
253
|
*/
|
|
@@ -384,6 +392,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
|
|
|
384
392
|
children: ReactNode;
|
|
385
393
|
colorScheme?: ColorSchemeTypes;
|
|
386
394
|
disabled?: boolean;
|
|
395
|
+
inheritColor?: boolean;
|
|
387
396
|
leftIcon?: ReactNode | undefined;
|
|
388
397
|
rightIcon?: ReactNode | undefined;
|
|
389
398
|
type?: LinkTypes | undefined;
|
|
@@ -415,6 +424,7 @@ declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & re
|
|
|
415
424
|
children: ReactNode;
|
|
416
425
|
colorScheme?: ColorSchemeTypes;
|
|
417
426
|
disabled?: boolean;
|
|
427
|
+
inheritColor?: boolean;
|
|
418
428
|
leftIcon?: ReactNode | undefined;
|
|
419
429
|
rightIcon?: ReactNode | undefined;
|
|
420
430
|
type?: LinkTypes | undefined;
|
|
@@ -2936,6 +2946,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
|
|
|
2936
2946
|
children: react.ReactNode;
|
|
2937
2947
|
colorScheme?: ColorSchemeTypes;
|
|
2938
2948
|
disabled?: boolean;
|
|
2949
|
+
inheritColor?: boolean;
|
|
2939
2950
|
leftIcon?: react.ReactNode | undefined;
|
|
2940
2951
|
rightIcon?: react.ReactNode | undefined;
|
|
2941
2952
|
type?: LinkTypes | undefined;
|
|
@@ -2977,6 +2988,7 @@ declare const MenuItem: react.ForwardRefExoticComponent<(Omit<DropdownMenuItemPr
|
|
|
2977
2988
|
children: react.ReactNode;
|
|
2978
2989
|
colorScheme?: ColorSchemeTypes;
|
|
2979
2990
|
disabled?: boolean;
|
|
2991
|
+
inheritColor?: boolean;
|
|
2980
2992
|
leftIcon?: react.ReactNode | undefined;
|
|
2981
2993
|
rightIcon?: react.ReactNode | undefined;
|
|
2982
2994
|
type?: LinkTypes | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.20.
|
|
3
|
+
* @license @wistia/ui v0.20.14-beta.205376ec.54074ac
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -2934,11 +2934,42 @@ var useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOpti
|
|
|
2934
2934
|
|
|
2935
2935
|
// src/hooks/useKeyPress/useKeyPress.ts
|
|
2936
2936
|
import { useState as useState7 } from "react";
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2937
|
+
|
|
2938
|
+
// src/private/hooks/useUpdateEffect/useUpdateEffect.ts
|
|
2939
|
+
import { useEffect as useEffect5, useRef as useRef6 } from "react";
|
|
2940
|
+
var useUpdateEffect = (effect, dependencies) => {
|
|
2941
|
+
const isFirstMount = useRef6(true);
|
|
2942
|
+
useEffect5(() => {
|
|
2943
|
+
if (isFirstMount.current) {
|
|
2944
|
+
isFirstMount.current = false;
|
|
2945
|
+
return () => {
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
return effect();
|
|
2949
|
+
}, dependencies);
|
|
2950
|
+
};
|
|
2951
|
+
|
|
2952
|
+
// src/hooks/useKeyPress/useKeyPress.ts
|
|
2953
|
+
var useKeyPress = (keyFilter, options) => {
|
|
2954
|
+
const [keyPressState, setKeyPressState] = useState7([false, null]);
|
|
2955
|
+
const { onKeyDown, onKeyUp } = options ?? {};
|
|
2956
|
+
useKey(keyFilter, (event) => setKeyPressState([true, event]), {
|
|
2957
|
+
eventName: "keydown"
|
|
2958
|
+
});
|
|
2959
|
+
useKey(keyFilter, (event) => setKeyPressState([false, event]), {
|
|
2960
|
+
eventName: "keyup"
|
|
2961
|
+
});
|
|
2962
|
+
useUpdateEffect(() => {
|
|
2963
|
+
const [pressed, event] = keyPressState;
|
|
2964
|
+
if (!pressed && onKeyUp && event !== null) {
|
|
2965
|
+
onKeyUp(event);
|
|
2966
|
+
} else if (pressed && onKeyDown && event !== null) {
|
|
2967
|
+
onKeyDown(event);
|
|
2968
|
+
}
|
|
2969
|
+
return () => {
|
|
2970
|
+
};
|
|
2971
|
+
}, [keyPressState[0]]);
|
|
2972
|
+
return keyPressState;
|
|
2942
2973
|
};
|
|
2943
2974
|
|
|
2944
2975
|
// src/hooks/useLocalStorage/useLocalStorage.ts
|
|
@@ -3052,9 +3083,9 @@ var useActiveMq = () => {
|
|
|
3052
3083
|
};
|
|
3053
3084
|
|
|
3054
3085
|
// src/hooks/useOnClickOutside/useOnClickOutside.ts
|
|
3055
|
-
import { useEffect as
|
|
3086
|
+
import { useEffect as useEffect6 } from "react";
|
|
3056
3087
|
var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) => {
|
|
3057
|
-
|
|
3088
|
+
useEffect6(() => {
|
|
3058
3089
|
const listener = (event) => {
|
|
3059
3090
|
if (!ref.current || ref.current.contains(event.target)) {
|
|
3060
3091
|
return;
|
|
@@ -3081,10 +3112,10 @@ var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) =
|
|
|
3081
3112
|
};
|
|
3082
3113
|
|
|
3083
3114
|
// src/hooks/usePreviousValue/usePreviousValue.ts
|
|
3084
|
-
import { useEffect as
|
|
3115
|
+
import { useEffect as useEffect7, useRef as useRef7 } from "react";
|
|
3085
3116
|
var usePreviousValue = (value) => {
|
|
3086
|
-
const ref =
|
|
3087
|
-
|
|
3117
|
+
const ref = useRef7(void 0);
|
|
3118
|
+
useEffect7(() => {
|
|
3088
3119
|
ref.current = value;
|
|
3089
3120
|
});
|
|
3090
3121
|
return ref.current;
|
|
@@ -8051,7 +8082,11 @@ var StyledLink = styled5.a`
|
|
|
8051
8082
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8052
8083
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
8053
8084
|
font-family: inherit;
|
|
8054
|
-
color: ${({ $disabled }) =>
|
|
8085
|
+
color: ${({ $disabled, $inheritColor }) => {
|
|
8086
|
+
if ($disabled) return "var(--wui-color-text-disabled)";
|
|
8087
|
+
if ($inheritColor) return "inherit";
|
|
8088
|
+
return "var(--wui-color-text-link)";
|
|
8089
|
+
}};
|
|
8055
8090
|
text-decoration: ${({ $underline }) => $underline === "always" ? "underline" : "none"};
|
|
8056
8091
|
display: inline-flex;
|
|
8057
8092
|
align-items: baseline;
|
|
@@ -8083,6 +8118,7 @@ var Link = forwardRef(
|
|
|
8083
8118
|
disabled = false,
|
|
8084
8119
|
colorScheme = "inherit",
|
|
8085
8120
|
underline = "none",
|
|
8121
|
+
inheritColor = false,
|
|
8086
8122
|
leftIcon,
|
|
8087
8123
|
rightIcon,
|
|
8088
8124
|
"aria-disabled": ariaDisabled,
|
|
@@ -8092,6 +8128,7 @@ var Link = forwardRef(
|
|
|
8092
8128
|
const inRouterContext = useInRouterContext();
|
|
8093
8129
|
const to = generateHref(props.href, type, disabled);
|
|
8094
8130
|
const shouldUseReactRouterLink = inRouterContext && type !== "external" && !to?.startsWith("http");
|
|
8131
|
+
const hasIcons = isNotNil5(leftIcon) || isNotNil5(rightIcon);
|
|
8095
8132
|
const handleClick = async (event) => {
|
|
8096
8133
|
if (disabled) {
|
|
8097
8134
|
event.preventDefault();
|
|
@@ -8120,6 +8157,8 @@ var Link = forwardRef(
|
|
|
8120
8157
|
$colorScheme: colorScheme,
|
|
8121
8158
|
$disabled: disabled,
|
|
8122
8159
|
$underline: underline,
|
|
8160
|
+
$inheritColor: inheritColor,
|
|
8161
|
+
$hasIcons: hasIcons,
|
|
8123
8162
|
onClick: handleClick,
|
|
8124
8163
|
"aria-disabled": ariaDisabled ?? (disabled ? "true" : void 0)
|
|
8125
8164
|
};
|
|
@@ -8469,7 +8508,7 @@ var ActionButton = forwardRef3(
|
|
|
8469
8508
|
ActionButton.displayName = "ActionButton_UI";
|
|
8470
8509
|
|
|
8471
8510
|
// src/components/Avatar/Avatar.tsx
|
|
8472
|
-
import { useState as useState10, useMemo as useMemo4, useEffect as
|
|
8511
|
+
import { useState as useState10, useMemo as useMemo4, useEffect as useEffect8 } from "react";
|
|
8473
8512
|
import { isNil as isNil8, isNotNil as isNotNil8 } from "@wistia/type-guards";
|
|
8474
8513
|
import { styled as styled10 } from "styled-components";
|
|
8475
8514
|
|
|
@@ -8683,7 +8722,7 @@ var Avatar = ({
|
|
|
8683
8722
|
...props
|
|
8684
8723
|
}) => {
|
|
8685
8724
|
const [imageLoadState, setImageLoadState] = useState10("loading");
|
|
8686
|
-
|
|
8725
|
+
useEffect8(() => {
|
|
8687
8726
|
setImageLoadState("loading");
|
|
8688
8727
|
}, [imageUrl]);
|
|
8689
8728
|
const handleImageLoad = () => {
|
|
@@ -8774,7 +8813,7 @@ var Badge = forwardRef4(
|
|
|
8774
8813
|
Badge.displayName = "Badge_UI";
|
|
8775
8814
|
|
|
8776
8815
|
// src/components/Banner/Banner.tsx
|
|
8777
|
-
import { useEffect as
|
|
8816
|
+
import { useEffect as useEffect9, useState as useState11, useMemo as useMemo5 } from "react";
|
|
8778
8817
|
import { styled as styled17 } from "styled-components";
|
|
8779
8818
|
import { isNil as isNil11, isNotNil as isNotNil13 } from "@wistia/type-guards";
|
|
8780
8819
|
|
|
@@ -9551,7 +9590,7 @@ var Banner = ({
|
|
|
9551
9590
|
const [contentRef, { height: contentHeight }] = useElementObserver();
|
|
9552
9591
|
const [isSmallContainer, setIsSmallContainer] = useState11(false);
|
|
9553
9592
|
const [isVerticalLayout, setIsVerticalLayout] = useState11(orientation === "vertical");
|
|
9554
|
-
|
|
9593
|
+
useEffect9(() => {
|
|
9555
9594
|
const breakpoint = orientation === "vertical" ? VERTICAL_BREAKPOINT_WIDTH : BREAKPOINT_WIDTH;
|
|
9556
9595
|
setIsSmallContainer(width <= breakpoint);
|
|
9557
9596
|
if (orientation === "auto") {
|
|
@@ -10046,7 +10085,7 @@ import { isArray } from "@wistia/type-guards";
|
|
|
10046
10085
|
|
|
10047
10086
|
// src/components/FormGroup/FormGroup.tsx
|
|
10048
10087
|
import { styled as styled27 } from "styled-components";
|
|
10049
|
-
import { useRef as
|
|
10088
|
+
import { useRef as useRef8 } from "react";
|
|
10050
10089
|
import { isNonEmptyString as isNonEmptyString2, isNotNil as isNotNil16 } from "@wistia/type-guards";
|
|
10051
10090
|
|
|
10052
10091
|
// src/components/Stack/Stack.tsx
|
|
@@ -10114,7 +10153,7 @@ var FormGroup = ({
|
|
|
10114
10153
|
description,
|
|
10115
10154
|
...props
|
|
10116
10155
|
}) => {
|
|
10117
|
-
const ref =
|
|
10156
|
+
const ref = useRef8(null);
|
|
10118
10157
|
const hasLabel = isNotNil16(label) && isNonEmptyString2(label);
|
|
10119
10158
|
const hasDescription = isNotNil16(description) && isNonEmptyString2(description);
|
|
10120
10159
|
return /* @__PURE__ */ jsxs18(
|
|
@@ -10152,7 +10191,7 @@ var FormGroup = ({
|
|
|
10152
10191
|
FormGroup.displayName = "FormGroup_UI";
|
|
10153
10192
|
|
|
10154
10193
|
// src/components/Form/Form.tsx
|
|
10155
|
-
import { forwardRef as forwardRef11, useRef as
|
|
10194
|
+
import { forwardRef as forwardRef11, useRef as useRef9, useMemo as useMemo6, createContext as createContext3, useState as useState12, useId } from "react";
|
|
10156
10195
|
import { styled as styled28 } from "styled-components";
|
|
10157
10196
|
import { isNotUndefined as isNotUndefined6, isUndefined as isUndefined3 } from "@wistia/type-guards";
|
|
10158
10197
|
|
|
@@ -10197,7 +10236,7 @@ var Form = forwardRef11(
|
|
|
10197
10236
|
}, forwardedRef) => {
|
|
10198
10237
|
const [errors, setErrors] = useState12({});
|
|
10199
10238
|
const [hasSubmitted, setHasSubmitted] = useState12(false);
|
|
10200
|
-
const innerRef =
|
|
10239
|
+
const innerRef = useRef9(null);
|
|
10201
10240
|
const ref = forwardedRef ?? innerRef;
|
|
10202
10241
|
const autoId = useId();
|
|
10203
10242
|
const id = props.id ?? autoId;
|
|
@@ -10478,7 +10517,7 @@ var Checkbox = forwardRef12(
|
|
|
10478
10517
|
Checkbox.displayName = "Checkbox_UI";
|
|
10479
10518
|
|
|
10480
10519
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
10481
|
-
import { Children as Children3, cloneElement as cloneElement3, useCallback as useCallback8, useEffect as
|
|
10520
|
+
import { Children as Children3, cloneElement as cloneElement3, useCallback as useCallback8, useEffect as useEffect10 } from "react";
|
|
10482
10521
|
var isClickableElement = (element) => {
|
|
10483
10522
|
if (!element) {
|
|
10484
10523
|
return false;
|
|
@@ -10487,7 +10526,7 @@ var isClickableElement = (element) => {
|
|
|
10487
10526
|
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;
|
|
10488
10527
|
};
|
|
10489
10528
|
var ClickRegion = ({ children, targetRef }) => {
|
|
10490
|
-
|
|
10529
|
+
useEffect10(() => {
|
|
10491
10530
|
if (targetRef.current?.tagName === "A") {
|
|
10492
10531
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
10493
10532
|
} else if (targetRef.current?.tagName === "BUTTON") {
|
|
@@ -10631,7 +10670,7 @@ import { styled as styled34 } from "styled-components";
|
|
|
10631
10670
|
import { Root as RadioGroupRoot } from "@radix-ui/react-radio-group";
|
|
10632
10671
|
|
|
10633
10672
|
// src/components/ColorPicker/ColorPickerContext.tsx
|
|
10634
|
-
import { createContext as createContext5, useCallback as useCallback9, useContext as useContext4, useEffect as
|
|
10673
|
+
import { createContext as createContext5, useCallback as useCallback9, useContext as useContext4, useEffect as useEffect11, useMemo as useMemo8, useState as useState13 } from "react";
|
|
10635
10674
|
import { formatHex as formatHex2 } from "culori/fn";
|
|
10636
10675
|
|
|
10637
10676
|
// src/components/ColorPicker/color-conversion-utils.ts
|
|
@@ -11113,7 +11152,7 @@ var ColorPickerProvider = ({
|
|
|
11113
11152
|
);
|
|
11114
11153
|
setNonDerivedValueAsHsv(convertToHsv(valueAsHex));
|
|
11115
11154
|
}
|
|
11116
|
-
|
|
11155
|
+
useEffect11(() => {
|
|
11117
11156
|
if (valueAsHex !== valueAsHsvConvertedToHex && !isTransitioning && !isDragging) {
|
|
11118
11157
|
onValueChange(whatValueAsHexShouldBe);
|
|
11119
11158
|
}
|
|
@@ -12099,11 +12138,11 @@ var ContrastControls = () => {
|
|
|
12099
12138
|
ContrastControls.displayName = "ContrastControls_UI";
|
|
12100
12139
|
|
|
12101
12140
|
// src/components/ColorPicker/HexColorInput.tsx
|
|
12102
|
-
import { useCallback as useCallback13, useEffect as
|
|
12141
|
+
import { useCallback as useCallback13, useEffect as useEffect12, useRef as useRef11, useState as useState14 } from "react";
|
|
12103
12142
|
import { parseHex as parseHex2 } from "culori/fn";
|
|
12104
12143
|
|
|
12105
12144
|
// src/components/Input/Input.tsx
|
|
12106
|
-
import { isValidElement as isValidElement2, forwardRef as forwardRef15, cloneElement as cloneElement4, useRef as
|
|
12145
|
+
import { isValidElement as isValidElement2, forwardRef as forwardRef15, cloneElement as cloneElement4, useRef as useRef10 } from "react";
|
|
12107
12146
|
import { styled as styled46, css as css30 } from "styled-components";
|
|
12108
12147
|
import { isNil as isNil14, isNotNil as isNotNil18, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
12109
12148
|
|
|
@@ -12298,7 +12337,7 @@ var Input = forwardRef15(
|
|
|
12298
12337
|
rightIcon,
|
|
12299
12338
|
...props
|
|
12300
12339
|
}, externalRef) => {
|
|
12301
|
-
const internalRef =
|
|
12340
|
+
const internalRef = useRef10(null);
|
|
12302
12341
|
const ref = isNotNil18(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef;
|
|
12303
12342
|
let leftIconToDisplay = leftIcon;
|
|
12304
12343
|
if (isNil14(leftIcon) && type === "search") {
|
|
@@ -12377,7 +12416,7 @@ var normalizeHexInput = (input) => {
|
|
|
12377
12416
|
};
|
|
12378
12417
|
var HexColorInput = ({ autoFocus = true }) => {
|
|
12379
12418
|
const { valueAsHex, nonDerivedValueAsHsv, onChangeNonDerivedValueAsHsv } = useColorPickerState();
|
|
12380
|
-
const inputRef =
|
|
12419
|
+
const inputRef = useRef11(null);
|
|
12381
12420
|
const [textInputValue, setTextInputValue] = useState14(valueAsHex);
|
|
12382
12421
|
const onChangeInputValue = useCallback13(
|
|
12383
12422
|
(event) => {
|
|
@@ -12488,7 +12527,7 @@ var HexColorInput = ({ autoFocus = true }) => {
|
|
|
12488
12527
|
}
|
|
12489
12528
|
selectAllButTheHash();
|
|
12490
12529
|
}, [selectAllButTheHash]);
|
|
12491
|
-
|
|
12530
|
+
useEffect12(() => {
|
|
12492
12531
|
if (!autoFocus) {
|
|
12493
12532
|
return;
|
|
12494
12533
|
}
|
|
@@ -12499,7 +12538,7 @@ var HexColorInput = ({ autoFocus = true }) => {
|
|
|
12499
12538
|
inputElem.focus();
|
|
12500
12539
|
selectAllButTheHash();
|
|
12501
12540
|
}, [autoFocus, selectAllButTheHash]);
|
|
12502
|
-
|
|
12541
|
+
useEffect12(() => {
|
|
12503
12542
|
setTextInputValue(valueAsHex);
|
|
12504
12543
|
}, [valueAsHex]);
|
|
12505
12544
|
return /* @__PURE__ */ jsx271(
|
|
@@ -12535,7 +12574,7 @@ import { styled as styled48 } from "styled-components";
|
|
|
12535
12574
|
import { formatHex as formatHex6 } from "culori/fn";
|
|
12536
12575
|
|
|
12537
12576
|
// src/components/ColorPicker/HSVHueCanvas.tsx
|
|
12538
|
-
import { useEffect as
|
|
12577
|
+
import { useEffect as useEffect13, useRef as useRef12 } from "react";
|
|
12539
12578
|
import { styled as styled47 } from "styled-components";
|
|
12540
12579
|
import { formatHex as formatHex5 } from "culori/fn";
|
|
12541
12580
|
import { jsx as jsx272 } from "react/jsx-runtime";
|
|
@@ -12545,8 +12584,8 @@ var Canvas = styled47.canvas`
|
|
|
12545
12584
|
width: 100%;
|
|
12546
12585
|
`;
|
|
12547
12586
|
var HSVHueCanvas = ({ hsv }) => {
|
|
12548
|
-
const canvasRef =
|
|
12549
|
-
|
|
12587
|
+
const canvasRef = useRef12(null);
|
|
12588
|
+
useEffect13(() => {
|
|
12550
12589
|
const canvas = canvasRef.current;
|
|
12551
12590
|
if (!canvas) {
|
|
12552
12591
|
return;
|
|
@@ -12668,11 +12707,11 @@ var HueSlider = () => {
|
|
|
12668
12707
|
HueSlider.displayName = "HueSlider_UI";
|
|
12669
12708
|
|
|
12670
12709
|
// src/components/ColorPicker/SaturationAndValuePicker.tsx
|
|
12671
|
-
import { useCallback as useCallback15, useEffect as
|
|
12710
|
+
import { useCallback as useCallback15, useEffect as useEffect15, useLayoutEffect as useLayoutEffect4, useMemo as useMemo10, useRef as useRef14, useState as useState15 } from "react";
|
|
12672
12711
|
import { styled as styled50 } from "styled-components";
|
|
12673
12712
|
|
|
12674
12713
|
// src/components/ColorPicker/HSVSaturationValueCanvas.tsx
|
|
12675
|
-
import { useEffect as
|
|
12714
|
+
import { useEffect as useEffect14, useRef as useRef13 } from "react";
|
|
12676
12715
|
import { styled as styled49 } from "styled-components";
|
|
12677
12716
|
|
|
12678
12717
|
// src/components/ColorPicker/canvas-utils.ts
|
|
@@ -12762,8 +12801,8 @@ var HSVSaturationValueCanvas = ({
|
|
|
12762
12801
|
colorForComparison,
|
|
12763
12802
|
opacityForContrastCalculation
|
|
12764
12803
|
}) => {
|
|
12765
|
-
const canvasRef =
|
|
12766
|
-
|
|
12804
|
+
const canvasRef = useRef13(null);
|
|
12805
|
+
useEffect14(() => {
|
|
12767
12806
|
const canvas = canvasRef.current;
|
|
12768
12807
|
if (!canvas) {
|
|
12769
12808
|
return;
|
|
@@ -12866,8 +12905,8 @@ var SaturationAndValuePicker = ({
|
|
|
12866
12905
|
valueAsHex,
|
|
12867
12906
|
valueAsHsv
|
|
12868
12907
|
} = useColorPickerState();
|
|
12869
|
-
const containerRef =
|
|
12870
|
-
const thumbRef =
|
|
12908
|
+
const containerRef = useRef14(null);
|
|
12909
|
+
const thumbRef = useRef14(null);
|
|
12871
12910
|
const uuid = useMemo10(() => crypto.randomUUID(), []);
|
|
12872
12911
|
const instructionsId = `sv-instructions-${uuid}`;
|
|
12873
12912
|
const valueAsHexConvertedToHsv = convertToHsv(valueAsHex);
|
|
@@ -12981,7 +13020,7 @@ var SaturationAndValuePicker = ({
|
|
|
12981
13020
|
[isDragging, updateSaturationAndValueFromCoordinates]
|
|
12982
13021
|
);
|
|
12983
13022
|
const onWindowMouseUp = useCallback15(() => setIsDragging(false), [setIsDragging]);
|
|
12984
|
-
|
|
13023
|
+
useEffect15(() => {
|
|
12985
13024
|
window.addEventListener("mousemove", onWindowMouseMove);
|
|
12986
13025
|
window.addEventListener("mouseup", onWindowMouseUp);
|
|
12987
13026
|
return () => {
|
|
@@ -13044,10 +13083,10 @@ SaturationAndValuePicker.displayName = "SaturationAndValuePicker_UI";
|
|
|
13044
13083
|
import * as Ariakit from "@ariakit/react";
|
|
13045
13084
|
import {
|
|
13046
13085
|
useMemo as useMemo11,
|
|
13047
|
-
useRef as
|
|
13086
|
+
useRef as useRef15,
|
|
13048
13087
|
useState as useState16,
|
|
13049
13088
|
useTransition,
|
|
13050
|
-
useEffect as
|
|
13089
|
+
useEffect as useEffect16,
|
|
13051
13090
|
Children as Children5,
|
|
13052
13091
|
isValidElement as isValidElement3
|
|
13053
13092
|
} from "react";
|
|
@@ -13398,10 +13437,10 @@ var Combobox2 = ({
|
|
|
13398
13437
|
const [isOpen, setIsOpen] = useState16(false);
|
|
13399
13438
|
const [isPending, startTransition] = useTransition();
|
|
13400
13439
|
const [wrapperWidth, setWrapperWidth] = useState16("auto");
|
|
13401
|
-
const comboboxWrapperRef =
|
|
13440
|
+
const comboboxWrapperRef = useRef15(null);
|
|
13402
13441
|
const options = useMemo11(() => extractOptions(children), [children]);
|
|
13403
13442
|
const isMultiSelect = isArray2(value);
|
|
13404
|
-
|
|
13443
|
+
useEffect16(() => {
|
|
13405
13444
|
const comboboxWrapper = comboboxWrapperRef.current;
|
|
13406
13445
|
if (comboboxWrapper) {
|
|
13407
13446
|
const updateWidthVariable = () => {
|
|
@@ -13501,7 +13540,7 @@ var Combobox2 = ({
|
|
|
13501
13540
|
|
|
13502
13541
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
13503
13542
|
import { isNil as isNil16, isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
13504
|
-
import { useEffect as
|
|
13543
|
+
import { useEffect as useEffect17, useState as useState18 } from "react";
|
|
13505
13544
|
import { createPortal } from "react-dom";
|
|
13506
13545
|
|
|
13507
13546
|
// src/components/Menu/Menu.tsx
|
|
@@ -14193,7 +14232,7 @@ var ContextMenu = ({
|
|
|
14193
14232
|
}) => {
|
|
14194
14233
|
const [isRightClicked, setIsRightClicked] = useState18(false);
|
|
14195
14234
|
const [menuPosition, setMenuPosition] = useState18(position ?? { x: 0, y: 0 });
|
|
14196
|
-
|
|
14235
|
+
useEffect17(() => {
|
|
14197
14236
|
if (isNil16(position)) {
|
|
14198
14237
|
const onContextMenu = (event) => {
|
|
14199
14238
|
event.preventDefault();
|
|
@@ -14249,7 +14288,7 @@ var ContextMenu = ({
|
|
|
14249
14288
|
};
|
|
14250
14289
|
|
|
14251
14290
|
// src/components/DataCards/DataCard.tsx
|
|
14252
|
-
import { useRef as
|
|
14291
|
+
import { useRef as useRef16 } from "react";
|
|
14253
14292
|
import { styled as styled58, keyframes as keyframes4 } from "styled-components";
|
|
14254
14293
|
import { isNotNil as isNotNil25 } from "@wistia/type-guards";
|
|
14255
14294
|
import { jsx as jsx289, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
@@ -14427,7 +14466,7 @@ var DataCardInner = ({
|
|
|
14427
14466
|
}
|
|
14428
14467
|
);
|
|
14429
14468
|
var DataCard = (props) => {
|
|
14430
|
-
const ref =
|
|
14469
|
+
const ref = useRef16(null);
|
|
14431
14470
|
if (isNotNil25(props.href) || isNotNil25(props.onClick)) {
|
|
14432
14471
|
const { "aria-pressed": ariaPressed, ...dataCardProps } = props;
|
|
14433
14472
|
return /* @__PURE__ */ jsx289(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ jsx289(
|
|
@@ -14694,7 +14733,7 @@ Divider.displayName = "Divider_UI";
|
|
|
14694
14733
|
|
|
14695
14734
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
14696
14735
|
import { styled as styled64, css as css34 } from "styled-components";
|
|
14697
|
-
import { useState as useState19, useRef as
|
|
14736
|
+
import { useState as useState19, useRef as useRef17 } from "react";
|
|
14698
14737
|
import { Fragment as Fragment8, jsx as jsx297, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14699
14738
|
var StyledInput = styled64(Input)`
|
|
14700
14739
|
&:not([rows]) {
|
|
@@ -14753,7 +14792,7 @@ var EditableHeading = ({
|
|
|
14753
14792
|
const [value, setValue] = useState19(children);
|
|
14754
14793
|
const [previousValue, setPreviousValue] = useState19(children);
|
|
14755
14794
|
const [headingHeight, setHeadingHeight] = useState19("60");
|
|
14756
|
-
const headingRef =
|
|
14795
|
+
const headingRef = useRef17(null);
|
|
14757
14796
|
const handleSetEditing = (editing) => {
|
|
14758
14797
|
if (editingDisabled) {
|
|
14759
14798
|
return;
|
|
@@ -14835,7 +14874,7 @@ var EditableHeading = ({
|
|
|
14835
14874
|
};
|
|
14836
14875
|
|
|
14837
14876
|
// src/components/EditableText/EditableTextDisplay.tsx
|
|
14838
|
-
import { useContext as useContext6, useRef as
|
|
14877
|
+
import { useContext as useContext6, useRef as useRef18, forwardRef as forwardRef21 } from "react";
|
|
14839
14878
|
import { styled as styled66, css as css35 } from "styled-components";
|
|
14840
14879
|
import { isNotNil as isNotNil26 } from "@wistia/type-guards";
|
|
14841
14880
|
|
|
@@ -15033,7 +15072,7 @@ var EditableTextDisplayComponent = forwardRef21(
|
|
|
15033
15072
|
throw new Error("EditableTextDisplay must be used within an EditableTextRoot context");
|
|
15034
15073
|
}
|
|
15035
15074
|
const { value, typographicVariant, setIsEditing, placeholder, maxLines, isEditing, minLines } = context;
|
|
15036
|
-
const triggerButtonRef =
|
|
15075
|
+
const triggerButtonRef = useRef18(null);
|
|
15037
15076
|
const handleTriggerClick = () => {
|
|
15038
15077
|
setIsEditing(true);
|
|
15039
15078
|
};
|
|
@@ -15093,7 +15132,7 @@ var EditableTextDisplay = makePolymorphic(
|
|
|
15093
15132
|
);
|
|
15094
15133
|
|
|
15095
15134
|
// src/components/EditableText/EditableTextInput.tsx
|
|
15096
|
-
import { useContext as useContext7, useEffect as
|
|
15135
|
+
import { useContext as useContext7, useEffect as useEffect18, useRef as useRef19 } from "react";
|
|
15097
15136
|
import { styled as styled67 } from "styled-components";
|
|
15098
15137
|
import { isNotNil as isNotNil27 } from "@wistia/type-guards";
|
|
15099
15138
|
import { jsx as jsx300 } from "react/jsx-runtime";
|
|
@@ -15129,8 +15168,8 @@ var EditableTextInput = (props) => {
|
|
|
15129
15168
|
maxLines,
|
|
15130
15169
|
finalFocusEl
|
|
15131
15170
|
} = context;
|
|
15132
|
-
const inputRef =
|
|
15133
|
-
|
|
15171
|
+
const inputRef = useRef19(null);
|
|
15172
|
+
useEffect18(() => {
|
|
15134
15173
|
if (inputRef.current) {
|
|
15135
15174
|
if (isEditing) {
|
|
15136
15175
|
const element = inputRef.current;
|
|
@@ -15368,14 +15407,14 @@ var useFormState = (action, initialData = {}) => {
|
|
|
15368
15407
|
};
|
|
15369
15408
|
|
|
15370
15409
|
// src/components/Form/FormErrorSummary.tsx
|
|
15371
|
-
import { useContext as useContext12, useRef as
|
|
15410
|
+
import { useContext as useContext12, useRef as useRef20 } from "react";
|
|
15372
15411
|
import { isArray as isArray3, isNotUndefined as isNotUndefined11 } from "@wistia/type-guards";
|
|
15373
15412
|
import { jsx as jsx303, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
15374
15413
|
var ErrorItem = ({ name, error, formId }) => {
|
|
15375
15414
|
return /* @__PURE__ */ jsx303("li", { children: /* @__PURE__ */ jsx303(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
15376
15415
|
};
|
|
15377
15416
|
var FormErrorSummary = ({ description }) => {
|
|
15378
|
-
const ref =
|
|
15417
|
+
const ref = useRef20(null);
|
|
15379
15418
|
const { formId, errors, hasSubmitted } = useContext12(FormContext);
|
|
15380
15419
|
const isValid = Object.keys(errors).length === 0;
|
|
15381
15420
|
if (isValid || !hasSubmitted) {
|
|
@@ -15736,7 +15775,7 @@ var Grid = makePolymorphic(GridComponent);
|
|
|
15736
15775
|
|
|
15737
15776
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
15738
15777
|
import { styled as styled70 } from "styled-components";
|
|
15739
|
-
import { forwardRef as forwardRef23, useEffect as
|
|
15778
|
+
import { forwardRef as forwardRef23, useEffect as useEffect19, useState as useState22 } from "react";
|
|
15740
15779
|
import { isFunction as isFunction3 } from "@wistia/type-guards";
|
|
15741
15780
|
import { jsx as jsx307 } from "react/jsx-runtime";
|
|
15742
15781
|
var StyledIconButton = styled70(IconButton)`
|
|
@@ -15751,7 +15790,7 @@ var COPY_SUCCESS_DURATION = 2e3;
|
|
|
15751
15790
|
var InputClickToCopy = forwardRef23(
|
|
15752
15791
|
({ value, onCopy, disabled = false, ...props }, ref) => {
|
|
15753
15792
|
const [isCopied, setIsCopied] = useState22(false);
|
|
15754
|
-
|
|
15793
|
+
useEffect19(() => {
|
|
15755
15794
|
if (isCopied) {
|
|
15756
15795
|
const timeout = setTimeout(() => {
|
|
15757
15796
|
setIsCopied(false);
|
|
@@ -16374,14 +16413,14 @@ import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
|
16374
16413
|
var DEFAULT_MODAL_WIDTH = "532px";
|
|
16375
16414
|
|
|
16376
16415
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
16377
|
-
import { useRef as
|
|
16416
|
+
import { useRef as useRef21, useEffect as useEffect20 } from "react";
|
|
16378
16417
|
import { isNotNil as isNotNil31 } from "@wistia/type-guards";
|
|
16379
16418
|
var useFocusRestore = () => {
|
|
16380
|
-
const previouslyFocusedRef =
|
|
16381
|
-
|
|
16419
|
+
const previouslyFocusedRef = useRef21(null);
|
|
16420
|
+
useEffect20(() => {
|
|
16382
16421
|
previouslyFocusedRef.current = document.activeElement;
|
|
16383
16422
|
}, []);
|
|
16384
|
-
|
|
16423
|
+
useEffect20(() => {
|
|
16385
16424
|
return () => {
|
|
16386
16425
|
if (isNotNil31(previouslyFocusedRef.current)) {
|
|
16387
16426
|
setTimeout(() => {
|
|
@@ -17390,7 +17429,7 @@ var RadioCardImage = forwardRef30(
|
|
|
17390
17429
|
RadioCardImage.displayName = "RadioCardImage_UI";
|
|
17391
17430
|
|
|
17392
17431
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
17393
|
-
import { forwardRef as forwardRef31, useCallback as useCallback18, useEffect as
|
|
17432
|
+
import { forwardRef as forwardRef31, useCallback as useCallback18, useEffect as useEffect21, useMemo as useMemo15, useRef as useRef22, useState as useState24 } from "react";
|
|
17394
17433
|
import { styled as styled90 } from "styled-components";
|
|
17395
17434
|
import { throttle } from "throttle-debounce";
|
|
17396
17435
|
import { jsx as jsx327, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
@@ -17442,7 +17481,7 @@ var ShadowAtRight = styled90(Shadow)`
|
|
|
17442
17481
|
`;
|
|
17443
17482
|
var ScrollArea = forwardRef31(
|
|
17444
17483
|
({ children, onScroll, style, locked = false, ...props }, forwardedRef) => {
|
|
17445
|
-
const scrollContainerRefInternal =
|
|
17484
|
+
const scrollContainerRefInternal = useRef22(null);
|
|
17446
17485
|
const [shadowState, setShadowState] = useState24({
|
|
17447
17486
|
canScrollUp: false,
|
|
17448
17487
|
canScrollLeft: false,
|
|
@@ -17470,7 +17509,7 @@ var ScrollArea = forwardRef31(
|
|
|
17470
17509
|
},
|
|
17471
17510
|
[onScroll, throttledUpdateShadows]
|
|
17472
17511
|
);
|
|
17473
|
-
|
|
17512
|
+
useEffect21(() => {
|
|
17474
17513
|
updateShadows();
|
|
17475
17514
|
}, [updateShadows]);
|
|
17476
17515
|
return /* @__PURE__ */ jsxs59(Container10, { style, children: [
|
|
@@ -17636,7 +17675,7 @@ var SegmentedControl = forwardRef32(
|
|
|
17636
17675
|
SegmentedControl.displayName = "SegmentedControl_UI";
|
|
17637
17676
|
|
|
17638
17677
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
17639
|
-
import { forwardRef as forwardRef33, useEffect as
|
|
17678
|
+
import { forwardRef as forwardRef33, useEffect as useEffect22, useRef as useRef23 } from "react";
|
|
17640
17679
|
import { styled as styled93, css as css47 } from "styled-components";
|
|
17641
17680
|
import { Item as ToggleGroupItem2 } from "@radix-ui/react-toggle-group";
|
|
17642
17681
|
import { isNotNil as isNotNil36 } from "@wistia/type-guards";
|
|
@@ -17716,7 +17755,7 @@ var SegmentedControlItem = forwardRef33(
|
|
|
17716
17755
|
({ disabled, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
|
|
17717
17756
|
const selectedValue = useSegmentedControlValue();
|
|
17718
17757
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
17719
|
-
const buttonRef =
|
|
17758
|
+
const buttonRef = useRef23(null);
|
|
17720
17759
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
17721
17760
|
const handleClick = (event) => {
|
|
17722
17761
|
const target = event.target;
|
|
@@ -17725,7 +17764,7 @@ var SegmentedControlItem = forwardRef33(
|
|
|
17725
17764
|
event.preventDefault();
|
|
17726
17765
|
}
|
|
17727
17766
|
};
|
|
17728
|
-
|
|
17767
|
+
useEffect22(() => {
|
|
17729
17768
|
const buttonElem = buttonRef.current;
|
|
17730
17769
|
if (!buttonElem) {
|
|
17731
17770
|
return void 0;
|
|
@@ -18374,7 +18413,7 @@ var TabsList = ({ children, fullWidth = true, ...props }) => {
|
|
|
18374
18413
|
TabsList.displayName = "TabsList_UI";
|
|
18375
18414
|
|
|
18376
18415
|
// src/components/Tabs/TabsTrigger.tsx
|
|
18377
|
-
import { forwardRef as forwardRef36, useEffect as
|
|
18416
|
+
import { forwardRef as forwardRef36, useEffect as useEffect23, useRef as useRef24 } from "react";
|
|
18378
18417
|
import { isNotNil as isNotNil39 } from "@wistia/type-guards";
|
|
18379
18418
|
|
|
18380
18419
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
@@ -18394,9 +18433,9 @@ var TabsTrigger = forwardRef36(
|
|
|
18394
18433
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
|
|
18395
18434
|
const selectedValue = useTabsValue();
|
|
18396
18435
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
18397
|
-
const buttonRef =
|
|
18436
|
+
const buttonRef = useRef24(null);
|
|
18398
18437
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
18399
|
-
|
|
18438
|
+
useEffect23(() => {
|
|
18400
18439
|
const buttonElem = buttonRef.current;
|
|
18401
18440
|
if (!buttonElem) {
|
|
18402
18441
|
return void 0;
|
|
@@ -18478,7 +18517,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
|
18478
18517
|
ThumbnailBadge.displayName = "ThumbnailBadge_UI";
|
|
18479
18518
|
|
|
18480
18519
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
18481
|
-
import { forwardRef as forwardRef37, useState as useState27, useRef as
|
|
18520
|
+
import { forwardRef as forwardRef37, useState as useState27, useRef as useRef25, useCallback as useCallback20, useMemo as useMemo17 } from "react";
|
|
18482
18521
|
import { styled as styled109 } from "styled-components";
|
|
18483
18522
|
import {
|
|
18484
18523
|
isNil as isNil19,
|
|
@@ -18882,7 +18921,7 @@ var Thumbnail = forwardRef37(
|
|
|
18882
18921
|
const [percent, setPercent] = useState27(0);
|
|
18883
18922
|
const [isMouseOver, setIsMouseOver] = useState27(false);
|
|
18884
18923
|
const [isStoryboardReady, setIsStoryboardReady] = useState27(false);
|
|
18885
|
-
const storyboardElementRef =
|
|
18924
|
+
const storyboardElementRef = useRef25(null);
|
|
18886
18925
|
const [cursorPosition, setCursorPosition] = useState27(null);
|
|
18887
18926
|
const backgroundUrl = useMemo17(
|
|
18888
18927
|
() => thumbnailImageType === "square" && hasValidThumbnailUrl(thumbnailUrl) ? thumbnailUrl : void 0,
|