@wistia/ui 0.6.39 → 0.6.40-beta.d3a0b63e.a55d26a
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 +768 -279
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +88 -1
- package/dist/index.d.ts +88 -1
- package/dist/index.mjs +542 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.6.
|
|
3
|
+
* @license @wistia/ui v0.6.40-beta.d3a0b63e.a55d26a
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -2475,6 +2475,238 @@ var useToast = () => {
|
|
|
2475
2475
|
);
|
|
2476
2476
|
};
|
|
2477
2477
|
|
|
2478
|
+
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2479
|
+
import { useRef as useRef3, useCallback as useCallback5, useEffect as useEffect4 } from "react";
|
|
2480
|
+
import { isNotUndefined } from "@wistia/type-guards";
|
|
2481
|
+
|
|
2482
|
+
// src/hooks/useFocusTrap/helpers.ts
|
|
2483
|
+
var FOCUSABLE_ELEMENT_SELECTORS = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [tabindex="0"], [contenteditable]';
|
|
2484
|
+
var coerceToString = (value) => value === null || value === void 0 ? "" : String(value);
|
|
2485
|
+
var isHiddenElement = (element) => {
|
|
2486
|
+
const { display, visibility } = window.getComputedStyle(element);
|
|
2487
|
+
const isHidden = display === "none" || element.style.display === "none" || visibility === "none" || element.style.visibility === "hidden";
|
|
2488
|
+
return element.offsetWidth <= 0 && element.offsetHeight <= 0 || isHidden;
|
|
2489
|
+
};
|
|
2490
|
+
var isVisibleElement = (element) => {
|
|
2491
|
+
let parentElement = element;
|
|
2492
|
+
while (parentElement) {
|
|
2493
|
+
if (parentElement === document.body) {
|
|
2494
|
+
break;
|
|
2495
|
+
}
|
|
2496
|
+
if (isHiddenElement(parentElement)) {
|
|
2497
|
+
return false;
|
|
2498
|
+
}
|
|
2499
|
+
parentElement = parentElement.parentNode;
|
|
2500
|
+
}
|
|
2501
|
+
return true;
|
|
2502
|
+
};
|
|
2503
|
+
var getElementTabIndex = (element) => {
|
|
2504
|
+
const tabIndex = element.getAttribute("tabindex");
|
|
2505
|
+
return Number.parseInt(tabIndex ?? void 0, 10);
|
|
2506
|
+
};
|
|
2507
|
+
var isTabIndexNaN = (element) => {
|
|
2508
|
+
const tabIndex = getElementTabIndex(element);
|
|
2509
|
+
return Number.isNaN(tabIndex);
|
|
2510
|
+
};
|
|
2511
|
+
var isFocusableElement = (element) => {
|
|
2512
|
+
const tabbableNodeRegEx = /input|select|textarea|button|object/;
|
|
2513
|
+
const nodeName = element.nodeName.toLowerCase();
|
|
2514
|
+
const isTabIndexNotNaN = !isTabIndexNaN(element);
|
|
2515
|
+
const isFocusable = (
|
|
2516
|
+
// @ts-expect-error - Disabled is specific to buttons and inputs, but we could be dealing with any number of types here. Disabled would be undefined for those, so ignoring.
|
|
2517
|
+
tabbableNodeRegEx.test(nodeName) && !element.disabled || (element instanceof HTMLAnchorElement ? element.href || isTabIndexNotNaN : isTabIndexNotNaN)
|
|
2518
|
+
);
|
|
2519
|
+
return Boolean(isFocusable) && isVisibleElement(element);
|
|
2520
|
+
};
|
|
2521
|
+
var isTabbableElement = (element) => {
|
|
2522
|
+
const tabIndex = getElementTabIndex(element);
|
|
2523
|
+
return (isTabIndexNaN(element) || tabIndex >= 0) && isFocusableElement(element);
|
|
2524
|
+
};
|
|
2525
|
+
var findTabbableDescendants = (element) => Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter(
|
|
2526
|
+
isTabbableElement
|
|
2527
|
+
);
|
|
2528
|
+
var focusLaterElements = [];
|
|
2529
|
+
var focusElement = null;
|
|
2530
|
+
var needToFocus = false;
|
|
2531
|
+
var handleBlur = () => {
|
|
2532
|
+
needToFocus = true;
|
|
2533
|
+
};
|
|
2534
|
+
var handleFocus = () => {
|
|
2535
|
+
if (needToFocus) {
|
|
2536
|
+
needToFocus = false;
|
|
2537
|
+
if (!focusElement) {
|
|
2538
|
+
return;
|
|
2539
|
+
}
|
|
2540
|
+
if (focusElement.contains(document.activeElement)) {
|
|
2541
|
+
return;
|
|
2542
|
+
}
|
|
2543
|
+
const element = findTabbableDescendants(focusElement)[0] ?? focusElement;
|
|
2544
|
+
element.focus();
|
|
2545
|
+
}
|
|
2546
|
+
};
|
|
2547
|
+
var markForFocusLater = () => {
|
|
2548
|
+
const element = document.activeElement;
|
|
2549
|
+
if (element !== null) {
|
|
2550
|
+
focusLaterElements.push(element);
|
|
2551
|
+
}
|
|
2552
|
+
};
|
|
2553
|
+
var returnFocus = () => {
|
|
2554
|
+
let toFocus = null;
|
|
2555
|
+
try {
|
|
2556
|
+
toFocus = focusLaterElements.pop();
|
|
2557
|
+
if (toFocus) {
|
|
2558
|
+
toFocus.focus();
|
|
2559
|
+
}
|
|
2560
|
+
} catch {
|
|
2561
|
+
console.warn(
|
|
2562
|
+
`You tried to return focus to ${coerceToString(toFocus)} but it is not in the DOM anymore`
|
|
2563
|
+
);
|
|
2564
|
+
}
|
|
2565
|
+
};
|
|
2566
|
+
var setupScopedFocus = (element) => {
|
|
2567
|
+
focusElement = element;
|
|
2568
|
+
document.addEventListener("focusout", handleBlur, false);
|
|
2569
|
+
document.addEventListener("focusin", handleFocus, true);
|
|
2570
|
+
};
|
|
2571
|
+
var teardownScopedFocus = () => {
|
|
2572
|
+
focusElement = null;
|
|
2573
|
+
document.removeEventListener("focusout", handleBlur);
|
|
2574
|
+
document.removeEventListener("focusin", handleFocus);
|
|
2575
|
+
};
|
|
2576
|
+
var scopeTab = (node, event) => {
|
|
2577
|
+
const tabbable = findTabbableDescendants(node);
|
|
2578
|
+
if (!tabbable.length) {
|
|
2579
|
+
event.preventDefault();
|
|
2580
|
+
return;
|
|
2581
|
+
}
|
|
2582
|
+
const finalTabbable = tabbable[event.shiftKey ? 0 : tabbable.length - 1];
|
|
2583
|
+
const leavingFinalTabbable = finalTabbable === document.activeElement || node === document.activeElement;
|
|
2584
|
+
if (!leavingFinalTabbable) {
|
|
2585
|
+
return;
|
|
2586
|
+
}
|
|
2587
|
+
event.preventDefault();
|
|
2588
|
+
const target = tabbable[event.shiftKey ? tabbable.length - 1 : 0];
|
|
2589
|
+
if (target) {
|
|
2590
|
+
target.focus();
|
|
2591
|
+
}
|
|
2592
|
+
};
|
|
2593
|
+
var createAriaHider = (containerNode, selector) => {
|
|
2594
|
+
if (selector === void 0) {
|
|
2595
|
+
selector = "body > :not(script)";
|
|
2596
|
+
}
|
|
2597
|
+
const rootNodes = Array.from(document.querySelectorAll(selector)).map((node) => {
|
|
2598
|
+
if (node.contains(containerNode)) {
|
|
2599
|
+
return void 0;
|
|
2600
|
+
}
|
|
2601
|
+
const ariaHidden = node.getAttribute("aria-hidden");
|
|
2602
|
+
if (ariaHidden === null || ariaHidden === "false") {
|
|
2603
|
+
node.setAttribute("aria-hidden", "true");
|
|
2604
|
+
}
|
|
2605
|
+
return {
|
|
2606
|
+
node,
|
|
2607
|
+
ariaHidden
|
|
2608
|
+
};
|
|
2609
|
+
});
|
|
2610
|
+
return () => {
|
|
2611
|
+
rootNodes.forEach((item) => {
|
|
2612
|
+
if (!item) {
|
|
2613
|
+
return;
|
|
2614
|
+
}
|
|
2615
|
+
if (item.ariaHidden === null) {
|
|
2616
|
+
item.node.removeAttribute("aria-hidden");
|
|
2617
|
+
} else {
|
|
2618
|
+
item.node.setAttribute("aria-hidden", item.ariaHidden);
|
|
2619
|
+
}
|
|
2620
|
+
});
|
|
2621
|
+
};
|
|
2622
|
+
};
|
|
2623
|
+
|
|
2624
|
+
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2625
|
+
var isRef = (val) => {
|
|
2626
|
+
return val !== null && typeof val === "object" && "current" in val;
|
|
2627
|
+
};
|
|
2628
|
+
var useFocusTrap = (active = true, options = {}) => {
|
|
2629
|
+
const ref = useRef3(null);
|
|
2630
|
+
const restoreAriaRef = useRef3(null);
|
|
2631
|
+
const setRef = useCallback5(
|
|
2632
|
+
(node) => {
|
|
2633
|
+
if (restoreAriaRef.current !== null) {
|
|
2634
|
+
restoreAriaRef.current();
|
|
2635
|
+
}
|
|
2636
|
+
if (ref.current) {
|
|
2637
|
+
returnFocus();
|
|
2638
|
+
teardownScopedFocus();
|
|
2639
|
+
}
|
|
2640
|
+
if (active && node !== null && node !== void 0) {
|
|
2641
|
+
setupScopedFocus(node);
|
|
2642
|
+
markForFocusLater();
|
|
2643
|
+
const processNode = (node2) => {
|
|
2644
|
+
restoreAriaRef.current = !(options.disableAriaHider ?? false) ? createAriaHider(node2) : null;
|
|
2645
|
+
let focusElement2 = null;
|
|
2646
|
+
if (isNotUndefined(options.focusSelector)) {
|
|
2647
|
+
if (isRef(options.focusSelector)) {
|
|
2648
|
+
focusElement2 = options.focusSelector.current;
|
|
2649
|
+
} else {
|
|
2650
|
+
focusElement2 = typeof options.focusSelector === "string" ? node2.querySelector(options.focusSelector) : options.focusSelector;
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
if (!focusElement2) {
|
|
2654
|
+
const children = Array.from(
|
|
2655
|
+
node2.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)
|
|
2656
|
+
);
|
|
2657
|
+
focusElement2 = // Prefer tabbable elements, But fallback to any focusable element
|
|
2658
|
+
children.find(isTabbableElement) ?? // But fallback to any focusable element
|
|
2659
|
+
children.find(isFocusableElement) ?? // Nothing found
|
|
2660
|
+
null;
|
|
2661
|
+
if (!focusElement2 && isFocusableElement(node2)) {
|
|
2662
|
+
focusElement2 = node2;
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
if (focusElement2) {
|
|
2666
|
+
focusElement2.focus();
|
|
2667
|
+
}
|
|
2668
|
+
if (!focusElement2 && process.env["NODE_ENV"] === "development") {
|
|
2669
|
+
console.warn(
|
|
2670
|
+
'[useFocusTrap]: Failed to find a focusable element after activating the focus trap. Make sure to include at an element that can recieve focus. As a fallback, you can also set "tabIndex={-1}" on the focus trap node.',
|
|
2671
|
+
node2
|
|
2672
|
+
);
|
|
2673
|
+
}
|
|
2674
|
+
};
|
|
2675
|
+
setTimeout(() => {
|
|
2676
|
+
if (node.ownerDocument) {
|
|
2677
|
+
processNode(node);
|
|
2678
|
+
}
|
|
2679
|
+
if (!node.ownerDocument && process.env["NODE_ENV"] === "development") {
|
|
2680
|
+
console.warn(
|
|
2681
|
+
"[useFocusTrap]: The focus trap is not part of the DOM yet, so it is unable to correctly set focus. Make sure to render the ref node.",
|
|
2682
|
+
node
|
|
2683
|
+
);
|
|
2684
|
+
}
|
|
2685
|
+
});
|
|
2686
|
+
ref.current = node;
|
|
2687
|
+
} else {
|
|
2688
|
+
ref.current = null;
|
|
2689
|
+
}
|
|
2690
|
+
},
|
|
2691
|
+
[active, options.focusSelector, options.disableAriaHider]
|
|
2692
|
+
);
|
|
2693
|
+
useEffect4(() => {
|
|
2694
|
+
if (!active) {
|
|
2695
|
+
return void 0;
|
|
2696
|
+
}
|
|
2697
|
+
const handleKeyDown = (event) => {
|
|
2698
|
+
if (event.key === "Tab" && ref.current) {
|
|
2699
|
+
scopeTab(ref.current, event);
|
|
2700
|
+
}
|
|
2701
|
+
};
|
|
2702
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
2703
|
+
return () => {
|
|
2704
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
2705
|
+
};
|
|
2706
|
+
}, [active]);
|
|
2707
|
+
return setRef;
|
|
2708
|
+
};
|
|
2709
|
+
|
|
2478
2710
|
// src/components/ActionButton/ActionButton.tsx
|
|
2479
2711
|
import { forwardRef as forwardRef3 } from "react";
|
|
2480
2712
|
import styled6, { css as css16 } from "styled-components";
|
|
@@ -2482,7 +2714,7 @@ import styled6, { css as css16 } from "styled-components";
|
|
|
2482
2714
|
// src/components/Button/Button.tsx
|
|
2483
2715
|
import { forwardRef as forwardRef2 } from "react";
|
|
2484
2716
|
import styled5 from "styled-components";
|
|
2485
|
-
import { isNotNil as isNotNil6, isNotUndefined as
|
|
2717
|
+
import { isNotNil as isNotNil6, isNotUndefined as isNotUndefined4 } from "@wistia/type-guards";
|
|
2486
2718
|
|
|
2487
2719
|
// src/css/buttonResetCss.tsx
|
|
2488
2720
|
import { css as css14 } from "styled-components";
|
|
@@ -6541,7 +6773,7 @@ var iconMap = {
|
|
|
6541
6773
|
};
|
|
6542
6774
|
|
|
6543
6775
|
// src/private/hooks/useResponsiveProp/useResponsiveProp.ts
|
|
6544
|
-
import { isNotUndefined, isRecord as isRecord2, isUndefined } from "@wistia/type-guards";
|
|
6776
|
+
import { isNotUndefined as isNotUndefined2, isRecord as isRecord2, isUndefined } from "@wistia/type-guards";
|
|
6545
6777
|
import { useMemo as useMemo2 } from "react";
|
|
6546
6778
|
var isResponsiveObject = (values) => {
|
|
6547
6779
|
return typeof values === "object" && values !== null && !Array.isArray(values) && "base" in values;
|
|
@@ -6551,7 +6783,7 @@ var useResponsiveProp = (values) => {
|
|
|
6551
6783
|
return useMemo2(() => {
|
|
6552
6784
|
if (isRecord2(values) && isResponsiveObject(values)) {
|
|
6553
6785
|
const mq2 = activeMediaQueries.find((key) => key in values);
|
|
6554
|
-
return
|
|
6786
|
+
return isNotUndefined2(mq2) && isNotUndefined2(values[mq2]) ? values[mq2] : values.base;
|
|
6555
6787
|
}
|
|
6556
6788
|
return values;
|
|
6557
6789
|
}, [activeMediaQueries, values]);
|
|
@@ -6616,7 +6848,7 @@ Icon.displayName = "Icon";
|
|
|
6616
6848
|
|
|
6617
6849
|
// src/components/Link/Link.tsx
|
|
6618
6850
|
import { forwardRef } from "react";
|
|
6619
|
-
import { isFunction as isFunction2, isNil as isNil6, isNotNil as isNotNil5, isNotUndefined as
|
|
6851
|
+
import { isFunction as isFunction2, isNil as isNil6, isNotNil as isNotNil5, isNotUndefined as isNotUndefined3, isUndefined as isUndefined2 } from "@wistia/type-guards";
|
|
6620
6852
|
import styled4 from "styled-components";
|
|
6621
6853
|
import { Link as RouterLink, useInRouterContext } from "react-router-dom";
|
|
6622
6854
|
import { jsx as jsx192, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
@@ -6634,7 +6866,7 @@ var generateHref = (href, type, disabled) => {
|
|
|
6634
6866
|
return to;
|
|
6635
6867
|
};
|
|
6636
6868
|
var isButton = (props) => isUndefined2(props.href);
|
|
6637
|
-
var isLink = (props) =>
|
|
6869
|
+
var isLink = (props) => isNotUndefined3(props.href);
|
|
6638
6870
|
var StyledLink = styled4.a`
|
|
6639
6871
|
--link-icon-size: 14px;
|
|
6640
6872
|
|
|
@@ -6749,7 +6981,7 @@ Link.displayName = "Link";
|
|
|
6749
6981
|
|
|
6750
6982
|
// src/components/Button/Button.tsx
|
|
6751
6983
|
import { Fragment, jsx as jsx193, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
6752
|
-
var isLink2 = (props) =>
|
|
6984
|
+
var isLink2 = (props) => isNotUndefined4(props.href);
|
|
6753
6985
|
var StyledButton = styled5.button`
|
|
6754
6986
|
${buttonResetCss}
|
|
6755
6987
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
@@ -7024,7 +7256,7 @@ var ActionButton = forwardRef3(
|
|
|
7024
7256
|
ActionButton.displayName = "ActionButton";
|
|
7025
7257
|
|
|
7026
7258
|
// src/components/Avatar/Avatar.tsx
|
|
7027
|
-
import { useState as useState5, useMemo as useMemo3, useEffect as
|
|
7259
|
+
import { useState as useState5, useMemo as useMemo3, useEffect as useEffect5 } from "react";
|
|
7028
7260
|
import { isNil as isNil8 } from "@wistia/type-guards";
|
|
7029
7261
|
import styled8 from "styled-components";
|
|
7030
7262
|
|
|
@@ -7157,7 +7389,7 @@ var Avatar = ({
|
|
|
7157
7389
|
...otherProps
|
|
7158
7390
|
}) => {
|
|
7159
7391
|
const [imageLoadState, setImageLoadState] = useState5("loading");
|
|
7160
|
-
|
|
7392
|
+
useEffect5(() => {
|
|
7161
7393
|
setImageLoadState("loading");
|
|
7162
7394
|
}, [imageUrl]);
|
|
7163
7395
|
const handleImageLoad = () => {
|
|
@@ -7246,7 +7478,7 @@ Badge.displayName = "Badge";
|
|
|
7246
7478
|
// src/components/Box/Box.tsx
|
|
7247
7479
|
import { Children, cloneElement as cloneElement2, forwardRef as forwardRef5 } from "react";
|
|
7248
7480
|
import styled10, { css as css17 } from "styled-components";
|
|
7249
|
-
import { isNotNil as isNotNil8, isNil as isNil9, isRecord as isRecord3, isNotUndefined as
|
|
7481
|
+
import { isNotNil as isNotNil8, isNil as isNil9, isRecord as isRecord3, isNotUndefined as isNotUndefined5 } from "@wistia/type-guards";
|
|
7250
7482
|
|
|
7251
7483
|
// src/private/helpers/makePolymorphic/makePolymorphic.tsx
|
|
7252
7484
|
var makePolymorphic = (component) => {
|
|
@@ -7392,7 +7624,7 @@ var BoxComponent = forwardRef5(
|
|
|
7392
7624
|
flexMode,
|
|
7393
7625
|
...otherProps
|
|
7394
7626
|
}, ref) => {
|
|
7395
|
-
if (
|
|
7627
|
+
if (isNotUndefined5(height)) {
|
|
7396
7628
|
if (fill === true || fill === "vertical") {
|
|
7397
7629
|
throw new Error('Cannot use height prop with fill="vertical" or fill={true}');
|
|
7398
7630
|
}
|
|
@@ -7402,7 +7634,7 @@ var BoxComponent = forwardRef5(
|
|
|
7402
7634
|
);
|
|
7403
7635
|
}
|
|
7404
7636
|
}
|
|
7405
|
-
if (
|
|
7637
|
+
if (isNotUndefined5(width)) {
|
|
7406
7638
|
if (fill === true || fill === "horizontal") {
|
|
7407
7639
|
throw new Error('Cannot use width prop with fill="horizontal" or fill={true}');
|
|
7408
7640
|
}
|
|
@@ -7956,9 +8188,9 @@ var Checkbox = forwardRef7(
|
|
|
7956
8188
|
Checkbox.displayName = "Checkbox";
|
|
7957
8189
|
|
|
7958
8190
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
7959
|
-
import { Children as Children3, cloneElement as cloneElement3, useCallback as
|
|
8191
|
+
import { Children as Children3, cloneElement as cloneElement3, useCallback as useCallback6, useEffect as useEffect6 } from "react";
|
|
7960
8192
|
var ClickRegion = ({ children, targetRef }) => {
|
|
7961
|
-
|
|
8193
|
+
useEffect6(() => {
|
|
7962
8194
|
if (targetRef.current && targetRef.current.tagName === "A") {
|
|
7963
8195
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
7964
8196
|
} else if (targetRef.current && targetRef.current.tagName === "BUTTON") {
|
|
@@ -7966,7 +8198,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
7966
8198
|
} else {
|
|
7967
8199
|
}
|
|
7968
8200
|
}, [targetRef]);
|
|
7969
|
-
const handleClick =
|
|
8201
|
+
const handleClick = useCallback6(
|
|
7970
8202
|
(event) => {
|
|
7971
8203
|
const node = targetRef.current;
|
|
7972
8204
|
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")) {
|
|
@@ -8027,13 +8259,13 @@ var CollapsibleTrigger = ({ children }) => {
|
|
|
8027
8259
|
// src/components/Collapsible/CollapsibleContent.tsx
|
|
8028
8260
|
import styled21 from "styled-components";
|
|
8029
8261
|
import { Content } from "@radix-ui/react-collapsible";
|
|
8030
|
-
import { isNotUndefined as
|
|
8262
|
+
import { isNotUndefined as isNotUndefined6 } from "@wistia/type-guards";
|
|
8031
8263
|
import { Fragment as Fragment4, jsx as jsx210, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
8032
8264
|
var ClampedContent = styled21.div.attrs({ "data-wui-collapsible-content": true })`
|
|
8033
8265
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
8034
8266
|
`;
|
|
8035
8267
|
var CollapsibleContent = ({ clamp, children }) => {
|
|
8036
|
-
if (
|
|
8268
|
+
if (isNotUndefined6(clamp)) {
|
|
8037
8269
|
return /* @__PURE__ */ jsx210(ClampedContent, { $clamp: clamp, children });
|
|
8038
8270
|
}
|
|
8039
8271
|
return /* @__PURE__ */ jsx210(Content, { children: /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
@@ -8580,7 +8812,7 @@ Divider.displayName = "Divider";
|
|
|
8580
8812
|
|
|
8581
8813
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
8582
8814
|
import styled30, { css as css26 } from "styled-components";
|
|
8583
|
-
import { useState as useState6, useRef as
|
|
8815
|
+
import { useState as useState6, useRef as useRef5 } from "react";
|
|
8584
8816
|
|
|
8585
8817
|
// src/components/Tooltip/Tooltip.tsx
|
|
8586
8818
|
import {
|
|
@@ -8695,7 +8927,7 @@ var Tooltip = ({
|
|
|
8695
8927
|
Tooltip.displayName = "Tooltip";
|
|
8696
8928
|
|
|
8697
8929
|
// src/components/Input/Input.tsx
|
|
8698
|
-
import { forwardRef as forwardRef10, cloneElement as cloneElement4, useRef as
|
|
8930
|
+
import { forwardRef as forwardRef10, cloneElement as cloneElement4, useRef as useRef4 } from "react";
|
|
8699
8931
|
import styled29, { css as css25 } from "styled-components";
|
|
8700
8932
|
import { isNil as isNil13, isNotNil as isNotNil12, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
8701
8933
|
import { jsx as jsx218, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
@@ -8794,7 +9026,7 @@ var Input = forwardRef10(
|
|
|
8794
9026
|
rightIcon,
|
|
8795
9027
|
...props
|
|
8796
9028
|
}, externalRef) => {
|
|
8797
|
-
const internalRef =
|
|
9029
|
+
const internalRef = useRef4();
|
|
8798
9030
|
const ref = (
|
|
8799
9031
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
8800
9032
|
isNotNil12(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
@@ -8816,7 +9048,7 @@ var Input = forwardRef10(
|
|
|
8816
9048
|
className: "wui-input-right-icon"
|
|
8817
9049
|
});
|
|
8818
9050
|
}
|
|
8819
|
-
const
|
|
9051
|
+
const handleFocus2 = (event) => {
|
|
8820
9052
|
if (isNotNil12(props.onFocus)) {
|
|
8821
9053
|
props.onFocus(event);
|
|
8822
9054
|
}
|
|
@@ -8838,14 +9070,14 @@ var Input = forwardRef10(
|
|
|
8838
9070
|
{
|
|
8839
9071
|
...props,
|
|
8840
9072
|
ref,
|
|
8841
|
-
onFocus:
|
|
9073
|
+
onFocus: handleFocus2
|
|
8842
9074
|
}
|
|
8843
9075
|
) : /* @__PURE__ */ jsx218(
|
|
8844
9076
|
"input",
|
|
8845
9077
|
{
|
|
8846
9078
|
...props,
|
|
8847
9079
|
ref,
|
|
8848
|
-
onFocus:
|
|
9080
|
+
onFocus: handleFocus2,
|
|
8849
9081
|
type
|
|
8850
9082
|
}
|
|
8851
9083
|
),
|
|
@@ -8910,7 +9142,7 @@ var EditableHeading = ({
|
|
|
8910
9142
|
const [value, setValue] = useState6(children);
|
|
8911
9143
|
const [previousValue, setPreviousValue] = useState6(children);
|
|
8912
9144
|
const [headingHeight, setHeadingHeight] = useState6("60");
|
|
8913
|
-
const headingRef =
|
|
9145
|
+
const headingRef = useRef5(null);
|
|
8914
9146
|
const handleSetEditing = (editing) => {
|
|
8915
9147
|
if (editingDisabled) return;
|
|
8916
9148
|
if (editing && headingRef.current) {
|
|
@@ -8996,9 +9228,9 @@ var EditableHeading = ({
|
|
|
8996
9228
|
};
|
|
8997
9229
|
|
|
8998
9230
|
// src/components/Form/Form.tsx
|
|
8999
|
-
import { forwardRef as forwardRef12, useRef as
|
|
9231
|
+
import { forwardRef as forwardRef12, useRef as useRef6, useMemo as useMemo4, createContext as createContext2, useState as useState7, useId as useId2 } from "react";
|
|
9000
9232
|
import styled32 from "styled-components";
|
|
9001
|
-
import { isNotUndefined as
|
|
9233
|
+
import { isNotUndefined as isNotUndefined7, isUndefined as isUndefined3 } from "@wistia/type-guards";
|
|
9002
9234
|
|
|
9003
9235
|
// src/components/Stack/Stack.tsx
|
|
9004
9236
|
import { forwardRef as forwardRef11 } from "react";
|
|
@@ -9058,7 +9290,7 @@ var FormComponent = ({
|
|
|
9058
9290
|
}, forwardedRef) => {
|
|
9059
9291
|
const [errors, setErrors] = useState7({});
|
|
9060
9292
|
const [hasSubmitted, setHasSubmitted] = useState7(false);
|
|
9061
|
-
const innerRef =
|
|
9293
|
+
const innerRef = useRef6();
|
|
9062
9294
|
const ref = forwardedRef ?? innerRef;
|
|
9063
9295
|
const autoId = useId2();
|
|
9064
9296
|
const id = props.id ?? autoId;
|
|
@@ -9069,12 +9301,12 @@ var FormComponent = ({
|
|
|
9069
9301
|
}
|
|
9070
9302
|
return validate(nextData);
|
|
9071
9303
|
};
|
|
9072
|
-
const
|
|
9304
|
+
const handleBlur2 = (event) => {
|
|
9073
9305
|
if (props.onBlur) {
|
|
9074
9306
|
props.onBlur(event);
|
|
9075
9307
|
}
|
|
9076
9308
|
const formData = new FormData(event.currentTarget);
|
|
9077
|
-
if (
|
|
9309
|
+
if (isNotUndefined7(validate)) {
|
|
9078
9310
|
handleValidate(formData);
|
|
9079
9311
|
}
|
|
9080
9312
|
};
|
|
@@ -9122,7 +9354,7 @@ var FormComponent = ({
|
|
|
9122
9354
|
as: StyledForm,
|
|
9123
9355
|
gap: "space-05",
|
|
9124
9356
|
id,
|
|
9125
|
-
onBlur:
|
|
9357
|
+
onBlur: handleBlur2,
|
|
9126
9358
|
onReset: handleReset,
|
|
9127
9359
|
onSubmit: handleSubmit,
|
|
9128
9360
|
children
|
|
@@ -9134,12 +9366,12 @@ FormComponent.displayName = "Form";
|
|
|
9134
9366
|
var Form = forwardRef12(FormComponent);
|
|
9135
9367
|
|
|
9136
9368
|
// src/components/Form/useFormState.tsx
|
|
9137
|
-
import { useCallback as
|
|
9369
|
+
import { useCallback as useCallback7, useState as useState8 } from "react";
|
|
9138
9370
|
var useFormState = (action, initialData = {}) => {
|
|
9139
9371
|
const [data, setData] = useState8(initialData);
|
|
9140
9372
|
const [isPending, setIsPending] = useState8(false);
|
|
9141
9373
|
const [error, setError] = useState8(null);
|
|
9142
|
-
const formAction =
|
|
9374
|
+
const formAction = useCallback7(
|
|
9143
9375
|
async (nextFormData) => {
|
|
9144
9376
|
if (nextFormData === null) {
|
|
9145
9377
|
setData(initialData);
|
|
@@ -9170,14 +9402,14 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9170
9402
|
};
|
|
9171
9403
|
|
|
9172
9404
|
// src/components/Form/FormErrorSummary.tsx
|
|
9173
|
-
import { useContext as useContext2, useRef as
|
|
9174
|
-
import { isArray, isNotUndefined as
|
|
9405
|
+
import { useContext as useContext2, useRef as useRef7 } from "react";
|
|
9406
|
+
import { isArray, isNotUndefined as isNotUndefined8 } from "@wistia/type-guards";
|
|
9175
9407
|
import { jsx as jsx222, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
9176
9408
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9177
9409
|
return /* @__PURE__ */ jsx222("li", { children: /* @__PURE__ */ jsx222(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9178
9410
|
};
|
|
9179
9411
|
var FormErrorSummary = ({ description }) => {
|
|
9180
|
-
const ref =
|
|
9412
|
+
const ref = useRef7(null);
|
|
9181
9413
|
const { formId, errors, hasSubmitted } = useContext2(FormContext);
|
|
9182
9414
|
const isValid = Object.keys(errors).length === 0;
|
|
9183
9415
|
if (isValid || !hasSubmitted) {
|
|
@@ -9185,7 +9417,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9185
9417
|
}
|
|
9186
9418
|
return /* @__PURE__ */ jsxs21("div", { ref, children: [
|
|
9187
9419
|
/* @__PURE__ */ jsx222("p", { children: description }),
|
|
9188
|
-
/* @__PURE__ */ jsx222("ul", { children: Object.entries(errors).filter(([, error]) =>
|
|
9420
|
+
/* @__PURE__ */ jsx222("ul", { children: Object.entries(errors).filter(([, error]) => isNotUndefined8(error)).map(
|
|
9189
9421
|
([name, error]) => isArray(error) ? error.map((err) => /* @__PURE__ */ jsx222(
|
|
9190
9422
|
ErrorItem,
|
|
9191
9423
|
{
|
|
@@ -9210,7 +9442,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9210
9442
|
// src/components/FormField/FormField.tsx
|
|
9211
9443
|
import { Children as Children5, cloneElement as cloneElement5, useContext as useContext3 } from "react";
|
|
9212
9444
|
import styled35 from "styled-components";
|
|
9213
|
-
import { isArray as isArray2, isNotNil as isNotNil13, isNotUndefined as
|
|
9445
|
+
import { isArray as isArray2, isNotNil as isNotNil13, isNotUndefined as isNotUndefined9, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
9214
9446
|
|
|
9215
9447
|
// src/components/Label/Label.tsx
|
|
9216
9448
|
import styled33, { css as css27 } from "styled-components";
|
|
@@ -9277,7 +9509,7 @@ import { createContext as createContext3, useMemo as useMemo5 } from "react";
|
|
|
9277
9509
|
|
|
9278
9510
|
// src/components/FormGroup/FormGroup.tsx
|
|
9279
9511
|
import styled34 from "styled-components";
|
|
9280
|
-
import { useRef as
|
|
9512
|
+
import { useRef as useRef8 } from "react";
|
|
9281
9513
|
import { jsx as jsx224, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9282
9514
|
var StyledFieldset = styled34.fieldset`
|
|
9283
9515
|
border: 0;
|
|
@@ -9286,7 +9518,7 @@ var StyledLegend = styled34.legend`
|
|
|
9286
9518
|
margin-bottom: var(--space-01);
|
|
9287
9519
|
`;
|
|
9288
9520
|
var FormGroup = ({ children, label, ...props }) => {
|
|
9289
|
-
const ref =
|
|
9521
|
+
const ref = useRef8();
|
|
9290
9522
|
return /* @__PURE__ */ jsxs22(
|
|
9291
9523
|
Stack,
|
|
9292
9524
|
{
|
|
@@ -9420,7 +9652,7 @@ var FormField = ({
|
|
|
9420
9652
|
"aria-describedby": ariaDescribedby,
|
|
9421
9653
|
...props
|
|
9422
9654
|
};
|
|
9423
|
-
if (isUndefined4(value) &&
|
|
9655
|
+
if (isUndefined4(value) && isNotUndefined9(defaultValue)) {
|
|
9424
9656
|
childProps = {
|
|
9425
9657
|
...childProps,
|
|
9426
9658
|
defaultValue
|
|
@@ -9429,10 +9661,10 @@ var FormField = ({
|
|
|
9429
9661
|
if (isNotNil13(checkboxGroup)) {
|
|
9430
9662
|
const computedName = isNotNil13(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
9431
9663
|
const handleChange = (event) => {
|
|
9432
|
-
if (
|
|
9664
|
+
if (isNotUndefined9(props.onChange)) {
|
|
9433
9665
|
props.onChange(event);
|
|
9434
9666
|
}
|
|
9435
|
-
if (
|
|
9667
|
+
if (isNotUndefined9(checkboxGroup.onChange)) {
|
|
9436
9668
|
checkboxGroup.onChange(event);
|
|
9437
9669
|
}
|
|
9438
9670
|
};
|
|
@@ -9585,7 +9817,7 @@ import {
|
|
|
9585
9817
|
DropdownMenuPortal,
|
|
9586
9818
|
DropdownMenuContent
|
|
9587
9819
|
} from "@radix-ui/react-dropdown-menu";
|
|
9588
|
-
import { isNotNil as isNotNil15, isNotUndefined as
|
|
9820
|
+
import { isNotNil as isNotNil15, isNotUndefined as isNotUndefined10 } from "@wistia/type-guards";
|
|
9589
9821
|
import { useMemo as useMemo7 } from "react";
|
|
9590
9822
|
|
|
9591
9823
|
// src/components/Menu/MenuContext.tsx
|
|
@@ -9711,7 +9943,7 @@ var Menu = ({
|
|
|
9711
9943
|
modal: false,
|
|
9712
9944
|
...controlProps,
|
|
9713
9945
|
children: [
|
|
9714
|
-
/* @__PURE__ */ jsx230(DropdownMenuTrigger, { asChild: true, children:
|
|
9946
|
+
/* @__PURE__ */ jsx230(DropdownMenuTrigger, { asChild: true, children: isNotUndefined10(trigger) ? trigger : /* @__PURE__ */ jsx230(
|
|
9715
9947
|
Button,
|
|
9716
9948
|
{
|
|
9717
9949
|
"aria-expanded": isOpen,
|
|
@@ -9784,7 +10016,7 @@ import { isNotNil as isNotNil17 } from "@wistia/type-guards";
|
|
|
9784
10016
|
// src/components/Menu/MenuItemButton.tsx
|
|
9785
10017
|
import { forwardRef as forwardRef14 } from "react";
|
|
9786
10018
|
import styled40 from "styled-components";
|
|
9787
|
-
import { isNotNil as isNotNil16, isNotUndefined as
|
|
10019
|
+
import { isNotNil as isNotNil16, isNotUndefined as isNotUndefined11 } from "@wistia/type-guards";
|
|
9788
10020
|
import { jsx as jsx232, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9789
10021
|
var StyledButton3 = styled40(Button)`
|
|
9790
10022
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -9862,7 +10094,7 @@ var StyledBadgeContainer = styled40.div`
|
|
|
9862
10094
|
var MenuItemButton = forwardRef14(({ children, appearance, command, icon, ...props }, ref) => {
|
|
9863
10095
|
let { colorScheme, badge } = props;
|
|
9864
10096
|
if (appearance === "dangerous") {
|
|
9865
|
-
if (
|
|
10097
|
+
if (isNotUndefined11(colorScheme)) {
|
|
9866
10098
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
9867
10099
|
}
|
|
9868
10100
|
colorScheme = "error";
|
|
@@ -10209,14 +10441,14 @@ import styled45 from "styled-components";
|
|
|
10209
10441
|
import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
10210
10442
|
|
|
10211
10443
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10212
|
-
import { useRef as
|
|
10444
|
+
import { useRef as useRef9, useEffect as useEffect7 } from "react";
|
|
10213
10445
|
import { isNotNil as isNotNil18 } from "@wistia/type-guards";
|
|
10214
10446
|
var useFocusRestore = () => {
|
|
10215
|
-
const previouslyFocusedRef =
|
|
10216
|
-
|
|
10447
|
+
const previouslyFocusedRef = useRef9(null);
|
|
10448
|
+
useEffect7(() => {
|
|
10217
10449
|
previouslyFocusedRef.current = document.activeElement;
|
|
10218
10450
|
}, []);
|
|
10219
|
-
|
|
10451
|
+
useEffect7(() => {
|
|
10220
10452
|
return () => {
|
|
10221
10453
|
if (isNotNil18(previouslyFocusedRef.current)) {
|
|
10222
10454
|
setTimeout(() => {
|
|
@@ -10858,7 +11090,7 @@ var SegmentedControl = forwardRef20(
|
|
|
10858
11090
|
SegmentedControl.displayName = "SegmentedControl";
|
|
10859
11091
|
|
|
10860
11092
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
10861
|
-
import { forwardRef as forwardRef21, useEffect as
|
|
11093
|
+
import { forwardRef as forwardRef21, useEffect as useEffect8, useRef as useRef10 } from "react";
|
|
10862
11094
|
import styled53, { css as css32 } from "styled-components";
|
|
10863
11095
|
import { Item as ToggleGroupItem } from "@radix-ui/react-toggle-group";
|
|
10864
11096
|
import { isNotNil as isNotNil22 } from "@wistia/type-guards";
|
|
@@ -10930,7 +11162,7 @@ var SegmentedControlItem = forwardRef21(
|
|
|
10930
11162
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
10931
11163
|
const selectedValue = useSegmentedControlValue();
|
|
10932
11164
|
const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
|
|
10933
|
-
const buttonRef =
|
|
11165
|
+
const buttonRef = useRef10(null);
|
|
10934
11166
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
10935
11167
|
const handleClick = (event) => {
|
|
10936
11168
|
const target = event.target;
|
|
@@ -10939,7 +11171,7 @@ var SegmentedControlItem = forwardRef21(
|
|
|
10939
11171
|
event.preventDefault();
|
|
10940
11172
|
}
|
|
10941
11173
|
};
|
|
10942
|
-
|
|
11174
|
+
useEffect8(() => {
|
|
10943
11175
|
const buttonElem = buttonRef.current;
|
|
10944
11176
|
if (!buttonElem) {
|
|
10945
11177
|
return void 0;
|
|
@@ -11507,7 +11739,7 @@ var TabList = ({
|
|
|
11507
11739
|
TabList.displayName = "TabList";
|
|
11508
11740
|
|
|
11509
11741
|
// src/components/Tabs/TabItem.tsx
|
|
11510
|
-
import { forwardRef as forwardRef25, useEffect as
|
|
11742
|
+
import { forwardRef as forwardRef25, useEffect as useEffect9, useRef as useRef11 } from "react";
|
|
11511
11743
|
import styled66 from "styled-components";
|
|
11512
11744
|
import { Trigger as RadixTab } from "@radix-ui/react-tabs";
|
|
11513
11745
|
import { isNotNil as isNotNil23 } from "@wistia/type-guards";
|
|
@@ -11537,9 +11769,9 @@ var TabItem = forwardRef25(
|
|
|
11537
11769
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11538
11770
|
const selectedValue = useTabsValue();
|
|
11539
11771
|
const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
|
|
11540
|
-
const buttonRef =
|
|
11772
|
+
const buttonRef = useRef11(null);
|
|
11541
11773
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11542
|
-
|
|
11774
|
+
useEffect9(() => {
|
|
11543
11775
|
const buttonElem = buttonRef.current;
|
|
11544
11776
|
if (!buttonElem) {
|
|
11545
11777
|
return void 0;
|
|
@@ -12049,6 +12281,257 @@ var WistiaLogo = ({
|
|
|
12049
12281
|
return href !== void 0 ? /* @__PURE__ */ jsx266("a", { href, children: Logo }) : Logo;
|
|
12050
12282
|
};
|
|
12051
12283
|
WistiaLogo.displayName = "WistiaLogo";
|
|
12284
|
+
|
|
12285
|
+
// src/components/Thumbnail/Thumbnail.tsx
|
|
12286
|
+
import { forwardRef as forwardRef29 } from "react";
|
|
12287
|
+
import styled71 from "styled-components";
|
|
12288
|
+
import { isNotNil as isNotNil28 } from "@wistia/type-guards";
|
|
12289
|
+
|
|
12290
|
+
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
12291
|
+
import { isNotNil as isNotNil27 } from "@wistia/type-guards";
|
|
12292
|
+
import { css as css37 } from "styled-components";
|
|
12293
|
+
var gradients = {
|
|
12294
|
+
defaultDarkOne: css37`
|
|
12295
|
+
background-color: #222d66;
|
|
12296
|
+
background-image:
|
|
12297
|
+
radial-gradient(farthest-corner at top right, #222d66, transparent 70%),
|
|
12298
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 50%),
|
|
12299
|
+
radial-gradient(farthest-corner at bottom left, #6b84ff, transparent 57%),
|
|
12300
|
+
radial-gradient(farthest-corner at top left, #2949e5, transparent 68%);
|
|
12301
|
+
`,
|
|
12302
|
+
defaultDarkTwo: css37`
|
|
12303
|
+
background-color: #222d66;
|
|
12304
|
+
background-image:
|
|
12305
|
+
radial-gradient(farthest-corner at top left, #6b84ff, transparent 100%),
|
|
12306
|
+
radial-gradient(farthest-corner at bottom left, #222d66, transparent 57%),
|
|
12307
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 50%),
|
|
12308
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 70%);
|
|
12309
|
+
`,
|
|
12310
|
+
defaultLightOne: css37`
|
|
12311
|
+
background-color: #ccd5ff;
|
|
12312
|
+
background-image:
|
|
12313
|
+
radial-gradient(farthest-corner at bottom right, #ccd5ff, transparent 55%),
|
|
12314
|
+
radial-gradient(farthest-corner at top left, #ccd5ff, transparent 65%),
|
|
12315
|
+
radial-gradient(farthest-corner at top right, #6b84ff, transparent 50%),
|
|
12316
|
+
radial-gradient(farthest-corner at bottom left, #f7f8ff, transparent 50%);
|
|
12317
|
+
`,
|
|
12318
|
+
defaultLightTwo: css37`
|
|
12319
|
+
background-color: #ccd5ff;
|
|
12320
|
+
background-image:
|
|
12321
|
+
radial-gradient(ellipse at top, #ccd5ff, transparent),
|
|
12322
|
+
radial-gradient(ellipse at bottom, #6b84ff, transparent);
|
|
12323
|
+
`,
|
|
12324
|
+
defaultMidOne: css37`
|
|
12325
|
+
background-color: #6b84ff;
|
|
12326
|
+
background-image:
|
|
12327
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 70%),
|
|
12328
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 50%),
|
|
12329
|
+
radial-gradient(farthest-corner at top left, #6b84ff, transparent 80%),
|
|
12330
|
+
radial-gradient(farthest-corner at bottom left, #222d66, transparent 57%);
|
|
12331
|
+
`,
|
|
12332
|
+
defaultMidTwo: css37`
|
|
12333
|
+
background-color: #6b84ff;
|
|
12334
|
+
background-image:
|
|
12335
|
+
radial-gradient(ellipse at top, #2949e5, transparent),
|
|
12336
|
+
radial-gradient(ellipse at bottom, #ccd5ff, transparent);
|
|
12337
|
+
`,
|
|
12338
|
+
green: css37`
|
|
12339
|
+
background-color: #fafffa;
|
|
12340
|
+
background-image:
|
|
12341
|
+
radial-gradient(farthest-corner at bottom left, #b0e5a5, transparent 50%),
|
|
12342
|
+
radial-gradient(farthest-corner at top right, #268713, transparent 50%),
|
|
12343
|
+
radial-gradient(farthest-corner at top left, #44b62d, transparent 65%),
|
|
12344
|
+
radial-gradient(farthest-corner at bottom right, #44b62d, transparent 55%);
|
|
12345
|
+
`,
|
|
12346
|
+
greenWithPop: css37`
|
|
12347
|
+
background-color: #fafffa;
|
|
12348
|
+
background-image:
|
|
12349
|
+
radial-gradient(farthest-corner at bottom left, #b0e5a5, transparent 50%),
|
|
12350
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 50%),
|
|
12351
|
+
radial-gradient(farthest-corner at top left, #44b62d, transparent 65%),
|
|
12352
|
+
radial-gradient(farthest-corner at bottom right, #44b62d, transparent 55%);
|
|
12353
|
+
`,
|
|
12354
|
+
pink: css37`
|
|
12355
|
+
background-color: #fffff0;
|
|
12356
|
+
background-image:
|
|
12357
|
+
radial-gradient(farthest-corner at bottom left, #ffc7e8, transparent 50%),
|
|
12358
|
+
radial-gradient(farthest-corner at top right, #e0128e, transparent 70%),
|
|
12359
|
+
radial-gradient(farthest-corner at top left, #ff40b3, transparent 65%),
|
|
12360
|
+
radial-gradient(farthest-corner at bottom right, #ff40b3, transparent 55%);
|
|
12361
|
+
`,
|
|
12362
|
+
pinkWithPop: css37`
|
|
12363
|
+
background-color: #fffff0;
|
|
12364
|
+
background-image:
|
|
12365
|
+
radial-gradient(farthest-corner at top right, #e0128e, transparent 70%),
|
|
12366
|
+
radial-gradient(farthest-corner at top left, #ff40b3, transparent 65%),
|
|
12367
|
+
radial-gradient(farthest-corner at bottom right, #ff40b3, transparent 55%),
|
|
12368
|
+
radial-gradient(farthest-corner at bottom left, #2949e5, transparent 50%);
|
|
12369
|
+
`,
|
|
12370
|
+
playfulGradientOne: css37`
|
|
12371
|
+
background-color: #f7f8ff;
|
|
12372
|
+
background-image:
|
|
12373
|
+
radial-gradient(farthest-corner at top left, #d65cff, transparent 68%),
|
|
12374
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 50%),
|
|
12375
|
+
radial-gradient(farthest-corner at bottom left, #ffc7e8, transparent 57%),
|
|
12376
|
+
radial-gradient(farthest-corner at top right, #ffcaba, transparent 70%);
|
|
12377
|
+
`,
|
|
12378
|
+
playfulGradientTwo: css37`
|
|
12379
|
+
background-color: #f7f8ff;
|
|
12380
|
+
background-image:
|
|
12381
|
+
radial-gradient(farthest-corner at top left, #44b62d, transparent 68%),
|
|
12382
|
+
radial-gradient(farthest-corner at bottom right, #eff18d, transparent 50%),
|
|
12383
|
+
radial-gradient(farthest-corner at bottom left, #ccd5ff, transparent 57%),
|
|
12384
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 70%);
|
|
12385
|
+
`,
|
|
12386
|
+
purple: css37`
|
|
12387
|
+
background-color: #f2caff;
|
|
12388
|
+
background-image:
|
|
12389
|
+
radial-gradient(ellipse at 0% 100%, #f9e5ff, transparent 50%),
|
|
12390
|
+
radial-gradient(ellipse at 100% 0%, #e093fa, transparent 70%);
|
|
12391
|
+
`,
|
|
12392
|
+
purpleWithPop: css37`
|
|
12393
|
+
background-color: #f2caff;
|
|
12394
|
+
background-image:
|
|
12395
|
+
radial-gradient(farthest-corner at bottom left, #f2caff, transparent 50%),
|
|
12396
|
+
radial-gradient(farthest-corner at top left, #d65cff, transparent 65%),
|
|
12397
|
+
radial-gradient(farthest-corner at bottom right, #d65cff, transparent 55%),
|
|
12398
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 70%);
|
|
12399
|
+
`,
|
|
12400
|
+
yellow: css37`
|
|
12401
|
+
background-color: #fffff0;
|
|
12402
|
+
background-image:
|
|
12403
|
+
radial-gradient(farthest-corner at bottom left, #eff18d, transparent 50%),
|
|
12404
|
+
radial-gradient(farthest-corner at top right, #bcbf19, transparent 70%),
|
|
12405
|
+
radial-gradient(farthest-corner at top left, #e8ec1e, transparent 65%),
|
|
12406
|
+
radial-gradient(farthest-corner at bottom right, #e8ec1e, transparent 55%);
|
|
12407
|
+
`,
|
|
12408
|
+
yellowWithPop: css37`
|
|
12409
|
+
background-color: #fffff0;
|
|
12410
|
+
background-image:
|
|
12411
|
+
radial-gradient(farthest-corner at bottom left, #eff18d, transparent 50%),
|
|
12412
|
+
radial-gradient(farthest-corner at top right, #bcbf19, transparent 70%),
|
|
12413
|
+
radial-gradient(farthest-corner at top left, #e8ec1e, transparent 65%),
|
|
12414
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 55%);
|
|
12415
|
+
`
|
|
12416
|
+
};
|
|
12417
|
+
var gradientMap = Object.keys(gradients);
|
|
12418
|
+
var getBackgroundGradient = (gradientName = void 0) => {
|
|
12419
|
+
return isNotNil27(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
12420
|
+
};
|
|
12421
|
+
|
|
12422
|
+
// src/components/Thumbnail/Thumbnail.tsx
|
|
12423
|
+
import { jsx as jsx267, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
12424
|
+
var WideThumbnailImage = styled71.img`
|
|
12425
|
+
height: 100%;
|
|
12426
|
+
object-fit: cover;
|
|
12427
|
+
width: 100%;
|
|
12428
|
+
`;
|
|
12429
|
+
var SquareThumbnailImage = styled71.img`
|
|
12430
|
+
backdrop-filter: blur(8px);
|
|
12431
|
+
object-fit: contain;
|
|
12432
|
+
width: 100%;
|
|
12433
|
+
`;
|
|
12434
|
+
var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
12435
|
+
if (thumbnailImageType === "wide") {
|
|
12436
|
+
return /* @__PURE__ */ jsx267(
|
|
12437
|
+
WideThumbnailImage,
|
|
12438
|
+
{
|
|
12439
|
+
alt: "",
|
|
12440
|
+
src: thumbnailUrl
|
|
12441
|
+
}
|
|
12442
|
+
);
|
|
12443
|
+
}
|
|
12444
|
+
return /* @__PURE__ */ jsx267(
|
|
12445
|
+
SquareThumbnailImage,
|
|
12446
|
+
{
|
|
12447
|
+
alt: "",
|
|
12448
|
+
src: thumbnailUrl
|
|
12449
|
+
}
|
|
12450
|
+
);
|
|
12451
|
+
};
|
|
12452
|
+
var StyledThumbnail = styled71.div`
|
|
12453
|
+
${({ $gradientBackground }) => getBackgroundGradient($gradientBackground)};
|
|
12454
|
+
aspect-ratio: 16 / 9;
|
|
12455
|
+
background: ${({ $backgroundUrl }) => isNotNil28($backgroundUrl) ? `url('${$backgroundUrl}') center / cover` : void 0};
|
|
12456
|
+
border-radius: 4px;
|
|
12457
|
+
display: flex;
|
|
12458
|
+
overflow: hidden;
|
|
12459
|
+
position: relative;
|
|
12460
|
+
width: ${({ $width }) => $width};
|
|
12461
|
+
`;
|
|
12462
|
+
var Thumbnail = forwardRef29(
|
|
12463
|
+
({
|
|
12464
|
+
gradientBackground = "defaultMidOne",
|
|
12465
|
+
thumbnailImageType = "square",
|
|
12466
|
+
thumbnailUrl,
|
|
12467
|
+
width = "100%",
|
|
12468
|
+
children,
|
|
12469
|
+
...otherProps
|
|
12470
|
+
}, ref) => {
|
|
12471
|
+
const backgroundUrl = thumbnailImageType === "square" && isNotNil28(thumbnailUrl) ? thumbnailUrl : void 0;
|
|
12472
|
+
return /* @__PURE__ */ jsxs44(
|
|
12473
|
+
StyledThumbnail,
|
|
12474
|
+
{
|
|
12475
|
+
ref,
|
|
12476
|
+
$backgroundUrl: backgroundUrl,
|
|
12477
|
+
$gradientBackground: gradientBackground,
|
|
12478
|
+
$width: width,
|
|
12479
|
+
...otherProps,
|
|
12480
|
+
children: [
|
|
12481
|
+
isNotNil28(children) && children,
|
|
12482
|
+
isNotNil28(thumbnailUrl) && /* @__PURE__ */ jsx267(
|
|
12483
|
+
ThumbnailImage,
|
|
12484
|
+
{
|
|
12485
|
+
thumbnailImageType,
|
|
12486
|
+
thumbnailUrl
|
|
12487
|
+
}
|
|
12488
|
+
)
|
|
12489
|
+
]
|
|
12490
|
+
}
|
|
12491
|
+
);
|
|
12492
|
+
}
|
|
12493
|
+
);
|
|
12494
|
+
Thumbnail.displayName = "Thumbnail";
|
|
12495
|
+
|
|
12496
|
+
// src/components/Thumbnail/ThumbnailOverlay.tsx
|
|
12497
|
+
import styled72 from "styled-components";
|
|
12498
|
+
import { isNotNil as isNotNil29 } from "@wistia/type-guards";
|
|
12499
|
+
import { jsx as jsx268, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
12500
|
+
var StyledThumbnailOverlay = styled72.div`
|
|
12501
|
+
align-items: center;
|
|
12502
|
+
background-color: rgb(0 0 0 / 50%);
|
|
12503
|
+
border-radius: var(--wui-border-radius-01);
|
|
12504
|
+
bottom: var(--wui-space-01);
|
|
12505
|
+
color: var(--wui-color-text-on-fill);
|
|
12506
|
+
display: flex;
|
|
12507
|
+
font-size: var(--wui-typography-body-4-size);
|
|
12508
|
+
font-weight: var(--wui-typography-weight-body-bold);
|
|
12509
|
+
gap: var(--wui-space-01);
|
|
12510
|
+
padding: 0 var(--wui-space-01);
|
|
12511
|
+
position: absolute;
|
|
12512
|
+
right: var(--wui-space-01);
|
|
12513
|
+
z-index: 1;
|
|
12514
|
+
|
|
12515
|
+
svg {
|
|
12516
|
+
height: 12px;
|
|
12517
|
+
width: 12px;
|
|
12518
|
+
|
|
12519
|
+
path {
|
|
12520
|
+
color: var(--wui-color-icon-on-fill);
|
|
12521
|
+
}
|
|
12522
|
+
}
|
|
12523
|
+
`;
|
|
12524
|
+
var ThumbnailOverlay = ({
|
|
12525
|
+
icon,
|
|
12526
|
+
label,
|
|
12527
|
+
...otherProps
|
|
12528
|
+
}) => {
|
|
12529
|
+
return /* @__PURE__ */ jsxs45(StyledThumbnailOverlay, { ...otherProps, children: [
|
|
12530
|
+
isNotNil29(icon) && icon,
|
|
12531
|
+
/* @__PURE__ */ jsx268("span", { children: label })
|
|
12532
|
+
] });
|
|
12533
|
+
};
|
|
12534
|
+
ThumbnailOverlay.displayName = "ThumbnailOverlay";
|
|
12052
12535
|
export {
|
|
12053
12536
|
ActionButton,
|
|
12054
12537
|
Avatar,
|
|
@@ -12121,6 +12604,8 @@ export {
|
|
|
12121
12604
|
Tabs,
|
|
12122
12605
|
Tag,
|
|
12123
12606
|
Text,
|
|
12607
|
+
Thumbnail,
|
|
12608
|
+
ThumbnailOverlay,
|
|
12124
12609
|
Tooltip,
|
|
12125
12610
|
UIProvider,
|
|
12126
12611
|
WistiaLogo,
|
|
@@ -12136,6 +12621,7 @@ export {
|
|
|
12136
12621
|
useAriaLive,
|
|
12137
12622
|
useBoolean,
|
|
12138
12623
|
useFilePicker,
|
|
12624
|
+
useFocusTrap,
|
|
12139
12625
|
useFormState,
|
|
12140
12626
|
useImperativeFilePicker,
|
|
12141
12627
|
useKey,
|