@wistia/ui 0.8.15-beta.f44f7b94.a75e9a7 → 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 +205 -182
- 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 +51 -29
- 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,
|
|
@@ -1417,8 +1418,8 @@ var typographyTokens = import_styled_components6.css`
|
|
|
1417
1418
|
var import_styled_components7 = require("styled-components");
|
|
1418
1419
|
var zIndexTokens = import_styled_components7.css`
|
|
1419
1420
|
--wui-zindex-under: -1;
|
|
1420
|
-
--wui-zindex-backdrop:
|
|
1421
|
-
--wui-zindex-modal:
|
|
1421
|
+
--wui-zindex-backdrop: 100;
|
|
1422
|
+
--wui-zindex-modal: 100;
|
|
1422
1423
|
--wui-zindex-menu: 500;
|
|
1423
1424
|
--wui-zindex-select: 500;
|
|
1424
1425
|
--wui-zindex-tooltip: 500;
|
|
@@ -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;
|
|
@@ -10849,7 +10871,7 @@ var BackdropComponent = import_styled_components64.default.div`
|
|
|
10849
10871
|
}
|
|
10850
10872
|
}
|
|
10851
10873
|
`;
|
|
10852
|
-
var Backdrop = (0,
|
|
10874
|
+
var Backdrop = (0, import_react51.forwardRef)(
|
|
10853
10875
|
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
10854
10876
|
BackdropComponent,
|
|
10855
10877
|
{
|
|
@@ -10871,7 +10893,7 @@ var ModalBody = import_styled_components65.default.div`
|
|
|
10871
10893
|
display: flex;
|
|
10872
10894
|
order: 2;
|
|
10873
10895
|
`;
|
|
10874
|
-
var Modal = (0,
|
|
10896
|
+
var Modal = (0, import_react52.forwardRef)(
|
|
10875
10897
|
({
|
|
10876
10898
|
children,
|
|
10877
10899
|
fullHeight = false,
|
|
@@ -11085,7 +11107,7 @@ var ProgressBar = ({
|
|
|
11085
11107
|
ProgressBar.displayName = "ProgressBar";
|
|
11086
11108
|
|
|
11087
11109
|
// src/components/Radio/Radio.tsx
|
|
11088
|
-
var
|
|
11110
|
+
var import_react53 = require("react");
|
|
11089
11111
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11090
11112
|
var import_type_guards44 = require("@wistia/type-guards");
|
|
11091
11113
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
@@ -11188,7 +11210,7 @@ var StyledHiddenRadioInput = import_styled_components68.default.input`
|
|
|
11188
11210
|
display: block;
|
|
11189
11211
|
}
|
|
11190
11212
|
`;
|
|
11191
|
-
var Radio = (0,
|
|
11213
|
+
var Radio = (0, import_react53.forwardRef)(
|
|
11192
11214
|
({
|
|
11193
11215
|
checked,
|
|
11194
11216
|
disabled = false,
|
|
@@ -11203,7 +11225,7 @@ var Radio = (0, import_react52.forwardRef)(
|
|
|
11203
11225
|
hideLabel = false,
|
|
11204
11226
|
...props
|
|
11205
11227
|
}, ref) => {
|
|
11206
|
-
const generatedId = (0,
|
|
11228
|
+
const generatedId = (0, import_react53.useId)();
|
|
11207
11229
|
const computedId = (0, import_type_guards44.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11208
11230
|
return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(
|
|
11209
11231
|
StyledRadioWrapper,
|
|
@@ -11253,20 +11275,20 @@ var Radio = (0, import_react52.forwardRef)(
|
|
|
11253
11275
|
Radio.displayName = "Radio";
|
|
11254
11276
|
|
|
11255
11277
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
11256
|
-
var
|
|
11278
|
+
var import_react56 = require("react");
|
|
11257
11279
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11258
11280
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
11259
11281
|
var import_type_guards45 = require("@wistia/type-guards");
|
|
11260
11282
|
|
|
11261
11283
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11262
|
-
var
|
|
11284
|
+
var import_react54 = require("react");
|
|
11263
11285
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
11264
|
-
var SelectedItemStyleContext = (0,
|
|
11286
|
+
var SelectedItemStyleContext = (0, import_react54.createContext)(null);
|
|
11265
11287
|
var SelectedItemStyleProvider = ({
|
|
11266
11288
|
children
|
|
11267
11289
|
}) => {
|
|
11268
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
11269
|
-
const selectedItemIndicatorStyle = (0,
|
|
11290
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react54.useState)(null);
|
|
11291
|
+
const selectedItemIndicatorStyle = (0, import_react54.useMemo)(
|
|
11270
11292
|
() => selectedItemMeasurements != null ? {
|
|
11271
11293
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
11272
11294
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
@@ -11276,7 +11298,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11276
11298
|
},
|
|
11277
11299
|
[selectedItemMeasurements]
|
|
11278
11300
|
);
|
|
11279
|
-
const contextValue = (0,
|
|
11301
|
+
const contextValue = (0, import_react54.useMemo)(
|
|
11280
11302
|
() => ({
|
|
11281
11303
|
setSelectedItemMeasurements,
|
|
11282
11304
|
selectedItemIndicatorStyle
|
|
@@ -11286,7 +11308,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11286
11308
|
return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
11287
11309
|
};
|
|
11288
11310
|
var useSelectedItemStyle = () => {
|
|
11289
|
-
const context = (0,
|
|
11311
|
+
const context = (0, import_react54.useContext)(SelectedItemStyleContext);
|
|
11290
11312
|
if (context === null) {
|
|
11291
11313
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
11292
11314
|
}
|
|
@@ -11297,11 +11319,11 @@ var useSelectedItemStyle = () => {
|
|
|
11297
11319
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
11298
11320
|
|
|
11299
11321
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
11300
|
-
var
|
|
11301
|
-
var SegmentedControlValueContext = (0,
|
|
11322
|
+
var import_react55 = require("react");
|
|
11323
|
+
var SegmentedControlValueContext = (0, import_react55.createContext)(null);
|
|
11302
11324
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
11303
11325
|
var useSegmentedControlValue = () => {
|
|
11304
|
-
const context = (0,
|
|
11326
|
+
const context = (0, import_react55.useContext)(SegmentedControlValueContext);
|
|
11305
11327
|
if (context === null) {
|
|
11306
11328
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
11307
11329
|
}
|
|
@@ -11347,7 +11369,7 @@ var segmentedControlStyles = import_styled_components70.css`
|
|
|
11347
11369
|
var StyledSegmentedControl = (0, import_styled_components70.default)(import_react_toggle_group.Root)`
|
|
11348
11370
|
${segmentedControlStyles}
|
|
11349
11371
|
`;
|
|
11350
|
-
var SegmentedControl = (0,
|
|
11372
|
+
var SegmentedControl = (0, import_react56.forwardRef)(
|
|
11351
11373
|
({
|
|
11352
11374
|
children,
|
|
11353
11375
|
disabled = false,
|
|
@@ -11382,7 +11404,7 @@ var SegmentedControl = (0, import_react55.forwardRef)(
|
|
|
11382
11404
|
SegmentedControl.displayName = "SegmentedControl";
|
|
11383
11405
|
|
|
11384
11406
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
11385
|
-
var
|
|
11407
|
+
var import_react57 = require("react");
|
|
11386
11408
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
11387
11409
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
11388
11410
|
var import_type_guards46 = require("@wistia/type-guards");
|
|
@@ -11450,11 +11472,11 @@ var segmentedControlItemStyles = import_styled_components71.css`
|
|
|
11450
11472
|
var StyledSegmentedControlItem = (0, import_styled_components71.default)(import_react_toggle_group2.Item)`
|
|
11451
11473
|
${segmentedControlItemStyles}
|
|
11452
11474
|
`;
|
|
11453
|
-
var SegmentedControlItem = (0,
|
|
11475
|
+
var SegmentedControlItem = (0, import_react57.forwardRef)(
|
|
11454
11476
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11455
11477
|
const selectedValue = useSegmentedControlValue();
|
|
11456
11478
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
11457
|
-
const buttonRef = (0,
|
|
11479
|
+
const buttonRef = (0, import_react57.useRef)(null);
|
|
11458
11480
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11459
11481
|
const handleClick = (event) => {
|
|
11460
11482
|
const target = event.target;
|
|
@@ -11463,7 +11485,7 @@ var SegmentedControlItem = (0, import_react56.forwardRef)(
|
|
|
11463
11485
|
event.preventDefault();
|
|
11464
11486
|
}
|
|
11465
11487
|
};
|
|
11466
|
-
(0,
|
|
11488
|
+
(0, import_react57.useEffect)(() => {
|
|
11467
11489
|
const buttonElem = buttonRef.current;
|
|
11468
11490
|
if (!buttonElem) {
|
|
11469
11491
|
return void 0;
|
|
@@ -11509,7 +11531,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
11509
11531
|
|
|
11510
11532
|
// src/components/Select/Select.tsx
|
|
11511
11533
|
var import_react_select = require("@radix-ui/react-select");
|
|
11512
|
-
var
|
|
11534
|
+
var import_react58 = require("react");
|
|
11513
11535
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11514
11536
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11515
11537
|
var StyledTrigger = (0, import_styled_components72.default)(import_react_select.Trigger)`
|
|
@@ -11574,7 +11596,7 @@ var StyledContent3 = (0, import_styled_components72.default)(import_react_select
|
|
|
11574
11596
|
max-height: var(--radix-select-content-available-height);
|
|
11575
11597
|
z-index: var(--wui-zindex-select);
|
|
11576
11598
|
`;
|
|
11577
|
-
var Select = (0,
|
|
11599
|
+
var Select = (0, import_react58.forwardRef)(
|
|
11578
11600
|
({
|
|
11579
11601
|
colorScheme = "inherit",
|
|
11580
11602
|
children,
|
|
@@ -11623,7 +11645,7 @@ Select.displayName = "Select";
|
|
|
11623
11645
|
|
|
11624
11646
|
// src/components/Select/SelectOption.tsx
|
|
11625
11647
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11626
|
-
var
|
|
11648
|
+
var import_react59 = require("react");
|
|
11627
11649
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11628
11650
|
var import_type_guards47 = require("@wistia/type-guards");
|
|
11629
11651
|
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
@@ -11654,7 +11676,7 @@ var StyledItem = (0, import_styled_components73.default)(import_react_select2.It
|
|
|
11654
11676
|
var StyledIconContainer = import_styled_components73.default.span`
|
|
11655
11677
|
width: 12px;
|
|
11656
11678
|
`;
|
|
11657
|
-
var SelectOption = (0,
|
|
11679
|
+
var SelectOption = (0, import_react59.forwardRef)(
|
|
11658
11680
|
({ children, selectedDisplayValue, ...props }, forwardedRef) => {
|
|
11659
11681
|
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(
|
|
11660
11682
|
StyledItem,
|
|
@@ -11702,7 +11724,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11702
11724
|
};
|
|
11703
11725
|
|
|
11704
11726
|
// src/components/Switch/Switch.tsx
|
|
11705
|
-
var
|
|
11727
|
+
var import_react60 = require("react");
|
|
11706
11728
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11707
11729
|
var import_type_guards48 = require("@wistia/type-guards");
|
|
11708
11730
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
@@ -11807,7 +11829,7 @@ var StyledHiddenSwitchInput = import_styled_components75.default.input`
|
|
|
11807
11829
|
}
|
|
11808
11830
|
}
|
|
11809
11831
|
`;
|
|
11810
|
-
var Switch = (0,
|
|
11832
|
+
var Switch = (0, import_react60.forwardRef)(
|
|
11811
11833
|
({
|
|
11812
11834
|
checked,
|
|
11813
11835
|
disabled = false,
|
|
@@ -11822,7 +11844,7 @@ var Switch = (0, import_react59.forwardRef)(
|
|
|
11822
11844
|
hideLabel = false,
|
|
11823
11845
|
...props
|
|
11824
11846
|
}, ref) => {
|
|
11825
|
-
const generatedId = (0,
|
|
11847
|
+
const generatedId = (0, import_react60.useId)();
|
|
11826
11848
|
const computedId = (0, import_type_guards48.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11827
11849
|
return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
11828
11850
|
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
@@ -11912,8 +11934,8 @@ var Table = ({
|
|
|
11912
11934
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
11913
11935
|
|
|
11914
11936
|
// src/components/Table/TableSectionContext.ts
|
|
11915
|
-
var
|
|
11916
|
-
var TableSectionContext = (0,
|
|
11937
|
+
var import_react61 = require("react");
|
|
11938
|
+
var TableSectionContext = (0, import_react61.createContext)(null);
|
|
11917
11939
|
|
|
11918
11940
|
// src/components/Table/TableBody.tsx
|
|
11919
11941
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
@@ -11923,7 +11945,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
11923
11945
|
};
|
|
11924
11946
|
|
|
11925
11947
|
// src/components/Table/TableCell.tsx
|
|
11926
|
-
var
|
|
11948
|
+
var import_react62 = require("react");
|
|
11927
11949
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
11928
11950
|
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
11929
11951
|
var sharedStyles = import_styled_components78.css`
|
|
@@ -11944,7 +11966,7 @@ var StyledTd = import_styled_components78.default.td`
|
|
|
11944
11966
|
line-height: var(--wui-typography-body-2-line-height);
|
|
11945
11967
|
`;
|
|
11946
11968
|
var TableCell = ({ children, ...props }) => {
|
|
11947
|
-
const section = (0,
|
|
11969
|
+
const section = (0, import_react62.useContext)(TableSectionContext);
|
|
11948
11970
|
if (section === "head") {
|
|
11949
11971
|
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(StyledTh, { ...props, children });
|
|
11950
11972
|
}
|
|
@@ -11976,7 +11998,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
11976
11998
|
};
|
|
11977
11999
|
|
|
11978
12000
|
// src/components/Tabs/Tabs.tsx
|
|
11979
|
-
var
|
|
12001
|
+
var import_react66 = require("react");
|
|
11980
12002
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
11981
12003
|
var import_type_guards50 = require("@wistia/type-guards");
|
|
11982
12004
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
@@ -12031,17 +12053,17 @@ var TabList = ({
|
|
|
12031
12053
|
TabList.displayName = "TabList";
|
|
12032
12054
|
|
|
12033
12055
|
// src/components/Tabs/TabItem.tsx
|
|
12034
|
-
var
|
|
12056
|
+
var import_react64 = require("react");
|
|
12035
12057
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
12036
12058
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
12037
12059
|
var import_type_guards49 = require("@wistia/type-guards");
|
|
12038
12060
|
|
|
12039
12061
|
// src/components/Tabs/useTabsValue.tsx
|
|
12040
|
-
var
|
|
12041
|
-
var TabsValueContext = (0,
|
|
12062
|
+
var import_react63 = require("react");
|
|
12063
|
+
var TabsValueContext = (0, import_react63.createContext)(null);
|
|
12042
12064
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
12043
12065
|
var useTabsValue = () => {
|
|
12044
|
-
const context = (0,
|
|
12066
|
+
const context = (0, import_react63.useContext)(TabsValueContext);
|
|
12045
12067
|
if (context === null) {
|
|
12046
12068
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
12047
12069
|
}
|
|
@@ -12057,13 +12079,13 @@ var StyledTabItem = (0, import_styled_components84.default)(import_react_tabs3.T
|
|
|
12057
12079
|
outline: none;
|
|
12058
12080
|
}
|
|
12059
12081
|
`;
|
|
12060
|
-
var TabItem = (0,
|
|
12082
|
+
var TabItem = (0, import_react64.forwardRef)(
|
|
12061
12083
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
12062
12084
|
const selectedValue = useTabsValue();
|
|
12063
12085
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
12064
|
-
const buttonRef = (0,
|
|
12086
|
+
const buttonRef = (0, import_react64.useRef)(null);
|
|
12065
12087
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
12066
|
-
(0,
|
|
12088
|
+
(0, import_react64.useEffect)(() => {
|
|
12067
12089
|
const buttonElem = buttonRef.current;
|
|
12068
12090
|
if (!buttonElem) {
|
|
12069
12091
|
return void 0;
|
|
@@ -12107,16 +12129,16 @@ var TabItem = (0, import_react63.forwardRef)(
|
|
|
12107
12129
|
TabItem.displayName = "TabItem";
|
|
12108
12130
|
|
|
12109
12131
|
// src/components/Tabs/extractTabItems.ts
|
|
12110
|
-
var
|
|
12132
|
+
var import_react65 = require("react");
|
|
12111
12133
|
var extractTabItems = (children) => {
|
|
12112
12134
|
const tabItems = [];
|
|
12113
|
-
|
|
12114
|
-
if (!(0,
|
|
12135
|
+
import_react65.Children.forEach(children, (child) => {
|
|
12136
|
+
if (!(0, import_react65.isValidElement)(child)) {
|
|
12115
12137
|
return;
|
|
12116
12138
|
}
|
|
12117
12139
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
12118
12140
|
tabItems.push(child);
|
|
12119
|
-
} else if (child.type ===
|
|
12141
|
+
} else if (child.type === import_react65.Fragment) {
|
|
12120
12142
|
const fragmentElement = child;
|
|
12121
12143
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
12122
12144
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -12163,7 +12185,7 @@ var StyledTabsRoot = (0, import_styled_components86.default)(import_react_tabs4.
|
|
|
12163
12185
|
flex-direction: column;
|
|
12164
12186
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
12165
12187
|
`;
|
|
12166
|
-
var Tabs = (0,
|
|
12188
|
+
var Tabs = (0, import_react66.forwardRef)(
|
|
12167
12189
|
({
|
|
12168
12190
|
children,
|
|
12169
12191
|
fullWidth = true,
|
|
@@ -12175,7 +12197,7 @@ var Tabs = (0, import_react65.forwardRef)(
|
|
|
12175
12197
|
...props
|
|
12176
12198
|
}, ref) => {
|
|
12177
12199
|
const tabItems = extractTabItems(children);
|
|
12178
|
-
const [internalSelectedValue, setInternalSelectedValue] = (0,
|
|
12200
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react66.useState)(defaultSelectedValue);
|
|
12179
12201
|
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
12180
12202
|
defaultValue: defaultSelectedValue,
|
|
12181
12203
|
onValueChange: setInternalSelectedValue
|
|
@@ -12261,15 +12283,15 @@ var Tabs = (0, import_react65.forwardRef)(
|
|
|
12261
12283
|
Tabs.displayName = "Tabs";
|
|
12262
12284
|
|
|
12263
12285
|
// src/components/Tabs/Tab.tsx
|
|
12264
|
-
var
|
|
12286
|
+
var import_react67 = require("react");
|
|
12265
12287
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
12266
|
-
var Tab = (0,
|
|
12288
|
+
var Tab = (0, import_react67.forwardRef)(({ children }, ref) => {
|
|
12267
12289
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("div", { ref, children });
|
|
12268
12290
|
});
|
|
12269
12291
|
Tab.displayName = "Tab";
|
|
12270
12292
|
|
|
12271
12293
|
// src/components/Tag/Tag.tsx
|
|
12272
|
-
var
|
|
12294
|
+
var import_react68 = require("react");
|
|
12273
12295
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
12274
12296
|
var import_type_guards51 = require("@wistia/type-guards");
|
|
12275
12297
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
@@ -12386,7 +12408,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12386
12408
|
)
|
|
12387
12409
|
] });
|
|
12388
12410
|
};
|
|
12389
|
-
var Tag = (0,
|
|
12411
|
+
var Tag = (0, import_react68.forwardRef)(
|
|
12390
12412
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12391
12413
|
const hasIcon = (0, import_type_guards51.isNotNil)(icon);
|
|
12392
12414
|
const labelProps = (0, import_type_guards51.isNotNil)(href) && (0, import_type_guards51.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
@@ -12460,7 +12482,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
|
12460
12482
|
ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
12461
12483
|
|
|
12462
12484
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12463
|
-
var
|
|
12485
|
+
var import_react69 = require("react");
|
|
12464
12486
|
var import_styled_components90 = __toESM(require("styled-components"));
|
|
12465
12487
|
var import_type_guards54 = require("@wistia/type-guards");
|
|
12466
12488
|
|
|
@@ -12647,7 +12669,7 @@ var StyledThumbnail = import_styled_components90.default.div`
|
|
|
12647
12669
|
border-radius: calc(8% * (9 / 16)) / 8%;
|
|
12648
12670
|
}
|
|
12649
12671
|
`;
|
|
12650
|
-
var Thumbnail = (0,
|
|
12672
|
+
var Thumbnail = (0, import_react69.forwardRef)(
|
|
12651
12673
|
({
|
|
12652
12674
|
gradientBackground = "defaultMidOne",
|
|
12653
12675
|
thumbnailImageType = "square",
|
|
@@ -12683,7 +12705,7 @@ var Thumbnail = (0, import_react68.forwardRef)(
|
|
|
12683
12705
|
Thumbnail.displayName = "Thumbnail";
|
|
12684
12706
|
|
|
12685
12707
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
12686
|
-
var
|
|
12708
|
+
var import_react70 = __toESM(require("react"));
|
|
12687
12709
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
12688
12710
|
var import_type_guards55 = require("@wistia/type-guards");
|
|
12689
12711
|
var import_jsx_runtime271 = (
|
|
@@ -12763,10 +12785,10 @@ var ThumbnailCollage = ({
|
|
|
12763
12785
|
gradientBackground = "defaultMidOne",
|
|
12764
12786
|
...props
|
|
12765
12787
|
}) => {
|
|
12766
|
-
const thumbnailArray =
|
|
12788
|
+
const thumbnailArray = import_react70.default.Children.toArray(children);
|
|
12767
12789
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
12768
12790
|
const thumbnails = (0, import_type_guards55.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
12769
|
-
return
|
|
12791
|
+
return import_react70.default.cloneElement(child, {
|
|
12770
12792
|
...child.props,
|
|
12771
12793
|
children: void 0
|
|
12772
12794
|
});
|
|
@@ -13009,6 +13031,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
13009
13031
|
useFocusTrap,
|
|
13010
13032
|
useFormState,
|
|
13011
13033
|
useImperativeFilePicker,
|
|
13034
|
+
useIsHovered,
|
|
13012
13035
|
useKey,
|
|
13013
13036
|
useLocalStorage,
|
|
13014
13037
|
useLockBodyScroll,
|