@wistia/ui 0.8.15 → 0.8.16
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 +208 -180
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.mjs +54 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.8.
|
|
3
|
+
* @license @wistia/ui v0.8.16
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -131,6 +131,7 @@ __export(index_exports, {
|
|
|
131
131
|
useFocusTrap: () => useFocusTrap,
|
|
132
132
|
useFormState: () => useFormState,
|
|
133
133
|
useImperativeFilePicker: () => import_use_file_picker.useImperativeFilePicker,
|
|
134
|
+
useIsHovered: () => useIsHovered,
|
|
134
135
|
useKey: () => useKey,
|
|
135
136
|
useLocalStorage: () => useLocalStorage,
|
|
136
137
|
useLockBodyScroll: () => useLockBodyScroll,
|
|
@@ -2372,11 +2373,32 @@ var useFocusTrap = (active = true, options = {}) => {
|
|
|
2372
2373
|
return setRef;
|
|
2373
2374
|
};
|
|
2374
2375
|
|
|
2376
|
+
// src/hooks/useIsHovered/useIsHovered.ts
|
|
2377
|
+
var import_react9 = require("react");
|
|
2378
|
+
var useIsHovered = () => {
|
|
2379
|
+
const [isHovered, setIsHovered] = (0, import_react9.useState)(false);
|
|
2380
|
+
const onFocus = () => setIsHovered(true);
|
|
2381
|
+
const onMouseEnter = () => setIsHovered(true);
|
|
2382
|
+
const onMouseMove = () => setIsHovered(true);
|
|
2383
|
+
const onBlur = () => setIsHovered(false);
|
|
2384
|
+
const onMouseLeave = () => setIsHovered(false);
|
|
2385
|
+
const hoverProps = {
|
|
2386
|
+
onFocus,
|
|
2387
|
+
onMouseEnter,
|
|
2388
|
+
onBlur,
|
|
2389
|
+
onMouseLeave
|
|
2390
|
+
};
|
|
2391
|
+
if (!isHovered) {
|
|
2392
|
+
hoverProps.onMouseMove = onMouseMove;
|
|
2393
|
+
}
|
|
2394
|
+
return [isHovered, hoverProps, setIsHovered];
|
|
2395
|
+
};
|
|
2396
|
+
|
|
2375
2397
|
// src/hooks/useKey/useKey.ts
|
|
2376
|
-
var
|
|
2398
|
+
var import_react11 = require("react");
|
|
2377
2399
|
|
|
2378
2400
|
// src/private/hooks/useEvent/useEvent.ts
|
|
2379
|
-
var
|
|
2401
|
+
var import_react10 = require("react");
|
|
2380
2402
|
|
|
2381
2403
|
// src/private/helpers/isValidRef/isValidRef.ts
|
|
2382
2404
|
var import_type_guards8 = require("@wistia/type-guards");
|
|
@@ -2395,15 +2417,15 @@ var isEventTargetSupported = (eventTarget) => (
|
|
|
2395
2417
|
!!(typeof eventTarget === "object" && eventTarget?.addEventListener)
|
|
2396
2418
|
);
|
|
2397
2419
|
var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}) => {
|
|
2398
|
-
const savedEventHandler = (0,
|
|
2399
|
-
const savedEventOptions = (0,
|
|
2400
|
-
(0,
|
|
2420
|
+
const savedEventHandler = (0, import_react10.useRef)();
|
|
2421
|
+
const savedEventOptions = (0, import_react10.useRef)();
|
|
2422
|
+
(0, import_react10.useEffect)(() => {
|
|
2401
2423
|
savedEventHandler.current = eventHandler;
|
|
2402
2424
|
}, [eventHandler]);
|
|
2403
|
-
(0,
|
|
2425
|
+
(0, import_react10.useEffect)(() => {
|
|
2404
2426
|
savedEventOptions.current = eventOptions;
|
|
2405
2427
|
}, [eventOptions]);
|
|
2406
|
-
(0,
|
|
2428
|
+
(0, import_react10.useEffect)(() => {
|
|
2407
2429
|
const target = isValidRef(eventTarget) ? eventTarget.current : eventTarget;
|
|
2408
2430
|
if (!eventName || !isEventTargetSupported(target)) {
|
|
2409
2431
|
return;
|
|
@@ -2423,7 +2445,7 @@ var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}
|
|
|
2423
2445
|
|
|
2424
2446
|
// src/hooks/useKey/useKey.ts
|
|
2425
2447
|
var useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOptions } = {}) => {
|
|
2426
|
-
const memoizedEventHandler = (0,
|
|
2448
|
+
const memoizedEventHandler = (0, import_react11.useCallback)(
|
|
2427
2449
|
(handlerEvent) => {
|
|
2428
2450
|
if (["INPUT", "TEXTAREA", "SELECT"].includes(document.activeElement?.nodeName ?? "") || document.activeElement?.isContentEditable) {
|
|
2429
2451
|
return;
|
|
@@ -2448,9 +2470,9 @@ var useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOpti
|
|
|
2448
2470
|
};
|
|
2449
2471
|
|
|
2450
2472
|
// src/hooks/useLocalStorage/useLocalStorage.ts
|
|
2451
|
-
var
|
|
2473
|
+
var import_react12 = require("react");
|
|
2452
2474
|
var useLocalStorage = (key, initialValue, storage = window.localStorage) => {
|
|
2453
|
-
const [storedValue, setStoredValue] = (0,
|
|
2475
|
+
const [storedValue, setStoredValue] = (0, import_react12.useState)(() => {
|
|
2454
2476
|
try {
|
|
2455
2477
|
const item = storage.getItem(key);
|
|
2456
2478
|
return item !== null && !!item ? JSON.parse(item) : initialValue;
|
|
@@ -2476,9 +2498,9 @@ var useLocalStorage = (key, initialValue, storage = window.localStorage) => {
|
|
|
2476
2498
|
};
|
|
2477
2499
|
|
|
2478
2500
|
// src/hooks/useLockBodyScroll/useLockBodyScroll.ts
|
|
2479
|
-
var
|
|
2501
|
+
var import_react13 = require("react");
|
|
2480
2502
|
var useLockBodyScroll = (locked) => {
|
|
2481
|
-
(0,
|
|
2503
|
+
(0, import_react13.useLayoutEffect)(() => {
|
|
2482
2504
|
if (locked) {
|
|
2483
2505
|
const originalStyle = window.getComputedStyle(document.body).overflow;
|
|
2484
2506
|
document.body.style.overflow = "hidden";
|
|
@@ -2494,7 +2516,7 @@ var useLockBodyScroll = (locked) => {
|
|
|
2494
2516
|
var import_type_guards9 = require("@wistia/type-guards");
|
|
2495
2517
|
|
|
2496
2518
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2497
|
-
var
|
|
2519
|
+
var import_react14 = require("react");
|
|
2498
2520
|
var import_throttle_debounce = require("throttle-debounce");
|
|
2499
2521
|
|
|
2500
2522
|
// src/private/helpers/isClient/isClient.ts
|
|
@@ -2502,11 +2524,11 @@ var isClient = () => typeof window !== "undefined" && typeof document !== "undef
|
|
|
2502
2524
|
|
|
2503
2525
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2504
2526
|
var useWindowSize = (interval = 0) => {
|
|
2505
|
-
const [dimensions, setDimensions] = (0,
|
|
2527
|
+
const [dimensions, setDimensions] = (0, import_react14.useState)({
|
|
2506
2528
|
width: isClient() ? window.innerWidth : 0,
|
|
2507
2529
|
height: isClient() ? window.innerHeight : 0
|
|
2508
2530
|
});
|
|
2509
|
-
(0,
|
|
2531
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
2510
2532
|
const handleResize = (0, import_throttle_debounce.debounce)(
|
|
2511
2533
|
interval,
|
|
2512
2534
|
() => setDimensions({
|
|
@@ -2558,9 +2580,9 @@ var useActiveMq = () => {
|
|
|
2558
2580
|
};
|
|
2559
2581
|
|
|
2560
2582
|
// src/hooks/useOnClickOutside/useOnClickOutside.ts
|
|
2561
|
-
var
|
|
2583
|
+
var import_react15 = require("react");
|
|
2562
2584
|
var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) => {
|
|
2563
|
-
(0,
|
|
2585
|
+
(0, import_react15.useEffect)(() => {
|
|
2564
2586
|
const listener = (event) => {
|
|
2565
2587
|
if (!ref.current || ref.current.contains(event.target)) {
|
|
2566
2588
|
return;
|
|
@@ -2587,11 +2609,11 @@ var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) =
|
|
|
2587
2609
|
};
|
|
2588
2610
|
|
|
2589
2611
|
// src/hooks/useToast/useToast.tsx
|
|
2590
|
-
var
|
|
2612
|
+
var import_react17 = require("react");
|
|
2591
2613
|
var import_sonner2 = require("sonner");
|
|
2592
2614
|
|
|
2593
2615
|
// src/private/components/Toast/Toast.tsx
|
|
2594
|
-
var
|
|
2616
|
+
var import_react16 = require("react");
|
|
2595
2617
|
var import_styled_components16 = __toESM(require("styled-components"));
|
|
2596
2618
|
var import_type_guards11 = require("@wistia/type-guards");
|
|
2597
2619
|
|
|
@@ -2829,8 +2851,8 @@ var StyledToast = import_styled_components16.default.div`
|
|
|
2829
2851
|
}
|
|
2830
2852
|
`;
|
|
2831
2853
|
var Action = ({ actionButton }) => {
|
|
2832
|
-
if ((0, import_type_guards11.isNotNil)(actionButton) && (0,
|
|
2833
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0,
|
|
2854
|
+
if ((0, import_type_guards11.isNotNil)(actionButton) && (0, import_react16.isValidElement)(actionButton)) {
|
|
2855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0, import_react16.cloneElement)(actionButton, {
|
|
2834
2856
|
variant: "soft",
|
|
2835
2857
|
// force Button variant
|
|
2836
2858
|
size: "sm"
|
|
@@ -2866,7 +2888,7 @@ Toast.displayName = "Toast";
|
|
|
2866
2888
|
// src/hooks/useToast/useToast.tsx
|
|
2867
2889
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2868
2890
|
var useToast = () => {
|
|
2869
|
-
return (0,
|
|
2891
|
+
return (0, import_react17.useCallback)(
|
|
2870
2892
|
({ message, action, colorScheme, icon, position = "bottom-left", duration = 3e3 }) => {
|
|
2871
2893
|
import_sonner2.toast.custom(
|
|
2872
2894
|
() => {
|
|
@@ -2888,11 +2910,11 @@ var useToast = () => {
|
|
|
2888
2910
|
};
|
|
2889
2911
|
|
|
2890
2912
|
// src/components/ActionButton/ActionButton.tsx
|
|
2891
|
-
var
|
|
2913
|
+
var import_react21 = require("react");
|
|
2892
2914
|
var import_styled_components22 = __toESM(require("styled-components"));
|
|
2893
2915
|
|
|
2894
2916
|
// src/components/Button/Button.tsx
|
|
2895
|
-
var
|
|
2917
|
+
var import_react20 = require("react");
|
|
2896
2918
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
2897
2919
|
var import_type_guards15 = require("@wistia/type-guards");
|
|
2898
2920
|
|
|
@@ -6954,13 +6976,13 @@ var iconMap = {
|
|
|
6954
6976
|
|
|
6955
6977
|
// src/private/hooks/useResponsiveProp/useResponsiveProp.ts
|
|
6956
6978
|
var import_type_guards12 = require("@wistia/type-guards");
|
|
6957
|
-
var
|
|
6979
|
+
var import_react18 = require("react");
|
|
6958
6980
|
var isResponsiveObject = (values) => {
|
|
6959
6981
|
return typeof values === "object" && values !== null && !Array.isArray(values) && "base" in values;
|
|
6960
6982
|
};
|
|
6961
6983
|
var useResponsiveProp = (values) => {
|
|
6962
6984
|
const activeMediaQueries = useActiveMq();
|
|
6963
|
-
return (0,
|
|
6985
|
+
return (0, import_react18.useMemo)(() => {
|
|
6964
6986
|
if ((0, import_type_guards12.isRecord)(values) && isResponsiveObject(values)) {
|
|
6965
6987
|
const mq2 = activeMediaQueries.find((key) => key in values);
|
|
6966
6988
|
return (0, import_type_guards12.isNotUndefined)(mq2) && (0, import_type_guards12.isNotUndefined)(values[mq2]) ? values[mq2] : values.base;
|
|
@@ -7027,7 +7049,7 @@ var Icon = ({
|
|
|
7027
7049
|
Icon.displayName = "Icon";
|
|
7028
7050
|
|
|
7029
7051
|
// src/components/Link/Link.tsx
|
|
7030
|
-
var
|
|
7052
|
+
var import_react19 = require("react");
|
|
7031
7053
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
7032
7054
|
var import_react_router_dom = require("react-router-dom");
|
|
7033
7055
|
var import_type_guards14 = require("@wistia/type-guards");
|
|
@@ -7065,7 +7087,7 @@ var StyledLink = import_styled_components20.default.a`
|
|
|
7065
7087
|
}
|
|
7066
7088
|
}
|
|
7067
7089
|
`;
|
|
7068
|
-
var Link = (0,
|
|
7090
|
+
var Link = (0, import_react19.forwardRef)(
|
|
7069
7091
|
({
|
|
7070
7092
|
beforeAction,
|
|
7071
7093
|
children,
|
|
@@ -7206,7 +7228,7 @@ var ButtonContent = ({
|
|
|
7206
7228
|
)
|
|
7207
7229
|
] });
|
|
7208
7230
|
};
|
|
7209
|
-
var Button = (0,
|
|
7231
|
+
var Button = (0, import_react20.forwardRef)(
|
|
7210
7232
|
({
|
|
7211
7233
|
children,
|
|
7212
7234
|
forceState,
|
|
@@ -7385,7 +7407,7 @@ var StyledLabel = import_styled_components22.default.span`
|
|
|
7385
7407
|
grid-row: 2;
|
|
7386
7408
|
text-align: left;
|
|
7387
7409
|
`;
|
|
7388
|
-
var ActionButton = (0,
|
|
7410
|
+
var ActionButton = (0, import_react21.forwardRef)(
|
|
7389
7411
|
({
|
|
7390
7412
|
icon,
|
|
7391
7413
|
colorScheme = "default",
|
|
@@ -7429,7 +7451,7 @@ var ActionButton = (0, import_react20.forwardRef)(
|
|
|
7429
7451
|
ActionButton.displayName = "ActionButton";
|
|
7430
7452
|
|
|
7431
7453
|
// src/components/Avatar/Avatar.tsx
|
|
7432
|
-
var
|
|
7454
|
+
var import_react22 = require("react");
|
|
7433
7455
|
var import_type_guards18 = require("@wistia/type-guards");
|
|
7434
7456
|
var import_styled_components25 = __toESM(require("styled-components"));
|
|
7435
7457
|
|
|
@@ -7637,8 +7659,8 @@ var Avatar = ({
|
|
|
7637
7659
|
onImageLoad,
|
|
7638
7660
|
...props
|
|
7639
7661
|
}) => {
|
|
7640
|
-
const [imageLoadState, setImageLoadState] = (0,
|
|
7641
|
-
(0,
|
|
7662
|
+
const [imageLoadState, setImageLoadState] = (0, import_react22.useState)("loading");
|
|
7663
|
+
(0, import_react22.useEffect)(() => {
|
|
7642
7664
|
setImageLoadState("loading");
|
|
7643
7665
|
}, [imageUrl]);
|
|
7644
7666
|
const handleImageLoad = () => {
|
|
@@ -7650,7 +7672,7 @@ var Avatar = ({
|
|
|
7650
7672
|
onImageLoad?.({ state: "error", type: "initials" });
|
|
7651
7673
|
};
|
|
7652
7674
|
const avatarSize = heightAndWidth ?? avatarSizeMap[size];
|
|
7653
|
-
const avatarColor = (0,
|
|
7675
|
+
const avatarColor = (0, import_react22.useMemo)(() => chooseColorScheme(name), [name]);
|
|
7654
7676
|
return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
7655
7677
|
AvatarWrapper,
|
|
7656
7678
|
{
|
|
@@ -7677,7 +7699,7 @@ var Avatar = ({
|
|
|
7677
7699
|
Avatar.displayName = "Avatar";
|
|
7678
7700
|
|
|
7679
7701
|
// src/components/Badge/Badge.tsx
|
|
7680
|
-
var
|
|
7702
|
+
var import_react23 = require("react");
|
|
7681
7703
|
var import_styled_components26 = __toESM(require("styled-components"));
|
|
7682
7704
|
var import_type_guards19 = require("@wistia/type-guards");
|
|
7683
7705
|
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
@@ -7701,7 +7723,7 @@ var StyledBadge = import_styled_components26.default.div`
|
|
|
7701
7723
|
width: 12px;
|
|
7702
7724
|
}
|
|
7703
7725
|
`;
|
|
7704
|
-
var Badge = (0,
|
|
7726
|
+
var Badge = (0, import_react23.forwardRef)(
|
|
7705
7727
|
({ colorScheme = "inherit", label, icon, ...props }, ref) => {
|
|
7706
7728
|
const hasIcon = (0, import_type_guards19.isNotNil)(icon);
|
|
7707
7729
|
return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(
|
|
@@ -7722,7 +7744,7 @@ var Badge = (0, import_react22.forwardRef)(
|
|
|
7722
7744
|
Badge.displayName = "Badge";
|
|
7723
7745
|
|
|
7724
7746
|
// src/components/Box/Box.tsx
|
|
7725
|
-
var
|
|
7747
|
+
var import_react24 = require("react");
|
|
7726
7748
|
var import_styled_components27 = __toESM(require("styled-components"));
|
|
7727
7749
|
var import_type_guards20 = require("@wistia/type-guards");
|
|
7728
7750
|
|
|
@@ -7831,13 +7853,13 @@ var StyledBoxComponent = import_styled_components27.default.div`
|
|
|
7831
7853
|
var wrapChildren = (children) => {
|
|
7832
7854
|
if ((0, import_type_guards20.isNotNil)(children)) {
|
|
7833
7855
|
if (typeof children === "object" && isDev) {
|
|
7834
|
-
return
|
|
7856
|
+
return import_react24.Children.map(children, (child) => {
|
|
7835
7857
|
if ((0, import_type_guards20.isNil)(child)) return null;
|
|
7836
7858
|
const elementParams = {};
|
|
7837
7859
|
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
7838
7860
|
elementParams.hasBoxParent = true;
|
|
7839
7861
|
}
|
|
7840
|
-
return (0,
|
|
7862
|
+
return (0, import_react24.cloneElement)(child, elementParams);
|
|
7841
7863
|
});
|
|
7842
7864
|
}
|
|
7843
7865
|
return children;
|
|
@@ -7845,7 +7867,7 @@ var wrapChildren = (children) => {
|
|
|
7845
7867
|
return null;
|
|
7846
7868
|
};
|
|
7847
7869
|
var DEFAULT_ELEMENT = "div";
|
|
7848
|
-
var BoxComponent = (0,
|
|
7870
|
+
var BoxComponent = (0, import_react24.forwardRef)(
|
|
7849
7871
|
({
|
|
7850
7872
|
alignContent = "stretch",
|
|
7851
7873
|
alignItems = "flex-start",
|
|
@@ -7928,7 +7950,7 @@ BoxComponent.displayName = "Box";
|
|
|
7928
7950
|
var Box = makePolymorphic(BoxComponent);
|
|
7929
7951
|
|
|
7930
7952
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
7931
|
-
var
|
|
7953
|
+
var import_react25 = require("react");
|
|
7932
7954
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
7933
7955
|
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
7934
7956
|
var StyledBreadcrumbs = import_styled_components28.default.nav`
|
|
@@ -7944,7 +7966,7 @@ var StyledBreadcrumbs = import_styled_components28.default.nav`
|
|
|
7944
7966
|
var BUFFER_WIDTH = 10;
|
|
7945
7967
|
var Breadcrumbs = ({ children, ...props }) => {
|
|
7946
7968
|
const { isXsAndDown } = useMq();
|
|
7947
|
-
let crumbs =
|
|
7969
|
+
let crumbs = import_react25.Children.toArray(children);
|
|
7948
7970
|
if (isXsAndDown) {
|
|
7949
7971
|
crumbs = crumbs.slice(-1);
|
|
7950
7972
|
}
|
|
@@ -8133,7 +8155,7 @@ var Card = ({
|
|
|
8133
8155
|
Card.displayName = "Card";
|
|
8134
8156
|
|
|
8135
8157
|
// src/components/Center/Center.tsx
|
|
8136
|
-
var
|
|
8158
|
+
var import_react26 = require("react");
|
|
8137
8159
|
var import_styled_components32 = __toESM(require("styled-components"));
|
|
8138
8160
|
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8139
8161
|
var StyledCenter = import_styled_components32.default.div`
|
|
@@ -8148,7 +8170,7 @@ var StyledCenter = import_styled_components32.default.div`
|
|
|
8148
8170
|
align-items: center;
|
|
8149
8171
|
`}
|
|
8150
8172
|
`;
|
|
8151
|
-
var Center = (0,
|
|
8173
|
+
var Center = (0, import_react26.forwardRef)(
|
|
8152
8174
|
({ maxWidth = "100%", gutterWidth = "space-00", intrinsic = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8153
8175
|
StyledCenter,
|
|
8154
8176
|
{
|
|
@@ -8164,7 +8186,7 @@ var Center = (0, import_react25.forwardRef)(
|
|
|
8164
8186
|
Center.displayName = "Center";
|
|
8165
8187
|
|
|
8166
8188
|
// src/components/Checkbox/Checkbox.tsx
|
|
8167
|
-
var
|
|
8189
|
+
var import_react27 = require("react");
|
|
8168
8190
|
var import_styled_components36 = __toESM(require("styled-components"));
|
|
8169
8191
|
var import_type_guards25 = require("@wistia/type-guards");
|
|
8170
8192
|
|
|
@@ -8384,7 +8406,7 @@ var StyledHiddenCheckboxInput = import_styled_components36.default.input`
|
|
|
8384
8406
|
display: block;
|
|
8385
8407
|
}
|
|
8386
8408
|
`;
|
|
8387
|
-
var Checkbox = (0,
|
|
8409
|
+
var Checkbox = (0, import_react27.forwardRef)(
|
|
8388
8410
|
({
|
|
8389
8411
|
checked,
|
|
8390
8412
|
disabled = false,
|
|
@@ -8399,7 +8421,7 @@ var Checkbox = (0, import_react26.forwardRef)(
|
|
|
8399
8421
|
hideLabel = false,
|
|
8400
8422
|
...props
|
|
8401
8423
|
}, ref) => {
|
|
8402
|
-
const generatedId = (0,
|
|
8424
|
+
const generatedId = (0, import_react27.useId)();
|
|
8403
8425
|
const computedId = (0, import_type_guards25.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
8404
8426
|
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
8405
8427
|
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
@@ -8442,9 +8464,9 @@ var Checkbox = (0, import_react26.forwardRef)(
|
|
|
8442
8464
|
Checkbox.displayName = "Checkbox";
|
|
8443
8465
|
|
|
8444
8466
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
8445
|
-
var
|
|
8467
|
+
var import_react28 = require("react");
|
|
8446
8468
|
var ClickRegion = ({ children, targetRef }) => {
|
|
8447
|
-
(0,
|
|
8469
|
+
(0, import_react28.useEffect)(() => {
|
|
8448
8470
|
if (targetRef.current && targetRef.current.tagName === "A") {
|
|
8449
8471
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
8450
8472
|
} else if (targetRef.current && targetRef.current.tagName === "BUTTON") {
|
|
@@ -8452,7 +8474,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8452
8474
|
} else {
|
|
8453
8475
|
}
|
|
8454
8476
|
}, [targetRef]);
|
|
8455
|
-
const handleClick = (0,
|
|
8477
|
+
const handleClick = (0, import_react28.useCallback)(
|
|
8456
8478
|
(event) => {
|
|
8457
8479
|
const node = targetRef.current;
|
|
8458
8480
|
if (event.target instanceof HTMLAnchorElement && !event.target.hasAttribute("data-click-region-target-link") || event.target instanceof HTMLButtonElement && !event.target.hasAttribute("data-click-region-target-button")) {
|
|
@@ -8469,7 +8491,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8469
8491
|
},
|
|
8470
8492
|
[targetRef]
|
|
8471
8493
|
);
|
|
8472
|
-
return (0,
|
|
8494
|
+
return (0, import_react28.cloneElement)(import_react28.Children.only(children), {
|
|
8473
8495
|
"data-click-region": true,
|
|
8474
8496
|
onClick: handleClick
|
|
8475
8497
|
});
|
|
@@ -8502,11 +8524,11 @@ var Collapsible = ({
|
|
|
8502
8524
|
Collapsible.displayName = "Collapsible";
|
|
8503
8525
|
|
|
8504
8526
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
8505
|
-
var
|
|
8527
|
+
var import_react29 = require("react");
|
|
8506
8528
|
var import_react_collapsible2 = require("@radix-ui/react-collapsible");
|
|
8507
8529
|
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
8508
8530
|
var CollapsibleTrigger = ({ children }) => {
|
|
8509
|
-
|
|
8531
|
+
import_react29.Children.only(children);
|
|
8510
8532
|
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
|
|
8511
8533
|
};
|
|
8512
8534
|
|
|
@@ -8533,7 +8555,7 @@ var import_styled_components40 = __toESM(require("styled-components"));
|
|
|
8533
8555
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8534
8556
|
|
|
8535
8557
|
// src/components/Heading/Heading.tsx
|
|
8536
|
-
var
|
|
8558
|
+
var import_react30 = require("react");
|
|
8537
8559
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8538
8560
|
var import_type_guards28 = require("@wistia/type-guards");
|
|
8539
8561
|
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
@@ -8629,7 +8651,7 @@ var variantElementMap = {
|
|
|
8629
8651
|
heading5: "h5",
|
|
8630
8652
|
heading6: "h6"
|
|
8631
8653
|
};
|
|
8632
|
-
var HeadingComponent = (0,
|
|
8654
|
+
var HeadingComponent = (0, import_react30.forwardRef)(
|
|
8633
8655
|
({
|
|
8634
8656
|
align = "left",
|
|
8635
8657
|
colorScheme = "inherit",
|
|
@@ -8793,7 +8815,7 @@ DataCards.displayName = "DataCards";
|
|
|
8793
8815
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8794
8816
|
|
|
8795
8817
|
// src/components/Text/Text.tsx
|
|
8796
|
-
var
|
|
8818
|
+
var import_react31 = require("react");
|
|
8797
8819
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
8798
8820
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8799
8821
|
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
@@ -8968,7 +8990,7 @@ var StyledText = import_styled_components42.default.div`
|
|
|
8968
8990
|
}
|
|
8969
8991
|
`}
|
|
8970
8992
|
`;
|
|
8971
|
-
var TextComponent = (0,
|
|
8993
|
+
var TextComponent = (0, import_react31.forwardRef)(
|
|
8972
8994
|
({
|
|
8973
8995
|
align = "left",
|
|
8974
8996
|
colorScheme = "inherit",
|
|
@@ -9081,7 +9103,7 @@ Divider.displayName = "Divider";
|
|
|
9081
9103
|
|
|
9082
9104
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9083
9105
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
9084
|
-
var
|
|
9106
|
+
var import_react33 = require("react");
|
|
9085
9107
|
|
|
9086
9108
|
// src/components/Tooltip/Tooltip.tsx
|
|
9087
9109
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
@@ -9179,7 +9201,7 @@ var Tooltip = ({
|
|
|
9179
9201
|
Tooltip.displayName = "Tooltip";
|
|
9180
9202
|
|
|
9181
9203
|
// src/components/Input/Input.tsx
|
|
9182
|
-
var
|
|
9204
|
+
var import_react32 = require("react");
|
|
9183
9205
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9184
9206
|
var import_type_guards31 = require("@wistia/type-guards");
|
|
9185
9207
|
|
|
@@ -9314,7 +9336,7 @@ var StyledInputContainer = import_styled_components47.default.div`
|
|
|
9314
9336
|
padding-right: 32px;
|
|
9315
9337
|
}
|
|
9316
9338
|
`;
|
|
9317
|
-
var Input = (0,
|
|
9339
|
+
var Input = (0, import_react32.forwardRef)(
|
|
9318
9340
|
({
|
|
9319
9341
|
fullWidth = true,
|
|
9320
9342
|
monospace = false,
|
|
@@ -9324,7 +9346,7 @@ var Input = (0, import_react31.forwardRef)(
|
|
|
9324
9346
|
rightIcon,
|
|
9325
9347
|
...props
|
|
9326
9348
|
}, externalRef) => {
|
|
9327
|
-
const internalRef = (0,
|
|
9349
|
+
const internalRef = (0, import_react32.useRef)();
|
|
9328
9350
|
const ref = (
|
|
9329
9351
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
9330
9352
|
(0, import_type_guards31.isNotNil)(externalRef) && (0, import_type_guards31.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
@@ -9334,14 +9356,14 @@ var Input = (0, import_react31.forwardRef)(
|
|
|
9334
9356
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(Icon, { type: "search" });
|
|
9335
9357
|
}
|
|
9336
9358
|
if ((0, import_type_guards31.isNotNil)(leftIconToDisplay)) {
|
|
9337
|
-
leftIconToDisplay = (0,
|
|
9359
|
+
leftIconToDisplay = (0, import_react32.cloneElement)(leftIconToDisplay, {
|
|
9338
9360
|
size: "md",
|
|
9339
9361
|
className: "wui-input-left-icon"
|
|
9340
9362
|
});
|
|
9341
9363
|
}
|
|
9342
9364
|
let rightIconToDisplay = rightIcon;
|
|
9343
9365
|
if ((0, import_type_guards31.isNotNil)(rightIconToDisplay)) {
|
|
9344
|
-
rightIconToDisplay = (0,
|
|
9366
|
+
rightIconToDisplay = (0, import_react32.cloneElement)(rightIconToDisplay, {
|
|
9345
9367
|
size: "md",
|
|
9346
9368
|
className: "wui-input-right-icon"
|
|
9347
9369
|
});
|
|
@@ -9433,11 +9455,11 @@ var EditableHeading = ({
|
|
|
9433
9455
|
__forceEditing = false,
|
|
9434
9456
|
editingDisabled = false
|
|
9435
9457
|
}) => {
|
|
9436
|
-
const [isEditing, setIsEditing] = (0,
|
|
9437
|
-
const [value, setValue] = (0,
|
|
9438
|
-
const [previousValue, setPreviousValue] = (0,
|
|
9439
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
9440
|
-
const headingRef = (0,
|
|
9458
|
+
const [isEditing, setIsEditing] = (0, import_react33.useState)(false);
|
|
9459
|
+
const [value, setValue] = (0, import_react33.useState)(children);
|
|
9460
|
+
const [previousValue, setPreviousValue] = (0, import_react33.useState)(children);
|
|
9461
|
+
const [headingHeight, setHeadingHeight] = (0, import_react33.useState)("60");
|
|
9462
|
+
const headingRef = (0, import_react33.useRef)(null);
|
|
9441
9463
|
const handleSetEditing = (editing) => {
|
|
9442
9464
|
if (editingDisabled) return;
|
|
9443
9465
|
if (editing && headingRef.current) {
|
|
@@ -9516,12 +9538,12 @@ var EditableHeading = ({
|
|
|
9516
9538
|
};
|
|
9517
9539
|
|
|
9518
9540
|
// src/components/Form/Form.tsx
|
|
9519
|
-
var
|
|
9541
|
+
var import_react35 = require("react");
|
|
9520
9542
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
9521
9543
|
var import_type_guards32 = require("@wistia/type-guards");
|
|
9522
9544
|
|
|
9523
9545
|
// src/components/Stack/Stack.tsx
|
|
9524
|
-
var
|
|
9546
|
+
var import_react34 = require("react");
|
|
9525
9547
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9526
9548
|
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9527
9549
|
var DEFAULT_ELEMENT4 = "div";
|
|
@@ -9531,7 +9553,7 @@ var StyledStack = import_styled_components49.default.div`
|
|
|
9531
9553
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9532
9554
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
9533
9555
|
`;
|
|
9534
|
-
var StackComponent = (0,
|
|
9556
|
+
var StackComponent = (0, import_react34.forwardRef)(
|
|
9535
9557
|
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9536
9558
|
const responsiveGap = useResponsiveProp(gap);
|
|
9537
9559
|
const responsiveDirection = useResponsiveProp(direction);
|
|
@@ -9560,7 +9582,7 @@ var StyledForm = import_styled_components50.default.form`
|
|
|
9560
9582
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9561
9583
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9562
9584
|
`;
|
|
9563
|
-
var FormContext = (0,
|
|
9585
|
+
var FormContext = (0, import_react35.createContext)({
|
|
9564
9586
|
values: {},
|
|
9565
9587
|
errors: {},
|
|
9566
9588
|
hasSubmitted: false,
|
|
@@ -9576,11 +9598,11 @@ var FormComponent = ({
|
|
|
9576
9598
|
fullWidth = false,
|
|
9577
9599
|
...props
|
|
9578
9600
|
}, forwardedRef) => {
|
|
9579
|
-
const [errors, setErrors] = (0,
|
|
9580
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
9581
|
-
const innerRef = (0,
|
|
9601
|
+
const [errors, setErrors] = (0, import_react35.useState)({});
|
|
9602
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react35.useState)(false);
|
|
9603
|
+
const innerRef = (0, import_react35.useRef)();
|
|
9582
9604
|
const ref = forwardedRef ?? innerRef;
|
|
9583
|
-
const autoId = (0,
|
|
9605
|
+
const autoId = (0, import_react35.useId)();
|
|
9584
9606
|
const id = props.id ?? autoId;
|
|
9585
9607
|
const handleValidate = (nextFormData) => {
|
|
9586
9608
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
@@ -9622,7 +9644,7 @@ var FormComponent = ({
|
|
|
9622
9644
|
void action(null);
|
|
9623
9645
|
}
|
|
9624
9646
|
};
|
|
9625
|
-
const context = (0,
|
|
9647
|
+
const context = (0, import_react35.useMemo)(() => {
|
|
9626
9648
|
return {
|
|
9627
9649
|
values,
|
|
9628
9650
|
errors,
|
|
@@ -9651,15 +9673,15 @@ var FormComponent = ({
|
|
|
9651
9673
|
);
|
|
9652
9674
|
};
|
|
9653
9675
|
FormComponent.displayName = "Form";
|
|
9654
|
-
var Form = (0,
|
|
9676
|
+
var Form = (0, import_react35.forwardRef)(FormComponent);
|
|
9655
9677
|
|
|
9656
9678
|
// src/components/Form/useFormState.tsx
|
|
9657
|
-
var
|
|
9679
|
+
var import_react36 = require("react");
|
|
9658
9680
|
var useFormState = (action, initialData = {}) => {
|
|
9659
|
-
const [data, setData] = (0,
|
|
9660
|
-
const [isPending, setIsPending] = (0,
|
|
9661
|
-
const [error, setError] = (0,
|
|
9662
|
-
const formAction = (0,
|
|
9681
|
+
const [data, setData] = (0, import_react36.useState)(initialData);
|
|
9682
|
+
const [isPending, setIsPending] = (0, import_react36.useState)(false);
|
|
9683
|
+
const [error, setError] = (0, import_react36.useState)(null);
|
|
9684
|
+
const formAction = (0, import_react36.useCallback)(
|
|
9663
9685
|
async (nextFormData) => {
|
|
9664
9686
|
if (nextFormData === null) {
|
|
9665
9687
|
setData(initialData);
|
|
@@ -9690,15 +9712,15 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9690
9712
|
};
|
|
9691
9713
|
|
|
9692
9714
|
// src/components/Form/FormErrorSummary.tsx
|
|
9693
|
-
var
|
|
9715
|
+
var import_react37 = require("react");
|
|
9694
9716
|
var import_type_guards33 = require("@wistia/type-guards");
|
|
9695
9717
|
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9696
9718
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9697
9719
|
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9698
9720
|
};
|
|
9699
9721
|
var FormErrorSummary = ({ description }) => {
|
|
9700
|
-
const ref = (0,
|
|
9701
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
9722
|
+
const ref = (0, import_react37.useRef)(null);
|
|
9723
|
+
const { formId, errors, hasSubmitted } = (0, import_react37.useContext)(FormContext);
|
|
9702
9724
|
const isValid = Object.keys(errors).length === 0;
|
|
9703
9725
|
if (isValid || !hasSubmitted) {
|
|
9704
9726
|
return null;
|
|
@@ -9728,7 +9750,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9728
9750
|
};
|
|
9729
9751
|
|
|
9730
9752
|
// src/components/FormField/FormField.tsx
|
|
9731
|
-
var
|
|
9753
|
+
var import_react40 = require("react");
|
|
9732
9754
|
var import_styled_components53 = __toESM(require("styled-components"));
|
|
9733
9755
|
var import_type_guards34 = require("@wistia/type-guards");
|
|
9734
9756
|
|
|
@@ -9793,11 +9815,11 @@ var Label = ({
|
|
|
9793
9815
|
Label.displayName = "Label";
|
|
9794
9816
|
|
|
9795
9817
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9796
|
-
var
|
|
9818
|
+
var import_react39 = require("react");
|
|
9797
9819
|
|
|
9798
9820
|
// src/components/FormGroup/FormGroup.tsx
|
|
9799
9821
|
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9800
|
-
var
|
|
9822
|
+
var import_react38 = require("react");
|
|
9801
9823
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9802
9824
|
var StyledFieldset = import_styled_components52.default.fieldset`
|
|
9803
9825
|
border: 0;
|
|
@@ -9806,7 +9828,7 @@ var StyledLegend = import_styled_components52.default.legend`
|
|
|
9806
9828
|
margin-bottom: var(--space-01);
|
|
9807
9829
|
`;
|
|
9808
9830
|
var FormGroup = ({ children, label, ...props }) => {
|
|
9809
|
-
const ref = (0,
|
|
9831
|
+
const ref = (0, import_react38.useRef)();
|
|
9810
9832
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
9811
9833
|
Stack,
|
|
9812
9834
|
{
|
|
@@ -9831,7 +9853,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
9831
9853
|
|
|
9832
9854
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9833
9855
|
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9834
|
-
var CheckboxGroupContext = (0,
|
|
9856
|
+
var CheckboxGroupContext = (0, import_react39.createContext)(null);
|
|
9835
9857
|
var CheckboxGroup = ({
|
|
9836
9858
|
children,
|
|
9837
9859
|
name,
|
|
@@ -9839,7 +9861,7 @@ var CheckboxGroup = ({
|
|
|
9839
9861
|
value,
|
|
9840
9862
|
...props
|
|
9841
9863
|
}) => {
|
|
9842
|
-
const context = (0,
|
|
9864
|
+
const context = (0, import_react39.useMemo)(() => {
|
|
9843
9865
|
return {
|
|
9844
9866
|
name,
|
|
9845
9867
|
onChange
|
|
@@ -9924,8 +9946,8 @@ var FormField = ({
|
|
|
9924
9946
|
value,
|
|
9925
9947
|
...props
|
|
9926
9948
|
}) => {
|
|
9927
|
-
const formState = (0,
|
|
9928
|
-
const checkboxGroup = (0,
|
|
9949
|
+
const formState = (0, import_react40.useContext)(FormContext);
|
|
9950
|
+
const checkboxGroup = (0, import_react40.useContext)(CheckboxGroupContext);
|
|
9929
9951
|
const defaultValue = formState.values[name];
|
|
9930
9952
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9931
9953
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -9963,7 +9985,7 @@ var FormField = ({
|
|
|
9963
9985
|
"aria-invalid": (0, import_type_guards34.isNotNil)(error)
|
|
9964
9986
|
};
|
|
9965
9987
|
}
|
|
9966
|
-
|
|
9988
|
+
import_react40.Children.only(children);
|
|
9967
9989
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(
|
|
9968
9990
|
StyledFormField,
|
|
9969
9991
|
{
|
|
@@ -9972,7 +9994,7 @@ var FormField = ({
|
|
|
9972
9994
|
children: [
|
|
9973
9995
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
9974
9996
|
(0, import_type_guards34.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9975
|
-
(0,
|
|
9997
|
+
(0, import_react40.cloneElement)(children, childProps),
|
|
9976
9998
|
(0, import_type_guards34.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(import_jsx_runtime227.Fragment, { children: [
|
|
9977
9999
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("div", {}),
|
|
9978
10000
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
@@ -9990,9 +10012,9 @@ var FormField = ({
|
|
|
9990
10012
|
FormField.displayName = "FormField";
|
|
9991
10013
|
|
|
9992
10014
|
// src/components/FormGroup/RadioGroup.tsx
|
|
9993
|
-
var
|
|
10015
|
+
var import_react41 = require("react");
|
|
9994
10016
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
9995
|
-
var RadioGroupContext = (0,
|
|
10017
|
+
var RadioGroupContext = (0, import_react41.createContext)(null);
|
|
9996
10018
|
var RadioGroup = ({
|
|
9997
10019
|
children,
|
|
9998
10020
|
name,
|
|
@@ -10000,7 +10022,7 @@ var RadioGroup = ({
|
|
|
10000
10022
|
value,
|
|
10001
10023
|
...props
|
|
10002
10024
|
}) => {
|
|
10003
|
-
const context = (0,
|
|
10025
|
+
const context = (0, import_react41.useMemo)(() => {
|
|
10004
10026
|
return {
|
|
10005
10027
|
name,
|
|
10006
10028
|
onChange
|
|
@@ -10011,7 +10033,7 @@ var RadioGroup = ({
|
|
|
10011
10033
|
RadioGroup.displayName = "RadioGroup";
|
|
10012
10034
|
|
|
10013
10035
|
// src/components/IconButton/IconButton.tsx
|
|
10014
|
-
var
|
|
10036
|
+
var import_react42 = require("react");
|
|
10015
10037
|
var import_styled_components54 = __toESM(require("styled-components"));
|
|
10016
10038
|
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
10017
10039
|
var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
@@ -10028,7 +10050,7 @@ var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
|
10028
10050
|
align-items: center;
|
|
10029
10051
|
line-height: 1;
|
|
10030
10052
|
`;
|
|
10031
|
-
var IconButton = (0,
|
|
10053
|
+
var IconButton = (0, import_react42.forwardRef)(
|
|
10032
10054
|
({ children, label, size = "md", ...props }, ref) => {
|
|
10033
10055
|
const responsiveSize = useResponsiveProp(size);
|
|
10034
10056
|
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
@@ -10039,7 +10061,7 @@ var IconButton = (0, import_react41.forwardRef)(
|
|
|
10039
10061
|
"aria-label": label,
|
|
10040
10062
|
"data-wistia-ui-icon-button": true,
|
|
10041
10063
|
size: responsiveSize,
|
|
10042
|
-
children: (0,
|
|
10064
|
+
children: (0, import_react42.cloneElement)(import_react42.Children.only(children), {
|
|
10043
10065
|
size: responsiveSize
|
|
10044
10066
|
})
|
|
10045
10067
|
}
|
|
@@ -10050,7 +10072,7 @@ IconButton.displayName = "IconButton";
|
|
|
10050
10072
|
|
|
10051
10073
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
10052
10074
|
var import_styled_components55 = __toESM(require("styled-components"));
|
|
10053
|
-
var
|
|
10075
|
+
var import_react43 = require("react");
|
|
10054
10076
|
var import_type_guards35 = require("@wistia/type-guards");
|
|
10055
10077
|
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
10056
10078
|
var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
@@ -10063,10 +10085,10 @@ var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
|
10063
10085
|
}
|
|
10064
10086
|
`;
|
|
10065
10087
|
var COPY_SUCCESS_DURATION = 2e3;
|
|
10066
|
-
var InputClickToCopy = (0,
|
|
10088
|
+
var InputClickToCopy = (0, import_react43.forwardRef)(
|
|
10067
10089
|
({ value, onCopy, ...props }, ref) => {
|
|
10068
|
-
const [isCopied, setIsCopied] = (0,
|
|
10069
|
-
(0,
|
|
10090
|
+
const [isCopied, setIsCopied] = (0, import_react43.useState)(false);
|
|
10091
|
+
(0, import_react43.useEffect)(() => {
|
|
10070
10092
|
if (isCopied) {
|
|
10071
10093
|
const timeout = setTimeout(() => {
|
|
10072
10094
|
setIsCopied(false);
|
|
@@ -10116,12 +10138,12 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
10116
10138
|
var import_styled_components56 = __toESM(require("styled-components"));
|
|
10117
10139
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
10118
10140
|
var import_type_guards36 = require("@wistia/type-guards");
|
|
10119
|
-
var
|
|
10141
|
+
var import_react45 = require("react");
|
|
10120
10142
|
|
|
10121
10143
|
// src/components/Menu/MenuContext.tsx
|
|
10122
|
-
var
|
|
10123
|
-
var MenuContext = (0,
|
|
10124
|
-
var useMenuContext = () => (0,
|
|
10144
|
+
var import_react44 = require("react");
|
|
10145
|
+
var MenuContext = (0, import_react44.createContext)({ compact: false });
|
|
10146
|
+
var useMenuContext = () => (0, import_react44.useContext)(MenuContext);
|
|
10125
10147
|
|
|
10126
10148
|
// src/components/Menu/Menu.tsx
|
|
10127
10149
|
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
@@ -10225,7 +10247,7 @@ var Menu = ({
|
|
|
10225
10247
|
onInteractOutside,
|
|
10226
10248
|
...props
|
|
10227
10249
|
}) => {
|
|
10228
|
-
const contextValue = (0,
|
|
10250
|
+
const contextValue = (0, import_react45.useMemo)(() => ({ compact }), [compact]);
|
|
10229
10251
|
let controlProps = {
|
|
10230
10252
|
...(0, import_type_guards36.isNotNil)(onOpenChange) && (0, import_type_guards36.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
10231
10253
|
};
|
|
@@ -10299,13 +10321,13 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
10299
10321
|
MenuLabel.displayName = "MenuLabel";
|
|
10300
10322
|
|
|
10301
10323
|
// src/components/Menu/SubMenu.tsx
|
|
10302
|
-
var
|
|
10324
|
+
var import_react47 = require("react");
|
|
10303
10325
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
10304
10326
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
10305
10327
|
var import_type_guards38 = require("@wistia/type-guards");
|
|
10306
10328
|
|
|
10307
10329
|
// src/components/Menu/MenuItemButton.tsx
|
|
10308
|
-
var
|
|
10330
|
+
var import_react46 = require("react");
|
|
10309
10331
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
10310
10332
|
var import_type_guards37 = require("@wistia/type-guards");
|
|
10311
10333
|
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
@@ -10382,7 +10404,7 @@ var StyledBadgeContainer = import_styled_components58.default.div`
|
|
|
10382
10404
|
font-size: var(--wui-typography-label-4-size);
|
|
10383
10405
|
color: var(--wui-color-text-secondary);
|
|
10384
10406
|
`;
|
|
10385
|
-
var MenuItemButton = (0,
|
|
10407
|
+
var MenuItemButton = (0, import_react46.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
10386
10408
|
let { colorScheme, badge } = props;
|
|
10387
10409
|
if (appearance === "dangerous") {
|
|
10388
10410
|
if ((0, import_type_guards37.isNotUndefined)(colorScheme)) {
|
|
@@ -10478,7 +10500,7 @@ var SubMenu = ({
|
|
|
10478
10500
|
...props
|
|
10479
10501
|
}) => {
|
|
10480
10502
|
const { isSmAndUp } = useMq();
|
|
10481
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
10503
|
+
const [isExpanded, setIsExpanded] = (0, import_react47.useState)(false);
|
|
10482
10504
|
const { compact } = useMenuContext();
|
|
10483
10505
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
10484
10506
|
/* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
@@ -10507,10 +10529,10 @@ var SubMenu = ({
|
|
|
10507
10529
|
SubMenu.displayName = "SubMenu";
|
|
10508
10530
|
|
|
10509
10531
|
// src/components/Menu/MenuItem.tsx
|
|
10510
|
-
var
|
|
10532
|
+
var import_react48 = require("react");
|
|
10511
10533
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
10512
10534
|
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
10513
|
-
var MenuItem = (0,
|
|
10535
|
+
var MenuItem = (0, import_react48.forwardRef)(
|
|
10514
10536
|
({ onSelect = () => null, ...props }, ref) => {
|
|
10515
10537
|
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
10516
10538
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
@@ -10662,7 +10684,7 @@ var CheckboxMenuItem = ({
|
|
|
10662
10684
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
10663
10685
|
|
|
10664
10686
|
// src/components/Modal/Modal.tsx
|
|
10665
|
-
var
|
|
10687
|
+
var import_react52 = require("react");
|
|
10666
10688
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
10667
10689
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
10668
10690
|
var import_type_guards41 = require("@wistia/type-guards");
|
|
@@ -10722,19 +10744,19 @@ var ModalHeader = ({
|
|
|
10722
10744
|
};
|
|
10723
10745
|
|
|
10724
10746
|
// src/components/Modal/ModalContent.tsx
|
|
10725
|
-
var
|
|
10747
|
+
var import_react50 = require("react");
|
|
10726
10748
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
10727
10749
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
10728
10750
|
|
|
10729
10751
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10730
|
-
var
|
|
10752
|
+
var import_react49 = require("react");
|
|
10731
10753
|
var import_type_guards40 = require("@wistia/type-guards");
|
|
10732
10754
|
var useFocusRestore = () => {
|
|
10733
|
-
const previouslyFocusedRef = (0,
|
|
10734
|
-
(0,
|
|
10755
|
+
const previouslyFocusedRef = (0, import_react49.useRef)(null);
|
|
10756
|
+
(0, import_react49.useEffect)(() => {
|
|
10735
10757
|
previouslyFocusedRef.current = document.activeElement;
|
|
10736
10758
|
}, []);
|
|
10737
|
-
(0,
|
|
10759
|
+
(0, import_react49.useEffect)(() => {
|
|
10738
10760
|
return () => {
|
|
10739
10761
|
if ((0, import_type_guards40.isNotNil)(previouslyFocusedRef.current)) {
|
|
10740
10762
|
setTimeout(() => {
|
|
@@ -10788,7 +10810,7 @@ var StyledModalContent = (0, import_styled_components63.default)(import_react_di
|
|
|
10788
10810
|
}
|
|
10789
10811
|
}
|
|
10790
10812
|
`;
|
|
10791
|
-
var ModalContent = (0,
|
|
10813
|
+
var ModalContent = (0, import_react50.forwardRef)(
|
|
10792
10814
|
({ fullHeight, width, children, ...props }, ref) => {
|
|
10793
10815
|
useFocusRestore();
|
|
10794
10816
|
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
@@ -10806,7 +10828,7 @@ var ModalContent = (0, import_react49.forwardRef)(
|
|
|
10806
10828
|
);
|
|
10807
10829
|
|
|
10808
10830
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
10809
|
-
var
|
|
10831
|
+
var import_react51 = require("react");
|
|
10810
10832
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
10811
10833
|
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
10812
10834
|
var backdropAnimationDuration = 150;
|
|
@@ -10834,6 +10856,11 @@ var BackdropComponent = import_styled_components64.default.div`
|
|
|
10834
10856
|
position: fixed;
|
|
10835
10857
|
z-index: var(--wui-zindex-backdrop);
|
|
10836
10858
|
|
|
10859
|
+
@media (prefers-reduced-motion: reduce) {
|
|
10860
|
+
animation: none;
|
|
10861
|
+
opacity: 1;
|
|
10862
|
+
}
|
|
10863
|
+
|
|
10837
10864
|
@keyframes backdropShow {
|
|
10838
10865
|
from {
|
|
10839
10866
|
opacity: 0;
|
|
@@ -10844,7 +10871,7 @@ var BackdropComponent = import_styled_components64.default.div`
|
|
|
10844
10871
|
}
|
|
10845
10872
|
}
|
|
10846
10873
|
`;
|
|
10847
|
-
var Backdrop = (0,
|
|
10874
|
+
var Backdrop = (0, import_react51.forwardRef)(
|
|
10848
10875
|
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
10849
10876
|
BackdropComponent,
|
|
10850
10877
|
{
|
|
@@ -10866,7 +10893,7 @@ var ModalBody = import_styled_components65.default.div`
|
|
|
10866
10893
|
display: flex;
|
|
10867
10894
|
order: 2;
|
|
10868
10895
|
`;
|
|
10869
|
-
var Modal = (0,
|
|
10896
|
+
var Modal = (0, import_react52.forwardRef)(
|
|
10870
10897
|
({
|
|
10871
10898
|
children,
|
|
10872
10899
|
fullHeight = false,
|
|
@@ -11080,7 +11107,7 @@ var ProgressBar = ({
|
|
|
11080
11107
|
ProgressBar.displayName = "ProgressBar";
|
|
11081
11108
|
|
|
11082
11109
|
// src/components/Radio/Radio.tsx
|
|
11083
|
-
var
|
|
11110
|
+
var import_react53 = require("react");
|
|
11084
11111
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11085
11112
|
var import_type_guards44 = require("@wistia/type-guards");
|
|
11086
11113
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
@@ -11183,7 +11210,7 @@ var StyledHiddenRadioInput = import_styled_components68.default.input`
|
|
|
11183
11210
|
display: block;
|
|
11184
11211
|
}
|
|
11185
11212
|
`;
|
|
11186
|
-
var Radio = (0,
|
|
11213
|
+
var Radio = (0, import_react53.forwardRef)(
|
|
11187
11214
|
({
|
|
11188
11215
|
checked,
|
|
11189
11216
|
disabled = false,
|
|
@@ -11198,7 +11225,7 @@ var Radio = (0, import_react52.forwardRef)(
|
|
|
11198
11225
|
hideLabel = false,
|
|
11199
11226
|
...props
|
|
11200
11227
|
}, ref) => {
|
|
11201
|
-
const generatedId = (0,
|
|
11228
|
+
const generatedId = (0, import_react53.useId)();
|
|
11202
11229
|
const computedId = (0, import_type_guards44.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11203
11230
|
return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(
|
|
11204
11231
|
StyledRadioWrapper,
|
|
@@ -11248,20 +11275,20 @@ var Radio = (0, import_react52.forwardRef)(
|
|
|
11248
11275
|
Radio.displayName = "Radio";
|
|
11249
11276
|
|
|
11250
11277
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
11251
|
-
var
|
|
11278
|
+
var import_react56 = require("react");
|
|
11252
11279
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11253
11280
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
11254
11281
|
var import_type_guards45 = require("@wistia/type-guards");
|
|
11255
11282
|
|
|
11256
11283
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11257
|
-
var
|
|
11284
|
+
var import_react54 = require("react");
|
|
11258
11285
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
11259
|
-
var SelectedItemStyleContext = (0,
|
|
11286
|
+
var SelectedItemStyleContext = (0, import_react54.createContext)(null);
|
|
11260
11287
|
var SelectedItemStyleProvider = ({
|
|
11261
11288
|
children
|
|
11262
11289
|
}) => {
|
|
11263
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
11264
|
-
const selectedItemIndicatorStyle = (0,
|
|
11290
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react54.useState)(null);
|
|
11291
|
+
const selectedItemIndicatorStyle = (0, import_react54.useMemo)(
|
|
11265
11292
|
() => selectedItemMeasurements != null ? {
|
|
11266
11293
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
11267
11294
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
@@ -11271,7 +11298,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11271
11298
|
},
|
|
11272
11299
|
[selectedItemMeasurements]
|
|
11273
11300
|
);
|
|
11274
|
-
const contextValue = (0,
|
|
11301
|
+
const contextValue = (0, import_react54.useMemo)(
|
|
11275
11302
|
() => ({
|
|
11276
11303
|
setSelectedItemMeasurements,
|
|
11277
11304
|
selectedItemIndicatorStyle
|
|
@@ -11281,7 +11308,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11281
11308
|
return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
11282
11309
|
};
|
|
11283
11310
|
var useSelectedItemStyle = () => {
|
|
11284
|
-
const context = (0,
|
|
11311
|
+
const context = (0, import_react54.useContext)(SelectedItemStyleContext);
|
|
11285
11312
|
if (context === null) {
|
|
11286
11313
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
11287
11314
|
}
|
|
@@ -11292,11 +11319,11 @@ var useSelectedItemStyle = () => {
|
|
|
11292
11319
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
11293
11320
|
|
|
11294
11321
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
11295
|
-
var
|
|
11296
|
-
var SegmentedControlValueContext = (0,
|
|
11322
|
+
var import_react55 = require("react");
|
|
11323
|
+
var SegmentedControlValueContext = (0, import_react55.createContext)(null);
|
|
11297
11324
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
11298
11325
|
var useSegmentedControlValue = () => {
|
|
11299
|
-
const context = (0,
|
|
11326
|
+
const context = (0, import_react55.useContext)(SegmentedControlValueContext);
|
|
11300
11327
|
if (context === null) {
|
|
11301
11328
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
11302
11329
|
}
|
|
@@ -11342,7 +11369,7 @@ var segmentedControlStyles = import_styled_components70.css`
|
|
|
11342
11369
|
var StyledSegmentedControl = (0, import_styled_components70.default)(import_react_toggle_group.Root)`
|
|
11343
11370
|
${segmentedControlStyles}
|
|
11344
11371
|
`;
|
|
11345
|
-
var SegmentedControl = (0,
|
|
11372
|
+
var SegmentedControl = (0, import_react56.forwardRef)(
|
|
11346
11373
|
({
|
|
11347
11374
|
children,
|
|
11348
11375
|
disabled = false,
|
|
@@ -11377,7 +11404,7 @@ var SegmentedControl = (0, import_react55.forwardRef)(
|
|
|
11377
11404
|
SegmentedControl.displayName = "SegmentedControl";
|
|
11378
11405
|
|
|
11379
11406
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
11380
|
-
var
|
|
11407
|
+
var import_react57 = require("react");
|
|
11381
11408
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
11382
11409
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
11383
11410
|
var import_type_guards46 = require("@wistia/type-guards");
|
|
@@ -11445,11 +11472,11 @@ var segmentedControlItemStyles = import_styled_components71.css`
|
|
|
11445
11472
|
var StyledSegmentedControlItem = (0, import_styled_components71.default)(import_react_toggle_group2.Item)`
|
|
11446
11473
|
${segmentedControlItemStyles}
|
|
11447
11474
|
`;
|
|
11448
|
-
var SegmentedControlItem = (0,
|
|
11475
|
+
var SegmentedControlItem = (0, import_react57.forwardRef)(
|
|
11449
11476
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11450
11477
|
const selectedValue = useSegmentedControlValue();
|
|
11451
11478
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
11452
|
-
const buttonRef = (0,
|
|
11479
|
+
const buttonRef = (0, import_react57.useRef)(null);
|
|
11453
11480
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11454
11481
|
const handleClick = (event) => {
|
|
11455
11482
|
const target = event.target;
|
|
@@ -11458,7 +11485,7 @@ var SegmentedControlItem = (0, import_react56.forwardRef)(
|
|
|
11458
11485
|
event.preventDefault();
|
|
11459
11486
|
}
|
|
11460
11487
|
};
|
|
11461
|
-
(0,
|
|
11488
|
+
(0, import_react57.useEffect)(() => {
|
|
11462
11489
|
const buttonElem = buttonRef.current;
|
|
11463
11490
|
if (!buttonElem) {
|
|
11464
11491
|
return void 0;
|
|
@@ -11504,7 +11531,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
11504
11531
|
|
|
11505
11532
|
// src/components/Select/Select.tsx
|
|
11506
11533
|
var import_react_select = require("@radix-ui/react-select");
|
|
11507
|
-
var
|
|
11534
|
+
var import_react58 = require("react");
|
|
11508
11535
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11509
11536
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11510
11537
|
var StyledTrigger = (0, import_styled_components72.default)(import_react_select.Trigger)`
|
|
@@ -11569,7 +11596,7 @@ var StyledContent3 = (0, import_styled_components72.default)(import_react_select
|
|
|
11569
11596
|
max-height: var(--radix-select-content-available-height);
|
|
11570
11597
|
z-index: var(--wui-zindex-select);
|
|
11571
11598
|
`;
|
|
11572
|
-
var Select = (0,
|
|
11599
|
+
var Select = (0, import_react58.forwardRef)(
|
|
11573
11600
|
({
|
|
11574
11601
|
colorScheme = "inherit",
|
|
11575
11602
|
children,
|
|
@@ -11618,7 +11645,7 @@ Select.displayName = "Select";
|
|
|
11618
11645
|
|
|
11619
11646
|
// src/components/Select/SelectOption.tsx
|
|
11620
11647
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11621
|
-
var
|
|
11648
|
+
var import_react59 = require("react");
|
|
11622
11649
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11623
11650
|
var import_type_guards47 = require("@wistia/type-guards");
|
|
11624
11651
|
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
@@ -11649,7 +11676,7 @@ var StyledItem = (0, import_styled_components73.default)(import_react_select2.It
|
|
|
11649
11676
|
var StyledIconContainer = import_styled_components73.default.span`
|
|
11650
11677
|
width: 12px;
|
|
11651
11678
|
`;
|
|
11652
|
-
var SelectOption = (0,
|
|
11679
|
+
var SelectOption = (0, import_react59.forwardRef)(
|
|
11653
11680
|
({ children, selectedDisplayValue, ...props }, forwardedRef) => {
|
|
11654
11681
|
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(
|
|
11655
11682
|
StyledItem,
|
|
@@ -11697,7 +11724,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11697
11724
|
};
|
|
11698
11725
|
|
|
11699
11726
|
// src/components/Switch/Switch.tsx
|
|
11700
|
-
var
|
|
11727
|
+
var import_react60 = require("react");
|
|
11701
11728
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11702
11729
|
var import_type_guards48 = require("@wistia/type-guards");
|
|
11703
11730
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
@@ -11802,7 +11829,7 @@ var StyledHiddenSwitchInput = import_styled_components75.default.input`
|
|
|
11802
11829
|
}
|
|
11803
11830
|
}
|
|
11804
11831
|
`;
|
|
11805
|
-
var Switch = (0,
|
|
11832
|
+
var Switch = (0, import_react60.forwardRef)(
|
|
11806
11833
|
({
|
|
11807
11834
|
checked,
|
|
11808
11835
|
disabled = false,
|
|
@@ -11817,7 +11844,7 @@ var Switch = (0, import_react59.forwardRef)(
|
|
|
11817
11844
|
hideLabel = false,
|
|
11818
11845
|
...props
|
|
11819
11846
|
}, ref) => {
|
|
11820
|
-
const generatedId = (0,
|
|
11847
|
+
const generatedId = (0, import_react60.useId)();
|
|
11821
11848
|
const computedId = (0, import_type_guards48.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11822
11849
|
return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
11823
11850
|
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
@@ -11907,8 +11934,8 @@ var Table = ({
|
|
|
11907
11934
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
11908
11935
|
|
|
11909
11936
|
// src/components/Table/TableSectionContext.ts
|
|
11910
|
-
var
|
|
11911
|
-
var TableSectionContext = (0,
|
|
11937
|
+
var import_react61 = require("react");
|
|
11938
|
+
var TableSectionContext = (0, import_react61.createContext)(null);
|
|
11912
11939
|
|
|
11913
11940
|
// src/components/Table/TableBody.tsx
|
|
11914
11941
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
@@ -11918,7 +11945,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
11918
11945
|
};
|
|
11919
11946
|
|
|
11920
11947
|
// src/components/Table/TableCell.tsx
|
|
11921
|
-
var
|
|
11948
|
+
var import_react62 = require("react");
|
|
11922
11949
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
11923
11950
|
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
11924
11951
|
var sharedStyles = import_styled_components78.css`
|
|
@@ -11939,7 +11966,7 @@ var StyledTd = import_styled_components78.default.td`
|
|
|
11939
11966
|
line-height: var(--wui-typography-body-2-line-height);
|
|
11940
11967
|
`;
|
|
11941
11968
|
var TableCell = ({ children, ...props }) => {
|
|
11942
|
-
const section = (0,
|
|
11969
|
+
const section = (0, import_react62.useContext)(TableSectionContext);
|
|
11943
11970
|
if (section === "head") {
|
|
11944
11971
|
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(StyledTh, { ...props, children });
|
|
11945
11972
|
}
|
|
@@ -11971,7 +11998,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
11971
11998
|
};
|
|
11972
11999
|
|
|
11973
12000
|
// src/components/Tabs/Tabs.tsx
|
|
11974
|
-
var
|
|
12001
|
+
var import_react66 = require("react");
|
|
11975
12002
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
11976
12003
|
var import_type_guards50 = require("@wistia/type-guards");
|
|
11977
12004
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
@@ -12026,17 +12053,17 @@ var TabList = ({
|
|
|
12026
12053
|
TabList.displayName = "TabList";
|
|
12027
12054
|
|
|
12028
12055
|
// src/components/Tabs/TabItem.tsx
|
|
12029
|
-
var
|
|
12056
|
+
var import_react64 = require("react");
|
|
12030
12057
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
12031
12058
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
12032
12059
|
var import_type_guards49 = require("@wistia/type-guards");
|
|
12033
12060
|
|
|
12034
12061
|
// src/components/Tabs/useTabsValue.tsx
|
|
12035
|
-
var
|
|
12036
|
-
var TabsValueContext = (0,
|
|
12062
|
+
var import_react63 = require("react");
|
|
12063
|
+
var TabsValueContext = (0, import_react63.createContext)(null);
|
|
12037
12064
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
12038
12065
|
var useTabsValue = () => {
|
|
12039
|
-
const context = (0,
|
|
12066
|
+
const context = (0, import_react63.useContext)(TabsValueContext);
|
|
12040
12067
|
if (context === null) {
|
|
12041
12068
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
12042
12069
|
}
|
|
@@ -12052,13 +12079,13 @@ var StyledTabItem = (0, import_styled_components84.default)(import_react_tabs3.T
|
|
|
12052
12079
|
outline: none;
|
|
12053
12080
|
}
|
|
12054
12081
|
`;
|
|
12055
|
-
var TabItem = (0,
|
|
12082
|
+
var TabItem = (0, import_react64.forwardRef)(
|
|
12056
12083
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
12057
12084
|
const selectedValue = useTabsValue();
|
|
12058
12085
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
12059
|
-
const buttonRef = (0,
|
|
12086
|
+
const buttonRef = (0, import_react64.useRef)(null);
|
|
12060
12087
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
12061
|
-
(0,
|
|
12088
|
+
(0, import_react64.useEffect)(() => {
|
|
12062
12089
|
const buttonElem = buttonRef.current;
|
|
12063
12090
|
if (!buttonElem) {
|
|
12064
12091
|
return void 0;
|
|
@@ -12102,16 +12129,16 @@ var TabItem = (0, import_react63.forwardRef)(
|
|
|
12102
12129
|
TabItem.displayName = "TabItem";
|
|
12103
12130
|
|
|
12104
12131
|
// src/components/Tabs/extractTabItems.ts
|
|
12105
|
-
var
|
|
12132
|
+
var import_react65 = require("react");
|
|
12106
12133
|
var extractTabItems = (children) => {
|
|
12107
12134
|
const tabItems = [];
|
|
12108
|
-
|
|
12109
|
-
if (!(0,
|
|
12135
|
+
import_react65.Children.forEach(children, (child) => {
|
|
12136
|
+
if (!(0, import_react65.isValidElement)(child)) {
|
|
12110
12137
|
return;
|
|
12111
12138
|
}
|
|
12112
12139
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
12113
12140
|
tabItems.push(child);
|
|
12114
|
-
} else if (child.type ===
|
|
12141
|
+
} else if (child.type === import_react65.Fragment) {
|
|
12115
12142
|
const fragmentElement = child;
|
|
12116
12143
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
12117
12144
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -12158,7 +12185,7 @@ var StyledTabsRoot = (0, import_styled_components86.default)(import_react_tabs4.
|
|
|
12158
12185
|
flex-direction: column;
|
|
12159
12186
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
12160
12187
|
`;
|
|
12161
|
-
var Tabs = (0,
|
|
12188
|
+
var Tabs = (0, import_react66.forwardRef)(
|
|
12162
12189
|
({
|
|
12163
12190
|
children,
|
|
12164
12191
|
fullWidth = true,
|
|
@@ -12170,7 +12197,7 @@ var Tabs = (0, import_react65.forwardRef)(
|
|
|
12170
12197
|
...props
|
|
12171
12198
|
}, ref) => {
|
|
12172
12199
|
const tabItems = extractTabItems(children);
|
|
12173
|
-
const [internalSelectedValue, setInternalSelectedValue] = (0,
|
|
12200
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react66.useState)(defaultSelectedValue);
|
|
12174
12201
|
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
12175
12202
|
defaultValue: defaultSelectedValue,
|
|
12176
12203
|
onValueChange: setInternalSelectedValue
|
|
@@ -12256,15 +12283,15 @@ var Tabs = (0, import_react65.forwardRef)(
|
|
|
12256
12283
|
Tabs.displayName = "Tabs";
|
|
12257
12284
|
|
|
12258
12285
|
// src/components/Tabs/Tab.tsx
|
|
12259
|
-
var
|
|
12286
|
+
var import_react67 = require("react");
|
|
12260
12287
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
12261
|
-
var Tab = (0,
|
|
12288
|
+
var Tab = (0, import_react67.forwardRef)(({ children }, ref) => {
|
|
12262
12289
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("div", { ref, children });
|
|
12263
12290
|
});
|
|
12264
12291
|
Tab.displayName = "Tab";
|
|
12265
12292
|
|
|
12266
12293
|
// src/components/Tag/Tag.tsx
|
|
12267
|
-
var
|
|
12294
|
+
var import_react68 = require("react");
|
|
12268
12295
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
12269
12296
|
var import_type_guards51 = require("@wistia/type-guards");
|
|
12270
12297
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
@@ -12381,7 +12408,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12381
12408
|
)
|
|
12382
12409
|
] });
|
|
12383
12410
|
};
|
|
12384
|
-
var Tag = (0,
|
|
12411
|
+
var Tag = (0, import_react68.forwardRef)(
|
|
12385
12412
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12386
12413
|
const hasIcon = (0, import_type_guards51.isNotNil)(icon);
|
|
12387
12414
|
const labelProps = (0, import_type_guards51.isNotNil)(href) && (0, import_type_guards51.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
@@ -12455,7 +12482,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
|
12455
12482
|
ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
12456
12483
|
|
|
12457
12484
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12458
|
-
var
|
|
12485
|
+
var import_react69 = require("react");
|
|
12459
12486
|
var import_styled_components90 = __toESM(require("styled-components"));
|
|
12460
12487
|
var import_type_guards54 = require("@wistia/type-guards");
|
|
12461
12488
|
|
|
@@ -12642,7 +12669,7 @@ var StyledThumbnail = import_styled_components90.default.div`
|
|
|
12642
12669
|
border-radius: calc(8% * (9 / 16)) / 8%;
|
|
12643
12670
|
}
|
|
12644
12671
|
`;
|
|
12645
|
-
var Thumbnail = (0,
|
|
12672
|
+
var Thumbnail = (0, import_react69.forwardRef)(
|
|
12646
12673
|
({
|
|
12647
12674
|
gradientBackground = "defaultMidOne",
|
|
12648
12675
|
thumbnailImageType = "square",
|
|
@@ -12678,7 +12705,7 @@ var Thumbnail = (0, import_react68.forwardRef)(
|
|
|
12678
12705
|
Thumbnail.displayName = "Thumbnail";
|
|
12679
12706
|
|
|
12680
12707
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
12681
|
-
var
|
|
12708
|
+
var import_react70 = __toESM(require("react"));
|
|
12682
12709
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
12683
12710
|
var import_type_guards55 = require("@wistia/type-guards");
|
|
12684
12711
|
var import_jsx_runtime271 = (
|
|
@@ -12758,10 +12785,10 @@ var ThumbnailCollage = ({
|
|
|
12758
12785
|
gradientBackground = "defaultMidOne",
|
|
12759
12786
|
...props
|
|
12760
12787
|
}) => {
|
|
12761
|
-
const thumbnailArray =
|
|
12788
|
+
const thumbnailArray = import_react70.default.Children.toArray(children);
|
|
12762
12789
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
12763
12790
|
const thumbnails = (0, import_type_guards55.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
12764
|
-
return
|
|
12791
|
+
return import_react70.default.cloneElement(child, {
|
|
12765
12792
|
...child.props,
|
|
12766
12793
|
children: void 0
|
|
12767
12794
|
});
|
|
@@ -13004,6 +13031,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
13004
13031
|
useFocusTrap,
|
|
13005
13032
|
useFormState,
|
|
13006
13033
|
useImperativeFilePicker,
|
|
13034
|
+
useIsHovered,
|
|
13007
13035
|
useKey,
|
|
13008
13036
|
useLocalStorage,
|
|
13009
13037
|
useLockBodyScroll,
|