@wistia/ui 0.8.9-beta.8e513df6.87f52b0 → 0.8.9
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 +226 -225
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +25 -26
- package/dist/index.d.ts +25 -26
- package/dist/index.mjs +64 -63
- 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.9
|
|
3
|
+
* @license @wistia/ui v0.8.9
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -142,7 +142,6 @@ module.exports = __toCommonJS(index_exports);
|
|
|
142
142
|
|
|
143
143
|
// src/providers/UIProvider/UIProvider.tsx
|
|
144
144
|
var import_react_tooltip = require("@radix-ui/react-tooltip");
|
|
145
|
-
var import_react3 = require("react");
|
|
146
145
|
|
|
147
146
|
// src/css/GlobalStyle.tsx
|
|
148
147
|
var import_styled_components12 = require("styled-components");
|
|
@@ -1601,17 +1600,12 @@ var ToastProvider = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_so
|
|
|
1601
1600
|
|
|
1602
1601
|
// src/providers/UIProvider/UIProvider.tsx
|
|
1603
1602
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1604
|
-
var UIProviderNestingContext = (0, import_react3.createContext)(false);
|
|
1605
1603
|
var UIProvider = ({ children }) => {
|
|
1606
|
-
|
|
1607
|
-
if (isNested) {
|
|
1608
|
-
console.warn("UIProvider is nested. Only one instance of UIProvider.");
|
|
1609
|
-
}
|
|
1610
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(UIProviderNestingContext.Provider, { value: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AriaLiveProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_tooltip.Provider, { children: [
|
|
1604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AriaLiveProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_tooltip.Provider, { children: [
|
|
1611
1605
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(GlobalStyle, {}),
|
|
1612
1606
|
children,
|
|
1613
1607
|
process.env["NODE_ENV"] !== "test" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToastProvider, {})
|
|
1614
|
-
] }) })
|
|
1608
|
+
] }) });
|
|
1615
1609
|
};
|
|
1616
1610
|
|
|
1617
1611
|
// src/helpers/copyToClipboard/copyToClipboard.ts
|
|
@@ -2079,10 +2073,10 @@ var mq = {
|
|
|
2079
2073
|
};
|
|
2080
2074
|
|
|
2081
2075
|
// src/hooks/useAriaLive/useAriaLive.tsx
|
|
2082
|
-
var
|
|
2076
|
+
var import_react3 = require("react");
|
|
2083
2077
|
var import_type_guards6 = require("@wistia/type-guards");
|
|
2084
2078
|
var useAriaLive = () => {
|
|
2085
|
-
const context = (0,
|
|
2079
|
+
const context = (0, import_react3.useContext)(AriaLiveContext);
|
|
2086
2080
|
if ((0, import_type_guards6.isNil)(context)) {
|
|
2087
2081
|
throw new Error("useAriaLive must be used within an AriaLiveProvider");
|
|
2088
2082
|
}
|
|
@@ -2090,12 +2084,12 @@ var useAriaLive = () => {
|
|
|
2090
2084
|
};
|
|
2091
2085
|
|
|
2092
2086
|
// src/hooks/useBoolean/useBoolean.ts
|
|
2093
|
-
var
|
|
2087
|
+
var import_react4 = require("react");
|
|
2094
2088
|
var useBoolean = (initialValue = false) => {
|
|
2095
|
-
const [value, setValue] = (0,
|
|
2096
|
-
const toggle = (0,
|
|
2097
|
-
const setTrue = (0,
|
|
2098
|
-
const setFalse = (0,
|
|
2089
|
+
const [value, setValue] = (0, import_react4.useState)(initialValue);
|
|
2090
|
+
const toggle = (0, import_react4.useCallback)(() => setValue((val) => !val), []);
|
|
2091
|
+
const setTrue = (0, import_react4.useCallback)(() => setValue(true), []);
|
|
2092
|
+
const setFalse = (0, import_react4.useCallback)(() => setValue(false), []);
|
|
2099
2093
|
return [value, toggle, setTrue, setFalse, setValue];
|
|
2100
2094
|
};
|
|
2101
2095
|
|
|
@@ -2104,10 +2098,10 @@ var import_use_file_picker = require("use-file-picker");
|
|
|
2104
2098
|
var import_validators = require("use-file-picker/validators");
|
|
2105
2099
|
|
|
2106
2100
|
// src/hooks/useKey/useKey.ts
|
|
2107
|
-
var
|
|
2101
|
+
var import_react6 = require("react");
|
|
2108
2102
|
|
|
2109
2103
|
// src/private/hooks/useEvent/useEvent.ts
|
|
2110
|
-
var
|
|
2104
|
+
var import_react5 = require("react");
|
|
2111
2105
|
|
|
2112
2106
|
// src/private/helpers/isValidRef/isValidRef.ts
|
|
2113
2107
|
var import_type_guards7 = require("@wistia/type-guards");
|
|
@@ -2126,15 +2120,15 @@ var isEventTargetSupported = (eventTarget) => (
|
|
|
2126
2120
|
!!(typeof eventTarget === "object" && eventTarget?.addEventListener)
|
|
2127
2121
|
);
|
|
2128
2122
|
var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}) => {
|
|
2129
|
-
const savedEventHandler = (0,
|
|
2130
|
-
const savedEventOptions = (0,
|
|
2131
|
-
(0,
|
|
2123
|
+
const savedEventHandler = (0, import_react5.useRef)();
|
|
2124
|
+
const savedEventOptions = (0, import_react5.useRef)();
|
|
2125
|
+
(0, import_react5.useEffect)(() => {
|
|
2132
2126
|
savedEventHandler.current = eventHandler;
|
|
2133
2127
|
}, [eventHandler]);
|
|
2134
|
-
(0,
|
|
2128
|
+
(0, import_react5.useEffect)(() => {
|
|
2135
2129
|
savedEventOptions.current = eventOptions;
|
|
2136
2130
|
}, [eventOptions]);
|
|
2137
|
-
(0,
|
|
2131
|
+
(0, import_react5.useEffect)(() => {
|
|
2138
2132
|
const target = isValidRef(eventTarget) ? eventTarget.current : eventTarget;
|
|
2139
2133
|
if (!eventName || !isEventTargetSupported(target)) {
|
|
2140
2134
|
return;
|
|
@@ -2154,7 +2148,7 @@ var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}
|
|
|
2154
2148
|
|
|
2155
2149
|
// src/hooks/useKey/useKey.ts
|
|
2156
2150
|
var useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOptions } = {}) => {
|
|
2157
|
-
const memoizedEventHandler = (0,
|
|
2151
|
+
const memoizedEventHandler = (0, import_react6.useCallback)(
|
|
2158
2152
|
(handlerEvent) => {
|
|
2159
2153
|
if (["INPUT", "TEXTAREA", "SELECT"].includes(document.activeElement?.nodeName ?? "") || document.activeElement?.isContentEditable) {
|
|
2160
2154
|
return;
|
|
@@ -2179,9 +2173,9 @@ var useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOpti
|
|
|
2179
2173
|
};
|
|
2180
2174
|
|
|
2181
2175
|
// src/hooks/useLocalStorage/useLocalStorage.ts
|
|
2182
|
-
var
|
|
2176
|
+
var import_react7 = require("react");
|
|
2183
2177
|
var useLocalStorage = (key, initialValue, storage = window.localStorage) => {
|
|
2184
|
-
const [storedValue, setStoredValue] = (0,
|
|
2178
|
+
const [storedValue, setStoredValue] = (0, import_react7.useState)(() => {
|
|
2185
2179
|
try {
|
|
2186
2180
|
const item = storage.getItem(key);
|
|
2187
2181
|
return item !== null && !!item ? JSON.parse(item) : initialValue;
|
|
@@ -2207,9 +2201,9 @@ var useLocalStorage = (key, initialValue, storage = window.localStorage) => {
|
|
|
2207
2201
|
};
|
|
2208
2202
|
|
|
2209
2203
|
// src/hooks/useLockBodyScroll/useLockBodyScroll.ts
|
|
2210
|
-
var
|
|
2204
|
+
var import_react8 = require("react");
|
|
2211
2205
|
var useLockBodyScroll = (locked) => {
|
|
2212
|
-
(0,
|
|
2206
|
+
(0, import_react8.useLayoutEffect)(() => {
|
|
2213
2207
|
if (locked) {
|
|
2214
2208
|
const originalStyle = window.getComputedStyle(document.body).overflow;
|
|
2215
2209
|
document.body.style.overflow = "hidden";
|
|
@@ -2222,9 +2216,9 @@ var useLockBodyScroll = (locked) => {
|
|
|
2222
2216
|
};
|
|
2223
2217
|
|
|
2224
2218
|
// src/hooks/useOnClickOutside/useOnClickOutside.ts
|
|
2225
|
-
var
|
|
2219
|
+
var import_react9 = require("react");
|
|
2226
2220
|
var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) => {
|
|
2227
|
-
(0,
|
|
2221
|
+
(0, import_react9.useEffect)(() => {
|
|
2228
2222
|
const listener = (event) => {
|
|
2229
2223
|
if (!ref.current || ref.current.contains(event.target)) {
|
|
2230
2224
|
return;
|
|
@@ -2254,7 +2248,7 @@ var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) =
|
|
|
2254
2248
|
var import_type_guards8 = require("@wistia/type-guards");
|
|
2255
2249
|
|
|
2256
2250
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2257
|
-
var
|
|
2251
|
+
var import_react10 = require("react");
|
|
2258
2252
|
var import_throttle_debounce = require("throttle-debounce");
|
|
2259
2253
|
|
|
2260
2254
|
// src/private/helpers/isClient/isClient.ts
|
|
@@ -2262,11 +2256,11 @@ var isClient = () => typeof window !== "undefined" && typeof document !== "undef
|
|
|
2262
2256
|
|
|
2263
2257
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2264
2258
|
var useWindowSize = (interval = 0) => {
|
|
2265
|
-
const [dimensions, setDimensions] = (0,
|
|
2259
|
+
const [dimensions, setDimensions] = (0, import_react10.useState)({
|
|
2266
2260
|
width: isClient() ? window.innerWidth : 0,
|
|
2267
2261
|
height: isClient() ? window.innerHeight : 0
|
|
2268
2262
|
});
|
|
2269
|
-
(0,
|
|
2263
|
+
(0, import_react10.useLayoutEffect)(() => {
|
|
2270
2264
|
const handleResize = (0, import_throttle_debounce.debounce)(
|
|
2271
2265
|
interval,
|
|
2272
2266
|
() => setDimensions({
|
|
@@ -2318,11 +2312,11 @@ var useActiveMq = () => {
|
|
|
2318
2312
|
};
|
|
2319
2313
|
|
|
2320
2314
|
// src/hooks/useToast/useToast.tsx
|
|
2321
|
-
var
|
|
2315
|
+
var import_react12 = require("react");
|
|
2322
2316
|
var import_sonner2 = require("sonner");
|
|
2323
2317
|
|
|
2324
2318
|
// src/private/components/Toast/Toast.tsx
|
|
2325
|
-
var
|
|
2319
|
+
var import_react11 = require("react");
|
|
2326
2320
|
var import_styled_components16 = __toESM(require("styled-components"));
|
|
2327
2321
|
var import_type_guards10 = require("@wistia/type-guards");
|
|
2328
2322
|
|
|
@@ -2560,8 +2554,8 @@ var StyledToast = import_styled_components16.default.div`
|
|
|
2560
2554
|
}
|
|
2561
2555
|
`;
|
|
2562
2556
|
var Action = ({ actionButton }) => {
|
|
2563
|
-
if ((0, import_type_guards10.isNotNil)(actionButton) && (0,
|
|
2564
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0,
|
|
2557
|
+
if ((0, import_type_guards10.isNotNil)(actionButton) && (0, import_react11.isValidElement)(actionButton)) {
|
|
2558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0, import_react11.cloneElement)(actionButton, {
|
|
2565
2559
|
variant: "soft",
|
|
2566
2560
|
// force Button variant
|
|
2567
2561
|
size: "sm"
|
|
@@ -2597,7 +2591,7 @@ Toast.displayName = "Toast";
|
|
|
2597
2591
|
// src/hooks/useToast/useToast.tsx
|
|
2598
2592
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2599
2593
|
var useToast = () => {
|
|
2600
|
-
return (0,
|
|
2594
|
+
return (0, import_react12.useCallback)(
|
|
2601
2595
|
({ message, action, colorScheme, icon, position = "bottom-left", duration = 3e3 }) => {
|
|
2602
2596
|
import_sonner2.toast.custom(
|
|
2603
2597
|
() => {
|
|
@@ -2619,7 +2613,7 @@ var useToast = () => {
|
|
|
2619
2613
|
};
|
|
2620
2614
|
|
|
2621
2615
|
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2622
|
-
var
|
|
2616
|
+
var import_react13 = require("react");
|
|
2623
2617
|
var import_type_guards11 = require("@wistia/type-guards");
|
|
2624
2618
|
|
|
2625
2619
|
// src/hooks/useFocusTrap/helpers.ts
|
|
@@ -2769,9 +2763,9 @@ var isRef = (val) => {
|
|
|
2769
2763
|
return val !== null && typeof val === "object" && "current" in val;
|
|
2770
2764
|
};
|
|
2771
2765
|
var useFocusTrap = (active = true, options = {}) => {
|
|
2772
|
-
const ref = (0,
|
|
2773
|
-
const restoreAriaRef = (0,
|
|
2774
|
-
const setRef = (0,
|
|
2766
|
+
const ref = (0, import_react13.useRef)(null);
|
|
2767
|
+
const restoreAriaRef = (0, import_react13.useRef)(null);
|
|
2768
|
+
const setRef = (0, import_react13.useCallback)(
|
|
2775
2769
|
(node) => {
|
|
2776
2770
|
if (restoreAriaRef.current !== null) {
|
|
2777
2771
|
restoreAriaRef.current();
|
|
@@ -2833,7 +2827,7 @@ var useFocusTrap = (active = true, options = {}) => {
|
|
|
2833
2827
|
},
|
|
2834
2828
|
[active, options.focusSelector, options.disableAriaHider]
|
|
2835
2829
|
);
|
|
2836
|
-
(0,
|
|
2830
|
+
(0, import_react13.useEffect)(() => {
|
|
2837
2831
|
if (!active) {
|
|
2838
2832
|
return void 0;
|
|
2839
2833
|
}
|
|
@@ -2851,11 +2845,11 @@ var useFocusTrap = (active = true, options = {}) => {
|
|
|
2851
2845
|
};
|
|
2852
2846
|
|
|
2853
2847
|
// src/components/ActionButton/ActionButton.tsx
|
|
2854
|
-
var
|
|
2848
|
+
var import_react17 = require("react");
|
|
2855
2849
|
var import_styled_components22 = __toESM(require("styled-components"));
|
|
2856
2850
|
|
|
2857
2851
|
// src/components/Button/Button.tsx
|
|
2858
|
-
var
|
|
2852
|
+
var import_react16 = require("react");
|
|
2859
2853
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
2860
2854
|
var import_type_guards15 = require("@wistia/type-guards");
|
|
2861
2855
|
|
|
@@ -6917,13 +6911,13 @@ var iconMap = {
|
|
|
6917
6911
|
|
|
6918
6912
|
// src/private/hooks/useResponsiveProp/useResponsiveProp.ts
|
|
6919
6913
|
var import_type_guards12 = require("@wistia/type-guards");
|
|
6920
|
-
var
|
|
6914
|
+
var import_react14 = require("react");
|
|
6921
6915
|
var isResponsiveObject = (values) => {
|
|
6922
6916
|
return typeof values === "object" && values !== null && !Array.isArray(values) && "base" in values;
|
|
6923
6917
|
};
|
|
6924
6918
|
var useResponsiveProp = (values) => {
|
|
6925
6919
|
const activeMediaQueries = useActiveMq();
|
|
6926
|
-
return (0,
|
|
6920
|
+
return (0, import_react14.useMemo)(() => {
|
|
6927
6921
|
if ((0, import_type_guards12.isRecord)(values) && isResponsiveObject(values)) {
|
|
6928
6922
|
const mq2 = activeMediaQueries.find((key) => key in values);
|
|
6929
6923
|
return (0, import_type_guards12.isNotUndefined)(mq2) && (0, import_type_guards12.isNotUndefined)(values[mq2]) ? values[mq2] : values.base;
|
|
@@ -6990,30 +6984,32 @@ var Icon = ({
|
|
|
6990
6984
|
Icon.displayName = "Icon";
|
|
6991
6985
|
|
|
6992
6986
|
// src/components/Link/Link.tsx
|
|
6993
|
-
var
|
|
6987
|
+
var import_react15 = require("react");
|
|
6988
|
+
var import_type_guards14 = require("@wistia/type-guards");
|
|
6994
6989
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
6995
6990
|
var import_react_router_dom = require("react-router-dom");
|
|
6996
|
-
var import_type_guards14 = require("@wistia/type-guards");
|
|
6997
6991
|
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
6998
6992
|
var generateHref = (href, type, disabled) => {
|
|
6999
6993
|
if (disabled || (0, import_type_guards14.isNil)(href)) {
|
|
7000
6994
|
return void 0;
|
|
7001
6995
|
}
|
|
7002
|
-
let
|
|
6996
|
+
let to = href;
|
|
7003
6997
|
if (type === "phone") {
|
|
7004
|
-
|
|
6998
|
+
to = `tel:${href}`;
|
|
7005
6999
|
}
|
|
7006
7000
|
if (type === "email") {
|
|
7007
|
-
|
|
7001
|
+
to = `mailto:${href}`;
|
|
7008
7002
|
}
|
|
7009
|
-
return
|
|
7003
|
+
return to;
|
|
7010
7004
|
};
|
|
7011
7005
|
var isButton = (props) => (0, import_type_guards14.isUndefined)(props.href);
|
|
7012
7006
|
var isLink = (props) => (0, import_type_guards14.isNotUndefined)(props.href);
|
|
7013
7007
|
var StyledLink = import_styled_components20.default.a`
|
|
7008
|
+
--link-icon-size: 14px;
|
|
7009
|
+
|
|
7014
7010
|
${({ href }) => (0, import_type_guards14.isNil)(href) && buttonResetCss};
|
|
7015
7011
|
${({ $colorScheme }) => getColorScheme($colorScheme)}
|
|
7016
|
-
cursor:
|
|
7012
|
+
cursor: pointer;
|
|
7017
7013
|
font-family: var(--wui-typography-family-default);
|
|
7018
7014
|
color: var(--wui-color-text-link);
|
|
7019
7015
|
text-decoration: ${({ $underline }) => $underline ? "underline" : "none"};
|
|
@@ -7023,12 +7019,12 @@ var StyledLink = import_styled_components20.default.a`
|
|
|
7023
7019
|
|
|
7024
7020
|
&& {
|
|
7025
7021
|
svg {
|
|
7026
|
-
width:
|
|
7027
|
-
height:
|
|
7022
|
+
width: var(--link-icon-size);
|
|
7023
|
+
height: var(--link-icon-size);
|
|
7028
7024
|
}
|
|
7029
7025
|
}
|
|
7030
7026
|
`;
|
|
7031
|
-
var Link = (0,
|
|
7027
|
+
var Link = (0, import_react15.forwardRef)(
|
|
7032
7028
|
({
|
|
7033
7029
|
beforeAction,
|
|
7034
7030
|
children,
|
|
@@ -7069,7 +7065,6 @@ var Link = (0, import_react16.forwardRef)(
|
|
|
7069
7065
|
};
|
|
7070
7066
|
const commonProps = {
|
|
7071
7067
|
$colorScheme: colorScheme,
|
|
7072
|
-
$disabled: disabled,
|
|
7073
7068
|
$underline: underline,
|
|
7074
7069
|
onClick: handleClick
|
|
7075
7070
|
};
|
|
@@ -7088,27 +7083,33 @@ var Link = (0, import_react16.forwardRef)(
|
|
|
7088
7083
|
}
|
|
7089
7084
|
if (isLink(props)) {
|
|
7090
7085
|
const externalLinkProps = type === "external" ? { target: "_blank", rel: "noopener noreferrer" } : null;
|
|
7091
|
-
const routerSpecificProps = shouldUseReactRouterLink ? {
|
|
7092
|
-
// TODO: Using 'any' here due to styled-components typing limitations with RouterLink
|
|
7093
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
7094
|
-
as: import_react_router_dom.Link,
|
|
7095
|
-
to: to ?? ""
|
|
7096
|
-
} : {
|
|
7097
|
-
as: "a",
|
|
7098
|
-
href: to
|
|
7099
|
-
};
|
|
7100
7086
|
const combinedProps = {
|
|
7101
7087
|
ref,
|
|
7102
7088
|
...props,
|
|
7103
7089
|
...commonProps,
|
|
7104
|
-
...externalLinkProps
|
|
7105
|
-
...routerSpecificProps
|
|
7090
|
+
...externalLinkProps
|
|
7106
7091
|
};
|
|
7107
|
-
return /* @__PURE__ */ (0, import_jsx_runtime192.
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7092
|
+
return shouldUseReactRouterLink ? /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
7093
|
+
StyledLink,
|
|
7094
|
+
{
|
|
7095
|
+
as: import_react_router_dom.Link,
|
|
7096
|
+
...combinedProps,
|
|
7097
|
+
to: to ?? "",
|
|
7098
|
+
children
|
|
7099
|
+
}
|
|
7100
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime192.jsxs)(
|
|
7101
|
+
StyledLink,
|
|
7102
|
+
{
|
|
7103
|
+
as: "a",
|
|
7104
|
+
...combinedProps,
|
|
7105
|
+
href: to,
|
|
7106
|
+
children: [
|
|
7107
|
+
leftIcon ?? null,
|
|
7108
|
+
children,
|
|
7109
|
+
rightIcon ?? null
|
|
7110
|
+
]
|
|
7111
|
+
}
|
|
7112
|
+
);
|
|
7112
7113
|
}
|
|
7113
7114
|
return null;
|
|
7114
7115
|
}
|
|
@@ -7169,7 +7170,7 @@ var ButtonContent = ({
|
|
|
7169
7170
|
)
|
|
7170
7171
|
] });
|
|
7171
7172
|
};
|
|
7172
|
-
var Button = (0,
|
|
7173
|
+
var Button = (0, import_react16.forwardRef)(
|
|
7173
7174
|
({
|
|
7174
7175
|
children,
|
|
7175
7176
|
forceState,
|
|
@@ -7348,7 +7349,7 @@ var StyledLabel = import_styled_components22.default.span`
|
|
|
7348
7349
|
grid-row: 2;
|
|
7349
7350
|
text-align: left;
|
|
7350
7351
|
`;
|
|
7351
|
-
var ActionButton = (0,
|
|
7352
|
+
var ActionButton = (0, import_react17.forwardRef)(
|
|
7352
7353
|
({
|
|
7353
7354
|
icon,
|
|
7354
7355
|
colorScheme = "default",
|
|
@@ -7392,7 +7393,7 @@ var ActionButton = (0, import_react18.forwardRef)(
|
|
|
7392
7393
|
ActionButton.displayName = "ActionButton";
|
|
7393
7394
|
|
|
7394
7395
|
// src/components/Avatar/Avatar.tsx
|
|
7395
|
-
var
|
|
7396
|
+
var import_react18 = require("react");
|
|
7396
7397
|
var import_type_guards18 = require("@wistia/type-guards");
|
|
7397
7398
|
var import_styled_components25 = __toESM(require("styled-components"));
|
|
7398
7399
|
|
|
@@ -7600,8 +7601,8 @@ var Avatar = ({
|
|
|
7600
7601
|
onImageLoad,
|
|
7601
7602
|
...props
|
|
7602
7603
|
}) => {
|
|
7603
|
-
const [imageLoadState, setImageLoadState] = (0,
|
|
7604
|
-
(0,
|
|
7604
|
+
const [imageLoadState, setImageLoadState] = (0, import_react18.useState)("loading");
|
|
7605
|
+
(0, import_react18.useEffect)(() => {
|
|
7605
7606
|
setImageLoadState("loading");
|
|
7606
7607
|
}, [imageUrl]);
|
|
7607
7608
|
const handleImageLoad = () => {
|
|
@@ -7613,7 +7614,7 @@ var Avatar = ({
|
|
|
7613
7614
|
onImageLoad?.({ state: "error", type: "initials" });
|
|
7614
7615
|
};
|
|
7615
7616
|
const avatarSize = heightAndWidth ?? avatarSizeMap[size];
|
|
7616
|
-
const avatarColor = (0,
|
|
7617
|
+
const avatarColor = (0, import_react18.useMemo)(() => chooseColorScheme(name), [name]);
|
|
7617
7618
|
return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
7618
7619
|
AvatarWrapper,
|
|
7619
7620
|
{
|
|
@@ -7640,7 +7641,7 @@ var Avatar = ({
|
|
|
7640
7641
|
Avatar.displayName = "Avatar";
|
|
7641
7642
|
|
|
7642
7643
|
// src/components/Badge/Badge.tsx
|
|
7643
|
-
var
|
|
7644
|
+
var import_react19 = require("react");
|
|
7644
7645
|
var import_styled_components26 = __toESM(require("styled-components"));
|
|
7645
7646
|
var import_type_guards19 = require("@wistia/type-guards");
|
|
7646
7647
|
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
@@ -7664,7 +7665,7 @@ var StyledBadge = import_styled_components26.default.div`
|
|
|
7664
7665
|
width: 12px;
|
|
7665
7666
|
}
|
|
7666
7667
|
`;
|
|
7667
|
-
var Badge = (0,
|
|
7668
|
+
var Badge = (0, import_react19.forwardRef)(
|
|
7668
7669
|
({ colorScheme = "inherit", label, icon, ...props }, ref) => {
|
|
7669
7670
|
const hasIcon = (0, import_type_guards19.isNotNil)(icon);
|
|
7670
7671
|
return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(
|
|
@@ -7685,7 +7686,7 @@ var Badge = (0, import_react20.forwardRef)(
|
|
|
7685
7686
|
Badge.displayName = "Badge";
|
|
7686
7687
|
|
|
7687
7688
|
// src/components/Box/Box.tsx
|
|
7688
|
-
var
|
|
7689
|
+
var import_react20 = require("react");
|
|
7689
7690
|
var import_styled_components27 = __toESM(require("styled-components"));
|
|
7690
7691
|
var import_type_guards20 = require("@wistia/type-guards");
|
|
7691
7692
|
|
|
@@ -7794,13 +7795,13 @@ var StyledBoxComponent = import_styled_components27.default.div`
|
|
|
7794
7795
|
var wrapChildren = (children) => {
|
|
7795
7796
|
if ((0, import_type_guards20.isNotNil)(children)) {
|
|
7796
7797
|
if (typeof children === "object" && isDev) {
|
|
7797
|
-
return
|
|
7798
|
+
return import_react20.Children.map(children, (child) => {
|
|
7798
7799
|
if ((0, import_type_guards20.isNil)(child)) return null;
|
|
7799
7800
|
const elementParams = {};
|
|
7800
7801
|
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
7801
7802
|
elementParams.hasBoxParent = true;
|
|
7802
7803
|
}
|
|
7803
|
-
return (0,
|
|
7804
|
+
return (0, import_react20.cloneElement)(child, elementParams);
|
|
7804
7805
|
});
|
|
7805
7806
|
}
|
|
7806
7807
|
return children;
|
|
@@ -7808,7 +7809,7 @@ var wrapChildren = (children) => {
|
|
|
7808
7809
|
return null;
|
|
7809
7810
|
};
|
|
7810
7811
|
var DEFAULT_ELEMENT = "div";
|
|
7811
|
-
var BoxComponent = (0,
|
|
7812
|
+
var BoxComponent = (0, import_react20.forwardRef)(
|
|
7812
7813
|
({
|
|
7813
7814
|
alignContent = "stretch",
|
|
7814
7815
|
alignItems = "flex-start",
|
|
@@ -7885,7 +7886,7 @@ BoxComponent.displayName = "Box";
|
|
|
7885
7886
|
var Box = makePolymorphic(BoxComponent);
|
|
7886
7887
|
|
|
7887
7888
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
7888
|
-
var
|
|
7889
|
+
var import_react21 = require("react");
|
|
7889
7890
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
7890
7891
|
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
7891
7892
|
var StyledBreadcrumbs = import_styled_components28.default.nav`
|
|
@@ -7901,7 +7902,7 @@ var StyledBreadcrumbs = import_styled_components28.default.nav`
|
|
|
7901
7902
|
var BUFFER_WIDTH = 10;
|
|
7902
7903
|
var Breadcrumbs = ({ children, ...props }) => {
|
|
7903
7904
|
const { isXsAndDown } = useMq();
|
|
7904
|
-
let crumbs =
|
|
7905
|
+
let crumbs = import_react21.Children.toArray(children);
|
|
7905
7906
|
if (isXsAndDown) {
|
|
7906
7907
|
crumbs = crumbs.slice(-1);
|
|
7907
7908
|
}
|
|
@@ -8088,7 +8089,7 @@ var Card = ({
|
|
|
8088
8089
|
Card.displayName = "Card";
|
|
8089
8090
|
|
|
8090
8091
|
// src/components/Center/Center.tsx
|
|
8091
|
-
var
|
|
8092
|
+
var import_react22 = require("react");
|
|
8092
8093
|
var import_styled_components32 = __toESM(require("styled-components"));
|
|
8093
8094
|
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8094
8095
|
var StyledCenter = import_styled_components32.default.div`
|
|
@@ -8103,7 +8104,7 @@ var StyledCenter = import_styled_components32.default.div`
|
|
|
8103
8104
|
align-items: center;
|
|
8104
8105
|
`}
|
|
8105
8106
|
`;
|
|
8106
|
-
var Center = (0,
|
|
8107
|
+
var Center = (0, import_react22.forwardRef)(
|
|
8107
8108
|
({ maxWidth = "100%", gutterWidth = "space-00", intrinsic = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8108
8109
|
StyledCenter,
|
|
8109
8110
|
{
|
|
@@ -8119,7 +8120,7 @@ var Center = (0, import_react23.forwardRef)(
|
|
|
8119
8120
|
Center.displayName = "Center";
|
|
8120
8121
|
|
|
8121
8122
|
// src/components/Checkbox/Checkbox.tsx
|
|
8122
|
-
var
|
|
8123
|
+
var import_react23 = require("react");
|
|
8123
8124
|
var import_styled_components36 = __toESM(require("styled-components"));
|
|
8124
8125
|
var import_type_guards25 = require("@wistia/type-guards");
|
|
8125
8126
|
|
|
@@ -8339,7 +8340,7 @@ var StyledHiddenCheckboxInput = import_styled_components36.default.input`
|
|
|
8339
8340
|
display: block;
|
|
8340
8341
|
}
|
|
8341
8342
|
`;
|
|
8342
|
-
var Checkbox = (0,
|
|
8343
|
+
var Checkbox = (0, import_react23.forwardRef)(
|
|
8343
8344
|
({
|
|
8344
8345
|
checked,
|
|
8345
8346
|
disabled = false,
|
|
@@ -8354,7 +8355,7 @@ var Checkbox = (0, import_react24.forwardRef)(
|
|
|
8354
8355
|
hideLabel = false,
|
|
8355
8356
|
...props
|
|
8356
8357
|
}, ref) => {
|
|
8357
|
-
const generatedId = (0,
|
|
8358
|
+
const generatedId = (0, import_react23.useId)();
|
|
8358
8359
|
const computedId = (0, import_type_guards25.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
8359
8360
|
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
8360
8361
|
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
@@ -8397,9 +8398,9 @@ var Checkbox = (0, import_react24.forwardRef)(
|
|
|
8397
8398
|
Checkbox.displayName = "Checkbox";
|
|
8398
8399
|
|
|
8399
8400
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
8400
|
-
var
|
|
8401
|
+
var import_react24 = require("react");
|
|
8401
8402
|
var ClickRegion = ({ children, targetRef }) => {
|
|
8402
|
-
(0,
|
|
8403
|
+
(0, import_react24.useEffect)(() => {
|
|
8403
8404
|
if (targetRef.current && targetRef.current.tagName === "A") {
|
|
8404
8405
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
8405
8406
|
} else if (targetRef.current && targetRef.current.tagName === "BUTTON") {
|
|
@@ -8407,7 +8408,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8407
8408
|
} else {
|
|
8408
8409
|
}
|
|
8409
8410
|
}, [targetRef]);
|
|
8410
|
-
const handleClick = (0,
|
|
8411
|
+
const handleClick = (0, import_react24.useCallback)(
|
|
8411
8412
|
(event) => {
|
|
8412
8413
|
const node = targetRef.current;
|
|
8413
8414
|
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")) {
|
|
@@ -8424,7 +8425,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8424
8425
|
},
|
|
8425
8426
|
[targetRef]
|
|
8426
8427
|
);
|
|
8427
|
-
return (0,
|
|
8428
|
+
return (0, import_react24.cloneElement)(import_react24.Children.only(children), {
|
|
8428
8429
|
"data-click-region": true,
|
|
8429
8430
|
onClick: handleClick
|
|
8430
8431
|
});
|
|
@@ -8457,11 +8458,11 @@ var Collapsible = ({
|
|
|
8457
8458
|
Collapsible.displayName = "Collapsible";
|
|
8458
8459
|
|
|
8459
8460
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
8460
|
-
var
|
|
8461
|
+
var import_react25 = require("react");
|
|
8461
8462
|
var import_react_collapsible2 = require("@radix-ui/react-collapsible");
|
|
8462
8463
|
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
8463
8464
|
var CollapsibleTrigger = ({ children }) => {
|
|
8464
|
-
|
|
8465
|
+
import_react25.Children.only(children);
|
|
8465
8466
|
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
|
|
8466
8467
|
};
|
|
8467
8468
|
|
|
@@ -8488,7 +8489,7 @@ var import_styled_components40 = __toESM(require("styled-components"));
|
|
|
8488
8489
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8489
8490
|
|
|
8490
8491
|
// src/components/Heading/Heading.tsx
|
|
8491
|
-
var
|
|
8492
|
+
var import_react26 = require("react");
|
|
8492
8493
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8493
8494
|
var import_type_guards28 = require("@wistia/type-guards");
|
|
8494
8495
|
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
@@ -8584,7 +8585,7 @@ var variantElementMap = {
|
|
|
8584
8585
|
heading5: "h5",
|
|
8585
8586
|
heading6: "h6"
|
|
8586
8587
|
};
|
|
8587
|
-
var HeadingComponent = (0,
|
|
8588
|
+
var HeadingComponent = (0, import_react26.forwardRef)(
|
|
8588
8589
|
({
|
|
8589
8590
|
align = "left",
|
|
8590
8591
|
colorScheme = "inherit",
|
|
@@ -8748,7 +8749,7 @@ DataCards.displayName = "DataCards";
|
|
|
8748
8749
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8749
8750
|
|
|
8750
8751
|
// src/components/Text/Text.tsx
|
|
8751
|
-
var
|
|
8752
|
+
var import_react27 = require("react");
|
|
8752
8753
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
8753
8754
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8754
8755
|
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
@@ -8923,7 +8924,7 @@ var StyledText = import_styled_components42.default.div`
|
|
|
8923
8924
|
}
|
|
8924
8925
|
`}
|
|
8925
8926
|
`;
|
|
8926
|
-
var TextComponent = (0,
|
|
8927
|
+
var TextComponent = (0, import_react27.forwardRef)(
|
|
8927
8928
|
({
|
|
8928
8929
|
align = "left",
|
|
8929
8930
|
colorScheme = "inherit",
|
|
@@ -9036,7 +9037,7 @@ Divider.displayName = "Divider";
|
|
|
9036
9037
|
|
|
9037
9038
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9038
9039
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
9039
|
-
var
|
|
9040
|
+
var import_react29 = require("react");
|
|
9040
9041
|
|
|
9041
9042
|
// src/components/Tooltip/Tooltip.tsx
|
|
9042
9043
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
@@ -9134,7 +9135,7 @@ var Tooltip = ({
|
|
|
9134
9135
|
Tooltip.displayName = "Tooltip";
|
|
9135
9136
|
|
|
9136
9137
|
// src/components/Input/Input.tsx
|
|
9137
|
-
var
|
|
9138
|
+
var import_react28 = require("react");
|
|
9138
9139
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9139
9140
|
var import_type_guards31 = require("@wistia/type-guards");
|
|
9140
9141
|
|
|
@@ -9269,7 +9270,7 @@ var StyledInputContainer = import_styled_components47.default.div`
|
|
|
9269
9270
|
padding-right: 32px;
|
|
9270
9271
|
}
|
|
9271
9272
|
`;
|
|
9272
|
-
var Input = (0,
|
|
9273
|
+
var Input = (0, import_react28.forwardRef)(
|
|
9273
9274
|
({
|
|
9274
9275
|
fullWidth = true,
|
|
9275
9276
|
monospace = false,
|
|
@@ -9279,7 +9280,7 @@ var Input = (0, import_react29.forwardRef)(
|
|
|
9279
9280
|
rightIcon,
|
|
9280
9281
|
...props
|
|
9281
9282
|
}, externalRef) => {
|
|
9282
|
-
const internalRef = (0,
|
|
9283
|
+
const internalRef = (0, import_react28.useRef)();
|
|
9283
9284
|
const ref = (
|
|
9284
9285
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
9285
9286
|
(0, import_type_guards31.isNotNil)(externalRef) && (0, import_type_guards31.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
@@ -9289,14 +9290,14 @@ var Input = (0, import_react29.forwardRef)(
|
|
|
9289
9290
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(Icon, { type: "search" });
|
|
9290
9291
|
}
|
|
9291
9292
|
if ((0, import_type_guards31.isNotNil)(leftIconToDisplay)) {
|
|
9292
|
-
leftIconToDisplay = (0,
|
|
9293
|
+
leftIconToDisplay = (0, import_react28.cloneElement)(leftIconToDisplay, {
|
|
9293
9294
|
size: "md",
|
|
9294
9295
|
className: "wui-input-left-icon"
|
|
9295
9296
|
});
|
|
9296
9297
|
}
|
|
9297
9298
|
let rightIconToDisplay = rightIcon;
|
|
9298
9299
|
if ((0, import_type_guards31.isNotNil)(rightIconToDisplay)) {
|
|
9299
|
-
rightIconToDisplay = (0,
|
|
9300
|
+
rightIconToDisplay = (0, import_react28.cloneElement)(rightIconToDisplay, {
|
|
9300
9301
|
size: "md",
|
|
9301
9302
|
className: "wui-input-right-icon"
|
|
9302
9303
|
});
|
|
@@ -9388,11 +9389,11 @@ var EditableHeading = ({
|
|
|
9388
9389
|
__forceEditing = false,
|
|
9389
9390
|
editingDisabled = false
|
|
9390
9391
|
}) => {
|
|
9391
|
-
const [isEditing, setIsEditing] = (0,
|
|
9392
|
-
const [value, setValue] = (0,
|
|
9393
|
-
const [previousValue, setPreviousValue] = (0,
|
|
9394
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
9395
|
-
const headingRef = (0,
|
|
9392
|
+
const [isEditing, setIsEditing] = (0, import_react29.useState)(false);
|
|
9393
|
+
const [value, setValue] = (0, import_react29.useState)(children);
|
|
9394
|
+
const [previousValue, setPreviousValue] = (0, import_react29.useState)(children);
|
|
9395
|
+
const [headingHeight, setHeadingHeight] = (0, import_react29.useState)("60");
|
|
9396
|
+
const headingRef = (0, import_react29.useRef)(null);
|
|
9396
9397
|
const handleSetEditing = (editing) => {
|
|
9397
9398
|
if (editingDisabled) return;
|
|
9398
9399
|
if (editing && headingRef.current) {
|
|
@@ -9471,12 +9472,12 @@ var EditableHeading = ({
|
|
|
9471
9472
|
};
|
|
9472
9473
|
|
|
9473
9474
|
// src/components/Form/Form.tsx
|
|
9474
|
-
var
|
|
9475
|
+
var import_react31 = require("react");
|
|
9475
9476
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
9476
9477
|
var import_type_guards32 = require("@wistia/type-guards");
|
|
9477
9478
|
|
|
9478
9479
|
// src/components/Stack/Stack.tsx
|
|
9479
|
-
var
|
|
9480
|
+
var import_react30 = require("react");
|
|
9480
9481
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9481
9482
|
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9482
9483
|
var DEFAULT_ELEMENT4 = "div";
|
|
@@ -9486,7 +9487,7 @@ var StyledStack = import_styled_components49.default.div`
|
|
|
9486
9487
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9487
9488
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
9488
9489
|
`;
|
|
9489
|
-
var StackComponent = (0,
|
|
9490
|
+
var StackComponent = (0, import_react30.forwardRef)(
|
|
9490
9491
|
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9491
9492
|
const responsiveGap = useResponsiveProp(gap);
|
|
9492
9493
|
const responsiveDirection = useResponsiveProp(direction);
|
|
@@ -9515,7 +9516,7 @@ var StyledForm = import_styled_components50.default.form`
|
|
|
9515
9516
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9516
9517
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9517
9518
|
`;
|
|
9518
|
-
var FormContext = (0,
|
|
9519
|
+
var FormContext = (0, import_react31.createContext)({
|
|
9519
9520
|
values: {},
|
|
9520
9521
|
errors: {},
|
|
9521
9522
|
hasSubmitted: false,
|
|
@@ -9531,11 +9532,11 @@ var FormComponent = ({
|
|
|
9531
9532
|
fullWidth = false,
|
|
9532
9533
|
...props
|
|
9533
9534
|
}, forwardedRef) => {
|
|
9534
|
-
const [errors, setErrors] = (0,
|
|
9535
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
9536
|
-
const innerRef = (0,
|
|
9535
|
+
const [errors, setErrors] = (0, import_react31.useState)({});
|
|
9536
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react31.useState)(false);
|
|
9537
|
+
const innerRef = (0, import_react31.useRef)();
|
|
9537
9538
|
const ref = forwardedRef ?? innerRef;
|
|
9538
|
-
const autoId = (0,
|
|
9539
|
+
const autoId = (0, import_react31.useId)();
|
|
9539
9540
|
const id = props.id ?? autoId;
|
|
9540
9541
|
const handleValidate = (nextFormData) => {
|
|
9541
9542
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
@@ -9577,7 +9578,7 @@ var FormComponent = ({
|
|
|
9577
9578
|
void action(null);
|
|
9578
9579
|
}
|
|
9579
9580
|
};
|
|
9580
|
-
const context = (0,
|
|
9581
|
+
const context = (0, import_react31.useMemo)(() => {
|
|
9581
9582
|
return {
|
|
9582
9583
|
values,
|
|
9583
9584
|
errors,
|
|
@@ -9606,15 +9607,15 @@ var FormComponent = ({
|
|
|
9606
9607
|
);
|
|
9607
9608
|
};
|
|
9608
9609
|
FormComponent.displayName = "Form";
|
|
9609
|
-
var Form = (0,
|
|
9610
|
+
var Form = (0, import_react31.forwardRef)(FormComponent);
|
|
9610
9611
|
|
|
9611
9612
|
// src/components/Form/useFormState.tsx
|
|
9612
|
-
var
|
|
9613
|
+
var import_react32 = require("react");
|
|
9613
9614
|
var useFormState = (action, initialData = {}) => {
|
|
9614
|
-
const [data, setData] = (0,
|
|
9615
|
-
const [isPending, setIsPending] = (0,
|
|
9616
|
-
const [error, setError] = (0,
|
|
9617
|
-
const formAction = (0,
|
|
9615
|
+
const [data, setData] = (0, import_react32.useState)(initialData);
|
|
9616
|
+
const [isPending, setIsPending] = (0, import_react32.useState)(false);
|
|
9617
|
+
const [error, setError] = (0, import_react32.useState)(null);
|
|
9618
|
+
const formAction = (0, import_react32.useCallback)(
|
|
9618
9619
|
async (nextFormData) => {
|
|
9619
9620
|
if (nextFormData === null) {
|
|
9620
9621
|
setData(initialData);
|
|
@@ -9645,15 +9646,15 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9645
9646
|
};
|
|
9646
9647
|
|
|
9647
9648
|
// src/components/Form/FormErrorSummary.tsx
|
|
9648
|
-
var
|
|
9649
|
+
var import_react33 = require("react");
|
|
9649
9650
|
var import_type_guards33 = require("@wistia/type-guards");
|
|
9650
9651
|
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9651
9652
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9652
9653
|
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9653
9654
|
};
|
|
9654
9655
|
var FormErrorSummary = ({ description }) => {
|
|
9655
|
-
const ref = (0,
|
|
9656
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
9656
|
+
const ref = (0, import_react33.useRef)(null);
|
|
9657
|
+
const { formId, errors, hasSubmitted } = (0, import_react33.useContext)(FormContext);
|
|
9657
9658
|
const isValid = Object.keys(errors).length === 0;
|
|
9658
9659
|
if (isValid || !hasSubmitted) {
|
|
9659
9660
|
return null;
|
|
@@ -9683,7 +9684,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9683
9684
|
};
|
|
9684
9685
|
|
|
9685
9686
|
// src/components/FormField/FormField.tsx
|
|
9686
|
-
var
|
|
9687
|
+
var import_react36 = require("react");
|
|
9687
9688
|
var import_styled_components53 = __toESM(require("styled-components"));
|
|
9688
9689
|
var import_type_guards34 = require("@wistia/type-guards");
|
|
9689
9690
|
|
|
@@ -9748,11 +9749,11 @@ var Label = ({
|
|
|
9748
9749
|
Label.displayName = "Label";
|
|
9749
9750
|
|
|
9750
9751
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9751
|
-
var
|
|
9752
|
+
var import_react35 = require("react");
|
|
9752
9753
|
|
|
9753
9754
|
// src/components/FormGroup/FormGroup.tsx
|
|
9754
9755
|
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9755
|
-
var
|
|
9756
|
+
var import_react34 = require("react");
|
|
9756
9757
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9757
9758
|
var StyledFieldset = import_styled_components52.default.fieldset`
|
|
9758
9759
|
border: 0;
|
|
@@ -9761,7 +9762,7 @@ var StyledLegend = import_styled_components52.default.legend`
|
|
|
9761
9762
|
margin-bottom: var(--space-01);
|
|
9762
9763
|
`;
|
|
9763
9764
|
var FormGroup = ({ children, label, ...props }) => {
|
|
9764
|
-
const ref = (0,
|
|
9765
|
+
const ref = (0, import_react34.useRef)();
|
|
9765
9766
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
9766
9767
|
Stack,
|
|
9767
9768
|
{
|
|
@@ -9786,7 +9787,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
9786
9787
|
|
|
9787
9788
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9788
9789
|
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9789
|
-
var CheckboxGroupContext = (0,
|
|
9790
|
+
var CheckboxGroupContext = (0, import_react35.createContext)(null);
|
|
9790
9791
|
var CheckboxGroup = ({
|
|
9791
9792
|
children,
|
|
9792
9793
|
name,
|
|
@@ -9794,7 +9795,7 @@ var CheckboxGroup = ({
|
|
|
9794
9795
|
value,
|
|
9795
9796
|
...props
|
|
9796
9797
|
}) => {
|
|
9797
|
-
const context = (0,
|
|
9798
|
+
const context = (0, import_react35.useMemo)(() => {
|
|
9798
9799
|
return {
|
|
9799
9800
|
name,
|
|
9800
9801
|
onChange
|
|
@@ -9879,8 +9880,8 @@ var FormField = ({
|
|
|
9879
9880
|
value,
|
|
9880
9881
|
...props
|
|
9881
9882
|
}) => {
|
|
9882
|
-
const formState = (0,
|
|
9883
|
-
const checkboxGroup = (0,
|
|
9883
|
+
const formState = (0, import_react36.useContext)(FormContext);
|
|
9884
|
+
const checkboxGroup = (0, import_react36.useContext)(CheckboxGroupContext);
|
|
9884
9885
|
const defaultValue = formState.values[name];
|
|
9885
9886
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9886
9887
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -9918,7 +9919,7 @@ var FormField = ({
|
|
|
9918
9919
|
"aria-invalid": (0, import_type_guards34.isNotNil)(error)
|
|
9919
9920
|
};
|
|
9920
9921
|
}
|
|
9921
|
-
|
|
9922
|
+
import_react36.Children.only(children);
|
|
9922
9923
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(
|
|
9923
9924
|
StyledFormField,
|
|
9924
9925
|
{
|
|
@@ -9927,7 +9928,7 @@ var FormField = ({
|
|
|
9927
9928
|
children: [
|
|
9928
9929
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
9929
9930
|
(0, import_type_guards34.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9930
|
-
(0,
|
|
9931
|
+
(0, import_react36.cloneElement)(children, childProps),
|
|
9931
9932
|
(0, import_type_guards34.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(import_jsx_runtime227.Fragment, { children: [
|
|
9932
9933
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("div", {}),
|
|
9933
9934
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
@@ -9945,9 +9946,9 @@ var FormField = ({
|
|
|
9945
9946
|
FormField.displayName = "FormField";
|
|
9946
9947
|
|
|
9947
9948
|
// src/components/FormGroup/RadioGroup.tsx
|
|
9948
|
-
var
|
|
9949
|
+
var import_react37 = require("react");
|
|
9949
9950
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
9950
|
-
var RadioGroupContext = (0,
|
|
9951
|
+
var RadioGroupContext = (0, import_react37.createContext)(null);
|
|
9951
9952
|
var RadioGroup = ({
|
|
9952
9953
|
children,
|
|
9953
9954
|
name,
|
|
@@ -9955,7 +9956,7 @@ var RadioGroup = ({
|
|
|
9955
9956
|
value,
|
|
9956
9957
|
...props
|
|
9957
9958
|
}) => {
|
|
9958
|
-
const context = (0,
|
|
9959
|
+
const context = (0, import_react37.useMemo)(() => {
|
|
9959
9960
|
return {
|
|
9960
9961
|
name,
|
|
9961
9962
|
onChange
|
|
@@ -9966,7 +9967,7 @@ var RadioGroup = ({
|
|
|
9966
9967
|
RadioGroup.displayName = "RadioGroup";
|
|
9967
9968
|
|
|
9968
9969
|
// src/components/IconButton/IconButton.tsx
|
|
9969
|
-
var
|
|
9970
|
+
var import_react38 = require("react");
|
|
9970
9971
|
var import_styled_components54 = __toESM(require("styled-components"));
|
|
9971
9972
|
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
9972
9973
|
var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
@@ -9983,7 +9984,7 @@ var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
|
9983
9984
|
align-items: center;
|
|
9984
9985
|
line-height: 1;
|
|
9985
9986
|
`;
|
|
9986
|
-
var IconButton = (0,
|
|
9987
|
+
var IconButton = (0, import_react38.forwardRef)(
|
|
9987
9988
|
({ children, label, size = "md", ...props }, ref) => {
|
|
9988
9989
|
const responsiveSize = useResponsiveProp(size);
|
|
9989
9990
|
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
@@ -9994,7 +9995,7 @@ var IconButton = (0, import_react39.forwardRef)(
|
|
|
9994
9995
|
"aria-label": label,
|
|
9995
9996
|
"data-wistia-ui-icon-button": true,
|
|
9996
9997
|
size: responsiveSize,
|
|
9997
|
-
children: (0,
|
|
9998
|
+
children: (0, import_react38.cloneElement)(import_react38.Children.only(children), {
|
|
9998
9999
|
size: responsiveSize
|
|
9999
10000
|
})
|
|
10000
10001
|
}
|
|
@@ -10005,7 +10006,7 @@ IconButton.displayName = "IconButton";
|
|
|
10005
10006
|
|
|
10006
10007
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
10007
10008
|
var import_styled_components55 = __toESM(require("styled-components"));
|
|
10008
|
-
var
|
|
10009
|
+
var import_react39 = require("react");
|
|
10009
10010
|
var import_type_guards35 = require("@wistia/type-guards");
|
|
10010
10011
|
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
10011
10012
|
var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
@@ -10018,10 +10019,10 @@ var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
|
10018
10019
|
}
|
|
10019
10020
|
`;
|
|
10020
10021
|
var COPY_SUCCESS_DURATION = 2e3;
|
|
10021
|
-
var InputClickToCopy = (0,
|
|
10022
|
+
var InputClickToCopy = (0, import_react39.forwardRef)(
|
|
10022
10023
|
({ value, onCopy, ...props }, ref) => {
|
|
10023
|
-
const [isCopied, setIsCopied] = (0,
|
|
10024
|
-
(0,
|
|
10024
|
+
const [isCopied, setIsCopied] = (0, import_react39.useState)(false);
|
|
10025
|
+
(0, import_react39.useEffect)(() => {
|
|
10025
10026
|
if (isCopied) {
|
|
10026
10027
|
const timeout = setTimeout(() => {
|
|
10027
10028
|
setIsCopied(false);
|
|
@@ -10071,12 +10072,12 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
10071
10072
|
var import_styled_components56 = __toESM(require("styled-components"));
|
|
10072
10073
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
10073
10074
|
var import_type_guards36 = require("@wistia/type-guards");
|
|
10074
|
-
var
|
|
10075
|
+
var import_react41 = require("react");
|
|
10075
10076
|
|
|
10076
10077
|
// src/components/Menu/MenuContext.tsx
|
|
10077
|
-
var
|
|
10078
|
-
var MenuContext = (0,
|
|
10079
|
-
var useMenuContext = () => (0,
|
|
10078
|
+
var import_react40 = require("react");
|
|
10079
|
+
var MenuContext = (0, import_react40.createContext)({ compact: false });
|
|
10080
|
+
var useMenuContext = () => (0, import_react40.useContext)(MenuContext);
|
|
10080
10081
|
|
|
10081
10082
|
// src/components/Menu/Menu.tsx
|
|
10082
10083
|
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
@@ -10180,7 +10181,7 @@ var Menu = ({
|
|
|
10180
10181
|
onInteractOutside,
|
|
10181
10182
|
...props
|
|
10182
10183
|
}) => {
|
|
10183
|
-
const contextValue = (0,
|
|
10184
|
+
const contextValue = (0, import_react41.useMemo)(() => ({ compact }), [compact]);
|
|
10184
10185
|
let controlProps = {
|
|
10185
10186
|
...(0, import_type_guards36.isNotNil)(onOpenChange) && (0, import_type_guards36.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
10186
10187
|
};
|
|
@@ -10254,13 +10255,13 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
10254
10255
|
MenuLabel.displayName = "MenuLabel";
|
|
10255
10256
|
|
|
10256
10257
|
// src/components/Menu/SubMenu.tsx
|
|
10257
|
-
var
|
|
10258
|
+
var import_react43 = require("react");
|
|
10258
10259
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
10259
10260
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
10260
10261
|
var import_type_guards38 = require("@wistia/type-guards");
|
|
10261
10262
|
|
|
10262
10263
|
// src/components/Menu/MenuItemButton.tsx
|
|
10263
|
-
var
|
|
10264
|
+
var import_react42 = require("react");
|
|
10264
10265
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
10265
10266
|
var import_type_guards37 = require("@wistia/type-guards");
|
|
10266
10267
|
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
@@ -10337,7 +10338,7 @@ var StyledBadgeContainer = import_styled_components58.default.div`
|
|
|
10337
10338
|
font-size: var(--wui-typography-label-4-size);
|
|
10338
10339
|
color: var(--wui-color-text-secondary);
|
|
10339
10340
|
`;
|
|
10340
|
-
var MenuItemButton = (0,
|
|
10341
|
+
var MenuItemButton = (0, import_react42.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
10341
10342
|
let { colorScheme, badge } = props;
|
|
10342
10343
|
if (appearance === "dangerous") {
|
|
10343
10344
|
if ((0, import_type_guards37.isNotUndefined)(colorScheme)) {
|
|
@@ -10433,7 +10434,7 @@ var SubMenu = ({
|
|
|
10433
10434
|
...props
|
|
10434
10435
|
}) => {
|
|
10435
10436
|
const { isSmAndUp } = useMq();
|
|
10436
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
10437
|
+
const [isExpanded, setIsExpanded] = (0, import_react43.useState)(false);
|
|
10437
10438
|
const { compact } = useMenuContext();
|
|
10438
10439
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
10439
10440
|
/* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
@@ -10462,10 +10463,10 @@ var SubMenu = ({
|
|
|
10462
10463
|
SubMenu.displayName = "SubMenu";
|
|
10463
10464
|
|
|
10464
10465
|
// src/components/Menu/MenuItem.tsx
|
|
10465
|
-
var
|
|
10466
|
+
var import_react44 = require("react");
|
|
10466
10467
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
10467
10468
|
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
10468
|
-
var MenuItem = (0,
|
|
10469
|
+
var MenuItem = (0, import_react44.forwardRef)(
|
|
10469
10470
|
({ onSelect = () => null, ...props }, ref) => {
|
|
10470
10471
|
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
10471
10472
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
@@ -10617,7 +10618,7 @@ var CheckboxMenuItem = ({
|
|
|
10617
10618
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
10618
10619
|
|
|
10619
10620
|
// src/components/Modal/Modal.tsx
|
|
10620
|
-
var
|
|
10621
|
+
var import_react48 = require("react");
|
|
10621
10622
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
10622
10623
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
10623
10624
|
var import_type_guards41 = require("@wistia/type-guards");
|
|
@@ -10677,19 +10678,19 @@ var ModalHeader = ({
|
|
|
10677
10678
|
};
|
|
10678
10679
|
|
|
10679
10680
|
// src/components/Modal/ModalContent.tsx
|
|
10680
|
-
var
|
|
10681
|
+
var import_react46 = require("react");
|
|
10681
10682
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
10682
10683
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
10683
10684
|
|
|
10684
10685
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10685
|
-
var
|
|
10686
|
+
var import_react45 = require("react");
|
|
10686
10687
|
var import_type_guards40 = require("@wistia/type-guards");
|
|
10687
10688
|
var useFocusRestore = () => {
|
|
10688
|
-
const previouslyFocusedRef = (0,
|
|
10689
|
-
(0,
|
|
10689
|
+
const previouslyFocusedRef = (0, import_react45.useRef)(null);
|
|
10690
|
+
(0, import_react45.useEffect)(() => {
|
|
10690
10691
|
previouslyFocusedRef.current = document.activeElement;
|
|
10691
10692
|
}, []);
|
|
10692
|
-
(0,
|
|
10693
|
+
(0, import_react45.useEffect)(() => {
|
|
10693
10694
|
return () => {
|
|
10694
10695
|
if ((0, import_type_guards40.isNotNil)(previouslyFocusedRef.current)) {
|
|
10695
10696
|
setTimeout(() => {
|
|
@@ -10743,7 +10744,7 @@ var StyledModalContent = (0, import_styled_components63.default)(import_react_di
|
|
|
10743
10744
|
}
|
|
10744
10745
|
}
|
|
10745
10746
|
`;
|
|
10746
|
-
var ModalContent = (0,
|
|
10747
|
+
var ModalContent = (0, import_react46.forwardRef)(
|
|
10747
10748
|
({ fullHeight, width, children, ...props }, ref) => {
|
|
10748
10749
|
useFocusRestore();
|
|
10749
10750
|
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
@@ -10761,7 +10762,7 @@ var ModalContent = (0, import_react47.forwardRef)(
|
|
|
10761
10762
|
);
|
|
10762
10763
|
|
|
10763
10764
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
10764
|
-
var
|
|
10765
|
+
var import_react47 = require("react");
|
|
10765
10766
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
10766
10767
|
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
10767
10768
|
var backdropAnimationDuration = 150;
|
|
@@ -10799,7 +10800,7 @@ var BackdropComponent = import_styled_components64.default.div`
|
|
|
10799
10800
|
}
|
|
10800
10801
|
}
|
|
10801
10802
|
`;
|
|
10802
|
-
var Backdrop = (0,
|
|
10803
|
+
var Backdrop = (0, import_react47.forwardRef)(
|
|
10803
10804
|
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
10804
10805
|
BackdropComponent,
|
|
10805
10806
|
{
|
|
@@ -10821,7 +10822,7 @@ var ModalBody = import_styled_components65.default.div`
|
|
|
10821
10822
|
display: flex;
|
|
10822
10823
|
order: 2;
|
|
10823
10824
|
`;
|
|
10824
|
-
var Modal = (0,
|
|
10825
|
+
var Modal = (0, import_react48.forwardRef)(
|
|
10825
10826
|
({
|
|
10826
10827
|
children,
|
|
10827
10828
|
fullHeight = false,
|
|
@@ -11035,7 +11036,7 @@ var ProgressBar = ({
|
|
|
11035
11036
|
ProgressBar.displayName = "ProgressBar";
|
|
11036
11037
|
|
|
11037
11038
|
// src/components/Radio/Radio.tsx
|
|
11038
|
-
var
|
|
11039
|
+
var import_react49 = require("react");
|
|
11039
11040
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11040
11041
|
var import_type_guards44 = require("@wistia/type-guards");
|
|
11041
11042
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
@@ -11138,7 +11139,7 @@ var StyledHiddenRadioInput = import_styled_components68.default.input`
|
|
|
11138
11139
|
display: block;
|
|
11139
11140
|
}
|
|
11140
11141
|
`;
|
|
11141
|
-
var Radio = (0,
|
|
11142
|
+
var Radio = (0, import_react49.forwardRef)(
|
|
11142
11143
|
({
|
|
11143
11144
|
checked,
|
|
11144
11145
|
disabled = false,
|
|
@@ -11153,7 +11154,7 @@ var Radio = (0, import_react50.forwardRef)(
|
|
|
11153
11154
|
hideLabel = false,
|
|
11154
11155
|
...props
|
|
11155
11156
|
}, ref) => {
|
|
11156
|
-
const generatedId = (0,
|
|
11157
|
+
const generatedId = (0, import_react49.useId)();
|
|
11157
11158
|
const computedId = (0, import_type_guards44.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11158
11159
|
return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(
|
|
11159
11160
|
StyledRadioWrapper,
|
|
@@ -11203,20 +11204,20 @@ var Radio = (0, import_react50.forwardRef)(
|
|
|
11203
11204
|
Radio.displayName = "Radio";
|
|
11204
11205
|
|
|
11205
11206
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
11206
|
-
var
|
|
11207
|
+
var import_react52 = require("react");
|
|
11207
11208
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11208
11209
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
11209
11210
|
var import_type_guards45 = require("@wistia/type-guards");
|
|
11210
11211
|
|
|
11211
11212
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11212
|
-
var
|
|
11213
|
+
var import_react50 = require("react");
|
|
11213
11214
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
11214
|
-
var SelectedItemStyleContext = (0,
|
|
11215
|
+
var SelectedItemStyleContext = (0, import_react50.createContext)(null);
|
|
11215
11216
|
var SelectedItemStyleProvider = ({
|
|
11216
11217
|
children
|
|
11217
11218
|
}) => {
|
|
11218
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
11219
|
-
const selectedItemIndicatorStyle = (0,
|
|
11219
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react50.useState)(null);
|
|
11220
|
+
const selectedItemIndicatorStyle = (0, import_react50.useMemo)(
|
|
11220
11221
|
() => selectedItemMeasurements != null ? {
|
|
11221
11222
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
11222
11223
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
@@ -11226,7 +11227,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11226
11227
|
},
|
|
11227
11228
|
[selectedItemMeasurements]
|
|
11228
11229
|
);
|
|
11229
|
-
const contextValue = (0,
|
|
11230
|
+
const contextValue = (0, import_react50.useMemo)(
|
|
11230
11231
|
() => ({
|
|
11231
11232
|
setSelectedItemMeasurements,
|
|
11232
11233
|
selectedItemIndicatorStyle
|
|
@@ -11236,7 +11237,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11236
11237
|
return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
11237
11238
|
};
|
|
11238
11239
|
var useSelectedItemStyle = () => {
|
|
11239
|
-
const context = (0,
|
|
11240
|
+
const context = (0, import_react50.useContext)(SelectedItemStyleContext);
|
|
11240
11241
|
if (context === null) {
|
|
11241
11242
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
11242
11243
|
}
|
|
@@ -11247,11 +11248,11 @@ var useSelectedItemStyle = () => {
|
|
|
11247
11248
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
11248
11249
|
|
|
11249
11250
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
11250
|
-
var
|
|
11251
|
-
var SegmentedControlValueContext = (0,
|
|
11251
|
+
var import_react51 = require("react");
|
|
11252
|
+
var SegmentedControlValueContext = (0, import_react51.createContext)(null);
|
|
11252
11253
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
11253
11254
|
var useSegmentedControlValue = () => {
|
|
11254
|
-
const context = (0,
|
|
11255
|
+
const context = (0, import_react51.useContext)(SegmentedControlValueContext);
|
|
11255
11256
|
if (context === null) {
|
|
11256
11257
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
11257
11258
|
}
|
|
@@ -11297,7 +11298,7 @@ var segmentedControlStyles = import_styled_components70.css`
|
|
|
11297
11298
|
var StyledSegmentedControl = (0, import_styled_components70.default)(import_react_toggle_group.Root)`
|
|
11298
11299
|
${segmentedControlStyles}
|
|
11299
11300
|
`;
|
|
11300
|
-
var SegmentedControl = (0,
|
|
11301
|
+
var SegmentedControl = (0, import_react52.forwardRef)(
|
|
11301
11302
|
({
|
|
11302
11303
|
children,
|
|
11303
11304
|
disabled = false,
|
|
@@ -11332,7 +11333,7 @@ var SegmentedControl = (0, import_react53.forwardRef)(
|
|
|
11332
11333
|
SegmentedControl.displayName = "SegmentedControl";
|
|
11333
11334
|
|
|
11334
11335
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
11335
|
-
var
|
|
11336
|
+
var import_react53 = require("react");
|
|
11336
11337
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
11337
11338
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
11338
11339
|
var import_type_guards46 = require("@wistia/type-guards");
|
|
@@ -11400,11 +11401,11 @@ var segmentedControlItemStyles = import_styled_components71.css`
|
|
|
11400
11401
|
var StyledSegmentedControlItem = (0, import_styled_components71.default)(import_react_toggle_group2.Item)`
|
|
11401
11402
|
${segmentedControlItemStyles}
|
|
11402
11403
|
`;
|
|
11403
|
-
var SegmentedControlItem = (0,
|
|
11404
|
+
var SegmentedControlItem = (0, import_react53.forwardRef)(
|
|
11404
11405
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11405
11406
|
const selectedValue = useSegmentedControlValue();
|
|
11406
11407
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
11407
|
-
const buttonRef = (0,
|
|
11408
|
+
const buttonRef = (0, import_react53.useRef)(null);
|
|
11408
11409
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11409
11410
|
const handleClick = (event) => {
|
|
11410
11411
|
const target = event.target;
|
|
@@ -11413,7 +11414,7 @@ var SegmentedControlItem = (0, import_react54.forwardRef)(
|
|
|
11413
11414
|
event.preventDefault();
|
|
11414
11415
|
}
|
|
11415
11416
|
};
|
|
11416
|
-
(0,
|
|
11417
|
+
(0, import_react53.useEffect)(() => {
|
|
11417
11418
|
const buttonElem = buttonRef.current;
|
|
11418
11419
|
if (!buttonElem) {
|
|
11419
11420
|
return void 0;
|
|
@@ -11459,7 +11460,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
11459
11460
|
|
|
11460
11461
|
// src/components/Select/Select.tsx
|
|
11461
11462
|
var import_react_select = require("@radix-ui/react-select");
|
|
11462
|
-
var
|
|
11463
|
+
var import_react54 = require("react");
|
|
11463
11464
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11464
11465
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11465
11466
|
var StyledTrigger = (0, import_styled_components72.default)(import_react_select.Trigger)`
|
|
@@ -11524,7 +11525,7 @@ var StyledContent3 = (0, import_styled_components72.default)(import_react_select
|
|
|
11524
11525
|
max-height: var(--radix-select-content-available-height);
|
|
11525
11526
|
z-index: var(--wui-zindex-select);
|
|
11526
11527
|
`;
|
|
11527
|
-
var Select = (0,
|
|
11528
|
+
var Select = (0, import_react54.forwardRef)(
|
|
11528
11529
|
({
|
|
11529
11530
|
colorScheme = "inherit",
|
|
11530
11531
|
children,
|
|
@@ -11573,7 +11574,7 @@ Select.displayName = "Select";
|
|
|
11573
11574
|
|
|
11574
11575
|
// src/components/Select/SelectOption.tsx
|
|
11575
11576
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11576
|
-
var
|
|
11577
|
+
var import_react55 = require("react");
|
|
11577
11578
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11578
11579
|
var import_type_guards47 = require("@wistia/type-guards");
|
|
11579
11580
|
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
@@ -11604,7 +11605,7 @@ var StyledItem = (0, import_styled_components73.default)(import_react_select2.It
|
|
|
11604
11605
|
var StyledIconContainer = import_styled_components73.default.span`
|
|
11605
11606
|
width: 12px;
|
|
11606
11607
|
`;
|
|
11607
|
-
var SelectOption = (0,
|
|
11608
|
+
var SelectOption = (0, import_react55.forwardRef)(
|
|
11608
11609
|
({ children, selectedDisplayValue, ...props }, forwardedRef) => {
|
|
11609
11610
|
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(
|
|
11610
11611
|
StyledItem,
|
|
@@ -11652,7 +11653,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11652
11653
|
};
|
|
11653
11654
|
|
|
11654
11655
|
// src/components/Switch/Switch.tsx
|
|
11655
|
-
var
|
|
11656
|
+
var import_react56 = require("react");
|
|
11656
11657
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11657
11658
|
var import_type_guards48 = require("@wistia/type-guards");
|
|
11658
11659
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
@@ -11757,7 +11758,7 @@ var StyledHiddenSwitchInput = import_styled_components75.default.input`
|
|
|
11757
11758
|
}
|
|
11758
11759
|
}
|
|
11759
11760
|
`;
|
|
11760
|
-
var Switch = (0,
|
|
11761
|
+
var Switch = (0, import_react56.forwardRef)(
|
|
11761
11762
|
({
|
|
11762
11763
|
checked,
|
|
11763
11764
|
disabled = false,
|
|
@@ -11772,7 +11773,7 @@ var Switch = (0, import_react57.forwardRef)(
|
|
|
11772
11773
|
hideLabel = false,
|
|
11773
11774
|
...props
|
|
11774
11775
|
}, ref) => {
|
|
11775
|
-
const generatedId = (0,
|
|
11776
|
+
const generatedId = (0, import_react56.useId)();
|
|
11776
11777
|
const computedId = (0, import_type_guards48.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11777
11778
|
return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
11778
11779
|
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
@@ -11854,8 +11855,8 @@ var Table = ({
|
|
|
11854
11855
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
11855
11856
|
|
|
11856
11857
|
// src/components/Table/TableSectionContext.ts
|
|
11857
|
-
var
|
|
11858
|
-
var TableSectionContext = (0,
|
|
11858
|
+
var import_react57 = require("react");
|
|
11859
|
+
var TableSectionContext = (0, import_react57.createContext)(null);
|
|
11859
11860
|
|
|
11860
11861
|
// src/components/Table/TableBody.tsx
|
|
11861
11862
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
@@ -11865,7 +11866,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
11865
11866
|
};
|
|
11866
11867
|
|
|
11867
11868
|
// src/components/Table/TableCell.tsx
|
|
11868
|
-
var
|
|
11869
|
+
var import_react58 = require("react");
|
|
11869
11870
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
11870
11871
|
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
11871
11872
|
var sharedStyles = import_styled_components78.css`
|
|
@@ -11886,7 +11887,7 @@ var StyledTd = import_styled_components78.default.td`
|
|
|
11886
11887
|
line-height: var(--wui-typography-body-2-line-height);
|
|
11887
11888
|
`;
|
|
11888
11889
|
var TableCell = ({ children, ...props }) => {
|
|
11889
|
-
const section = (0,
|
|
11890
|
+
const section = (0, import_react58.useContext)(TableSectionContext);
|
|
11890
11891
|
if (section === "head") {
|
|
11891
11892
|
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(StyledTh, { ...props, children });
|
|
11892
11893
|
}
|
|
@@ -11918,7 +11919,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
11918
11919
|
};
|
|
11919
11920
|
|
|
11920
11921
|
// src/components/Tabs/Tabs.tsx
|
|
11921
|
-
var
|
|
11922
|
+
var import_react62 = require("react");
|
|
11922
11923
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
11923
11924
|
var import_type_guards50 = require("@wistia/type-guards");
|
|
11924
11925
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
@@ -11973,17 +11974,17 @@ var TabList = ({
|
|
|
11973
11974
|
TabList.displayName = "TabList";
|
|
11974
11975
|
|
|
11975
11976
|
// src/components/Tabs/TabItem.tsx
|
|
11976
|
-
var
|
|
11977
|
+
var import_react60 = require("react");
|
|
11977
11978
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
11978
11979
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
11979
11980
|
var import_type_guards49 = require("@wistia/type-guards");
|
|
11980
11981
|
|
|
11981
11982
|
// src/components/Tabs/useTabsValue.tsx
|
|
11982
|
-
var
|
|
11983
|
-
var TabsValueContext = (0,
|
|
11983
|
+
var import_react59 = require("react");
|
|
11984
|
+
var TabsValueContext = (0, import_react59.createContext)(null);
|
|
11984
11985
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
11985
11986
|
var useTabsValue = () => {
|
|
11986
|
-
const context = (0,
|
|
11987
|
+
const context = (0, import_react59.useContext)(TabsValueContext);
|
|
11987
11988
|
if (context === null) {
|
|
11988
11989
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
11989
11990
|
}
|
|
@@ -11999,13 +12000,13 @@ var StyledTabItem = (0, import_styled_components84.default)(import_react_tabs3.T
|
|
|
11999
12000
|
outline: none;
|
|
12000
12001
|
}
|
|
12001
12002
|
`;
|
|
12002
|
-
var TabItem = (0,
|
|
12003
|
+
var TabItem = (0, import_react60.forwardRef)(
|
|
12003
12004
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
12004
12005
|
const selectedValue = useTabsValue();
|
|
12005
12006
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
12006
|
-
const buttonRef = (0,
|
|
12007
|
+
const buttonRef = (0, import_react60.useRef)(null);
|
|
12007
12008
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
12008
|
-
(0,
|
|
12009
|
+
(0, import_react60.useEffect)(() => {
|
|
12009
12010
|
const buttonElem = buttonRef.current;
|
|
12010
12011
|
if (!buttonElem) {
|
|
12011
12012
|
return void 0;
|
|
@@ -12049,16 +12050,16 @@ var TabItem = (0, import_react61.forwardRef)(
|
|
|
12049
12050
|
TabItem.displayName = "TabItem";
|
|
12050
12051
|
|
|
12051
12052
|
// src/components/Tabs/extractTabItems.ts
|
|
12052
|
-
var
|
|
12053
|
+
var import_react61 = require("react");
|
|
12053
12054
|
var extractTabItems = (children) => {
|
|
12054
12055
|
const tabItems = [];
|
|
12055
|
-
|
|
12056
|
-
if (!(0,
|
|
12056
|
+
import_react61.Children.forEach(children, (child) => {
|
|
12057
|
+
if (!(0, import_react61.isValidElement)(child)) {
|
|
12057
12058
|
return;
|
|
12058
12059
|
}
|
|
12059
12060
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
12060
12061
|
tabItems.push(child);
|
|
12061
|
-
} else if (child.type ===
|
|
12062
|
+
} else if (child.type === import_react61.Fragment) {
|
|
12062
12063
|
const fragmentElement = child;
|
|
12063
12064
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
12064
12065
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -12105,7 +12106,7 @@ var StyledTabsRoot = (0, import_styled_components86.default)(import_react_tabs4.
|
|
|
12105
12106
|
flex-direction: column;
|
|
12106
12107
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
12107
12108
|
`;
|
|
12108
|
-
var Tabs = (0,
|
|
12109
|
+
var Tabs = (0, import_react62.forwardRef)(
|
|
12109
12110
|
({
|
|
12110
12111
|
children,
|
|
12111
12112
|
fullWidth = true,
|
|
@@ -12117,7 +12118,7 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12117
12118
|
...props
|
|
12118
12119
|
}, ref) => {
|
|
12119
12120
|
const tabItems = extractTabItems(children);
|
|
12120
|
-
const [internalSelectedValue, setInternalSelectedValue] = (0,
|
|
12121
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react62.useState)(defaultSelectedValue);
|
|
12121
12122
|
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
12122
12123
|
defaultValue: defaultSelectedValue,
|
|
12123
12124
|
onValueChange: setInternalSelectedValue
|
|
@@ -12203,15 +12204,15 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12203
12204
|
Tabs.displayName = "Tabs";
|
|
12204
12205
|
|
|
12205
12206
|
// src/components/Tabs/Tab.tsx
|
|
12206
|
-
var
|
|
12207
|
+
var import_react63 = require("react");
|
|
12207
12208
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
12208
|
-
var Tab = (0,
|
|
12209
|
+
var Tab = (0, import_react63.forwardRef)(({ children }, ref) => {
|
|
12209
12210
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("div", { ref, children });
|
|
12210
12211
|
});
|
|
12211
12212
|
Tab.displayName = "Tab";
|
|
12212
12213
|
|
|
12213
12214
|
// src/components/Tag/Tag.tsx
|
|
12214
|
-
var
|
|
12215
|
+
var import_react64 = require("react");
|
|
12215
12216
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
12216
12217
|
var import_type_guards51 = require("@wistia/type-guards");
|
|
12217
12218
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
@@ -12328,7 +12329,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12328
12329
|
)
|
|
12329
12330
|
] });
|
|
12330
12331
|
};
|
|
12331
|
-
var Tag = (0,
|
|
12332
|
+
var Tag = (0, import_react64.forwardRef)(
|
|
12332
12333
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12333
12334
|
const hasIcon = (0, import_type_guards51.isNotNil)(icon);
|
|
12334
12335
|
const labelProps = (0, import_type_guards51.isNotNil)(href) && (0, import_type_guards51.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
@@ -12402,7 +12403,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
|
12402
12403
|
ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
12403
12404
|
|
|
12404
12405
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12405
|
-
var
|
|
12406
|
+
var import_react65 = require("react");
|
|
12406
12407
|
var import_styled_components90 = __toESM(require("styled-components"));
|
|
12407
12408
|
var import_type_guards54 = require("@wistia/type-guards");
|
|
12408
12409
|
|
|
@@ -12589,7 +12590,7 @@ var StyledThumbnail = import_styled_components90.default.div`
|
|
|
12589
12590
|
border-radius: calc(8% * (9 / 16)) / 8%;
|
|
12590
12591
|
}
|
|
12591
12592
|
`;
|
|
12592
|
-
var Thumbnail = (0,
|
|
12593
|
+
var Thumbnail = (0, import_react65.forwardRef)(
|
|
12593
12594
|
({
|
|
12594
12595
|
gradientBackground = "defaultMidOne",
|
|
12595
12596
|
thumbnailImageType = "square",
|
|
@@ -12625,7 +12626,7 @@ var Thumbnail = (0, import_react66.forwardRef)(
|
|
|
12625
12626
|
Thumbnail.displayName = "Thumbnail";
|
|
12626
12627
|
|
|
12627
12628
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
12628
|
-
var
|
|
12629
|
+
var import_react66 = __toESM(require("react"));
|
|
12629
12630
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
12630
12631
|
var import_type_guards55 = require("@wistia/type-guards");
|
|
12631
12632
|
var import_jsx_runtime271 = (
|
|
@@ -12705,10 +12706,10 @@ var ThumbnailCollage = ({
|
|
|
12705
12706
|
gradientBackground = "defaultMidOne",
|
|
12706
12707
|
...props
|
|
12707
12708
|
}) => {
|
|
12708
|
-
const thumbnailArray =
|
|
12709
|
+
const thumbnailArray = import_react66.default.Children.toArray(children);
|
|
12709
12710
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
12710
12711
|
const thumbnails = (0, import_type_guards55.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
12711
|
-
return
|
|
12712
|
+
return import_react66.default.cloneElement(child, {
|
|
12712
12713
|
...child.props,
|
|
12713
12714
|
children: void 0
|
|
12714
12715
|
});
|