@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.cjs
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
|
*
|
|
@@ -110,6 +110,8 @@ __export(index_exports, {
|
|
|
110
110
|
Tabs: () => Tabs,
|
|
111
111
|
Tag: () => Tag,
|
|
112
112
|
Text: () => Text,
|
|
113
|
+
Thumbnail: () => Thumbnail,
|
|
114
|
+
ThumbnailOverlay: () => ThumbnailOverlay,
|
|
113
115
|
Tooltip: () => Tooltip,
|
|
114
116
|
UIProvider: () => UIProvider,
|
|
115
117
|
WistiaLogo: () => WistiaLogo,
|
|
@@ -125,6 +127,7 @@ __export(index_exports, {
|
|
|
125
127
|
useAriaLive: () => useAriaLive,
|
|
126
128
|
useBoolean: () => useBoolean,
|
|
127
129
|
useFilePicker: () => import_use_file_picker.useFilePicker,
|
|
130
|
+
useFocusTrap: () => useFocusTrap,
|
|
128
131
|
useFormState: () => useFormState,
|
|
129
132
|
useImperativeFilePicker: () => import_use_file_picker.useImperativeFilePicker,
|
|
130
133
|
useKey: () => useKey,
|
|
@@ -2598,14 +2601,246 @@ var useToast = () => {
|
|
|
2598
2601
|
);
|
|
2599
2602
|
};
|
|
2600
2603
|
|
|
2604
|
+
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2605
|
+
var import_react13 = require("react");
|
|
2606
|
+
var import_type_guards11 = require("@wistia/type-guards");
|
|
2607
|
+
|
|
2608
|
+
// src/hooks/useFocusTrap/helpers.ts
|
|
2609
|
+
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]';
|
|
2610
|
+
var coerceToString = (value) => value === null || value === void 0 ? "" : String(value);
|
|
2611
|
+
var isHiddenElement = (element) => {
|
|
2612
|
+
const { display, visibility } = window.getComputedStyle(element);
|
|
2613
|
+
const isHidden = display === "none" || element.style.display === "none" || visibility === "none" || element.style.visibility === "hidden";
|
|
2614
|
+
return element.offsetWidth <= 0 && element.offsetHeight <= 0 || isHidden;
|
|
2615
|
+
};
|
|
2616
|
+
var isVisibleElement = (element) => {
|
|
2617
|
+
let parentElement = element;
|
|
2618
|
+
while (parentElement) {
|
|
2619
|
+
if (parentElement === document.body) {
|
|
2620
|
+
break;
|
|
2621
|
+
}
|
|
2622
|
+
if (isHiddenElement(parentElement)) {
|
|
2623
|
+
return false;
|
|
2624
|
+
}
|
|
2625
|
+
parentElement = parentElement.parentNode;
|
|
2626
|
+
}
|
|
2627
|
+
return true;
|
|
2628
|
+
};
|
|
2629
|
+
var getElementTabIndex = (element) => {
|
|
2630
|
+
const tabIndex = element.getAttribute("tabindex");
|
|
2631
|
+
return Number.parseInt(tabIndex ?? void 0, 10);
|
|
2632
|
+
};
|
|
2633
|
+
var isTabIndexNaN = (element) => {
|
|
2634
|
+
const tabIndex = getElementTabIndex(element);
|
|
2635
|
+
return Number.isNaN(tabIndex);
|
|
2636
|
+
};
|
|
2637
|
+
var isFocusableElement = (element) => {
|
|
2638
|
+
const tabbableNodeRegEx = /input|select|textarea|button|object/;
|
|
2639
|
+
const nodeName = element.nodeName.toLowerCase();
|
|
2640
|
+
const isTabIndexNotNaN = !isTabIndexNaN(element);
|
|
2641
|
+
const isFocusable = (
|
|
2642
|
+
// @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.
|
|
2643
|
+
tabbableNodeRegEx.test(nodeName) && !element.disabled || (element instanceof HTMLAnchorElement ? element.href || isTabIndexNotNaN : isTabIndexNotNaN)
|
|
2644
|
+
);
|
|
2645
|
+
return Boolean(isFocusable) && isVisibleElement(element);
|
|
2646
|
+
};
|
|
2647
|
+
var isTabbableElement = (element) => {
|
|
2648
|
+
const tabIndex = getElementTabIndex(element);
|
|
2649
|
+
return (isTabIndexNaN(element) || tabIndex >= 0) && isFocusableElement(element);
|
|
2650
|
+
};
|
|
2651
|
+
var findTabbableDescendants = (element) => Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter(
|
|
2652
|
+
isTabbableElement
|
|
2653
|
+
);
|
|
2654
|
+
var focusLaterElements = [];
|
|
2655
|
+
var focusElement = null;
|
|
2656
|
+
var needToFocus = false;
|
|
2657
|
+
var handleBlur = () => {
|
|
2658
|
+
needToFocus = true;
|
|
2659
|
+
};
|
|
2660
|
+
var handleFocus = () => {
|
|
2661
|
+
if (needToFocus) {
|
|
2662
|
+
needToFocus = false;
|
|
2663
|
+
if (!focusElement) {
|
|
2664
|
+
return;
|
|
2665
|
+
}
|
|
2666
|
+
if (focusElement.contains(document.activeElement)) {
|
|
2667
|
+
return;
|
|
2668
|
+
}
|
|
2669
|
+
const element = findTabbableDescendants(focusElement)[0] ?? focusElement;
|
|
2670
|
+
element.focus();
|
|
2671
|
+
}
|
|
2672
|
+
};
|
|
2673
|
+
var markForFocusLater = () => {
|
|
2674
|
+
const element = document.activeElement;
|
|
2675
|
+
if (element !== null) {
|
|
2676
|
+
focusLaterElements.push(element);
|
|
2677
|
+
}
|
|
2678
|
+
};
|
|
2679
|
+
var returnFocus = () => {
|
|
2680
|
+
let toFocus = null;
|
|
2681
|
+
try {
|
|
2682
|
+
toFocus = focusLaterElements.pop();
|
|
2683
|
+
if (toFocus) {
|
|
2684
|
+
toFocus.focus();
|
|
2685
|
+
}
|
|
2686
|
+
} catch {
|
|
2687
|
+
console.warn(
|
|
2688
|
+
`You tried to return focus to ${coerceToString(toFocus)} but it is not in the DOM anymore`
|
|
2689
|
+
);
|
|
2690
|
+
}
|
|
2691
|
+
};
|
|
2692
|
+
var setupScopedFocus = (element) => {
|
|
2693
|
+
focusElement = element;
|
|
2694
|
+
document.addEventListener("focusout", handleBlur, false);
|
|
2695
|
+
document.addEventListener("focusin", handleFocus, true);
|
|
2696
|
+
};
|
|
2697
|
+
var teardownScopedFocus = () => {
|
|
2698
|
+
focusElement = null;
|
|
2699
|
+
document.removeEventListener("focusout", handleBlur);
|
|
2700
|
+
document.removeEventListener("focusin", handleFocus);
|
|
2701
|
+
};
|
|
2702
|
+
var scopeTab = (node, event) => {
|
|
2703
|
+
const tabbable = findTabbableDescendants(node);
|
|
2704
|
+
if (!tabbable.length) {
|
|
2705
|
+
event.preventDefault();
|
|
2706
|
+
return;
|
|
2707
|
+
}
|
|
2708
|
+
const finalTabbable = tabbable[event.shiftKey ? 0 : tabbable.length - 1];
|
|
2709
|
+
const leavingFinalTabbable = finalTabbable === document.activeElement || node === document.activeElement;
|
|
2710
|
+
if (!leavingFinalTabbable) {
|
|
2711
|
+
return;
|
|
2712
|
+
}
|
|
2713
|
+
event.preventDefault();
|
|
2714
|
+
const target = tabbable[event.shiftKey ? tabbable.length - 1 : 0];
|
|
2715
|
+
if (target) {
|
|
2716
|
+
target.focus();
|
|
2717
|
+
}
|
|
2718
|
+
};
|
|
2719
|
+
var createAriaHider = (containerNode, selector) => {
|
|
2720
|
+
if (selector === void 0) {
|
|
2721
|
+
selector = "body > :not(script)";
|
|
2722
|
+
}
|
|
2723
|
+
const rootNodes = Array.from(document.querySelectorAll(selector)).map((node) => {
|
|
2724
|
+
if (node.contains(containerNode)) {
|
|
2725
|
+
return void 0;
|
|
2726
|
+
}
|
|
2727
|
+
const ariaHidden = node.getAttribute("aria-hidden");
|
|
2728
|
+
if (ariaHidden === null || ariaHidden === "false") {
|
|
2729
|
+
node.setAttribute("aria-hidden", "true");
|
|
2730
|
+
}
|
|
2731
|
+
return {
|
|
2732
|
+
node,
|
|
2733
|
+
ariaHidden
|
|
2734
|
+
};
|
|
2735
|
+
});
|
|
2736
|
+
return () => {
|
|
2737
|
+
rootNodes.forEach((item) => {
|
|
2738
|
+
if (!item) {
|
|
2739
|
+
return;
|
|
2740
|
+
}
|
|
2741
|
+
if (item.ariaHidden === null) {
|
|
2742
|
+
item.node.removeAttribute("aria-hidden");
|
|
2743
|
+
} else {
|
|
2744
|
+
item.node.setAttribute("aria-hidden", item.ariaHidden);
|
|
2745
|
+
}
|
|
2746
|
+
});
|
|
2747
|
+
};
|
|
2748
|
+
};
|
|
2749
|
+
|
|
2750
|
+
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2751
|
+
var isRef = (val) => {
|
|
2752
|
+
return val !== null && typeof val === "object" && "current" in val;
|
|
2753
|
+
};
|
|
2754
|
+
var useFocusTrap = (active = true, options = {}) => {
|
|
2755
|
+
const ref = (0, import_react13.useRef)(null);
|
|
2756
|
+
const restoreAriaRef = (0, import_react13.useRef)(null);
|
|
2757
|
+
const setRef = (0, import_react13.useCallback)(
|
|
2758
|
+
(node) => {
|
|
2759
|
+
if (restoreAriaRef.current !== null) {
|
|
2760
|
+
restoreAriaRef.current();
|
|
2761
|
+
}
|
|
2762
|
+
if (ref.current) {
|
|
2763
|
+
returnFocus();
|
|
2764
|
+
teardownScopedFocus();
|
|
2765
|
+
}
|
|
2766
|
+
if (active && node !== null && node !== void 0) {
|
|
2767
|
+
setupScopedFocus(node);
|
|
2768
|
+
markForFocusLater();
|
|
2769
|
+
const processNode = (node2) => {
|
|
2770
|
+
restoreAriaRef.current = !(options.disableAriaHider ?? false) ? createAriaHider(node2) : null;
|
|
2771
|
+
let focusElement2 = null;
|
|
2772
|
+
if ((0, import_type_guards11.isNotUndefined)(options.focusSelector)) {
|
|
2773
|
+
if (isRef(options.focusSelector)) {
|
|
2774
|
+
focusElement2 = options.focusSelector.current;
|
|
2775
|
+
} else {
|
|
2776
|
+
focusElement2 = typeof options.focusSelector === "string" ? node2.querySelector(options.focusSelector) : options.focusSelector;
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
if (!focusElement2) {
|
|
2780
|
+
const children = Array.from(
|
|
2781
|
+
node2.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)
|
|
2782
|
+
);
|
|
2783
|
+
focusElement2 = // Prefer tabbable elements, But fallback to any focusable element
|
|
2784
|
+
children.find(isTabbableElement) ?? // But fallback to any focusable element
|
|
2785
|
+
children.find(isFocusableElement) ?? // Nothing found
|
|
2786
|
+
null;
|
|
2787
|
+
if (!focusElement2 && isFocusableElement(node2)) {
|
|
2788
|
+
focusElement2 = node2;
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
if (focusElement2) {
|
|
2792
|
+
focusElement2.focus();
|
|
2793
|
+
}
|
|
2794
|
+
if (!focusElement2 && process.env["NODE_ENV"] === "development") {
|
|
2795
|
+
console.warn(
|
|
2796
|
+
'[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.',
|
|
2797
|
+
node2
|
|
2798
|
+
);
|
|
2799
|
+
}
|
|
2800
|
+
};
|
|
2801
|
+
setTimeout(() => {
|
|
2802
|
+
if (node.ownerDocument) {
|
|
2803
|
+
processNode(node);
|
|
2804
|
+
}
|
|
2805
|
+
if (!node.ownerDocument && process.env["NODE_ENV"] === "development") {
|
|
2806
|
+
console.warn(
|
|
2807
|
+
"[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.",
|
|
2808
|
+
node
|
|
2809
|
+
);
|
|
2810
|
+
}
|
|
2811
|
+
});
|
|
2812
|
+
ref.current = node;
|
|
2813
|
+
} else {
|
|
2814
|
+
ref.current = null;
|
|
2815
|
+
}
|
|
2816
|
+
},
|
|
2817
|
+
[active, options.focusSelector, options.disableAriaHider]
|
|
2818
|
+
);
|
|
2819
|
+
(0, import_react13.useEffect)(() => {
|
|
2820
|
+
if (!active) {
|
|
2821
|
+
return void 0;
|
|
2822
|
+
}
|
|
2823
|
+
const handleKeyDown = (event) => {
|
|
2824
|
+
if (event.key === "Tab" && ref.current) {
|
|
2825
|
+
scopeTab(ref.current, event);
|
|
2826
|
+
}
|
|
2827
|
+
};
|
|
2828
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
2829
|
+
return () => {
|
|
2830
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
2831
|
+
};
|
|
2832
|
+
}, [active]);
|
|
2833
|
+
return setRef;
|
|
2834
|
+
};
|
|
2835
|
+
|
|
2601
2836
|
// src/components/ActionButton/ActionButton.tsx
|
|
2602
|
-
var
|
|
2837
|
+
var import_react17 = require("react");
|
|
2603
2838
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
2604
2839
|
|
|
2605
2840
|
// src/components/Button/Button.tsx
|
|
2606
|
-
var
|
|
2841
|
+
var import_react16 = require("react");
|
|
2607
2842
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
2608
|
-
var
|
|
2843
|
+
var import_type_guards15 = require("@wistia/type-guards");
|
|
2609
2844
|
|
|
2610
2845
|
// src/css/buttonResetCss.tsx
|
|
2611
2846
|
var import_styled_components16 = require("styled-components");
|
|
@@ -2809,7 +3044,7 @@ var buttonSizeStyles = {
|
|
|
2809
3044
|
};
|
|
2810
3045
|
|
|
2811
3046
|
// src/components/Icon/Icon.tsx
|
|
2812
|
-
var
|
|
3047
|
+
var import_type_guards13 = require("@wistia/type-guards");
|
|
2813
3048
|
var import_styled_components18 = __toESM(require("styled-components"));
|
|
2814
3049
|
|
|
2815
3050
|
// src/components/Icon/icons/AbTestIcon.tsx
|
|
@@ -6664,17 +6899,17 @@ var iconMap = {
|
|
|
6664
6899
|
};
|
|
6665
6900
|
|
|
6666
6901
|
// src/private/hooks/useResponsiveProp/useResponsiveProp.ts
|
|
6667
|
-
var
|
|
6668
|
-
var
|
|
6902
|
+
var import_type_guards12 = require("@wistia/type-guards");
|
|
6903
|
+
var import_react14 = require("react");
|
|
6669
6904
|
var isResponsiveObject = (values) => {
|
|
6670
6905
|
return typeof values === "object" && values !== null && !Array.isArray(values) && "base" in values;
|
|
6671
6906
|
};
|
|
6672
6907
|
var useResponsiveProp = (values) => {
|
|
6673
6908
|
const activeMediaQueries = useActiveMq();
|
|
6674
|
-
return (0,
|
|
6675
|
-
if ((0,
|
|
6909
|
+
return (0, import_react14.useMemo)(() => {
|
|
6910
|
+
if ((0, import_type_guards12.isRecord)(values) && isResponsiveObject(values)) {
|
|
6676
6911
|
const mq2 = activeMediaQueries.find((key) => key in values);
|
|
6677
|
-
return (0,
|
|
6912
|
+
return (0, import_type_guards12.isNotUndefined)(mq2) && (0, import_type_guards12.isNotUndefined)(values[mq2]) ? values[mq2] : values.base;
|
|
6678
6913
|
}
|
|
6679
6914
|
return values;
|
|
6680
6915
|
}, [activeMediaQueries, values]);
|
|
@@ -6701,13 +6936,13 @@ var Icon = ({
|
|
|
6701
6936
|
...otherProps
|
|
6702
6937
|
}) => {
|
|
6703
6938
|
const responsiveSize = useResponsiveProp(size);
|
|
6704
|
-
if ((0,
|
|
6939
|
+
if ((0, import_type_guards13.isNil)(type)) {
|
|
6705
6940
|
throw new Error("An Icon component requires a `type` prop to be provided");
|
|
6706
6941
|
}
|
|
6707
|
-
if ((0,
|
|
6942
|
+
if ((0, import_type_guards13.isNil)(iconMap[type])) {
|
|
6708
6943
|
throw new Error(`Type "${type}" does not exist, please update type prop in Icon component.`);
|
|
6709
6944
|
}
|
|
6710
|
-
if ((0,
|
|
6945
|
+
if ((0, import_type_guards13.isNil)(iconSizeMap[responsiveSize])) {
|
|
6711
6946
|
throw new Error(
|
|
6712
6947
|
`Size "${responsiveSize}" does not exist, please update size prop in Icon component.`
|
|
6713
6948
|
);
|
|
@@ -6738,13 +6973,13 @@ var Icon = ({
|
|
|
6738
6973
|
Icon.displayName = "Icon";
|
|
6739
6974
|
|
|
6740
6975
|
// src/components/Link/Link.tsx
|
|
6741
|
-
var
|
|
6742
|
-
var
|
|
6976
|
+
var import_react15 = require("react");
|
|
6977
|
+
var import_type_guards14 = require("@wistia/type-guards");
|
|
6743
6978
|
var import_styled_components19 = __toESM(require("styled-components"));
|
|
6744
6979
|
var import_react_router_dom = require("react-router-dom");
|
|
6745
6980
|
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
6746
6981
|
var generateHref = (href, type, disabled) => {
|
|
6747
|
-
if (disabled || (0,
|
|
6982
|
+
if (disabled || (0, import_type_guards14.isNil)(href)) {
|
|
6748
6983
|
return void 0;
|
|
6749
6984
|
}
|
|
6750
6985
|
let to = href;
|
|
@@ -6756,12 +6991,12 @@ var generateHref = (href, type, disabled) => {
|
|
|
6756
6991
|
}
|
|
6757
6992
|
return to;
|
|
6758
6993
|
};
|
|
6759
|
-
var isButton = (props) => (0,
|
|
6760
|
-
var isLink = (props) => (0,
|
|
6994
|
+
var isButton = (props) => (0, import_type_guards14.isUndefined)(props.href);
|
|
6995
|
+
var isLink = (props) => (0, import_type_guards14.isNotUndefined)(props.href);
|
|
6761
6996
|
var StyledLink = import_styled_components19.default.a`
|
|
6762
6997
|
--link-icon-size: 14px;
|
|
6763
6998
|
|
|
6764
|
-
${({ href }) => (0,
|
|
6999
|
+
${({ href }) => (0, import_type_guards14.isNil)(href) && buttonResetCss};
|
|
6765
7000
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
6766
7001
|
cursor: pointer;
|
|
6767
7002
|
font-family: var(--wui-typography-family-default);
|
|
@@ -6778,7 +7013,7 @@ var StyledLink = import_styled_components19.default.a`
|
|
|
6778
7013
|
}
|
|
6779
7014
|
}
|
|
6780
7015
|
`;
|
|
6781
|
-
var Link = (0,
|
|
7016
|
+
var Link = (0, import_react15.forwardRef)(
|
|
6782
7017
|
({
|
|
6783
7018
|
beforeAction,
|
|
6784
7019
|
children,
|
|
@@ -6802,16 +7037,16 @@ var Link = (0, import_react14.forwardRef)(
|
|
|
6802
7037
|
} catch (error) {
|
|
6803
7038
|
console.error(error);
|
|
6804
7039
|
} finally {
|
|
6805
|
-
if ((0,
|
|
7040
|
+
if ((0, import_type_guards14.isFunction)(props.onClick)) {
|
|
6806
7041
|
props.onClick(event);
|
|
6807
7042
|
} else if (routingCallback !== null) {
|
|
6808
7043
|
routingCallback();
|
|
6809
|
-
} else if ((0,
|
|
7044
|
+
} else if ((0, import_type_guards14.isNotNil)(to)) {
|
|
6810
7045
|
window.location.assign(to);
|
|
6811
7046
|
} else {
|
|
6812
7047
|
}
|
|
6813
7048
|
}
|
|
6814
|
-
} else if ((0,
|
|
7049
|
+
} else if ((0, import_type_guards14.isFunction)(props.onClick)) {
|
|
6815
7050
|
props.onClick(event);
|
|
6816
7051
|
} else {
|
|
6817
7052
|
}
|
|
@@ -6872,7 +7107,7 @@ Link.displayName = "Link";
|
|
|
6872
7107
|
|
|
6873
7108
|
// src/components/Button/Button.tsx
|
|
6874
7109
|
var import_jsx_runtime193 = require("react/jsx-runtime");
|
|
6875
|
-
var isLink2 = (props) => (0,
|
|
7110
|
+
var isLink2 = (props) => (0, import_type_guards15.isNotUndefined)(props.href);
|
|
6876
7111
|
var StyledButton = import_styled_components20.default.button`
|
|
6877
7112
|
${buttonResetCss}
|
|
6878
7113
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
@@ -6912,8 +7147,8 @@ var ButtonContent = ({
|
|
|
6912
7147
|
/* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(
|
|
6913
7148
|
StyledButtonContent,
|
|
6914
7149
|
{
|
|
6915
|
-
$hasLeftIcon: (0,
|
|
6916
|
-
$hasRightIcon: (0,
|
|
7150
|
+
$hasLeftIcon: (0, import_type_guards15.isNotNil)(leftIcon),
|
|
7151
|
+
$hasRightIcon: (0, import_type_guards15.isNotNil)(rightIcon),
|
|
6917
7152
|
$isLoading: isLoading,
|
|
6918
7153
|
children: [
|
|
6919
7154
|
leftIcon ?? null,
|
|
@@ -6924,7 +7159,7 @@ var ButtonContent = ({
|
|
|
6924
7159
|
)
|
|
6925
7160
|
] });
|
|
6926
7161
|
};
|
|
6927
|
-
var Button = (0,
|
|
7162
|
+
var Button = (0, import_react16.forwardRef)(
|
|
6928
7163
|
({
|
|
6929
7164
|
children,
|
|
6930
7165
|
forceState,
|
|
@@ -6981,7 +7216,7 @@ var Button = (0, import_react15.forwardRef)(
|
|
|
6981
7216
|
event.preventDefault();
|
|
6982
7217
|
return;
|
|
6983
7218
|
}
|
|
6984
|
-
if ((0,
|
|
7219
|
+
if ((0, import_type_guards15.isNotNil)(onClick)) {
|
|
6985
7220
|
onClick(event);
|
|
6986
7221
|
}
|
|
6987
7222
|
};
|
|
@@ -7103,7 +7338,7 @@ var StyledLabel = import_styled_components21.default.span`
|
|
|
7103
7338
|
grid-row: 2;
|
|
7104
7339
|
text-align: left;
|
|
7105
7340
|
`;
|
|
7106
|
-
var ActionButton = (0,
|
|
7341
|
+
var ActionButton = (0, import_react17.forwardRef)(
|
|
7107
7342
|
({
|
|
7108
7343
|
icon,
|
|
7109
7344
|
colorScheme = "default",
|
|
@@ -7147,8 +7382,8 @@ var ActionButton = (0, import_react16.forwardRef)(
|
|
|
7147
7382
|
ActionButton.displayName = "ActionButton";
|
|
7148
7383
|
|
|
7149
7384
|
// src/components/Avatar/Avatar.tsx
|
|
7150
|
-
var
|
|
7151
|
-
var
|
|
7385
|
+
var import_react18 = require("react");
|
|
7386
|
+
var import_type_guards17 = require("@wistia/type-guards");
|
|
7152
7387
|
var import_styled_components23 = __toESM(require("styled-components"));
|
|
7153
7388
|
|
|
7154
7389
|
// src/components/ColorSchemeWrapper/ColorSchemeWrapper.tsx
|
|
@@ -7191,13 +7426,13 @@ var ColorSchemeWrapper = ({
|
|
|
7191
7426
|
ColorSchemeWrapper.displayName = "ColorSchemeWrapper";
|
|
7192
7427
|
|
|
7193
7428
|
// src/components/Avatar/formatNameForDisplay.tsx
|
|
7194
|
-
var
|
|
7429
|
+
var import_type_guards16 = require("@wistia/type-guards");
|
|
7195
7430
|
var containsEmojiCharacter = (char) => {
|
|
7196
7431
|
const emojiRegex = /<a?:.+?:\d{18}>|\p{Extended_Pictographic}/gu;
|
|
7197
7432
|
return emojiRegex.test(char);
|
|
7198
7433
|
};
|
|
7199
7434
|
var formatNameForDisplay = (name) => {
|
|
7200
|
-
if ((0,
|
|
7435
|
+
if ((0, import_type_guards16.isNil)(name) || !(0, import_type_guards16.isString)(name) || (0, import_type_guards16.isEmptyString)(name) || containsEmojiCharacter(name)) {
|
|
7201
7436
|
return "U";
|
|
7202
7437
|
}
|
|
7203
7438
|
const firstChar = name.trim().substring(0, 1);
|
|
@@ -7260,7 +7495,7 @@ var AvatarWrapper = import_styled_components23.default.div`
|
|
|
7260
7495
|
max-height: ${({ $maxHeight }) => $maxHeight}px;
|
|
7261
7496
|
`;
|
|
7262
7497
|
var chooseColorScheme = (name) => {
|
|
7263
|
-
if ((0,
|
|
7498
|
+
if ((0, import_type_guards17.isNil)(name) || name === "Anonymous") {
|
|
7264
7499
|
return "default";
|
|
7265
7500
|
}
|
|
7266
7501
|
const filteredColors = colorSchemeOptions.filter(
|
|
@@ -7279,8 +7514,8 @@ var Avatar = ({
|
|
|
7279
7514
|
onImageLoad,
|
|
7280
7515
|
...otherProps
|
|
7281
7516
|
}) => {
|
|
7282
|
-
const [imageLoadState, setImageLoadState] = (0,
|
|
7283
|
-
(0,
|
|
7517
|
+
const [imageLoadState, setImageLoadState] = (0, import_react18.useState)("loading");
|
|
7518
|
+
(0, import_react18.useEffect)(() => {
|
|
7284
7519
|
setImageLoadState("loading");
|
|
7285
7520
|
}, [imageUrl]);
|
|
7286
7521
|
const handleImageLoad = () => {
|
|
@@ -7292,8 +7527,8 @@ var Avatar = ({
|
|
|
7292
7527
|
onImageLoad?.({ state: "error", type: "initials" });
|
|
7293
7528
|
};
|
|
7294
7529
|
const avatarSize = heightAndWidth ?? avatarSizeMap[size];
|
|
7295
|
-
const avatarColor = (0,
|
|
7296
|
-
const showInitials = (0,
|
|
7530
|
+
const avatarColor = (0, import_react18.useMemo)(() => chooseColorScheme(name), [name]);
|
|
7531
|
+
const showInitials = (0, import_type_guards17.isNil)(imageUrl) || imageLoadState === "error";
|
|
7297
7532
|
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
7298
7533
|
AvatarWrapper,
|
|
7299
7534
|
{
|
|
@@ -7322,9 +7557,9 @@ var Avatar = ({
|
|
|
7322
7557
|
Avatar.displayName = "Avatar";
|
|
7323
7558
|
|
|
7324
7559
|
// src/components/Badge/Badge.tsx
|
|
7325
|
-
var
|
|
7560
|
+
var import_react19 = require("react");
|
|
7326
7561
|
var import_styled_components24 = __toESM(require("styled-components"));
|
|
7327
|
-
var
|
|
7562
|
+
var import_type_guards18 = require("@wistia/type-guards");
|
|
7328
7563
|
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
7329
7564
|
var StyledBadge = import_styled_components24.default.div`
|
|
7330
7565
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -7346,9 +7581,9 @@ var StyledBadge = import_styled_components24.default.div`
|
|
|
7346
7581
|
width: 12px;
|
|
7347
7582
|
}
|
|
7348
7583
|
`;
|
|
7349
|
-
var Badge = (0,
|
|
7584
|
+
var Badge = (0, import_react19.forwardRef)(
|
|
7350
7585
|
({ colorScheme = "inherit", label, icon, ...otherProps }, ref) => {
|
|
7351
|
-
const hasIcon = (0,
|
|
7586
|
+
const hasIcon = (0, import_type_guards18.isNotNil)(icon);
|
|
7352
7587
|
return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
7353
7588
|
StyledBadge,
|
|
7354
7589
|
{
|
|
@@ -7367,9 +7602,9 @@ var Badge = (0, import_react18.forwardRef)(
|
|
|
7367
7602
|
Badge.displayName = "Badge";
|
|
7368
7603
|
|
|
7369
7604
|
// src/components/Box/Box.tsx
|
|
7370
|
-
var
|
|
7605
|
+
var import_react20 = require("react");
|
|
7371
7606
|
var import_styled_components25 = __toESM(require("styled-components"));
|
|
7372
|
-
var
|
|
7607
|
+
var import_type_guards19 = require("@wistia/type-guards");
|
|
7373
7608
|
|
|
7374
7609
|
// src/private/helpers/makePolymorphic/makePolymorphic.tsx
|
|
7375
7610
|
var makePolymorphic = (component) => {
|
|
@@ -7380,8 +7615,8 @@ var makePolymorphic = (component) => {
|
|
|
7380
7615
|
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
7381
7616
|
var isDev = process.env["NODE_ENV"] === "development" || process.env["NODE_ENV"] === "test";
|
|
7382
7617
|
var getGapStyle = (gap) => {
|
|
7383
|
-
if ((0,
|
|
7384
|
-
if ((0,
|
|
7618
|
+
if ((0, import_type_guards19.isNotNil)(gap)) {
|
|
7619
|
+
if ((0, import_type_guards19.isRecord)(gap)) {
|
|
7385
7620
|
return Object.entries(gap).map(([key, value]) => {
|
|
7386
7621
|
return `${key}-gap: var(--wui-${value})};`;
|
|
7387
7622
|
}).join("");
|
|
@@ -7456,8 +7691,8 @@ var StyledBoxComponent = import_styled_components25.default.div`
|
|
|
7456
7691
|
align-content: ${({ $alignContent }) => $alignContent};
|
|
7457
7692
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
7458
7693
|
align-self: ${({ $alignSelf }) => $alignSelf ?? null};
|
|
7459
|
-
display: ${({ $inline }) => (0,
|
|
7460
|
-
flex-basis: ${({ $basis }) => (0,
|
|
7694
|
+
display: ${({ $inline }) => (0, import_type_guards19.isNotNil)($inline) && $inline ? "inline-flex" : "flex"};
|
|
7695
|
+
flex-basis: ${({ $basis }) => (0, import_type_guards19.isNotNil)($basis) ? $basis : null};
|
|
7461
7696
|
flex-direction: ${({ $flexDirection }) => $flexDirection};
|
|
7462
7697
|
${({ $fillBox: fill }) => getFillStyle(fill)};
|
|
7463
7698
|
${({ $fillViewport }) => getFillViewportStyle($fillViewport)};
|
|
@@ -7467,22 +7702,22 @@ var StyledBoxComponent = import_styled_components25.default.div`
|
|
|
7467
7702
|
width: ${({ $width }) => $width ?? null};
|
|
7468
7703
|
|
|
7469
7704
|
/* Box children styles */
|
|
7470
|
-
flex-grow: ${({ $grow }) => (0,
|
|
7471
|
-
flex-shrink: ${({ $shrink }) => (0,
|
|
7705
|
+
flex-grow: ${({ $grow }) => (0, import_type_guards19.isNotNil)($grow) ? $grow : null};
|
|
7706
|
+
flex-shrink: ${({ $shrink }) => (0, import_type_guards19.isNotNil)($shrink) ? $shrink : null};
|
|
7472
7707
|
flex-wrap: ${({ $wrapItems }) => $wrapItems ? "wrap" : "nowrap"};
|
|
7473
7708
|
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
7474
|
-
order: ${({ $order }) => (0,
|
|
7709
|
+
order: ${({ $order }) => (0, import_type_guards19.isNotNil)($order) ? $order : null};
|
|
7475
7710
|
`;
|
|
7476
7711
|
var wrapChildren = (children) => {
|
|
7477
|
-
if ((0,
|
|
7712
|
+
if ((0, import_type_guards19.isNotNil)(children)) {
|
|
7478
7713
|
if (typeof children === "object" && isDev) {
|
|
7479
|
-
return
|
|
7480
|
-
if ((0,
|
|
7714
|
+
return import_react20.Children.map(children, (child) => {
|
|
7715
|
+
if ((0, import_type_guards19.isNil)(child)) return null;
|
|
7481
7716
|
const elementParams = {};
|
|
7482
7717
|
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
7483
7718
|
elementParams.hasBoxParent = true;
|
|
7484
7719
|
}
|
|
7485
|
-
return (0,
|
|
7720
|
+
return (0, import_react20.cloneElement)(child, elementParams);
|
|
7486
7721
|
});
|
|
7487
7722
|
}
|
|
7488
7723
|
return children;
|
|
@@ -7490,7 +7725,7 @@ var wrapChildren = (children) => {
|
|
|
7490
7725
|
return null;
|
|
7491
7726
|
};
|
|
7492
7727
|
var DEFAULT_ELEMENT = "div";
|
|
7493
|
-
var BoxComponent = (0,
|
|
7728
|
+
var BoxComponent = (0, import_react20.forwardRef)(
|
|
7494
7729
|
({
|
|
7495
7730
|
alignContent = "stretch",
|
|
7496
7731
|
alignItems = "flex-start",
|
|
@@ -7515,7 +7750,7 @@ var BoxComponent = (0, import_react19.forwardRef)(
|
|
|
7515
7750
|
flexMode,
|
|
7516
7751
|
...otherProps
|
|
7517
7752
|
}, ref) => {
|
|
7518
|
-
if ((0,
|
|
7753
|
+
if ((0, import_type_guards19.isNotUndefined)(height)) {
|
|
7519
7754
|
if (fill === true || fill === "vertical") {
|
|
7520
7755
|
throw new Error('Cannot use height prop with fill="vertical" or fill={true}');
|
|
7521
7756
|
}
|
|
@@ -7525,7 +7760,7 @@ var BoxComponent = (0, import_react19.forwardRef)(
|
|
|
7525
7760
|
);
|
|
7526
7761
|
}
|
|
7527
7762
|
}
|
|
7528
|
-
if ((0,
|
|
7763
|
+
if ((0, import_type_guards19.isNotUndefined)(width)) {
|
|
7529
7764
|
if (fill === true || fill === "horizontal") {
|
|
7530
7765
|
throw new Error('Cannot use width prop with fill="horizontal" or fill={true}');
|
|
7531
7766
|
}
|
|
@@ -7567,7 +7802,7 @@ BoxComponent.displayName = "Box";
|
|
|
7567
7802
|
var Box = makePolymorphic(BoxComponent);
|
|
7568
7803
|
|
|
7569
7804
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
7570
|
-
var
|
|
7805
|
+
var import_react21 = require("react");
|
|
7571
7806
|
var import_styled_components26 = __toESM(require("styled-components"));
|
|
7572
7807
|
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
7573
7808
|
var StyledBreadcrumbs = import_styled_components26.default.nav`
|
|
@@ -7583,7 +7818,7 @@ var StyledBreadcrumbs = import_styled_components26.default.nav`
|
|
|
7583
7818
|
var BUFFER_WIDTH = 10;
|
|
7584
7819
|
var Breadcrumbs = ({ children, ...props }) => {
|
|
7585
7820
|
const { isXsAndDown } = useMq();
|
|
7586
|
-
let crumbs =
|
|
7821
|
+
let crumbs = import_react21.Children.toArray(children);
|
|
7587
7822
|
if (isXsAndDown) {
|
|
7588
7823
|
crumbs = crumbs.slice(-1);
|
|
7589
7824
|
}
|
|
@@ -7650,7 +7885,7 @@ var Breadcrumb = ({ icon, href, children, ...props }) => {
|
|
|
7650
7885
|
|
|
7651
7886
|
// src/components/ButtonGroup/ButtonGroup.tsx
|
|
7652
7887
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
7653
|
-
var
|
|
7888
|
+
var import_type_guards20 = require("@wistia/type-guards");
|
|
7654
7889
|
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
7655
7890
|
var getAlignment = (align) => {
|
|
7656
7891
|
if (align === "center") {
|
|
@@ -7696,7 +7931,7 @@ var ButtonGroup = ({
|
|
|
7696
7931
|
collapseOnSmallScreens = true,
|
|
7697
7932
|
...otherProps
|
|
7698
7933
|
}) => {
|
|
7699
|
-
if ((0,
|
|
7934
|
+
if ((0, import_type_guards20.isNil)(children)) {
|
|
7700
7935
|
return null;
|
|
7701
7936
|
}
|
|
7702
7937
|
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
@@ -7770,7 +8005,7 @@ var Card = ({
|
|
|
7770
8005
|
Card.displayName = "Card";
|
|
7771
8006
|
|
|
7772
8007
|
// src/components/Center/Center.tsx
|
|
7773
|
-
var
|
|
8008
|
+
var import_react22 = require("react");
|
|
7774
8009
|
var import_styled_components30 = __toESM(require("styled-components"));
|
|
7775
8010
|
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
7776
8011
|
var StyledCenter = import_styled_components30.default.div`
|
|
@@ -7785,7 +8020,7 @@ var StyledCenter = import_styled_components30.default.div`
|
|
|
7785
8020
|
align-items: center;
|
|
7786
8021
|
`}
|
|
7787
8022
|
`;
|
|
7788
|
-
var Center = (0,
|
|
8023
|
+
var Center = (0, import_react22.forwardRef)(
|
|
7789
8024
|
({ maxWidth = "100%", gutterWidth = "space-00", intrinsic = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
7790
8025
|
StyledCenter,
|
|
7791
8026
|
{
|
|
@@ -7801,17 +8036,17 @@ var Center = (0, import_react21.forwardRef)(
|
|
|
7801
8036
|
Center.displayName = "Center";
|
|
7802
8037
|
|
|
7803
8038
|
// src/components/Checkbox/Checkbox.tsx
|
|
7804
|
-
var
|
|
8039
|
+
var import_react23 = require("react");
|
|
7805
8040
|
var import_styled_components34 = __toESM(require("styled-components"));
|
|
7806
|
-
var
|
|
8041
|
+
var import_type_guards24 = require("@wistia/type-guards");
|
|
7807
8042
|
|
|
7808
8043
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
7809
8044
|
var import_styled_components33 = __toESM(require("styled-components"));
|
|
7810
|
-
var
|
|
8045
|
+
var import_type_guards23 = require("@wistia/type-guards");
|
|
7811
8046
|
|
|
7812
8047
|
// src/private/components/FormControlLabel/FormControlLabelDescription.tsx
|
|
7813
8048
|
var import_styled_components31 = __toESM(require("styled-components"));
|
|
7814
|
-
var
|
|
8049
|
+
var import_type_guards21 = require("@wistia/type-guards");
|
|
7815
8050
|
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
7816
8051
|
var disabledStyle = import_styled_components31.css`
|
|
7817
8052
|
color: var(--wui-color-text-disabled);
|
|
@@ -7831,7 +8066,7 @@ var FormControlLabelDescription = ({
|
|
|
7831
8066
|
disabled = false,
|
|
7832
8067
|
...props
|
|
7833
8068
|
}) => {
|
|
7834
|
-
if ((0,
|
|
8069
|
+
if ((0, import_type_guards21.isNil)(children)) {
|
|
7835
8070
|
return null;
|
|
7836
8071
|
}
|
|
7837
8072
|
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
@@ -7847,7 +8082,7 @@ FormControlLabelDescription.displayName = "FormControlLabelDescription";
|
|
|
7847
8082
|
|
|
7848
8083
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7849
8084
|
var import_styled_components32 = __toESM(require("styled-components"));
|
|
7850
|
-
var
|
|
8085
|
+
var import_type_guards22 = require("@wistia/type-guards");
|
|
7851
8086
|
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
7852
8087
|
var VisuallyHidden = import_styled_components32.default.div({ ...visuallyHiddenStyle });
|
|
7853
8088
|
var VisuallyHiddenButFocusable = import_styled_components32.default.div({
|
|
@@ -7859,7 +8094,7 @@ var ScreenReaderOnly = ({
|
|
|
7859
8094
|
focusable = false,
|
|
7860
8095
|
...otherProps
|
|
7861
8096
|
}) => {
|
|
7862
|
-
const accessibleText = (0,
|
|
8097
|
+
const accessibleText = (0, import_type_guards22.isNotNil)(text) ? text : children;
|
|
7863
8098
|
if (focusable) {
|
|
7864
8099
|
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7865
8100
|
}
|
|
@@ -7899,7 +8134,7 @@ var FormControlLabel = ({
|
|
|
7899
8134
|
hideLabel = false,
|
|
7900
8135
|
...props
|
|
7901
8136
|
}) => {
|
|
7902
|
-
if ((0,
|
|
8137
|
+
if ((0, import_type_guards23.isNil)(label)) {
|
|
7903
8138
|
return null;
|
|
7904
8139
|
}
|
|
7905
8140
|
const labelContent = hideLabel ? /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(ScreenReaderOnly, { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(StyledLabelWrapper, { children: [
|
|
@@ -7913,7 +8148,7 @@ var FormControlLabel = ({
|
|
|
7913
8148
|
htmlFor,
|
|
7914
8149
|
...props,
|
|
7915
8150
|
children: [
|
|
7916
|
-
(0,
|
|
8151
|
+
(0, import_type_guards23.isNotNil)(controlSlot) ? controlSlot : null,
|
|
7917
8152
|
labelContent
|
|
7918
8153
|
]
|
|
7919
8154
|
}
|
|
@@ -8021,7 +8256,7 @@ var StyledHiddenCheckboxInput = import_styled_components34.default.input`
|
|
|
8021
8256
|
display: block;
|
|
8022
8257
|
}
|
|
8023
8258
|
`;
|
|
8024
|
-
var Checkbox = (0,
|
|
8259
|
+
var Checkbox = (0, import_react23.forwardRef)(
|
|
8025
8260
|
({
|
|
8026
8261
|
checked,
|
|
8027
8262
|
disabled = false,
|
|
@@ -8036,8 +8271,8 @@ var Checkbox = (0, import_react22.forwardRef)(
|
|
|
8036
8271
|
hideLabel = false,
|
|
8037
8272
|
...props
|
|
8038
8273
|
}, ref) => {
|
|
8039
|
-
const generatedId = (0,
|
|
8040
|
-
const computedId = (0,
|
|
8274
|
+
const generatedId = (0, import_react23.useId)();
|
|
8275
|
+
const computedId = (0, import_type_guards24.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
8041
8276
|
return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
8042
8277
|
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
8043
8278
|
StyledHiddenCheckboxInput,
|
|
@@ -8079,9 +8314,9 @@ var Checkbox = (0, import_react22.forwardRef)(
|
|
|
8079
8314
|
Checkbox.displayName = "Checkbox";
|
|
8080
8315
|
|
|
8081
8316
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
8082
|
-
var
|
|
8317
|
+
var import_react24 = require("react");
|
|
8083
8318
|
var ClickRegion = ({ children, targetRef }) => {
|
|
8084
|
-
(0,
|
|
8319
|
+
(0, import_react24.useEffect)(() => {
|
|
8085
8320
|
if (targetRef.current && targetRef.current.tagName === "A") {
|
|
8086
8321
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
8087
8322
|
} else if (targetRef.current && targetRef.current.tagName === "BUTTON") {
|
|
@@ -8089,7 +8324,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8089
8324
|
} else {
|
|
8090
8325
|
}
|
|
8091
8326
|
}, [targetRef]);
|
|
8092
|
-
const handleClick = (0,
|
|
8327
|
+
const handleClick = (0, import_react24.useCallback)(
|
|
8093
8328
|
(event) => {
|
|
8094
8329
|
const node = targetRef.current;
|
|
8095
8330
|
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")) {
|
|
@@ -8106,7 +8341,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8106
8341
|
},
|
|
8107
8342
|
[targetRef]
|
|
8108
8343
|
);
|
|
8109
|
-
return (0,
|
|
8344
|
+
return (0, import_react24.cloneElement)(import_react24.Children.only(children), {
|
|
8110
8345
|
"data-click-region": true,
|
|
8111
8346
|
onClick: handleClick
|
|
8112
8347
|
});
|
|
@@ -8115,7 +8350,7 @@ ClickRegion.displayName = "ClickRegion";
|
|
|
8115
8350
|
|
|
8116
8351
|
// src/components/Collapsible/Collapsible.tsx
|
|
8117
8352
|
var import_react_collapsible = require("@radix-ui/react-collapsible");
|
|
8118
|
-
var
|
|
8353
|
+
var import_type_guards25 = require("@wistia/type-guards");
|
|
8119
8354
|
var import_styled_components35 = __toESM(require("styled-components"));
|
|
8120
8355
|
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
8121
8356
|
var StyledRoot = (0, import_styled_components35.default)(import_react_collapsible.Root)`
|
|
@@ -8132,31 +8367,31 @@ var Collapsible = ({
|
|
|
8132
8367
|
onOpenChange
|
|
8133
8368
|
}) => {
|
|
8134
8369
|
const controlProps = {
|
|
8135
|
-
...(0,
|
|
8370
|
+
...(0, import_type_guards25.isNotNil)(onOpenChange) && (0, import_type_guards25.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
8136
8371
|
};
|
|
8137
8372
|
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(StyledRoot, { ...controlProps, children });
|
|
8138
8373
|
};
|
|
8139
8374
|
Collapsible.displayName = "Collapsible";
|
|
8140
8375
|
|
|
8141
8376
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
8142
|
-
var
|
|
8377
|
+
var import_react25 = require("react");
|
|
8143
8378
|
var import_react_collapsible2 = require("@radix-ui/react-collapsible");
|
|
8144
8379
|
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
8145
8380
|
var CollapsibleTrigger = ({ children }) => {
|
|
8146
|
-
|
|
8381
|
+
import_react25.Children.only(children);
|
|
8147
8382
|
return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
|
|
8148
8383
|
};
|
|
8149
8384
|
|
|
8150
8385
|
// src/components/Collapsible/CollapsibleContent.tsx
|
|
8151
8386
|
var import_styled_components36 = __toESM(require("styled-components"));
|
|
8152
8387
|
var import_react_collapsible3 = require("@radix-ui/react-collapsible");
|
|
8153
|
-
var
|
|
8388
|
+
var import_type_guards26 = require("@wistia/type-guards");
|
|
8154
8389
|
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
8155
8390
|
var ClampedContent = import_styled_components36.default.div.attrs({ "data-wui-collapsible-content": true })`
|
|
8156
8391
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
8157
8392
|
`;
|
|
8158
8393
|
var CollapsibleContent = ({ clamp, children }) => {
|
|
8159
|
-
if ((0,
|
|
8394
|
+
if ((0, import_type_guards26.isNotUndefined)(clamp)) {
|
|
8160
8395
|
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(ClampedContent, { $clamp: clamp, children });
|
|
8161
8396
|
}
|
|
8162
8397
|
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_collapsible3.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(import_jsx_runtime210.Fragment, { children: [
|
|
@@ -8167,10 +8402,10 @@ var CollapsibleContent = ({ clamp, children }) => {
|
|
|
8167
8402
|
|
|
8168
8403
|
// src/components/DataCards/DataCard.tsx
|
|
8169
8404
|
var import_styled_components38 = __toESM(require("styled-components"));
|
|
8170
|
-
var
|
|
8405
|
+
var import_type_guards27 = require("@wistia/type-guards");
|
|
8171
8406
|
|
|
8172
8407
|
// src/components/Heading/Heading.tsx
|
|
8173
|
-
var
|
|
8408
|
+
var import_react26 = require("react");
|
|
8174
8409
|
var import_styled_components37 = __toESM(require("styled-components"));
|
|
8175
8410
|
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
8176
8411
|
var heroStyle = import_styled_components37.css`
|
|
@@ -8257,7 +8492,7 @@ var variantElementMap = {
|
|
|
8257
8492
|
heading5: "h5",
|
|
8258
8493
|
heading6: "h6"
|
|
8259
8494
|
};
|
|
8260
|
-
var HeadingComponent = (0,
|
|
8495
|
+
var HeadingComponent = (0, import_react26.forwardRef)(
|
|
8261
8496
|
({
|
|
8262
8497
|
align = "left",
|
|
8263
8498
|
colorScheme = "inherit",
|
|
@@ -8376,8 +8611,8 @@ var DataCard = ({
|
|
|
8376
8611
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledLoadingValue, {}) : value
|
|
8377
8612
|
}
|
|
8378
8613
|
),
|
|
8379
|
-
(0,
|
|
8380
|
-
(0,
|
|
8614
|
+
(0, import_type_guards27.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
8615
|
+
(0, import_type_guards27.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
8381
8616
|
]
|
|
8382
8617
|
}
|
|
8383
8618
|
);
|
|
@@ -8421,7 +8656,7 @@ DataCards.displayName = "DataCards";
|
|
|
8421
8656
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
8422
8657
|
|
|
8423
8658
|
// src/components/Text/Text.tsx
|
|
8424
|
-
var
|
|
8659
|
+
var import_react27 = require("react");
|
|
8425
8660
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
8426
8661
|
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
8427
8662
|
var bodyBoldStyles = import_styled_components40.css`
|
|
@@ -8587,7 +8822,7 @@ var StyledText = import_styled_components40.default.div`
|
|
|
8587
8822
|
}
|
|
8588
8823
|
`}
|
|
8589
8824
|
`;
|
|
8590
|
-
var TextComponent = (0,
|
|
8825
|
+
var TextComponent = (0, import_react27.forwardRef)(
|
|
8591
8826
|
({
|
|
8592
8827
|
align = "left",
|
|
8593
8828
|
colorScheme = "inherit",
|
|
@@ -8703,7 +8938,7 @@ Divider.displayName = "Divider";
|
|
|
8703
8938
|
|
|
8704
8939
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
8705
8940
|
var import_styled_components45 = __toESM(require("styled-components"));
|
|
8706
|
-
var
|
|
8941
|
+
var import_react29 = require("react");
|
|
8707
8942
|
|
|
8708
8943
|
// src/components/Tooltip/Tooltip.tsx
|
|
8709
8944
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
@@ -8812,9 +9047,9 @@ var Tooltip = ({
|
|
|
8812
9047
|
Tooltip.displayName = "Tooltip";
|
|
8813
9048
|
|
|
8814
9049
|
// src/components/Input/Input.tsx
|
|
8815
|
-
var
|
|
9050
|
+
var import_react28 = require("react");
|
|
8816
9051
|
var import_styled_components44 = __toESM(require("styled-components"));
|
|
8817
|
-
var
|
|
9052
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
8818
9053
|
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
8819
9054
|
var inputStyles = import_styled_components44.css`
|
|
8820
9055
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
@@ -8901,7 +9136,7 @@ var StyledInputContainer = import_styled_components44.default.div`
|
|
|
8901
9136
|
padding-right: 32px;
|
|
8902
9137
|
}
|
|
8903
9138
|
`;
|
|
8904
|
-
var Input = (0,
|
|
9139
|
+
var Input = (0, import_react28.forwardRef)(
|
|
8905
9140
|
({
|
|
8906
9141
|
fullWidth = true,
|
|
8907
9142
|
monospace = false,
|
|
@@ -8911,30 +9146,30 @@ var Input = (0, import_react27.forwardRef)(
|
|
|
8911
9146
|
rightIcon,
|
|
8912
9147
|
...props
|
|
8913
9148
|
}, externalRef) => {
|
|
8914
|
-
const internalRef = (0,
|
|
9149
|
+
const internalRef = (0, import_react28.useRef)();
|
|
8915
9150
|
const ref = (
|
|
8916
9151
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
8917
|
-
(0,
|
|
9152
|
+
(0, import_type_guards28.isNotNil)(externalRef) && (0, import_type_guards28.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
8918
9153
|
);
|
|
8919
9154
|
let leftIconToDisplay = leftIcon;
|
|
8920
|
-
if ((0,
|
|
9155
|
+
if ((0, import_type_guards28.isNil)(leftIcon) && type === "search") {
|
|
8921
9156
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(Icon, { type: "search" });
|
|
8922
9157
|
}
|
|
8923
|
-
if ((0,
|
|
8924
|
-
leftIconToDisplay = (0,
|
|
9158
|
+
if ((0, import_type_guards28.isNotNil)(leftIconToDisplay)) {
|
|
9159
|
+
leftIconToDisplay = (0, import_react28.cloneElement)(leftIconToDisplay, {
|
|
8925
9160
|
size: "md",
|
|
8926
9161
|
className: "wui-input-left-icon"
|
|
8927
9162
|
});
|
|
8928
9163
|
}
|
|
8929
9164
|
let rightIconToDisplay = rightIcon;
|
|
8930
|
-
if ((0,
|
|
8931
|
-
rightIconToDisplay = (0,
|
|
9165
|
+
if ((0, import_type_guards28.isNotNil)(rightIconToDisplay)) {
|
|
9166
|
+
rightIconToDisplay = (0, import_react28.cloneElement)(rightIconToDisplay, {
|
|
8932
9167
|
size: "md",
|
|
8933
9168
|
className: "wui-input-right-icon"
|
|
8934
9169
|
});
|
|
8935
9170
|
}
|
|
8936
|
-
const
|
|
8937
|
-
if ((0,
|
|
9171
|
+
const handleFocus2 = (event) => {
|
|
9172
|
+
if ((0, import_type_guards28.isNotNil)(props.onFocus)) {
|
|
8938
9173
|
props.onFocus(event);
|
|
8939
9174
|
}
|
|
8940
9175
|
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
@@ -8955,14 +9190,14 @@ var Input = (0, import_react27.forwardRef)(
|
|
|
8955
9190
|
{
|
|
8956
9191
|
...props,
|
|
8957
9192
|
ref,
|
|
8958
|
-
onFocus:
|
|
9193
|
+
onFocus: handleFocus2
|
|
8959
9194
|
}
|
|
8960
9195
|
) : /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
8961
9196
|
"input",
|
|
8962
9197
|
{
|
|
8963
9198
|
...props,
|
|
8964
9199
|
ref,
|
|
8965
|
-
onFocus:
|
|
9200
|
+
onFocus: handleFocus2,
|
|
8966
9201
|
type
|
|
8967
9202
|
}
|
|
8968
9203
|
),
|
|
@@ -9023,11 +9258,11 @@ var EditableHeading = ({
|
|
|
9023
9258
|
forceEditing = false,
|
|
9024
9259
|
editingDisabled = false
|
|
9025
9260
|
}) => {
|
|
9026
|
-
const [isEditing, setIsEditing] = (0,
|
|
9027
|
-
const [value, setValue] = (0,
|
|
9028
|
-
const [previousValue, setPreviousValue] = (0,
|
|
9029
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
9030
|
-
const headingRef = (0,
|
|
9261
|
+
const [isEditing, setIsEditing] = (0, import_react29.useState)(false);
|
|
9262
|
+
const [value, setValue] = (0, import_react29.useState)(children);
|
|
9263
|
+
const [previousValue, setPreviousValue] = (0, import_react29.useState)(children);
|
|
9264
|
+
const [headingHeight, setHeadingHeight] = (0, import_react29.useState)("60");
|
|
9265
|
+
const headingRef = (0, import_react29.useRef)(null);
|
|
9031
9266
|
const handleSetEditing = (editing) => {
|
|
9032
9267
|
if (editingDisabled) return;
|
|
9033
9268
|
if (editing && headingRef.current) {
|
|
@@ -9113,12 +9348,12 @@ var EditableHeading = ({
|
|
|
9113
9348
|
};
|
|
9114
9349
|
|
|
9115
9350
|
// src/components/Form/Form.tsx
|
|
9116
|
-
var
|
|
9351
|
+
var import_react31 = require("react");
|
|
9117
9352
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9118
|
-
var
|
|
9353
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
9119
9354
|
|
|
9120
9355
|
// src/components/Stack/Stack.tsx
|
|
9121
|
-
var
|
|
9356
|
+
var import_react30 = require("react");
|
|
9122
9357
|
var import_styled_components46 = __toESM(require("styled-components"));
|
|
9123
9358
|
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
9124
9359
|
var DEFAULT_ELEMENT4 = "div";
|
|
@@ -9128,7 +9363,7 @@ var StyledStack = import_styled_components46.default.div`
|
|
|
9128
9363
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9129
9364
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
9130
9365
|
`;
|
|
9131
|
-
var StackComponent = (0,
|
|
9366
|
+
var StackComponent = (0, import_react30.forwardRef)(
|
|
9132
9367
|
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9133
9368
|
const responsiveGap = useResponsiveProp(gap);
|
|
9134
9369
|
const responsiveDirection = useResponsiveProp(direction);
|
|
@@ -9157,7 +9392,7 @@ var StyledForm = import_styled_components47.default.form`
|
|
|
9157
9392
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9158
9393
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9159
9394
|
`;
|
|
9160
|
-
var FormContext = (0,
|
|
9395
|
+
var FormContext = (0, import_react31.createContext)({
|
|
9161
9396
|
values: {},
|
|
9162
9397
|
errors: {},
|
|
9163
9398
|
hasSubmitted: false,
|
|
@@ -9173,25 +9408,25 @@ var FormComponent = ({
|
|
|
9173
9408
|
fullWidth = false,
|
|
9174
9409
|
...props
|
|
9175
9410
|
}, forwardedRef) => {
|
|
9176
|
-
const [errors, setErrors] = (0,
|
|
9177
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
9178
|
-
const innerRef = (0,
|
|
9411
|
+
const [errors, setErrors] = (0, import_react31.useState)({});
|
|
9412
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react31.useState)(false);
|
|
9413
|
+
const innerRef = (0, import_react31.useRef)();
|
|
9179
9414
|
const ref = forwardedRef ?? innerRef;
|
|
9180
|
-
const autoId = (0,
|
|
9415
|
+
const autoId = (0, import_react31.useId)();
|
|
9181
9416
|
const id = props.id ?? autoId;
|
|
9182
9417
|
const handleValidate = (nextFormData) => {
|
|
9183
9418
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
9184
|
-
if ((0,
|
|
9419
|
+
if ((0, import_type_guards29.isUndefined)(validate)) {
|
|
9185
9420
|
return {};
|
|
9186
9421
|
}
|
|
9187
9422
|
return validate(nextData);
|
|
9188
9423
|
};
|
|
9189
|
-
const
|
|
9424
|
+
const handleBlur2 = (event) => {
|
|
9190
9425
|
if (props.onBlur) {
|
|
9191
9426
|
props.onBlur(event);
|
|
9192
9427
|
}
|
|
9193
9428
|
const formData = new FormData(event.currentTarget);
|
|
9194
|
-
if ((0,
|
|
9429
|
+
if ((0, import_type_guards29.isNotUndefined)(validate)) {
|
|
9195
9430
|
handleValidate(formData);
|
|
9196
9431
|
}
|
|
9197
9432
|
};
|
|
@@ -9219,7 +9454,7 @@ var FormComponent = ({
|
|
|
9219
9454
|
void action(null);
|
|
9220
9455
|
}
|
|
9221
9456
|
};
|
|
9222
|
-
const context = (0,
|
|
9457
|
+
const context = (0, import_react31.useMemo)(() => {
|
|
9223
9458
|
return {
|
|
9224
9459
|
values,
|
|
9225
9460
|
errors,
|
|
@@ -9239,7 +9474,7 @@ var FormComponent = ({
|
|
|
9239
9474
|
as: StyledForm,
|
|
9240
9475
|
gap: "space-05",
|
|
9241
9476
|
id,
|
|
9242
|
-
onBlur:
|
|
9477
|
+
onBlur: handleBlur2,
|
|
9243
9478
|
onReset: handleReset,
|
|
9244
9479
|
onSubmit: handleSubmit,
|
|
9245
9480
|
children
|
|
@@ -9248,15 +9483,15 @@ var FormComponent = ({
|
|
|
9248
9483
|
);
|
|
9249
9484
|
};
|
|
9250
9485
|
FormComponent.displayName = "Form";
|
|
9251
|
-
var Form = (0,
|
|
9486
|
+
var Form = (0, import_react31.forwardRef)(FormComponent);
|
|
9252
9487
|
|
|
9253
9488
|
// src/components/Form/useFormState.tsx
|
|
9254
|
-
var
|
|
9489
|
+
var import_react32 = require("react");
|
|
9255
9490
|
var useFormState = (action, initialData = {}) => {
|
|
9256
|
-
const [data, setData] = (0,
|
|
9257
|
-
const [isPending, setIsPending] = (0,
|
|
9258
|
-
const [error, setError] = (0,
|
|
9259
|
-
const formAction = (0,
|
|
9491
|
+
const [data, setData] = (0, import_react32.useState)(initialData);
|
|
9492
|
+
const [isPending, setIsPending] = (0, import_react32.useState)(false);
|
|
9493
|
+
const [error, setError] = (0, import_react32.useState)(null);
|
|
9494
|
+
const formAction = (0, import_react32.useCallback)(
|
|
9260
9495
|
async (nextFormData) => {
|
|
9261
9496
|
if (nextFormData === null) {
|
|
9262
9497
|
setData(initialData);
|
|
@@ -9287,23 +9522,23 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9287
9522
|
};
|
|
9288
9523
|
|
|
9289
9524
|
// src/components/Form/FormErrorSummary.tsx
|
|
9290
|
-
var
|
|
9291
|
-
var
|
|
9525
|
+
var import_react33 = require("react");
|
|
9526
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
9292
9527
|
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
9293
9528
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9294
9529
|
return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9295
9530
|
};
|
|
9296
9531
|
var FormErrorSummary = ({ description }) => {
|
|
9297
|
-
const ref = (0,
|
|
9298
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
9532
|
+
const ref = (0, import_react33.useRef)(null);
|
|
9533
|
+
const { formId, errors, hasSubmitted } = (0, import_react33.useContext)(FormContext);
|
|
9299
9534
|
const isValid = Object.keys(errors).length === 0;
|
|
9300
9535
|
if (isValid || !hasSubmitted) {
|
|
9301
9536
|
return null;
|
|
9302
9537
|
}
|
|
9303
9538
|
return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { ref, children: [
|
|
9304
9539
|
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("p", { children: description }),
|
|
9305
|
-
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0,
|
|
9306
|
-
([name, error]) => (0,
|
|
9540
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards30.isNotUndefined)(error)).map(
|
|
9541
|
+
([name, error]) => (0, import_type_guards30.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
9307
9542
|
ErrorItem,
|
|
9308
9543
|
{
|
|
9309
9544
|
error: err,
|
|
@@ -9325,9 +9560,9 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9325
9560
|
};
|
|
9326
9561
|
|
|
9327
9562
|
// src/components/FormField/FormField.tsx
|
|
9328
|
-
var
|
|
9563
|
+
var import_react36 = require("react");
|
|
9329
9564
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
9330
|
-
var
|
|
9565
|
+
var import_type_guards31 = require("@wistia/type-guards");
|
|
9331
9566
|
|
|
9332
9567
|
// src/components/Label/Label.tsx
|
|
9333
9568
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
@@ -9390,11 +9625,11 @@ var Label = ({
|
|
|
9390
9625
|
Label.displayName = "Label";
|
|
9391
9626
|
|
|
9392
9627
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9393
|
-
var
|
|
9628
|
+
var import_react35 = require("react");
|
|
9394
9629
|
|
|
9395
9630
|
// src/components/FormGroup/FormGroup.tsx
|
|
9396
9631
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9397
|
-
var
|
|
9632
|
+
var import_react34 = require("react");
|
|
9398
9633
|
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
9399
9634
|
var StyledFieldset = import_styled_components49.default.fieldset`
|
|
9400
9635
|
border: 0;
|
|
@@ -9403,7 +9638,7 @@ var StyledLegend = import_styled_components49.default.legend`
|
|
|
9403
9638
|
margin-bottom: var(--space-01);
|
|
9404
9639
|
`;
|
|
9405
9640
|
var FormGroup = ({ children, label, ...props }) => {
|
|
9406
|
-
const ref = (0,
|
|
9641
|
+
const ref = (0, import_react34.useRef)();
|
|
9407
9642
|
return /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(
|
|
9408
9643
|
Stack,
|
|
9409
9644
|
{
|
|
@@ -9428,7 +9663,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
9428
9663
|
|
|
9429
9664
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9430
9665
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9431
|
-
var CheckboxGroupContext = (0,
|
|
9666
|
+
var CheckboxGroupContext = (0, import_react35.createContext)(null);
|
|
9432
9667
|
var CheckboxGroup = ({
|
|
9433
9668
|
children,
|
|
9434
9669
|
name,
|
|
@@ -9436,7 +9671,7 @@ var CheckboxGroup = ({
|
|
|
9436
9671
|
value,
|
|
9437
9672
|
...props
|
|
9438
9673
|
}) => {
|
|
9439
|
-
const context = (0,
|
|
9674
|
+
const context = (0, import_react35.useMemo)(() => {
|
|
9440
9675
|
return {
|
|
9441
9676
|
name,
|
|
9442
9677
|
onChange
|
|
@@ -9487,7 +9722,7 @@ var StyledErrorList = import_styled_components50.default.ul`
|
|
|
9487
9722
|
gap: var(--wui-space-01);
|
|
9488
9723
|
`;
|
|
9489
9724
|
var ErrorMessages = ({ errors, id }) => {
|
|
9490
|
-
const isMultipleErrors = (0,
|
|
9725
|
+
const isMultipleErrors = (0, import_type_guards31.isArray)(errors);
|
|
9491
9726
|
return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9492
9727
|
Text,
|
|
9493
9728
|
{
|
|
@@ -9521,8 +9756,8 @@ var FormField = ({
|
|
|
9521
9756
|
value,
|
|
9522
9757
|
...props
|
|
9523
9758
|
}) => {
|
|
9524
|
-
const formState = (0,
|
|
9525
|
-
const checkboxGroup = (0,
|
|
9759
|
+
const formState = (0, import_react36.useContext)(FormContext);
|
|
9760
|
+
const checkboxGroup = (0, import_react36.useContext)(CheckboxGroupContext);
|
|
9526
9761
|
const defaultValue = formState.values[name];
|
|
9527
9762
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9528
9763
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -9537,19 +9772,19 @@ var FormField = ({
|
|
|
9537
9772
|
"aria-describedby": ariaDescribedby,
|
|
9538
9773
|
...props
|
|
9539
9774
|
};
|
|
9540
|
-
if ((0,
|
|
9775
|
+
if ((0, import_type_guards31.isUndefined)(value) && (0, import_type_guards31.isNotUndefined)(defaultValue)) {
|
|
9541
9776
|
childProps = {
|
|
9542
9777
|
...childProps,
|
|
9543
9778
|
defaultValue
|
|
9544
9779
|
};
|
|
9545
9780
|
}
|
|
9546
|
-
if ((0,
|
|
9547
|
-
const computedName = (0,
|
|
9781
|
+
if ((0, import_type_guards31.isNotNil)(checkboxGroup)) {
|
|
9782
|
+
const computedName = (0, import_type_guards31.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
9548
9783
|
const handleChange = (event) => {
|
|
9549
|
-
if ((0,
|
|
9784
|
+
if ((0, import_type_guards31.isNotUndefined)(props.onChange)) {
|
|
9550
9785
|
props.onChange(event);
|
|
9551
9786
|
}
|
|
9552
|
-
if ((0,
|
|
9787
|
+
if ((0, import_type_guards31.isNotUndefined)(checkboxGroup.onChange)) {
|
|
9553
9788
|
checkboxGroup.onChange(event);
|
|
9554
9789
|
}
|
|
9555
9790
|
};
|
|
@@ -9557,10 +9792,10 @@ var FormField = ({
|
|
|
9557
9792
|
...childProps,
|
|
9558
9793
|
name: computedName,
|
|
9559
9794
|
onChange: handleChange,
|
|
9560
|
-
"aria-invalid": (0,
|
|
9795
|
+
"aria-invalid": (0, import_type_guards31.isNotNil)(error)
|
|
9561
9796
|
};
|
|
9562
9797
|
}
|
|
9563
|
-
|
|
9798
|
+
import_react36.Children.only(children);
|
|
9564
9799
|
return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
|
|
9565
9800
|
StyledFormField,
|
|
9566
9801
|
{
|
|
@@ -9568,9 +9803,9 @@ var FormField = ({
|
|
|
9568
9803
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
9569
9804
|
children: [
|
|
9570
9805
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
9571
|
-
(0,
|
|
9572
|
-
(0,
|
|
9573
|
-
(0,
|
|
9806
|
+
(0, import_type_guards31.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9807
|
+
(0, import_react36.cloneElement)(children, childProps),
|
|
9808
|
+
(0, import_type_guards31.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(import_jsx_runtime226.Fragment, { children: [
|
|
9574
9809
|
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("div", {}),
|
|
9575
9810
|
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9576
9811
|
ErrorMessages,
|
|
@@ -9587,9 +9822,9 @@ var FormField = ({
|
|
|
9587
9822
|
FormField.displayName = "FormField";
|
|
9588
9823
|
|
|
9589
9824
|
// src/components/FormGroup/RadioGroup.tsx
|
|
9590
|
-
var
|
|
9825
|
+
var import_react37 = require("react");
|
|
9591
9826
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
9592
|
-
var RadioGroupContext = (0,
|
|
9827
|
+
var RadioGroupContext = (0, import_react37.createContext)(null);
|
|
9593
9828
|
var RadioGroup = ({
|
|
9594
9829
|
children,
|
|
9595
9830
|
name,
|
|
@@ -9597,7 +9832,7 @@ var RadioGroup = ({
|
|
|
9597
9832
|
value,
|
|
9598
9833
|
...props
|
|
9599
9834
|
}) => {
|
|
9600
|
-
const context = (0,
|
|
9835
|
+
const context = (0, import_react37.useMemo)(() => {
|
|
9601
9836
|
return {
|
|
9602
9837
|
name,
|
|
9603
9838
|
onChange
|
|
@@ -9608,7 +9843,7 @@ var RadioGroup = ({
|
|
|
9608
9843
|
RadioGroup.displayName = "RadioGroup";
|
|
9609
9844
|
|
|
9610
9845
|
// src/components/IconButton/IconButton.tsx
|
|
9611
|
-
var
|
|
9846
|
+
var import_react38 = require("react");
|
|
9612
9847
|
var import_styled_components51 = __toESM(require("styled-components"));
|
|
9613
9848
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
9614
9849
|
var StyledButton2 = (0, import_styled_components51.default)(Button)`
|
|
@@ -9625,7 +9860,7 @@ var StyledButton2 = (0, import_styled_components51.default)(Button)`
|
|
|
9625
9860
|
align-items: center;
|
|
9626
9861
|
line-height: 1;
|
|
9627
9862
|
`;
|
|
9628
|
-
var IconButton = (0,
|
|
9863
|
+
var IconButton = (0, import_react38.forwardRef)(
|
|
9629
9864
|
({ children, label, size = "md", ...props }, ref) => {
|
|
9630
9865
|
const responsiveSize = useResponsiveProp(size);
|
|
9631
9866
|
return /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
@@ -9636,7 +9871,7 @@ var IconButton = (0, import_react37.forwardRef)(
|
|
|
9636
9871
|
"aria-label": label,
|
|
9637
9872
|
"data-wistia-ui-icon-button": true,
|
|
9638
9873
|
size: responsiveSize,
|
|
9639
|
-
children: (0,
|
|
9874
|
+
children: (0, import_react38.cloneElement)(import_react38.Children.only(children), {
|
|
9640
9875
|
size: responsiveSize
|
|
9641
9876
|
})
|
|
9642
9877
|
}
|
|
@@ -9647,7 +9882,7 @@ IconButton.displayName = "IconButton";
|
|
|
9647
9882
|
|
|
9648
9883
|
// src/components/Image/Image.tsx
|
|
9649
9884
|
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9650
|
-
var
|
|
9885
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
9651
9886
|
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
9652
9887
|
var getFillStyle2 = (fillContainer) => {
|
|
9653
9888
|
if (fillContainer === "horizontal") {
|
|
@@ -9665,7 +9900,7 @@ var getFillStyle2 = (fillContainer) => {
|
|
|
9665
9900
|
return void 0;
|
|
9666
9901
|
};
|
|
9667
9902
|
var StyledImage = import_styled_components52.default.img`
|
|
9668
|
-
border-radius: ${({ $borderRadius }) => (0,
|
|
9903
|
+
border-radius: ${({ $borderRadius }) => (0, import_type_guards32.isNotNil)($borderRadius) ? `var(--wui-${$borderRadius})` : void 0};
|
|
9669
9904
|
${({ $fillContainer }) => getFillStyle2($fillContainer)};
|
|
9670
9905
|
object-fit: ${({ $objFit }) => $objFit};
|
|
9671
9906
|
object-position: ${({ $objPosition }) => $objPosition};
|
|
@@ -9697,13 +9932,13 @@ Image.displayName = "Image";
|
|
|
9697
9932
|
// src/components/Menu/Menu.tsx
|
|
9698
9933
|
var import_styled_components53 = __toESM(require("styled-components"));
|
|
9699
9934
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
9700
|
-
var
|
|
9701
|
-
var
|
|
9935
|
+
var import_type_guards33 = require("@wistia/type-guards");
|
|
9936
|
+
var import_react40 = require("react");
|
|
9702
9937
|
|
|
9703
9938
|
// src/components/Menu/MenuContext.tsx
|
|
9704
|
-
var
|
|
9705
|
-
var MenuContext = (0,
|
|
9706
|
-
var useMenuContext = () => (0,
|
|
9939
|
+
var import_react39 = require("react");
|
|
9940
|
+
var MenuContext = (0, import_react39.createContext)({ compact: false });
|
|
9941
|
+
var useMenuContext = () => (0, import_react39.useContext)(MenuContext);
|
|
9707
9942
|
|
|
9708
9943
|
// src/components/Menu/Menu.tsx
|
|
9709
9944
|
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
@@ -9807,9 +10042,9 @@ var Menu = ({
|
|
|
9807
10042
|
onInteractOutside,
|
|
9808
10043
|
...props
|
|
9809
10044
|
}) => {
|
|
9810
|
-
const contextValue = (0,
|
|
10045
|
+
const contextValue = (0, import_react40.useMemo)(() => ({ compact }), [compact]);
|
|
9811
10046
|
let controlProps = {
|
|
9812
|
-
...(0,
|
|
10047
|
+
...(0, import_type_guards33.isNotNil)(onOpenChange) && (0, import_type_guards33.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
9813
10048
|
};
|
|
9814
10049
|
if (disabled) {
|
|
9815
10050
|
controlProps = {
|
|
@@ -9823,7 +10058,7 @@ var Menu = ({
|
|
|
9823
10058
|
modal: false,
|
|
9824
10059
|
...controlProps,
|
|
9825
10060
|
children: [
|
|
9826
|
-
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0,
|
|
10061
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards33.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
9827
10062
|
Button,
|
|
9828
10063
|
{
|
|
9829
10064
|
"aria-expanded": isOpen,
|
|
@@ -9881,15 +10116,15 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
9881
10116
|
MenuLabel.displayName = "MenuLabel";
|
|
9882
10117
|
|
|
9883
10118
|
// src/components/Menu/SubMenu.tsx
|
|
9884
|
-
var
|
|
10119
|
+
var import_react42 = require("react");
|
|
9885
10120
|
var import_styled_components57 = __toESM(require("styled-components"));
|
|
9886
10121
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
9887
|
-
var
|
|
10122
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
9888
10123
|
|
|
9889
10124
|
// src/components/Menu/MenuItemButton.tsx
|
|
9890
|
-
var
|
|
10125
|
+
var import_react41 = require("react");
|
|
9891
10126
|
var import_styled_components55 = __toESM(require("styled-components"));
|
|
9892
|
-
var
|
|
10127
|
+
var import_type_guards34 = require("@wistia/type-guards");
|
|
9893
10128
|
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
9894
10129
|
var StyledButton3 = (0, import_styled_components55.default)(Button)`
|
|
9895
10130
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -9964,10 +10199,10 @@ var StyledBadgeContainer = import_styled_components55.default.div`
|
|
|
9964
10199
|
font-size: var(--wui-typography-label-4-size);
|
|
9965
10200
|
color: var(--wui-color-text-secondary);
|
|
9966
10201
|
`;
|
|
9967
|
-
var MenuItemButton = (0,
|
|
10202
|
+
var MenuItemButton = (0, import_react41.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
9968
10203
|
let { colorScheme, badge } = props;
|
|
9969
10204
|
if (appearance === "dangerous") {
|
|
9970
|
-
if ((0,
|
|
10205
|
+
if ((0, import_type_guards34.isNotUndefined)(colorScheme)) {
|
|
9971
10206
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
9972
10207
|
}
|
|
9973
10208
|
colorScheme = "error";
|
|
@@ -9997,7 +10232,7 @@ var MenuItemButton = (0, import_react40.forwardRef)(({ children, appearance, com
|
|
|
9997
10232
|
children: [
|
|
9998
10233
|
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
9999
10234
|
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
10000
|
-
(0,
|
|
10235
|
+
(0, import_type_guards34.isNotNil)(badge) || (0, import_type_guards34.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
10001
10236
|
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
10002
10237
|
]
|
|
10003
10238
|
}
|
|
@@ -10060,12 +10295,12 @@ var SubMenu = ({
|
|
|
10060
10295
|
...props
|
|
10061
10296
|
}) => {
|
|
10062
10297
|
const { isSmAndUp } = useMq();
|
|
10063
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
10298
|
+
const [isExpanded, setIsExpanded] = (0, import_react42.useState)(false);
|
|
10064
10299
|
const { compact } = useMenuContext();
|
|
10065
10300
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
10066
10301
|
/* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
10067
10302
|
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(MenuItemLabel, { children: label }),
|
|
10068
|
-
(0,
|
|
10303
|
+
(0, import_type_guards35.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(MenuItemDescription, { children: description }) : null
|
|
10069
10304
|
] }),
|
|
10070
10305
|
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
10071
10306
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
@@ -10089,10 +10324,10 @@ var SubMenu = ({
|
|
|
10089
10324
|
SubMenu.displayName = "SubMenu";
|
|
10090
10325
|
|
|
10091
10326
|
// src/components/Menu/MenuItem.tsx
|
|
10092
|
-
var
|
|
10327
|
+
var import_react43 = require("react");
|
|
10093
10328
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
10094
10329
|
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
10095
|
-
var MenuItem = (0,
|
|
10330
|
+
var MenuItem = (0, import_react43.forwardRef)(
|
|
10096
10331
|
({ onSelect = () => null, ...props }, ref) => {
|
|
10097
10332
|
return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
10098
10333
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
@@ -10242,10 +10477,10 @@ var CheckboxMenuItem = ({
|
|
|
10242
10477
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
10243
10478
|
|
|
10244
10479
|
// src/components/Modal/Modal.tsx
|
|
10245
|
-
var
|
|
10480
|
+
var import_react47 = require("react");
|
|
10246
10481
|
var import_styled_components62 = __toESM(require("styled-components"));
|
|
10247
10482
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
10248
|
-
var
|
|
10483
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
10249
10484
|
|
|
10250
10485
|
// src/components/Modal/ModalHeader.tsx
|
|
10251
10486
|
var import_styled_components59 = __toESM(require("styled-components"));
|
|
@@ -10302,21 +10537,21 @@ var ModalHeader = ({
|
|
|
10302
10537
|
};
|
|
10303
10538
|
|
|
10304
10539
|
// src/components/Modal/ModalContent.tsx
|
|
10305
|
-
var
|
|
10540
|
+
var import_react45 = require("react");
|
|
10306
10541
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
10307
10542
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
10308
10543
|
|
|
10309
10544
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10310
|
-
var
|
|
10311
|
-
var
|
|
10545
|
+
var import_react44 = require("react");
|
|
10546
|
+
var import_type_guards36 = require("@wistia/type-guards");
|
|
10312
10547
|
var useFocusRestore = () => {
|
|
10313
|
-
const previouslyFocusedRef = (0,
|
|
10314
|
-
(0,
|
|
10548
|
+
const previouslyFocusedRef = (0, import_react44.useRef)(null);
|
|
10549
|
+
(0, import_react44.useEffect)(() => {
|
|
10315
10550
|
previouslyFocusedRef.current = document.activeElement;
|
|
10316
10551
|
}, []);
|
|
10317
|
-
(0,
|
|
10552
|
+
(0, import_react44.useEffect)(() => {
|
|
10318
10553
|
return () => {
|
|
10319
|
-
if ((0,
|
|
10554
|
+
if ((0, import_type_guards36.isNotNil)(previouslyFocusedRef.current)) {
|
|
10320
10555
|
setTimeout(() => {
|
|
10321
10556
|
previouslyFocusedRef.current?.focus();
|
|
10322
10557
|
}, 0);
|
|
@@ -10368,7 +10603,7 @@ var StyledModalContent = (0, import_styled_components60.default)(import_react_di
|
|
|
10368
10603
|
}
|
|
10369
10604
|
}
|
|
10370
10605
|
`;
|
|
10371
|
-
var ModalContent = (0,
|
|
10606
|
+
var ModalContent = (0, import_react45.forwardRef)(
|
|
10372
10607
|
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
10373
10608
|
useFocusRestore();
|
|
10374
10609
|
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
@@ -10386,7 +10621,7 @@ var ModalContent = (0, import_react44.forwardRef)(
|
|
|
10386
10621
|
);
|
|
10387
10622
|
|
|
10388
10623
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
10389
|
-
var
|
|
10624
|
+
var import_react46 = require("react");
|
|
10390
10625
|
var import_styled_components61 = __toESM(require("styled-components"));
|
|
10391
10626
|
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
10392
10627
|
var backdropAnimationDuration = 150;
|
|
@@ -10424,7 +10659,7 @@ var BackdropComponent = import_styled_components61.default.div`
|
|
|
10424
10659
|
}
|
|
10425
10660
|
}
|
|
10426
10661
|
`;
|
|
10427
|
-
var Backdrop = (0,
|
|
10662
|
+
var Backdrop = (0, import_react46.forwardRef)(
|
|
10428
10663
|
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
10429
10664
|
BackdropComponent,
|
|
10430
10665
|
{
|
|
@@ -10446,7 +10681,7 @@ var ModalBody = import_styled_components62.default.div`
|
|
|
10446
10681
|
display: flex;
|
|
10447
10682
|
order: 2;
|
|
10448
10683
|
`;
|
|
10449
|
-
var Modal = (0,
|
|
10684
|
+
var Modal = (0, import_react47.forwardRef)(
|
|
10450
10685
|
({
|
|
10451
10686
|
children,
|
|
10452
10687
|
fullHeight = false,
|
|
@@ -10463,7 +10698,7 @@ var Modal = (0, import_react46.forwardRef)(
|
|
|
10463
10698
|
import_react_dialog4.Root,
|
|
10464
10699
|
{
|
|
10465
10700
|
onOpenChange: (open2) => {
|
|
10466
|
-
if (!open2 && (0,
|
|
10701
|
+
if (!open2 && (0, import_type_guards37.isNotNil)(onRequestClose)) {
|
|
10467
10702
|
onRequestClose();
|
|
10468
10703
|
}
|
|
10469
10704
|
},
|
|
@@ -10476,7 +10711,7 @@ var Modal = (0, import_react46.forwardRef)(
|
|
|
10476
10711
|
ref,
|
|
10477
10712
|
fullHeight,
|
|
10478
10713
|
onOpenAutoFocus: (event) => {
|
|
10479
|
-
if ((0,
|
|
10714
|
+
if ((0, import_type_guards37.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
10480
10715
|
event.preventDefault();
|
|
10481
10716
|
requestAnimationFrame(() => {
|
|
10482
10717
|
initialFocusRef.current?.focus();
|
|
@@ -10510,9 +10745,9 @@ var import_react_popover = require("@radix-ui/react-popover");
|
|
|
10510
10745
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
10511
10746
|
|
|
10512
10747
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
10513
|
-
var
|
|
10748
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
10514
10749
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
10515
|
-
return (0,
|
|
10750
|
+
return (0, import_type_guards38.isNotNil)(onOpenChange) && (0, import_type_guards38.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
10516
10751
|
};
|
|
10517
10752
|
|
|
10518
10753
|
// src/components/Popover/Popover.tsx
|
|
@@ -10571,7 +10806,7 @@ Popover.displayName = "Popover";
|
|
|
10571
10806
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
10572
10807
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
10573
10808
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
10574
|
-
var
|
|
10809
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
10575
10810
|
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
10576
10811
|
var ProgressBarWrapper = import_styled_components64.default.div`
|
|
10577
10812
|
--progress-bar-height: 8px;
|
|
@@ -10626,7 +10861,7 @@ var ProgressBar = ({
|
|
|
10626
10861
|
...props
|
|
10627
10862
|
}) => {
|
|
10628
10863
|
return /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)(ProgressBarWrapper, { children: [
|
|
10629
|
-
(0,
|
|
10864
|
+
(0, import_type_guards39.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
10630
10865
|
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
10631
10866
|
StyledProgressBar,
|
|
10632
10867
|
{
|
|
@@ -10642,15 +10877,15 @@ var ProgressBar = ({
|
|
|
10642
10877
|
)
|
|
10643
10878
|
}
|
|
10644
10879
|
),
|
|
10645
|
-
(0,
|
|
10880
|
+
(0, import_type_guards39.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
10646
10881
|
] });
|
|
10647
10882
|
};
|
|
10648
10883
|
ProgressBar.displayName = "ProgressBar";
|
|
10649
10884
|
|
|
10650
10885
|
// src/components/Radio/Radio.tsx
|
|
10651
|
-
var
|
|
10886
|
+
var import_react48 = require("react");
|
|
10652
10887
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
10653
|
-
var
|
|
10888
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
10654
10889
|
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
10655
10890
|
var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
10656
10891
|
"svg",
|
|
@@ -10751,7 +10986,7 @@ var StyledHiddenRadioInput = import_styled_components65.default.input`
|
|
|
10751
10986
|
display: block;
|
|
10752
10987
|
}
|
|
10753
10988
|
`;
|
|
10754
|
-
var Radio = (0,
|
|
10989
|
+
var Radio = (0, import_react48.forwardRef)(
|
|
10755
10990
|
({
|
|
10756
10991
|
checked,
|
|
10757
10992
|
disabled = false,
|
|
@@ -10766,8 +11001,8 @@ var Radio = (0, import_react47.forwardRef)(
|
|
|
10766
11001
|
hideLabel = false,
|
|
10767
11002
|
...props
|
|
10768
11003
|
}, ref) => {
|
|
10769
|
-
const generatedId = (0,
|
|
10770
|
-
const computedId = (0,
|
|
11004
|
+
const generatedId = (0, import_react48.useId)();
|
|
11005
|
+
const computedId = (0, import_type_guards40.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
10771
11006
|
return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(
|
|
10772
11007
|
StyledRadioWrapper,
|
|
10773
11008
|
{
|
|
@@ -10816,22 +11051,22 @@ var Radio = (0, import_react47.forwardRef)(
|
|
|
10816
11051
|
Radio.displayName = "Radio";
|
|
10817
11052
|
|
|
10818
11053
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
10819
|
-
var
|
|
11054
|
+
var import_react52 = require("react");
|
|
10820
11055
|
var import_styled_components67 = __toESM(require("styled-components"));
|
|
10821
11056
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
10822
|
-
var
|
|
11057
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
10823
11058
|
|
|
10824
11059
|
// src/components/SegmentedControl/useSelectedItemMeasurements.tsx
|
|
10825
|
-
var
|
|
11060
|
+
var import_react49 = require("react");
|
|
10826
11061
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
10827
|
-
var SelectedItemMeasurementsContext = (0,
|
|
11062
|
+
var SelectedItemMeasurementsContext = (0, import_react49.createContext)(
|
|
10828
11063
|
null
|
|
10829
11064
|
);
|
|
10830
11065
|
var SelectedItemMeasurementsProvider = ({
|
|
10831
11066
|
children
|
|
10832
11067
|
}) => {
|
|
10833
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
10834
|
-
const contextValue = (0,
|
|
11068
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react49.useState)(null);
|
|
11069
|
+
const contextValue = (0, import_react49.useMemo)(
|
|
10835
11070
|
() => ({
|
|
10836
11071
|
setSelectedItemMeasurements,
|
|
10837
11072
|
selectedItemMeasurements
|
|
@@ -10841,7 +11076,7 @@ var SelectedItemMeasurementsProvider = ({
|
|
|
10841
11076
|
return /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(SelectedItemMeasurementsContext.Provider, { value: contextValue, children });
|
|
10842
11077
|
};
|
|
10843
11078
|
var useSelectedItemMeasurements = () => {
|
|
10844
|
-
const context = (0,
|
|
11079
|
+
const context = (0, import_react49.useContext)(SelectedItemMeasurementsContext);
|
|
10845
11080
|
if (context === null) {
|
|
10846
11081
|
throw new Error(
|
|
10847
11082
|
"useSelectedItemMeasurements must be used within a SelectedItemMeasurementsProvider"
|
|
@@ -10851,15 +11086,15 @@ var useSelectedItemMeasurements = () => {
|
|
|
10851
11086
|
};
|
|
10852
11087
|
|
|
10853
11088
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
10854
|
-
var
|
|
11089
|
+
var import_react51 = require("react");
|
|
10855
11090
|
var import_styled_components66 = __toESM(require("styled-components"));
|
|
10856
11091
|
|
|
10857
11092
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
10858
|
-
var
|
|
10859
|
-
var SegmentedControlValueContext = (0,
|
|
11093
|
+
var import_react50 = require("react");
|
|
11094
|
+
var SegmentedControlValueContext = (0, import_react50.createContext)(null);
|
|
10860
11095
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
10861
11096
|
var useSegmentedControlValue = () => {
|
|
10862
|
-
const context = (0,
|
|
11097
|
+
const context = (0, import_react50.useContext)(SegmentedControlValueContext);
|
|
10863
11098
|
if (context === null) {
|
|
10864
11099
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
10865
11100
|
}
|
|
@@ -10883,7 +11118,7 @@ var SelectedItemIndicatorDiv = import_styled_components66.default.div`
|
|
|
10883
11118
|
var SelectedItemIndicator = () => {
|
|
10884
11119
|
const selectedValue = useSegmentedControlValue();
|
|
10885
11120
|
const { selectedItemMeasurements } = useSelectedItemMeasurements();
|
|
10886
|
-
const selectedItemIndicatorStyle = (0,
|
|
11121
|
+
const selectedItemIndicatorStyle = (0, import_react51.useMemo)(
|
|
10887
11122
|
() => selectedItemMeasurements != null ? {
|
|
10888
11123
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
10889
11124
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px)`,
|
|
@@ -10921,7 +11156,7 @@ var segmentedControlStyles = import_styled_components67.css`
|
|
|
10921
11156
|
var StyledSegmentedControl = (0, import_styled_components67.default)(import_react_toggle_group.Root)`
|
|
10922
11157
|
${segmentedControlStyles}
|
|
10923
11158
|
`;
|
|
10924
|
-
var SegmentedControl = (0,
|
|
11159
|
+
var SegmentedControl = (0, import_react52.forwardRef)(
|
|
10925
11160
|
({
|
|
10926
11161
|
children,
|
|
10927
11162
|
disabled = false,
|
|
@@ -10930,7 +11165,7 @@ var SegmentedControl = (0, import_react51.forwardRef)(
|
|
|
10930
11165
|
onSelectedValueChange,
|
|
10931
11166
|
...props
|
|
10932
11167
|
}, ref) => {
|
|
10933
|
-
if ((0,
|
|
11168
|
+
if ((0, import_type_guards41.isNil)(children)) {
|
|
10934
11169
|
return null;
|
|
10935
11170
|
}
|
|
10936
11171
|
return /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
@@ -10956,10 +11191,10 @@ var SegmentedControl = (0, import_react51.forwardRef)(
|
|
|
10956
11191
|
SegmentedControl.displayName = "SegmentedControl";
|
|
10957
11192
|
|
|
10958
11193
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
10959
|
-
var
|
|
11194
|
+
var import_react53 = require("react");
|
|
10960
11195
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
10961
11196
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
10962
|
-
var
|
|
11197
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
10963
11198
|
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
10964
11199
|
var segmentedControlItemStyles = import_styled_components68.css`
|
|
10965
11200
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -11024,11 +11259,11 @@ var segmentedControlItemStyles = import_styled_components68.css`
|
|
|
11024
11259
|
var StyledSegmentedControlItem = (0, import_styled_components68.default)(import_react_toggle_group2.Item)`
|
|
11025
11260
|
${segmentedControlItemStyles}
|
|
11026
11261
|
`;
|
|
11027
|
-
var SegmentedControlItem = (0,
|
|
11262
|
+
var SegmentedControlItem = (0, import_react53.forwardRef)(
|
|
11028
11263
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11029
11264
|
const selectedValue = useSegmentedControlValue();
|
|
11030
11265
|
const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
|
|
11031
|
-
const buttonRef = (0,
|
|
11266
|
+
const buttonRef = (0, import_react53.useRef)(null);
|
|
11032
11267
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11033
11268
|
const handleClick = (event) => {
|
|
11034
11269
|
const target = event.target;
|
|
@@ -11037,7 +11272,7 @@ var SegmentedControlItem = (0, import_react52.forwardRef)(
|
|
|
11037
11272
|
event.preventDefault();
|
|
11038
11273
|
}
|
|
11039
11274
|
};
|
|
11040
|
-
(0,
|
|
11275
|
+
(0, import_react53.useEffect)(() => {
|
|
11041
11276
|
const buttonElem = buttonRef.current;
|
|
11042
11277
|
if (!buttonElem) {
|
|
11043
11278
|
return void 0;
|
|
@@ -11066,8 +11301,8 @@ var SegmentedControlItem = (0, import_react52.forwardRef)(
|
|
|
11066
11301
|
StyledSegmentedControlItem,
|
|
11067
11302
|
{
|
|
11068
11303
|
ref: combinedRef,
|
|
11069
|
-
$hasLabel: (0,
|
|
11070
|
-
"aria-label": (0,
|
|
11304
|
+
$hasLabel: (0, import_type_guards42.isNotNil)(label),
|
|
11305
|
+
"aria-label": (0, import_type_guards42.isNotNil)(label) ? void 0 : ariaLabel,
|
|
11071
11306
|
disabled,
|
|
11072
11307
|
onClick: handleClick,
|
|
11073
11308
|
value,
|
|
@@ -11083,7 +11318,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
11083
11318
|
|
|
11084
11319
|
// src/components/Select/Select.tsx
|
|
11085
11320
|
var import_react_select = require("@radix-ui/react-select");
|
|
11086
|
-
var
|
|
11321
|
+
var import_react54 = require("react");
|
|
11087
11322
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
11088
11323
|
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
11089
11324
|
var StyledTrigger = (0, import_styled_components69.default)(import_react_select.Trigger)`
|
|
@@ -11152,7 +11387,7 @@ var StyledContent3 = (0, import_styled_components69.default)(import_react_select
|
|
|
11152
11387
|
max-height: var(--radix-select-content-available-height);
|
|
11153
11388
|
z-index: var(--wui-zindex-select);
|
|
11154
11389
|
`;
|
|
11155
|
-
var Select = (0,
|
|
11390
|
+
var Select = (0, import_react54.forwardRef)(
|
|
11156
11391
|
({
|
|
11157
11392
|
colorScheme = "inherit",
|
|
11158
11393
|
children,
|
|
@@ -11201,7 +11436,7 @@ Select.displayName = "Select";
|
|
|
11201
11436
|
|
|
11202
11437
|
// src/components/Select/SelectOption.tsx
|
|
11203
11438
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11204
|
-
var
|
|
11439
|
+
var import_react55 = require("react");
|
|
11205
11440
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11206
11441
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11207
11442
|
var StyledItem = (0, import_styled_components70.default)(import_react_select2.Item)`
|
|
@@ -11230,7 +11465,7 @@ var StyledItem = (0, import_styled_components70.default)(import_react_select2.It
|
|
|
11230
11465
|
var StyledIconContainer = import_styled_components70.default.span`
|
|
11231
11466
|
width: 12px;
|
|
11232
11467
|
`;
|
|
11233
|
-
var SelectOption = (0,
|
|
11468
|
+
var SelectOption = (0, import_react55.forwardRef)(
|
|
11234
11469
|
({ children, ...props }, forwardedRef) => {
|
|
11235
11470
|
return /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
|
|
11236
11471
|
StyledItem,
|
|
@@ -11275,9 +11510,9 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11275
11510
|
};
|
|
11276
11511
|
|
|
11277
11512
|
// src/components/Switch/Switch.tsx
|
|
11278
|
-
var
|
|
11513
|
+
var import_react56 = require("react");
|
|
11279
11514
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11280
|
-
var
|
|
11515
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
11281
11516
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
11282
11517
|
var sizeSmall3 = import_styled_components72.css`
|
|
11283
11518
|
--wui-size-small-width: 24px;
|
|
@@ -11380,7 +11615,7 @@ var StyledHiddenSwitchInput = import_styled_components72.default.input`
|
|
|
11380
11615
|
}
|
|
11381
11616
|
}
|
|
11382
11617
|
`;
|
|
11383
|
-
var Switch = (0,
|
|
11618
|
+
var Switch = (0, import_react56.forwardRef)(
|
|
11384
11619
|
({
|
|
11385
11620
|
checked,
|
|
11386
11621
|
disabled = false,
|
|
@@ -11395,8 +11630,8 @@ var Switch = (0, import_react55.forwardRef)(
|
|
|
11395
11630
|
hideLabel = false,
|
|
11396
11631
|
...props
|
|
11397
11632
|
}, ref) => {
|
|
11398
|
-
const generatedId = (0,
|
|
11399
|
-
const computedId = (0,
|
|
11633
|
+
const generatedId = (0, import_react56.useId)();
|
|
11634
|
+
const computedId = (0, import_type_guards43.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11400
11635
|
return /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
11401
11636
|
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
11402
11637
|
StyledHiddenSwitchInput,
|
|
@@ -11477,8 +11712,8 @@ var Table = ({
|
|
|
11477
11712
|
var import_styled_components74 = __toESM(require("styled-components"));
|
|
11478
11713
|
|
|
11479
11714
|
// src/components/Table/TableSectionContext.ts
|
|
11480
|
-
var
|
|
11481
|
-
var TableSectionContext = (0,
|
|
11715
|
+
var import_react57 = require("react");
|
|
11716
|
+
var TableSectionContext = (0, import_react57.createContext)(null);
|
|
11482
11717
|
|
|
11483
11718
|
// src/components/Table/TableBody.tsx
|
|
11484
11719
|
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
@@ -11488,7 +11723,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
11488
11723
|
};
|
|
11489
11724
|
|
|
11490
11725
|
// src/components/Table/TableCell.tsx
|
|
11491
|
-
var
|
|
11726
|
+
var import_react58 = require("react");
|
|
11492
11727
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11493
11728
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
11494
11729
|
var sharedStyles = import_styled_components75.css`
|
|
@@ -11509,7 +11744,7 @@ var StyledTd = import_styled_components75.default.td`
|
|
|
11509
11744
|
line-height: var(--wui-typography-body-2-line-height);
|
|
11510
11745
|
`;
|
|
11511
11746
|
var TableCell = ({ children, ...props }) => {
|
|
11512
|
-
const section = (0,
|
|
11747
|
+
const section = (0, import_react58.useContext)(TableSectionContext);
|
|
11513
11748
|
if (section === "head") {
|
|
11514
11749
|
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledTh, { ...props, children });
|
|
11515
11750
|
}
|
|
@@ -11541,9 +11776,9 @@ var TableRow = ({ children, ...props }) => {
|
|
|
11541
11776
|
};
|
|
11542
11777
|
|
|
11543
11778
|
// src/components/Tabs/Tabs.tsx
|
|
11544
|
-
var
|
|
11779
|
+
var import_react63 = require("react");
|
|
11545
11780
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
11546
|
-
var
|
|
11781
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
11547
11782
|
var import_styled_components83 = __toESM(require("styled-components"));
|
|
11548
11783
|
|
|
11549
11784
|
// src/components/Tabs/TabPanel.tsx
|
|
@@ -11596,17 +11831,17 @@ var TabList = ({
|
|
|
11596
11831
|
TabList.displayName = "TabList";
|
|
11597
11832
|
|
|
11598
11833
|
// src/components/Tabs/TabItem.tsx
|
|
11599
|
-
var
|
|
11834
|
+
var import_react60 = require("react");
|
|
11600
11835
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
11601
11836
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
11602
|
-
var
|
|
11837
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
11603
11838
|
|
|
11604
11839
|
// src/components/Tabs/useTabsValue.tsx
|
|
11605
|
-
var
|
|
11606
|
-
var TabsValueContext = (0,
|
|
11840
|
+
var import_react59 = require("react");
|
|
11841
|
+
var TabsValueContext = (0, import_react59.createContext)(null);
|
|
11607
11842
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
11608
11843
|
var useTabsValue = () => {
|
|
11609
|
-
const context = (0,
|
|
11844
|
+
const context = (0, import_react59.useContext)(TabsValueContext);
|
|
11610
11845
|
if (context === null) {
|
|
11611
11846
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
11612
11847
|
}
|
|
@@ -11622,13 +11857,13 @@ var StyledTabItem = (0, import_styled_components81.default)(import_react_tabs3.T
|
|
|
11622
11857
|
outline: none;
|
|
11623
11858
|
}
|
|
11624
11859
|
`;
|
|
11625
|
-
var TabItem = (0,
|
|
11860
|
+
var TabItem = (0, import_react60.forwardRef)(
|
|
11626
11861
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11627
11862
|
const selectedValue = useTabsValue();
|
|
11628
11863
|
const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
|
|
11629
|
-
const buttonRef = (0,
|
|
11864
|
+
const buttonRef = (0, import_react60.useRef)(null);
|
|
11630
11865
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11631
|
-
(0,
|
|
11866
|
+
(0, import_react60.useEffect)(() => {
|
|
11632
11867
|
const buttonElem = buttonRef.current;
|
|
11633
11868
|
if (!buttonElem) {
|
|
11634
11869
|
return void 0;
|
|
@@ -11657,8 +11892,8 @@ var TabItem = (0, import_react59.forwardRef)(
|
|
|
11657
11892
|
StyledTabItem,
|
|
11658
11893
|
{
|
|
11659
11894
|
ref: combinedRef,
|
|
11660
|
-
$hasLabel: (0,
|
|
11661
|
-
"aria-label": (0,
|
|
11895
|
+
$hasLabel: (0, import_type_guards44.isNotNil)(label),
|
|
11896
|
+
"aria-label": (0, import_type_guards44.isNotNil)(label) ? void 0 : ariaLabel,
|
|
11662
11897
|
disabled,
|
|
11663
11898
|
value,
|
|
11664
11899
|
children: [
|
|
@@ -11672,16 +11907,16 @@ var TabItem = (0, import_react59.forwardRef)(
|
|
|
11672
11907
|
TabItem.displayName = "TabItem";
|
|
11673
11908
|
|
|
11674
11909
|
// src/components/Tabs/extractTabItems.ts
|
|
11675
|
-
var
|
|
11910
|
+
var import_react61 = require("react");
|
|
11676
11911
|
var extractTabItems = (children) => {
|
|
11677
11912
|
const tabItems = [];
|
|
11678
|
-
|
|
11679
|
-
if (!(0,
|
|
11913
|
+
import_react61.Children.forEach(children, (child) => {
|
|
11914
|
+
if (!(0, import_react61.isValidElement)(child)) {
|
|
11680
11915
|
return;
|
|
11681
11916
|
}
|
|
11682
11917
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
11683
11918
|
tabItems.push(child);
|
|
11684
|
-
} else if (child.type ===
|
|
11919
|
+
} else if (child.type === import_react61.Fragment) {
|
|
11685
11920
|
const fragmentElement = child;
|
|
11686
11921
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
11687
11922
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -11694,7 +11929,7 @@ var extractTabItems = (children) => {
|
|
|
11694
11929
|
};
|
|
11695
11930
|
|
|
11696
11931
|
// src/components/Tabs/SelectedItemIndicator.tsx
|
|
11697
|
-
var
|
|
11932
|
+
var import_react62 = require("react");
|
|
11698
11933
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
11699
11934
|
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
11700
11935
|
var TabsSelectedItemIndicatorDiv = (0, import_styled_components82.default)(SelectedItemIndicatorDiv)`
|
|
@@ -11705,7 +11940,7 @@ var TabsSelectedItemIndicatorDiv = (0, import_styled_components82.default)(Selec
|
|
|
11705
11940
|
var SelectedItemIndicator2 = () => {
|
|
11706
11941
|
const { selectedItemMeasurements } = useSelectedItemMeasurements();
|
|
11707
11942
|
const selectedValue = useTabsValue();
|
|
11708
|
-
const selectedItemIndicatorStyle = (0,
|
|
11943
|
+
const selectedItemIndicatorStyle = (0, import_react62.useMemo)(
|
|
11709
11944
|
() => selectedItemMeasurements != null ? {
|
|
11710
11945
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
11711
11946
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px)`,
|
|
@@ -11746,7 +11981,7 @@ var StyledTabsRoot = (0, import_styled_components83.default)(import_react_tabs4.
|
|
|
11746
11981
|
flex-direction: column;
|
|
11747
11982
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
11748
11983
|
`;
|
|
11749
|
-
var Tabs = (0,
|
|
11984
|
+
var Tabs = (0, import_react63.forwardRef)(
|
|
11750
11985
|
({
|
|
11751
11986
|
children,
|
|
11752
11987
|
fullWidth = true,
|
|
@@ -11758,7 +11993,7 @@ var Tabs = (0, import_react62.forwardRef)(
|
|
|
11758
11993
|
...otherProps
|
|
11759
11994
|
}, ref) => {
|
|
11760
11995
|
const tabItems = extractTabItems(children);
|
|
11761
|
-
const [internalSelectedValue, setInternalSelectedValue] = (0,
|
|
11996
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react63.useState)(defaultSelectedValue);
|
|
11762
11997
|
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
11763
11998
|
defaultValue: defaultSelectedValue,
|
|
11764
11999
|
onValueChange: setInternalSelectedValue
|
|
@@ -11788,7 +12023,7 @@ var Tabs = (0, import_react62.forwardRef)(
|
|
|
11788
12023
|
label,
|
|
11789
12024
|
"aria-label": ariaLabelForTab
|
|
11790
12025
|
} = tab.props;
|
|
11791
|
-
if ((0,
|
|
12026
|
+
if ((0, import_type_guards45.isNil)(icon)) {
|
|
11792
12027
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
11793
12028
|
TabItem,
|
|
11794
12029
|
{
|
|
@@ -11799,7 +12034,7 @@ var Tabs = (0, import_react62.forwardRef)(
|
|
|
11799
12034
|
value
|
|
11800
12035
|
);
|
|
11801
12036
|
}
|
|
11802
|
-
if ((0,
|
|
12037
|
+
if ((0, import_type_guards45.isNotNil)(label)) {
|
|
11803
12038
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
11804
12039
|
TabItem,
|
|
11805
12040
|
{
|
|
@@ -11811,7 +12046,7 @@ var Tabs = (0, import_react62.forwardRef)(
|
|
|
11811
12046
|
value
|
|
11812
12047
|
);
|
|
11813
12048
|
}
|
|
11814
|
-
if ((0,
|
|
12049
|
+
if ((0, import_type_guards45.isNotNil)(ariaLabelForTab)) {
|
|
11815
12050
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
11816
12051
|
TabItem,
|
|
11817
12052
|
{
|
|
@@ -11844,17 +12079,17 @@ var Tabs = (0, import_react62.forwardRef)(
|
|
|
11844
12079
|
Tabs.displayName = "Tabs";
|
|
11845
12080
|
|
|
11846
12081
|
// src/components/Tabs/Tab.tsx
|
|
11847
|
-
var
|
|
12082
|
+
var import_react64 = require("react");
|
|
11848
12083
|
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
11849
|
-
var Tab = (0,
|
|
12084
|
+
var Tab = (0, import_react64.forwardRef)(({ children }, ref) => {
|
|
11850
12085
|
return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)("div", { ref, children });
|
|
11851
12086
|
});
|
|
11852
12087
|
Tab.displayName = "Tab";
|
|
11853
12088
|
|
|
11854
12089
|
// src/components/Tag/Tag.tsx
|
|
11855
|
-
var
|
|
12090
|
+
var import_react65 = require("react");
|
|
11856
12091
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
11857
|
-
var
|
|
12092
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
11858
12093
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
11859
12094
|
var TagLabel = import_styled_components84.default.a`
|
|
11860
12095
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -11939,10 +12174,10 @@ var StyledTag = import_styled_components84.default.div`
|
|
|
11939
12174
|
}
|
|
11940
12175
|
`;
|
|
11941
12176
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
11942
|
-
if ((0,
|
|
12177
|
+
if ((0, import_type_guards46.isNil)(onClickRemove)) {
|
|
11943
12178
|
return null;
|
|
11944
12179
|
}
|
|
11945
|
-
if ((0,
|
|
12180
|
+
if ((0, import_type_guards46.isNil)(onClickRemoveLabel)) {
|
|
11946
12181
|
throw new Error(
|
|
11947
12182
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
11948
12183
|
);
|
|
@@ -11969,7 +12204,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
11969
12204
|
)
|
|
11970
12205
|
] });
|
|
11971
12206
|
};
|
|
11972
|
-
var Tag = (0,
|
|
12207
|
+
var Tag = (0, import_react65.forwardRef)(
|
|
11973
12208
|
({
|
|
11974
12209
|
onClickRemove,
|
|
11975
12210
|
colorScheme = "inherit",
|
|
@@ -11979,8 +12214,8 @@ var Tag = (0, import_react64.forwardRef)(
|
|
|
11979
12214
|
onClickRemoveLabel,
|
|
11980
12215
|
...otherProps
|
|
11981
12216
|
}, ref) => {
|
|
11982
|
-
const hasIcon = (0,
|
|
11983
|
-
const labelProps = (0,
|
|
12217
|
+
const hasIcon = (0, import_type_guards46.isNotNil)(icon);
|
|
12218
|
+
const labelProps = (0, import_type_guards46.isNotNil)(href) && (0, import_type_guards46.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
11984
12219
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(
|
|
11985
12220
|
StyledTag,
|
|
11986
12221
|
{
|
|
@@ -12016,7 +12251,7 @@ Tag.displayName = "Tag";
|
|
|
12016
12251
|
|
|
12017
12252
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
12018
12253
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
12019
|
-
var
|
|
12254
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
12020
12255
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
12021
12256
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
12022
12257
|
if (iconOnly) {
|
|
@@ -12129,7 +12364,7 @@ var WistiaLogo = ({
|
|
|
12129
12364
|
...otherProps,
|
|
12130
12365
|
children: [
|
|
12131
12366
|
/* @__PURE__ */ (0, import_jsx_runtime268.jsx)("title", { children: title }),
|
|
12132
|
-
(0,
|
|
12367
|
+
(0, import_type_guards47.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("desc", { children: description }) : null,
|
|
12133
12368
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
12134
12369
|
renderLogotype(logotypeColor, iconOnly)
|
|
12135
12370
|
]
|
|
@@ -12138,6 +12373,257 @@ var WistiaLogo = ({
|
|
|
12138
12373
|
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("a", { href, children: Logo }) : Logo;
|
|
12139
12374
|
};
|
|
12140
12375
|
WistiaLogo.displayName = "WistiaLogo";
|
|
12376
|
+
|
|
12377
|
+
// src/components/Thumbnail/Thumbnail.tsx
|
|
12378
|
+
var import_react66 = require("react");
|
|
12379
|
+
var import_styled_components87 = __toESM(require("styled-components"));
|
|
12380
|
+
var import_type_guards49 = require("@wistia/type-guards");
|
|
12381
|
+
|
|
12382
|
+
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
12383
|
+
var import_type_guards48 = require("@wistia/type-guards");
|
|
12384
|
+
var import_styled_components86 = require("styled-components");
|
|
12385
|
+
var gradients = {
|
|
12386
|
+
defaultDarkOne: import_styled_components86.css`
|
|
12387
|
+
background-color: #222d66;
|
|
12388
|
+
background-image:
|
|
12389
|
+
radial-gradient(farthest-corner at top right, #222d66, transparent 70%),
|
|
12390
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 50%),
|
|
12391
|
+
radial-gradient(farthest-corner at bottom left, #6b84ff, transparent 57%),
|
|
12392
|
+
radial-gradient(farthest-corner at top left, #2949e5, transparent 68%);
|
|
12393
|
+
`,
|
|
12394
|
+
defaultDarkTwo: import_styled_components86.css`
|
|
12395
|
+
background-color: #222d66;
|
|
12396
|
+
background-image:
|
|
12397
|
+
radial-gradient(farthest-corner at top left, #6b84ff, transparent 100%),
|
|
12398
|
+
radial-gradient(farthest-corner at bottom left, #222d66, transparent 57%),
|
|
12399
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 50%),
|
|
12400
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 70%);
|
|
12401
|
+
`,
|
|
12402
|
+
defaultLightOne: import_styled_components86.css`
|
|
12403
|
+
background-color: #ccd5ff;
|
|
12404
|
+
background-image:
|
|
12405
|
+
radial-gradient(farthest-corner at bottom right, #ccd5ff, transparent 55%),
|
|
12406
|
+
radial-gradient(farthest-corner at top left, #ccd5ff, transparent 65%),
|
|
12407
|
+
radial-gradient(farthest-corner at top right, #6b84ff, transparent 50%),
|
|
12408
|
+
radial-gradient(farthest-corner at bottom left, #f7f8ff, transparent 50%);
|
|
12409
|
+
`,
|
|
12410
|
+
defaultLightTwo: import_styled_components86.css`
|
|
12411
|
+
background-color: #ccd5ff;
|
|
12412
|
+
background-image:
|
|
12413
|
+
radial-gradient(ellipse at top, #ccd5ff, transparent),
|
|
12414
|
+
radial-gradient(ellipse at bottom, #6b84ff, transparent);
|
|
12415
|
+
`,
|
|
12416
|
+
defaultMidOne: import_styled_components86.css`
|
|
12417
|
+
background-color: #6b84ff;
|
|
12418
|
+
background-image:
|
|
12419
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 70%),
|
|
12420
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 50%),
|
|
12421
|
+
radial-gradient(farthest-corner at top left, #6b84ff, transparent 80%),
|
|
12422
|
+
radial-gradient(farthest-corner at bottom left, #222d66, transparent 57%);
|
|
12423
|
+
`,
|
|
12424
|
+
defaultMidTwo: import_styled_components86.css`
|
|
12425
|
+
background-color: #6b84ff;
|
|
12426
|
+
background-image:
|
|
12427
|
+
radial-gradient(ellipse at top, #2949e5, transparent),
|
|
12428
|
+
radial-gradient(ellipse at bottom, #ccd5ff, transparent);
|
|
12429
|
+
`,
|
|
12430
|
+
green: import_styled_components86.css`
|
|
12431
|
+
background-color: #fafffa;
|
|
12432
|
+
background-image:
|
|
12433
|
+
radial-gradient(farthest-corner at bottom left, #b0e5a5, transparent 50%),
|
|
12434
|
+
radial-gradient(farthest-corner at top right, #268713, transparent 50%),
|
|
12435
|
+
radial-gradient(farthest-corner at top left, #44b62d, transparent 65%),
|
|
12436
|
+
radial-gradient(farthest-corner at bottom right, #44b62d, transparent 55%);
|
|
12437
|
+
`,
|
|
12438
|
+
greenWithPop: import_styled_components86.css`
|
|
12439
|
+
background-color: #fafffa;
|
|
12440
|
+
background-image:
|
|
12441
|
+
radial-gradient(farthest-corner at bottom left, #b0e5a5, transparent 50%),
|
|
12442
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 50%),
|
|
12443
|
+
radial-gradient(farthest-corner at top left, #44b62d, transparent 65%),
|
|
12444
|
+
radial-gradient(farthest-corner at bottom right, #44b62d, transparent 55%);
|
|
12445
|
+
`,
|
|
12446
|
+
pink: import_styled_components86.css`
|
|
12447
|
+
background-color: #fffff0;
|
|
12448
|
+
background-image:
|
|
12449
|
+
radial-gradient(farthest-corner at bottom left, #ffc7e8, transparent 50%),
|
|
12450
|
+
radial-gradient(farthest-corner at top right, #e0128e, transparent 70%),
|
|
12451
|
+
radial-gradient(farthest-corner at top left, #ff40b3, transparent 65%),
|
|
12452
|
+
radial-gradient(farthest-corner at bottom right, #ff40b3, transparent 55%);
|
|
12453
|
+
`,
|
|
12454
|
+
pinkWithPop: import_styled_components86.css`
|
|
12455
|
+
background-color: #fffff0;
|
|
12456
|
+
background-image:
|
|
12457
|
+
radial-gradient(farthest-corner at top right, #e0128e, transparent 70%),
|
|
12458
|
+
radial-gradient(farthest-corner at top left, #ff40b3, transparent 65%),
|
|
12459
|
+
radial-gradient(farthest-corner at bottom right, #ff40b3, transparent 55%),
|
|
12460
|
+
radial-gradient(farthest-corner at bottom left, #2949e5, transparent 50%);
|
|
12461
|
+
`,
|
|
12462
|
+
playfulGradientOne: import_styled_components86.css`
|
|
12463
|
+
background-color: #f7f8ff;
|
|
12464
|
+
background-image:
|
|
12465
|
+
radial-gradient(farthest-corner at top left, #d65cff, transparent 68%),
|
|
12466
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 50%),
|
|
12467
|
+
radial-gradient(farthest-corner at bottom left, #ffc7e8, transparent 57%),
|
|
12468
|
+
radial-gradient(farthest-corner at top right, #ffcaba, transparent 70%);
|
|
12469
|
+
`,
|
|
12470
|
+
playfulGradientTwo: import_styled_components86.css`
|
|
12471
|
+
background-color: #f7f8ff;
|
|
12472
|
+
background-image:
|
|
12473
|
+
radial-gradient(farthest-corner at top left, #44b62d, transparent 68%),
|
|
12474
|
+
radial-gradient(farthest-corner at bottom right, #eff18d, transparent 50%),
|
|
12475
|
+
radial-gradient(farthest-corner at bottom left, #ccd5ff, transparent 57%),
|
|
12476
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 70%);
|
|
12477
|
+
`,
|
|
12478
|
+
purple: import_styled_components86.css`
|
|
12479
|
+
background-color: #f2caff;
|
|
12480
|
+
background-image:
|
|
12481
|
+
radial-gradient(ellipse at 0% 100%, #f9e5ff, transparent 50%),
|
|
12482
|
+
radial-gradient(ellipse at 100% 0%, #e093fa, transparent 70%);
|
|
12483
|
+
`,
|
|
12484
|
+
purpleWithPop: import_styled_components86.css`
|
|
12485
|
+
background-color: #f2caff;
|
|
12486
|
+
background-image:
|
|
12487
|
+
radial-gradient(farthest-corner at bottom left, #f2caff, transparent 50%),
|
|
12488
|
+
radial-gradient(farthest-corner at top left, #d65cff, transparent 65%),
|
|
12489
|
+
radial-gradient(farthest-corner at bottom right, #d65cff, transparent 55%),
|
|
12490
|
+
radial-gradient(farthest-corner at top right, #2949e5, transparent 70%);
|
|
12491
|
+
`,
|
|
12492
|
+
yellow: import_styled_components86.css`
|
|
12493
|
+
background-color: #fffff0;
|
|
12494
|
+
background-image:
|
|
12495
|
+
radial-gradient(farthest-corner at bottom left, #eff18d, transparent 50%),
|
|
12496
|
+
radial-gradient(farthest-corner at top right, #bcbf19, transparent 70%),
|
|
12497
|
+
radial-gradient(farthest-corner at top left, #e8ec1e, transparent 65%),
|
|
12498
|
+
radial-gradient(farthest-corner at bottom right, #e8ec1e, transparent 55%);
|
|
12499
|
+
`,
|
|
12500
|
+
yellowWithPop: import_styled_components86.css`
|
|
12501
|
+
background-color: #fffff0;
|
|
12502
|
+
background-image:
|
|
12503
|
+
radial-gradient(farthest-corner at bottom left, #eff18d, transparent 50%),
|
|
12504
|
+
radial-gradient(farthest-corner at top right, #bcbf19, transparent 70%),
|
|
12505
|
+
radial-gradient(farthest-corner at top left, #e8ec1e, transparent 65%),
|
|
12506
|
+
radial-gradient(farthest-corner at bottom right, #2949e5, transparent 55%);
|
|
12507
|
+
`
|
|
12508
|
+
};
|
|
12509
|
+
var gradientMap = Object.keys(gradients);
|
|
12510
|
+
var getBackgroundGradient = (gradientName = void 0) => {
|
|
12511
|
+
return (0, import_type_guards48.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
12512
|
+
};
|
|
12513
|
+
|
|
12514
|
+
// src/components/Thumbnail/Thumbnail.tsx
|
|
12515
|
+
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
12516
|
+
var WideThumbnailImage = import_styled_components87.default.img`
|
|
12517
|
+
height: 100%;
|
|
12518
|
+
object-fit: cover;
|
|
12519
|
+
width: 100%;
|
|
12520
|
+
`;
|
|
12521
|
+
var SquareThumbnailImage = import_styled_components87.default.img`
|
|
12522
|
+
backdrop-filter: blur(8px);
|
|
12523
|
+
object-fit: contain;
|
|
12524
|
+
width: 100%;
|
|
12525
|
+
`;
|
|
12526
|
+
var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
12527
|
+
if (thumbnailImageType === "wide") {
|
|
12528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime269.jsx)(
|
|
12529
|
+
WideThumbnailImage,
|
|
12530
|
+
{
|
|
12531
|
+
alt: "",
|
|
12532
|
+
src: thumbnailUrl
|
|
12533
|
+
}
|
|
12534
|
+
);
|
|
12535
|
+
}
|
|
12536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime269.jsx)(
|
|
12537
|
+
SquareThumbnailImage,
|
|
12538
|
+
{
|
|
12539
|
+
alt: "",
|
|
12540
|
+
src: thumbnailUrl
|
|
12541
|
+
}
|
|
12542
|
+
);
|
|
12543
|
+
};
|
|
12544
|
+
var StyledThumbnail = import_styled_components87.default.div`
|
|
12545
|
+
${({ $gradientBackground }) => getBackgroundGradient($gradientBackground)};
|
|
12546
|
+
aspect-ratio: 16 / 9;
|
|
12547
|
+
background: ${({ $backgroundUrl }) => (0, import_type_guards49.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}') center / cover` : void 0};
|
|
12548
|
+
border-radius: 4px;
|
|
12549
|
+
display: flex;
|
|
12550
|
+
overflow: hidden;
|
|
12551
|
+
position: relative;
|
|
12552
|
+
width: ${({ $width }) => $width};
|
|
12553
|
+
`;
|
|
12554
|
+
var Thumbnail = (0, import_react66.forwardRef)(
|
|
12555
|
+
({
|
|
12556
|
+
gradientBackground = "defaultMidOne",
|
|
12557
|
+
thumbnailImageType = "square",
|
|
12558
|
+
thumbnailUrl,
|
|
12559
|
+
width = "100%",
|
|
12560
|
+
children,
|
|
12561
|
+
...otherProps
|
|
12562
|
+
}, ref) => {
|
|
12563
|
+
const backgroundUrl = thumbnailImageType === "square" && (0, import_type_guards49.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0;
|
|
12564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(
|
|
12565
|
+
StyledThumbnail,
|
|
12566
|
+
{
|
|
12567
|
+
ref,
|
|
12568
|
+
$backgroundUrl: backgroundUrl,
|
|
12569
|
+
$gradientBackground: gradientBackground,
|
|
12570
|
+
$width: width,
|
|
12571
|
+
...otherProps,
|
|
12572
|
+
children: [
|
|
12573
|
+
(0, import_type_guards49.isNotNil)(children) && children,
|
|
12574
|
+
(0, import_type_guards49.isNotNil)(thumbnailUrl) && /* @__PURE__ */ (0, import_jsx_runtime269.jsx)(
|
|
12575
|
+
ThumbnailImage,
|
|
12576
|
+
{
|
|
12577
|
+
thumbnailImageType,
|
|
12578
|
+
thumbnailUrl
|
|
12579
|
+
}
|
|
12580
|
+
)
|
|
12581
|
+
]
|
|
12582
|
+
}
|
|
12583
|
+
);
|
|
12584
|
+
}
|
|
12585
|
+
);
|
|
12586
|
+
Thumbnail.displayName = "Thumbnail";
|
|
12587
|
+
|
|
12588
|
+
// src/components/Thumbnail/ThumbnailOverlay.tsx
|
|
12589
|
+
var import_styled_components88 = __toESM(require("styled-components"));
|
|
12590
|
+
var import_type_guards50 = require("@wistia/type-guards");
|
|
12591
|
+
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
12592
|
+
var StyledThumbnailOverlay = import_styled_components88.default.div`
|
|
12593
|
+
align-items: center;
|
|
12594
|
+
background-color: rgb(0 0 0 / 50%);
|
|
12595
|
+
border-radius: var(--wui-border-radius-01);
|
|
12596
|
+
bottom: var(--wui-space-01);
|
|
12597
|
+
color: var(--wui-color-text-on-fill);
|
|
12598
|
+
display: flex;
|
|
12599
|
+
font-size: var(--wui-typography-body-4-size);
|
|
12600
|
+
font-weight: var(--wui-typography-weight-body-bold);
|
|
12601
|
+
gap: var(--wui-space-01);
|
|
12602
|
+
padding: 0 var(--wui-space-01);
|
|
12603
|
+
position: absolute;
|
|
12604
|
+
right: var(--wui-space-01);
|
|
12605
|
+
z-index: 1;
|
|
12606
|
+
|
|
12607
|
+
svg {
|
|
12608
|
+
height: 12px;
|
|
12609
|
+
width: 12px;
|
|
12610
|
+
|
|
12611
|
+
path {
|
|
12612
|
+
color: var(--wui-color-icon-on-fill);
|
|
12613
|
+
}
|
|
12614
|
+
}
|
|
12615
|
+
`;
|
|
12616
|
+
var ThumbnailOverlay = ({
|
|
12617
|
+
icon,
|
|
12618
|
+
label,
|
|
12619
|
+
...otherProps
|
|
12620
|
+
}) => {
|
|
12621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(StyledThumbnailOverlay, { ...otherProps, children: [
|
|
12622
|
+
(0, import_type_guards50.isNotNil)(icon) && icon,
|
|
12623
|
+
/* @__PURE__ */ (0, import_jsx_runtime270.jsx)("span", { children: label })
|
|
12624
|
+
] });
|
|
12625
|
+
};
|
|
12626
|
+
ThumbnailOverlay.displayName = "ThumbnailOverlay";
|
|
12141
12627
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12142
12628
|
0 && (module.exports = {
|
|
12143
12629
|
ActionButton,
|
|
@@ -12211,6 +12697,8 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
12211
12697
|
Tabs,
|
|
12212
12698
|
Tag,
|
|
12213
12699
|
Text,
|
|
12700
|
+
Thumbnail,
|
|
12701
|
+
ThumbnailOverlay,
|
|
12214
12702
|
Tooltip,
|
|
12215
12703
|
UIProvider,
|
|
12216
12704
|
WistiaLogo,
|
|
@@ -12226,6 +12714,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
12226
12714
|
useAriaLive,
|
|
12227
12715
|
useBoolean,
|
|
12228
12716
|
useFilePicker,
|
|
12717
|
+
useFocusTrap,
|
|
12229
12718
|
useFormState,
|
|
12230
12719
|
useImperativeFilePicker,
|
|
12231
12720
|
useKey,
|