@wistia/ui 0.6.33 → 0.6.34-beta.51fa53c3.a37ade7
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 +1048 -746
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +78 -8
- package/dist/index.d.ts +78 -8
- package/dist/index.mjs +830 -530
- 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.34-beta.51fa53c3.a37ade7
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -48,6 +48,7 @@ __export(index_exports, {
|
|
|
48
48
|
Button: () => Button,
|
|
49
49
|
ButtonGroup: () => ButtonGroup,
|
|
50
50
|
Card: () => Card,
|
|
51
|
+
Center: () => Center,
|
|
51
52
|
Checkbox: () => Checkbox,
|
|
52
53
|
CheckboxGroup: () => CheckboxGroup,
|
|
53
54
|
CheckboxMenuItem: () => CheckboxMenuItem,
|
|
@@ -123,6 +124,7 @@ __export(index_exports, {
|
|
|
123
124
|
useAriaLive: () => useAriaLive,
|
|
124
125
|
useBoolean: () => useBoolean,
|
|
125
126
|
useFilePicker: () => import_use_file_picker.useFilePicker,
|
|
127
|
+
useFocusTrap: () => useFocusTrap,
|
|
126
128
|
useFormState: () => useFormState,
|
|
127
129
|
useImperativeFilePicker: () => import_use_file_picker.useImperativeFilePicker,
|
|
128
130
|
useKey: () => useKey,
|
|
@@ -2535,14 +2537,246 @@ var useToast = () => {
|
|
|
2535
2537
|
);
|
|
2536
2538
|
};
|
|
2537
2539
|
|
|
2540
|
+
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2541
|
+
var import_react11 = require("react");
|
|
2542
|
+
var import_type_guards10 = require("@wistia/type-guards");
|
|
2543
|
+
|
|
2544
|
+
// src/hooks/useFocusTrap/helpers.ts
|
|
2545
|
+
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]';
|
|
2546
|
+
var coerceToString = (value) => value === null || value === void 0 ? "" : String(value);
|
|
2547
|
+
var isHiddenElement = (element) => {
|
|
2548
|
+
const { display, visibility } = window.getComputedStyle(element);
|
|
2549
|
+
const isHidden = display === "none" || element.style.display === "none" || visibility === "none" || element.style.visibility === "hidden";
|
|
2550
|
+
return element.offsetWidth <= 0 && element.offsetHeight <= 0 || isHidden;
|
|
2551
|
+
};
|
|
2552
|
+
var isVisibleElement = (element) => {
|
|
2553
|
+
let parentElement = element;
|
|
2554
|
+
while (parentElement) {
|
|
2555
|
+
if (parentElement === document.body) {
|
|
2556
|
+
break;
|
|
2557
|
+
}
|
|
2558
|
+
if (isHiddenElement(parentElement)) {
|
|
2559
|
+
return false;
|
|
2560
|
+
}
|
|
2561
|
+
parentElement = parentElement.parentNode;
|
|
2562
|
+
}
|
|
2563
|
+
return true;
|
|
2564
|
+
};
|
|
2565
|
+
var getElementTabIndex = (element) => {
|
|
2566
|
+
const tabIndex = element.getAttribute("tabindex");
|
|
2567
|
+
return Number.parseInt(tabIndex ?? void 0, 10);
|
|
2568
|
+
};
|
|
2569
|
+
var isTabIndexNaN = (element) => {
|
|
2570
|
+
const tabIndex = getElementTabIndex(element);
|
|
2571
|
+
return Number.isNaN(tabIndex);
|
|
2572
|
+
};
|
|
2573
|
+
var isFocusableElement = (element) => {
|
|
2574
|
+
const tabbableNodeRegEx = /input|select|textarea|button|object/;
|
|
2575
|
+
const nodeName = element.nodeName.toLowerCase();
|
|
2576
|
+
const isTabIndexNotNaN = !isTabIndexNaN(element);
|
|
2577
|
+
const isFocusable = (
|
|
2578
|
+
// @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.
|
|
2579
|
+
tabbableNodeRegEx.test(nodeName) && !element.disabled || (element instanceof HTMLAnchorElement ? element.href || isTabIndexNotNaN : isTabIndexNotNaN)
|
|
2580
|
+
);
|
|
2581
|
+
return Boolean(isFocusable) && isVisibleElement(element);
|
|
2582
|
+
};
|
|
2583
|
+
var isTabbableElement = (element) => {
|
|
2584
|
+
const tabIndex = getElementTabIndex(element);
|
|
2585
|
+
return (isTabIndexNaN(element) || tabIndex >= 0) && isFocusableElement(element);
|
|
2586
|
+
};
|
|
2587
|
+
var findTabbableDescendants = (element) => Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter(
|
|
2588
|
+
isTabbableElement
|
|
2589
|
+
);
|
|
2590
|
+
var focusLaterElements = [];
|
|
2591
|
+
var focusElement = null;
|
|
2592
|
+
var needToFocus = false;
|
|
2593
|
+
var handleBlur = () => {
|
|
2594
|
+
needToFocus = true;
|
|
2595
|
+
};
|
|
2596
|
+
var handleFocus = () => {
|
|
2597
|
+
if (needToFocus) {
|
|
2598
|
+
needToFocus = false;
|
|
2599
|
+
if (!focusElement) {
|
|
2600
|
+
return;
|
|
2601
|
+
}
|
|
2602
|
+
if (focusElement.contains(document.activeElement)) {
|
|
2603
|
+
return;
|
|
2604
|
+
}
|
|
2605
|
+
const element = findTabbableDescendants(focusElement)[0] ?? focusElement;
|
|
2606
|
+
element.focus();
|
|
2607
|
+
}
|
|
2608
|
+
};
|
|
2609
|
+
var markForFocusLater = () => {
|
|
2610
|
+
const element = document.activeElement;
|
|
2611
|
+
if (element !== null) {
|
|
2612
|
+
focusLaterElements.push(element);
|
|
2613
|
+
}
|
|
2614
|
+
};
|
|
2615
|
+
var returnFocus = () => {
|
|
2616
|
+
let toFocus = null;
|
|
2617
|
+
try {
|
|
2618
|
+
toFocus = focusLaterElements.pop();
|
|
2619
|
+
if (toFocus) {
|
|
2620
|
+
toFocus.focus();
|
|
2621
|
+
}
|
|
2622
|
+
} catch {
|
|
2623
|
+
console.warn(
|
|
2624
|
+
`You tried to return focus to ${coerceToString(toFocus)} but it is not in the DOM anymore`
|
|
2625
|
+
);
|
|
2626
|
+
}
|
|
2627
|
+
};
|
|
2628
|
+
var setupScopedFocus = (element) => {
|
|
2629
|
+
focusElement = element;
|
|
2630
|
+
document.addEventListener("focusout", handleBlur, false);
|
|
2631
|
+
document.addEventListener("focusin", handleFocus, true);
|
|
2632
|
+
};
|
|
2633
|
+
var teardownScopedFocus = () => {
|
|
2634
|
+
focusElement = null;
|
|
2635
|
+
document.removeEventListener("focusout", handleBlur);
|
|
2636
|
+
document.removeEventListener("focusin", handleFocus);
|
|
2637
|
+
};
|
|
2638
|
+
var scopeTab = (node, event) => {
|
|
2639
|
+
const tabbable = findTabbableDescendants(node);
|
|
2640
|
+
if (!tabbable.length) {
|
|
2641
|
+
event.preventDefault();
|
|
2642
|
+
return;
|
|
2643
|
+
}
|
|
2644
|
+
const finalTabbable = tabbable[event.shiftKey ? 0 : tabbable.length - 1];
|
|
2645
|
+
const leavingFinalTabbable = finalTabbable === document.activeElement || node === document.activeElement;
|
|
2646
|
+
if (!leavingFinalTabbable) {
|
|
2647
|
+
return;
|
|
2648
|
+
}
|
|
2649
|
+
event.preventDefault();
|
|
2650
|
+
const target = tabbable[event.shiftKey ? tabbable.length - 1 : 0];
|
|
2651
|
+
if (target) {
|
|
2652
|
+
target.focus();
|
|
2653
|
+
}
|
|
2654
|
+
};
|
|
2655
|
+
var createAriaHider = (containerNode, selector) => {
|
|
2656
|
+
if (selector === void 0) {
|
|
2657
|
+
selector = "body > :not(script)";
|
|
2658
|
+
}
|
|
2659
|
+
const rootNodes = Array.from(document.querySelectorAll(selector)).map((node) => {
|
|
2660
|
+
if (node.contains(containerNode)) {
|
|
2661
|
+
return void 0;
|
|
2662
|
+
}
|
|
2663
|
+
const ariaHidden = node.getAttribute("aria-hidden");
|
|
2664
|
+
if (ariaHidden === null || ariaHidden === "false") {
|
|
2665
|
+
node.setAttribute("aria-hidden", "true");
|
|
2666
|
+
}
|
|
2667
|
+
return {
|
|
2668
|
+
node,
|
|
2669
|
+
ariaHidden
|
|
2670
|
+
};
|
|
2671
|
+
});
|
|
2672
|
+
return () => {
|
|
2673
|
+
rootNodes.forEach((item) => {
|
|
2674
|
+
if (!item) {
|
|
2675
|
+
return;
|
|
2676
|
+
}
|
|
2677
|
+
if (item.ariaHidden === null) {
|
|
2678
|
+
item.node.removeAttribute("aria-hidden");
|
|
2679
|
+
} else {
|
|
2680
|
+
item.node.setAttribute("aria-hidden", item.ariaHidden);
|
|
2681
|
+
}
|
|
2682
|
+
});
|
|
2683
|
+
};
|
|
2684
|
+
};
|
|
2685
|
+
|
|
2686
|
+
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2687
|
+
var isRef = (val) => {
|
|
2688
|
+
return val !== null && typeof val === "object" && "current" in val;
|
|
2689
|
+
};
|
|
2690
|
+
var useFocusTrap = (active = true, options = {}) => {
|
|
2691
|
+
const ref = (0, import_react11.useRef)(null);
|
|
2692
|
+
const restoreAriaRef = (0, import_react11.useRef)(null);
|
|
2693
|
+
const setRef = (0, import_react11.useCallback)(
|
|
2694
|
+
(node) => {
|
|
2695
|
+
if (restoreAriaRef.current !== null) {
|
|
2696
|
+
restoreAriaRef.current();
|
|
2697
|
+
}
|
|
2698
|
+
if (ref.current) {
|
|
2699
|
+
returnFocus();
|
|
2700
|
+
teardownScopedFocus();
|
|
2701
|
+
}
|
|
2702
|
+
if (active && node !== null && node !== void 0) {
|
|
2703
|
+
setupScopedFocus(node);
|
|
2704
|
+
markForFocusLater();
|
|
2705
|
+
const processNode = (node2) => {
|
|
2706
|
+
restoreAriaRef.current = !(options.disableAriaHider ?? false) ? createAriaHider(node2) : null;
|
|
2707
|
+
let focusElement2 = null;
|
|
2708
|
+
if ((0, import_type_guards10.isNotUndefined)(options.focusSelector)) {
|
|
2709
|
+
if (isRef(options.focusSelector)) {
|
|
2710
|
+
focusElement2 = options.focusSelector.current;
|
|
2711
|
+
} else {
|
|
2712
|
+
focusElement2 = typeof options.focusSelector === "string" ? node2.querySelector(options.focusSelector) : options.focusSelector;
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
if (!focusElement2) {
|
|
2716
|
+
const children = Array.from(
|
|
2717
|
+
node2.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)
|
|
2718
|
+
);
|
|
2719
|
+
focusElement2 = // Prefer tabbable elements, But fallback to any focusable element
|
|
2720
|
+
children.find(isTabbableElement) ?? // But fallback to any focusable element
|
|
2721
|
+
children.find(isFocusableElement) ?? // Nothing found
|
|
2722
|
+
null;
|
|
2723
|
+
if (!focusElement2 && isFocusableElement(node2)) {
|
|
2724
|
+
focusElement2 = node2;
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
if (focusElement2) {
|
|
2728
|
+
focusElement2.focus();
|
|
2729
|
+
}
|
|
2730
|
+
if (!focusElement2 && process.env["NODE_ENV"] === "development") {
|
|
2731
|
+
console.warn(
|
|
2732
|
+
'[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.',
|
|
2733
|
+
node2
|
|
2734
|
+
);
|
|
2735
|
+
}
|
|
2736
|
+
};
|
|
2737
|
+
setTimeout(() => {
|
|
2738
|
+
if (node.ownerDocument) {
|
|
2739
|
+
processNode(node);
|
|
2740
|
+
}
|
|
2741
|
+
if (!node.ownerDocument && process.env["NODE_ENV"] === "development") {
|
|
2742
|
+
console.warn(
|
|
2743
|
+
"[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.",
|
|
2744
|
+
node
|
|
2745
|
+
);
|
|
2746
|
+
}
|
|
2747
|
+
});
|
|
2748
|
+
ref.current = node;
|
|
2749
|
+
} else {
|
|
2750
|
+
ref.current = null;
|
|
2751
|
+
}
|
|
2752
|
+
},
|
|
2753
|
+
[active, options.focusSelector, options.disableAriaHider]
|
|
2754
|
+
);
|
|
2755
|
+
(0, import_react11.useEffect)(() => {
|
|
2756
|
+
if (!active) {
|
|
2757
|
+
return void 0;
|
|
2758
|
+
}
|
|
2759
|
+
const handleKeyDown = (event) => {
|
|
2760
|
+
if (event.key === "Tab" && ref.current) {
|
|
2761
|
+
scopeTab(ref.current, event);
|
|
2762
|
+
}
|
|
2763
|
+
};
|
|
2764
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
2765
|
+
return () => {
|
|
2766
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
2767
|
+
};
|
|
2768
|
+
}, [active]);
|
|
2769
|
+
return setRef;
|
|
2770
|
+
};
|
|
2771
|
+
|
|
2538
2772
|
// src/components/ActionButton/ActionButton.tsx
|
|
2539
|
-
var
|
|
2773
|
+
var import_react15 = require("react");
|
|
2540
2774
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
2541
2775
|
|
|
2542
2776
|
// src/components/Button/Button.tsx
|
|
2543
|
-
var
|
|
2777
|
+
var import_react14 = require("react");
|
|
2544
2778
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
2545
|
-
var
|
|
2779
|
+
var import_type_guards14 = require("@wistia/type-guards");
|
|
2546
2780
|
|
|
2547
2781
|
// src/css/buttonResetCss.tsx
|
|
2548
2782
|
var import_styled_components16 = require("styled-components");
|
|
@@ -2746,7 +2980,7 @@ var buttonSizeStyles = {
|
|
|
2746
2980
|
};
|
|
2747
2981
|
|
|
2748
2982
|
// src/components/Icon/Icon.tsx
|
|
2749
|
-
var
|
|
2983
|
+
var import_type_guards12 = require("@wistia/type-guards");
|
|
2750
2984
|
var import_styled_components18 = __toESM(require("styled-components"));
|
|
2751
2985
|
|
|
2752
2986
|
// src/components/Icon/icons/AbTestIcon.tsx
|
|
@@ -6601,17 +6835,17 @@ var iconMap = {
|
|
|
6601
6835
|
};
|
|
6602
6836
|
|
|
6603
6837
|
// src/private/hooks/useResponsiveProp/useResponsiveProp.ts
|
|
6604
|
-
var
|
|
6605
|
-
var
|
|
6838
|
+
var import_type_guards11 = require("@wistia/type-guards");
|
|
6839
|
+
var import_react12 = require("react");
|
|
6606
6840
|
var isResponsiveObject = (values) => {
|
|
6607
6841
|
return typeof values === "object" && values !== null && !Array.isArray(values) && "base" in values;
|
|
6608
6842
|
};
|
|
6609
6843
|
var useResponsiveProp = (values) => {
|
|
6610
6844
|
const activeMediaQueries = useActiveMq();
|
|
6611
|
-
return (0,
|
|
6612
|
-
if ((0,
|
|
6845
|
+
return (0, import_react12.useMemo)(() => {
|
|
6846
|
+
if ((0, import_type_guards11.isRecord)(values) && isResponsiveObject(values)) {
|
|
6613
6847
|
const mq2 = activeMediaQueries.find((key) => key in values);
|
|
6614
|
-
return (0,
|
|
6848
|
+
return (0, import_type_guards11.isNotUndefined)(mq2) && (0, import_type_guards11.isNotUndefined)(values[mq2]) ? values[mq2] : values.base;
|
|
6615
6849
|
}
|
|
6616
6850
|
return values;
|
|
6617
6851
|
}, [activeMediaQueries, values]);
|
|
@@ -6638,13 +6872,13 @@ var Icon = ({
|
|
|
6638
6872
|
...otherProps
|
|
6639
6873
|
}) => {
|
|
6640
6874
|
const responsiveSize = useResponsiveProp(size);
|
|
6641
|
-
if ((0,
|
|
6875
|
+
if ((0, import_type_guards12.isNil)(type)) {
|
|
6642
6876
|
throw new Error("An Icon component requires a `type` prop to be provided");
|
|
6643
6877
|
}
|
|
6644
|
-
if ((0,
|
|
6878
|
+
if ((0, import_type_guards12.isNil)(iconMap[type])) {
|
|
6645
6879
|
throw new Error(`Type "${type}" does not exist, please update type prop in Icon component.`);
|
|
6646
6880
|
}
|
|
6647
|
-
if ((0,
|
|
6881
|
+
if ((0, import_type_guards12.isNil)(iconSizeMap[responsiveSize])) {
|
|
6648
6882
|
throw new Error(
|
|
6649
6883
|
`Size "${responsiveSize}" does not exist, please update size prop in Icon component.`
|
|
6650
6884
|
);
|
|
@@ -6675,13 +6909,13 @@ var Icon = ({
|
|
|
6675
6909
|
Icon.displayName = "Icon";
|
|
6676
6910
|
|
|
6677
6911
|
// src/components/Link/Link.tsx
|
|
6678
|
-
var
|
|
6679
|
-
var
|
|
6912
|
+
var import_react13 = require("react");
|
|
6913
|
+
var import_type_guards13 = require("@wistia/type-guards");
|
|
6680
6914
|
var import_styled_components19 = __toESM(require("styled-components"));
|
|
6681
6915
|
var import_react_router_dom = require("react-router-dom");
|
|
6682
6916
|
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
6683
6917
|
var generateHref = (href, type, disabled) => {
|
|
6684
|
-
if (disabled || (0,
|
|
6918
|
+
if (disabled || (0, import_type_guards13.isNil)(href)) {
|
|
6685
6919
|
return void 0;
|
|
6686
6920
|
}
|
|
6687
6921
|
let to = href;
|
|
@@ -6693,12 +6927,12 @@ var generateHref = (href, type, disabled) => {
|
|
|
6693
6927
|
}
|
|
6694
6928
|
return to;
|
|
6695
6929
|
};
|
|
6696
|
-
var isButton = (props) => (0,
|
|
6697
|
-
var isLink = (props) => (0,
|
|
6930
|
+
var isButton = (props) => (0, import_type_guards13.isUndefined)(props.href);
|
|
6931
|
+
var isLink = (props) => (0, import_type_guards13.isNotUndefined)(props.href);
|
|
6698
6932
|
var StyledLink = import_styled_components19.default.a`
|
|
6699
6933
|
--link-icon-size: 14px;
|
|
6700
6934
|
|
|
6701
|
-
${({ href }) => (0,
|
|
6935
|
+
${({ href }) => (0, import_type_guards13.isNil)(href) && buttonResetCss};
|
|
6702
6936
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
6703
6937
|
cursor: pointer;
|
|
6704
6938
|
font-family: var(--wui-typography-family-default);
|
|
@@ -6715,7 +6949,7 @@ var StyledLink = import_styled_components19.default.a`
|
|
|
6715
6949
|
}
|
|
6716
6950
|
}
|
|
6717
6951
|
`;
|
|
6718
|
-
var Link = (0,
|
|
6952
|
+
var Link = (0, import_react13.forwardRef)(
|
|
6719
6953
|
({
|
|
6720
6954
|
beforeAction,
|
|
6721
6955
|
children,
|
|
@@ -6739,16 +6973,16 @@ var Link = (0, import_react12.forwardRef)(
|
|
|
6739
6973
|
} catch (error) {
|
|
6740
6974
|
console.error(error);
|
|
6741
6975
|
} finally {
|
|
6742
|
-
if ((0,
|
|
6976
|
+
if ((0, import_type_guards13.isFunction)(props.onClick)) {
|
|
6743
6977
|
props.onClick(event);
|
|
6744
6978
|
} else if (routingCallback !== null) {
|
|
6745
6979
|
routingCallback();
|
|
6746
|
-
} else if ((0,
|
|
6980
|
+
} else if ((0, import_type_guards13.isNotNil)(to)) {
|
|
6747
6981
|
window.location.assign(to);
|
|
6748
6982
|
} else {
|
|
6749
6983
|
}
|
|
6750
6984
|
}
|
|
6751
|
-
} else if ((0,
|
|
6985
|
+
} else if ((0, import_type_guards13.isFunction)(props.onClick)) {
|
|
6752
6986
|
props.onClick(event);
|
|
6753
6987
|
} else {
|
|
6754
6988
|
}
|
|
@@ -6809,7 +7043,7 @@ Link.displayName = "Link";
|
|
|
6809
7043
|
|
|
6810
7044
|
// src/components/Button/Button.tsx
|
|
6811
7045
|
var import_jsx_runtime193 = require("react/jsx-runtime");
|
|
6812
|
-
var isLink2 = (props) => (0,
|
|
7046
|
+
var isLink2 = (props) => (0, import_type_guards14.isNotUndefined)(props.href);
|
|
6813
7047
|
var StyledButton = import_styled_components20.default.button`
|
|
6814
7048
|
${buttonResetCss}
|
|
6815
7049
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
@@ -6849,8 +7083,8 @@ var ButtonContent = ({
|
|
|
6849
7083
|
/* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(
|
|
6850
7084
|
StyledButtonContent,
|
|
6851
7085
|
{
|
|
6852
|
-
$hasLeftIcon: (0,
|
|
6853
|
-
$hasRightIcon: (0,
|
|
7086
|
+
$hasLeftIcon: (0, import_type_guards14.isNotNil)(leftIcon),
|
|
7087
|
+
$hasRightIcon: (0, import_type_guards14.isNotNil)(rightIcon),
|
|
6854
7088
|
$isLoading: isLoading,
|
|
6855
7089
|
children: [
|
|
6856
7090
|
leftIcon ?? null,
|
|
@@ -6861,7 +7095,7 @@ var ButtonContent = ({
|
|
|
6861
7095
|
)
|
|
6862
7096
|
] });
|
|
6863
7097
|
};
|
|
6864
|
-
var Button = (0,
|
|
7098
|
+
var Button = (0, import_react14.forwardRef)(
|
|
6865
7099
|
({
|
|
6866
7100
|
children,
|
|
6867
7101
|
forceState,
|
|
@@ -6918,7 +7152,7 @@ var Button = (0, import_react13.forwardRef)(
|
|
|
6918
7152
|
event.preventDefault();
|
|
6919
7153
|
return;
|
|
6920
7154
|
}
|
|
6921
|
-
if ((0,
|
|
7155
|
+
if ((0, import_type_guards14.isNotNil)(onClick)) {
|
|
6922
7156
|
onClick(event);
|
|
6923
7157
|
}
|
|
6924
7158
|
};
|
|
@@ -7040,7 +7274,7 @@ var StyledLabel = import_styled_components21.default.span`
|
|
|
7040
7274
|
grid-row: 2;
|
|
7041
7275
|
text-align: left;
|
|
7042
7276
|
`;
|
|
7043
|
-
var ActionButton = (0,
|
|
7277
|
+
var ActionButton = (0, import_react15.forwardRef)(
|
|
7044
7278
|
({
|
|
7045
7279
|
icon,
|
|
7046
7280
|
colorScheme = "default",
|
|
@@ -7084,8 +7318,8 @@ var ActionButton = (0, import_react14.forwardRef)(
|
|
|
7084
7318
|
ActionButton.displayName = "ActionButton";
|
|
7085
7319
|
|
|
7086
7320
|
// src/components/Avatar/Avatar.tsx
|
|
7087
|
-
var
|
|
7088
|
-
var
|
|
7321
|
+
var import_react16 = require("react");
|
|
7322
|
+
var import_type_guards16 = require("@wistia/type-guards");
|
|
7089
7323
|
var import_styled_components23 = __toESM(require("styled-components"));
|
|
7090
7324
|
|
|
7091
7325
|
// src/components/ColorSchemeWrapper/ColorSchemeWrapper.tsx
|
|
@@ -7128,13 +7362,13 @@ var ColorSchemeWrapper = ({
|
|
|
7128
7362
|
ColorSchemeWrapper.displayName = "ColorSchemeWrapper";
|
|
7129
7363
|
|
|
7130
7364
|
// src/components/Avatar/formatNameForDisplay.tsx
|
|
7131
|
-
var
|
|
7365
|
+
var import_type_guards15 = require("@wistia/type-guards");
|
|
7132
7366
|
var containsEmojiCharacter = (char) => {
|
|
7133
7367
|
const emojiRegex = /<a?:.+?:\d{18}>|\p{Extended_Pictographic}/gu;
|
|
7134
7368
|
return emojiRegex.test(char);
|
|
7135
7369
|
};
|
|
7136
7370
|
var formatNameForDisplay = (name) => {
|
|
7137
|
-
if ((0,
|
|
7371
|
+
if ((0, import_type_guards15.isNil)(name) || !(0, import_type_guards15.isString)(name) || (0, import_type_guards15.isEmptyString)(name) || containsEmojiCharacter(name)) {
|
|
7138
7372
|
return "U";
|
|
7139
7373
|
}
|
|
7140
7374
|
const firstChar = name.trim().substring(0, 1);
|
|
@@ -7197,7 +7431,7 @@ var AvatarWrapper = import_styled_components23.default.div`
|
|
|
7197
7431
|
max-height: ${({ $maxHeight }) => $maxHeight}px;
|
|
7198
7432
|
`;
|
|
7199
7433
|
var chooseColorScheme = (name) => {
|
|
7200
|
-
if ((0,
|
|
7434
|
+
if ((0, import_type_guards16.isNil)(name) || name === "Anonymous") {
|
|
7201
7435
|
return "default";
|
|
7202
7436
|
}
|
|
7203
7437
|
const filteredColors = colorSchemeOptions.filter(
|
|
@@ -7216,8 +7450,8 @@ var Avatar = ({
|
|
|
7216
7450
|
onImageLoad,
|
|
7217
7451
|
...otherProps
|
|
7218
7452
|
}) => {
|
|
7219
|
-
const [imageLoadState, setImageLoadState] = (0,
|
|
7220
|
-
(0,
|
|
7453
|
+
const [imageLoadState, setImageLoadState] = (0, import_react16.useState)("loading");
|
|
7454
|
+
(0, import_react16.useEffect)(() => {
|
|
7221
7455
|
setImageLoadState("loading");
|
|
7222
7456
|
}, [imageUrl]);
|
|
7223
7457
|
const handleImageLoad = () => {
|
|
@@ -7229,8 +7463,8 @@ var Avatar = ({
|
|
|
7229
7463
|
onImageLoad?.({ state: "error", type: "initials" });
|
|
7230
7464
|
};
|
|
7231
7465
|
const avatarSize = heightAndWidth ?? avatarSizeMap[size];
|
|
7232
|
-
const avatarColor = (0,
|
|
7233
|
-
const showInitials = (0,
|
|
7466
|
+
const avatarColor = (0, import_react16.useMemo)(() => chooseColorScheme(name), [name]);
|
|
7467
|
+
const showInitials = (0, import_type_guards16.isNil)(imageUrl) || imageLoadState === "error";
|
|
7234
7468
|
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
7235
7469
|
AvatarWrapper,
|
|
7236
7470
|
{
|
|
@@ -7259,9 +7493,9 @@ var Avatar = ({
|
|
|
7259
7493
|
Avatar.displayName = "Avatar";
|
|
7260
7494
|
|
|
7261
7495
|
// src/components/Badge/Badge.tsx
|
|
7262
|
-
var
|
|
7496
|
+
var import_react17 = require("react");
|
|
7263
7497
|
var import_styled_components24 = __toESM(require("styled-components"));
|
|
7264
|
-
var
|
|
7498
|
+
var import_type_guards17 = require("@wistia/type-guards");
|
|
7265
7499
|
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
7266
7500
|
var StyledBadge = import_styled_components24.default.div`
|
|
7267
7501
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -7283,9 +7517,9 @@ var StyledBadge = import_styled_components24.default.div`
|
|
|
7283
7517
|
width: 12px;
|
|
7284
7518
|
}
|
|
7285
7519
|
`;
|
|
7286
|
-
var Badge = (0,
|
|
7520
|
+
var Badge = (0, import_react17.forwardRef)(
|
|
7287
7521
|
({ colorScheme = "inherit", label, icon, ...otherProps }, ref) => {
|
|
7288
|
-
const hasIcon = (0,
|
|
7522
|
+
const hasIcon = (0, import_type_guards17.isNotNil)(icon);
|
|
7289
7523
|
return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
7290
7524
|
StyledBadge,
|
|
7291
7525
|
{
|
|
@@ -7304,9 +7538,9 @@ var Badge = (0, import_react16.forwardRef)(
|
|
|
7304
7538
|
Badge.displayName = "Badge";
|
|
7305
7539
|
|
|
7306
7540
|
// src/components/Box/Box.tsx
|
|
7307
|
-
var
|
|
7541
|
+
var import_react18 = require("react");
|
|
7308
7542
|
var import_styled_components25 = __toESM(require("styled-components"));
|
|
7309
|
-
var
|
|
7543
|
+
var import_type_guards18 = require("@wistia/type-guards");
|
|
7310
7544
|
|
|
7311
7545
|
// src/private/helpers/makePolymorphic/makePolymorphic.tsx
|
|
7312
7546
|
var makePolymorphic = (component) => {
|
|
@@ -7317,8 +7551,8 @@ var makePolymorphic = (component) => {
|
|
|
7317
7551
|
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
7318
7552
|
var isDev = process.env["NODE_ENV"] === "development" || process.env["NODE_ENV"] === "test";
|
|
7319
7553
|
var getGapStyle = (gap) => {
|
|
7320
|
-
if ((0,
|
|
7321
|
-
if ((0,
|
|
7554
|
+
if ((0, import_type_guards18.isNotNil)(gap)) {
|
|
7555
|
+
if ((0, import_type_guards18.isRecord)(gap)) {
|
|
7322
7556
|
return Object.entries(gap).map(([key, value]) => {
|
|
7323
7557
|
return `${key}-gap: var(--wui-${value})};`;
|
|
7324
7558
|
}).join("");
|
|
@@ -7357,36 +7591,69 @@ var getFillViewportStyle = (fillViewport) => {
|
|
|
7357
7591
|
}
|
|
7358
7592
|
return void 0;
|
|
7359
7593
|
};
|
|
7594
|
+
var getFlexStyle = (flexMode) => {
|
|
7595
|
+
if (!flexMode) return null;
|
|
7596
|
+
switch (flexMode) {
|
|
7597
|
+
// grows to fill space, won't shrink, starts at 0
|
|
7598
|
+
case "grow":
|
|
7599
|
+
return import_styled_components25.css`
|
|
7600
|
+
flex: 1 0 0;
|
|
7601
|
+
`;
|
|
7602
|
+
// default behavior, can shrink but won't grow
|
|
7603
|
+
case "initial":
|
|
7604
|
+
return import_styled_components25.css`
|
|
7605
|
+
flex: 0 1 auto;
|
|
7606
|
+
`;
|
|
7607
|
+
// equal distribution of space
|
|
7608
|
+
case "equal":
|
|
7609
|
+
return import_styled_components25.css`
|
|
7610
|
+
flex: 1;
|
|
7611
|
+
`;
|
|
7612
|
+
// won't grow or shrink
|
|
7613
|
+
case "rigid":
|
|
7614
|
+
return import_styled_components25.css`
|
|
7615
|
+
flex: 0 0 auto;
|
|
7616
|
+
`;
|
|
7617
|
+
// can grow and shrink from content size
|
|
7618
|
+
case "fluid":
|
|
7619
|
+
return import_styled_components25.css`
|
|
7620
|
+
flex: 1 1 auto;
|
|
7621
|
+
`;
|
|
7622
|
+
default:
|
|
7623
|
+
return null;
|
|
7624
|
+
}
|
|
7625
|
+
};
|
|
7360
7626
|
var StyledBoxComponent = import_styled_components25.default.div`
|
|
7361
7627
|
align-content: ${({ $alignContent }) => $alignContent};
|
|
7362
7628
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
7363
7629
|
align-self: ${({ $alignSelf }) => $alignSelf ?? null};
|
|
7364
|
-
display: ${({ $inline }) => (0,
|
|
7365
|
-
flex-basis: ${({ $basis }) => (0,
|
|
7630
|
+
display: ${({ $inline }) => (0, import_type_guards18.isNotNil)($inline) && $inline ? "inline-flex" : "flex"};
|
|
7631
|
+
flex-basis: ${({ $basis }) => (0, import_type_guards18.isNotNil)($basis) ? $basis : null};
|
|
7366
7632
|
flex-direction: ${({ $flexDirection }) => $flexDirection};
|
|
7367
7633
|
${({ $fillBox: fill }) => getFillStyle(fill)};
|
|
7368
7634
|
${({ $fillViewport }) => getFillViewportStyle($fillViewport)};
|
|
7635
|
+
${({ $flexMode }) => getFlexStyle($flexMode)};
|
|
7636
|
+
${({ $gap }) => getGapStyle($gap)};
|
|
7369
7637
|
height: ${({ $height }) => $height ?? null};
|
|
7370
7638
|
width: ${({ $width }) => $width ?? null};
|
|
7371
7639
|
|
|
7372
7640
|
/* Box children styles */
|
|
7373
|
-
flex-grow: ${({ $grow }) => (0,
|
|
7374
|
-
flex-shrink: ${({ $shrink }) => (0,
|
|
7641
|
+
flex-grow: ${({ $grow }) => (0, import_type_guards18.isNotNil)($grow) ? $grow : null};
|
|
7642
|
+
flex-shrink: ${({ $shrink }) => (0, import_type_guards18.isNotNil)($shrink) ? $shrink : null};
|
|
7375
7643
|
flex-wrap: ${({ $wrapItems }) => $wrapItems ? "wrap" : "nowrap"};
|
|
7376
|
-
${({ $gap }) => getGapStyle($gap)};
|
|
7377
7644
|
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
7378
|
-
order: ${({ $order }) => (0,
|
|
7645
|
+
order: ${({ $order }) => (0, import_type_guards18.isNotNil)($order) ? $order : null};
|
|
7379
7646
|
`;
|
|
7380
7647
|
var wrapChildren = (children) => {
|
|
7381
|
-
if ((0,
|
|
7648
|
+
if ((0, import_type_guards18.isNotNil)(children)) {
|
|
7382
7649
|
if (typeof children === "object" && isDev) {
|
|
7383
|
-
return
|
|
7384
|
-
if ((0,
|
|
7650
|
+
return import_react18.Children.map(children, (child) => {
|
|
7651
|
+
if ((0, import_type_guards18.isNil)(child)) return null;
|
|
7385
7652
|
const elementParams = {};
|
|
7386
7653
|
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
7387
7654
|
elementParams.hasBoxParent = true;
|
|
7388
7655
|
}
|
|
7389
|
-
return (0,
|
|
7656
|
+
return (0, import_react18.cloneElement)(child, elementParams);
|
|
7390
7657
|
});
|
|
7391
7658
|
}
|
|
7392
7659
|
return children;
|
|
@@ -7394,7 +7661,7 @@ var wrapChildren = (children) => {
|
|
|
7394
7661
|
return null;
|
|
7395
7662
|
};
|
|
7396
7663
|
var DEFAULT_ELEMENT = "div";
|
|
7397
|
-
var BoxComponent = (0,
|
|
7664
|
+
var BoxComponent = (0, import_react18.forwardRef)(
|
|
7398
7665
|
({
|
|
7399
7666
|
alignContent = "stretch",
|
|
7400
7667
|
alignItems = "flex-start",
|
|
@@ -7416,9 +7683,10 @@ var BoxComponent = (0, import_react17.forwardRef)(
|
|
|
7416
7683
|
shrink,
|
|
7417
7684
|
width,
|
|
7418
7685
|
wrapItems = false,
|
|
7686
|
+
flexMode,
|
|
7419
7687
|
...otherProps
|
|
7420
7688
|
}, ref) => {
|
|
7421
|
-
if ((0,
|
|
7689
|
+
if ((0, import_type_guards18.isNotUndefined)(height)) {
|
|
7422
7690
|
if (fill === true || fill === "vertical") {
|
|
7423
7691
|
throw new Error('Cannot use height prop with fill="vertical" or fill={true}');
|
|
7424
7692
|
}
|
|
@@ -7428,7 +7696,7 @@ var BoxComponent = (0, import_react17.forwardRef)(
|
|
|
7428
7696
|
);
|
|
7429
7697
|
}
|
|
7430
7698
|
}
|
|
7431
|
-
if ((0,
|
|
7699
|
+
if ((0, import_type_guards18.isNotUndefined)(width)) {
|
|
7432
7700
|
if (fill === true || fill === "horizontal") {
|
|
7433
7701
|
throw new Error('Cannot use width prop with fill="horizontal" or fill={true}');
|
|
7434
7702
|
}
|
|
@@ -7449,6 +7717,7 @@ var BoxComponent = (0, import_react17.forwardRef)(
|
|
|
7449
7717
|
$fillBox: fill,
|
|
7450
7718
|
$fillViewport: fillViewport,
|
|
7451
7719
|
$flexDirection: direction,
|
|
7720
|
+
$flexMode: flexMode,
|
|
7452
7721
|
$gap: gap,
|
|
7453
7722
|
$grow: grow,
|
|
7454
7723
|
$height: height,
|
|
@@ -7469,7 +7738,7 @@ BoxComponent.displayName = "Box";
|
|
|
7469
7738
|
var Box = makePolymorphic(BoxComponent);
|
|
7470
7739
|
|
|
7471
7740
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
7472
|
-
var
|
|
7741
|
+
var import_react19 = require("react");
|
|
7473
7742
|
var import_styled_components26 = __toESM(require("styled-components"));
|
|
7474
7743
|
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
7475
7744
|
var StyledBreadcrumbs = import_styled_components26.default.nav`
|
|
@@ -7485,7 +7754,7 @@ var StyledBreadcrumbs = import_styled_components26.default.nav`
|
|
|
7485
7754
|
var BUFFER_WIDTH = 10;
|
|
7486
7755
|
var Breadcrumbs = ({ children, ...props }) => {
|
|
7487
7756
|
const { isXsAndDown } = useMq();
|
|
7488
|
-
let crumbs =
|
|
7757
|
+
let crumbs = import_react19.Children.toArray(children);
|
|
7489
7758
|
if (isXsAndDown) {
|
|
7490
7759
|
crumbs = crumbs.slice(-1);
|
|
7491
7760
|
}
|
|
@@ -7552,7 +7821,7 @@ var Breadcrumb = ({ icon, href, children, ...props }) => {
|
|
|
7552
7821
|
|
|
7553
7822
|
// src/components/ButtonGroup/ButtonGroup.tsx
|
|
7554
7823
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
7555
|
-
var
|
|
7824
|
+
var import_type_guards19 = require("@wistia/type-guards");
|
|
7556
7825
|
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
7557
7826
|
var getAlignment = (align) => {
|
|
7558
7827
|
if (align === "center") {
|
|
@@ -7598,7 +7867,7 @@ var ButtonGroup = ({
|
|
|
7598
7867
|
collapseOnSmallScreens = true,
|
|
7599
7868
|
...otherProps
|
|
7600
7869
|
}) => {
|
|
7601
|
-
if ((0,
|
|
7870
|
+
if ((0, import_type_guards19.isNil)(children)) {
|
|
7602
7871
|
return null;
|
|
7603
7872
|
}
|
|
7604
7873
|
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
@@ -7671,23 +7940,54 @@ var Card = ({
|
|
|
7671
7940
|
);
|
|
7672
7941
|
Card.displayName = "Card";
|
|
7673
7942
|
|
|
7943
|
+
// src/components/Center/Center.tsx
|
|
7944
|
+
var import_react20 = require("react");
|
|
7945
|
+
var import_styled_components30 = __toESM(require("styled-components"));
|
|
7946
|
+
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
7947
|
+
var StyledCenter = import_styled_components30.default.div`
|
|
7948
|
+
box-sizing: border-box;
|
|
7949
|
+
margin-left: auto;
|
|
7950
|
+
margin-right: auto;
|
|
7951
|
+
max-width: ${({ $maxWidth }) => $maxWidth};
|
|
7952
|
+
${({ $gutterWidth }) => $gutterWidth && `padding: 0 var(--wui-${$gutterWidth.toString()});`}
|
|
7953
|
+
${({ $intrinsic }) => $intrinsic && `
|
|
7954
|
+
display: flex;
|
|
7955
|
+
flex-direction: column;
|
|
7956
|
+
align-items: center;
|
|
7957
|
+
`}
|
|
7958
|
+
`;
|
|
7959
|
+
var Center = (0, import_react20.forwardRef)(
|
|
7960
|
+
({ maxWidth = "100%", gutterWidth = "space-00", intrinsic = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
7961
|
+
StyledCenter,
|
|
7962
|
+
{
|
|
7963
|
+
ref,
|
|
7964
|
+
$gutterWidth: gutterWidth,
|
|
7965
|
+
$intrinsic: intrinsic,
|
|
7966
|
+
$maxWidth: maxWidth,
|
|
7967
|
+
...props,
|
|
7968
|
+
children
|
|
7969
|
+
}
|
|
7970
|
+
)
|
|
7971
|
+
);
|
|
7972
|
+
Center.displayName = "Center";
|
|
7973
|
+
|
|
7674
7974
|
// src/components/Checkbox/Checkbox.tsx
|
|
7675
|
-
var
|
|
7676
|
-
var
|
|
7677
|
-
var
|
|
7975
|
+
var import_react21 = require("react");
|
|
7976
|
+
var import_styled_components34 = __toESM(require("styled-components"));
|
|
7977
|
+
var import_type_guards23 = require("@wistia/type-guards");
|
|
7678
7978
|
|
|
7679
7979
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
7680
|
-
var
|
|
7681
|
-
var
|
|
7980
|
+
var import_styled_components33 = __toESM(require("styled-components"));
|
|
7981
|
+
var import_type_guards22 = require("@wistia/type-guards");
|
|
7682
7982
|
|
|
7683
7983
|
// src/private/components/FormControlLabel/FormControlLabelDescription.tsx
|
|
7684
|
-
var
|
|
7685
|
-
var
|
|
7686
|
-
var
|
|
7687
|
-
var disabledStyle =
|
|
7984
|
+
var import_styled_components31 = __toESM(require("styled-components"));
|
|
7985
|
+
var import_type_guards20 = require("@wistia/type-guards");
|
|
7986
|
+
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
7987
|
+
var disabledStyle = import_styled_components31.css`
|
|
7688
7988
|
color: var(--wui-color-text-disabled);
|
|
7689
7989
|
`;
|
|
7690
|
-
var StyledFormControlLabelDescription =
|
|
7990
|
+
var StyledFormControlLabelDescription = import_styled_components31.default.div`
|
|
7691
7991
|
color: var(--wui-color-text-secondary);
|
|
7692
7992
|
display: block;
|
|
7693
7993
|
font-size: var(--wui-typography-body-4-size);
|
|
@@ -7702,10 +8002,10 @@ var FormControlLabelDescription = ({
|
|
|
7702
8002
|
disabled = false,
|
|
7703
8003
|
...props
|
|
7704
8004
|
}) => {
|
|
7705
|
-
if ((0,
|
|
8005
|
+
if ((0, import_type_guards20.isNil)(children)) {
|
|
7706
8006
|
return null;
|
|
7707
8007
|
}
|
|
7708
|
-
return /* @__PURE__ */ (0,
|
|
8008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
7709
8009
|
StyledFormControlLabelDescription,
|
|
7710
8010
|
{
|
|
7711
8011
|
...props,
|
|
@@ -7717,11 +8017,11 @@ var FormControlLabelDescription = ({
|
|
|
7717
8017
|
FormControlLabelDescription.displayName = "FormControlLabelDescription";
|
|
7718
8018
|
|
|
7719
8019
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
7720
|
-
var
|
|
7721
|
-
var
|
|
7722
|
-
var
|
|
7723
|
-
var VisuallyHidden =
|
|
7724
|
-
var VisuallyHiddenButFocusable =
|
|
8020
|
+
var import_styled_components32 = __toESM(require("styled-components"));
|
|
8021
|
+
var import_type_guards21 = require("@wistia/type-guards");
|
|
8022
|
+
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
8023
|
+
var VisuallyHidden = import_styled_components32.default.div({ ...visuallyHiddenStyle });
|
|
8024
|
+
var VisuallyHiddenButFocusable = import_styled_components32.default.div({
|
|
7725
8025
|
"&:not(:focus-within)": visuallyHiddenStyle
|
|
7726
8026
|
});
|
|
7727
8027
|
var ScreenReaderOnly = ({
|
|
@@ -7730,25 +8030,25 @@ var ScreenReaderOnly = ({
|
|
|
7730
8030
|
focusable = false,
|
|
7731
8031
|
...otherProps
|
|
7732
8032
|
}) => {
|
|
7733
|
-
const accessibleText = (0,
|
|
8033
|
+
const accessibleText = (0, import_type_guards21.isNotNil)(text) ? text : children;
|
|
7734
8034
|
if (focusable) {
|
|
7735
|
-
return /* @__PURE__ */ (0,
|
|
8035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(VisuallyHiddenButFocusable, { ...otherProps, children: accessibleText });
|
|
7736
8036
|
}
|
|
7737
|
-
return /* @__PURE__ */ (0,
|
|
8037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(VisuallyHidden, { ...otherProps, children: accessibleText });
|
|
7738
8038
|
};
|
|
7739
8039
|
ScreenReaderOnly.displayName = "ScreenReaderOnly";
|
|
7740
8040
|
|
|
7741
8041
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
7742
|
-
var
|
|
7743
|
-
var disabledStyle2 =
|
|
8042
|
+
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
8043
|
+
var disabledStyle2 = import_styled_components33.css`
|
|
7744
8044
|
cursor: not-allowed;
|
|
7745
8045
|
color: var(--wui-color-text-disabled);
|
|
7746
8046
|
`;
|
|
7747
|
-
var StyledLabelWrapper =
|
|
8047
|
+
var StyledLabelWrapper = import_styled_components33.default.div`
|
|
7748
8048
|
display: flex;
|
|
7749
8049
|
flex-direction: column;
|
|
7750
8050
|
`;
|
|
7751
|
-
var StyledFormControlLabel =
|
|
8051
|
+
var StyledFormControlLabel = import_styled_components33.default.label`
|
|
7752
8052
|
cursor: pointer;
|
|
7753
8053
|
display: flex;
|
|
7754
8054
|
align-items: center;
|
|
@@ -7770,21 +8070,21 @@ var FormControlLabel = ({
|
|
|
7770
8070
|
hideLabel = false,
|
|
7771
8071
|
...props
|
|
7772
8072
|
}) => {
|
|
7773
|
-
if ((0,
|
|
8073
|
+
if ((0, import_type_guards22.isNil)(label)) {
|
|
7774
8074
|
return null;
|
|
7775
8075
|
}
|
|
7776
|
-
const labelContent = hideLabel ? /* @__PURE__ */ (0,
|
|
8076
|
+
const labelContent = hideLabel ? /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(ScreenReaderOnly, { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(StyledLabelWrapper, { children: [
|
|
7777
8077
|
label,
|
|
7778
|
-
/* @__PURE__ */ (0,
|
|
8078
|
+
/* @__PURE__ */ (0, import_jsx_runtime206.jsx)(FormControlLabelDescription, { children: description })
|
|
7779
8079
|
] });
|
|
7780
|
-
return /* @__PURE__ */ (0,
|
|
8080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
|
|
7781
8081
|
StyledFormControlLabel,
|
|
7782
8082
|
{
|
|
7783
8083
|
$disabled: disabled,
|
|
7784
8084
|
htmlFor,
|
|
7785
8085
|
...props,
|
|
7786
8086
|
children: [
|
|
7787
|
-
(0,
|
|
8087
|
+
(0, import_type_guards22.isNotNil)(controlSlot) ? controlSlot : null,
|
|
7788
8088
|
labelContent
|
|
7789
8089
|
]
|
|
7790
8090
|
}
|
|
@@ -7793,8 +8093,8 @@ var FormControlLabel = ({
|
|
|
7793
8093
|
FormControlLabel.displayName = "FormControlLabel";
|
|
7794
8094
|
|
|
7795
8095
|
// src/components/Checkbox/Checkbox.tsx
|
|
7796
|
-
var
|
|
7797
|
-
var CheckIcon = () => /* @__PURE__ */ (0,
|
|
8096
|
+
var import_jsx_runtime207 = require("react/jsx-runtime");
|
|
8097
|
+
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
7798
8098
|
"svg",
|
|
7799
8099
|
{
|
|
7800
8100
|
fill: "inherit",
|
|
@@ -7802,7 +8102,7 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
|
7802
8102
|
viewBox: "0 0 10 8",
|
|
7803
8103
|
width: "10",
|
|
7804
8104
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7805
|
-
children: /* @__PURE__ */ (0,
|
|
8105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
7806
8106
|
"path",
|
|
7807
8107
|
{
|
|
7808
8108
|
d: "M3.47281 7.19303L0.377565 4.07999C0.191609 3.89297 0.191609 3.58973 0.377565 3.40268L1.05098 2.72537C1.23694 2.53833 1.53847 2.53833 1.72442 2.72537L3.80953 4.82245L8.27558 0.330729C8.46154 0.143704 8.76306 0.143704 8.94902 0.330729L9.62244 1.00804C9.8084 1.19506 9.8084 1.49831 9.62244 1.68535L4.14624 7.19305C3.96027 7.38008 3.65876 7.38008 3.47281 7.19303Z",
|
|
@@ -7811,7 +8111,7 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
|
7811
8111
|
)
|
|
7812
8112
|
}
|
|
7813
8113
|
);
|
|
7814
|
-
var sizeSmall =
|
|
8114
|
+
var sizeSmall = import_styled_components34.css`
|
|
7815
8115
|
width: 14px;
|
|
7816
8116
|
height: 14px;
|
|
7817
8117
|
min-width: 14px;
|
|
@@ -7822,7 +8122,7 @@ var sizeSmall = import_styled_components33.css`
|
|
|
7822
8122
|
height: 7px;
|
|
7823
8123
|
}
|
|
7824
8124
|
`;
|
|
7825
|
-
var sizeMedium =
|
|
8125
|
+
var sizeMedium = import_styled_components34.css`
|
|
7826
8126
|
width: 16px;
|
|
7827
8127
|
height: 16px;
|
|
7828
8128
|
min-width: 16px;
|
|
@@ -7833,7 +8133,7 @@ var sizeMedium = import_styled_components33.css`
|
|
|
7833
8133
|
height: 9px;
|
|
7834
8134
|
}
|
|
7835
8135
|
`;
|
|
7836
|
-
var sizeLarge =
|
|
8136
|
+
var sizeLarge = import_styled_components34.css`
|
|
7837
8137
|
width: 20px;
|
|
7838
8138
|
height: 20px;
|
|
7839
8139
|
min-width: 20px;
|
|
@@ -7849,14 +8149,14 @@ var getSizeCss = (size) => {
|
|
|
7849
8149
|
if (size === "lg") return sizeLarge;
|
|
7850
8150
|
return sizeMedium;
|
|
7851
8151
|
};
|
|
7852
|
-
var StyledCheckboxWrapper =
|
|
8152
|
+
var StyledCheckboxWrapper = import_styled_components34.default.div`
|
|
7853
8153
|
display: flex;
|
|
7854
8154
|
margin: 0;
|
|
7855
8155
|
|
|
7856
8156
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
7857
8157
|
user-select: none;
|
|
7858
8158
|
`;
|
|
7859
|
-
var StyledCheckboxInput =
|
|
8159
|
+
var StyledCheckboxInput = import_styled_components34.default.div`
|
|
7860
8160
|
${({ $size }) => getSizeCss($size)}
|
|
7861
8161
|
line-height: 0;
|
|
7862
8162
|
margin: 0;
|
|
@@ -7878,7 +8178,7 @@ var StyledCheckboxInput = import_styled_components33.default.div`
|
|
|
7878
8178
|
}
|
|
7879
8179
|
}
|
|
7880
8180
|
`;
|
|
7881
|
-
var StyledHiddenCheckboxInput =
|
|
8181
|
+
var StyledHiddenCheckboxInput = import_styled_components34.default.input`
|
|
7882
8182
|
${visuallyHiddenStyle}
|
|
7883
8183
|
|
|
7884
8184
|
/* toggles display of faux-input background-color */
|
|
@@ -7892,7 +8192,7 @@ var StyledHiddenCheckboxInput = import_styled_components33.default.input`
|
|
|
7892
8192
|
display: block;
|
|
7893
8193
|
}
|
|
7894
8194
|
`;
|
|
7895
|
-
var Checkbox = (0,
|
|
8195
|
+
var Checkbox = (0, import_react21.forwardRef)(
|
|
7896
8196
|
({
|
|
7897
8197
|
checked,
|
|
7898
8198
|
disabled = false,
|
|
@@ -7907,10 +8207,10 @@ var Checkbox = (0, import_react19.forwardRef)(
|
|
|
7907
8207
|
hideLabel = false,
|
|
7908
8208
|
...props
|
|
7909
8209
|
}, ref) => {
|
|
7910
|
-
const generatedId = (0,
|
|
7911
|
-
const computedId = (0,
|
|
7912
|
-
return /* @__PURE__ */ (0,
|
|
7913
|
-
/* @__PURE__ */ (0,
|
|
8210
|
+
const generatedId = (0, import_react21.useId)();
|
|
8211
|
+
const computedId = (0, import_type_guards23.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
8212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
8213
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
7914
8214
|
StyledHiddenCheckboxInput,
|
|
7915
8215
|
{
|
|
7916
8216
|
...props,
|
|
@@ -7925,16 +8225,16 @@ var Checkbox = (0, import_react19.forwardRef)(
|
|
|
7925
8225
|
value
|
|
7926
8226
|
}
|
|
7927
8227
|
),
|
|
7928
|
-
/* @__PURE__ */ (0,
|
|
8228
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
7929
8229
|
FormControlLabel,
|
|
7930
8230
|
{
|
|
7931
|
-
controlSlot: /* @__PURE__ */ (0,
|
|
8231
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
7932
8232
|
StyledCheckboxInput,
|
|
7933
8233
|
{
|
|
7934
8234
|
$disabled: disabled,
|
|
7935
8235
|
$size: size,
|
|
7936
8236
|
"data-wui-faux-input": "true",
|
|
7937
|
-
children: /* @__PURE__ */ (0,
|
|
8237
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(CheckIcon, {})
|
|
7938
8238
|
}
|
|
7939
8239
|
),
|
|
7940
8240
|
description,
|
|
@@ -7950,9 +8250,9 @@ var Checkbox = (0, import_react19.forwardRef)(
|
|
|
7950
8250
|
Checkbox.displayName = "Checkbox";
|
|
7951
8251
|
|
|
7952
8252
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
7953
|
-
var
|
|
8253
|
+
var import_react22 = require("react");
|
|
7954
8254
|
var ClickRegion = ({ children, targetRef }) => {
|
|
7955
|
-
(0,
|
|
8255
|
+
(0, import_react22.useEffect)(() => {
|
|
7956
8256
|
if (targetRef.current && targetRef.current.tagName === "A") {
|
|
7957
8257
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
7958
8258
|
} else if (targetRef.current && targetRef.current.tagName === "BUTTON") {
|
|
@@ -7960,7 +8260,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
7960
8260
|
} else {
|
|
7961
8261
|
}
|
|
7962
8262
|
}, [targetRef]);
|
|
7963
|
-
const handleClick = (0,
|
|
8263
|
+
const handleClick = (0, import_react22.useCallback)(
|
|
7964
8264
|
(event) => {
|
|
7965
8265
|
const node = targetRef.current;
|
|
7966
8266
|
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")) {
|
|
@@ -7977,7 +8277,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
7977
8277
|
},
|
|
7978
8278
|
[targetRef]
|
|
7979
8279
|
);
|
|
7980
|
-
return (0,
|
|
8280
|
+
return (0, import_react22.cloneElement)(import_react22.Children.only(children), {
|
|
7981
8281
|
"data-click-region": true,
|
|
7982
8282
|
onClick: handleClick
|
|
7983
8283
|
});
|
|
@@ -7986,10 +8286,10 @@ ClickRegion.displayName = "ClickRegion";
|
|
|
7986
8286
|
|
|
7987
8287
|
// src/components/Collapsible/Collapsible.tsx
|
|
7988
8288
|
var import_react_collapsible = require("@radix-ui/react-collapsible");
|
|
7989
|
-
var
|
|
7990
|
-
var
|
|
7991
|
-
var
|
|
7992
|
-
var StyledRoot = (0,
|
|
8289
|
+
var import_type_guards24 = require("@wistia/type-guards");
|
|
8290
|
+
var import_styled_components35 = __toESM(require("styled-components"));
|
|
8291
|
+
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
8292
|
+
var StyledRoot = (0, import_styled_components35.default)(import_react_collapsible.Root)`
|
|
7993
8293
|
&[data-state='closed'] [data-wui-collapsible-content] {
|
|
7994
8294
|
display: -webkit-box;
|
|
7995
8295
|
-webkit-box-orient: vertical;
|
|
@@ -8003,84 +8303,84 @@ var Collapsible = ({
|
|
|
8003
8303
|
onOpenChange
|
|
8004
8304
|
}) => {
|
|
8005
8305
|
const controlProps = {
|
|
8006
|
-
...(0,
|
|
8306
|
+
...(0, import_type_guards24.isNotNil)(onOpenChange) && (0, import_type_guards24.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
8007
8307
|
};
|
|
8008
|
-
return /* @__PURE__ */ (0,
|
|
8308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(StyledRoot, { ...controlProps, children });
|
|
8009
8309
|
};
|
|
8010
8310
|
Collapsible.displayName = "Collapsible";
|
|
8011
8311
|
|
|
8012
8312
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
8013
|
-
var
|
|
8313
|
+
var import_react23 = require("react");
|
|
8014
8314
|
var import_react_collapsible2 = require("@radix-ui/react-collapsible");
|
|
8015
|
-
var
|
|
8315
|
+
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
8016
8316
|
var CollapsibleTrigger = ({ children }) => {
|
|
8017
|
-
|
|
8018
|
-
return /* @__PURE__ */ (0,
|
|
8317
|
+
import_react23.Children.only(children);
|
|
8318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
|
|
8019
8319
|
};
|
|
8020
8320
|
|
|
8021
8321
|
// src/components/Collapsible/CollapsibleContent.tsx
|
|
8022
|
-
var
|
|
8322
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
8023
8323
|
var import_react_collapsible3 = require("@radix-ui/react-collapsible");
|
|
8024
|
-
var
|
|
8025
|
-
var
|
|
8026
|
-
var ClampedContent =
|
|
8324
|
+
var import_type_guards25 = require("@wistia/type-guards");
|
|
8325
|
+
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
8326
|
+
var ClampedContent = import_styled_components36.default.div.attrs({ "data-wui-collapsible-content": true })`
|
|
8027
8327
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
8028
8328
|
`;
|
|
8029
8329
|
var CollapsibleContent = ({ clamp, children }) => {
|
|
8030
|
-
if ((0,
|
|
8031
|
-
return /* @__PURE__ */ (0,
|
|
8330
|
+
if ((0, import_type_guards25.isNotUndefined)(clamp)) {
|
|
8331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(ClampedContent, { $clamp: clamp, children });
|
|
8032
8332
|
}
|
|
8033
|
-
return /* @__PURE__ */ (0,
|
|
8333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_collapsible3.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(import_jsx_runtime210.Fragment, { children: [
|
|
8034
8334
|
children,
|
|
8035
8335
|
" "
|
|
8036
8336
|
] }) });
|
|
8037
8337
|
};
|
|
8038
8338
|
|
|
8039
8339
|
// src/components/DataCards/DataCard.tsx
|
|
8040
|
-
var
|
|
8041
|
-
var
|
|
8340
|
+
var import_styled_components38 = __toESM(require("styled-components"));
|
|
8341
|
+
var import_type_guards26 = require("@wistia/type-guards");
|
|
8042
8342
|
|
|
8043
8343
|
// src/components/Heading/Heading.tsx
|
|
8044
|
-
var
|
|
8045
|
-
var
|
|
8046
|
-
var
|
|
8047
|
-
var heroStyle =
|
|
8344
|
+
var import_react24 = require("react");
|
|
8345
|
+
var import_styled_components37 = __toESM(require("styled-components"));
|
|
8346
|
+
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
8347
|
+
var heroStyle = import_styled_components37.css`
|
|
8048
8348
|
--font-family: var(--wui-typography-heading-hero-family);
|
|
8049
8349
|
--font-size: var(--wui-typography-heading-hero-size);
|
|
8050
8350
|
--font-weight: var(--wui-typography-heading-hero-weight);
|
|
8051
8351
|
--line-height: var(--wui-typography-heading-hero-line-height);
|
|
8052
8352
|
`;
|
|
8053
|
-
var heading1TextStyle =
|
|
8353
|
+
var heading1TextStyle = import_styled_components37.css`
|
|
8054
8354
|
--font-family: var(--wui-typography-heading-1-family);
|
|
8055
8355
|
--font-size: var(--wui-typography-heading-1-size);
|
|
8056
8356
|
--font-weight: var(--wui-typography-heading-1-weight);
|
|
8057
8357
|
--line-height: var(--wui-typography-heading-1-line-height);
|
|
8058
8358
|
`;
|
|
8059
|
-
var heading2TextStyle =
|
|
8359
|
+
var heading2TextStyle = import_styled_components37.css`
|
|
8060
8360
|
--font-family: var(--wui-typography-heading-2-family);
|
|
8061
8361
|
--font-size: var(--wui-typography-heading-2-size);
|
|
8062
8362
|
--font-weight: var(--wui-typography-heading-2-weight);
|
|
8063
8363
|
--line-height: var(--wui-typography-heading-2-line-height);
|
|
8064
8364
|
`;
|
|
8065
|
-
var heading3TextStyle =
|
|
8365
|
+
var heading3TextStyle = import_styled_components37.css`
|
|
8066
8366
|
--font-family: var(--wui-typography-heading-3-family);
|
|
8067
8367
|
--font-size: var(--wui-typography-heading-3-size);
|
|
8068
8368
|
--font-weight: var(--wui-typography-heading-3-weight);
|
|
8069
8369
|
--line-height: var(--wui-typography-heading-3-line-height);
|
|
8070
8370
|
`;
|
|
8071
|
-
var heading4TextStyle =
|
|
8371
|
+
var heading4TextStyle = import_styled_components37.css`
|
|
8072
8372
|
--font-family: var(--wui-typography-heading-4-family);
|
|
8073
8373
|
--font-size: var(--wui-typography-heading-4-size);
|
|
8074
8374
|
--font-weight: var(--wui-typography-heading-4-weight);
|
|
8075
8375
|
--line-height: var(--wui-typography-heading-4-line-height);
|
|
8076
8376
|
`;
|
|
8077
|
-
var heading5TextStyle =
|
|
8377
|
+
var heading5TextStyle = import_styled_components37.css`
|
|
8078
8378
|
--font-family: var(--wui-typography-heading-5-family);
|
|
8079
8379
|
--font-size: var(--wui-typography-heading-5-size);
|
|
8080
8380
|
--font-weight: var(--wui-typography-heading-5-weight);
|
|
8081
8381
|
--line-height: var(--wui-typography-heading-5-line-height);
|
|
8082
8382
|
`;
|
|
8083
|
-
var heading6TextStyle =
|
|
8383
|
+
var heading6TextStyle = import_styled_components37.css`
|
|
8084
8384
|
--font-family: var(--wui-typography-heading-6-family);
|
|
8085
8385
|
--font-size: var(--wui-typography-heading-6-size);
|
|
8086
8386
|
--font-weight: var(--wui-typography-heading-6-weight);
|
|
@@ -8096,7 +8396,7 @@ var variantStyleMap = {
|
|
|
8096
8396
|
heading6: heading6TextStyle
|
|
8097
8397
|
};
|
|
8098
8398
|
var DEFAULT_ELEMENT2 = "h1";
|
|
8099
|
-
var StyledHeading =
|
|
8399
|
+
var StyledHeading = import_styled_components37.default.div`
|
|
8100
8400
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8101
8401
|
font-family: var(--font-family);
|
|
8102
8402
|
font-size: var(--font-size);
|
|
@@ -8105,16 +8405,16 @@ var StyledHeading = import_styled_components36.default.div`
|
|
|
8105
8405
|
color: var(--wui-color-text);
|
|
8106
8406
|
${({ $variant }) => variantStyleMap[$variant]}
|
|
8107
8407
|
${({ $ellipsis }) => $ellipsis && ellipsisStyle};
|
|
8108
|
-
${({ $inline }) => $inline &&
|
|
8408
|
+
${({ $inline }) => $inline && import_styled_components37.css`
|
|
8109
8409
|
display: inline-block;
|
|
8110
8410
|
`}
|
|
8111
|
-
${({ $disabled }) => $disabled &&
|
|
8411
|
+
${({ $disabled }) => $disabled && import_styled_components37.css`
|
|
8112
8412
|
color: var(--wui-color-text-disabled);
|
|
8113
8413
|
`}
|
|
8114
|
-
${({ $preventUserSelect }) => $preventUserSelect &&
|
|
8414
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components37.css`
|
|
8115
8415
|
user-select: none;
|
|
8116
8416
|
`}
|
|
8117
|
-
${({ $align }) =>
|
|
8417
|
+
${({ $align }) => import_styled_components37.css`
|
|
8118
8418
|
text-align: ${$align};
|
|
8119
8419
|
`}
|
|
8120
8420
|
margin: 0;
|
|
@@ -8128,7 +8428,7 @@ var variantElementMap = {
|
|
|
8128
8428
|
heading5: "h5",
|
|
8129
8429
|
heading6: "h6"
|
|
8130
8430
|
};
|
|
8131
|
-
var HeadingComponent = (0,
|
|
8431
|
+
var HeadingComponent = (0, import_react24.forwardRef)(
|
|
8132
8432
|
({
|
|
8133
8433
|
align = "left",
|
|
8134
8434
|
colorScheme = "inherit",
|
|
@@ -8139,7 +8439,7 @@ var HeadingComponent = (0, import_react22.forwardRef)(
|
|
|
8139
8439
|
variant = "heading1",
|
|
8140
8440
|
renderAs,
|
|
8141
8441
|
...otherProps
|
|
8142
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
8442
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
8143
8443
|
StyledHeading,
|
|
8144
8444
|
{
|
|
8145
8445
|
ref,
|
|
@@ -8159,8 +8459,8 @@ HeadingComponent.displayName = "Heading";
|
|
|
8159
8459
|
var Heading = makePolymorphic(HeadingComponent);
|
|
8160
8460
|
|
|
8161
8461
|
// src/components/DataCards/DataCard.tsx
|
|
8162
|
-
var
|
|
8163
|
-
var StyledDataCard =
|
|
8462
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
8463
|
+
var StyledDataCard = import_styled_components38.default.div`
|
|
8164
8464
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
8165
8465
|
display: grid;
|
|
8166
8466
|
grid-template-areas: 'label slot' 'value value';
|
|
@@ -8173,7 +8473,7 @@ var StyledDataCard = import_styled_components37.default.div`
|
|
|
8173
8473
|
border-radius: var(--wui-border-radius-02);
|
|
8174
8474
|
position: relative;
|
|
8175
8475
|
`;
|
|
8176
|
-
var shimmer =
|
|
8476
|
+
var shimmer = import_styled_components38.keyframes`
|
|
8177
8477
|
0% {
|
|
8178
8478
|
background-position: 200% 0;
|
|
8179
8479
|
}
|
|
@@ -8181,7 +8481,7 @@ var shimmer = import_styled_components37.keyframes`
|
|
|
8181
8481
|
background-position: -200% 0;
|
|
8182
8482
|
}
|
|
8183
8483
|
`;
|
|
8184
|
-
var LoadingBackground =
|
|
8484
|
+
var LoadingBackground = import_styled_components38.default.div`
|
|
8185
8485
|
background: linear-gradient(
|
|
8186
8486
|
90deg,
|
|
8187
8487
|
var(--wui-color-bg-surface-tertiary) 25%,
|
|
@@ -8192,27 +8492,27 @@ var LoadingBackground = import_styled_components37.default.div`
|
|
|
8192
8492
|
animation: ${shimmer} 1.5s infinite;
|
|
8193
8493
|
border-radius: var(--wui-border-radius-01);
|
|
8194
8494
|
`;
|
|
8195
|
-
var StyledLoadingLabel = (0,
|
|
8495
|
+
var StyledLoadingLabel = (0, import_styled_components38.default)(LoadingBackground)`
|
|
8196
8496
|
width: 80px;
|
|
8197
8497
|
height: var(--wui-typography-heading-6-line-height);
|
|
8198
8498
|
`;
|
|
8199
|
-
var StyledLoadingValue = (0,
|
|
8499
|
+
var StyledLoadingValue = (0, import_styled_components38.default)(LoadingBackground)`
|
|
8200
8500
|
width: 90%;
|
|
8201
8501
|
height: var(--wui-typography-heading-3-line-height);
|
|
8202
8502
|
`;
|
|
8203
|
-
var StyledLabel2 = (0,
|
|
8503
|
+
var StyledLabel2 = (0, import_styled_components38.default)(Heading)`
|
|
8204
8504
|
grid-area: label;
|
|
8205
8505
|
`;
|
|
8206
|
-
var StyledValue = (0,
|
|
8506
|
+
var StyledValue = (0, import_styled_components38.default)(Heading)`
|
|
8207
8507
|
grid-area: value;
|
|
8208
8508
|
`;
|
|
8209
|
-
var StyledSlot =
|
|
8509
|
+
var StyledSlot = import_styled_components38.default.div`
|
|
8210
8510
|
display: flex;
|
|
8211
8511
|
justify-content: flex-end;
|
|
8212
8512
|
grid-area: slot;
|
|
8213
8513
|
align-self: center;
|
|
8214
8514
|
`;
|
|
8215
|
-
var StyledDataCardTrendContainer =
|
|
8515
|
+
var StyledDataCardTrendContainer = import_styled_components38.default.div`
|
|
8216
8516
|
position: absolute;
|
|
8217
8517
|
bottom: var(--wui-space-01);
|
|
8218
8518
|
right: var(--wui-space-01);
|
|
@@ -8225,39 +8525,39 @@ var DataCard = ({
|
|
|
8225
8525
|
isLoading = false,
|
|
8226
8526
|
trend,
|
|
8227
8527
|
...props
|
|
8228
|
-
}) => /* @__PURE__ */ (0,
|
|
8528
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(
|
|
8229
8529
|
StyledDataCard,
|
|
8230
8530
|
{
|
|
8231
8531
|
$colorScheme: colorScheme,
|
|
8232
8532
|
...props,
|
|
8233
8533
|
children: [
|
|
8234
|
-
/* @__PURE__ */ (0,
|
|
8534
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
8235
8535
|
StyledLabel2,
|
|
8236
8536
|
{
|
|
8237
8537
|
renderAs: "dt",
|
|
8238
8538
|
variant: "heading6",
|
|
8239
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
8539
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledLoadingLabel, {}) : label
|
|
8240
8540
|
}
|
|
8241
8541
|
),
|
|
8242
|
-
/* @__PURE__ */ (0,
|
|
8542
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
8243
8543
|
StyledValue,
|
|
8244
8544
|
{
|
|
8245
8545
|
renderAs: "dd",
|
|
8246
8546
|
variant: "heading3",
|
|
8247
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
8547
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledLoadingValue, {}) : value
|
|
8248
8548
|
}
|
|
8249
8549
|
),
|
|
8250
|
-
(0,
|
|
8251
|
-
(0,
|
|
8550
|
+
(0, import_type_guards26.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
8551
|
+
(0, import_type_guards26.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
8252
8552
|
]
|
|
8253
8553
|
}
|
|
8254
8554
|
);
|
|
8255
8555
|
DataCard.displayName = "DataCard";
|
|
8256
8556
|
|
|
8257
8557
|
// src/components/DataCards/DataCards.tsx
|
|
8258
|
-
var
|
|
8259
|
-
var
|
|
8260
|
-
var StyledDataCards = (0,
|
|
8558
|
+
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8559
|
+
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
8560
|
+
var StyledDataCards = (0, import_styled_components39.default)(Box)`
|
|
8261
8561
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8262
8562
|
margin-top: 0; /* Remove default <dl> style */
|
|
8263
8563
|
> * {
|
|
@@ -8271,7 +8571,7 @@ var DataCards = ({
|
|
|
8271
8571
|
colorScheme = "inherit",
|
|
8272
8572
|
...props
|
|
8273
8573
|
}) => {
|
|
8274
|
-
return /* @__PURE__ */ (0,
|
|
8574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
8275
8575
|
StyledDataCards,
|
|
8276
8576
|
{
|
|
8277
8577
|
...props,
|
|
@@ -8289,25 +8589,25 @@ var DataCards = ({
|
|
|
8289
8589
|
DataCards.displayName = "DataCards";
|
|
8290
8590
|
|
|
8291
8591
|
// src/components/DataCards/DataCardTrend.tsx
|
|
8292
|
-
var
|
|
8592
|
+
var import_styled_components41 = __toESM(require("styled-components"));
|
|
8293
8593
|
|
|
8294
8594
|
// src/components/Text/Text.tsx
|
|
8295
|
-
var
|
|
8296
|
-
var
|
|
8297
|
-
var
|
|
8298
|
-
var bodyBoldStyles =
|
|
8595
|
+
var import_react25 = require("react");
|
|
8596
|
+
var import_styled_components40 = __toESM(require("styled-components"));
|
|
8597
|
+
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
8598
|
+
var bodyBoldStyles = import_styled_components40.css`
|
|
8299
8599
|
> strong,
|
|
8300
8600
|
b {
|
|
8301
8601
|
font-weight: var(--wui-typography-weight-body-bold);
|
|
8302
8602
|
}
|
|
8303
8603
|
`;
|
|
8304
|
-
var labelBoldStyles =
|
|
8604
|
+
var labelBoldStyles = import_styled_components40.css`
|
|
8305
8605
|
> strong,
|
|
8306
8606
|
b {
|
|
8307
8607
|
font-weight: var(--wui-typography-weight-label-bold);
|
|
8308
8608
|
}
|
|
8309
8609
|
`;
|
|
8310
|
-
var body1TextStyle =
|
|
8610
|
+
var body1TextStyle = import_styled_components40.css`
|
|
8311
8611
|
--font-family: var(--wui-typography-body-1-family);
|
|
8312
8612
|
--font-size: var(--wui-typography-body-1-size);
|
|
8313
8613
|
--font-weight: var(--wui-typography-body-1-weight);
|
|
@@ -8315,7 +8615,7 @@ var body1TextStyle = import_styled_components39.css`
|
|
|
8315
8615
|
--paragraph-spacing: var(--wui-typography-body-1-paragraph-spacing);
|
|
8316
8616
|
${bodyBoldStyles}
|
|
8317
8617
|
`;
|
|
8318
|
-
var body2TextStyle =
|
|
8618
|
+
var body2TextStyle = import_styled_components40.css`
|
|
8319
8619
|
--font-family: var(--wui-typography-body-2-family);
|
|
8320
8620
|
--font-size: var(--wui-typography-body-2-size);
|
|
8321
8621
|
--font-weight: var(--wui-typography-body-2-weight);
|
|
@@ -8323,7 +8623,7 @@ var body2TextStyle = import_styled_components39.css`
|
|
|
8323
8623
|
--paragraph-spacing: var(--wui-typography-body-2-paragraph-spacing);
|
|
8324
8624
|
${bodyBoldStyles}
|
|
8325
8625
|
`;
|
|
8326
|
-
var body3TextStyle =
|
|
8626
|
+
var body3TextStyle = import_styled_components40.css`
|
|
8327
8627
|
--font-family: var(--wui-typography-body-3-family);
|
|
8328
8628
|
--font-size: var(--wui-typography-body-3-size);
|
|
8329
8629
|
--font-weight: var(--wui-typography-body-3-weight);
|
|
@@ -8331,7 +8631,7 @@ var body3TextStyle = import_styled_components39.css`
|
|
|
8331
8631
|
--paragraph-spacing: var(--wui-typography-body-3-paragraph-spacing);
|
|
8332
8632
|
${bodyBoldStyles}
|
|
8333
8633
|
`;
|
|
8334
|
-
var body4TextStyle =
|
|
8634
|
+
var body4TextStyle = import_styled_components40.css`
|
|
8335
8635
|
--font-family: var(--wui-typography-body-4-family);
|
|
8336
8636
|
--font-size: var(--wui-typography-body-4-size);
|
|
8337
8637
|
--font-weight: var(--wui-typography-body-4-weight);
|
|
@@ -8339,47 +8639,47 @@ var body4TextStyle = import_styled_components39.css`
|
|
|
8339
8639
|
--paragraph-spacing: var(--wui-typography-body-4-paragraph-spacing);
|
|
8340
8640
|
${bodyBoldStyles}
|
|
8341
8641
|
`;
|
|
8342
|
-
var label1TextStyle =
|
|
8642
|
+
var label1TextStyle = import_styled_components40.css`
|
|
8343
8643
|
--font-family: var(--wui-typography-label-1-family);
|
|
8344
8644
|
--font-size: var(--wui-typography-label-1-size);
|
|
8345
8645
|
--font-weight: var(--wui-typography-label-1-weight);
|
|
8346
8646
|
--line-height: var(--wui-typography-label-1-line-height);
|
|
8347
8647
|
${labelBoldStyles}
|
|
8348
8648
|
`;
|
|
8349
|
-
var label2TextStyle =
|
|
8649
|
+
var label2TextStyle = import_styled_components40.css`
|
|
8350
8650
|
--font-family: var(--wui-typography-label-2-family);
|
|
8351
8651
|
--font-size: var(--wui-typography-label-2-size);
|
|
8352
8652
|
--font-weight: var(--wui-typography-label-2-weight);
|
|
8353
8653
|
--line-height: var(--wui-typography-label-2-line-height);
|
|
8354
8654
|
${labelBoldStyles}
|
|
8355
8655
|
`;
|
|
8356
|
-
var label3TextStyle =
|
|
8656
|
+
var label3TextStyle = import_styled_components40.css`
|
|
8357
8657
|
--font-family: var(--wui-typography-label-3-family);
|
|
8358
8658
|
--font-size: var(--wui-typography-label-3-size);
|
|
8359
8659
|
--font-weight: var(--wui-typography-label-3-weight);
|
|
8360
8660
|
--line-height: var(--wui-typography-label-3-line-height);
|
|
8361
8661
|
${labelBoldStyles}
|
|
8362
8662
|
`;
|
|
8363
|
-
var label4TextStyle =
|
|
8663
|
+
var label4TextStyle = import_styled_components40.css`
|
|
8364
8664
|
--font-family: var(--wui-typography-label-4-family);
|
|
8365
8665
|
--font-size: var(--wui-typography-label-4-size);
|
|
8366
8666
|
--font-weight: var(--wui-typography-label-4-weight);
|
|
8367
8667
|
--line-height: var(--wui-typography-label-4-line-height);
|
|
8368
8668
|
${labelBoldStyles}
|
|
8369
8669
|
`;
|
|
8370
|
-
var body1MonoTextStyle =
|
|
8670
|
+
var body1MonoTextStyle = import_styled_components40.css`
|
|
8371
8671
|
${body1TextStyle};
|
|
8372
8672
|
--font-family: var(--wui-typography-family-mono);
|
|
8373
8673
|
`;
|
|
8374
|
-
var body2MonoTextStyle =
|
|
8674
|
+
var body2MonoTextStyle = import_styled_components40.css`
|
|
8375
8675
|
${body2TextStyle};
|
|
8376
8676
|
--font-family: var(--wui-typography-family-mono);
|
|
8377
8677
|
`;
|
|
8378
|
-
var body3MonoTextStyle =
|
|
8678
|
+
var body3MonoTextStyle = import_styled_components40.css`
|
|
8379
8679
|
${body3TextStyle};
|
|
8380
8680
|
--font-family: var(--wui-typography-family-mono);
|
|
8381
8681
|
`;
|
|
8382
|
-
var body4MonoTextStyle =
|
|
8682
|
+
var body4MonoTextStyle = import_styled_components40.css`
|
|
8383
8683
|
${body4TextStyle};
|
|
8384
8684
|
--font-family: var(--wui-typography-family-mono);
|
|
8385
8685
|
`;
|
|
@@ -8414,7 +8714,7 @@ var variantElementMap2 = {
|
|
|
8414
8714
|
label3: labelElement,
|
|
8415
8715
|
label4: labelElement
|
|
8416
8716
|
};
|
|
8417
|
-
var StyledText =
|
|
8717
|
+
var StyledText = import_styled_components40.default.div`
|
|
8418
8718
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
8419
8719
|
--text-color: ${({ $prominence, $disabled }) => {
|
|
8420
8720
|
if ($disabled) {
|
|
@@ -8438,19 +8738,19 @@ var StyledText = import_styled_components39.default.div`
|
|
|
8438
8738
|
margin: 0;
|
|
8439
8739
|
${({ $variant }) => variantStyleMap2[$variant]}
|
|
8440
8740
|
${({ $ellipsis }) => $ellipsis && ellipsisStyle};
|
|
8441
|
-
${({ $inline }) => $inline &&
|
|
8741
|
+
${({ $inline }) => $inline && import_styled_components40.css`
|
|
8442
8742
|
display: inline-block;
|
|
8443
8743
|
`}
|
|
8444
|
-
${({ $disabled }) => $disabled &&
|
|
8744
|
+
${({ $disabled }) => $disabled && import_styled_components40.css`
|
|
8445
8745
|
--text-color: var(--wui-color-text-disabled);
|
|
8446
8746
|
`}
|
|
8447
|
-
${({ $preventUserSelect }) => $preventUserSelect &&
|
|
8747
|
+
${({ $preventUserSelect }) => $preventUserSelect && import_styled_components40.css`
|
|
8448
8748
|
user-select: none;
|
|
8449
8749
|
`}
|
|
8450
|
-
${({ $align }) =>
|
|
8750
|
+
${({ $align }) => import_styled_components40.css`
|
|
8451
8751
|
text-align: ${$align};
|
|
8452
8752
|
`}
|
|
8453
|
-
${({ as }) => as === "p" &&
|
|
8753
|
+
${({ as }) => as === "p" && import_styled_components40.css`
|
|
8454
8754
|
display: block;
|
|
8455
8755
|
|
|
8456
8756
|
+ p {
|
|
@@ -8458,7 +8758,7 @@ var StyledText = import_styled_components39.default.div`
|
|
|
8458
8758
|
}
|
|
8459
8759
|
`}
|
|
8460
8760
|
`;
|
|
8461
|
-
var TextComponent = (0,
|
|
8761
|
+
var TextComponent = (0, import_react25.forwardRef)(
|
|
8462
8762
|
({
|
|
8463
8763
|
align = "left",
|
|
8464
8764
|
colorScheme = "inherit",
|
|
@@ -8471,7 +8771,7 @@ var TextComponent = (0, import_react23.forwardRef)(
|
|
|
8471
8771
|
renderAs,
|
|
8472
8772
|
...otherProps
|
|
8473
8773
|
}, ref) => {
|
|
8474
|
-
return /* @__PURE__ */ (0,
|
|
8774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
8475
8775
|
StyledText,
|
|
8476
8776
|
{
|
|
8477
8777
|
ref,
|
|
@@ -8493,8 +8793,8 @@ TextComponent.displayName = "Text";
|
|
|
8493
8793
|
var Text = makePolymorphic(TextComponent);
|
|
8494
8794
|
|
|
8495
8795
|
// src/components/DataCards/DataCardTrend.tsx
|
|
8496
|
-
var
|
|
8497
|
-
var StyledDataCardTrend =
|
|
8796
|
+
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
8797
|
+
var StyledDataCardTrend = import_styled_components41.default.div`
|
|
8498
8798
|
${({ $outlook }) => getColorScheme($outlook === "positive" ? "success" : "error")};
|
|
8499
8799
|
background: var(--wui-color-bg-app);
|
|
8500
8800
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -8509,8 +8809,8 @@ var DataCardTrend = ({
|
|
|
8509
8809
|
children,
|
|
8510
8810
|
...props
|
|
8511
8811
|
}) => {
|
|
8512
|
-
return /* @__PURE__ */ (0,
|
|
8513
|
-
/* @__PURE__ */ (0,
|
|
8812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(StyledDataCardTrend, { $outlook: outlook, children: [
|
|
8813
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
8514
8814
|
Icon,
|
|
8515
8815
|
{
|
|
8516
8816
|
size: "md",
|
|
@@ -8518,7 +8818,7 @@ var DataCardTrend = ({
|
|
|
8518
8818
|
...props
|
|
8519
8819
|
}
|
|
8520
8820
|
),
|
|
8521
|
-
/* @__PURE__ */ (0,
|
|
8821
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
8522
8822
|
Text,
|
|
8523
8823
|
{
|
|
8524
8824
|
prominence: "secondary",
|
|
@@ -8530,22 +8830,22 @@ var DataCardTrend = ({
|
|
|
8530
8830
|
};
|
|
8531
8831
|
|
|
8532
8832
|
// src/components/Divider/Divider.tsx
|
|
8533
|
-
var
|
|
8534
|
-
var
|
|
8535
|
-
var horizontalBorderCss =
|
|
8833
|
+
var import_styled_components42 = __toESM(require("styled-components"));
|
|
8834
|
+
var import_jsx_runtime216 = require("react/jsx-runtime");
|
|
8835
|
+
var horizontalBorderCss = import_styled_components42.css`
|
|
8536
8836
|
border-top-color: var(--wui-color-border);
|
|
8537
8837
|
border-top-style: solid;
|
|
8538
8838
|
border-top-width: 1px;
|
|
8539
8839
|
clear: both; /* for horizontal dividers, ensure it clears any floats */
|
|
8540
8840
|
height: 0;
|
|
8541
8841
|
`;
|
|
8542
|
-
var verticalBorderCss =
|
|
8842
|
+
var verticalBorderCss = import_styled_components42.css`
|
|
8543
8843
|
background-color: var(--wui-color-border);
|
|
8544
8844
|
max-width: 1px;
|
|
8545
8845
|
min-height: 100%;
|
|
8546
8846
|
width: 1px;
|
|
8547
8847
|
`;
|
|
8548
|
-
var DividerComponent =
|
|
8848
|
+
var DividerComponent = import_styled_components42.default.div`
|
|
8549
8849
|
${({ $orientation }) => {
|
|
8550
8850
|
switch ($orientation) {
|
|
8551
8851
|
case "vertical":
|
|
@@ -8560,7 +8860,7 @@ var Divider = ({
|
|
|
8560
8860
|
orientation = "horizontal",
|
|
8561
8861
|
...otherProps
|
|
8562
8862
|
}) => {
|
|
8563
|
-
return /* @__PURE__ */ (0,
|
|
8863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
8564
8864
|
DividerComponent,
|
|
8565
8865
|
{
|
|
8566
8866
|
$orientation: orientation,
|
|
@@ -8573,21 +8873,21 @@ var Divider = ({
|
|
|
8573
8873
|
Divider.displayName = "Divider";
|
|
8574
8874
|
|
|
8575
8875
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
8576
|
-
var
|
|
8577
|
-
var
|
|
8876
|
+
var import_styled_components45 = __toESM(require("styled-components"));
|
|
8877
|
+
var import_react27 = require("react");
|
|
8578
8878
|
|
|
8579
8879
|
// src/components/Tooltip/Tooltip.tsx
|
|
8580
8880
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
8581
|
-
var
|
|
8582
|
-
var
|
|
8583
|
-
var CompactTooltipStyles =
|
|
8881
|
+
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8882
|
+
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
8883
|
+
var CompactTooltipStyles = import_styled_components43.css`
|
|
8584
8884
|
--tooltip-font-size: var(--wui-typography-label-4-size);
|
|
8585
8885
|
--tooltip-line-height: var(--wui-typography-label-4-line-height);
|
|
8586
8886
|
--tooltip-font-weight: var(--wui-typography-label-4-weight);
|
|
8587
8887
|
--tooltip-horizontal-padding: var(--wui-space-02);
|
|
8588
8888
|
--tooltip-vertical-padding: var(--wui-space-03);
|
|
8589
8889
|
`;
|
|
8590
|
-
var StyledContent = (0,
|
|
8890
|
+
var StyledContent = (0, import_styled_components43.default)(import_react_tooltip2.Content)`
|
|
8591
8891
|
--tooltip-font-family: var(--wui-typography-family-default);
|
|
8592
8892
|
--tooltip-border-radius: var(--wui-border-radius-05);
|
|
8593
8893
|
--tooltip-bg: var(--wui-color-bg-tooltip);
|
|
@@ -8646,14 +8946,14 @@ var Tooltip = ({
|
|
|
8646
8946
|
if (forceOpen === true) {
|
|
8647
8947
|
rootProps.open = true;
|
|
8648
8948
|
}
|
|
8649
|
-
return /* @__PURE__ */ (0,
|
|
8949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(
|
|
8650
8950
|
import_react_tooltip2.Root,
|
|
8651
8951
|
{
|
|
8652
8952
|
delayDuration: delay,
|
|
8653
8953
|
...rootProps,
|
|
8654
8954
|
children: [
|
|
8655
|
-
/* @__PURE__ */ (0,
|
|
8656
|
-
/* @__PURE__ */ (0,
|
|
8955
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_react_tooltip2.Trigger, { asChild: true, children }),
|
|
8956
|
+
/* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_react_tooltip2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(
|
|
8657
8957
|
StyledContent,
|
|
8658
8958
|
{
|
|
8659
8959
|
$compact: compact,
|
|
@@ -8661,7 +8961,7 @@ var Tooltip = ({
|
|
|
8661
8961
|
sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
|
|
8662
8962
|
children: [
|
|
8663
8963
|
content,
|
|
8664
|
-
!hideArrow ? /* @__PURE__ */ (0,
|
|
8964
|
+
!hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_react_tooltip2.Arrow, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
8665
8965
|
"svg",
|
|
8666
8966
|
{
|
|
8667
8967
|
fill: "var(--tooltip-bg)",
|
|
@@ -8670,7 +8970,7 @@ var Tooltip = ({
|
|
|
8670
8970
|
viewBox: "0 0 12 8",
|
|
8671
8971
|
width: "12",
|
|
8672
8972
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8673
|
-
children: /* @__PURE__ */ (0,
|
|
8973
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
|
|
8674
8974
|
}
|
|
8675
8975
|
) }) : null
|
|
8676
8976
|
]
|
|
@@ -8683,11 +8983,11 @@ var Tooltip = ({
|
|
|
8683
8983
|
Tooltip.displayName = "Tooltip";
|
|
8684
8984
|
|
|
8685
8985
|
// src/components/Input/Input.tsx
|
|
8686
|
-
var
|
|
8687
|
-
var
|
|
8688
|
-
var
|
|
8689
|
-
var
|
|
8690
|
-
var inputStyles =
|
|
8986
|
+
var import_react26 = require("react");
|
|
8987
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
8988
|
+
var import_type_guards27 = require("@wistia/type-guards");
|
|
8989
|
+
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
8990
|
+
var inputStyles = import_styled_components44.css`
|
|
8691
8991
|
--wui-input-color-bg: var(--wui-color-bg-surface);
|
|
8692
8992
|
--wui-input-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
8693
8993
|
--wui-input-color-border: var(--wui-color-border);
|
|
@@ -8728,7 +9028,7 @@ var inputStyles = import_styled_components43.css`
|
|
|
8728
9028
|
}
|
|
8729
9029
|
}
|
|
8730
9030
|
`;
|
|
8731
|
-
var StyledInputContainer =
|
|
9031
|
+
var StyledInputContainer = import_styled_components44.default.div`
|
|
8732
9032
|
display: inline-flex;
|
|
8733
9033
|
position: relative;
|
|
8734
9034
|
${inputStyles};
|
|
@@ -8772,7 +9072,7 @@ var StyledInputContainer = import_styled_components43.default.div`
|
|
|
8772
9072
|
padding-right: 32px;
|
|
8773
9073
|
}
|
|
8774
9074
|
`;
|
|
8775
|
-
var Input = (0,
|
|
9075
|
+
var Input = (0, import_react26.forwardRef)(
|
|
8776
9076
|
({
|
|
8777
9077
|
fullWidth = true,
|
|
8778
9078
|
monospace = false,
|
|
@@ -8782,30 +9082,30 @@ var Input = (0, import_react24.forwardRef)(
|
|
|
8782
9082
|
rightIcon,
|
|
8783
9083
|
...props
|
|
8784
9084
|
}, externalRef) => {
|
|
8785
|
-
const internalRef = (0,
|
|
9085
|
+
const internalRef = (0, import_react26.useRef)();
|
|
8786
9086
|
const ref = (
|
|
8787
9087
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
8788
|
-
(0,
|
|
9088
|
+
(0, import_type_guards27.isNotNil)(externalRef) && (0, import_type_guards27.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
8789
9089
|
);
|
|
8790
9090
|
let leftIconToDisplay = leftIcon;
|
|
8791
|
-
if ((0,
|
|
8792
|
-
leftIconToDisplay = /* @__PURE__ */ (0,
|
|
9091
|
+
if ((0, import_type_guards27.isNil)(leftIcon) && type === "search") {
|
|
9092
|
+
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(Icon, { type: "search" });
|
|
8793
9093
|
}
|
|
8794
|
-
if ((0,
|
|
8795
|
-
leftIconToDisplay = (0,
|
|
9094
|
+
if ((0, import_type_guards27.isNotNil)(leftIconToDisplay)) {
|
|
9095
|
+
leftIconToDisplay = (0, import_react26.cloneElement)(leftIconToDisplay, {
|
|
8796
9096
|
size: "md",
|
|
8797
9097
|
className: "wui-input-left-icon"
|
|
8798
9098
|
});
|
|
8799
9099
|
}
|
|
8800
9100
|
let rightIconToDisplay = rightIcon;
|
|
8801
|
-
if ((0,
|
|
8802
|
-
rightIconToDisplay = (0,
|
|
9101
|
+
if ((0, import_type_guards27.isNotNil)(rightIconToDisplay)) {
|
|
9102
|
+
rightIconToDisplay = (0, import_react26.cloneElement)(rightIconToDisplay, {
|
|
8803
9103
|
size: "md",
|
|
8804
9104
|
className: "wui-input-right-icon"
|
|
8805
9105
|
});
|
|
8806
9106
|
}
|
|
8807
|
-
const
|
|
8808
|
-
if ((0,
|
|
9107
|
+
const handleFocus2 = (event) => {
|
|
9108
|
+
if ((0, import_type_guards27.isNotNil)(props.onFocus)) {
|
|
8809
9109
|
props.onFocus(event);
|
|
8810
9110
|
}
|
|
8811
9111
|
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
@@ -8814,26 +9114,26 @@ var Input = (0, import_react24.forwardRef)(
|
|
|
8814
9114
|
});
|
|
8815
9115
|
}
|
|
8816
9116
|
};
|
|
8817
|
-
return /* @__PURE__ */ (0,
|
|
9117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
|
|
8818
9118
|
StyledInputContainer,
|
|
8819
9119
|
{
|
|
8820
9120
|
$fullWidth: fullWidth,
|
|
8821
9121
|
$monospace: monospace,
|
|
8822
9122
|
children: [
|
|
8823
9123
|
leftIconToDisplay ?? null,
|
|
8824
|
-
type === "multiline" ? /* @__PURE__ */ (0,
|
|
9124
|
+
type === "multiline" ? /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
8825
9125
|
"textarea",
|
|
8826
9126
|
{
|
|
8827
9127
|
...props,
|
|
8828
9128
|
ref,
|
|
8829
|
-
onFocus:
|
|
9129
|
+
onFocus: handleFocus2
|
|
8830
9130
|
}
|
|
8831
|
-
) : /* @__PURE__ */ (0,
|
|
9131
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(
|
|
8832
9132
|
"input",
|
|
8833
9133
|
{
|
|
8834
9134
|
...props,
|
|
8835
9135
|
ref,
|
|
8836
|
-
onFocus:
|
|
9136
|
+
onFocus: handleFocus2,
|
|
8837
9137
|
type
|
|
8838
9138
|
}
|
|
8839
9139
|
),
|
|
@@ -8846,8 +9146,8 @@ var Input = (0, import_react24.forwardRef)(
|
|
|
8846
9146
|
Input.displayName = "Input";
|
|
8847
9147
|
|
|
8848
9148
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
8849
|
-
var
|
|
8850
|
-
var StyledInput = (0,
|
|
9149
|
+
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
9150
|
+
var StyledInput = (0, import_styled_components45.default)(Input)`
|
|
8851
9151
|
:not([rows]) {
|
|
8852
9152
|
min-height: unset;
|
|
8853
9153
|
}
|
|
@@ -8867,7 +9167,7 @@ var StyledInput = (0, import_styled_components44.default)(Input)`
|
|
|
8867
9167
|
height: ${({ $height }) => `${$height}px`};
|
|
8868
9168
|
}
|
|
8869
9169
|
`;
|
|
8870
|
-
var editableStyles =
|
|
9170
|
+
var editableStyles = import_styled_components45.css`
|
|
8871
9171
|
&:has(+ :focus-within) {
|
|
8872
9172
|
background: var(--wui-color-bg-surface-hover);
|
|
8873
9173
|
}
|
|
@@ -8877,7 +9177,7 @@ var editableStyles = import_styled_components44.css`
|
|
|
8877
9177
|
cursor: pointer;
|
|
8878
9178
|
}
|
|
8879
9179
|
`;
|
|
8880
|
-
var StyledHeading2 = (0,
|
|
9180
|
+
var StyledHeading2 = (0, import_styled_components45.default)(Heading)`
|
|
8881
9181
|
width: 100%;
|
|
8882
9182
|
border-radius: var(--wui-border-radius-02);
|
|
8883
9183
|
padding: var(--wui-space-02);
|
|
@@ -8894,11 +9194,11 @@ var EditableHeading = ({
|
|
|
8894
9194
|
forceEditing = false,
|
|
8895
9195
|
editingDisabled = false
|
|
8896
9196
|
}) => {
|
|
8897
|
-
const [isEditing, setIsEditing] = (0,
|
|
8898
|
-
const [value, setValue] = (0,
|
|
8899
|
-
const [previousValue, setPreviousValue] = (0,
|
|
8900
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
8901
|
-
const headingRef = (0,
|
|
9197
|
+
const [isEditing, setIsEditing] = (0, import_react27.useState)(false);
|
|
9198
|
+
const [value, setValue] = (0, import_react27.useState)(children);
|
|
9199
|
+
const [previousValue, setPreviousValue] = (0, import_react27.useState)(children);
|
|
9200
|
+
const [headingHeight, setHeadingHeight] = (0, import_react27.useState)("60");
|
|
9201
|
+
const headingRef = (0, import_react27.useRef)(null);
|
|
8902
9202
|
const handleSetEditing = (editing) => {
|
|
8903
9203
|
if (editingDisabled) return;
|
|
8904
9204
|
if (editing && headingRef.current) {
|
|
@@ -8931,7 +9231,7 @@ var EditableHeading = ({
|
|
|
8931
9231
|
handleSetEditing(false);
|
|
8932
9232
|
}
|
|
8933
9233
|
};
|
|
8934
|
-
const HeadingComponent2 = /* @__PURE__ */ (0,
|
|
9234
|
+
const HeadingComponent2 = /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
8935
9235
|
StyledHeading2,
|
|
8936
9236
|
{
|
|
8937
9237
|
ref: headingRef,
|
|
@@ -8945,7 +9245,7 @@ var EditableHeading = ({
|
|
|
8945
9245
|
return HeadingComponent2;
|
|
8946
9246
|
}
|
|
8947
9247
|
if (isEditing || forceEditing) {
|
|
8948
|
-
return /* @__PURE__ */ (0,
|
|
9248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
8949
9249
|
StyledInput,
|
|
8950
9250
|
{
|
|
8951
9251
|
$height: headingHeight,
|
|
@@ -8963,8 +9263,8 @@ var EditableHeading = ({
|
|
|
8963
9263
|
}
|
|
8964
9264
|
);
|
|
8965
9265
|
}
|
|
8966
|
-
return /* @__PURE__ */ (0,
|
|
8967
|
-
/* @__PURE__ */ (0,
|
|
9266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(import_jsx_runtime219.Fragment, { children: [
|
|
9267
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
8968
9268
|
Tooltip,
|
|
8969
9269
|
{
|
|
8970
9270
|
compact: true,
|
|
@@ -8972,7 +9272,7 @@ var EditableHeading = ({
|
|
|
8972
9272
|
children: HeadingComponent2
|
|
8973
9273
|
}
|
|
8974
9274
|
),
|
|
8975
|
-
/* @__PURE__ */ (0,
|
|
9275
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
8976
9276
|
"button",
|
|
8977
9277
|
{
|
|
8978
9278
|
"aria-label": ariaLabel,
|
|
@@ -8984,27 +9284,27 @@ var EditableHeading = ({
|
|
|
8984
9284
|
};
|
|
8985
9285
|
|
|
8986
9286
|
// src/components/Form/Form.tsx
|
|
8987
|
-
var
|
|
8988
|
-
var
|
|
8989
|
-
var
|
|
9287
|
+
var import_react29 = require("react");
|
|
9288
|
+
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9289
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
8990
9290
|
|
|
8991
9291
|
// src/components/Stack/Stack.tsx
|
|
8992
|
-
var
|
|
8993
|
-
var
|
|
8994
|
-
var
|
|
9292
|
+
var import_react28 = require("react");
|
|
9293
|
+
var import_styled_components46 = __toESM(require("styled-components"));
|
|
9294
|
+
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
8995
9295
|
var DEFAULT_ELEMENT4 = "div";
|
|
8996
|
-
var StyledStack =
|
|
9296
|
+
var StyledStack = import_styled_components46.default.div`
|
|
8997
9297
|
display: flex;
|
|
8998
9298
|
flex-direction: ${({ $direction }) => $direction === "horizontal" ? "row" : "column"};
|
|
8999
9299
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9000
9300
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
9001
9301
|
`;
|
|
9002
|
-
var StackComponent = (0,
|
|
9302
|
+
var StackComponent = (0, import_react28.forwardRef)(
|
|
9003
9303
|
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9004
9304
|
const responsiveGap = useResponsiveProp(gap);
|
|
9005
9305
|
const responsiveDirection = useResponsiveProp(direction);
|
|
9006
9306
|
const responsiveAlignItems = useResponsiveProp(alignItems);
|
|
9007
|
-
return /* @__PURE__ */ (0,
|
|
9307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
9008
9308
|
StyledStack,
|
|
9009
9309
|
{
|
|
9010
9310
|
ref,
|
|
@@ -9021,14 +9321,14 @@ StackComponent.displayName = "Stack";
|
|
|
9021
9321
|
var Stack = makePolymorphic(StackComponent);
|
|
9022
9322
|
|
|
9023
9323
|
// src/components/Form/Form.tsx
|
|
9024
|
-
var
|
|
9025
|
-
var StyledForm =
|
|
9324
|
+
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9325
|
+
var StyledForm = import_styled_components47.default.form`
|
|
9026
9326
|
--form-default-width: 690px;
|
|
9027
9327
|
|
|
9028
9328
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9029
9329
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9030
9330
|
`;
|
|
9031
|
-
var FormContext = (0,
|
|
9331
|
+
var FormContext = (0, import_react29.createContext)({
|
|
9032
9332
|
values: {},
|
|
9033
9333
|
errors: {},
|
|
9034
9334
|
hasSubmitted: false,
|
|
@@ -9044,25 +9344,25 @@ var FormComponent = ({
|
|
|
9044
9344
|
fullWidth = false,
|
|
9045
9345
|
...props
|
|
9046
9346
|
}, forwardedRef) => {
|
|
9047
|
-
const [errors, setErrors] = (0,
|
|
9048
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
9049
|
-
const innerRef = (0,
|
|
9347
|
+
const [errors, setErrors] = (0, import_react29.useState)({});
|
|
9348
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react29.useState)(false);
|
|
9349
|
+
const innerRef = (0, import_react29.useRef)();
|
|
9050
9350
|
const ref = forwardedRef ?? innerRef;
|
|
9051
|
-
const autoId = (0,
|
|
9351
|
+
const autoId = (0, import_react29.useId)();
|
|
9052
9352
|
const id = props.id ?? autoId;
|
|
9053
9353
|
const handleValidate = (nextFormData) => {
|
|
9054
9354
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
9055
|
-
if ((0,
|
|
9355
|
+
if ((0, import_type_guards28.isUndefined)(validate)) {
|
|
9056
9356
|
return {};
|
|
9057
9357
|
}
|
|
9058
9358
|
return validate(nextData);
|
|
9059
9359
|
};
|
|
9060
|
-
const
|
|
9360
|
+
const handleBlur2 = (event) => {
|
|
9061
9361
|
if (props.onBlur) {
|
|
9062
9362
|
props.onBlur(event);
|
|
9063
9363
|
}
|
|
9064
9364
|
const formData = new FormData(event.currentTarget);
|
|
9065
|
-
if ((0,
|
|
9365
|
+
if ((0, import_type_guards28.isNotUndefined)(validate)) {
|
|
9066
9366
|
handleValidate(formData);
|
|
9067
9367
|
}
|
|
9068
9368
|
};
|
|
@@ -9090,7 +9390,7 @@ var FormComponent = ({
|
|
|
9090
9390
|
void action(null);
|
|
9091
9391
|
}
|
|
9092
9392
|
};
|
|
9093
|
-
const context = (0,
|
|
9393
|
+
const context = (0, import_react29.useMemo)(() => {
|
|
9094
9394
|
return {
|
|
9095
9395
|
values,
|
|
9096
9396
|
errors,
|
|
@@ -9101,7 +9401,7 @@ var FormComponent = ({
|
|
|
9101
9401
|
}, [labelPosition, values, errors, id, hasSubmitted]);
|
|
9102
9402
|
return (
|
|
9103
9403
|
// @ts-expect-error - generic context providers are a giant pain
|
|
9104
|
-
/* @__PURE__ */ (0,
|
|
9404
|
+
/* @__PURE__ */ (0, import_jsx_runtime221.jsx)(FormContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
9105
9405
|
Stack,
|
|
9106
9406
|
{
|
|
9107
9407
|
...props,
|
|
@@ -9110,7 +9410,7 @@ var FormComponent = ({
|
|
|
9110
9410
|
as: StyledForm,
|
|
9111
9411
|
gap: "space-05",
|
|
9112
9412
|
id,
|
|
9113
|
-
onBlur:
|
|
9413
|
+
onBlur: handleBlur2,
|
|
9114
9414
|
onReset: handleReset,
|
|
9115
9415
|
onSubmit: handleSubmit,
|
|
9116
9416
|
children
|
|
@@ -9119,15 +9419,15 @@ var FormComponent = ({
|
|
|
9119
9419
|
);
|
|
9120
9420
|
};
|
|
9121
9421
|
FormComponent.displayName = "Form";
|
|
9122
|
-
var Form = (0,
|
|
9422
|
+
var Form = (0, import_react29.forwardRef)(FormComponent);
|
|
9123
9423
|
|
|
9124
9424
|
// src/components/Form/useFormState.tsx
|
|
9125
|
-
var
|
|
9425
|
+
var import_react30 = require("react");
|
|
9126
9426
|
var useFormState = (action, initialData = {}) => {
|
|
9127
|
-
const [data, setData] = (0,
|
|
9128
|
-
const [isPending, setIsPending] = (0,
|
|
9129
|
-
const [error, setError] = (0,
|
|
9130
|
-
const formAction = (0,
|
|
9427
|
+
const [data, setData] = (0, import_react30.useState)(initialData);
|
|
9428
|
+
const [isPending, setIsPending] = (0, import_react30.useState)(false);
|
|
9429
|
+
const [error, setError] = (0, import_react30.useState)(null);
|
|
9430
|
+
const formAction = (0, import_react30.useCallback)(
|
|
9131
9431
|
async (nextFormData) => {
|
|
9132
9432
|
if (nextFormData === null) {
|
|
9133
9433
|
setData(initialData);
|
|
@@ -9158,23 +9458,23 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9158
9458
|
};
|
|
9159
9459
|
|
|
9160
9460
|
// src/components/Form/FormErrorSummary.tsx
|
|
9161
|
-
var
|
|
9162
|
-
var
|
|
9163
|
-
var
|
|
9461
|
+
var import_react31 = require("react");
|
|
9462
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
9463
|
+
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
9164
9464
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9165
|
-
return /* @__PURE__ */ (0,
|
|
9465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9166
9466
|
};
|
|
9167
9467
|
var FormErrorSummary = ({ description }) => {
|
|
9168
|
-
const ref = (0,
|
|
9169
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
9468
|
+
const ref = (0, import_react31.useRef)(null);
|
|
9469
|
+
const { formId, errors, hasSubmitted } = (0, import_react31.useContext)(FormContext);
|
|
9170
9470
|
const isValid = Object.keys(errors).length === 0;
|
|
9171
9471
|
if (isValid || !hasSubmitted) {
|
|
9172
9472
|
return null;
|
|
9173
9473
|
}
|
|
9174
|
-
return /* @__PURE__ */ (0,
|
|
9175
|
-
/* @__PURE__ */ (0,
|
|
9176
|
-
/* @__PURE__ */ (0,
|
|
9177
|
-
([name, error]) => (0,
|
|
9474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { ref, children: [
|
|
9475
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("p", { children: description }),
|
|
9476
|
+
/* @__PURE__ */ (0, import_jsx_runtime222.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards29.isNotUndefined)(error)).map(
|
|
9477
|
+
([name, error]) => (0, import_type_guards29.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
9178
9478
|
ErrorItem,
|
|
9179
9479
|
{
|
|
9180
9480
|
error: err,
|
|
@@ -9182,7 +9482,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9182
9482
|
name
|
|
9183
9483
|
},
|
|
9184
9484
|
err
|
|
9185
|
-
)) : /* @__PURE__ */ (0,
|
|
9485
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
|
|
9186
9486
|
ErrorItem,
|
|
9187
9487
|
{
|
|
9188
9488
|
error: error ?? "",
|
|
@@ -9196,14 +9496,14 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9196
9496
|
};
|
|
9197
9497
|
|
|
9198
9498
|
// src/components/FormField/FormField.tsx
|
|
9199
|
-
var
|
|
9200
|
-
var
|
|
9201
|
-
var
|
|
9499
|
+
var import_react34 = require("react");
|
|
9500
|
+
var import_styled_components50 = __toESM(require("styled-components"));
|
|
9501
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
9202
9502
|
|
|
9203
9503
|
// src/components/Label/Label.tsx
|
|
9204
|
-
var
|
|
9205
|
-
var
|
|
9206
|
-
var requiredStyle =
|
|
9504
|
+
var import_styled_components48 = __toESM(require("styled-components"));
|
|
9505
|
+
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9506
|
+
var requiredStyle = import_styled_components48.css`
|
|
9207
9507
|
&::after {
|
|
9208
9508
|
color: var(--wui-color-text-error);
|
|
9209
9509
|
display: inline;
|
|
@@ -9211,10 +9511,10 @@ var requiredStyle = import_styled_components47.css`
|
|
|
9211
9511
|
content: '*';
|
|
9212
9512
|
}
|
|
9213
9513
|
`;
|
|
9214
|
-
var disabledStyle3 =
|
|
9514
|
+
var disabledStyle3 = import_styled_components48.css`
|
|
9215
9515
|
color: var(--wui-color-text-disabled);
|
|
9216
9516
|
`;
|
|
9217
|
-
var StyledLabel3 =
|
|
9517
|
+
var StyledLabel3 = import_styled_components48.default.label`
|
|
9218
9518
|
display: block;
|
|
9219
9519
|
width: 100%;
|
|
9220
9520
|
color: var(--wui-color-text);
|
|
@@ -9246,7 +9546,7 @@ var Label = ({
|
|
|
9246
9546
|
screenReaderOnly = false,
|
|
9247
9547
|
...otherProps
|
|
9248
9548
|
}) => {
|
|
9249
|
-
return /* @__PURE__ */ (0,
|
|
9549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
9250
9550
|
StyledLabel3,
|
|
9251
9551
|
{
|
|
9252
9552
|
...otherProps,
|
|
@@ -9261,28 +9561,28 @@ var Label = ({
|
|
|
9261
9561
|
Label.displayName = "Label";
|
|
9262
9562
|
|
|
9263
9563
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9264
|
-
var
|
|
9564
|
+
var import_react33 = require("react");
|
|
9265
9565
|
|
|
9266
9566
|
// src/components/FormGroup/FormGroup.tsx
|
|
9267
|
-
var
|
|
9268
|
-
var
|
|
9269
|
-
var
|
|
9270
|
-
var StyledFieldset =
|
|
9567
|
+
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9568
|
+
var import_react32 = require("react");
|
|
9569
|
+
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
9570
|
+
var StyledFieldset = import_styled_components49.default.fieldset`
|
|
9271
9571
|
border: 0;
|
|
9272
9572
|
`;
|
|
9273
|
-
var StyledLegend =
|
|
9573
|
+
var StyledLegend = import_styled_components49.default.legend`
|
|
9274
9574
|
margin-bottom: var(--space-01);
|
|
9275
9575
|
`;
|
|
9276
9576
|
var FormGroup = ({ children, label, ...props }) => {
|
|
9277
|
-
const ref = (0,
|
|
9278
|
-
return /* @__PURE__ */ (0,
|
|
9577
|
+
const ref = (0, import_react32.useRef)();
|
|
9578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(
|
|
9279
9579
|
Stack,
|
|
9280
9580
|
{
|
|
9281
9581
|
...props,
|
|
9282
9582
|
ref,
|
|
9283
9583
|
renderAs: StyledFieldset,
|
|
9284
9584
|
children: [
|
|
9285
|
-
/* @__PURE__ */ (0,
|
|
9585
|
+
/* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
9286
9586
|
Heading,
|
|
9287
9587
|
{
|
|
9288
9588
|
renderAs: StyledLegend,
|
|
@@ -9298,8 +9598,8 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
9298
9598
|
FormGroup.displayName = "FormGroup";
|
|
9299
9599
|
|
|
9300
9600
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9301
|
-
var
|
|
9302
|
-
var CheckboxGroupContext = (0,
|
|
9601
|
+
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9602
|
+
var CheckboxGroupContext = (0, import_react33.createContext)(null);
|
|
9303
9603
|
var CheckboxGroup = ({
|
|
9304
9604
|
children,
|
|
9305
9605
|
name,
|
|
@@ -9307,19 +9607,19 @@ var CheckboxGroup = ({
|
|
|
9307
9607
|
value,
|
|
9308
9608
|
...props
|
|
9309
9609
|
}) => {
|
|
9310
|
-
const context = (0,
|
|
9610
|
+
const context = (0, import_react33.useMemo)(() => {
|
|
9311
9611
|
return {
|
|
9312
9612
|
name,
|
|
9313
9613
|
onChange
|
|
9314
9614
|
};
|
|
9315
9615
|
}, [name, onChange]);
|
|
9316
|
-
return /* @__PURE__ */ (0,
|
|
9616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(FormGroup, { ...props, children }) });
|
|
9317
9617
|
};
|
|
9318
9618
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
9319
9619
|
|
|
9320
9620
|
// src/components/FormField/FormField.tsx
|
|
9321
|
-
var
|
|
9322
|
-
var StyledFormField =
|
|
9621
|
+
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9622
|
+
var StyledFormField = import_styled_components50.default.div`
|
|
9323
9623
|
--form-field-spacing: var(--wui-space-01);
|
|
9324
9624
|
--form-field-spacing-inline: var(--wui-space-02);
|
|
9325
9625
|
--form-field-error-color: var(--wui-color-text-secondary-error);
|
|
@@ -9349,7 +9649,7 @@ var StyledFormField = import_styled_components49.default.div`
|
|
|
9349
9649
|
grid-template-rows: 1fr;
|
|
9350
9650
|
}
|
|
9351
9651
|
`;
|
|
9352
|
-
var StyledErrorList =
|
|
9652
|
+
var StyledErrorList = import_styled_components50.default.ul`
|
|
9353
9653
|
margin: 0;
|
|
9354
9654
|
padding: 0;
|
|
9355
9655
|
padding-left: var(--wui-space-04);
|
|
@@ -9358,8 +9658,8 @@ var StyledErrorList = import_styled_components49.default.ul`
|
|
|
9358
9658
|
gap: var(--wui-space-01);
|
|
9359
9659
|
`;
|
|
9360
9660
|
var ErrorMessages = ({ errors, id }) => {
|
|
9361
|
-
const isMultipleErrors = (0,
|
|
9362
|
-
return isMultipleErrors ? /* @__PURE__ */ (0,
|
|
9661
|
+
const isMultipleErrors = (0, import_type_guards30.isArray)(errors);
|
|
9662
|
+
return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9363
9663
|
Text,
|
|
9364
9664
|
{
|
|
9365
9665
|
colorScheme: "error",
|
|
@@ -9369,7 +9669,7 @@ var ErrorMessages = ({ errors, id }) => {
|
|
|
9369
9669
|
children: error
|
|
9370
9670
|
},
|
|
9371
9671
|
`${id}-${index}`
|
|
9372
|
-
)) }) : /* @__PURE__ */ (0,
|
|
9672
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9373
9673
|
Text,
|
|
9374
9674
|
{
|
|
9375
9675
|
colorScheme: "error",
|
|
@@ -9392,8 +9692,8 @@ var FormField = ({
|
|
|
9392
9692
|
value,
|
|
9393
9693
|
...props
|
|
9394
9694
|
}) => {
|
|
9395
|
-
const formState = (0,
|
|
9396
|
-
const checkboxGroup = (0,
|
|
9695
|
+
const formState = (0, import_react34.useContext)(FormContext);
|
|
9696
|
+
const checkboxGroup = (0, import_react34.useContext)(CheckboxGroupContext);
|
|
9397
9697
|
const defaultValue = formState.values[name];
|
|
9398
9698
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9399
9699
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -9408,19 +9708,19 @@ var FormField = ({
|
|
|
9408
9708
|
"aria-describedby": ariaDescribedby,
|
|
9409
9709
|
...props
|
|
9410
9710
|
};
|
|
9411
|
-
if ((0,
|
|
9711
|
+
if ((0, import_type_guards30.isUndefined)(value) && (0, import_type_guards30.isNotUndefined)(defaultValue)) {
|
|
9412
9712
|
childProps = {
|
|
9413
9713
|
...childProps,
|
|
9414
9714
|
defaultValue
|
|
9415
9715
|
};
|
|
9416
9716
|
}
|
|
9417
|
-
if ((0,
|
|
9418
|
-
const computedName = (0,
|
|
9717
|
+
if ((0, import_type_guards30.isNotNil)(checkboxGroup)) {
|
|
9718
|
+
const computedName = (0, import_type_guards30.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
9419
9719
|
const handleChange = (event) => {
|
|
9420
|
-
if ((0,
|
|
9720
|
+
if ((0, import_type_guards30.isNotUndefined)(props.onChange)) {
|
|
9421
9721
|
props.onChange(event);
|
|
9422
9722
|
}
|
|
9423
|
-
if ((0,
|
|
9723
|
+
if ((0, import_type_guards30.isNotUndefined)(checkboxGroup.onChange)) {
|
|
9424
9724
|
checkboxGroup.onChange(event);
|
|
9425
9725
|
}
|
|
9426
9726
|
};
|
|
@@ -9428,22 +9728,22 @@ var FormField = ({
|
|
|
9428
9728
|
...childProps,
|
|
9429
9729
|
name: computedName,
|
|
9430
9730
|
onChange: handleChange,
|
|
9431
|
-
"aria-invalid": (0,
|
|
9731
|
+
"aria-invalid": (0, import_type_guards30.isNotNil)(error)
|
|
9432
9732
|
};
|
|
9433
9733
|
}
|
|
9434
|
-
|
|
9435
|
-
return /* @__PURE__ */ (0,
|
|
9734
|
+
import_react34.Children.only(children);
|
|
9735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
|
|
9436
9736
|
StyledFormField,
|
|
9437
9737
|
{
|
|
9438
9738
|
...props,
|
|
9439
9739
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
9440
9740
|
children: [
|
|
9441
|
-
!isIntegratedLabel && /* @__PURE__ */ (0,
|
|
9442
|
-
(0,
|
|
9443
|
-
(0,
|
|
9444
|
-
(0,
|
|
9445
|
-
/* @__PURE__ */ (0,
|
|
9446
|
-
/* @__PURE__ */ (0,
|
|
9741
|
+
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
9742
|
+
(0, import_type_guards30.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9743
|
+
(0, import_react34.cloneElement)(children, childProps),
|
|
9744
|
+
(0, import_type_guards30.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(import_jsx_runtime226.Fragment, { children: [
|
|
9745
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("div", {}),
|
|
9746
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9447
9747
|
ErrorMessages,
|
|
9448
9748
|
{
|
|
9449
9749
|
errors: computedError,
|
|
@@ -9458,9 +9758,9 @@ var FormField = ({
|
|
|
9458
9758
|
FormField.displayName = "FormField";
|
|
9459
9759
|
|
|
9460
9760
|
// src/components/FormGroup/RadioGroup.tsx
|
|
9461
|
-
var
|
|
9462
|
-
var
|
|
9463
|
-
var RadioGroupContext = (0,
|
|
9761
|
+
var import_react35 = require("react");
|
|
9762
|
+
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
9763
|
+
var RadioGroupContext = (0, import_react35.createContext)(null);
|
|
9464
9764
|
var RadioGroup = ({
|
|
9465
9765
|
children,
|
|
9466
9766
|
name,
|
|
@@ -9468,21 +9768,21 @@ var RadioGroup = ({
|
|
|
9468
9768
|
value,
|
|
9469
9769
|
...props
|
|
9470
9770
|
}) => {
|
|
9471
|
-
const context = (0,
|
|
9771
|
+
const context = (0, import_react35.useMemo)(() => {
|
|
9472
9772
|
return {
|
|
9473
9773
|
name,
|
|
9474
9774
|
onChange
|
|
9475
9775
|
};
|
|
9476
9776
|
}, [name, onChange]);
|
|
9477
|
-
return /* @__PURE__ */ (0,
|
|
9777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(RadioGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(FormGroup, { ...props, children }) });
|
|
9478
9778
|
};
|
|
9479
9779
|
RadioGroup.displayName = "RadioGroup";
|
|
9480
9780
|
|
|
9481
9781
|
// src/components/IconButton/IconButton.tsx
|
|
9482
|
-
var
|
|
9483
|
-
var
|
|
9484
|
-
var
|
|
9485
|
-
var StyledButton2 = (0,
|
|
9782
|
+
var import_react36 = require("react");
|
|
9783
|
+
var import_styled_components51 = __toESM(require("styled-components"));
|
|
9784
|
+
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
9785
|
+
var StyledButton2 = (0, import_styled_components51.default)(Button)`
|
|
9486
9786
|
--icon-button-size-sm: 24px;
|
|
9487
9787
|
--icon-button-size-md: 32px;
|
|
9488
9788
|
--icon-button-size-lg: 40px;
|
|
@@ -9496,10 +9796,10 @@ var StyledButton2 = (0, import_styled_components50.default)(Button)`
|
|
|
9496
9796
|
align-items: center;
|
|
9497
9797
|
line-height: 1;
|
|
9498
9798
|
`;
|
|
9499
|
-
var IconButton = (0,
|
|
9799
|
+
var IconButton = (0, import_react36.forwardRef)(
|
|
9500
9800
|
({ children, label, size = "md", ...props }, ref) => {
|
|
9501
9801
|
const responsiveSize = useResponsiveProp(size);
|
|
9502
|
-
return /* @__PURE__ */ (0,
|
|
9802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
9503
9803
|
StyledButton2,
|
|
9504
9804
|
{
|
|
9505
9805
|
...props,
|
|
@@ -9507,7 +9807,7 @@ var IconButton = (0, import_react34.forwardRef)(
|
|
|
9507
9807
|
"aria-label": label,
|
|
9508
9808
|
"data-wistia-ui-icon-button": true,
|
|
9509
9809
|
size: responsiveSize,
|
|
9510
|
-
children: (0,
|
|
9810
|
+
children: (0, import_react36.cloneElement)(import_react36.Children.only(children), {
|
|
9511
9811
|
size: responsiveSize
|
|
9512
9812
|
})
|
|
9513
9813
|
}
|
|
@@ -9517,9 +9817,9 @@ var IconButton = (0, import_react34.forwardRef)(
|
|
|
9517
9817
|
IconButton.displayName = "IconButton";
|
|
9518
9818
|
|
|
9519
9819
|
// src/components/Image/Image.tsx
|
|
9520
|
-
var
|
|
9521
|
-
var
|
|
9522
|
-
var
|
|
9820
|
+
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9821
|
+
var import_type_guards31 = require("@wistia/type-guards");
|
|
9822
|
+
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
9523
9823
|
var getFillStyle2 = (fillContainer) => {
|
|
9524
9824
|
if (fillContainer === "horizontal") {
|
|
9525
9825
|
return "width: 100%;";
|
|
@@ -9535,8 +9835,8 @@ var getFillStyle2 = (fillContainer) => {
|
|
|
9535
9835
|
}
|
|
9536
9836
|
return void 0;
|
|
9537
9837
|
};
|
|
9538
|
-
var StyledImage =
|
|
9539
|
-
border-radius: ${({ $borderRadius }) => (0,
|
|
9838
|
+
var StyledImage = import_styled_components52.default.img`
|
|
9839
|
+
border-radius: ${({ $borderRadius }) => (0, import_type_guards31.isNotNil)($borderRadius) ? `var(--wui-${$borderRadius})` : void 0};
|
|
9540
9840
|
${({ $fillContainer }) => getFillStyle2($fillContainer)};
|
|
9541
9841
|
object-fit: ${({ $objFit }) => $objFit};
|
|
9542
9842
|
object-position: ${({ $objPosition }) => $objPosition};
|
|
@@ -9550,7 +9850,7 @@ var Image = ({
|
|
|
9550
9850
|
loading = "lazy",
|
|
9551
9851
|
position: objPosition,
|
|
9552
9852
|
...otherProps
|
|
9553
|
-
}) => /* @__PURE__ */ (0,
|
|
9853
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
9554
9854
|
StyledImage,
|
|
9555
9855
|
{
|
|
9556
9856
|
$borderRadius: borderRadius,
|
|
@@ -9566,19 +9866,19 @@ var Image = ({
|
|
|
9566
9866
|
Image.displayName = "Image";
|
|
9567
9867
|
|
|
9568
9868
|
// src/components/Menu/Menu.tsx
|
|
9569
|
-
var
|
|
9869
|
+
var import_styled_components53 = __toESM(require("styled-components"));
|
|
9570
9870
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
9571
|
-
var
|
|
9572
|
-
var
|
|
9871
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
9872
|
+
var import_react38 = require("react");
|
|
9573
9873
|
|
|
9574
9874
|
// src/components/Menu/MenuContext.tsx
|
|
9575
|
-
var
|
|
9576
|
-
var MenuContext = (0,
|
|
9577
|
-
var useMenuContext = () => (0,
|
|
9875
|
+
var import_react37 = require("react");
|
|
9876
|
+
var MenuContext = (0, import_react37.createContext)({ compact: false });
|
|
9877
|
+
var useMenuContext = () => (0, import_react37.useContext)(MenuContext);
|
|
9578
9878
|
|
|
9579
9879
|
// src/components/Menu/Menu.tsx
|
|
9580
|
-
var
|
|
9581
|
-
var open =
|
|
9880
|
+
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
9881
|
+
var open = import_styled_components53.keyframes`
|
|
9582
9882
|
from {
|
|
9583
9883
|
opacity: 0;
|
|
9584
9884
|
transform: scale(.97) translateY(-8px);
|
|
@@ -9588,7 +9888,7 @@ var open = import_styled_components52.keyframes`
|
|
|
9588
9888
|
transform: scale(1);
|
|
9589
9889
|
}
|
|
9590
9890
|
`;
|
|
9591
|
-
var close =
|
|
9891
|
+
var close = import_styled_components53.keyframes`
|
|
9592
9892
|
from {
|
|
9593
9893
|
opacity: 1;
|
|
9594
9894
|
transform: scale(1);
|
|
@@ -9598,7 +9898,7 @@ var close = import_styled_components52.keyframes`
|
|
|
9598
9898
|
transform: scale(.97) translateY(-8px);
|
|
9599
9899
|
}
|
|
9600
9900
|
`;
|
|
9601
|
-
var menuItemCss =
|
|
9901
|
+
var menuItemCss = import_styled_components53.css`
|
|
9602
9902
|
--menu-label-description-gap: var(--wui-space-01);
|
|
9603
9903
|
--menu-item-inner-gap: var(--wui-space-03);
|
|
9604
9904
|
--menu-item-left-icon-size: 24px;
|
|
@@ -9609,7 +9909,7 @@ var menuItemCss = import_styled_components52.css`
|
|
|
9609
9909
|
--menu-label-line-height: var(--wui-typography-label-3-line-height);
|
|
9610
9910
|
--menu-divider-margin: var(--wui-space-02);
|
|
9611
9911
|
`;
|
|
9612
|
-
var compactMenuItemCss =
|
|
9912
|
+
var compactMenuItemCss = import_styled_components53.css`
|
|
9613
9913
|
--menu-label-description-gap: 0;
|
|
9614
9914
|
--menu-item-inner-gap: var(--wui-space-02);
|
|
9615
9915
|
--menu-item-left-icon-size: 16px;
|
|
@@ -9620,7 +9920,7 @@ var compactMenuItemCss = import_styled_components52.css`
|
|
|
9620
9920
|
--menu-label-line-height: var(--wui-typography-label-4-line-height);
|
|
9621
9921
|
--menu-divider-margin: var(--wui-space-01);
|
|
9622
9922
|
`;
|
|
9623
|
-
var menuContentCss =
|
|
9923
|
+
var menuContentCss = import_styled_components53.css`
|
|
9624
9924
|
--menu-font-family: var(--wui-typography-family-default);
|
|
9625
9925
|
--menu-bg: var(--wui-color-bg-surface);
|
|
9626
9926
|
--menu-shadow: var(--wui-elevation-01);
|
|
@@ -9662,7 +9962,7 @@ var menuContentCss = import_styled_components52.css`
|
|
|
9662
9962
|
margin: var(--menu-divider-margin) 0;
|
|
9663
9963
|
}
|
|
9664
9964
|
`;
|
|
9665
|
-
var MenuContent = (0,
|
|
9965
|
+
var MenuContent = (0, import_styled_components53.default)(import_react_dropdown_menu.DropdownMenuContent)`
|
|
9666
9966
|
${menuContentCss}
|
|
9667
9967
|
`;
|
|
9668
9968
|
var Menu = ({
|
|
@@ -9678,9 +9978,9 @@ var Menu = ({
|
|
|
9678
9978
|
onInteractOutside,
|
|
9679
9979
|
...props
|
|
9680
9980
|
}) => {
|
|
9681
|
-
const contextValue = (0,
|
|
9981
|
+
const contextValue = (0, import_react38.useMemo)(() => ({ compact }), [compact]);
|
|
9682
9982
|
let controlProps = {
|
|
9683
|
-
...(0,
|
|
9983
|
+
...(0, import_type_guards32.isNotNil)(onOpenChange) && (0, import_type_guards32.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
9684
9984
|
};
|
|
9685
9985
|
if (disabled) {
|
|
9686
9986
|
controlProps = {
|
|
@@ -9688,24 +9988,24 @@ var Menu = ({
|
|
|
9688
9988
|
onOpenChange: () => null
|
|
9689
9989
|
};
|
|
9690
9990
|
}
|
|
9691
|
-
return /* @__PURE__ */ (0,
|
|
9991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(MenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)(
|
|
9692
9992
|
import_react_dropdown_menu.DropdownMenu,
|
|
9693
9993
|
{
|
|
9694
9994
|
modal: false,
|
|
9695
9995
|
...controlProps,
|
|
9696
9996
|
children: [
|
|
9697
|
-
/* @__PURE__ */ (0,
|
|
9997
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards32.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
9698
9998
|
Button,
|
|
9699
9999
|
{
|
|
9700
10000
|
"aria-expanded": isOpen,
|
|
9701
10001
|
disabled,
|
|
9702
10002
|
forceState: isOpen ? "active" : void 0,
|
|
9703
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
10003
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(Icon, { type: "caret-down" }),
|
|
9704
10004
|
...triggerProps,
|
|
9705
10005
|
children: label
|
|
9706
10006
|
}
|
|
9707
10007
|
) }),
|
|
9708
|
-
/* @__PURE__ */ (0,
|
|
10008
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(import_react_dropdown_menu.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
9709
10009
|
MenuContent,
|
|
9710
10010
|
{
|
|
9711
10011
|
...props,
|
|
@@ -9725,19 +10025,19 @@ var Menu = ({
|
|
|
9725
10025
|
Menu.displayName = "Menu";
|
|
9726
10026
|
|
|
9727
10027
|
// src/components/Menu/MenuLabel.tsx
|
|
9728
|
-
var
|
|
10028
|
+
var import_styled_components54 = __toESM(require("styled-components"));
|
|
9729
10029
|
var import_react_dropdown_menu2 = require("@radix-ui/react-dropdown-menu");
|
|
9730
|
-
var
|
|
9731
|
-
var StyledMenuLabel = (0,
|
|
10030
|
+
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
10031
|
+
var StyledMenuLabel = (0, import_styled_components54.default)(import_react_dropdown_menu2.DropdownMenuLabel)`
|
|
9732
10032
|
padding: var(--wui-space-02);
|
|
9733
10033
|
`;
|
|
9734
10034
|
var MenuLabel = ({ children, ...props }) => {
|
|
9735
|
-
return /* @__PURE__ */ (0,
|
|
10035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
9736
10036
|
StyledMenuLabel,
|
|
9737
10037
|
{
|
|
9738
10038
|
asChild: true,
|
|
9739
10039
|
...props,
|
|
9740
|
-
children: /* @__PURE__ */ (0,
|
|
10040
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
9741
10041
|
Heading,
|
|
9742
10042
|
{
|
|
9743
10043
|
renderAs: "span",
|
|
@@ -9752,17 +10052,17 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
9752
10052
|
MenuLabel.displayName = "MenuLabel";
|
|
9753
10053
|
|
|
9754
10054
|
// src/components/Menu/SubMenu.tsx
|
|
9755
|
-
var
|
|
9756
|
-
var
|
|
10055
|
+
var import_react40 = require("react");
|
|
10056
|
+
var import_styled_components57 = __toESM(require("styled-components"));
|
|
9757
10057
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
9758
|
-
var
|
|
10058
|
+
var import_type_guards34 = require("@wistia/type-guards");
|
|
9759
10059
|
|
|
9760
10060
|
// src/components/Menu/MenuItemButton.tsx
|
|
9761
|
-
var
|
|
9762
|
-
var
|
|
9763
|
-
var
|
|
9764
|
-
var
|
|
9765
|
-
var StyledButton3 = (0,
|
|
10061
|
+
var import_react39 = require("react");
|
|
10062
|
+
var import_styled_components55 = __toESM(require("styled-components"));
|
|
10063
|
+
var import_type_guards33 = require("@wistia/type-guards");
|
|
10064
|
+
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
10065
|
+
var StyledButton3 = (0, import_styled_components55.default)(Button)`
|
|
9766
10066
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
9767
10067
|
|
|
9768
10068
|
display: flex;
|
|
@@ -9801,7 +10101,7 @@ var StyledButton3 = (0, import_styled_components54.default)(Button)`
|
|
|
9801
10101
|
padding-left: var(--wui-space-04);
|
|
9802
10102
|
}
|
|
9803
10103
|
`;
|
|
9804
|
-
var StyledLeftIconContainer =
|
|
10104
|
+
var StyledLeftIconContainer = import_styled_components55.default.div`
|
|
9805
10105
|
height: var(--menu-item-left-icon-size);
|
|
9806
10106
|
width: var(--menu-item-left-icon-size);
|
|
9807
10107
|
|
|
@@ -9812,7 +10112,7 @@ var StyledLeftIconContainer = import_styled_components54.default.div`
|
|
|
9812
10112
|
}
|
|
9813
10113
|
}
|
|
9814
10114
|
`;
|
|
9815
|
-
var StyledRightIconContainer =
|
|
10115
|
+
var StyledRightIconContainer = import_styled_components55.default.div`
|
|
9816
10116
|
height: var(--menu-item-right-icon-size);
|
|
9817
10117
|
width: var(--menu-item-right-icon-size);
|
|
9818
10118
|
|
|
@@ -9823,28 +10123,28 @@ var StyledRightIconContainer = import_styled_components54.default.div`
|
|
|
9823
10123
|
}
|
|
9824
10124
|
}
|
|
9825
10125
|
`;
|
|
9826
|
-
var StyledLabelAndDescriptionContainer =
|
|
10126
|
+
var StyledLabelAndDescriptionContainer = import_styled_components55.default.div`
|
|
9827
10127
|
display: flex;
|
|
9828
10128
|
flex-direction: column;
|
|
9829
10129
|
gap: var(--menu-label-description-gap);
|
|
9830
10130
|
flex-basis: 100%;
|
|
9831
10131
|
`;
|
|
9832
|
-
var StyledBadgeContainer =
|
|
10132
|
+
var StyledBadgeContainer = import_styled_components55.default.div`
|
|
9833
10133
|
align-self: start;
|
|
9834
10134
|
justify-self: end;
|
|
9835
10135
|
font-size: var(--wui-typography-label-4-size);
|
|
9836
10136
|
color: var(--wui-color-text-secondary);
|
|
9837
10137
|
`;
|
|
9838
|
-
var MenuItemButton = (0,
|
|
10138
|
+
var MenuItemButton = (0, import_react39.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
9839
10139
|
let { colorScheme, badge } = props;
|
|
9840
10140
|
if (appearance === "dangerous") {
|
|
9841
|
-
if ((0,
|
|
10141
|
+
if ((0, import_type_guards33.isNotUndefined)(colorScheme)) {
|
|
9842
10142
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
9843
10143
|
}
|
|
9844
10144
|
colorScheme = "error";
|
|
9845
10145
|
}
|
|
9846
10146
|
if (appearance === "gated") {
|
|
9847
|
-
badge = /* @__PURE__ */ (0,
|
|
10147
|
+
badge = /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
9848
10148
|
Icon,
|
|
9849
10149
|
{
|
|
9850
10150
|
colorScheme: "purple",
|
|
@@ -9856,7 +10156,7 @@ var MenuItemButton = (0, import_react37.forwardRef)(({ children, appearance, com
|
|
|
9856
10156
|
}
|
|
9857
10157
|
);
|
|
9858
10158
|
}
|
|
9859
|
-
return /* @__PURE__ */ (0,
|
|
10159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(
|
|
9860
10160
|
StyledButton3,
|
|
9861
10161
|
{
|
|
9862
10162
|
...props,
|
|
@@ -9866,10 +10166,10 @@ var MenuItemButton = (0, import_react37.forwardRef)(({ children, appearance, com
|
|
|
9866
10166
|
fullWidth: true,
|
|
9867
10167
|
unstyled: true,
|
|
9868
10168
|
children: [
|
|
9869
|
-
props.leftIcon ? /* @__PURE__ */ (0,
|
|
9870
|
-
/* @__PURE__ */ (0,
|
|
9871
|
-
(0,
|
|
9872
|
-
props.rightIcon ? /* @__PURE__ */ (0,
|
|
10169
|
+
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
10170
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
10171
|
+
(0, import_type_guards33.isNotNil)(badge) || (0, import_type_guards33.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
10172
|
+
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
9873
10173
|
]
|
|
9874
10174
|
}
|
|
9875
10175
|
);
|
|
@@ -9877,33 +10177,33 @@ var MenuItemButton = (0, import_react37.forwardRef)(({ children, appearance, com
|
|
|
9877
10177
|
MenuItemButton.displayName = "MenuItemButton";
|
|
9878
10178
|
|
|
9879
10179
|
// src/components/Menu/MenuItemLabelDescription.tsx
|
|
9880
|
-
var
|
|
9881
|
-
var
|
|
9882
|
-
var StyledMenuItemLabel =
|
|
9883
|
-
var StyledMenuItemDescription = (0,
|
|
10180
|
+
var import_styled_components56 = __toESM(require("styled-components"));
|
|
10181
|
+
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
10182
|
+
var StyledMenuItemLabel = import_styled_components56.default.span``;
|
|
10183
|
+
var StyledMenuItemDescription = (0, import_styled_components56.default)(Text).attrs({
|
|
9884
10184
|
variant: "body4",
|
|
9885
10185
|
prominence: "secondary"
|
|
9886
10186
|
})``;
|
|
9887
10187
|
var MenuItemLabel = ({ children }) => {
|
|
9888
|
-
return /* @__PURE__ */ (0,
|
|
10188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(StyledMenuItemLabel, { children });
|
|
9889
10189
|
};
|
|
9890
10190
|
var MenuItemDescription = ({ children }) => {
|
|
9891
|
-
return /* @__PURE__ */ (0,
|
|
10191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(StyledMenuItemDescription, { children });
|
|
9892
10192
|
};
|
|
9893
10193
|
|
|
9894
10194
|
// src/components/Menu/SubMenu.tsx
|
|
9895
|
-
var
|
|
9896
|
-
var SubMenuContent = (0,
|
|
10195
|
+
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
10196
|
+
var SubMenuContent = (0, import_styled_components57.default)(import_react_dropdown_menu3.DropdownMenuSubContent)`
|
|
9897
10197
|
${menuContentCss}
|
|
9898
10198
|
|
|
9899
10199
|
${mq.smAndDown} {
|
|
9900
10200
|
transform: translateX(-100%) !important;
|
|
9901
10201
|
}
|
|
9902
10202
|
`;
|
|
9903
|
-
var StyledMobileSubMenuItems =
|
|
10203
|
+
var StyledMobileSubMenuItems = import_styled_components57.default.div`
|
|
9904
10204
|
margin-left: var(--wui-space-04);
|
|
9905
10205
|
`;
|
|
9906
|
-
var StyledSubTrigger = (0,
|
|
10206
|
+
var StyledSubTrigger = (0, import_styled_components57.default)(import_react_dropdown_menu3.DropdownMenuSubTrigger)`
|
|
9907
10207
|
outline: none;
|
|
9908
10208
|
|
|
9909
10209
|
&[data-state='open'],
|
|
@@ -9914,12 +10214,12 @@ var StyledSubTrigger = (0, import_styled_components56.default)(import_react_drop
|
|
|
9914
10214
|
var SubMenuTrigger = ({ icon, ...props }) => {
|
|
9915
10215
|
const { isSmAndUp } = useMq();
|
|
9916
10216
|
const Trigger4 = isSmAndUp ? StyledSubTrigger : import_react_dropdown_menu3.DropdownMenuItem;
|
|
9917
|
-
return /* @__PURE__ */ (0,
|
|
10217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Trigger4, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
9918
10218
|
MenuItemButton,
|
|
9919
10219
|
{
|
|
9920
10220
|
...props,
|
|
9921
10221
|
leftIcon: icon,
|
|
9922
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
10222
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Icon, { type: "caret-right" })
|
|
9923
10223
|
}
|
|
9924
10224
|
) });
|
|
9925
10225
|
};
|
|
@@ -9931,16 +10231,16 @@ var SubMenu = ({
|
|
|
9931
10231
|
...props
|
|
9932
10232
|
}) => {
|
|
9933
10233
|
const { isSmAndUp } = useMq();
|
|
9934
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
10234
|
+
const [isExpanded, setIsExpanded] = (0, import_react40.useState)(false);
|
|
9935
10235
|
const { compact } = useMenuContext();
|
|
9936
|
-
return isSmAndUp ? /* @__PURE__ */ (0,
|
|
9937
|
-
/* @__PURE__ */ (0,
|
|
9938
|
-
/* @__PURE__ */ (0,
|
|
9939
|
-
(0,
|
|
10236
|
+
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
10237
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
10238
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(MenuItemLabel, { children: label }),
|
|
10239
|
+
(0, import_type_guards34.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(MenuItemDescription, { children: description }) : null
|
|
9940
10240
|
] }),
|
|
9941
|
-
/* @__PURE__ */ (0,
|
|
9942
|
-
] }) : /* @__PURE__ */ (0,
|
|
9943
|
-
/* @__PURE__ */ (0,
|
|
10241
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
10242
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
10243
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(
|
|
9944
10244
|
SubMenuTrigger,
|
|
9945
10245
|
{
|
|
9946
10246
|
...props,
|
|
@@ -9949,28 +10249,28 @@ var SubMenu = ({
|
|
|
9949
10249
|
setIsExpanded((prev) => !prev);
|
|
9950
10250
|
},
|
|
9951
10251
|
children: [
|
|
9952
|
-
/* @__PURE__ */ (0,
|
|
9953
|
-
/* @__PURE__ */ (0,
|
|
10252
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(MenuItemLabel, { children: label }),
|
|
10253
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(MenuItemDescription, { children: description })
|
|
9954
10254
|
]
|
|
9955
10255
|
}
|
|
9956
10256
|
),
|
|
9957
|
-
/* @__PURE__ */ (0,
|
|
10257
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(StyledMobileSubMenuItems, { children: isExpanded ? children : null })
|
|
9958
10258
|
] });
|
|
9959
10259
|
};
|
|
9960
10260
|
SubMenu.displayName = "SubMenu";
|
|
9961
10261
|
|
|
9962
10262
|
// src/components/Menu/MenuItem.tsx
|
|
9963
|
-
var
|
|
10263
|
+
var import_react41 = require("react");
|
|
9964
10264
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
9965
|
-
var
|
|
9966
|
-
var MenuItem = (0,
|
|
10265
|
+
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
10266
|
+
var MenuItem = (0, import_react41.forwardRef)(
|
|
9967
10267
|
({ onSelect = () => null, ...props }, ref) => {
|
|
9968
|
-
return /* @__PURE__ */ (0,
|
|
10268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
9969
10269
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
9970
10270
|
{
|
|
9971
10271
|
asChild: true,
|
|
9972
10272
|
onSelect,
|
|
9973
|
-
children: /* @__PURE__ */ (0,
|
|
10273
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
9974
10274
|
MenuItemButton,
|
|
9975
10275
|
{
|
|
9976
10276
|
...props,
|
|
@@ -9986,10 +10286,10 @@ MenuItem.displayName = "MenuItem";
|
|
|
9986
10286
|
|
|
9987
10287
|
// src/components/Menu/MenuRadioGroup.tsx
|
|
9988
10288
|
var import_react_dropdown_menu5 = require("@radix-ui/react-dropdown-menu");
|
|
9989
|
-
var
|
|
10289
|
+
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
9990
10290
|
var MenuRadioGroup = ({ children, label, ...props }) => {
|
|
9991
|
-
return /* @__PURE__ */ (0,
|
|
9992
|
-
/* @__PURE__ */ (0,
|
|
10291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(import_react_dropdown_menu5.DropdownMenuRadioGroup, { ...props, children: [
|
|
10292
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(MenuLabel, { children: label }),
|
|
9993
10293
|
children
|
|
9994
10294
|
] });
|
|
9995
10295
|
};
|
|
@@ -9997,11 +10297,11 @@ MenuRadioGroup.displayName = "MenuRadioGroup";
|
|
|
9997
10297
|
|
|
9998
10298
|
// src/components/Menu/RadioMenuItem.tsx
|
|
9999
10299
|
var import_react_dropdown_menu6 = require("@radix-ui/react-dropdown-menu");
|
|
10000
|
-
var
|
|
10300
|
+
var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
10001
10301
|
var RadioMenuItem = ({
|
|
10002
10302
|
onSelect,
|
|
10003
10303
|
value,
|
|
10004
|
-
indicator = /* @__PURE__ */ (0,
|
|
10304
|
+
indicator = /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
|
|
10005
10305
|
Icon,
|
|
10006
10306
|
{
|
|
10007
10307
|
size: "sm",
|
|
@@ -10011,17 +10311,17 @@ var RadioMenuItem = ({
|
|
|
10011
10311
|
...props
|
|
10012
10312
|
}) => {
|
|
10013
10313
|
const extraProps = onSelect ? { onSelect } : {};
|
|
10014
|
-
return /* @__PURE__ */ (0,
|
|
10314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
|
|
10015
10315
|
import_react_dropdown_menu6.DropdownMenuRadioItem,
|
|
10016
10316
|
{
|
|
10017
10317
|
...extraProps,
|
|
10018
10318
|
asChild: true,
|
|
10019
10319
|
value,
|
|
10020
|
-
children: /* @__PURE__ */ (0,
|
|
10320
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
|
|
10021
10321
|
MenuItemButton,
|
|
10022
10322
|
{
|
|
10023
10323
|
...props,
|
|
10024
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
10324
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(import_react_dropdown_menu6.DropdownMenuItemIndicator, { children: indicator })
|
|
10025
10325
|
}
|
|
10026
10326
|
)
|
|
10027
10327
|
}
|
|
@@ -10031,9 +10331,9 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
10031
10331
|
|
|
10032
10332
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
10033
10333
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
10034
|
-
var
|
|
10334
|
+
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
10035
10335
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
10036
|
-
return checked ? /* @__PURE__ */ (0,
|
|
10336
|
+
return checked ? /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(
|
|
10037
10337
|
"svg",
|
|
10038
10338
|
{
|
|
10039
10339
|
...props,
|
|
@@ -10043,14 +10343,14 @@ var CheckboxIndicator = ({ checked, ...props }) => {
|
|
|
10043
10343
|
width: "24",
|
|
10044
10344
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10045
10345
|
children: [
|
|
10046
|
-
/* @__PURE__ */ (0,
|
|
10346
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10047
10347
|
"path",
|
|
10048
10348
|
{
|
|
10049
10349
|
d: "m4 8c0-2.20914 1.79086-4 4-4h8c2.2091 0 4 1.79086 4 4v8c0 2.2091-1.7909 4-4 4h-8c-2.20914 0-4-1.7909-4-4z",
|
|
10050
10350
|
fill: "#2949e5"
|
|
10051
10351
|
}
|
|
10052
10352
|
),
|
|
10053
|
-
/* @__PURE__ */ (0,
|
|
10353
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10054
10354
|
"path",
|
|
10055
10355
|
{
|
|
10056
10356
|
d: "m10.4728 15.1931-3.09523-3.1131c-.18596-.187-.18596-.4902 0-.6773l.67341-.6773c.18596-.187.48749-.187.67344 0l2.08508 2.0971 4.4661-4.49174c.1859-.18703.4875-.18703.6734 0l.6734.67731c.186.18703.186.49027 0 .67731l-5.4762 5.50772c-.1859.187-.4874.187-.6734 0z",
|
|
@@ -10059,7 +10359,7 @@ var CheckboxIndicator = ({ checked, ...props }) => {
|
|
|
10059
10359
|
)
|
|
10060
10360
|
]
|
|
10061
10361
|
}
|
|
10062
|
-
) : /* @__PURE__ */ (0,
|
|
10362
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(
|
|
10063
10363
|
"svg",
|
|
10064
10364
|
{
|
|
10065
10365
|
...props,
|
|
@@ -10069,14 +10369,14 @@ var CheckboxIndicator = ({ checked, ...props }) => {
|
|
|
10069
10369
|
width: "24",
|
|
10070
10370
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10071
10371
|
children: [
|
|
10072
|
-
/* @__PURE__ */ (0,
|
|
10372
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10073
10373
|
"path",
|
|
10074
10374
|
{
|
|
10075
10375
|
d: "m8 4.5h8c1.933 0 3.5 1.567 3.5 3.5v8c0 1.933-1.567 3.5-3.5 3.5h-8c-1.933 0-3.5-1.567-3.5-3.5v-8c0-1.933 1.567-3.5 3.5-3.5z",
|
|
10076
10376
|
fill: "#fcfcfd"
|
|
10077
10377
|
}
|
|
10078
10378
|
),
|
|
10079
|
-
/* @__PURE__ */ (0,
|
|
10379
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10080
10380
|
"path",
|
|
10081
10381
|
{
|
|
10082
10382
|
d: "m8 4.5h8c1.933 0 3.5 1.567 3.5 3.5v8c0 1.933-1.567 3.5-3.5 3.5h-8c-1.933 0-3.5-1.567-3.5-3.5v-8c0-1.933 1.567-3.5 3.5-3.5z",
|
|
@@ -10093,18 +10393,18 @@ var CheckboxMenuItem = ({
|
|
|
10093
10393
|
onCheckedChange,
|
|
10094
10394
|
...props
|
|
10095
10395
|
}) => {
|
|
10096
|
-
return /* @__PURE__ */ (0,
|
|
10396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10097
10397
|
import_react_dropdown_menu7.DropdownMenuCheckboxItem,
|
|
10098
10398
|
{
|
|
10099
10399
|
asChild: true,
|
|
10100
10400
|
checked,
|
|
10101
10401
|
onCheckedChange,
|
|
10102
10402
|
onSelect,
|
|
10103
|
-
children: /* @__PURE__ */ (0,
|
|
10403
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10104
10404
|
MenuItemButton,
|
|
10105
10405
|
{
|
|
10106
10406
|
...props,
|
|
10107
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
10407
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(CheckboxIndicator, { checked })
|
|
10108
10408
|
}
|
|
10109
10409
|
)
|
|
10110
10410
|
}
|
|
@@ -10113,37 +10413,37 @@ var CheckboxMenuItem = ({
|
|
|
10113
10413
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
10114
10414
|
|
|
10115
10415
|
// src/components/Modal/Modal.tsx
|
|
10116
|
-
var
|
|
10117
|
-
var
|
|
10416
|
+
var import_react45 = require("react");
|
|
10417
|
+
var import_styled_components62 = __toESM(require("styled-components"));
|
|
10118
10418
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
10119
|
-
var
|
|
10419
|
+
var import_type_guards36 = require("@wistia/type-guards");
|
|
10120
10420
|
|
|
10121
10421
|
// src/components/Modal/ModalHeader.tsx
|
|
10122
|
-
var
|
|
10422
|
+
var import_styled_components59 = __toESM(require("styled-components"));
|
|
10123
10423
|
var import_react_dialog2 = require("@radix-ui/react-dialog");
|
|
10124
10424
|
|
|
10125
10425
|
// src/components/Modal/ModalCloseButton.tsx
|
|
10126
|
-
var
|
|
10426
|
+
var import_styled_components58 = __toESM(require("styled-components"));
|
|
10127
10427
|
var import_react_dialog = require("@radix-ui/react-dialog");
|
|
10128
|
-
var
|
|
10129
|
-
var CloseButton = (0,
|
|
10428
|
+
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
10429
|
+
var CloseButton = (0, import_styled_components58.default)(import_react_dialog.Close)`
|
|
10130
10430
|
align-self: start;
|
|
10131
10431
|
`;
|
|
10132
10432
|
var ModalCloseButton = () => {
|
|
10133
|
-
return /* @__PURE__ */ (0,
|
|
10433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(CloseButton, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
|
|
10134
10434
|
IconButton,
|
|
10135
10435
|
{
|
|
10136
10436
|
label: "Dismiss modal",
|
|
10137
10437
|
size: "sm",
|
|
10138
10438
|
variant: "ghost",
|
|
10139
|
-
children: /* @__PURE__ */ (0,
|
|
10439
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Icon, { type: "close" })
|
|
10140
10440
|
}
|
|
10141
10441
|
) });
|
|
10142
10442
|
};
|
|
10143
10443
|
|
|
10144
10444
|
// src/components/Modal/ModalHeader.tsx
|
|
10145
|
-
var
|
|
10146
|
-
var Header =
|
|
10445
|
+
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
10446
|
+
var Header = import_styled_components59.default.header`
|
|
10147
10447
|
display: flex;
|
|
10148
10448
|
order: 1;
|
|
10149
10449
|
gap: var(--wui-space-01);
|
|
@@ -10154,7 +10454,7 @@ var Header = import_styled_components58.default.header`
|
|
|
10154
10454
|
margin: 0 0 var(--wui-space-03);
|
|
10155
10455
|
}
|
|
10156
10456
|
`;
|
|
10157
|
-
var Title = (0,
|
|
10457
|
+
var Title = (0, import_styled_components59.default)(import_react_dialog2.Title)`
|
|
10158
10458
|
font-family: var(--wui-typography-heading-2-family);
|
|
10159
10459
|
line-height: var(--wui-typography-heading-2-line-height);
|
|
10160
10460
|
font-size: var(--wui-typography-heading-2-size);
|
|
@@ -10165,29 +10465,29 @@ var ModalHeader = ({
|
|
|
10165
10465
|
hideTitle,
|
|
10166
10466
|
hideCloseButton
|
|
10167
10467
|
}) => {
|
|
10168
|
-
const TitleComponent = hideTitle ? /* @__PURE__ */ (0,
|
|
10169
|
-
return /* @__PURE__ */ (0,
|
|
10468
|
+
const TitleComponent = hideTitle ? /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ScreenReaderOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(Title, { children: title }) }) : /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(Title, { children: title });
|
|
10469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(Header, { $hideTitle: hideTitle, children: [
|
|
10170
10470
|
TitleComponent,
|
|
10171
|
-
hideCloseButton ? null : /* @__PURE__ */ (0,
|
|
10471
|
+
hideCloseButton ? null : /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ModalCloseButton, {})
|
|
10172
10472
|
] });
|
|
10173
10473
|
};
|
|
10174
10474
|
|
|
10175
10475
|
// src/components/Modal/ModalContent.tsx
|
|
10176
|
-
var
|
|
10177
|
-
var
|
|
10476
|
+
var import_react43 = require("react");
|
|
10477
|
+
var import_styled_components60 = __toESM(require("styled-components"));
|
|
10178
10478
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
10179
10479
|
|
|
10180
10480
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10181
|
-
var
|
|
10182
|
-
var
|
|
10481
|
+
var import_react42 = require("react");
|
|
10482
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
10183
10483
|
var useFocusRestore = () => {
|
|
10184
|
-
const previouslyFocusedRef = (0,
|
|
10185
|
-
(0,
|
|
10484
|
+
const previouslyFocusedRef = (0, import_react42.useRef)(null);
|
|
10485
|
+
(0, import_react42.useEffect)(() => {
|
|
10186
10486
|
previouslyFocusedRef.current = document.activeElement;
|
|
10187
10487
|
}, []);
|
|
10188
|
-
(0,
|
|
10488
|
+
(0, import_react42.useEffect)(() => {
|
|
10189
10489
|
return () => {
|
|
10190
|
-
if ((0,
|
|
10490
|
+
if ((0, import_type_guards35.isNotNil)(previouslyFocusedRef.current)) {
|
|
10191
10491
|
setTimeout(() => {
|
|
10192
10492
|
previouslyFocusedRef.current?.focus();
|
|
10193
10493
|
}, 0);
|
|
@@ -10197,8 +10497,8 @@ var useFocusRestore = () => {
|
|
|
10197
10497
|
};
|
|
10198
10498
|
|
|
10199
10499
|
// src/components/Modal/ModalContent.tsx
|
|
10200
|
-
var
|
|
10201
|
-
var StyledModalContent = (0,
|
|
10500
|
+
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
10501
|
+
var StyledModalContent = (0, import_styled_components60.default)(import_react_dialog3.Content)`
|
|
10202
10502
|
background-color: var(--wui-color-bg-app);
|
|
10203
10503
|
box-sizing: border-box;
|
|
10204
10504
|
display: flex;
|
|
@@ -10239,10 +10539,10 @@ var StyledModalContent = (0, import_styled_components59.default)(import_react_di
|
|
|
10239
10539
|
}
|
|
10240
10540
|
}
|
|
10241
10541
|
`;
|
|
10242
|
-
var ModalContent = (0,
|
|
10542
|
+
var ModalContent = (0, import_react43.forwardRef)(
|
|
10243
10543
|
({ fullHeight, width, children, ...otherProps }, ref) => {
|
|
10244
10544
|
useFocusRestore();
|
|
10245
|
-
return /* @__PURE__ */ (0,
|
|
10545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
10246
10546
|
StyledModalContent,
|
|
10247
10547
|
{
|
|
10248
10548
|
ref,
|
|
@@ -10257,9 +10557,9 @@ var ModalContent = (0, import_react41.forwardRef)(
|
|
|
10257
10557
|
);
|
|
10258
10558
|
|
|
10259
10559
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
10260
|
-
var
|
|
10261
|
-
var
|
|
10262
|
-
var
|
|
10560
|
+
var import_react44 = require("react");
|
|
10561
|
+
var import_styled_components61 = __toESM(require("styled-components"));
|
|
10562
|
+
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
10263
10563
|
var backdropAnimationDuration = 150;
|
|
10264
10564
|
var alignVerticalMap = {
|
|
10265
10565
|
stretch: "normal",
|
|
@@ -10272,7 +10572,7 @@ var alignHorizontalMap = {
|
|
|
10272
10572
|
center: "center",
|
|
10273
10573
|
right: "end"
|
|
10274
10574
|
};
|
|
10275
|
-
var BackdropComponent =
|
|
10575
|
+
var BackdropComponent = import_styled_components61.default.div`
|
|
10276
10576
|
align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
|
|
10277
10577
|
animation-name: backdropShow;
|
|
10278
10578
|
animation-duration: ${() => `${backdropAnimationDuration}ms`};
|
|
@@ -10295,8 +10595,8 @@ var BackdropComponent = import_styled_components60.default.div`
|
|
|
10295
10595
|
}
|
|
10296
10596
|
}
|
|
10297
10597
|
`;
|
|
10298
|
-
var Backdrop = (0,
|
|
10299
|
-
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0,
|
|
10598
|
+
var Backdrop = (0, import_react44.forwardRef)(
|
|
10599
|
+
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
10300
10600
|
BackdropComponent,
|
|
10301
10601
|
{
|
|
10302
10602
|
ref,
|
|
@@ -10310,14 +10610,14 @@ var Backdrop = (0, import_react42.forwardRef)(
|
|
|
10310
10610
|
Backdrop.displayName = "Backdrop";
|
|
10311
10611
|
|
|
10312
10612
|
// src/components/Modal/Modal.tsx
|
|
10313
|
-
var
|
|
10613
|
+
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
10314
10614
|
var DEFAULT_MODAL_WIDTH = "532px";
|
|
10315
|
-
var ModalBody =
|
|
10615
|
+
var ModalBody = import_styled_components62.default.div`
|
|
10316
10616
|
flex-direction: column;
|
|
10317
10617
|
display: flex;
|
|
10318
10618
|
order: 2;
|
|
10319
10619
|
`;
|
|
10320
|
-
var Modal = (0,
|
|
10620
|
+
var Modal = (0, import_react45.forwardRef)(
|
|
10321
10621
|
({
|
|
10322
10622
|
children,
|
|
10323
10623
|
fullHeight = false,
|
|
@@ -10330,24 +10630,24 @@ var Modal = (0, import_react43.forwardRef)(
|
|
|
10330
10630
|
width = DEFAULT_MODAL_WIDTH,
|
|
10331
10631
|
...props
|
|
10332
10632
|
}, ref) => {
|
|
10333
|
-
return /* @__PURE__ */ (0,
|
|
10633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
10334
10634
|
import_react_dialog4.Root,
|
|
10335
10635
|
{
|
|
10336
10636
|
onOpenChange: (open2) => {
|
|
10337
|
-
if (!open2 && (0,
|
|
10637
|
+
if (!open2 && (0, import_type_guards36.isNotNil)(onRequestClose)) {
|
|
10338
10638
|
onRequestClose();
|
|
10339
10639
|
}
|
|
10340
10640
|
},
|
|
10341
10641
|
open: isOpen,
|
|
10342
|
-
children: /* @__PURE__ */ (0,
|
|
10343
|
-
/* @__PURE__ */ (0,
|
|
10344
|
-
/* @__PURE__ */ (0,
|
|
10642
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(import_react_dialog4.Portal, { children: [
|
|
10643
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(Backdrop, {}),
|
|
10644
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
|
|
10345
10645
|
ModalContent,
|
|
10346
10646
|
{
|
|
10347
10647
|
ref,
|
|
10348
10648
|
fullHeight,
|
|
10349
10649
|
onOpenAutoFocus: (event) => {
|
|
10350
|
-
if ((0,
|
|
10650
|
+
if ((0, import_type_guards36.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
10351
10651
|
event.preventDefault();
|
|
10352
10652
|
requestAnimationFrame(() => {
|
|
10353
10653
|
initialFocusRef.current?.focus();
|
|
@@ -10357,8 +10657,8 @@ var Modal = (0, import_react43.forwardRef)(
|
|
|
10357
10657
|
width,
|
|
10358
10658
|
...props,
|
|
10359
10659
|
children: [
|
|
10360
|
-
/* @__PURE__ */ (0,
|
|
10361
|
-
/* @__PURE__ */ (0,
|
|
10660
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(ModalBody, { children }),
|
|
10661
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
10362
10662
|
ModalHeader,
|
|
10363
10663
|
{
|
|
10364
10664
|
hideCloseButton,
|
|
@@ -10378,18 +10678,18 @@ Modal.displayName = "Modal";
|
|
|
10378
10678
|
|
|
10379
10679
|
// src/components/Popover/Popover.tsx
|
|
10380
10680
|
var import_react_popover = require("@radix-ui/react-popover");
|
|
10381
|
-
var
|
|
10681
|
+
var import_styled_components63 = __toESM(require("styled-components"));
|
|
10382
10682
|
|
|
10383
10683
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
10384
|
-
var
|
|
10684
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
10385
10685
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
10386
|
-
return (0,
|
|
10686
|
+
return (0, import_type_guards37.isNotNil)(onOpenChange) && (0, import_type_guards37.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
10387
10687
|
};
|
|
10388
10688
|
|
|
10389
10689
|
// src/components/Popover/Popover.tsx
|
|
10390
|
-
var
|
|
10391
|
-
var StyledContent2 = (0,
|
|
10392
|
-
${({ $unstyled }) => !$unstyled &&
|
|
10690
|
+
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
10691
|
+
var StyledContent2 = (0, import_styled_components63.default)(import_react_popover.Content)`
|
|
10692
|
+
${({ $unstyled }) => !$unstyled && import_styled_components63.css`
|
|
10393
10693
|
border-radius: var(--wui-border-radius-02);
|
|
10394
10694
|
padding: var(--wui-space-04);
|
|
10395
10695
|
max-width: 320px;
|
|
@@ -10413,25 +10713,25 @@ var Popover = ({
|
|
|
10413
10713
|
unstyled = false,
|
|
10414
10714
|
...props
|
|
10415
10715
|
}) => {
|
|
10416
|
-
return /* @__PURE__ */ (0,
|
|
10417
|
-
/* @__PURE__ */ (0,
|
|
10418
|
-
/* @__PURE__ */ (0,
|
|
10716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(import_react_popover.Root, { ...getControlProps(isOpen, onOpenChange), children: [
|
|
10717
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(import_react_popover.Trigger, { asChild: true, children: trigger }),
|
|
10718
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(import_react_popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(
|
|
10419
10719
|
StyledContent2,
|
|
10420
10720
|
{
|
|
10421
10721
|
sideOffset: 8,
|
|
10422
10722
|
...props,
|
|
10423
10723
|
$unstyled: unstyled,
|
|
10424
10724
|
children: [
|
|
10425
|
-
!hideCloseButton && /* @__PURE__ */ (0,
|
|
10725
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(import_react_popover.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
10426
10726
|
IconButton,
|
|
10427
10727
|
{
|
|
10428
10728
|
"data-wui-popover-close": true,
|
|
10429
10729
|
label: "Close",
|
|
10430
10730
|
variant: "ghost",
|
|
10431
|
-
children: /* @__PURE__ */ (0,
|
|
10731
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(Icon, { type: "close" })
|
|
10432
10732
|
}
|
|
10433
10733
|
) }),
|
|
10434
|
-
/* @__PURE__ */ (0,
|
|
10734
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)("div", { children })
|
|
10435
10735
|
]
|
|
10436
10736
|
}
|
|
10437
10737
|
) })
|
|
@@ -10440,11 +10740,11 @@ var Popover = ({
|
|
|
10440
10740
|
Popover.displayName = "Popover";
|
|
10441
10741
|
|
|
10442
10742
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
10443
|
-
var
|
|
10743
|
+
var import_styled_components64 = __toESM(require("styled-components"));
|
|
10444
10744
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
10445
|
-
var
|
|
10446
|
-
var
|
|
10447
|
-
var ProgressBarWrapper =
|
|
10745
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
10746
|
+
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
10747
|
+
var ProgressBarWrapper = import_styled_components64.default.div`
|
|
10448
10748
|
--progress-bar-height: 8px;
|
|
10449
10749
|
--progress-bar-indicator-color: var(--wui-color-bg-fill);
|
|
10450
10750
|
--progress-bar-background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -10460,7 +10760,7 @@ var getTranslateValue = (progress, max) => {
|
|
|
10460
10760
|
const progressPercentage = progress / max * 100;
|
|
10461
10761
|
return `translateX(-${100 - progressPercentage}%)`;
|
|
10462
10762
|
};
|
|
10463
|
-
var ProgressBarLabel =
|
|
10763
|
+
var ProgressBarLabel = import_styled_components64.default.div`
|
|
10464
10764
|
display: flex;
|
|
10465
10765
|
line-height: var(--wui-typography-label-3-line-height);
|
|
10466
10766
|
font-size: var(--wui-typography-label-3-size);
|
|
@@ -10468,7 +10768,7 @@ var ProgressBarLabel = import_styled_components63.default.div`
|
|
|
10468
10768
|
color: var(--wui-color-text-secondary);
|
|
10469
10769
|
flex-shrink: 0;
|
|
10470
10770
|
`;
|
|
10471
|
-
var StyledProgressIndicator = (0,
|
|
10771
|
+
var StyledProgressIndicator = (0, import_styled_components64.default)(import_react_progress.Indicator)`
|
|
10472
10772
|
background-color: var(--progress-bar-indicator-color);
|
|
10473
10773
|
width: 100%;
|
|
10474
10774
|
height: 100%;
|
|
@@ -10477,7 +10777,7 @@ var StyledProgressIndicator = (0, import_styled_components63.default)(import_rea
|
|
|
10477
10777
|
transition: transform 660ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
10478
10778
|
transform: ${({ $progress, $max }) => getTranslateValue($progress, $max)};
|
|
10479
10779
|
`;
|
|
10480
|
-
var StyledProgressBar = (0,
|
|
10780
|
+
var StyledProgressBar = (0, import_styled_components64.default)(import_react_progress.Root)`
|
|
10481
10781
|
position: relative;
|
|
10482
10782
|
overflow: hidden;
|
|
10483
10783
|
background: var(--progress-bar-background-color);
|
|
@@ -10496,15 +10796,15 @@ var ProgressBar = ({
|
|
|
10496
10796
|
labelRight,
|
|
10497
10797
|
...props
|
|
10498
10798
|
}) => {
|
|
10499
|
-
return /* @__PURE__ */ (0,
|
|
10500
|
-
(0,
|
|
10501
|
-
/* @__PURE__ */ (0,
|
|
10799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)(ProgressBarWrapper, { children: [
|
|
10800
|
+
(0, import_type_guards38.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
10801
|
+
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
10502
10802
|
StyledProgressBar,
|
|
10503
10803
|
{
|
|
10504
10804
|
max,
|
|
10505
10805
|
value: progress,
|
|
10506
10806
|
...props,
|
|
10507
|
-
children: /* @__PURE__ */ (0,
|
|
10807
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
10508
10808
|
StyledProgressIndicator,
|
|
10509
10809
|
{
|
|
10510
10810
|
$max: max,
|
|
@@ -10513,17 +10813,17 @@ var ProgressBar = ({
|
|
|
10513
10813
|
)
|
|
10514
10814
|
}
|
|
10515
10815
|
),
|
|
10516
|
-
(0,
|
|
10816
|
+
(0, import_type_guards38.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
10517
10817
|
] });
|
|
10518
10818
|
};
|
|
10519
10819
|
ProgressBar.displayName = "ProgressBar";
|
|
10520
10820
|
|
|
10521
10821
|
// src/components/Radio/Radio.tsx
|
|
10522
|
-
var
|
|
10523
|
-
var
|
|
10524
|
-
var
|
|
10525
|
-
var
|
|
10526
|
-
var RadioIcon = () => /* @__PURE__ */ (0,
|
|
10822
|
+
var import_react46 = require("react");
|
|
10823
|
+
var import_styled_components65 = __toESM(require("styled-components"));
|
|
10824
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
10825
|
+
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
10826
|
+
var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
10527
10827
|
"svg",
|
|
10528
10828
|
{
|
|
10529
10829
|
fill: "inherit",
|
|
@@ -10531,7 +10831,7 @@ var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
|
10531
10831
|
viewBox: "0 0 1 1",
|
|
10532
10832
|
width: "1",
|
|
10533
10833
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10534
|
-
children: /* @__PURE__ */ (0,
|
|
10834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
10535
10835
|
"circle",
|
|
10536
10836
|
{
|
|
10537
10837
|
cx: "0.5",
|
|
@@ -10542,7 +10842,7 @@ var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
|
10542
10842
|
)
|
|
10543
10843
|
}
|
|
10544
10844
|
);
|
|
10545
|
-
var sizeSmall2 =
|
|
10845
|
+
var sizeSmall2 = import_styled_components65.css`
|
|
10546
10846
|
width: 14px;
|
|
10547
10847
|
height: 14px;
|
|
10548
10848
|
min-width: 14px;
|
|
@@ -10553,7 +10853,7 @@ var sizeSmall2 = import_styled_components64.css`
|
|
|
10553
10853
|
height: 7px;
|
|
10554
10854
|
}
|
|
10555
10855
|
`;
|
|
10556
|
-
var sizeMedium2 =
|
|
10856
|
+
var sizeMedium2 = import_styled_components65.css`
|
|
10557
10857
|
width: 16px;
|
|
10558
10858
|
height: 16px;
|
|
10559
10859
|
min-width: 16px;
|
|
@@ -10564,7 +10864,7 @@ var sizeMedium2 = import_styled_components64.css`
|
|
|
10564
10864
|
height: 8px;
|
|
10565
10865
|
}
|
|
10566
10866
|
`;
|
|
10567
|
-
var sizeLarge2 =
|
|
10867
|
+
var sizeLarge2 = import_styled_components65.css`
|
|
10568
10868
|
width: 20px;
|
|
10569
10869
|
height: 20px;
|
|
10570
10870
|
min-width: 20px;
|
|
@@ -10580,14 +10880,14 @@ var getSizeCss2 = (size) => {
|
|
|
10580
10880
|
if (size === "lg") return sizeLarge2;
|
|
10581
10881
|
return sizeMedium2;
|
|
10582
10882
|
};
|
|
10583
|
-
var StyledRadioWrapper =
|
|
10883
|
+
var StyledRadioWrapper = import_styled_components65.default.div`
|
|
10584
10884
|
display: flex;
|
|
10585
10885
|
margin: 0;
|
|
10586
10886
|
|
|
10587
10887
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
10588
10888
|
user-select: none;
|
|
10589
10889
|
`;
|
|
10590
|
-
var StyledRadioInput =
|
|
10890
|
+
var StyledRadioInput = import_styled_components65.default.div`
|
|
10591
10891
|
${({ $size }) => getSizeCss2($size)}
|
|
10592
10892
|
line-height: 0;
|
|
10593
10893
|
margin: 0;
|
|
@@ -10609,7 +10909,7 @@ var StyledRadioInput = import_styled_components64.default.div`
|
|
|
10609
10909
|
}
|
|
10610
10910
|
}
|
|
10611
10911
|
`;
|
|
10612
|
-
var StyledHiddenRadioInput =
|
|
10912
|
+
var StyledHiddenRadioInput = import_styled_components65.default.input`
|
|
10613
10913
|
${visuallyHiddenStyle}
|
|
10614
10914
|
|
|
10615
10915
|
/* toggles display of faux-input border-color */
|
|
@@ -10622,7 +10922,7 @@ var StyledHiddenRadioInput = import_styled_components64.default.input`
|
|
|
10622
10922
|
display: block;
|
|
10623
10923
|
}
|
|
10624
10924
|
`;
|
|
10625
|
-
var Radio = (0,
|
|
10925
|
+
var Radio = (0, import_react46.forwardRef)(
|
|
10626
10926
|
({
|
|
10627
10927
|
checked,
|
|
10628
10928
|
disabled = false,
|
|
@@ -10637,15 +10937,15 @@ var Radio = (0, import_react44.forwardRef)(
|
|
|
10637
10937
|
hideLabel = false,
|
|
10638
10938
|
...props
|
|
10639
10939
|
}, ref) => {
|
|
10640
|
-
const generatedId = (0,
|
|
10641
|
-
const computedId = (0,
|
|
10642
|
-
return /* @__PURE__ */ (0,
|
|
10940
|
+
const generatedId = (0, import_react46.useId)();
|
|
10941
|
+
const computedId = (0, import_type_guards39.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
10942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(
|
|
10643
10943
|
StyledRadioWrapper,
|
|
10644
10944
|
{
|
|
10645
10945
|
$disabled: disabled,
|
|
10646
10946
|
"aria-invalid": props["aria-invalid"],
|
|
10647
10947
|
children: [
|
|
10648
|
-
/* @__PURE__ */ (0,
|
|
10948
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
10649
10949
|
StyledHiddenRadioInput,
|
|
10650
10950
|
{
|
|
10651
10951
|
...props,
|
|
@@ -10660,16 +10960,16 @@ var Radio = (0, import_react44.forwardRef)(
|
|
|
10660
10960
|
value
|
|
10661
10961
|
}
|
|
10662
10962
|
),
|
|
10663
|
-
/* @__PURE__ */ (0,
|
|
10963
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
10664
10964
|
FormControlLabel,
|
|
10665
10965
|
{
|
|
10666
|
-
controlSlot: /* @__PURE__ */ (0,
|
|
10966
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
10667
10967
|
StyledRadioInput,
|
|
10668
10968
|
{
|
|
10669
10969
|
$disabled: disabled,
|
|
10670
10970
|
$size: size,
|
|
10671
10971
|
"data-wui-faux-input": "true",
|
|
10672
|
-
children: /* @__PURE__ */ (0,
|
|
10972
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(RadioIcon, {})
|
|
10673
10973
|
}
|
|
10674
10974
|
),
|
|
10675
10975
|
description,
|
|
@@ -10687,32 +10987,32 @@ var Radio = (0, import_react44.forwardRef)(
|
|
|
10687
10987
|
Radio.displayName = "Radio";
|
|
10688
10988
|
|
|
10689
10989
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
10690
|
-
var
|
|
10691
|
-
var
|
|
10990
|
+
var import_react50 = require("react");
|
|
10991
|
+
var import_styled_components67 = __toESM(require("styled-components"));
|
|
10692
10992
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
10693
|
-
var
|
|
10993
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
10694
10994
|
|
|
10695
10995
|
// src/components/SegmentedControl/useSelectedItemMeasurements.tsx
|
|
10696
|
-
var
|
|
10697
|
-
var
|
|
10698
|
-
var SelectedItemMeasurementsContext = (0,
|
|
10996
|
+
var import_react47 = require("react");
|
|
10997
|
+
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
10998
|
+
var SelectedItemMeasurementsContext = (0, import_react47.createContext)(
|
|
10699
10999
|
null
|
|
10700
11000
|
);
|
|
10701
11001
|
var SelectedItemMeasurementsProvider = ({
|
|
10702
11002
|
children
|
|
10703
11003
|
}) => {
|
|
10704
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
10705
|
-
const contextValue = (0,
|
|
11004
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react47.useState)(null);
|
|
11005
|
+
const contextValue = (0, import_react47.useMemo)(
|
|
10706
11006
|
() => ({
|
|
10707
11007
|
setSelectedItemMeasurements,
|
|
10708
11008
|
selectedItemMeasurements
|
|
10709
11009
|
}),
|
|
10710
11010
|
[selectedItemMeasurements]
|
|
10711
11011
|
);
|
|
10712
|
-
return /* @__PURE__ */ (0,
|
|
11012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(SelectedItemMeasurementsContext.Provider, { value: contextValue, children });
|
|
10713
11013
|
};
|
|
10714
11014
|
var useSelectedItemMeasurements = () => {
|
|
10715
|
-
const context = (0,
|
|
11015
|
+
const context = (0, import_react47.useContext)(SelectedItemMeasurementsContext);
|
|
10716
11016
|
if (context === null) {
|
|
10717
11017
|
throw new Error(
|
|
10718
11018
|
"useSelectedItemMeasurements must be used within a SelectedItemMeasurementsProvider"
|
|
@@ -10722,15 +11022,15 @@ var useSelectedItemMeasurements = () => {
|
|
|
10722
11022
|
};
|
|
10723
11023
|
|
|
10724
11024
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
10725
|
-
var
|
|
10726
|
-
var
|
|
11025
|
+
var import_react49 = require("react");
|
|
11026
|
+
var import_styled_components66 = __toESM(require("styled-components"));
|
|
10727
11027
|
|
|
10728
11028
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
10729
|
-
var
|
|
10730
|
-
var SegmentedControlValueContext = (0,
|
|
11029
|
+
var import_react48 = require("react");
|
|
11030
|
+
var SegmentedControlValueContext = (0, import_react48.createContext)(null);
|
|
10731
11031
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
10732
11032
|
var useSegmentedControlValue = () => {
|
|
10733
|
-
const context = (0,
|
|
11033
|
+
const context = (0, import_react48.useContext)(SegmentedControlValueContext);
|
|
10734
11034
|
if (context === null) {
|
|
10735
11035
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
10736
11036
|
}
|
|
@@ -10738,8 +11038,8 @@ var useSegmentedControlValue = () => {
|
|
|
10738
11038
|
};
|
|
10739
11039
|
|
|
10740
11040
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
10741
|
-
var
|
|
10742
|
-
var SelectedItemIndicatorDiv =
|
|
11041
|
+
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
11042
|
+
var SelectedItemIndicatorDiv = import_styled_components66.default.div`
|
|
10743
11043
|
background-color: var(--wui-color-bg-fill-white);
|
|
10744
11044
|
border-radius: var(--wui-border-radius-rounded);
|
|
10745
11045
|
left: 0;
|
|
@@ -10754,7 +11054,7 @@ var SelectedItemIndicatorDiv = import_styled_components65.default.div`
|
|
|
10754
11054
|
var SelectedItemIndicator = () => {
|
|
10755
11055
|
const selectedValue = useSegmentedControlValue();
|
|
10756
11056
|
const { selectedItemMeasurements } = useSelectedItemMeasurements();
|
|
10757
|
-
const selectedItemIndicatorStyle = (0,
|
|
11057
|
+
const selectedItemIndicatorStyle = (0, import_react49.useMemo)(
|
|
10758
11058
|
() => selectedItemMeasurements != null ? {
|
|
10759
11059
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
10760
11060
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px)`,
|
|
@@ -10765,7 +11065,7 @@ var SelectedItemIndicator = () => {
|
|
|
10765
11065
|
if (!selectedValue) {
|
|
10766
11066
|
return null;
|
|
10767
11067
|
}
|
|
10768
|
-
return /* @__PURE__ */ (0,
|
|
11068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
|
|
10769
11069
|
SelectedItemIndicatorDiv,
|
|
10770
11070
|
{
|
|
10771
11071
|
style: {
|
|
@@ -10778,8 +11078,8 @@ var SelectedItemIndicator = () => {
|
|
|
10778
11078
|
};
|
|
10779
11079
|
|
|
10780
11080
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
10781
|
-
var
|
|
10782
|
-
var segmentedControlStyles =
|
|
11081
|
+
var import_jsx_runtime249 = require("react/jsx-runtime");
|
|
11082
|
+
var segmentedControlStyles = import_styled_components67.css`
|
|
10783
11083
|
display: inline-flex;
|
|
10784
11084
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
10785
11085
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -10789,10 +11089,10 @@ var segmentedControlStyles = import_styled_components66.css`
|
|
|
10789
11089
|
position: relative;
|
|
10790
11090
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
10791
11091
|
`;
|
|
10792
|
-
var StyledSegmentedControl = (0,
|
|
11092
|
+
var StyledSegmentedControl = (0, import_styled_components67.default)(import_react_toggle_group.Root)`
|
|
10793
11093
|
${segmentedControlStyles}
|
|
10794
11094
|
`;
|
|
10795
|
-
var SegmentedControl = (0,
|
|
11095
|
+
var SegmentedControl = (0, import_react50.forwardRef)(
|
|
10796
11096
|
({
|
|
10797
11097
|
children,
|
|
10798
11098
|
disabled = false,
|
|
@@ -10801,10 +11101,10 @@ var SegmentedControl = (0, import_react48.forwardRef)(
|
|
|
10801
11101
|
onSelectedValueChange,
|
|
10802
11102
|
...props
|
|
10803
11103
|
}, ref) => {
|
|
10804
|
-
if ((0,
|
|
11104
|
+
if ((0, import_type_guards40.isNil)(children)) {
|
|
10805
11105
|
return null;
|
|
10806
11106
|
}
|
|
10807
|
-
return /* @__PURE__ */ (0,
|
|
11107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
10808
11108
|
StyledSegmentedControl,
|
|
10809
11109
|
{
|
|
10810
11110
|
ref,
|
|
@@ -10816,8 +11116,8 @@ var SegmentedControl = (0, import_react48.forwardRef)(
|
|
|
10816
11116
|
type: "single",
|
|
10817
11117
|
value: selectedValue,
|
|
10818
11118
|
...props,
|
|
10819
|
-
children: /* @__PURE__ */ (0,
|
|
10820
|
-
/* @__PURE__ */ (0,
|
|
11119
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(SegmentedControlValueProvider, { value: selectedValue, children: /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(SelectedItemMeasurementsProvider, { children: [
|
|
11120
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(SelectedItemIndicator, {}),
|
|
10821
11121
|
children
|
|
10822
11122
|
] }) })
|
|
10823
11123
|
}
|
|
@@ -10827,28 +11127,28 @@ var SegmentedControl = (0, import_react48.forwardRef)(
|
|
|
10827
11127
|
SegmentedControl.displayName = "SegmentedControl";
|
|
10828
11128
|
|
|
10829
11129
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
10830
|
-
var
|
|
10831
|
-
var
|
|
11130
|
+
var import_react51 = require("react");
|
|
11131
|
+
var import_styled_components68 = __toESM(require("styled-components"));
|
|
10832
11132
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
10833
|
-
var
|
|
11133
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
10834
11134
|
|
|
10835
11135
|
// src/private/helpers/mergeRefs/mergeRefs.ts
|
|
10836
|
-
var
|
|
11136
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
10837
11137
|
var mergeRefs = (refs) => (value) => {
|
|
10838
11138
|
refs.forEach((ref) => {
|
|
10839
|
-
if ((0,
|
|
11139
|
+
if ((0, import_type_guards41.isFunction)(ref)) {
|
|
10840
11140
|
ref(value);
|
|
10841
11141
|
return;
|
|
10842
11142
|
}
|
|
10843
|
-
if ((0,
|
|
11143
|
+
if ((0, import_type_guards41.isNotNil)(ref)) {
|
|
10844
11144
|
ref.current = value;
|
|
10845
11145
|
}
|
|
10846
11146
|
});
|
|
10847
11147
|
};
|
|
10848
11148
|
|
|
10849
11149
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
10850
|
-
var
|
|
10851
|
-
var segmentedControlItemStyles =
|
|
11150
|
+
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
11151
|
+
var segmentedControlItemStyles = import_styled_components68.css`
|
|
10852
11152
|
all: unset; /* ToggleGroupItem is a button element */
|
|
10853
11153
|
align-items: center;
|
|
10854
11154
|
border-radius: var(--wui-border-radius-rounded);
|
|
@@ -10907,14 +11207,14 @@ var segmentedControlItemStyles = import_styled_components67.css`
|
|
|
10907
11207
|
}
|
|
10908
11208
|
}
|
|
10909
11209
|
`;
|
|
10910
|
-
var StyledSegmentedControlItem = (0,
|
|
11210
|
+
var StyledSegmentedControlItem = (0, import_styled_components68.default)(import_react_toggle_group2.Item)`
|
|
10911
11211
|
${segmentedControlItemStyles}
|
|
10912
11212
|
`;
|
|
10913
|
-
var SegmentedControlItem = (0,
|
|
11213
|
+
var SegmentedControlItem = (0, import_react51.forwardRef)(
|
|
10914
11214
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
10915
11215
|
const selectedValue = useSegmentedControlValue();
|
|
10916
11216
|
const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
|
|
10917
|
-
const buttonRef = (0,
|
|
11217
|
+
const buttonRef = (0, import_react51.useRef)(null);
|
|
10918
11218
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
10919
11219
|
const handleClick = (event) => {
|
|
10920
11220
|
const target = event.target;
|
|
@@ -10923,7 +11223,7 @@ var SegmentedControlItem = (0, import_react49.forwardRef)(
|
|
|
10923
11223
|
event.preventDefault();
|
|
10924
11224
|
}
|
|
10925
11225
|
};
|
|
10926
|
-
(0,
|
|
11226
|
+
(0, import_react51.useEffect)(() => {
|
|
10927
11227
|
const buttonElem = buttonRef.current;
|
|
10928
11228
|
if (!buttonElem) {
|
|
10929
11229
|
return void 0;
|
|
@@ -10948,12 +11248,12 @@ var SegmentedControlItem = (0, import_react49.forwardRef)(
|
|
|
10948
11248
|
resizeObserver.disconnect();
|
|
10949
11249
|
};
|
|
10950
11250
|
}, [selectedValue, setSelectedItemMeasurements, value]);
|
|
10951
|
-
return /* @__PURE__ */ (0,
|
|
11251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(
|
|
10952
11252
|
StyledSegmentedControlItem,
|
|
10953
11253
|
{
|
|
10954
11254
|
ref: combinedRef,
|
|
10955
|
-
$hasLabel: (0,
|
|
10956
|
-
"aria-label": (0,
|
|
11255
|
+
$hasLabel: (0, import_type_guards42.isNotNil)(label),
|
|
11256
|
+
"aria-label": (0, import_type_guards42.isNotNil)(label) ? void 0 : ariaLabel,
|
|
10957
11257
|
disabled,
|
|
10958
11258
|
onClick: handleClick,
|
|
10959
11259
|
value,
|
|
@@ -10969,10 +11269,10 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
10969
11269
|
|
|
10970
11270
|
// src/components/Select/Select.tsx
|
|
10971
11271
|
var import_react_select = require("@radix-ui/react-select");
|
|
10972
|
-
var
|
|
10973
|
-
var
|
|
10974
|
-
var
|
|
10975
|
-
var StyledTrigger = (0,
|
|
11272
|
+
var import_react52 = require("react");
|
|
11273
|
+
var import_styled_components69 = __toESM(require("styled-components"));
|
|
11274
|
+
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
11275
|
+
var StyledTrigger = (0, import_styled_components69.default)(import_react_select.Trigger)`
|
|
10976
11276
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
10977
11277
|
--wui-select-color-bg: var(--wui-color-bg-surface);
|
|
10978
11278
|
--wui-select-color-bg-disabled: var(--wui-color-bg-surface-disabled);
|
|
@@ -11020,7 +11320,7 @@ var StyledTrigger = (0, import_styled_components68.default)(import_react_select.
|
|
|
11020
11320
|
background-color: var(--wui-color-bg-surface-disabled);
|
|
11021
11321
|
}
|
|
11022
11322
|
`;
|
|
11023
|
-
var StyledContent3 = (0,
|
|
11323
|
+
var StyledContent3 = (0, import_styled_components69.default)(import_react_select.Content)`
|
|
11024
11324
|
--wui-select-content-border: var(--wui-color-border);
|
|
11025
11325
|
--wui-select-content-bg: var(--wui-color-bg-surface);
|
|
11026
11326
|
--wui-select-content-border-radius: var(--wui-border-radius-02);
|
|
@@ -11038,7 +11338,7 @@ var StyledContent3 = (0, import_styled_components68.default)(import_react_select
|
|
|
11038
11338
|
max-height: var(--radix-select-content-available-height);
|
|
11039
11339
|
z-index: var(--wui-zindex-select);
|
|
11040
11340
|
`;
|
|
11041
|
-
var Select = (0,
|
|
11341
|
+
var Select = (0, import_react52.forwardRef)(
|
|
11042
11342
|
({
|
|
11043
11343
|
colorScheme = "inherit",
|
|
11044
11344
|
children,
|
|
@@ -11048,13 +11348,13 @@ var Select = (0, import_react50.forwardRef)(
|
|
|
11048
11348
|
...props
|
|
11049
11349
|
}, forwardedRef) => {
|
|
11050
11350
|
const responsiveFullWidth = useResponsiveProp(fullWidth);
|
|
11051
|
-
return /* @__PURE__ */ (0,
|
|
11351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
11052
11352
|
import_react_select.Root,
|
|
11053
11353
|
{
|
|
11054
11354
|
...props,
|
|
11055
11355
|
onValueChange: onChange,
|
|
11056
11356
|
children: [
|
|
11057
|
-
/* @__PURE__ */ (0,
|
|
11357
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
11058
11358
|
StyledTrigger,
|
|
11059
11359
|
{
|
|
11060
11360
|
ref: forwardedRef,
|
|
@@ -11062,8 +11362,8 @@ var Select = (0, import_react50.forwardRef)(
|
|
|
11062
11362
|
$fullWidth: responsiveFullWidth,
|
|
11063
11363
|
...props,
|
|
11064
11364
|
children: [
|
|
11065
|
-
/* @__PURE__ */ (0,
|
|
11066
|
-
/* @__PURE__ */ (0,
|
|
11365
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(import_react_select.Value, { placeholder }),
|
|
11366
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
|
|
11067
11367
|
Icon,
|
|
11068
11368
|
{
|
|
11069
11369
|
size: "md",
|
|
@@ -11073,10 +11373,10 @@ var Select = (0, import_react50.forwardRef)(
|
|
|
11073
11373
|
]
|
|
11074
11374
|
}
|
|
11075
11375
|
),
|
|
11076
|
-
/* @__PURE__ */ (0,
|
|
11077
|
-
/* @__PURE__ */ (0,
|
|
11078
|
-
/* @__PURE__ */ (0,
|
|
11079
|
-
/* @__PURE__ */ (0,
|
|
11376
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(import_react_select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(StyledContent3, { position: "popper", children: [
|
|
11377
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(import_react_select.ScrollUpButton, { children: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(Icon, { type: "caret-up" }) }),
|
|
11378
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(import_react_select.Viewport, { children }),
|
|
11379
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(import_react_select.ScrollDownButton, { children: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(Icon, { type: "caret-down" }) })
|
|
11080
11380
|
] }) })
|
|
11081
11381
|
]
|
|
11082
11382
|
}
|
|
@@ -11087,10 +11387,10 @@ Select.displayName = "Select";
|
|
|
11087
11387
|
|
|
11088
11388
|
// src/components/Select/SelectOption.tsx
|
|
11089
11389
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11090
|
-
var
|
|
11091
|
-
var
|
|
11092
|
-
var
|
|
11093
|
-
var StyledItem = (0,
|
|
11390
|
+
var import_react53 = require("react");
|
|
11391
|
+
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11392
|
+
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11393
|
+
var StyledItem = (0, import_styled_components70.default)(import_react_select2.Item)`
|
|
11094
11394
|
${variantStyleMap2.body3};
|
|
11095
11395
|
display: flex;
|
|
11096
11396
|
padding: var(--wui-select-option-padding);
|
|
@@ -11113,25 +11413,25 @@ var StyledItem = (0, import_styled_components69.default)(import_react_select2.It
|
|
|
11113
11413
|
background-color: transparent;
|
|
11114
11414
|
}
|
|
11115
11415
|
`;
|
|
11116
|
-
var StyledIconContainer =
|
|
11416
|
+
var StyledIconContainer = import_styled_components70.default.span`
|
|
11117
11417
|
width: 12px;
|
|
11118
11418
|
`;
|
|
11119
|
-
var SelectOption = (0,
|
|
11419
|
+
var SelectOption = (0, import_react53.forwardRef)(
|
|
11120
11420
|
({ children, ...props }, forwardedRef) => {
|
|
11121
|
-
return /* @__PURE__ */ (0,
|
|
11421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
|
|
11122
11422
|
StyledItem,
|
|
11123
11423
|
{
|
|
11124
11424
|
...props,
|
|
11125
11425
|
ref: forwardedRef,
|
|
11126
11426
|
children: [
|
|
11127
|
-
/* @__PURE__ */ (0,
|
|
11427
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(StyledIconContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_react_select2.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
11128
11428
|
Icon,
|
|
11129
11429
|
{
|
|
11130
11430
|
size: "sm",
|
|
11131
11431
|
type: "checkmark"
|
|
11132
11432
|
}
|
|
11133
11433
|
) }) }),
|
|
11134
|
-
/* @__PURE__ */ (0,
|
|
11434
|
+
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_react_select2.ItemText, { children })
|
|
11135
11435
|
]
|
|
11136
11436
|
}
|
|
11137
11437
|
);
|
|
@@ -11141,14 +11441,14 @@ SelectOption.displayName = "Option";
|
|
|
11141
11441
|
|
|
11142
11442
|
// src/components/Select/SelectOptionGroup.tsx
|
|
11143
11443
|
var import_react_select3 = require("@radix-ui/react-select");
|
|
11144
|
-
var
|
|
11145
|
-
var
|
|
11146
|
-
var StyledLabel4 = (0,
|
|
11444
|
+
var import_styled_components71 = __toESM(require("styled-components"));
|
|
11445
|
+
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
11446
|
+
var StyledLabel4 = (0, import_styled_components71.default)(import_react_select3.Label)`
|
|
11147
11447
|
padding: var(--wui-select-option-padding);
|
|
11148
11448
|
`;
|
|
11149
11449
|
var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
11150
|
-
return /* @__PURE__ */ (0,
|
|
11151
|
-
/* @__PURE__ */ (0,
|
|
11450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(import_react_select3.Group, { ...props, children: [
|
|
11451
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsx)(StyledLabel4, { children: /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
|
|
11152
11452
|
Text,
|
|
11153
11453
|
{
|
|
11154
11454
|
prominence: "secondary",
|
|
@@ -11161,11 +11461,11 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11161
11461
|
};
|
|
11162
11462
|
|
|
11163
11463
|
// src/components/Switch/Switch.tsx
|
|
11164
|
-
var
|
|
11165
|
-
var
|
|
11166
|
-
var
|
|
11167
|
-
var
|
|
11168
|
-
var sizeSmall3 =
|
|
11464
|
+
var import_react54 = require("react");
|
|
11465
|
+
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11466
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
11467
|
+
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
11468
|
+
var sizeSmall3 = import_styled_components72.css`
|
|
11169
11469
|
--wui-size-small-width: 24px;
|
|
11170
11470
|
--wui-size-small-height: 14px;
|
|
11171
11471
|
|
|
@@ -11180,7 +11480,7 @@ var sizeSmall3 = import_styled_components71.css`
|
|
|
11180
11480
|
height: calc(var(--wui-size-small-width) / 2);
|
|
11181
11481
|
}
|
|
11182
11482
|
`;
|
|
11183
|
-
var sizeMedium3 =
|
|
11483
|
+
var sizeMedium3 = import_styled_components72.css`
|
|
11184
11484
|
--wui-size-medium-width: 32px;
|
|
11185
11485
|
--wui-size-medium-height: 18px;
|
|
11186
11486
|
|
|
@@ -11195,7 +11495,7 @@ var sizeMedium3 = import_styled_components71.css`
|
|
|
11195
11495
|
height: calc(var(--wui-size-medium-width) / 2);
|
|
11196
11496
|
}
|
|
11197
11497
|
`;
|
|
11198
|
-
var sizeLarge3 =
|
|
11498
|
+
var sizeLarge3 = import_styled_components72.css`
|
|
11199
11499
|
--wui-size-large-width: 40px;
|
|
11200
11500
|
--wui-size-large-height: 22px;
|
|
11201
11501
|
|
|
@@ -11215,14 +11515,14 @@ var getSizeCss3 = (size) => {
|
|
|
11215
11515
|
if (size === "lg") return sizeLarge3;
|
|
11216
11516
|
return sizeMedium3;
|
|
11217
11517
|
};
|
|
11218
|
-
var StyledSwitchWrapper =
|
|
11518
|
+
var StyledSwitchWrapper = import_styled_components72.default.div`
|
|
11219
11519
|
display: flex;
|
|
11220
11520
|
margin: 0;
|
|
11221
11521
|
|
|
11222
11522
|
/* TODO this solves a problem but potentially causes and a11y issue */
|
|
11223
11523
|
user-select: none;
|
|
11224
11524
|
`;
|
|
11225
|
-
var StyledSwitchInput =
|
|
11525
|
+
var StyledSwitchInput = import_styled_components72.default.div`
|
|
11226
11526
|
${({ $size }) => getSizeCss3($size)}
|
|
11227
11527
|
line-height: 0;
|
|
11228
11528
|
margin: 0;
|
|
@@ -11250,7 +11550,7 @@ var StyledSwitchInput = import_styled_components71.default.div`
|
|
|
11250
11550
|
transition: all 0.2s ease-in-out;
|
|
11251
11551
|
}
|
|
11252
11552
|
`;
|
|
11253
|
-
var StyledHiddenSwitchInput =
|
|
11553
|
+
var StyledHiddenSwitchInput = import_styled_components72.default.input`
|
|
11254
11554
|
${visuallyHiddenStyle}
|
|
11255
11555
|
|
|
11256
11556
|
/* toggles display of faux-input background-color and toggle position */
|
|
@@ -11266,7 +11566,7 @@ var StyledHiddenSwitchInput = import_styled_components71.default.input`
|
|
|
11266
11566
|
}
|
|
11267
11567
|
}
|
|
11268
11568
|
`;
|
|
11269
|
-
var Switch = (0,
|
|
11569
|
+
var Switch = (0, import_react54.forwardRef)(
|
|
11270
11570
|
({
|
|
11271
11571
|
checked,
|
|
11272
11572
|
disabled = false,
|
|
@@ -11281,10 +11581,10 @@ var Switch = (0, import_react52.forwardRef)(
|
|
|
11281
11581
|
hideLabel = false,
|
|
11282
11582
|
...props
|
|
11283
11583
|
}, ref) => {
|
|
11284
|
-
const generatedId = (0,
|
|
11285
|
-
const computedId = (0,
|
|
11286
|
-
return /* @__PURE__ */ (0,
|
|
11287
|
-
/* @__PURE__ */ (0,
|
|
11584
|
+
const generatedId = (0, import_react54.useId)();
|
|
11585
|
+
const computedId = (0, import_type_guards43.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
11587
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
11288
11588
|
StyledHiddenSwitchInput,
|
|
11289
11589
|
{
|
|
11290
11590
|
...props,
|
|
@@ -11299,10 +11599,10 @@ var Switch = (0, import_react52.forwardRef)(
|
|
|
11299
11599
|
value
|
|
11300
11600
|
}
|
|
11301
11601
|
),
|
|
11302
|
-
/* @__PURE__ */ (0,
|
|
11602
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
11303
11603
|
FormControlLabel,
|
|
11304
11604
|
{
|
|
11305
|
-
controlSlot: /* @__PURE__ */ (0,
|
|
11605
|
+
controlSlot: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
11306
11606
|
StyledSwitchInput,
|
|
11307
11607
|
{
|
|
11308
11608
|
$disabled: disabled,
|
|
@@ -11324,19 +11624,19 @@ var Switch = (0, import_react52.forwardRef)(
|
|
|
11324
11624
|
Switch.displayName = "Switch";
|
|
11325
11625
|
|
|
11326
11626
|
// src/components/Table/Table.tsx
|
|
11327
|
-
var
|
|
11328
|
-
var
|
|
11329
|
-
var StyledTable =
|
|
11627
|
+
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11628
|
+
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
11629
|
+
var StyledTable = import_styled_components73.default.table`
|
|
11330
11630
|
width: 100%;
|
|
11331
11631
|
border-collapse: collapse;
|
|
11332
11632
|
|
|
11333
|
-
${({ $striped }) => $striped &&
|
|
11633
|
+
${({ $striped }) => $striped && import_styled_components73.css`
|
|
11334
11634
|
tbody tr:nth-child(even) {
|
|
11335
11635
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
11336
11636
|
}
|
|
11337
11637
|
`}
|
|
11338
11638
|
|
|
11339
|
-
${({ $divided }) => $divided &&
|
|
11639
|
+
${({ $divided }) => $divided && import_styled_components73.css`
|
|
11340
11640
|
tr {
|
|
11341
11641
|
border-bottom: 1px solid var(--wui-color-border);
|
|
11342
11642
|
}
|
|
@@ -11348,7 +11648,7 @@ var Table = ({
|
|
|
11348
11648
|
divided = false,
|
|
11349
11649
|
...props
|
|
11350
11650
|
}) => {
|
|
11351
|
-
return /* @__PURE__ */ (0,
|
|
11651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
11352
11652
|
StyledTable,
|
|
11353
11653
|
{
|
|
11354
11654
|
$divided: divided,
|
|
@@ -11360,88 +11660,88 @@ var Table = ({
|
|
|
11360
11660
|
};
|
|
11361
11661
|
|
|
11362
11662
|
// src/components/Table/TableBody.tsx
|
|
11363
|
-
var
|
|
11663
|
+
var import_styled_components74 = __toESM(require("styled-components"));
|
|
11364
11664
|
|
|
11365
11665
|
// src/components/Table/TableSectionContext.ts
|
|
11366
|
-
var
|
|
11367
|
-
var TableSectionContext = (0,
|
|
11666
|
+
var import_react55 = require("react");
|
|
11667
|
+
var TableSectionContext = (0, import_react55.createContext)(null);
|
|
11368
11668
|
|
|
11369
11669
|
// src/components/Table/TableBody.tsx
|
|
11370
|
-
var
|
|
11371
|
-
var StyledTbody =
|
|
11670
|
+
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
11671
|
+
var StyledTbody = import_styled_components74.default.tbody``;
|
|
11372
11672
|
var TableBody = ({ children, ...props }) => {
|
|
11373
|
-
return /* @__PURE__ */ (0,
|
|
11673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(TableSectionContext.Provider, { value: "body", children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(StyledTbody, { ...props, children }) });
|
|
11374
11674
|
};
|
|
11375
11675
|
|
|
11376
11676
|
// src/components/Table/TableCell.tsx
|
|
11377
|
-
var
|
|
11378
|
-
var
|
|
11379
|
-
var
|
|
11380
|
-
var sharedStyles =
|
|
11677
|
+
var import_react56 = require("react");
|
|
11678
|
+
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11679
|
+
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
11680
|
+
var sharedStyles = import_styled_components75.css`
|
|
11381
11681
|
color: var(--wui-color-text);
|
|
11382
11682
|
padding: var(--wui-space-02);
|
|
11383
11683
|
text-align: left;
|
|
11384
11684
|
`;
|
|
11385
|
-
var StyledTh =
|
|
11685
|
+
var StyledTh = import_styled_components75.default.th`
|
|
11386
11686
|
${sharedStyles}
|
|
11387
11687
|
font-size: var(--wui-typography-body-4-size);
|
|
11388
11688
|
font-weight: var(--wui-typography-weight-label-bold);
|
|
11389
11689
|
line-height: var(--wui-typography-body-4-line-height);
|
|
11390
11690
|
`;
|
|
11391
|
-
var StyledTd =
|
|
11691
|
+
var StyledTd = import_styled_components75.default.td`
|
|
11392
11692
|
${sharedStyles}
|
|
11393
11693
|
font-size: var(--wui-typography-body-2-size);
|
|
11394
11694
|
font-weight: var(--wui-typography-body-2-weight);
|
|
11395
11695
|
line-height: var(--wui-typography-body-2-line-height);
|
|
11396
11696
|
`;
|
|
11397
11697
|
var TableCell = ({ children, ...props }) => {
|
|
11398
|
-
const section = (0,
|
|
11698
|
+
const section = (0, import_react56.useContext)(TableSectionContext);
|
|
11399
11699
|
if (section === "head") {
|
|
11400
|
-
return /* @__PURE__ */ (0,
|
|
11700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledTh, { ...props, children });
|
|
11401
11701
|
}
|
|
11402
|
-
return /* @__PURE__ */ (0,
|
|
11702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledTd, { ...props, children });
|
|
11403
11703
|
};
|
|
11404
11704
|
|
|
11405
11705
|
// src/components/Table/TableFooter.tsx
|
|
11406
|
-
var
|
|
11407
|
-
var
|
|
11408
|
-
var StyledTfoot =
|
|
11706
|
+
var import_styled_components76 = __toESM(require("styled-components"));
|
|
11707
|
+
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
11708
|
+
var StyledTfoot = import_styled_components76.default.tfoot``;
|
|
11409
11709
|
var TableFooter = ({ children, ...props }) => {
|
|
11410
|
-
return /* @__PURE__ */ (0,
|
|
11710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(TableSectionContext.Provider, { value: "footer", children: /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(StyledTfoot, { ...props, children }) });
|
|
11411
11711
|
};
|
|
11412
11712
|
|
|
11413
11713
|
// src/components/Table/TableHead.tsx
|
|
11414
|
-
var
|
|
11415
|
-
var
|
|
11416
|
-
var StyledThead =
|
|
11714
|
+
var import_styled_components77 = __toESM(require("styled-components"));
|
|
11715
|
+
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
11716
|
+
var StyledThead = import_styled_components77.default.thead``;
|
|
11417
11717
|
var TableHead = ({ children, ...props }) => {
|
|
11418
|
-
return /* @__PURE__ */ (0,
|
|
11718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(TableSectionContext.Provider, { value: "head", children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(StyledThead, { ...props, children }) });
|
|
11419
11719
|
};
|
|
11420
11720
|
|
|
11421
11721
|
// src/components/Table/TableRow.tsx
|
|
11422
|
-
var
|
|
11423
|
-
var
|
|
11424
|
-
var StyledTr =
|
|
11722
|
+
var import_styled_components78 = __toESM(require("styled-components"));
|
|
11723
|
+
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
11724
|
+
var StyledTr = import_styled_components78.default.tr``;
|
|
11425
11725
|
var TableRow = ({ children, ...props }) => {
|
|
11426
|
-
return /* @__PURE__ */ (0,
|
|
11726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(StyledTr, { ...props, children });
|
|
11427
11727
|
};
|
|
11428
11728
|
|
|
11429
11729
|
// src/components/Tabs/Tabs.tsx
|
|
11430
|
-
var
|
|
11730
|
+
var import_react61 = require("react");
|
|
11431
11731
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
11432
|
-
var
|
|
11433
|
-
var
|
|
11732
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
11733
|
+
var import_styled_components83 = __toESM(require("styled-components"));
|
|
11434
11734
|
|
|
11435
11735
|
// src/components/Tabs/TabPanel.tsx
|
|
11436
|
-
var
|
|
11736
|
+
var import_styled_components79 = __toESM(require("styled-components"));
|
|
11437
11737
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
11438
|
-
var
|
|
11439
|
-
var StyledTabPanel = (0,
|
|
11738
|
+
var import_jsx_runtime261 = require("react/jsx-runtime");
|
|
11739
|
+
var StyledTabPanel = (0, import_styled_components79.default)(import_react_tabs.Content)`
|
|
11440
11740
|
display: flex;
|
|
11441
11741
|
flex-direction: column;
|
|
11442
11742
|
`;
|
|
11443
11743
|
var TabPanel = ({ children, value, ...props }) => {
|
|
11444
|
-
return /* @__PURE__ */ (0,
|
|
11744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(
|
|
11445
11745
|
StyledTabPanel,
|
|
11446
11746
|
{
|
|
11447
11747
|
value,
|
|
@@ -11453,10 +11753,10 @@ var TabPanel = ({ children, value, ...props }) => {
|
|
|
11453
11753
|
TabPanel.displayName = "TabPanel";
|
|
11454
11754
|
|
|
11455
11755
|
// src/components/Tabs/TabList.tsx
|
|
11456
|
-
var
|
|
11756
|
+
var import_styled_components80 = __toESM(require("styled-components"));
|
|
11457
11757
|
var import_react_tabs2 = require("@radix-ui/react-tabs");
|
|
11458
|
-
var
|
|
11459
|
-
var StyledTabList = (0,
|
|
11758
|
+
var import_jsx_runtime262 = require("react/jsx-runtime");
|
|
11759
|
+
var StyledTabList = (0, import_styled_components80.default)(import_react_tabs2.List)`
|
|
11460
11760
|
${segmentedControlStyles}
|
|
11461
11761
|
|
|
11462
11762
|
margin-bottom: var(--wui-space-04);
|
|
@@ -11469,7 +11769,7 @@ var TabList = ({
|
|
|
11469
11769
|
ariaLabel,
|
|
11470
11770
|
...props
|
|
11471
11771
|
}) => {
|
|
11472
|
-
return /* @__PURE__ */ (0,
|
|
11772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(
|
|
11473
11773
|
StyledTabList,
|
|
11474
11774
|
{
|
|
11475
11775
|
$fullWidth: fullWidth,
|
|
@@ -11482,17 +11782,17 @@ var TabList = ({
|
|
|
11482
11782
|
TabList.displayName = "TabList";
|
|
11483
11783
|
|
|
11484
11784
|
// src/components/Tabs/TabItem.tsx
|
|
11485
|
-
var
|
|
11486
|
-
var
|
|
11785
|
+
var import_react58 = require("react");
|
|
11786
|
+
var import_styled_components81 = __toESM(require("styled-components"));
|
|
11487
11787
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
11488
|
-
var
|
|
11788
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
11489
11789
|
|
|
11490
11790
|
// src/components/Tabs/useTabsValue.tsx
|
|
11491
|
-
var
|
|
11492
|
-
var TabsValueContext = (0,
|
|
11791
|
+
var import_react57 = require("react");
|
|
11792
|
+
var TabsValueContext = (0, import_react57.createContext)(null);
|
|
11493
11793
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
11494
11794
|
var useTabsValue = () => {
|
|
11495
|
-
const context = (0,
|
|
11795
|
+
const context = (0, import_react57.useContext)(TabsValueContext);
|
|
11496
11796
|
if (context === null) {
|
|
11497
11797
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
11498
11798
|
}
|
|
@@ -11500,21 +11800,21 @@ var useTabsValue = () => {
|
|
|
11500
11800
|
};
|
|
11501
11801
|
|
|
11502
11802
|
// src/components/Tabs/TabItem.tsx
|
|
11503
|
-
var
|
|
11504
|
-
var StyledTabItem = (0,
|
|
11803
|
+
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
11804
|
+
var StyledTabItem = (0, import_styled_components81.default)(import_react_tabs3.Trigger)`
|
|
11505
11805
|
${segmentedControlItemStyles}
|
|
11506
11806
|
|
|
11507
11807
|
&:focus-visible {
|
|
11508
11808
|
outline: none;
|
|
11509
11809
|
}
|
|
11510
11810
|
`;
|
|
11511
|
-
var TabItem = (0,
|
|
11811
|
+
var TabItem = (0, import_react58.forwardRef)(
|
|
11512
11812
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11513
11813
|
const selectedValue = useTabsValue();
|
|
11514
11814
|
const { setSelectedItemMeasurements } = useSelectedItemMeasurements();
|
|
11515
|
-
const buttonRef = (0,
|
|
11815
|
+
const buttonRef = (0, import_react58.useRef)(null);
|
|
11516
11816
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11517
|
-
(0,
|
|
11817
|
+
(0, import_react58.useEffect)(() => {
|
|
11518
11818
|
const buttonElem = buttonRef.current;
|
|
11519
11819
|
if (!buttonElem) {
|
|
11520
11820
|
return void 0;
|
|
@@ -11539,12 +11839,12 @@ var TabItem = (0, import_react56.forwardRef)(
|
|
|
11539
11839
|
resizeObserver.disconnect();
|
|
11540
11840
|
};
|
|
11541
11841
|
}, [selectedValue, setSelectedItemMeasurements, value]);
|
|
11542
|
-
return /* @__PURE__ */ (0,
|
|
11842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime263.jsxs)(
|
|
11543
11843
|
StyledTabItem,
|
|
11544
11844
|
{
|
|
11545
11845
|
ref: combinedRef,
|
|
11546
|
-
$hasLabel: (0,
|
|
11547
|
-
"aria-label": (0,
|
|
11846
|
+
$hasLabel: (0, import_type_guards44.isNotNil)(label),
|
|
11847
|
+
"aria-label": (0, import_type_guards44.isNotNil)(label) ? void 0 : ariaLabel,
|
|
11548
11848
|
disabled,
|
|
11549
11849
|
value,
|
|
11550
11850
|
children: [
|
|
@@ -11558,16 +11858,16 @@ var TabItem = (0, import_react56.forwardRef)(
|
|
|
11558
11858
|
TabItem.displayName = "TabItem";
|
|
11559
11859
|
|
|
11560
11860
|
// src/components/Tabs/extractTabItems.ts
|
|
11561
|
-
var
|
|
11861
|
+
var import_react59 = require("react");
|
|
11562
11862
|
var extractTabItems = (children) => {
|
|
11563
11863
|
const tabItems = [];
|
|
11564
|
-
|
|
11565
|
-
if (!(0,
|
|
11864
|
+
import_react59.Children.forEach(children, (child) => {
|
|
11865
|
+
if (!(0, import_react59.isValidElement)(child)) {
|
|
11566
11866
|
return;
|
|
11567
11867
|
}
|
|
11568
11868
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
11569
11869
|
tabItems.push(child);
|
|
11570
|
-
} else if (child.type ===
|
|
11870
|
+
} else if (child.type === import_react59.Fragment) {
|
|
11571
11871
|
const fragmentElement = child;
|
|
11572
11872
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
11573
11873
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -11580,10 +11880,10 @@ var extractTabItems = (children) => {
|
|
|
11580
11880
|
};
|
|
11581
11881
|
|
|
11582
11882
|
// src/components/Tabs/SelectedItemIndicator.tsx
|
|
11583
|
-
var
|
|
11584
|
-
var
|
|
11585
|
-
var
|
|
11586
|
-
var TabsSelectedItemIndicatorDiv = (0,
|
|
11883
|
+
var import_react60 = require("react");
|
|
11884
|
+
var import_styled_components82 = __toESM(require("styled-components"));
|
|
11885
|
+
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
11886
|
+
var TabsSelectedItemIndicatorDiv = (0, import_styled_components82.default)(SelectedItemIndicatorDiv)`
|
|
11587
11887
|
&:has(~ ${StyledTabItem}:focus-visible) {
|
|
11588
11888
|
outline: 2px solid var(--wui-color-focus-ring);
|
|
11589
11889
|
}
|
|
@@ -11591,7 +11891,7 @@ var TabsSelectedItemIndicatorDiv = (0, import_styled_components81.default)(Selec
|
|
|
11591
11891
|
var SelectedItemIndicator2 = () => {
|
|
11592
11892
|
const { selectedItemMeasurements } = useSelectedItemMeasurements();
|
|
11593
11893
|
const selectedValue = useTabsValue();
|
|
11594
|
-
const selectedItemIndicatorStyle = (0,
|
|
11894
|
+
const selectedItemIndicatorStyle = (0, import_react60.useMemo)(
|
|
11595
11895
|
() => selectedItemMeasurements != null ? {
|
|
11596
11896
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
11597
11897
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px)`,
|
|
@@ -11602,7 +11902,7 @@ var SelectedItemIndicator2 = () => {
|
|
|
11602
11902
|
if (selectedValue == null) {
|
|
11603
11903
|
return null;
|
|
11604
11904
|
}
|
|
11605
|
-
return /* @__PURE__ */ (0,
|
|
11905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
|
|
11606
11906
|
TabsSelectedItemIndicatorDiv,
|
|
11607
11907
|
{
|
|
11608
11908
|
style: {
|
|
@@ -11615,24 +11915,24 @@ var SelectedItemIndicator2 = () => {
|
|
|
11615
11915
|
};
|
|
11616
11916
|
|
|
11617
11917
|
// src/components/Tabs/Tabs.tsx
|
|
11618
|
-
var
|
|
11619
|
-
var TabsContainer =
|
|
11918
|
+
var import_jsx_runtime265 = require("react/jsx-runtime");
|
|
11919
|
+
var TabsContainer = import_styled_components83.default.div`
|
|
11620
11920
|
display: flex;
|
|
11621
11921
|
flex-direction: column;
|
|
11622
11922
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
11623
11923
|
overflow: ${({ $stickyHeaders }) => $stickyHeaders ? "hidden" : "visible"};
|
|
11624
11924
|
`;
|
|
11625
|
-
var StickyTabContent =
|
|
11925
|
+
var StickyTabContent = import_styled_components83.default.div`
|
|
11626
11926
|
flex: ${({ $stickyHeaders }) => $stickyHeaders ? "1" : "initial"};
|
|
11627
11927
|
overflow-y: ${({ $stickyHeaders }) => $stickyHeaders ? "auto" : "visible"};
|
|
11628
11928
|
overflow-x: ${({ $stickyHeaders }) => $stickyHeaders ? "hidden" : "visible"};
|
|
11629
11929
|
`;
|
|
11630
|
-
var StyledTabsRoot = (0,
|
|
11930
|
+
var StyledTabsRoot = (0, import_styled_components83.default)(import_react_tabs4.Root)`
|
|
11631
11931
|
display: flex;
|
|
11632
11932
|
flex-direction: column;
|
|
11633
11933
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
11634
11934
|
`;
|
|
11635
|
-
var Tabs = (0,
|
|
11935
|
+
var Tabs = (0, import_react61.forwardRef)(
|
|
11636
11936
|
({
|
|
11637
11937
|
children,
|
|
11638
11938
|
fullWidth = true,
|
|
@@ -11644,13 +11944,13 @@ var Tabs = (0, import_react59.forwardRef)(
|
|
|
11644
11944
|
...otherProps
|
|
11645
11945
|
}, ref) => {
|
|
11646
11946
|
const tabItems = extractTabItems(children);
|
|
11647
|
-
const [internalSelectedValue, setInternalSelectedValue] = (0,
|
|
11947
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react61.useState)(defaultSelectedValue);
|
|
11648
11948
|
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
11649
11949
|
defaultValue: defaultSelectedValue,
|
|
11650
11950
|
onValueChange: setInternalSelectedValue
|
|
11651
11951
|
} : { value: selectedValue, onValueChange: onSelectedValueChange };
|
|
11652
11952
|
const currentValue = defaultSelectedValue !== void 0 ? internalSelectedValue : selectedValue;
|
|
11653
|
-
return /* @__PURE__ */ (0,
|
|
11953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(TabsContainer, { $stickyHeaders: stickyHeaders, children: /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
11654
11954
|
StyledTabsRoot,
|
|
11655
11955
|
{
|
|
11656
11956
|
ref,
|
|
@@ -11658,14 +11958,14 @@ var Tabs = (0, import_react59.forwardRef)(
|
|
|
11658
11958
|
activationMode: "automatic",
|
|
11659
11959
|
...otherProps,
|
|
11660
11960
|
...modeProps,
|
|
11661
|
-
children: /* @__PURE__ */ (0,
|
|
11662
|
-
/* @__PURE__ */ (0,
|
|
11961
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(TabsValueProvider, { value: currentValue, children: /* @__PURE__ */ (0, import_jsx_runtime265.jsxs)(SelectedItemMeasurementsProvider, { children: [
|
|
11962
|
+
/* @__PURE__ */ (0, import_jsx_runtime265.jsxs)(
|
|
11663
11963
|
TabList,
|
|
11664
11964
|
{
|
|
11665
11965
|
ariaLabel,
|
|
11666
11966
|
fullWidth,
|
|
11667
11967
|
children: [
|
|
11668
|
-
/* @__PURE__ */ (0,
|
|
11968
|
+
/* @__PURE__ */ (0, import_jsx_runtime265.jsx)(SelectedItemIndicator2, {}),
|
|
11669
11969
|
tabItems.map((tab) => {
|
|
11670
11970
|
const {
|
|
11671
11971
|
value,
|
|
@@ -11674,8 +11974,8 @@ var Tabs = (0, import_react59.forwardRef)(
|
|
|
11674
11974
|
label,
|
|
11675
11975
|
"aria-label": ariaLabelForTab
|
|
11676
11976
|
} = tab.props;
|
|
11677
|
-
if ((0,
|
|
11678
|
-
return /* @__PURE__ */ (0,
|
|
11977
|
+
if ((0, import_type_guards45.isNil)(icon)) {
|
|
11978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
11679
11979
|
TabItem,
|
|
11680
11980
|
{
|
|
11681
11981
|
disabled,
|
|
@@ -11685,8 +11985,8 @@ var Tabs = (0, import_react59.forwardRef)(
|
|
|
11685
11985
|
value
|
|
11686
11986
|
);
|
|
11687
11987
|
}
|
|
11688
|
-
if ((0,
|
|
11689
|
-
return /* @__PURE__ */ (0,
|
|
11988
|
+
if ((0, import_type_guards45.isNotNil)(label)) {
|
|
11989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
11690
11990
|
TabItem,
|
|
11691
11991
|
{
|
|
11692
11992
|
disabled,
|
|
@@ -11697,8 +11997,8 @@ var Tabs = (0, import_react59.forwardRef)(
|
|
|
11697
11997
|
value
|
|
11698
11998
|
);
|
|
11699
11999
|
}
|
|
11700
|
-
if ((0,
|
|
11701
|
-
return /* @__PURE__ */ (0,
|
|
12000
|
+
if ((0, import_type_guards45.isNotNil)(ariaLabelForTab)) {
|
|
12001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
11702
12002
|
TabItem,
|
|
11703
12003
|
{
|
|
11704
12004
|
"aria-label": ariaLabelForTab,
|
|
@@ -11714,7 +12014,7 @@ var Tabs = (0, import_react59.forwardRef)(
|
|
|
11714
12014
|
]
|
|
11715
12015
|
}
|
|
11716
12016
|
),
|
|
11717
|
-
/* @__PURE__ */ (0,
|
|
12017
|
+
/* @__PURE__ */ (0, import_jsx_runtime265.jsx)(StickyTabContent, { $stickyHeaders: stickyHeaders, children: tabItems.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
11718
12018
|
TabPanel,
|
|
11719
12019
|
{
|
|
11720
12020
|
value: tab.props.value,
|
|
@@ -11730,19 +12030,19 @@ var Tabs = (0, import_react59.forwardRef)(
|
|
|
11730
12030
|
Tabs.displayName = "Tabs";
|
|
11731
12031
|
|
|
11732
12032
|
// src/components/Tabs/Tab.tsx
|
|
11733
|
-
var
|
|
11734
|
-
var
|
|
11735
|
-
var Tab = (0,
|
|
11736
|
-
return /* @__PURE__ */ (0,
|
|
12033
|
+
var import_react62 = require("react");
|
|
12034
|
+
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
12035
|
+
var Tab = (0, import_react62.forwardRef)(({ children }, ref) => {
|
|
12036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)("div", { ref, children });
|
|
11737
12037
|
});
|
|
11738
12038
|
Tab.displayName = "Tab";
|
|
11739
12039
|
|
|
11740
12040
|
// src/components/Tag/Tag.tsx
|
|
11741
|
-
var
|
|
11742
|
-
var
|
|
11743
|
-
var
|
|
11744
|
-
var
|
|
11745
|
-
var TagLabel =
|
|
12041
|
+
var import_react63 = require("react");
|
|
12042
|
+
var import_styled_components84 = __toESM(require("styled-components"));
|
|
12043
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
12044
|
+
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
12045
|
+
var TagLabel = import_styled_components84.default.a`
|
|
11746
12046
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
11747
12047
|
font-size: var(--wui-typography-label-4-size);
|
|
11748
12048
|
font-weight: var(--wui-typography-label-4-weight);
|
|
@@ -11777,14 +12077,14 @@ var TagLabel = import_styled_components83.default.a`
|
|
|
11777
12077
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
11778
12078
|
}
|
|
11779
12079
|
`;
|
|
11780
|
-
var TagDivider =
|
|
12080
|
+
var TagDivider = import_styled_components84.default.div`
|
|
11781
12081
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
11782
12082
|
border-left: 1px solid var(--wui-color-border);
|
|
11783
12083
|
display: flex;
|
|
11784
12084
|
height: 14px;
|
|
11785
12085
|
width: 1px;
|
|
11786
12086
|
`;
|
|
11787
|
-
var StyledRemoveButton =
|
|
12087
|
+
var StyledRemoveButton = import_styled_components84.default.button`
|
|
11788
12088
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
11789
12089
|
all: unset;
|
|
11790
12090
|
cursor: pointer;
|
|
@@ -11812,7 +12112,7 @@ var StyledRemoveButton = import_styled_components83.default.button`
|
|
|
11812
12112
|
box-shadow: inset 0 0 0 2px var(--wui-color-border-secondary);
|
|
11813
12113
|
}
|
|
11814
12114
|
`;
|
|
11815
|
-
var StyledTag =
|
|
12115
|
+
var StyledTag = import_styled_components84.default.div`
|
|
11816
12116
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
11817
12117
|
align-items: center;
|
|
11818
12118
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
@@ -11825,37 +12125,37 @@ var StyledTag = import_styled_components83.default.div`
|
|
|
11825
12125
|
}
|
|
11826
12126
|
`;
|
|
11827
12127
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
11828
|
-
if ((0,
|
|
12128
|
+
if ((0, import_type_guards46.isNil)(onClickRemove)) {
|
|
11829
12129
|
return null;
|
|
11830
12130
|
}
|
|
11831
|
-
if ((0,
|
|
12131
|
+
if ((0, import_type_guards46.isNil)(onClickRemoveLabel)) {
|
|
11832
12132
|
throw new Error(
|
|
11833
12133
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
11834
12134
|
);
|
|
11835
12135
|
}
|
|
11836
|
-
return /* @__PURE__ */ (0,
|
|
11837
|
-
/* @__PURE__ */ (0,
|
|
11838
|
-
/* @__PURE__ */ (0,
|
|
12136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(import_jsx_runtime267.Fragment, { children: [
|
|
12137
|
+
/* @__PURE__ */ (0, import_jsx_runtime267.jsx)(TagDivider, { $colorScheme: colorScheme }),
|
|
12138
|
+
/* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(
|
|
11839
12139
|
StyledRemoveButton,
|
|
11840
12140
|
{
|
|
11841
12141
|
$colorScheme: colorScheme,
|
|
11842
12142
|
onClick: onClickRemove,
|
|
11843
12143
|
type: "button",
|
|
11844
12144
|
children: [
|
|
11845
|
-
/* @__PURE__ */ (0,
|
|
12145
|
+
/* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
11846
12146
|
Icon,
|
|
11847
12147
|
{
|
|
11848
12148
|
size: "sm",
|
|
11849
12149
|
type: "close"
|
|
11850
12150
|
}
|
|
11851
12151
|
),
|
|
11852
|
-
/* @__PURE__ */ (0,
|
|
12152
|
+
/* @__PURE__ */ (0, import_jsx_runtime267.jsx)(ScreenReaderOnly, { children: onClickRemoveLabel })
|
|
11853
12153
|
]
|
|
11854
12154
|
}
|
|
11855
12155
|
)
|
|
11856
12156
|
] });
|
|
11857
12157
|
};
|
|
11858
|
-
var Tag = (0,
|
|
12158
|
+
var Tag = (0, import_react63.forwardRef)(
|
|
11859
12159
|
({
|
|
11860
12160
|
onClickRemove,
|
|
11861
12161
|
colorScheme = "inherit",
|
|
@@ -11865,16 +12165,16 @@ var Tag = (0, import_react61.forwardRef)(
|
|
|
11865
12165
|
onClickRemoveLabel,
|
|
11866
12166
|
...otherProps
|
|
11867
12167
|
}, ref) => {
|
|
11868
|
-
const hasIcon = (0,
|
|
11869
|
-
const labelProps = (0,
|
|
11870
|
-
return /* @__PURE__ */ (0,
|
|
12168
|
+
const hasIcon = (0, import_type_guards46.isNotNil)(icon);
|
|
12169
|
+
const labelProps = (0, import_type_guards46.isNotNil)(href) && (0, import_type_guards46.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
12170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(
|
|
11871
12171
|
StyledTag,
|
|
11872
12172
|
{
|
|
11873
12173
|
ref,
|
|
11874
12174
|
$colorScheme: colorScheme,
|
|
11875
12175
|
...otherProps,
|
|
11876
12176
|
children: [
|
|
11877
|
-
/* @__PURE__ */ (0,
|
|
12177
|
+
/* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(
|
|
11878
12178
|
TagLabel,
|
|
11879
12179
|
{
|
|
11880
12180
|
...labelProps,
|
|
@@ -11885,7 +12185,7 @@ var Tag = (0, import_react61.forwardRef)(
|
|
|
11885
12185
|
]
|
|
11886
12186
|
}
|
|
11887
12187
|
),
|
|
11888
|
-
/* @__PURE__ */ (0,
|
|
12188
|
+
/* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
11889
12189
|
RemoveButton,
|
|
11890
12190
|
{
|
|
11891
12191
|
colorScheme,
|
|
@@ -11901,26 +12201,26 @@ var Tag = (0, import_react61.forwardRef)(
|
|
|
11901
12201
|
Tag.displayName = "Tag";
|
|
11902
12202
|
|
|
11903
12203
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
11904
|
-
var
|
|
11905
|
-
var
|
|
11906
|
-
var
|
|
12204
|
+
var import_styled_components85 = __toESM(require("styled-components"));
|
|
12205
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
12206
|
+
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
11907
12207
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
11908
12208
|
if (iconOnly) {
|
|
11909
|
-
return /* @__PURE__ */ (0,
|
|
12209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(
|
|
11910
12210
|
"g",
|
|
11911
12211
|
{
|
|
11912
12212
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
11913
12213
|
fill: brandmarkColor,
|
|
11914
|
-
children: /* @__PURE__ */ (0,
|
|
12214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("path", { d: "M16.09 17.1h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 26.53c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87ZM32.14 0c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
11915
12215
|
}
|
|
11916
12216
|
);
|
|
11917
12217
|
}
|
|
11918
|
-
return /* @__PURE__ */ (0,
|
|
12218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(
|
|
11919
12219
|
"g",
|
|
11920
12220
|
{
|
|
11921
12221
|
"data-testid": "ui-wistia-logo-brandmark",
|
|
11922
12222
|
fill: brandmarkColor,
|
|
11923
|
-
children: /* @__PURE__ */ (0,
|
|
12223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("path", { d: "M16.09 21.37h-5.2c-1.58 0-3.08.68-4.11 1.87L.21 30.8c4.78.25 9.78.25 13.3.25 18.31 0 20.89-11.27 20.89-16.55-1.59 1.93-6.06 6.87-18.32 6.87Zm16.05-17.1c-.08.92-.59 4.69-11.31 4.69-8.72 0-12.24 0-20.83-.17l6.44 7.4a6.657 6.657 0 0 0 4.96 2.3c2.13.03 5.05.06 5.53.06 11.01 0 17.19-5.05 17.19-9.89 0-2.01-.67-3.44-1.97-4.4Z" })
|
|
11924
12224
|
}
|
|
11925
12225
|
);
|
|
11926
12226
|
};
|
|
@@ -11928,12 +12228,12 @@ var renderLogotype = (logotypeColor, iconOnly) => {
|
|
|
11928
12228
|
if (iconOnly) {
|
|
11929
12229
|
return null;
|
|
11930
12230
|
}
|
|
11931
|
-
return /* @__PURE__ */ (0,
|
|
12231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(
|
|
11932
12232
|
"g",
|
|
11933
12233
|
{
|
|
11934
12234
|
"data-testid": "ui-wistia-logo-logotype",
|
|
11935
12235
|
fill: logotypeColor,
|
|
11936
|
-
children: /* @__PURE__ */ (0,
|
|
12236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("path", { d: "M70.16 8.66v15.18c0 1.68-.35 3.09-1.05 4.23a6.612 6.612 0 0 1-2.85 2.54c-1.19.55-2.52.82-4.01.82s-2.8-.28-4.01-.85a6.655 6.655 0 0 1-3.11-2.96c-.08.15-.16.29-.24.42a6.552 6.552 0 0 1-2.87 2.54c-1.2.56-2.54.85-4.01.85s-2.8-.27-3.94-.82a6.214 6.214 0 0 1-2.71-2.52c-.67-1.14-1.01-2.56-1.02-4.25l-.22-15.18h7.34V22.3c0 .82.19 1.37.56 1.67.39.28.85.42 1.38.42s1.02-.15 1.45-.45c.43-.3.65-.85.65-1.65V8.65h7.3v13.64c0 .8.22 1.35.65 1.65.43.3.91.45 1.45.45s.99-.14 1.36-.42c.39-.3.58-.85.58-1.67V8.66h7.34Zm2.45 0v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89A3.43 3.43 0 0 0 78.28.44c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.13 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm8.86 1.96c-1.42.4-2.6 1.11-3.54 2.14-.93 1.02-1.4 2.4-1.4 4.12 0 1.11.17 2.09.51 2.94.36.85.82 1.62 1.38 2.34.22.28.55.65.98 1.11.37.4.64.72.8.96.18.24.27.47.27.69 0 .5-.4.87-1.2 1.09-.8.21-1.62.31-2.47.31-.1-.01-.22-.02-.33-.02l1.02 6.94c.42.07.92.11 1.51.11 1.9 0 3.6-.28 5.1-.85 1.5-.56 2.68-1.42 3.54-2.56.88-1.14 1.31-2.55 1.31-4.23 0-.68-.07-1.31-.22-1.87-.13-.58-.32-1.09-.56-1.54a6.64 6.64 0 0 0-.8-1.27c-.3-.37-.74-.82-1.34-1.36-.39-.33-.67-.59-.85-.8-.18-.22-.27-.45-.27-.67 0-.46.26-.79.78-.98.53-.19 1.17-.29 1.91-.29.25 0 .51.01.78.04l-.71-6.88a10.4 10.4 0 0 0-1.56-.11c-1.66 0-3.21.21-4.65.62Zm19.54 15.71c-.99 0-1.71-.23-2.14-.69-.42-.47-.62-1.18-.62-2.11v-6.57h4.21V8.66h-4.21V3.38l-7.34 1.85V24.1c0 2.45.47 4.29 1.4 5.52.95 1.22 2.45 1.83 4.49 1.83.95 0 1.86-.07 2.74-.22.88-.13 1.62-.34 2.25-.62l1.38-6.3c-.55.1-1.27.16-2.16.16Zm4.13-15.8v22.26h7.34V8.66h-7.34Zm5.67-1.87c.61-.3 1.08-.71 1.42-1.25.36-.55.53-1.19.53-1.94s-.18-1.34-.53-1.89a3.43 3.43 0 0 0-1.42-1.27c-.59-.3-1.25-.45-1.98-.45s-1.42.15-2.02.45c-.59.3-1.07.72-1.42 1.27-.36.55-.53 1.18-.53 1.89 0 1.1.38 1.97 1.14 2.63.76.65 1.71.98 2.85.98.73 0 1.39-.14 1.98-.42Zm27.51 1.87v22.26h-7.34v-2.28c-.41.43-.85.83-1.34 1.19-1.44 1.07-3.12 1.6-5.05 1.6s-3.61-.52-5.1-1.56c-1.48-1.05-2.63-2.47-3.45-4.25-.82-1.78-1.22-3.73-1.22-5.85s.41-4.07 1.22-5.83c.82-1.78 1.97-3.19 3.45-4.23 1.48-1.05 3.18-1.58 5.1-1.58s3.61.53 5.05 1.6c.48.36.93.75 1.34 1.19V8.66h7.34Zm-7.1 11.11c0-.8-.19-1.53-.56-2.18-.37-.67-.88-1.19-1.54-1.58-.64-.39-1.34-.58-2.09-.58s-1.45.19-2.09.58c-.64.39-1.15.91-1.54 1.58-.37.67-.56 1.39-.56 2.18s.19 1.51.56 2.18c.39.67.9 1.19 1.54 1.58.64.39 1.34.58 2.09.58s1.45-.19 2.09-.58c.65-.39 1.16-.91 1.54-1.56.37-.67.56-1.4.56-2.2Z" })
|
|
11937
12237
|
}
|
|
11938
12238
|
);
|
|
11939
12239
|
};
|
|
@@ -11943,7 +12243,7 @@ var computedViewBox = (iconOnly) => {
|
|
|
11943
12243
|
}
|
|
11944
12244
|
return "0 0 144 31.47";
|
|
11945
12245
|
};
|
|
11946
|
-
var WistiaLogoComponent =
|
|
12246
|
+
var WistiaLogoComponent = import_styled_components85.default.svg`
|
|
11947
12247
|
height: ${({ height }) => `${height}px`};
|
|
11948
12248
|
|
|
11949
12249
|
/* ensure it will always fit on mobile */
|
|
@@ -11959,12 +12259,12 @@ var WistiaLogoComponent = import_styled_components84.default.svg`
|
|
|
11959
12259
|
${({ $opticallyCentered, $iconOnly }) => {
|
|
11960
12260
|
if ($opticallyCentered) {
|
|
11961
12261
|
if ($iconOnly) {
|
|
11962
|
-
return
|
|
12262
|
+
return import_styled_components85.css`
|
|
11963
12263
|
aspect-ratio: 1;
|
|
11964
12264
|
padding: 11.85% 3.12% 13.91%;
|
|
11965
12265
|
`;
|
|
11966
12266
|
}
|
|
11967
|
-
return
|
|
12267
|
+
return import_styled_components85.css`
|
|
11968
12268
|
aspect-ratio: 127 / 32;
|
|
11969
12269
|
`;
|
|
11970
12270
|
}
|
|
@@ -12001,7 +12301,7 @@ var WistiaLogo = ({
|
|
|
12001
12301
|
};
|
|
12002
12302
|
const brandmarkColor = VARIANT_COLORS[variant].brandmark;
|
|
12003
12303
|
const logotypeColor = VARIANT_COLORS[variant].logotype;
|
|
12004
|
-
const Logo = /* @__PURE__ */ (0,
|
|
12304
|
+
const Logo = /* @__PURE__ */ (0, import_jsx_runtime268.jsxs)(
|
|
12005
12305
|
WistiaLogoComponent,
|
|
12006
12306
|
{
|
|
12007
12307
|
$hoverColor: hoverColor,
|
|
@@ -12014,14 +12314,14 @@ var WistiaLogo = ({
|
|
|
12014
12314
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12015
12315
|
...otherProps,
|
|
12016
12316
|
children: [
|
|
12017
|
-
/* @__PURE__ */ (0,
|
|
12018
|
-
(0,
|
|
12317
|
+
/* @__PURE__ */ (0, import_jsx_runtime268.jsx)("title", { children: title }),
|
|
12318
|
+
(0, import_type_guards47.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("desc", { children: description }) : null,
|
|
12019
12319
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
12020
12320
|
renderLogotype(logotypeColor, iconOnly)
|
|
12021
12321
|
]
|
|
12022
12322
|
}
|
|
12023
12323
|
);
|
|
12024
|
-
return href !== void 0 ? /* @__PURE__ */ (0,
|
|
12324
|
+
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("a", { href, children: Logo }) : Logo;
|
|
12025
12325
|
};
|
|
12026
12326
|
WistiaLogo.displayName = "WistiaLogo";
|
|
12027
12327
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -12035,6 +12335,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
12035
12335
|
Button,
|
|
12036
12336
|
ButtonGroup,
|
|
12037
12337
|
Card,
|
|
12338
|
+
Center,
|
|
12038
12339
|
Checkbox,
|
|
12039
12340
|
CheckboxGroup,
|
|
12040
12341
|
CheckboxMenuItem,
|
|
@@ -12110,6 +12411,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
12110
12411
|
useAriaLive,
|
|
12111
12412
|
useBoolean,
|
|
12112
12413
|
useFilePicker,
|
|
12414
|
+
useFocusTrap,
|
|
12113
12415
|
useFormState,
|
|
12114
12416
|
useImperativeFilePicker,
|
|
12115
12417
|
useKey,
|