@wistia/ui 0.8.17 → 0.8.18
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 +176 -164
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +39 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.8.
|
|
3
|
+
* @license @wistia/ui v0.8.18
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -137,6 +137,7 @@ __export(index_exports, {
|
|
|
137
137
|
useLockBodyScroll: () => useLockBodyScroll,
|
|
138
138
|
useMq: () => useMq,
|
|
139
139
|
useOnClickOutside: () => useOnClickOutside,
|
|
140
|
+
usePreviousValue: () => usePreviousValue,
|
|
140
141
|
useToast: () => useToast,
|
|
141
142
|
useWindowSize: () => useWindowSize
|
|
142
143
|
});
|
|
@@ -2608,12 +2609,22 @@ var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) =
|
|
|
2608
2609
|
}, [ref, handler, eventTypes]);
|
|
2609
2610
|
};
|
|
2610
2611
|
|
|
2612
|
+
// src/hooks/usePreviousValue/usePreviousValue.ts
|
|
2613
|
+
var import_react16 = require("react");
|
|
2614
|
+
var usePreviousValue = (value) => {
|
|
2615
|
+
const ref = (0, import_react16.useRef)();
|
|
2616
|
+
(0, import_react16.useEffect)(() => {
|
|
2617
|
+
ref.current = value;
|
|
2618
|
+
});
|
|
2619
|
+
return ref.current;
|
|
2620
|
+
};
|
|
2621
|
+
|
|
2611
2622
|
// src/hooks/useToast/useToast.tsx
|
|
2612
|
-
var
|
|
2623
|
+
var import_react18 = require("react");
|
|
2613
2624
|
var import_sonner2 = require("sonner");
|
|
2614
2625
|
|
|
2615
2626
|
// src/private/components/Toast/Toast.tsx
|
|
2616
|
-
var
|
|
2627
|
+
var import_react17 = require("react");
|
|
2617
2628
|
var import_styled_components16 = __toESM(require("styled-components"));
|
|
2618
2629
|
var import_type_guards11 = require("@wistia/type-guards");
|
|
2619
2630
|
|
|
@@ -2851,8 +2862,8 @@ var StyledToast = import_styled_components16.default.div`
|
|
|
2851
2862
|
}
|
|
2852
2863
|
`;
|
|
2853
2864
|
var Action = ({ actionButton }) => {
|
|
2854
|
-
if ((0, import_type_guards11.isNotNil)(actionButton) && (0,
|
|
2855
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0,
|
|
2865
|
+
if ((0, import_type_guards11.isNotNil)(actionButton) && (0, import_react17.isValidElement)(actionButton)) {
|
|
2866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0, import_react17.cloneElement)(actionButton, {
|
|
2856
2867
|
variant: "soft",
|
|
2857
2868
|
// force Button variant
|
|
2858
2869
|
size: "sm"
|
|
@@ -2888,7 +2899,7 @@ Toast.displayName = "Toast";
|
|
|
2888
2899
|
// src/hooks/useToast/useToast.tsx
|
|
2889
2900
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2890
2901
|
var useToast = () => {
|
|
2891
|
-
return (0,
|
|
2902
|
+
return (0, import_react18.useCallback)(
|
|
2892
2903
|
({ message, action, colorScheme, icon, position = "bottom-left", duration = 3e3 }) => {
|
|
2893
2904
|
import_sonner2.toast.custom(
|
|
2894
2905
|
() => {
|
|
@@ -2910,11 +2921,11 @@ var useToast = () => {
|
|
|
2910
2921
|
};
|
|
2911
2922
|
|
|
2912
2923
|
// src/components/ActionButton/ActionButton.tsx
|
|
2913
|
-
var
|
|
2924
|
+
var import_react22 = require("react");
|
|
2914
2925
|
var import_styled_components22 = __toESM(require("styled-components"));
|
|
2915
2926
|
|
|
2916
2927
|
// src/components/Button/Button.tsx
|
|
2917
|
-
var
|
|
2928
|
+
var import_react21 = require("react");
|
|
2918
2929
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
2919
2930
|
var import_type_guards15 = require("@wistia/type-guards");
|
|
2920
2931
|
|
|
@@ -6976,13 +6987,13 @@ var iconMap = {
|
|
|
6976
6987
|
|
|
6977
6988
|
// src/private/hooks/useResponsiveProp/useResponsiveProp.ts
|
|
6978
6989
|
var import_type_guards12 = require("@wistia/type-guards");
|
|
6979
|
-
var
|
|
6990
|
+
var import_react19 = require("react");
|
|
6980
6991
|
var isResponsiveObject = (values) => {
|
|
6981
6992
|
return typeof values === "object" && values !== null && !Array.isArray(values) && "base" in values;
|
|
6982
6993
|
};
|
|
6983
6994
|
var useResponsiveProp = (values) => {
|
|
6984
6995
|
const activeMediaQueries = useActiveMq();
|
|
6985
|
-
return (0,
|
|
6996
|
+
return (0, import_react19.useMemo)(() => {
|
|
6986
6997
|
if ((0, import_type_guards12.isRecord)(values) && isResponsiveObject(values)) {
|
|
6987
6998
|
const mq2 = activeMediaQueries.find((key) => key in values);
|
|
6988
6999
|
return (0, import_type_guards12.isNotUndefined)(mq2) && (0, import_type_guards12.isNotUndefined)(values[mq2]) ? values[mq2] : values.base;
|
|
@@ -7049,7 +7060,7 @@ var Icon = ({
|
|
|
7049
7060
|
Icon.displayName = "Icon";
|
|
7050
7061
|
|
|
7051
7062
|
// src/components/Link/Link.tsx
|
|
7052
|
-
var
|
|
7063
|
+
var import_react20 = require("react");
|
|
7053
7064
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
7054
7065
|
var import_react_router_dom = require("react-router-dom");
|
|
7055
7066
|
var import_type_guards14 = require("@wistia/type-guards");
|
|
@@ -7087,7 +7098,7 @@ var StyledLink = import_styled_components20.default.a`
|
|
|
7087
7098
|
}
|
|
7088
7099
|
}
|
|
7089
7100
|
`;
|
|
7090
|
-
var Link = (0,
|
|
7101
|
+
var Link = (0, import_react20.forwardRef)(
|
|
7091
7102
|
({
|
|
7092
7103
|
beforeAction,
|
|
7093
7104
|
children,
|
|
@@ -7228,7 +7239,7 @@ var ButtonContent = ({
|
|
|
7228
7239
|
)
|
|
7229
7240
|
] });
|
|
7230
7241
|
};
|
|
7231
|
-
var Button = (0,
|
|
7242
|
+
var Button = (0, import_react21.forwardRef)(
|
|
7232
7243
|
({
|
|
7233
7244
|
children,
|
|
7234
7245
|
forceState,
|
|
@@ -7407,7 +7418,7 @@ var StyledLabel = import_styled_components22.default.span`
|
|
|
7407
7418
|
grid-row: 2;
|
|
7408
7419
|
text-align: left;
|
|
7409
7420
|
`;
|
|
7410
|
-
var ActionButton = (0,
|
|
7421
|
+
var ActionButton = (0, import_react22.forwardRef)(
|
|
7411
7422
|
({
|
|
7412
7423
|
icon,
|
|
7413
7424
|
colorScheme = "default",
|
|
@@ -7451,7 +7462,7 @@ var ActionButton = (0, import_react21.forwardRef)(
|
|
|
7451
7462
|
ActionButton.displayName = "ActionButton";
|
|
7452
7463
|
|
|
7453
7464
|
// src/components/Avatar/Avatar.tsx
|
|
7454
|
-
var
|
|
7465
|
+
var import_react23 = require("react");
|
|
7455
7466
|
var import_type_guards18 = require("@wistia/type-guards");
|
|
7456
7467
|
var import_styled_components25 = __toESM(require("styled-components"));
|
|
7457
7468
|
|
|
@@ -7659,8 +7670,8 @@ var Avatar = ({
|
|
|
7659
7670
|
onImageLoad,
|
|
7660
7671
|
...props
|
|
7661
7672
|
}) => {
|
|
7662
|
-
const [imageLoadState, setImageLoadState] = (0,
|
|
7663
|
-
(0,
|
|
7673
|
+
const [imageLoadState, setImageLoadState] = (0, import_react23.useState)("loading");
|
|
7674
|
+
(0, import_react23.useEffect)(() => {
|
|
7664
7675
|
setImageLoadState("loading");
|
|
7665
7676
|
}, [imageUrl]);
|
|
7666
7677
|
const handleImageLoad = () => {
|
|
@@ -7672,7 +7683,7 @@ var Avatar = ({
|
|
|
7672
7683
|
onImageLoad?.({ state: "error", type: "initials" });
|
|
7673
7684
|
};
|
|
7674
7685
|
const avatarSize = heightAndWidth ?? avatarSizeMap[size];
|
|
7675
|
-
const avatarColor = (0,
|
|
7686
|
+
const avatarColor = (0, import_react23.useMemo)(() => chooseColorScheme(name), [name]);
|
|
7676
7687
|
return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
7677
7688
|
AvatarWrapper,
|
|
7678
7689
|
{
|
|
@@ -7699,7 +7710,7 @@ var Avatar = ({
|
|
|
7699
7710
|
Avatar.displayName = "Avatar";
|
|
7700
7711
|
|
|
7701
7712
|
// src/components/Badge/Badge.tsx
|
|
7702
|
-
var
|
|
7713
|
+
var import_react24 = require("react");
|
|
7703
7714
|
var import_styled_components26 = __toESM(require("styled-components"));
|
|
7704
7715
|
var import_type_guards19 = require("@wistia/type-guards");
|
|
7705
7716
|
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
@@ -7723,7 +7734,7 @@ var StyledBadge = import_styled_components26.default.div`
|
|
|
7723
7734
|
width: 12px;
|
|
7724
7735
|
}
|
|
7725
7736
|
`;
|
|
7726
|
-
var Badge = (0,
|
|
7737
|
+
var Badge = (0, import_react24.forwardRef)(
|
|
7727
7738
|
({ colorScheme = "inherit", label, icon, ...props }, ref) => {
|
|
7728
7739
|
const hasIcon = (0, import_type_guards19.isNotNil)(icon);
|
|
7729
7740
|
return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(
|
|
@@ -7744,7 +7755,7 @@ var Badge = (0, import_react23.forwardRef)(
|
|
|
7744
7755
|
Badge.displayName = "Badge";
|
|
7745
7756
|
|
|
7746
7757
|
// src/components/Box/Box.tsx
|
|
7747
|
-
var
|
|
7758
|
+
var import_react25 = require("react");
|
|
7748
7759
|
var import_styled_components27 = __toESM(require("styled-components"));
|
|
7749
7760
|
var import_type_guards20 = require("@wistia/type-guards");
|
|
7750
7761
|
|
|
@@ -7853,13 +7864,13 @@ var StyledBoxComponent = import_styled_components27.default.div`
|
|
|
7853
7864
|
var wrapChildren = (children) => {
|
|
7854
7865
|
if ((0, import_type_guards20.isNotNil)(children)) {
|
|
7855
7866
|
if (typeof children === "object" && isDev) {
|
|
7856
|
-
return
|
|
7867
|
+
return import_react25.Children.map(children, (child) => {
|
|
7857
7868
|
if ((0, import_type_guards20.isNil)(child)) return null;
|
|
7858
7869
|
const elementParams = {};
|
|
7859
7870
|
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
7860
7871
|
elementParams.hasBoxParent = true;
|
|
7861
7872
|
}
|
|
7862
|
-
return (0,
|
|
7873
|
+
return (0, import_react25.cloneElement)(child, elementParams);
|
|
7863
7874
|
});
|
|
7864
7875
|
}
|
|
7865
7876
|
return children;
|
|
@@ -7867,7 +7878,7 @@ var wrapChildren = (children) => {
|
|
|
7867
7878
|
return null;
|
|
7868
7879
|
};
|
|
7869
7880
|
var DEFAULT_ELEMENT = "div";
|
|
7870
|
-
var BoxComponent = (0,
|
|
7881
|
+
var BoxComponent = (0, import_react25.forwardRef)(
|
|
7871
7882
|
({
|
|
7872
7883
|
alignContent = "stretch",
|
|
7873
7884
|
alignItems = "flex-start",
|
|
@@ -7950,7 +7961,7 @@ BoxComponent.displayName = "Box";
|
|
|
7950
7961
|
var Box = makePolymorphic(BoxComponent);
|
|
7951
7962
|
|
|
7952
7963
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
7953
|
-
var
|
|
7964
|
+
var import_react26 = require("react");
|
|
7954
7965
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
7955
7966
|
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
7956
7967
|
var StyledBreadcrumbs = import_styled_components28.default.nav`
|
|
@@ -7966,7 +7977,7 @@ var StyledBreadcrumbs = import_styled_components28.default.nav`
|
|
|
7966
7977
|
var BUFFER_WIDTH = 10;
|
|
7967
7978
|
var Breadcrumbs = ({ children, ...props }) => {
|
|
7968
7979
|
const { isXsAndDown } = useMq();
|
|
7969
|
-
let crumbs =
|
|
7980
|
+
let crumbs = import_react26.Children.toArray(children);
|
|
7970
7981
|
if (isXsAndDown) {
|
|
7971
7982
|
crumbs = crumbs.slice(-1);
|
|
7972
7983
|
}
|
|
@@ -8155,7 +8166,7 @@ var Card = ({
|
|
|
8155
8166
|
Card.displayName = "Card";
|
|
8156
8167
|
|
|
8157
8168
|
// src/components/Center/Center.tsx
|
|
8158
|
-
var
|
|
8169
|
+
var import_react27 = require("react");
|
|
8159
8170
|
var import_styled_components32 = __toESM(require("styled-components"));
|
|
8160
8171
|
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8161
8172
|
var StyledCenter = import_styled_components32.default.div`
|
|
@@ -8170,7 +8181,7 @@ var StyledCenter = import_styled_components32.default.div`
|
|
|
8170
8181
|
align-items: center;
|
|
8171
8182
|
`}
|
|
8172
8183
|
`;
|
|
8173
|
-
var Center = (0,
|
|
8184
|
+
var Center = (0, import_react27.forwardRef)(
|
|
8174
8185
|
({ maxWidth = "100%", gutterWidth = "space-00", intrinsic = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8175
8186
|
StyledCenter,
|
|
8176
8187
|
{
|
|
@@ -8186,7 +8197,7 @@ var Center = (0, import_react26.forwardRef)(
|
|
|
8186
8197
|
Center.displayName = "Center";
|
|
8187
8198
|
|
|
8188
8199
|
// src/components/Checkbox/Checkbox.tsx
|
|
8189
|
-
var
|
|
8200
|
+
var import_react28 = require("react");
|
|
8190
8201
|
var import_styled_components36 = __toESM(require("styled-components"));
|
|
8191
8202
|
var import_type_guards25 = require("@wistia/type-guards");
|
|
8192
8203
|
|
|
@@ -8406,7 +8417,7 @@ var StyledHiddenCheckboxInput = import_styled_components36.default.input`
|
|
|
8406
8417
|
display: block;
|
|
8407
8418
|
}
|
|
8408
8419
|
`;
|
|
8409
|
-
var Checkbox = (0,
|
|
8420
|
+
var Checkbox = (0, import_react28.forwardRef)(
|
|
8410
8421
|
({
|
|
8411
8422
|
checked,
|
|
8412
8423
|
disabled = false,
|
|
@@ -8421,7 +8432,7 @@ var Checkbox = (0, import_react27.forwardRef)(
|
|
|
8421
8432
|
hideLabel = false,
|
|
8422
8433
|
...props
|
|
8423
8434
|
}, ref) => {
|
|
8424
|
-
const generatedId = (0,
|
|
8435
|
+
const generatedId = (0, import_react28.useId)();
|
|
8425
8436
|
const computedId = (0, import_type_guards25.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
8426
8437
|
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
8427
8438
|
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
@@ -8464,9 +8475,9 @@ var Checkbox = (0, import_react27.forwardRef)(
|
|
|
8464
8475
|
Checkbox.displayName = "Checkbox";
|
|
8465
8476
|
|
|
8466
8477
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
8467
|
-
var
|
|
8478
|
+
var import_react29 = require("react");
|
|
8468
8479
|
var ClickRegion = ({ children, targetRef }) => {
|
|
8469
|
-
(0,
|
|
8480
|
+
(0, import_react29.useEffect)(() => {
|
|
8470
8481
|
if (targetRef.current && targetRef.current.tagName === "A") {
|
|
8471
8482
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
8472
8483
|
} else if (targetRef.current && targetRef.current.tagName === "BUTTON") {
|
|
@@ -8474,7 +8485,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8474
8485
|
} else {
|
|
8475
8486
|
}
|
|
8476
8487
|
}, [targetRef]);
|
|
8477
|
-
const handleClick = (0,
|
|
8488
|
+
const handleClick = (0, import_react29.useCallback)(
|
|
8478
8489
|
(event) => {
|
|
8479
8490
|
const node = targetRef.current;
|
|
8480
8491
|
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")) {
|
|
@@ -8491,7 +8502,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8491
8502
|
},
|
|
8492
8503
|
[targetRef]
|
|
8493
8504
|
);
|
|
8494
|
-
return (0,
|
|
8505
|
+
return (0, import_react29.cloneElement)(import_react29.Children.only(children), {
|
|
8495
8506
|
"data-click-region": true,
|
|
8496
8507
|
onClick: handleClick
|
|
8497
8508
|
});
|
|
@@ -8524,11 +8535,11 @@ var Collapsible = ({
|
|
|
8524
8535
|
Collapsible.displayName = "Collapsible";
|
|
8525
8536
|
|
|
8526
8537
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
8527
|
-
var
|
|
8538
|
+
var import_react30 = require("react");
|
|
8528
8539
|
var import_react_collapsible2 = require("@radix-ui/react-collapsible");
|
|
8529
8540
|
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
8530
8541
|
var CollapsibleTrigger = ({ children }) => {
|
|
8531
|
-
|
|
8542
|
+
import_react30.Children.only(children);
|
|
8532
8543
|
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
|
|
8533
8544
|
};
|
|
8534
8545
|
|
|
@@ -8555,7 +8566,7 @@ var import_styled_components40 = __toESM(require("styled-components"));
|
|
|
8555
8566
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8556
8567
|
|
|
8557
8568
|
// src/components/Heading/Heading.tsx
|
|
8558
|
-
var
|
|
8569
|
+
var import_react31 = require("react");
|
|
8559
8570
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8560
8571
|
var import_type_guards28 = require("@wistia/type-guards");
|
|
8561
8572
|
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
@@ -8651,7 +8662,7 @@ var variantElementMap = {
|
|
|
8651
8662
|
heading5: "h5",
|
|
8652
8663
|
heading6: "h6"
|
|
8653
8664
|
};
|
|
8654
|
-
var HeadingComponent = (0,
|
|
8665
|
+
var HeadingComponent = (0, import_react31.forwardRef)(
|
|
8655
8666
|
({
|
|
8656
8667
|
align = "left",
|
|
8657
8668
|
colorScheme = "inherit",
|
|
@@ -8815,7 +8826,7 @@ DataCards.displayName = "DataCards";
|
|
|
8815
8826
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8816
8827
|
|
|
8817
8828
|
// src/components/Text/Text.tsx
|
|
8818
|
-
var
|
|
8829
|
+
var import_react32 = require("react");
|
|
8819
8830
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
8820
8831
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8821
8832
|
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
@@ -8990,7 +9001,7 @@ var StyledText = import_styled_components42.default.div`
|
|
|
8990
9001
|
}
|
|
8991
9002
|
`}
|
|
8992
9003
|
`;
|
|
8993
|
-
var TextComponent = (0,
|
|
9004
|
+
var TextComponent = (0, import_react32.forwardRef)(
|
|
8994
9005
|
({
|
|
8995
9006
|
align = "left",
|
|
8996
9007
|
colorScheme = "inherit",
|
|
@@ -9103,7 +9114,7 @@ Divider.displayName = "Divider";
|
|
|
9103
9114
|
|
|
9104
9115
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9105
9116
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
9106
|
-
var
|
|
9117
|
+
var import_react34 = require("react");
|
|
9107
9118
|
|
|
9108
9119
|
// src/components/Tooltip/Tooltip.tsx
|
|
9109
9120
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
@@ -9201,7 +9212,7 @@ var Tooltip = ({
|
|
|
9201
9212
|
Tooltip.displayName = "Tooltip";
|
|
9202
9213
|
|
|
9203
9214
|
// src/components/Input/Input.tsx
|
|
9204
|
-
var
|
|
9215
|
+
var import_react33 = require("react");
|
|
9205
9216
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9206
9217
|
var import_type_guards31 = require("@wistia/type-guards");
|
|
9207
9218
|
|
|
@@ -9336,7 +9347,7 @@ var StyledInputContainer = import_styled_components47.default.div`
|
|
|
9336
9347
|
padding-right: 32px;
|
|
9337
9348
|
}
|
|
9338
9349
|
`;
|
|
9339
|
-
var Input = (0,
|
|
9350
|
+
var Input = (0, import_react33.forwardRef)(
|
|
9340
9351
|
({
|
|
9341
9352
|
fullWidth = true,
|
|
9342
9353
|
monospace = false,
|
|
@@ -9346,7 +9357,7 @@ var Input = (0, import_react32.forwardRef)(
|
|
|
9346
9357
|
rightIcon,
|
|
9347
9358
|
...props
|
|
9348
9359
|
}, externalRef) => {
|
|
9349
|
-
const internalRef = (0,
|
|
9360
|
+
const internalRef = (0, import_react33.useRef)();
|
|
9350
9361
|
const ref = (
|
|
9351
9362
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
9352
9363
|
(0, import_type_guards31.isNotNil)(externalRef) && (0, import_type_guards31.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
@@ -9356,14 +9367,14 @@ var Input = (0, import_react32.forwardRef)(
|
|
|
9356
9367
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(Icon, { type: "search" });
|
|
9357
9368
|
}
|
|
9358
9369
|
if ((0, import_type_guards31.isNotNil)(leftIconToDisplay)) {
|
|
9359
|
-
leftIconToDisplay = (0,
|
|
9370
|
+
leftIconToDisplay = (0, import_react33.cloneElement)(leftIconToDisplay, {
|
|
9360
9371
|
size: "md",
|
|
9361
9372
|
className: "wui-input-left-icon"
|
|
9362
9373
|
});
|
|
9363
9374
|
}
|
|
9364
9375
|
let rightIconToDisplay = rightIcon;
|
|
9365
9376
|
if ((0, import_type_guards31.isNotNil)(rightIconToDisplay)) {
|
|
9366
|
-
rightIconToDisplay = (0,
|
|
9377
|
+
rightIconToDisplay = (0, import_react33.cloneElement)(rightIconToDisplay, {
|
|
9367
9378
|
size: "md",
|
|
9368
9379
|
className: "wui-input-right-icon"
|
|
9369
9380
|
});
|
|
@@ -9455,11 +9466,11 @@ var EditableHeading = ({
|
|
|
9455
9466
|
__forceEditing = false,
|
|
9456
9467
|
editingDisabled = false
|
|
9457
9468
|
}) => {
|
|
9458
|
-
const [isEditing, setIsEditing] = (0,
|
|
9459
|
-
const [value, setValue] = (0,
|
|
9460
|
-
const [previousValue, setPreviousValue] = (0,
|
|
9461
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
9462
|
-
const headingRef = (0,
|
|
9469
|
+
const [isEditing, setIsEditing] = (0, import_react34.useState)(false);
|
|
9470
|
+
const [value, setValue] = (0, import_react34.useState)(children);
|
|
9471
|
+
const [previousValue, setPreviousValue] = (0, import_react34.useState)(children);
|
|
9472
|
+
const [headingHeight, setHeadingHeight] = (0, import_react34.useState)("60");
|
|
9473
|
+
const headingRef = (0, import_react34.useRef)(null);
|
|
9463
9474
|
const handleSetEditing = (editing) => {
|
|
9464
9475
|
if (editingDisabled) return;
|
|
9465
9476
|
if (editing && headingRef.current) {
|
|
@@ -9538,12 +9549,12 @@ var EditableHeading = ({
|
|
|
9538
9549
|
};
|
|
9539
9550
|
|
|
9540
9551
|
// src/components/Form/Form.tsx
|
|
9541
|
-
var
|
|
9552
|
+
var import_react36 = require("react");
|
|
9542
9553
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
9543
9554
|
var import_type_guards32 = require("@wistia/type-guards");
|
|
9544
9555
|
|
|
9545
9556
|
// src/components/Stack/Stack.tsx
|
|
9546
|
-
var
|
|
9557
|
+
var import_react35 = require("react");
|
|
9547
9558
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9548
9559
|
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9549
9560
|
var DEFAULT_ELEMENT4 = "div";
|
|
@@ -9553,7 +9564,7 @@ var StyledStack = import_styled_components49.default.div`
|
|
|
9553
9564
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9554
9565
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
9555
9566
|
`;
|
|
9556
|
-
var StackComponent = (0,
|
|
9567
|
+
var StackComponent = (0, import_react35.forwardRef)(
|
|
9557
9568
|
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9558
9569
|
const responsiveGap = useResponsiveProp(gap);
|
|
9559
9570
|
const responsiveDirection = useResponsiveProp(direction);
|
|
@@ -9582,11 +9593,11 @@ var StyledForm = import_styled_components50.default.form`
|
|
|
9582
9593
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9583
9594
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9584
9595
|
`;
|
|
9585
|
-
var FormContext = (0,
|
|
9596
|
+
var FormContext = (0, import_react36.createContext)({
|
|
9586
9597
|
values: {},
|
|
9587
9598
|
errors: {},
|
|
9588
9599
|
hasSubmitted: false,
|
|
9589
|
-
formId: "",
|
|
9600
|
+
formId: "NO_FORM",
|
|
9590
9601
|
labelPosition: "block"
|
|
9591
9602
|
});
|
|
9592
9603
|
var FormComponent = ({
|
|
@@ -9598,11 +9609,11 @@ var FormComponent = ({
|
|
|
9598
9609
|
fullWidth = false,
|
|
9599
9610
|
...props
|
|
9600
9611
|
}, forwardedRef) => {
|
|
9601
|
-
const [errors, setErrors] = (0,
|
|
9602
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
9603
|
-
const innerRef = (0,
|
|
9612
|
+
const [errors, setErrors] = (0, import_react36.useState)({});
|
|
9613
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react36.useState)(false);
|
|
9614
|
+
const innerRef = (0, import_react36.useRef)();
|
|
9604
9615
|
const ref = forwardedRef ?? innerRef;
|
|
9605
|
-
const autoId = (0,
|
|
9616
|
+
const autoId = (0, import_react36.useId)();
|
|
9606
9617
|
const id = props.id ?? autoId;
|
|
9607
9618
|
const handleValidate = (nextFormData) => {
|
|
9608
9619
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
@@ -9644,7 +9655,7 @@ var FormComponent = ({
|
|
|
9644
9655
|
void action(null);
|
|
9645
9656
|
}
|
|
9646
9657
|
};
|
|
9647
|
-
const context = (0,
|
|
9658
|
+
const context = (0, import_react36.useMemo)(() => {
|
|
9648
9659
|
return {
|
|
9649
9660
|
values,
|
|
9650
9661
|
errors,
|
|
@@ -9673,15 +9684,15 @@ var FormComponent = ({
|
|
|
9673
9684
|
);
|
|
9674
9685
|
};
|
|
9675
9686
|
FormComponent.displayName = "Form";
|
|
9676
|
-
var Form = (0,
|
|
9687
|
+
var Form = (0, import_react36.forwardRef)(FormComponent);
|
|
9677
9688
|
|
|
9678
9689
|
// src/components/Form/useFormState.tsx
|
|
9679
|
-
var
|
|
9690
|
+
var import_react37 = require("react");
|
|
9680
9691
|
var useFormState = (action, initialData = {}) => {
|
|
9681
|
-
const [data, setData] = (0,
|
|
9682
|
-
const [isPending, setIsPending] = (0,
|
|
9683
|
-
const [error, setError] = (0,
|
|
9684
|
-
const formAction = (0,
|
|
9692
|
+
const [data, setData] = (0, import_react37.useState)(initialData);
|
|
9693
|
+
const [isPending, setIsPending] = (0, import_react37.useState)(false);
|
|
9694
|
+
const [error, setError] = (0, import_react37.useState)(null);
|
|
9695
|
+
const formAction = (0, import_react37.useCallback)(
|
|
9685
9696
|
async (nextFormData) => {
|
|
9686
9697
|
if (nextFormData === null) {
|
|
9687
9698
|
setData(initialData);
|
|
@@ -9712,15 +9723,15 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9712
9723
|
};
|
|
9713
9724
|
|
|
9714
9725
|
// src/components/Form/FormErrorSummary.tsx
|
|
9715
|
-
var
|
|
9726
|
+
var import_react38 = require("react");
|
|
9716
9727
|
var import_type_guards33 = require("@wistia/type-guards");
|
|
9717
9728
|
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9718
9729
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9719
9730
|
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9720
9731
|
};
|
|
9721
9732
|
var FormErrorSummary = ({ description }) => {
|
|
9722
|
-
const ref = (0,
|
|
9723
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
9733
|
+
const ref = (0, import_react38.useRef)(null);
|
|
9734
|
+
const { formId, errors, hasSubmitted } = (0, import_react38.useContext)(FormContext);
|
|
9724
9735
|
const isValid = Object.keys(errors).length === 0;
|
|
9725
9736
|
if (isValid || !hasSubmitted) {
|
|
9726
9737
|
return null;
|
|
@@ -9750,7 +9761,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9750
9761
|
};
|
|
9751
9762
|
|
|
9752
9763
|
// src/components/FormField/FormField.tsx
|
|
9753
|
-
var
|
|
9764
|
+
var import_react41 = require("react");
|
|
9754
9765
|
var import_styled_components53 = __toESM(require("styled-components"));
|
|
9755
9766
|
var import_type_guards34 = require("@wistia/type-guards");
|
|
9756
9767
|
|
|
@@ -9815,11 +9826,11 @@ var Label = ({
|
|
|
9815
9826
|
Label.displayName = "Label";
|
|
9816
9827
|
|
|
9817
9828
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9818
|
-
var
|
|
9829
|
+
var import_react40 = require("react");
|
|
9819
9830
|
|
|
9820
9831
|
// src/components/FormGroup/FormGroup.tsx
|
|
9821
9832
|
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9822
|
-
var
|
|
9833
|
+
var import_react39 = require("react");
|
|
9823
9834
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9824
9835
|
var StyledFieldset = import_styled_components52.default.fieldset`
|
|
9825
9836
|
border: 0;
|
|
@@ -9828,7 +9839,7 @@ var StyledLegend = import_styled_components52.default.legend`
|
|
|
9828
9839
|
margin-bottom: var(--space-01);
|
|
9829
9840
|
`;
|
|
9830
9841
|
var FormGroup = ({ children, label, ...props }) => {
|
|
9831
|
-
const ref = (0,
|
|
9842
|
+
const ref = (0, import_react39.useRef)();
|
|
9832
9843
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
9833
9844
|
Stack,
|
|
9834
9845
|
{
|
|
@@ -9853,7 +9864,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
9853
9864
|
|
|
9854
9865
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9855
9866
|
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9856
|
-
var CheckboxGroupContext = (0,
|
|
9867
|
+
var CheckboxGroupContext = (0, import_react40.createContext)(null);
|
|
9857
9868
|
var CheckboxGroup = ({
|
|
9858
9869
|
children,
|
|
9859
9870
|
name,
|
|
@@ -9861,7 +9872,7 @@ var CheckboxGroup = ({
|
|
|
9861
9872
|
value,
|
|
9862
9873
|
...props
|
|
9863
9874
|
}) => {
|
|
9864
|
-
const context = (0,
|
|
9875
|
+
const context = (0, import_react40.useMemo)(() => {
|
|
9865
9876
|
return {
|
|
9866
9877
|
name,
|
|
9867
9878
|
onChange
|
|
@@ -9946,8 +9957,8 @@ var FormField = ({
|
|
|
9946
9957
|
value,
|
|
9947
9958
|
...props
|
|
9948
9959
|
}) => {
|
|
9949
|
-
const formState = (0,
|
|
9950
|
-
const checkboxGroup = (0,
|
|
9960
|
+
const formState = (0, import_react41.useContext)(FormContext);
|
|
9961
|
+
const checkboxGroup = (0, import_react41.useContext)(CheckboxGroupContext);
|
|
9951
9962
|
const defaultValue = formState.values[name];
|
|
9952
9963
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9953
9964
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -9985,7 +9996,7 @@ var FormField = ({
|
|
|
9985
9996
|
"aria-invalid": (0, import_type_guards34.isNotNil)(error)
|
|
9986
9997
|
};
|
|
9987
9998
|
}
|
|
9988
|
-
|
|
9999
|
+
import_react41.Children.only(children);
|
|
9989
10000
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(
|
|
9990
10001
|
StyledFormField,
|
|
9991
10002
|
{
|
|
@@ -9994,7 +10005,7 @@ var FormField = ({
|
|
|
9994
10005
|
children: [
|
|
9995
10006
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
9996
10007
|
(0, import_type_guards34.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9997
|
-
(0,
|
|
10008
|
+
(0, import_react41.cloneElement)(children, childProps),
|
|
9998
10009
|
(0, import_type_guards34.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(import_jsx_runtime227.Fragment, { children: [
|
|
9999
10010
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("div", {}),
|
|
10000
10011
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
@@ -10012,9 +10023,9 @@ var FormField = ({
|
|
|
10012
10023
|
FormField.displayName = "FormField";
|
|
10013
10024
|
|
|
10014
10025
|
// src/components/FormGroup/RadioGroup.tsx
|
|
10015
|
-
var
|
|
10026
|
+
var import_react42 = require("react");
|
|
10016
10027
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
10017
|
-
var RadioGroupContext = (0,
|
|
10028
|
+
var RadioGroupContext = (0, import_react42.createContext)(null);
|
|
10018
10029
|
var RadioGroup = ({
|
|
10019
10030
|
children,
|
|
10020
10031
|
name,
|
|
@@ -10022,7 +10033,7 @@ var RadioGroup = ({
|
|
|
10022
10033
|
value,
|
|
10023
10034
|
...props
|
|
10024
10035
|
}) => {
|
|
10025
|
-
const context = (0,
|
|
10036
|
+
const context = (0, import_react42.useMemo)(() => {
|
|
10026
10037
|
return {
|
|
10027
10038
|
name,
|
|
10028
10039
|
onChange
|
|
@@ -10033,7 +10044,7 @@ var RadioGroup = ({
|
|
|
10033
10044
|
RadioGroup.displayName = "RadioGroup";
|
|
10034
10045
|
|
|
10035
10046
|
// src/components/IconButton/IconButton.tsx
|
|
10036
|
-
var
|
|
10047
|
+
var import_react43 = require("react");
|
|
10037
10048
|
var import_styled_components54 = __toESM(require("styled-components"));
|
|
10038
10049
|
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
10039
10050
|
var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
@@ -10050,7 +10061,7 @@ var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
|
10050
10061
|
align-items: center;
|
|
10051
10062
|
line-height: 1;
|
|
10052
10063
|
`;
|
|
10053
|
-
var IconButton = (0,
|
|
10064
|
+
var IconButton = (0, import_react43.forwardRef)(
|
|
10054
10065
|
({ children, label, size = "md", ...props }, ref) => {
|
|
10055
10066
|
const responsiveSize = useResponsiveProp(size);
|
|
10056
10067
|
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
@@ -10061,7 +10072,7 @@ var IconButton = (0, import_react42.forwardRef)(
|
|
|
10061
10072
|
"aria-label": label,
|
|
10062
10073
|
"data-wistia-ui-icon-button": true,
|
|
10063
10074
|
size: responsiveSize,
|
|
10064
|
-
children: (0,
|
|
10075
|
+
children: (0, import_react43.cloneElement)(import_react43.Children.only(children), {
|
|
10065
10076
|
size: responsiveSize
|
|
10066
10077
|
})
|
|
10067
10078
|
}
|
|
@@ -10072,7 +10083,7 @@ IconButton.displayName = "IconButton";
|
|
|
10072
10083
|
|
|
10073
10084
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
10074
10085
|
var import_styled_components55 = __toESM(require("styled-components"));
|
|
10075
|
-
var
|
|
10086
|
+
var import_react44 = require("react");
|
|
10076
10087
|
var import_type_guards35 = require("@wistia/type-guards");
|
|
10077
10088
|
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
10078
10089
|
var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
@@ -10085,10 +10096,10 @@ var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
|
10085
10096
|
}
|
|
10086
10097
|
`;
|
|
10087
10098
|
var COPY_SUCCESS_DURATION = 2e3;
|
|
10088
|
-
var InputClickToCopy = (0,
|
|
10099
|
+
var InputClickToCopy = (0, import_react44.forwardRef)(
|
|
10089
10100
|
({ value, onCopy, ...props }, ref) => {
|
|
10090
|
-
const [isCopied, setIsCopied] = (0,
|
|
10091
|
-
(0,
|
|
10101
|
+
const [isCopied, setIsCopied] = (0, import_react44.useState)(false);
|
|
10102
|
+
(0, import_react44.useEffect)(() => {
|
|
10092
10103
|
if (isCopied) {
|
|
10093
10104
|
const timeout = setTimeout(() => {
|
|
10094
10105
|
setIsCopied(false);
|
|
@@ -10138,12 +10149,12 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
10138
10149
|
var import_styled_components56 = __toESM(require("styled-components"));
|
|
10139
10150
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
10140
10151
|
var import_type_guards36 = require("@wistia/type-guards");
|
|
10141
|
-
var
|
|
10152
|
+
var import_react46 = require("react");
|
|
10142
10153
|
|
|
10143
10154
|
// src/components/Menu/MenuContext.tsx
|
|
10144
|
-
var
|
|
10145
|
-
var MenuContext = (0,
|
|
10146
|
-
var useMenuContext = () => (0,
|
|
10155
|
+
var import_react45 = require("react");
|
|
10156
|
+
var MenuContext = (0, import_react45.createContext)({ compact: false });
|
|
10157
|
+
var useMenuContext = () => (0, import_react45.useContext)(MenuContext);
|
|
10147
10158
|
|
|
10148
10159
|
// src/components/Menu/Menu.tsx
|
|
10149
10160
|
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
@@ -10247,7 +10258,7 @@ var Menu = ({
|
|
|
10247
10258
|
onInteractOutside,
|
|
10248
10259
|
...props
|
|
10249
10260
|
}) => {
|
|
10250
|
-
const contextValue = (0,
|
|
10261
|
+
const contextValue = (0, import_react46.useMemo)(() => ({ compact }), [compact]);
|
|
10251
10262
|
let controlProps = {
|
|
10252
10263
|
...(0, import_type_guards36.isNotNil)(onOpenChange) && (0, import_type_guards36.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
10253
10264
|
};
|
|
@@ -10321,13 +10332,13 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
10321
10332
|
MenuLabel.displayName = "MenuLabel";
|
|
10322
10333
|
|
|
10323
10334
|
// src/components/Menu/SubMenu.tsx
|
|
10324
|
-
var
|
|
10335
|
+
var import_react48 = require("react");
|
|
10325
10336
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
10326
10337
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
10327
10338
|
var import_type_guards38 = require("@wistia/type-guards");
|
|
10328
10339
|
|
|
10329
10340
|
// src/components/Menu/MenuItemButton.tsx
|
|
10330
|
-
var
|
|
10341
|
+
var import_react47 = require("react");
|
|
10331
10342
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
10332
10343
|
var import_type_guards37 = require("@wistia/type-guards");
|
|
10333
10344
|
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
@@ -10404,7 +10415,7 @@ var StyledBadgeContainer = import_styled_components58.default.div`
|
|
|
10404
10415
|
font-size: var(--wui-typography-label-4-size);
|
|
10405
10416
|
color: var(--wui-color-text-secondary);
|
|
10406
10417
|
`;
|
|
10407
|
-
var MenuItemButton = (0,
|
|
10418
|
+
var MenuItemButton = (0, import_react47.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
10408
10419
|
let { colorScheme, badge } = props;
|
|
10409
10420
|
if (appearance === "dangerous") {
|
|
10410
10421
|
if ((0, import_type_guards37.isNotUndefined)(colorScheme)) {
|
|
@@ -10500,7 +10511,7 @@ var SubMenu = ({
|
|
|
10500
10511
|
...props
|
|
10501
10512
|
}) => {
|
|
10502
10513
|
const { isSmAndUp } = useMq();
|
|
10503
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
10514
|
+
const [isExpanded, setIsExpanded] = (0, import_react48.useState)(false);
|
|
10504
10515
|
const { compact } = useMenuContext();
|
|
10505
10516
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
10506
10517
|
/* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
@@ -10529,10 +10540,10 @@ var SubMenu = ({
|
|
|
10529
10540
|
SubMenu.displayName = "SubMenu";
|
|
10530
10541
|
|
|
10531
10542
|
// src/components/Menu/MenuItem.tsx
|
|
10532
|
-
var
|
|
10543
|
+
var import_react49 = require("react");
|
|
10533
10544
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
10534
10545
|
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
10535
|
-
var MenuItem = (0,
|
|
10546
|
+
var MenuItem = (0, import_react49.forwardRef)(
|
|
10536
10547
|
({ onSelect = () => null, ...props }, ref) => {
|
|
10537
10548
|
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
10538
10549
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
@@ -10684,7 +10695,7 @@ var CheckboxMenuItem = ({
|
|
|
10684
10695
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
10685
10696
|
|
|
10686
10697
|
// src/components/Modal/Modal.tsx
|
|
10687
|
-
var
|
|
10698
|
+
var import_react53 = require("react");
|
|
10688
10699
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
10689
10700
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
10690
10701
|
var import_type_guards41 = require("@wistia/type-guards");
|
|
@@ -10744,19 +10755,19 @@ var ModalHeader = ({
|
|
|
10744
10755
|
};
|
|
10745
10756
|
|
|
10746
10757
|
// src/components/Modal/ModalContent.tsx
|
|
10747
|
-
var
|
|
10758
|
+
var import_react51 = require("react");
|
|
10748
10759
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
10749
10760
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
10750
10761
|
|
|
10751
10762
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10752
|
-
var
|
|
10763
|
+
var import_react50 = require("react");
|
|
10753
10764
|
var import_type_guards40 = require("@wistia/type-guards");
|
|
10754
10765
|
var useFocusRestore = () => {
|
|
10755
|
-
const previouslyFocusedRef = (0,
|
|
10756
|
-
(0,
|
|
10766
|
+
const previouslyFocusedRef = (0, import_react50.useRef)(null);
|
|
10767
|
+
(0, import_react50.useEffect)(() => {
|
|
10757
10768
|
previouslyFocusedRef.current = document.activeElement;
|
|
10758
10769
|
}, []);
|
|
10759
|
-
(0,
|
|
10770
|
+
(0, import_react50.useEffect)(() => {
|
|
10760
10771
|
return () => {
|
|
10761
10772
|
if ((0, import_type_guards40.isNotNil)(previouslyFocusedRef.current)) {
|
|
10762
10773
|
setTimeout(() => {
|
|
@@ -10810,7 +10821,7 @@ var StyledModalContent = (0, import_styled_components63.default)(import_react_di
|
|
|
10810
10821
|
}
|
|
10811
10822
|
}
|
|
10812
10823
|
`;
|
|
10813
|
-
var ModalContent = (0,
|
|
10824
|
+
var ModalContent = (0, import_react51.forwardRef)(
|
|
10814
10825
|
({ fullHeight, width, children, ...props }, ref) => {
|
|
10815
10826
|
useFocusRestore();
|
|
10816
10827
|
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
@@ -10828,7 +10839,7 @@ var ModalContent = (0, import_react50.forwardRef)(
|
|
|
10828
10839
|
);
|
|
10829
10840
|
|
|
10830
10841
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
10831
|
-
var
|
|
10842
|
+
var import_react52 = require("react");
|
|
10832
10843
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
10833
10844
|
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
10834
10845
|
var backdropAnimationDuration = 150;
|
|
@@ -10871,7 +10882,7 @@ var BackdropComponent = import_styled_components64.default.div`
|
|
|
10871
10882
|
}
|
|
10872
10883
|
}
|
|
10873
10884
|
`;
|
|
10874
|
-
var Backdrop = (0,
|
|
10885
|
+
var Backdrop = (0, import_react52.forwardRef)(
|
|
10875
10886
|
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
10876
10887
|
BackdropComponent,
|
|
10877
10888
|
{
|
|
@@ -10893,7 +10904,7 @@ var ModalBody = import_styled_components65.default.div`
|
|
|
10893
10904
|
display: flex;
|
|
10894
10905
|
order: 2;
|
|
10895
10906
|
`;
|
|
10896
|
-
var Modal = (0,
|
|
10907
|
+
var Modal = (0, import_react53.forwardRef)(
|
|
10897
10908
|
({
|
|
10898
10909
|
children,
|
|
10899
10910
|
fullHeight = false,
|
|
@@ -11107,7 +11118,7 @@ var ProgressBar = ({
|
|
|
11107
11118
|
ProgressBar.displayName = "ProgressBar";
|
|
11108
11119
|
|
|
11109
11120
|
// src/components/Radio/Radio.tsx
|
|
11110
|
-
var
|
|
11121
|
+
var import_react54 = require("react");
|
|
11111
11122
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11112
11123
|
var import_type_guards44 = require("@wistia/type-guards");
|
|
11113
11124
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
@@ -11210,7 +11221,7 @@ var StyledHiddenRadioInput = import_styled_components68.default.input`
|
|
|
11210
11221
|
display: block;
|
|
11211
11222
|
}
|
|
11212
11223
|
`;
|
|
11213
|
-
var Radio = (0,
|
|
11224
|
+
var Radio = (0, import_react54.forwardRef)(
|
|
11214
11225
|
({
|
|
11215
11226
|
checked,
|
|
11216
11227
|
disabled = false,
|
|
@@ -11225,7 +11236,7 @@ var Radio = (0, import_react53.forwardRef)(
|
|
|
11225
11236
|
hideLabel = false,
|
|
11226
11237
|
...props
|
|
11227
11238
|
}, ref) => {
|
|
11228
|
-
const generatedId = (0,
|
|
11239
|
+
const generatedId = (0, import_react54.useId)();
|
|
11229
11240
|
const computedId = (0, import_type_guards44.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11230
11241
|
return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(
|
|
11231
11242
|
StyledRadioWrapper,
|
|
@@ -11275,20 +11286,20 @@ var Radio = (0, import_react53.forwardRef)(
|
|
|
11275
11286
|
Radio.displayName = "Radio";
|
|
11276
11287
|
|
|
11277
11288
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
11278
|
-
var
|
|
11289
|
+
var import_react57 = require("react");
|
|
11279
11290
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11280
11291
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
11281
11292
|
var import_type_guards45 = require("@wistia/type-guards");
|
|
11282
11293
|
|
|
11283
11294
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11284
|
-
var
|
|
11295
|
+
var import_react55 = require("react");
|
|
11285
11296
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
11286
|
-
var SelectedItemStyleContext = (0,
|
|
11297
|
+
var SelectedItemStyleContext = (0, import_react55.createContext)(null);
|
|
11287
11298
|
var SelectedItemStyleProvider = ({
|
|
11288
11299
|
children
|
|
11289
11300
|
}) => {
|
|
11290
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
11291
|
-
const selectedItemIndicatorStyle = (0,
|
|
11301
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react55.useState)(null);
|
|
11302
|
+
const selectedItemIndicatorStyle = (0, import_react55.useMemo)(
|
|
11292
11303
|
() => selectedItemMeasurements != null ? {
|
|
11293
11304
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
11294
11305
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
@@ -11298,7 +11309,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11298
11309
|
},
|
|
11299
11310
|
[selectedItemMeasurements]
|
|
11300
11311
|
);
|
|
11301
|
-
const contextValue = (0,
|
|
11312
|
+
const contextValue = (0, import_react55.useMemo)(
|
|
11302
11313
|
() => ({
|
|
11303
11314
|
setSelectedItemMeasurements,
|
|
11304
11315
|
selectedItemIndicatorStyle
|
|
@@ -11308,7 +11319,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11308
11319
|
return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
11309
11320
|
};
|
|
11310
11321
|
var useSelectedItemStyle = () => {
|
|
11311
|
-
const context = (0,
|
|
11322
|
+
const context = (0, import_react55.useContext)(SelectedItemStyleContext);
|
|
11312
11323
|
if (context === null) {
|
|
11313
11324
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
11314
11325
|
}
|
|
@@ -11319,11 +11330,11 @@ var useSelectedItemStyle = () => {
|
|
|
11319
11330
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
11320
11331
|
|
|
11321
11332
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
11322
|
-
var
|
|
11323
|
-
var SegmentedControlValueContext = (0,
|
|
11333
|
+
var import_react56 = require("react");
|
|
11334
|
+
var SegmentedControlValueContext = (0, import_react56.createContext)(null);
|
|
11324
11335
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
11325
11336
|
var useSegmentedControlValue = () => {
|
|
11326
|
-
const context = (0,
|
|
11337
|
+
const context = (0, import_react56.useContext)(SegmentedControlValueContext);
|
|
11327
11338
|
if (context === null) {
|
|
11328
11339
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
11329
11340
|
}
|
|
@@ -11369,7 +11380,7 @@ var segmentedControlStyles = import_styled_components70.css`
|
|
|
11369
11380
|
var StyledSegmentedControl = (0, import_styled_components70.default)(import_react_toggle_group.Root)`
|
|
11370
11381
|
${segmentedControlStyles}
|
|
11371
11382
|
`;
|
|
11372
|
-
var SegmentedControl = (0,
|
|
11383
|
+
var SegmentedControl = (0, import_react57.forwardRef)(
|
|
11373
11384
|
({
|
|
11374
11385
|
children,
|
|
11375
11386
|
disabled = false,
|
|
@@ -11404,7 +11415,7 @@ var SegmentedControl = (0, import_react56.forwardRef)(
|
|
|
11404
11415
|
SegmentedControl.displayName = "SegmentedControl";
|
|
11405
11416
|
|
|
11406
11417
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
11407
|
-
var
|
|
11418
|
+
var import_react58 = require("react");
|
|
11408
11419
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
11409
11420
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
11410
11421
|
var import_type_guards46 = require("@wistia/type-guards");
|
|
@@ -11472,11 +11483,11 @@ var segmentedControlItemStyles = import_styled_components71.css`
|
|
|
11472
11483
|
var StyledSegmentedControlItem = (0, import_styled_components71.default)(import_react_toggle_group2.Item)`
|
|
11473
11484
|
${segmentedControlItemStyles}
|
|
11474
11485
|
`;
|
|
11475
|
-
var SegmentedControlItem = (0,
|
|
11486
|
+
var SegmentedControlItem = (0, import_react58.forwardRef)(
|
|
11476
11487
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11477
11488
|
const selectedValue = useSegmentedControlValue();
|
|
11478
11489
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
11479
|
-
const buttonRef = (0,
|
|
11490
|
+
const buttonRef = (0, import_react58.useRef)(null);
|
|
11480
11491
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11481
11492
|
const handleClick = (event) => {
|
|
11482
11493
|
const target = event.target;
|
|
@@ -11485,7 +11496,7 @@ var SegmentedControlItem = (0, import_react57.forwardRef)(
|
|
|
11485
11496
|
event.preventDefault();
|
|
11486
11497
|
}
|
|
11487
11498
|
};
|
|
11488
|
-
(0,
|
|
11499
|
+
(0, import_react58.useEffect)(() => {
|
|
11489
11500
|
const buttonElem = buttonRef.current;
|
|
11490
11501
|
if (!buttonElem) {
|
|
11491
11502
|
return void 0;
|
|
@@ -11531,7 +11542,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
11531
11542
|
|
|
11532
11543
|
// src/components/Select/Select.tsx
|
|
11533
11544
|
var import_react_select = require("@radix-ui/react-select");
|
|
11534
|
-
var
|
|
11545
|
+
var import_react59 = require("react");
|
|
11535
11546
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11536
11547
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11537
11548
|
var StyledTrigger = (0, import_styled_components72.default)(import_react_select.Trigger)`
|
|
@@ -11596,7 +11607,7 @@ var StyledContent3 = (0, import_styled_components72.default)(import_react_select
|
|
|
11596
11607
|
max-height: var(--radix-select-content-available-height);
|
|
11597
11608
|
z-index: var(--wui-zindex-select);
|
|
11598
11609
|
`;
|
|
11599
|
-
var Select = (0,
|
|
11610
|
+
var Select = (0, import_react59.forwardRef)(
|
|
11600
11611
|
({
|
|
11601
11612
|
colorScheme = "inherit",
|
|
11602
11613
|
children,
|
|
@@ -11645,7 +11656,7 @@ Select.displayName = "Select";
|
|
|
11645
11656
|
|
|
11646
11657
|
// src/components/Select/SelectOption.tsx
|
|
11647
11658
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11648
|
-
var
|
|
11659
|
+
var import_react60 = require("react");
|
|
11649
11660
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11650
11661
|
var import_type_guards47 = require("@wistia/type-guards");
|
|
11651
11662
|
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
@@ -11676,7 +11687,7 @@ var StyledItem = (0, import_styled_components73.default)(import_react_select2.It
|
|
|
11676
11687
|
var StyledIconContainer = import_styled_components73.default.span`
|
|
11677
11688
|
width: 12px;
|
|
11678
11689
|
`;
|
|
11679
|
-
var SelectOption = (0,
|
|
11690
|
+
var SelectOption = (0, import_react60.forwardRef)(
|
|
11680
11691
|
({ children, selectedDisplayValue, ...props }, forwardedRef) => {
|
|
11681
11692
|
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(
|
|
11682
11693
|
StyledItem,
|
|
@@ -11724,7 +11735,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11724
11735
|
};
|
|
11725
11736
|
|
|
11726
11737
|
// src/components/Switch/Switch.tsx
|
|
11727
|
-
var
|
|
11738
|
+
var import_react61 = require("react");
|
|
11728
11739
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11729
11740
|
var import_type_guards48 = require("@wistia/type-guards");
|
|
11730
11741
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
@@ -11829,7 +11840,7 @@ var StyledHiddenSwitchInput = import_styled_components75.default.input`
|
|
|
11829
11840
|
}
|
|
11830
11841
|
}
|
|
11831
11842
|
`;
|
|
11832
|
-
var Switch = (0,
|
|
11843
|
+
var Switch = (0, import_react61.forwardRef)(
|
|
11833
11844
|
({
|
|
11834
11845
|
checked,
|
|
11835
11846
|
disabled = false,
|
|
@@ -11844,7 +11855,7 @@ var Switch = (0, import_react60.forwardRef)(
|
|
|
11844
11855
|
hideLabel = false,
|
|
11845
11856
|
...props
|
|
11846
11857
|
}, ref) => {
|
|
11847
|
-
const generatedId = (0,
|
|
11858
|
+
const generatedId = (0, import_react61.useId)();
|
|
11848
11859
|
const computedId = (0, import_type_guards48.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11849
11860
|
return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
11850
11861
|
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
@@ -11934,8 +11945,8 @@ var Table = ({
|
|
|
11934
11945
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
11935
11946
|
|
|
11936
11947
|
// src/components/Table/TableSectionContext.ts
|
|
11937
|
-
var
|
|
11938
|
-
var TableSectionContext = (0,
|
|
11948
|
+
var import_react62 = require("react");
|
|
11949
|
+
var TableSectionContext = (0, import_react62.createContext)(null);
|
|
11939
11950
|
|
|
11940
11951
|
// src/components/Table/TableBody.tsx
|
|
11941
11952
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
@@ -11945,7 +11956,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
11945
11956
|
};
|
|
11946
11957
|
|
|
11947
11958
|
// src/components/Table/TableCell.tsx
|
|
11948
|
-
var
|
|
11959
|
+
var import_react63 = require("react");
|
|
11949
11960
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
11950
11961
|
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
11951
11962
|
var sharedStyles = import_styled_components78.css`
|
|
@@ -11966,7 +11977,7 @@ var StyledTd = import_styled_components78.default.td`
|
|
|
11966
11977
|
line-height: var(--wui-typography-body-2-line-height);
|
|
11967
11978
|
`;
|
|
11968
11979
|
var TableCell = ({ children, ...props }) => {
|
|
11969
|
-
const section = (0,
|
|
11980
|
+
const section = (0, import_react63.useContext)(TableSectionContext);
|
|
11970
11981
|
if (section === "head") {
|
|
11971
11982
|
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(StyledTh, { ...props, children });
|
|
11972
11983
|
}
|
|
@@ -11998,7 +12009,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
11998
12009
|
};
|
|
11999
12010
|
|
|
12000
12011
|
// src/components/Tabs/Tabs.tsx
|
|
12001
|
-
var
|
|
12012
|
+
var import_react67 = require("react");
|
|
12002
12013
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
12003
12014
|
var import_type_guards50 = require("@wistia/type-guards");
|
|
12004
12015
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
@@ -12053,17 +12064,17 @@ var TabList = ({
|
|
|
12053
12064
|
TabList.displayName = "TabList";
|
|
12054
12065
|
|
|
12055
12066
|
// src/components/Tabs/TabItem.tsx
|
|
12056
|
-
var
|
|
12067
|
+
var import_react65 = require("react");
|
|
12057
12068
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
12058
12069
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
12059
12070
|
var import_type_guards49 = require("@wistia/type-guards");
|
|
12060
12071
|
|
|
12061
12072
|
// src/components/Tabs/useTabsValue.tsx
|
|
12062
|
-
var
|
|
12063
|
-
var TabsValueContext = (0,
|
|
12073
|
+
var import_react64 = require("react");
|
|
12074
|
+
var TabsValueContext = (0, import_react64.createContext)(null);
|
|
12064
12075
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
12065
12076
|
var useTabsValue = () => {
|
|
12066
|
-
const context = (0,
|
|
12077
|
+
const context = (0, import_react64.useContext)(TabsValueContext);
|
|
12067
12078
|
if (context === null) {
|
|
12068
12079
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
12069
12080
|
}
|
|
@@ -12079,13 +12090,13 @@ var StyledTabItem = (0, import_styled_components84.default)(import_react_tabs3.T
|
|
|
12079
12090
|
outline: none;
|
|
12080
12091
|
}
|
|
12081
12092
|
`;
|
|
12082
|
-
var TabItem = (0,
|
|
12093
|
+
var TabItem = (0, import_react65.forwardRef)(
|
|
12083
12094
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
12084
12095
|
const selectedValue = useTabsValue();
|
|
12085
12096
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
12086
|
-
const buttonRef = (0,
|
|
12097
|
+
const buttonRef = (0, import_react65.useRef)(null);
|
|
12087
12098
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
12088
|
-
(0,
|
|
12099
|
+
(0, import_react65.useEffect)(() => {
|
|
12089
12100
|
const buttonElem = buttonRef.current;
|
|
12090
12101
|
if (!buttonElem) {
|
|
12091
12102
|
return void 0;
|
|
@@ -12129,16 +12140,16 @@ var TabItem = (0, import_react64.forwardRef)(
|
|
|
12129
12140
|
TabItem.displayName = "TabItem";
|
|
12130
12141
|
|
|
12131
12142
|
// src/components/Tabs/extractTabItems.ts
|
|
12132
|
-
var
|
|
12143
|
+
var import_react66 = require("react");
|
|
12133
12144
|
var extractTabItems = (children) => {
|
|
12134
12145
|
const tabItems = [];
|
|
12135
|
-
|
|
12136
|
-
if (!(0,
|
|
12146
|
+
import_react66.Children.forEach(children, (child) => {
|
|
12147
|
+
if (!(0, import_react66.isValidElement)(child)) {
|
|
12137
12148
|
return;
|
|
12138
12149
|
}
|
|
12139
12150
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
12140
12151
|
tabItems.push(child);
|
|
12141
|
-
} else if (child.type ===
|
|
12152
|
+
} else if (child.type === import_react66.Fragment) {
|
|
12142
12153
|
const fragmentElement = child;
|
|
12143
12154
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
12144
12155
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -12185,7 +12196,7 @@ var StyledTabsRoot = (0, import_styled_components86.default)(import_react_tabs4.
|
|
|
12185
12196
|
flex-direction: column;
|
|
12186
12197
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
12187
12198
|
`;
|
|
12188
|
-
var Tabs = (0,
|
|
12199
|
+
var Tabs = (0, import_react67.forwardRef)(
|
|
12189
12200
|
({
|
|
12190
12201
|
children,
|
|
12191
12202
|
fullWidth = true,
|
|
@@ -12197,7 +12208,7 @@ var Tabs = (0, import_react66.forwardRef)(
|
|
|
12197
12208
|
...props
|
|
12198
12209
|
}, ref) => {
|
|
12199
12210
|
const tabItems = extractTabItems(children);
|
|
12200
|
-
const [internalSelectedValue, setInternalSelectedValue] = (0,
|
|
12211
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react67.useState)(defaultSelectedValue);
|
|
12201
12212
|
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
12202
12213
|
defaultValue: defaultSelectedValue,
|
|
12203
12214
|
onValueChange: setInternalSelectedValue
|
|
@@ -12283,15 +12294,15 @@ var Tabs = (0, import_react66.forwardRef)(
|
|
|
12283
12294
|
Tabs.displayName = "Tabs";
|
|
12284
12295
|
|
|
12285
12296
|
// src/components/Tabs/Tab.tsx
|
|
12286
|
-
var
|
|
12297
|
+
var import_react68 = require("react");
|
|
12287
12298
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
12288
|
-
var Tab = (0,
|
|
12299
|
+
var Tab = (0, import_react68.forwardRef)(({ children }, ref) => {
|
|
12289
12300
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("div", { ref, children });
|
|
12290
12301
|
});
|
|
12291
12302
|
Tab.displayName = "Tab";
|
|
12292
12303
|
|
|
12293
12304
|
// src/components/Tag/Tag.tsx
|
|
12294
|
-
var
|
|
12305
|
+
var import_react69 = require("react");
|
|
12295
12306
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
12296
12307
|
var import_type_guards51 = require("@wistia/type-guards");
|
|
12297
12308
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
@@ -12408,7 +12419,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12408
12419
|
)
|
|
12409
12420
|
] });
|
|
12410
12421
|
};
|
|
12411
|
-
var Tag = (0,
|
|
12422
|
+
var Tag = (0, import_react69.forwardRef)(
|
|
12412
12423
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12413
12424
|
const hasIcon = (0, import_type_guards51.isNotNil)(icon);
|
|
12414
12425
|
const labelProps = (0, import_type_guards51.isNotNil)(href) && (0, import_type_guards51.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
@@ -12482,7 +12493,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
|
12482
12493
|
ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
12483
12494
|
|
|
12484
12495
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12485
|
-
var
|
|
12496
|
+
var import_react70 = require("react");
|
|
12486
12497
|
var import_styled_components90 = __toESM(require("styled-components"));
|
|
12487
12498
|
var import_type_guards54 = require("@wistia/type-guards");
|
|
12488
12499
|
|
|
@@ -12669,7 +12680,7 @@ var StyledThumbnail = import_styled_components90.default.div`
|
|
|
12669
12680
|
border-radius: calc(8% * (9 / 16)) / 8%;
|
|
12670
12681
|
}
|
|
12671
12682
|
`;
|
|
12672
|
-
var Thumbnail = (0,
|
|
12683
|
+
var Thumbnail = (0, import_react70.forwardRef)(
|
|
12673
12684
|
({
|
|
12674
12685
|
gradientBackground = "defaultMidOne",
|
|
12675
12686
|
thumbnailImageType = "square",
|
|
@@ -12705,7 +12716,7 @@ var Thumbnail = (0, import_react69.forwardRef)(
|
|
|
12705
12716
|
Thumbnail.displayName = "Thumbnail";
|
|
12706
12717
|
|
|
12707
12718
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
12708
|
-
var
|
|
12719
|
+
var import_react71 = __toESM(require("react"));
|
|
12709
12720
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
12710
12721
|
var import_type_guards55 = require("@wistia/type-guards");
|
|
12711
12722
|
var import_jsx_runtime271 = (
|
|
@@ -12785,10 +12796,10 @@ var ThumbnailCollage = ({
|
|
|
12785
12796
|
gradientBackground = "defaultMidOne",
|
|
12786
12797
|
...props
|
|
12787
12798
|
}) => {
|
|
12788
|
-
const thumbnailArray =
|
|
12799
|
+
const thumbnailArray = import_react71.default.Children.toArray(children);
|
|
12789
12800
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
12790
12801
|
const thumbnails = (0, import_type_guards55.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
12791
|
-
return
|
|
12802
|
+
return import_react71.default.cloneElement(child, {
|
|
12792
12803
|
...child.props,
|
|
12793
12804
|
children: void 0
|
|
12794
12805
|
});
|
|
@@ -13037,6 +13048,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
13037
13048
|
useLockBodyScroll,
|
|
13038
13049
|
useMq,
|
|
13039
13050
|
useOnClickOutside,
|
|
13051
|
+
usePreviousValue,
|
|
13040
13052
|
useToast,
|
|
13041
13053
|
useWindowSize
|
|
13042
13054
|
});
|