@wistia/ui 0.8.13-beta.c5b7cc46.087dbaa → 0.8.14
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 +544 -497
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +24 -16
- package/dist/index.d.ts +24 -16
- package/dist/index.mjs +379 -333
- 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.14
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -105,7 +105,7 @@ __export(index_exports, {
|
|
|
105
105
|
Table: () => Table,
|
|
106
106
|
TableBody: () => TableBody,
|
|
107
107
|
TableCell: () => TableCell,
|
|
108
|
-
|
|
108
|
+
TableFoot: () => TableFoot,
|
|
109
109
|
TableHead: () => TableHead,
|
|
110
110
|
TableRow: () => TableRow,
|
|
111
111
|
Tabs: () => Tabs,
|
|
@@ -126,6 +126,7 @@ __export(index_exports, {
|
|
|
126
126
|
useActiveMq: () => useActiveMq,
|
|
127
127
|
useAriaLive: () => useAriaLive,
|
|
128
128
|
useBoolean: () => useBoolean,
|
|
129
|
+
useClipboard: () => useClipboard,
|
|
129
130
|
useFilePicker: () => import_use_file_picker.useFilePicker,
|
|
130
131
|
useFocusTrap: () => useFocusTrap,
|
|
131
132
|
useFormState: () => useFormState,
|
|
@@ -2100,20 +2101,287 @@ var useBoolean = (initialValue = false) => {
|
|
|
2100
2101
|
return [value, toggle, setTrue, setFalse, setValue];
|
|
2101
2102
|
};
|
|
2102
2103
|
|
|
2104
|
+
// src/hooks/useClipboard/useClipboard.ts
|
|
2105
|
+
var import_react7 = require("react");
|
|
2106
|
+
|
|
2107
|
+
// src/private/hooks/useTimedToggle/useTimedToggle.ts
|
|
2108
|
+
var import_react6 = require("react");
|
|
2109
|
+
var useTimedToggle = (initialValue) => {
|
|
2110
|
+
const [value, setValue] = (0, import_react6.useState)(false);
|
|
2111
|
+
const timeoutRef = (0, import_react6.useRef)();
|
|
2112
|
+
const initialValueRef = (0, import_react6.useRef)(initialValue);
|
|
2113
|
+
const toggleValue = (timeout) => {
|
|
2114
|
+
clearTimeout(timeoutRef.current);
|
|
2115
|
+
setValue(!initialValueRef.current);
|
|
2116
|
+
timeoutRef.current = window.setTimeout(() => setValue(initialValueRef.current), timeout);
|
|
2117
|
+
};
|
|
2118
|
+
(0, import_react6.useEffect)(() => () => clearTimeout(timeoutRef.current), []);
|
|
2119
|
+
return [value, toggleValue];
|
|
2120
|
+
};
|
|
2121
|
+
|
|
2122
|
+
// src/hooks/useClipboard/useClipboard.ts
|
|
2123
|
+
var useClipboard = (textToCopy, timeout = 1500) => {
|
|
2124
|
+
const [hasCopied, toggleHasCopied] = useTimedToggle(false);
|
|
2125
|
+
const [failedToCopy, toggleFailedToCopy] = useTimedToggle(false);
|
|
2126
|
+
const onCopy = (0, import_react7.useCallback)(async () => {
|
|
2127
|
+
try {
|
|
2128
|
+
await copyToClipboard(textToCopy);
|
|
2129
|
+
if (timeout && timeout > 0) {
|
|
2130
|
+
toggleHasCopied(timeout);
|
|
2131
|
+
}
|
|
2132
|
+
} catch (error) {
|
|
2133
|
+
if (error instanceof Error) {
|
|
2134
|
+
toggleFailedToCopy(timeout);
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
}, [textToCopy, timeout, toggleHasCopied, toggleFailedToCopy]);
|
|
2138
|
+
return [onCopy, hasCopied, failedToCopy];
|
|
2139
|
+
};
|
|
2140
|
+
|
|
2103
2141
|
// src/hooks/useFilePicker/index.ts
|
|
2104
2142
|
var import_use_file_picker = require("use-file-picker");
|
|
2105
2143
|
var import_validators = require("use-file-picker/validators");
|
|
2106
2144
|
|
|
2145
|
+
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2146
|
+
var import_react8 = require("react");
|
|
2147
|
+
var import_type_guards7 = require("@wistia/type-guards");
|
|
2148
|
+
|
|
2149
|
+
// src/hooks/useFocusTrap/helpers.ts
|
|
2150
|
+
var FOCUSABLE_ELEMENT_SELECTORS = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [tabindex="0"], [contenteditable]';
|
|
2151
|
+
var coerceToString = (value) => value === null || value === void 0 ? "" : String(value);
|
|
2152
|
+
var isHiddenElement = (element) => {
|
|
2153
|
+
const { display, visibility } = window.getComputedStyle(element);
|
|
2154
|
+
const isHidden = display === "none" || element.style.display === "none" || visibility === "none" || element.style.visibility === "hidden";
|
|
2155
|
+
return element.offsetWidth <= 0 && element.offsetHeight <= 0 || isHidden;
|
|
2156
|
+
};
|
|
2157
|
+
var isVisibleElement = (element) => {
|
|
2158
|
+
let parentElement = element;
|
|
2159
|
+
while (parentElement) {
|
|
2160
|
+
if (parentElement === document.body) {
|
|
2161
|
+
break;
|
|
2162
|
+
}
|
|
2163
|
+
if (isHiddenElement(parentElement)) {
|
|
2164
|
+
return false;
|
|
2165
|
+
}
|
|
2166
|
+
parentElement = parentElement.parentNode;
|
|
2167
|
+
}
|
|
2168
|
+
return true;
|
|
2169
|
+
};
|
|
2170
|
+
var getElementTabIndex = (element) => {
|
|
2171
|
+
const tabIndex = element.getAttribute("tabindex");
|
|
2172
|
+
return Number.parseInt(tabIndex ?? void 0, 10);
|
|
2173
|
+
};
|
|
2174
|
+
var isTabIndexNaN = (element) => {
|
|
2175
|
+
const tabIndex = getElementTabIndex(element);
|
|
2176
|
+
return Number.isNaN(tabIndex);
|
|
2177
|
+
};
|
|
2178
|
+
var isFocusableElement = (element) => {
|
|
2179
|
+
const tabbableNodeRegEx = /input|select|textarea|button|object/;
|
|
2180
|
+
const nodeName = element.nodeName.toLowerCase();
|
|
2181
|
+
const isTabIndexNotNaN = !isTabIndexNaN(element);
|
|
2182
|
+
const isFocusable = (
|
|
2183
|
+
// @ts-expect-error - Disabled is specific to buttons and inputs, but we could be dealing with any number of types here. Disabled would be undefined for those, so ignoring.
|
|
2184
|
+
tabbableNodeRegEx.test(nodeName) && !element.disabled || (element instanceof HTMLAnchorElement ? element.href || isTabIndexNotNaN : isTabIndexNotNaN)
|
|
2185
|
+
);
|
|
2186
|
+
return Boolean(isFocusable) && isVisibleElement(element);
|
|
2187
|
+
};
|
|
2188
|
+
var isTabbableElement = (element) => {
|
|
2189
|
+
const tabIndex = getElementTabIndex(element);
|
|
2190
|
+
return (isTabIndexNaN(element) || tabIndex >= 0) && isFocusableElement(element);
|
|
2191
|
+
};
|
|
2192
|
+
var findTabbableDescendants = (element) => Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter(
|
|
2193
|
+
isTabbableElement
|
|
2194
|
+
);
|
|
2195
|
+
var focusLaterElements = [];
|
|
2196
|
+
var focusElement = null;
|
|
2197
|
+
var needToFocus = false;
|
|
2198
|
+
var handleBlur = () => {
|
|
2199
|
+
needToFocus = true;
|
|
2200
|
+
};
|
|
2201
|
+
var handleFocus = () => {
|
|
2202
|
+
if (needToFocus) {
|
|
2203
|
+
needToFocus = false;
|
|
2204
|
+
if (!focusElement) {
|
|
2205
|
+
return;
|
|
2206
|
+
}
|
|
2207
|
+
if (focusElement.contains(document.activeElement)) {
|
|
2208
|
+
return;
|
|
2209
|
+
}
|
|
2210
|
+
const element = findTabbableDescendants(focusElement)[0] ?? focusElement;
|
|
2211
|
+
element.focus();
|
|
2212
|
+
}
|
|
2213
|
+
};
|
|
2214
|
+
var markForFocusLater = () => {
|
|
2215
|
+
const element = document.activeElement;
|
|
2216
|
+
if (element !== null) {
|
|
2217
|
+
focusLaterElements.push(element);
|
|
2218
|
+
}
|
|
2219
|
+
};
|
|
2220
|
+
var returnFocus = () => {
|
|
2221
|
+
let toFocus = null;
|
|
2222
|
+
try {
|
|
2223
|
+
toFocus = focusLaterElements.pop();
|
|
2224
|
+
if (toFocus) {
|
|
2225
|
+
toFocus.focus();
|
|
2226
|
+
}
|
|
2227
|
+
} catch {
|
|
2228
|
+
console.warn(
|
|
2229
|
+
`You tried to return focus to ${coerceToString(toFocus)} but it is not in the DOM anymore`
|
|
2230
|
+
);
|
|
2231
|
+
}
|
|
2232
|
+
};
|
|
2233
|
+
var setupScopedFocus = (element) => {
|
|
2234
|
+
focusElement = element;
|
|
2235
|
+
document.addEventListener("focusout", handleBlur, false);
|
|
2236
|
+
document.addEventListener("focusin", handleFocus, true);
|
|
2237
|
+
};
|
|
2238
|
+
var teardownScopedFocus = () => {
|
|
2239
|
+
focusElement = null;
|
|
2240
|
+
document.removeEventListener("focusout", handleBlur);
|
|
2241
|
+
document.removeEventListener("focusin", handleFocus);
|
|
2242
|
+
};
|
|
2243
|
+
var scopeTab = (node, event) => {
|
|
2244
|
+
const tabbable = findTabbableDescendants(node);
|
|
2245
|
+
if (!tabbable.length) {
|
|
2246
|
+
event.preventDefault();
|
|
2247
|
+
return;
|
|
2248
|
+
}
|
|
2249
|
+
const finalTabbable = tabbable[event.shiftKey ? 0 : tabbable.length - 1];
|
|
2250
|
+
const leavingFinalTabbable = finalTabbable === document.activeElement || node === document.activeElement;
|
|
2251
|
+
if (!leavingFinalTabbable) {
|
|
2252
|
+
return;
|
|
2253
|
+
}
|
|
2254
|
+
event.preventDefault();
|
|
2255
|
+
const target = tabbable[event.shiftKey ? tabbable.length - 1 : 0];
|
|
2256
|
+
if (target) {
|
|
2257
|
+
target.focus();
|
|
2258
|
+
}
|
|
2259
|
+
};
|
|
2260
|
+
var createAriaHider = (containerNode, selector) => {
|
|
2261
|
+
selector ??= "body > :not(script)";
|
|
2262
|
+
const rootNodes = Array.from(document.querySelectorAll(selector)).map((node) => {
|
|
2263
|
+
if (node.contains(containerNode)) {
|
|
2264
|
+
return void 0;
|
|
2265
|
+
}
|
|
2266
|
+
const ariaHidden = node.getAttribute("aria-hidden");
|
|
2267
|
+
if (ariaHidden === null || ariaHidden === "false") {
|
|
2268
|
+
node.setAttribute("aria-hidden", "true");
|
|
2269
|
+
}
|
|
2270
|
+
return {
|
|
2271
|
+
node,
|
|
2272
|
+
ariaHidden
|
|
2273
|
+
};
|
|
2274
|
+
});
|
|
2275
|
+
return () => {
|
|
2276
|
+
rootNodes.forEach((item) => {
|
|
2277
|
+
if (!item) {
|
|
2278
|
+
return;
|
|
2279
|
+
}
|
|
2280
|
+
if (item.ariaHidden === null) {
|
|
2281
|
+
item.node.removeAttribute("aria-hidden");
|
|
2282
|
+
} else {
|
|
2283
|
+
item.node.setAttribute("aria-hidden", item.ariaHidden);
|
|
2284
|
+
}
|
|
2285
|
+
});
|
|
2286
|
+
};
|
|
2287
|
+
};
|
|
2288
|
+
|
|
2289
|
+
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2290
|
+
var isRef = (val) => {
|
|
2291
|
+
return val !== null && typeof val === "object" && "current" in val;
|
|
2292
|
+
};
|
|
2293
|
+
var useFocusTrap = (active = true, options = {}) => {
|
|
2294
|
+
const ref = (0, import_react8.useRef)(null);
|
|
2295
|
+
const restoreAriaRef = (0, import_react8.useRef)(null);
|
|
2296
|
+
const setRef = (0, import_react8.useCallback)(
|
|
2297
|
+
(node) => {
|
|
2298
|
+
if (restoreAriaRef.current !== null) {
|
|
2299
|
+
restoreAriaRef.current();
|
|
2300
|
+
}
|
|
2301
|
+
if (ref.current) {
|
|
2302
|
+
returnFocus();
|
|
2303
|
+
teardownScopedFocus();
|
|
2304
|
+
}
|
|
2305
|
+
if (active && node !== null && node !== void 0) {
|
|
2306
|
+
setupScopedFocus(node);
|
|
2307
|
+
markForFocusLater();
|
|
2308
|
+
const processNode = (node2) => {
|
|
2309
|
+
restoreAriaRef.current = !(options.disableAriaHider ?? false) ? createAriaHider(node2) : null;
|
|
2310
|
+
let focusElement2 = null;
|
|
2311
|
+
if ((0, import_type_guards7.isNotUndefined)(options.focusSelector)) {
|
|
2312
|
+
if (isRef(options.focusSelector)) {
|
|
2313
|
+
focusElement2 = options.focusSelector.current;
|
|
2314
|
+
} else {
|
|
2315
|
+
focusElement2 = typeof options.focusSelector === "string" ? node2.querySelector(options.focusSelector) : options.focusSelector;
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
if (!focusElement2) {
|
|
2319
|
+
const children = Array.from(
|
|
2320
|
+
node2.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)
|
|
2321
|
+
);
|
|
2322
|
+
focusElement2 = // Prefer tabbable elements, But fallback to any focusable element
|
|
2323
|
+
children.find(isTabbableElement) ?? // But fallback to any focusable element
|
|
2324
|
+
children.find(isFocusableElement) ?? // Nothing found
|
|
2325
|
+
null;
|
|
2326
|
+
if (!focusElement2 && isFocusableElement(node2)) {
|
|
2327
|
+
focusElement2 = node2;
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
if (focusElement2) {
|
|
2331
|
+
focusElement2.focus();
|
|
2332
|
+
}
|
|
2333
|
+
if (!focusElement2 && process.env["NODE_ENV"] === "development") {
|
|
2334
|
+
console.warn(
|
|
2335
|
+
'[useFocusTrap]: Failed to find a focusable element after activating the focus trap. Make sure to include at an element that can recieve focus. As a fallback, you can also set "tabIndex={-1}" on the focus trap node.',
|
|
2336
|
+
node2
|
|
2337
|
+
);
|
|
2338
|
+
}
|
|
2339
|
+
};
|
|
2340
|
+
setTimeout(() => {
|
|
2341
|
+
if (node.ownerDocument) {
|
|
2342
|
+
processNode(node);
|
|
2343
|
+
}
|
|
2344
|
+
if (!node.ownerDocument && process.env["NODE_ENV"] === "development") {
|
|
2345
|
+
console.warn(
|
|
2346
|
+
"[useFocusTrap]: The focus trap is not part of the DOM yet, so it is unable to correctly set focus. Make sure to render the ref node.",
|
|
2347
|
+
node
|
|
2348
|
+
);
|
|
2349
|
+
}
|
|
2350
|
+
});
|
|
2351
|
+
ref.current = node;
|
|
2352
|
+
} else {
|
|
2353
|
+
ref.current = null;
|
|
2354
|
+
}
|
|
2355
|
+
},
|
|
2356
|
+
[active, options.focusSelector, options.disableAriaHider]
|
|
2357
|
+
);
|
|
2358
|
+
(0, import_react8.useEffect)(() => {
|
|
2359
|
+
if (!active) {
|
|
2360
|
+
return void 0;
|
|
2361
|
+
}
|
|
2362
|
+
const handleKeyDown = (event) => {
|
|
2363
|
+
if (event.key === "Tab" && ref.current) {
|
|
2364
|
+
scopeTab(ref.current, event);
|
|
2365
|
+
}
|
|
2366
|
+
};
|
|
2367
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
2368
|
+
return () => {
|
|
2369
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
2370
|
+
};
|
|
2371
|
+
}, [active]);
|
|
2372
|
+
return setRef;
|
|
2373
|
+
};
|
|
2374
|
+
|
|
2107
2375
|
// src/hooks/useKey/useKey.ts
|
|
2108
|
-
var
|
|
2376
|
+
var import_react10 = require("react");
|
|
2109
2377
|
|
|
2110
2378
|
// src/private/hooks/useEvent/useEvent.ts
|
|
2111
|
-
var
|
|
2379
|
+
var import_react9 = require("react");
|
|
2112
2380
|
|
|
2113
2381
|
// src/private/helpers/isValidRef/isValidRef.ts
|
|
2114
|
-
var
|
|
2382
|
+
var import_type_guards8 = require("@wistia/type-guards");
|
|
2115
2383
|
var isValidRef = (value) => {
|
|
2116
|
-
return (0,
|
|
2384
|
+
return (0, import_type_guards8.isNotNil)(value) && (0, import_type_guards8.isRecord)(value) && "current" in value;
|
|
2117
2385
|
};
|
|
2118
2386
|
|
|
2119
2387
|
// src/private/helpers/noOpFn/noOpFn.ts
|
|
@@ -2127,15 +2395,15 @@ var isEventTargetSupported = (eventTarget) => (
|
|
|
2127
2395
|
!!(typeof eventTarget === "object" && eventTarget?.addEventListener)
|
|
2128
2396
|
);
|
|
2129
2397
|
var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}) => {
|
|
2130
|
-
const savedEventHandler = (0,
|
|
2131
|
-
const savedEventOptions = (0,
|
|
2132
|
-
(0,
|
|
2398
|
+
const savedEventHandler = (0, import_react9.useRef)();
|
|
2399
|
+
const savedEventOptions = (0, import_react9.useRef)();
|
|
2400
|
+
(0, import_react9.useEffect)(() => {
|
|
2133
2401
|
savedEventHandler.current = eventHandler;
|
|
2134
2402
|
}, [eventHandler]);
|
|
2135
|
-
(0,
|
|
2403
|
+
(0, import_react9.useEffect)(() => {
|
|
2136
2404
|
savedEventOptions.current = eventOptions;
|
|
2137
2405
|
}, [eventOptions]);
|
|
2138
|
-
(0,
|
|
2406
|
+
(0, import_react9.useEffect)(() => {
|
|
2139
2407
|
const target = isValidRef(eventTarget) ? eventTarget.current : eventTarget;
|
|
2140
2408
|
if (!eventName || !isEventTargetSupported(target)) {
|
|
2141
2409
|
return;
|
|
@@ -2155,7 +2423,7 @@ var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}
|
|
|
2155
2423
|
|
|
2156
2424
|
// src/hooks/useKey/useKey.ts
|
|
2157
2425
|
var useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOptions } = {}) => {
|
|
2158
|
-
const memoizedEventHandler = (0,
|
|
2426
|
+
const memoizedEventHandler = (0, import_react10.useCallback)(
|
|
2159
2427
|
(handlerEvent) => {
|
|
2160
2428
|
if (["INPUT", "TEXTAREA", "SELECT"].includes(document.activeElement?.nodeName ?? "") || document.activeElement?.isContentEditable) {
|
|
2161
2429
|
return;
|
|
@@ -2180,9 +2448,9 @@ var useKey = (key, eventHandler, { eventName = "keydown", eventTarget, eventOpti
|
|
|
2180
2448
|
};
|
|
2181
2449
|
|
|
2182
2450
|
// src/hooks/useLocalStorage/useLocalStorage.ts
|
|
2183
|
-
var
|
|
2451
|
+
var import_react11 = require("react");
|
|
2184
2452
|
var useLocalStorage = (key, initialValue, storage = window.localStorage) => {
|
|
2185
|
-
const [storedValue, setStoredValue] = (0,
|
|
2453
|
+
const [storedValue, setStoredValue] = (0, import_react11.useState)(() => {
|
|
2186
2454
|
try {
|
|
2187
2455
|
const item = storage.getItem(key);
|
|
2188
2456
|
return item !== null && !!item ? JSON.parse(item) : initialValue;
|
|
@@ -2208,9 +2476,9 @@ var useLocalStorage = (key, initialValue, storage = window.localStorage) => {
|
|
|
2208
2476
|
};
|
|
2209
2477
|
|
|
2210
2478
|
// src/hooks/useLockBodyScroll/useLockBodyScroll.ts
|
|
2211
|
-
var
|
|
2479
|
+
var import_react12 = require("react");
|
|
2212
2480
|
var useLockBodyScroll = (locked) => {
|
|
2213
|
-
(0,
|
|
2481
|
+
(0, import_react12.useLayoutEffect)(() => {
|
|
2214
2482
|
if (locked) {
|
|
2215
2483
|
const originalStyle = window.getComputedStyle(document.body).overflow;
|
|
2216
2484
|
document.body.style.overflow = "hidden";
|
|
@@ -2222,40 +2490,11 @@ var useLockBodyScroll = (locked) => {
|
|
|
2222
2490
|
}, [locked]);
|
|
2223
2491
|
};
|
|
2224
2492
|
|
|
2225
|
-
// src/hooks/useOnClickOutside/useOnClickOutside.ts
|
|
2226
|
-
var import_react10 = require("react");
|
|
2227
|
-
var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) => {
|
|
2228
|
-
(0, import_react10.useEffect)(() => {
|
|
2229
|
-
const listener = (event) => {
|
|
2230
|
-
if (!ref.current || ref.current.contains(event.target)) {
|
|
2231
|
-
return;
|
|
2232
|
-
}
|
|
2233
|
-
handler(event);
|
|
2234
|
-
};
|
|
2235
|
-
if (Array.isArray(eventTypes)) {
|
|
2236
|
-
eventTypes.forEach((eventType) => {
|
|
2237
|
-
document.addEventListener(eventType, listener);
|
|
2238
|
-
});
|
|
2239
|
-
} else {
|
|
2240
|
-
document.addEventListener(eventTypes, listener);
|
|
2241
|
-
}
|
|
2242
|
-
return () => {
|
|
2243
|
-
if (Array.isArray(eventTypes)) {
|
|
2244
|
-
eventTypes.forEach((eventType) => {
|
|
2245
|
-
document.removeEventListener(eventType, listener);
|
|
2246
|
-
});
|
|
2247
|
-
} else {
|
|
2248
|
-
document.removeEventListener(eventTypes, listener);
|
|
2249
|
-
}
|
|
2250
|
-
};
|
|
2251
|
-
}, [ref, handler, eventTypes]);
|
|
2252
|
-
};
|
|
2253
|
-
|
|
2254
2493
|
// src/hooks/useMq/useMq.ts
|
|
2255
|
-
var
|
|
2494
|
+
var import_type_guards9 = require("@wistia/type-guards");
|
|
2256
2495
|
|
|
2257
2496
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2258
|
-
var
|
|
2497
|
+
var import_react13 = require("react");
|
|
2259
2498
|
var import_throttle_debounce = require("throttle-debounce");
|
|
2260
2499
|
|
|
2261
2500
|
// src/private/helpers/isClient/isClient.ts
|
|
@@ -2263,11 +2502,11 @@ var isClient = () => typeof window !== "undefined" && typeof document !== "undef
|
|
|
2263
2502
|
|
|
2264
2503
|
// src/hooks/useWindowSize/useWindowSize.ts
|
|
2265
2504
|
var useWindowSize = (interval = 0) => {
|
|
2266
|
-
const [dimensions, setDimensions] = (0,
|
|
2505
|
+
const [dimensions, setDimensions] = (0, import_react13.useState)({
|
|
2267
2506
|
width: isClient() ? window.innerWidth : 0,
|
|
2268
2507
|
height: isClient() ? window.innerHeight : 0
|
|
2269
2508
|
});
|
|
2270
|
-
(0,
|
|
2509
|
+
(0, import_react13.useLayoutEffect)(() => {
|
|
2271
2510
|
const handleResize = (0, import_throttle_debounce.debounce)(
|
|
2272
2511
|
interval,
|
|
2273
2512
|
() => setDimensions({
|
|
@@ -2314,21 +2553,50 @@ var useActiveMq = () => {
|
|
|
2314
2553
|
const keys = Object.keys(mq2);
|
|
2315
2554
|
return keys.filter((key) => {
|
|
2316
2555
|
const value = mq2[key];
|
|
2317
|
-
return (0,
|
|
2556
|
+
return (0, import_type_guards9.isBoolean)(value) && value;
|
|
2318
2557
|
});
|
|
2319
2558
|
};
|
|
2320
2559
|
|
|
2560
|
+
// src/hooks/useOnClickOutside/useOnClickOutside.ts
|
|
2561
|
+
var import_react14 = require("react");
|
|
2562
|
+
var useOnClickOutside = (ref, handler, eventTypes = ["mousedown", "touchend"]) => {
|
|
2563
|
+
(0, import_react14.useEffect)(() => {
|
|
2564
|
+
const listener = (event) => {
|
|
2565
|
+
if (!ref.current || ref.current.contains(event.target)) {
|
|
2566
|
+
return;
|
|
2567
|
+
}
|
|
2568
|
+
handler(event);
|
|
2569
|
+
};
|
|
2570
|
+
if (Array.isArray(eventTypes)) {
|
|
2571
|
+
eventTypes.forEach((eventType) => {
|
|
2572
|
+
document.addEventListener(eventType, listener);
|
|
2573
|
+
});
|
|
2574
|
+
} else {
|
|
2575
|
+
document.addEventListener(eventTypes, listener);
|
|
2576
|
+
}
|
|
2577
|
+
return () => {
|
|
2578
|
+
if (Array.isArray(eventTypes)) {
|
|
2579
|
+
eventTypes.forEach((eventType) => {
|
|
2580
|
+
document.removeEventListener(eventType, listener);
|
|
2581
|
+
});
|
|
2582
|
+
} else {
|
|
2583
|
+
document.removeEventListener(eventTypes, listener);
|
|
2584
|
+
}
|
|
2585
|
+
};
|
|
2586
|
+
}, [ref, handler, eventTypes]);
|
|
2587
|
+
};
|
|
2588
|
+
|
|
2321
2589
|
// src/hooks/useToast/useToast.tsx
|
|
2322
|
-
var
|
|
2590
|
+
var import_react16 = require("react");
|
|
2323
2591
|
var import_sonner2 = require("sonner");
|
|
2324
2592
|
|
|
2325
2593
|
// src/private/components/Toast/Toast.tsx
|
|
2326
|
-
var
|
|
2594
|
+
var import_react15 = require("react");
|
|
2327
2595
|
var import_styled_components16 = __toESM(require("styled-components"));
|
|
2328
|
-
var
|
|
2596
|
+
var import_type_guards11 = require("@wistia/type-guards");
|
|
2329
2597
|
|
|
2330
2598
|
// src/components/Ellipsis/Ellipsis.tsx
|
|
2331
|
-
var
|
|
2599
|
+
var import_type_guards10 = require("@wistia/type-guards");
|
|
2332
2600
|
var import_styled_components14 = __toESM(require("styled-components"));
|
|
2333
2601
|
|
|
2334
2602
|
// src/css/lineClampCss.tsx
|
|
@@ -2372,7 +2640,7 @@ var ellipsisFlexParentStyle = import_styled_components14.css`
|
|
|
2372
2640
|
var EllipsisComponent = import_styled_components14.default.span`
|
|
2373
2641
|
${ellipsisStyle};
|
|
2374
2642
|
${({ $lines }) => {
|
|
2375
|
-
if ((0,
|
|
2643
|
+
if ((0, import_type_guards10.isNotNil)($lines)) {
|
|
2376
2644
|
return lineClampCss($lines);
|
|
2377
2645
|
}
|
|
2378
2646
|
return void 0;
|
|
@@ -2561,8 +2829,8 @@ var StyledToast = import_styled_components16.default.div`
|
|
|
2561
2829
|
}
|
|
2562
2830
|
`;
|
|
2563
2831
|
var Action = ({ actionButton }) => {
|
|
2564
|
-
if ((0,
|
|
2565
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0,
|
|
2832
|
+
if ((0, import_type_guards11.isNotNil)(actionButton) && (0, import_react15.isValidElement)(actionButton)) {
|
|
2833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionWrapper, { children: (0, import_react15.cloneElement)(actionButton, {
|
|
2566
2834
|
variant: "soft",
|
|
2567
2835
|
// force Button variant
|
|
2568
2836
|
size: "sm"
|
|
@@ -2571,290 +2839,60 @@ var Action = ({ actionButton }) => {
|
|
|
2571
2839
|
}
|
|
2572
2840
|
return null;
|
|
2573
2841
|
};
|
|
2574
|
-
var Toast = ({
|
|
2575
|
-
action,
|
|
2576
|
-
message,
|
|
2577
|
-
colorScheme = "inherit",
|
|
2578
|
-
icon,
|
|
2579
|
-
...props
|
|
2580
|
-
}) => {
|
|
2581
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
2582
|
-
StyledToast,
|
|
2583
|
-
{
|
|
2584
|
-
...props,
|
|
2585
|
-
$colorScheme: colorScheme,
|
|
2586
|
-
children: [
|
|
2587
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(MessageWrapper, { children: [
|
|
2588
|
-
(0,
|
|
2589
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Message, { lines: 3, children: message })
|
|
2590
|
-
] }),
|
|
2591
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Action, { actionButton: action })
|
|
2592
|
-
]
|
|
2593
|
-
}
|
|
2594
|
-
);
|
|
2595
|
-
};
|
|
2596
|
-
Toast.displayName = "Toast";
|
|
2597
|
-
|
|
2598
|
-
// src/hooks/useToast/useToast.tsx
|
|
2599
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2600
|
-
var useToast = () => {
|
|
2601
|
-
return (0, import_react13.useCallback)(
|
|
2602
|
-
({ message, action, colorScheme, icon, position = "bottom-left", duration = 3e3 }) => {
|
|
2603
|
-
import_sonner2.toast.custom(
|
|
2604
|
-
() => {
|
|
2605
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2606
|
-
Toast,
|
|
2607
|
-
{
|
|
2608
|
-
action,
|
|
2609
|
-
colorScheme,
|
|
2610
|
-
icon,
|
|
2611
|
-
message
|
|
2612
|
-
}
|
|
2613
|
-
);
|
|
2614
|
-
},
|
|
2615
|
-
{ position, duration }
|
|
2616
|
-
);
|
|
2617
|
-
},
|
|
2618
|
-
[]
|
|
2619
|
-
);
|
|
2620
|
-
};
|
|
2621
|
-
|
|
2622
|
-
// src/hooks/useFocusTrap/useFocusTrap.ts
|
|
2623
|
-
var import_react14 = require("react");
|
|
2624
|
-
var import_type_guards11 = require("@wistia/type-guards");
|
|
2625
|
-
|
|
2626
|
-
// src/hooks/useFocusTrap/helpers.ts
|
|
2627
|
-
var FOCUSABLE_ELEMENT_SELECTORS = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [tabindex="0"], [contenteditable]';
|
|
2628
|
-
var coerceToString = (value) => value === null || value === void 0 ? "" : String(value);
|
|
2629
|
-
var isHiddenElement = (element) => {
|
|
2630
|
-
const { display, visibility } = window.getComputedStyle(element);
|
|
2631
|
-
const isHidden = display === "none" || element.style.display === "none" || visibility === "none" || element.style.visibility === "hidden";
|
|
2632
|
-
return element.offsetWidth <= 0 && element.offsetHeight <= 0 || isHidden;
|
|
2633
|
-
};
|
|
2634
|
-
var isVisibleElement = (element) => {
|
|
2635
|
-
let parentElement = element;
|
|
2636
|
-
while (parentElement) {
|
|
2637
|
-
if (parentElement === document.body) {
|
|
2638
|
-
break;
|
|
2639
|
-
}
|
|
2640
|
-
if (isHiddenElement(parentElement)) {
|
|
2641
|
-
return false;
|
|
2642
|
-
}
|
|
2643
|
-
parentElement = parentElement.parentNode;
|
|
2644
|
-
}
|
|
2645
|
-
return true;
|
|
2646
|
-
};
|
|
2647
|
-
var getElementTabIndex = (element) => {
|
|
2648
|
-
const tabIndex = element.getAttribute("tabindex");
|
|
2649
|
-
return Number.parseInt(tabIndex ?? void 0, 10);
|
|
2650
|
-
};
|
|
2651
|
-
var isTabIndexNaN = (element) => {
|
|
2652
|
-
const tabIndex = getElementTabIndex(element);
|
|
2653
|
-
return Number.isNaN(tabIndex);
|
|
2654
|
-
};
|
|
2655
|
-
var isFocusableElement = (element) => {
|
|
2656
|
-
const tabbableNodeRegEx = /input|select|textarea|button|object/;
|
|
2657
|
-
const nodeName = element.nodeName.toLowerCase();
|
|
2658
|
-
const isTabIndexNotNaN = !isTabIndexNaN(element);
|
|
2659
|
-
const isFocusable = (
|
|
2660
|
-
// @ts-expect-error - Disabled is specific to buttons and inputs, but we could be dealing with any number of types here. Disabled would be undefined for those, so ignoring.
|
|
2661
|
-
tabbableNodeRegEx.test(nodeName) && !element.disabled || (element instanceof HTMLAnchorElement ? element.href || isTabIndexNotNaN : isTabIndexNotNaN)
|
|
2662
|
-
);
|
|
2663
|
-
return Boolean(isFocusable) && isVisibleElement(element);
|
|
2664
|
-
};
|
|
2665
|
-
var isTabbableElement = (element) => {
|
|
2666
|
-
const tabIndex = getElementTabIndex(element);
|
|
2667
|
-
return (isTabIndexNaN(element) || tabIndex >= 0) && isFocusableElement(element);
|
|
2668
|
-
};
|
|
2669
|
-
var findTabbableDescendants = (element) => Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter(
|
|
2670
|
-
isTabbableElement
|
|
2671
|
-
);
|
|
2672
|
-
var focusLaterElements = [];
|
|
2673
|
-
var focusElement = null;
|
|
2674
|
-
var needToFocus = false;
|
|
2675
|
-
var handleBlur = () => {
|
|
2676
|
-
needToFocus = true;
|
|
2677
|
-
};
|
|
2678
|
-
var handleFocus = () => {
|
|
2679
|
-
if (needToFocus) {
|
|
2680
|
-
needToFocus = false;
|
|
2681
|
-
if (!focusElement) {
|
|
2682
|
-
return;
|
|
2683
|
-
}
|
|
2684
|
-
if (focusElement.contains(document.activeElement)) {
|
|
2685
|
-
return;
|
|
2686
|
-
}
|
|
2687
|
-
const element = findTabbableDescendants(focusElement)[0] ?? focusElement;
|
|
2688
|
-
element.focus();
|
|
2689
|
-
}
|
|
2690
|
-
};
|
|
2691
|
-
var markForFocusLater = () => {
|
|
2692
|
-
const element = document.activeElement;
|
|
2693
|
-
if (element !== null) {
|
|
2694
|
-
focusLaterElements.push(element);
|
|
2695
|
-
}
|
|
2696
|
-
};
|
|
2697
|
-
var returnFocus = () => {
|
|
2698
|
-
let toFocus = null;
|
|
2699
|
-
try {
|
|
2700
|
-
toFocus = focusLaterElements.pop();
|
|
2701
|
-
if (toFocus) {
|
|
2702
|
-
toFocus.focus();
|
|
2703
|
-
}
|
|
2704
|
-
} catch {
|
|
2705
|
-
console.warn(
|
|
2706
|
-
`You tried to return focus to ${coerceToString(toFocus)} but it is not in the DOM anymore`
|
|
2707
|
-
);
|
|
2708
|
-
}
|
|
2709
|
-
};
|
|
2710
|
-
var setupScopedFocus = (element) => {
|
|
2711
|
-
focusElement = element;
|
|
2712
|
-
document.addEventListener("focusout", handleBlur, false);
|
|
2713
|
-
document.addEventListener("focusin", handleFocus, true);
|
|
2714
|
-
};
|
|
2715
|
-
var teardownScopedFocus = () => {
|
|
2716
|
-
focusElement = null;
|
|
2717
|
-
document.removeEventListener("focusout", handleBlur);
|
|
2718
|
-
document.removeEventListener("focusin", handleFocus);
|
|
2719
|
-
};
|
|
2720
|
-
var scopeTab = (node, event) => {
|
|
2721
|
-
const tabbable = findTabbableDescendants(node);
|
|
2722
|
-
if (!tabbable.length) {
|
|
2723
|
-
event.preventDefault();
|
|
2724
|
-
return;
|
|
2725
|
-
}
|
|
2726
|
-
const finalTabbable = tabbable[event.shiftKey ? 0 : tabbable.length - 1];
|
|
2727
|
-
const leavingFinalTabbable = finalTabbable === document.activeElement || node === document.activeElement;
|
|
2728
|
-
if (!leavingFinalTabbable) {
|
|
2729
|
-
return;
|
|
2730
|
-
}
|
|
2731
|
-
event.preventDefault();
|
|
2732
|
-
const target = tabbable[event.shiftKey ? tabbable.length - 1 : 0];
|
|
2733
|
-
if (target) {
|
|
2734
|
-
target.focus();
|
|
2735
|
-
}
|
|
2736
|
-
};
|
|
2737
|
-
var createAriaHider = (containerNode, selector) => {
|
|
2738
|
-
selector ??= "body > :not(script)";
|
|
2739
|
-
const rootNodes = Array.from(document.querySelectorAll(selector)).map((node) => {
|
|
2740
|
-
if (node.contains(containerNode)) {
|
|
2741
|
-
return void 0;
|
|
2742
|
-
}
|
|
2743
|
-
const ariaHidden = node.getAttribute("aria-hidden");
|
|
2744
|
-
if (ariaHidden === null || ariaHidden === "false") {
|
|
2745
|
-
node.setAttribute("aria-hidden", "true");
|
|
2842
|
+
var Toast = ({
|
|
2843
|
+
action,
|
|
2844
|
+
message,
|
|
2845
|
+
colorScheme = "inherit",
|
|
2846
|
+
icon,
|
|
2847
|
+
...props
|
|
2848
|
+
}) => {
|
|
2849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
2850
|
+
StyledToast,
|
|
2851
|
+
{
|
|
2852
|
+
...props,
|
|
2853
|
+
$colorScheme: colorScheme,
|
|
2854
|
+
children: [
|
|
2855
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(MessageWrapper, { children: [
|
|
2856
|
+
(0, import_type_guards11.isNotNil)(icon) ? icon : null,
|
|
2857
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Message, { lines: 3, children: message })
|
|
2858
|
+
] }),
|
|
2859
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Action, { actionButton: action })
|
|
2860
|
+
]
|
|
2746
2861
|
}
|
|
2747
|
-
|
|
2748
|
-
node,
|
|
2749
|
-
ariaHidden
|
|
2750
|
-
};
|
|
2751
|
-
});
|
|
2752
|
-
return () => {
|
|
2753
|
-
rootNodes.forEach((item) => {
|
|
2754
|
-
if (!item) {
|
|
2755
|
-
return;
|
|
2756
|
-
}
|
|
2757
|
-
if (item.ariaHidden === null) {
|
|
2758
|
-
item.node.removeAttribute("aria-hidden");
|
|
2759
|
-
} else {
|
|
2760
|
-
item.node.setAttribute("aria-hidden", item.ariaHidden);
|
|
2761
|
-
}
|
|
2762
|
-
});
|
|
2763
|
-
};
|
|
2862
|
+
);
|
|
2764
2863
|
};
|
|
2864
|
+
Toast.displayName = "Toast";
|
|
2765
2865
|
|
|
2766
|
-
// src/hooks/
|
|
2767
|
-
var
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
teardownScopedFocus();
|
|
2781
|
-
}
|
|
2782
|
-
if (active && node !== null && node !== void 0) {
|
|
2783
|
-
setupScopedFocus(node);
|
|
2784
|
-
markForFocusLater();
|
|
2785
|
-
const processNode = (node2) => {
|
|
2786
|
-
restoreAriaRef.current = !(options.disableAriaHider ?? false) ? createAriaHider(node2) : null;
|
|
2787
|
-
let focusElement2 = null;
|
|
2788
|
-
if ((0, import_type_guards11.isNotUndefined)(options.focusSelector)) {
|
|
2789
|
-
if (isRef(options.focusSelector)) {
|
|
2790
|
-
focusElement2 = options.focusSelector.current;
|
|
2791
|
-
} else {
|
|
2792
|
-
focusElement2 = typeof options.focusSelector === "string" ? node2.querySelector(options.focusSelector) : options.focusSelector;
|
|
2793
|
-
}
|
|
2794
|
-
}
|
|
2795
|
-
if (!focusElement2) {
|
|
2796
|
-
const children = Array.from(
|
|
2797
|
-
node2.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)
|
|
2798
|
-
);
|
|
2799
|
-
focusElement2 = // Prefer tabbable elements, But fallback to any focusable element
|
|
2800
|
-
children.find(isTabbableElement) ?? // But fallback to any focusable element
|
|
2801
|
-
children.find(isFocusableElement) ?? // Nothing found
|
|
2802
|
-
null;
|
|
2803
|
-
if (!focusElement2 && isFocusableElement(node2)) {
|
|
2804
|
-
focusElement2 = node2;
|
|
2866
|
+
// src/hooks/useToast/useToast.tsx
|
|
2867
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2868
|
+
var useToast = () => {
|
|
2869
|
+
return (0, import_react16.useCallback)(
|
|
2870
|
+
({ message, action, colorScheme, icon, position = "bottom-left", duration = 3e3 }) => {
|
|
2871
|
+
import_sonner2.toast.custom(
|
|
2872
|
+
() => {
|
|
2873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
2874
|
+
Toast,
|
|
2875
|
+
{
|
|
2876
|
+
action,
|
|
2877
|
+
colorScheme,
|
|
2878
|
+
icon,
|
|
2879
|
+
message
|
|
2805
2880
|
}
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
if (!focusElement2 && process.env["NODE_ENV"] === "development") {
|
|
2811
|
-
console.warn(
|
|
2812
|
-
'[useFocusTrap]: Failed to find a focusable element after activating the focus trap. Make sure to include at an element that can recieve focus. As a fallback, you can also set "tabIndex={-1}" on the focus trap node.',
|
|
2813
|
-
node2
|
|
2814
|
-
);
|
|
2815
|
-
}
|
|
2816
|
-
};
|
|
2817
|
-
setTimeout(() => {
|
|
2818
|
-
if (node.ownerDocument) {
|
|
2819
|
-
processNode(node);
|
|
2820
|
-
}
|
|
2821
|
-
if (!node.ownerDocument && process.env["NODE_ENV"] === "development") {
|
|
2822
|
-
console.warn(
|
|
2823
|
-
"[useFocusTrap]: The focus trap is not part of the DOM yet, so it is unable to correctly set focus. Make sure to render the ref node.",
|
|
2824
|
-
node
|
|
2825
|
-
);
|
|
2826
|
-
}
|
|
2827
|
-
});
|
|
2828
|
-
ref.current = node;
|
|
2829
|
-
} else {
|
|
2830
|
-
ref.current = null;
|
|
2831
|
-
}
|
|
2881
|
+
);
|
|
2882
|
+
},
|
|
2883
|
+
{ position, duration }
|
|
2884
|
+
);
|
|
2832
2885
|
},
|
|
2833
|
-
[
|
|
2886
|
+
[]
|
|
2834
2887
|
);
|
|
2835
|
-
(0, import_react14.useEffect)(() => {
|
|
2836
|
-
if (!active) {
|
|
2837
|
-
return void 0;
|
|
2838
|
-
}
|
|
2839
|
-
const handleKeyDown = (event) => {
|
|
2840
|
-
if (event.key === "Tab" && ref.current) {
|
|
2841
|
-
scopeTab(ref.current, event);
|
|
2842
|
-
}
|
|
2843
|
-
};
|
|
2844
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
2845
|
-
return () => {
|
|
2846
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
2847
|
-
};
|
|
2848
|
-
}, [active]);
|
|
2849
|
-
return setRef;
|
|
2850
2888
|
};
|
|
2851
2889
|
|
|
2852
2890
|
// src/components/ActionButton/ActionButton.tsx
|
|
2853
|
-
var
|
|
2891
|
+
var import_react20 = require("react");
|
|
2854
2892
|
var import_styled_components22 = __toESM(require("styled-components"));
|
|
2855
2893
|
|
|
2856
2894
|
// src/components/Button/Button.tsx
|
|
2857
|
-
var
|
|
2895
|
+
var import_react19 = require("react");
|
|
2858
2896
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
2859
2897
|
var import_type_guards15 = require("@wistia/type-guards");
|
|
2860
2898
|
|
|
@@ -6916,13 +6954,13 @@ var iconMap = {
|
|
|
6916
6954
|
|
|
6917
6955
|
// src/private/hooks/useResponsiveProp/useResponsiveProp.ts
|
|
6918
6956
|
var import_type_guards12 = require("@wistia/type-guards");
|
|
6919
|
-
var
|
|
6957
|
+
var import_react17 = require("react");
|
|
6920
6958
|
var isResponsiveObject = (values) => {
|
|
6921
6959
|
return typeof values === "object" && values !== null && !Array.isArray(values) && "base" in values;
|
|
6922
6960
|
};
|
|
6923
6961
|
var useResponsiveProp = (values) => {
|
|
6924
6962
|
const activeMediaQueries = useActiveMq();
|
|
6925
|
-
return (0,
|
|
6963
|
+
return (0, import_react17.useMemo)(() => {
|
|
6926
6964
|
if ((0, import_type_guards12.isRecord)(values) && isResponsiveObject(values)) {
|
|
6927
6965
|
const mq2 = activeMediaQueries.find((key) => key in values);
|
|
6928
6966
|
return (0, import_type_guards12.isNotUndefined)(mq2) && (0, import_type_guards12.isNotUndefined)(values[mq2]) ? values[mq2] : values.base;
|
|
@@ -6989,7 +7027,7 @@ var Icon = ({
|
|
|
6989
7027
|
Icon.displayName = "Icon";
|
|
6990
7028
|
|
|
6991
7029
|
// src/components/Link/Link.tsx
|
|
6992
|
-
var
|
|
7030
|
+
var import_react18 = require("react");
|
|
6993
7031
|
var import_styled_components20 = __toESM(require("styled-components"));
|
|
6994
7032
|
var import_react_router_dom = require("react-router-dom");
|
|
6995
7033
|
var import_type_guards14 = require("@wistia/type-guards");
|
|
@@ -7027,7 +7065,7 @@ var StyledLink = import_styled_components20.default.a`
|
|
|
7027
7065
|
}
|
|
7028
7066
|
}
|
|
7029
7067
|
`;
|
|
7030
|
-
var Link = (0,
|
|
7068
|
+
var Link = (0, import_react18.forwardRef)(
|
|
7031
7069
|
({
|
|
7032
7070
|
beforeAction,
|
|
7033
7071
|
children,
|
|
@@ -7168,7 +7206,7 @@ var ButtonContent = ({
|
|
|
7168
7206
|
)
|
|
7169
7207
|
] });
|
|
7170
7208
|
};
|
|
7171
|
-
var Button = (0,
|
|
7209
|
+
var Button = (0, import_react19.forwardRef)(
|
|
7172
7210
|
({
|
|
7173
7211
|
children,
|
|
7174
7212
|
forceState,
|
|
@@ -7347,7 +7385,7 @@ var StyledLabel = import_styled_components22.default.span`
|
|
|
7347
7385
|
grid-row: 2;
|
|
7348
7386
|
text-align: left;
|
|
7349
7387
|
`;
|
|
7350
|
-
var ActionButton = (0,
|
|
7388
|
+
var ActionButton = (0, import_react20.forwardRef)(
|
|
7351
7389
|
({
|
|
7352
7390
|
icon,
|
|
7353
7391
|
colorScheme = "default",
|
|
@@ -7391,7 +7429,7 @@ var ActionButton = (0, import_react18.forwardRef)(
|
|
|
7391
7429
|
ActionButton.displayName = "ActionButton";
|
|
7392
7430
|
|
|
7393
7431
|
// src/components/Avatar/Avatar.tsx
|
|
7394
|
-
var
|
|
7432
|
+
var import_react21 = require("react");
|
|
7395
7433
|
var import_type_guards18 = require("@wistia/type-guards");
|
|
7396
7434
|
var import_styled_components25 = __toESM(require("styled-components"));
|
|
7397
7435
|
|
|
@@ -7599,8 +7637,8 @@ var Avatar = ({
|
|
|
7599
7637
|
onImageLoad,
|
|
7600
7638
|
...props
|
|
7601
7639
|
}) => {
|
|
7602
|
-
const [imageLoadState, setImageLoadState] = (0,
|
|
7603
|
-
(0,
|
|
7640
|
+
const [imageLoadState, setImageLoadState] = (0, import_react21.useState)("loading");
|
|
7641
|
+
(0, import_react21.useEffect)(() => {
|
|
7604
7642
|
setImageLoadState("loading");
|
|
7605
7643
|
}, [imageUrl]);
|
|
7606
7644
|
const handleImageLoad = () => {
|
|
@@ -7612,7 +7650,7 @@ var Avatar = ({
|
|
|
7612
7650
|
onImageLoad?.({ state: "error", type: "initials" });
|
|
7613
7651
|
};
|
|
7614
7652
|
const avatarSize = heightAndWidth ?? avatarSizeMap[size];
|
|
7615
|
-
const avatarColor = (0,
|
|
7653
|
+
const avatarColor = (0, import_react21.useMemo)(() => chooseColorScheme(name), [name]);
|
|
7616
7654
|
return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
7617
7655
|
AvatarWrapper,
|
|
7618
7656
|
{
|
|
@@ -7639,7 +7677,7 @@ var Avatar = ({
|
|
|
7639
7677
|
Avatar.displayName = "Avatar";
|
|
7640
7678
|
|
|
7641
7679
|
// src/components/Badge/Badge.tsx
|
|
7642
|
-
var
|
|
7680
|
+
var import_react22 = require("react");
|
|
7643
7681
|
var import_styled_components26 = __toESM(require("styled-components"));
|
|
7644
7682
|
var import_type_guards19 = require("@wistia/type-guards");
|
|
7645
7683
|
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
@@ -7663,7 +7701,7 @@ var StyledBadge = import_styled_components26.default.div`
|
|
|
7663
7701
|
width: 12px;
|
|
7664
7702
|
}
|
|
7665
7703
|
`;
|
|
7666
|
-
var Badge = (0,
|
|
7704
|
+
var Badge = (0, import_react22.forwardRef)(
|
|
7667
7705
|
({ colorScheme = "inherit", label, icon, ...props }, ref) => {
|
|
7668
7706
|
const hasIcon = (0, import_type_guards19.isNotNil)(icon);
|
|
7669
7707
|
return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(
|
|
@@ -7684,7 +7722,7 @@ var Badge = (0, import_react20.forwardRef)(
|
|
|
7684
7722
|
Badge.displayName = "Badge";
|
|
7685
7723
|
|
|
7686
7724
|
// src/components/Box/Box.tsx
|
|
7687
|
-
var
|
|
7725
|
+
var import_react23 = require("react");
|
|
7688
7726
|
var import_styled_components27 = __toESM(require("styled-components"));
|
|
7689
7727
|
var import_type_guards20 = require("@wistia/type-guards");
|
|
7690
7728
|
|
|
@@ -7793,13 +7831,13 @@ var StyledBoxComponent = import_styled_components27.default.div`
|
|
|
7793
7831
|
var wrapChildren = (children) => {
|
|
7794
7832
|
if ((0, import_type_guards20.isNotNil)(children)) {
|
|
7795
7833
|
if (typeof children === "object" && isDev) {
|
|
7796
|
-
return
|
|
7834
|
+
return import_react23.Children.map(children, (child) => {
|
|
7797
7835
|
if ((0, import_type_guards20.isNil)(child)) return null;
|
|
7798
7836
|
const elementParams = {};
|
|
7799
7837
|
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
7800
7838
|
elementParams.hasBoxParent = true;
|
|
7801
7839
|
}
|
|
7802
|
-
return (0,
|
|
7840
|
+
return (0, import_react23.cloneElement)(child, elementParams);
|
|
7803
7841
|
});
|
|
7804
7842
|
}
|
|
7805
7843
|
return children;
|
|
@@ -7807,7 +7845,7 @@ var wrapChildren = (children) => {
|
|
|
7807
7845
|
return null;
|
|
7808
7846
|
};
|
|
7809
7847
|
var DEFAULT_ELEMENT = "div";
|
|
7810
|
-
var BoxComponent = (0,
|
|
7848
|
+
var BoxComponent = (0, import_react23.forwardRef)(
|
|
7811
7849
|
({
|
|
7812
7850
|
alignContent = "stretch",
|
|
7813
7851
|
alignItems = "flex-start",
|
|
@@ -7884,7 +7922,7 @@ BoxComponent.displayName = "Box";
|
|
|
7884
7922
|
var Box = makePolymorphic(BoxComponent);
|
|
7885
7923
|
|
|
7886
7924
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
7887
|
-
var
|
|
7925
|
+
var import_react24 = require("react");
|
|
7888
7926
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
7889
7927
|
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
7890
7928
|
var StyledBreadcrumbs = import_styled_components28.default.nav`
|
|
@@ -7900,7 +7938,7 @@ var StyledBreadcrumbs = import_styled_components28.default.nav`
|
|
|
7900
7938
|
var BUFFER_WIDTH = 10;
|
|
7901
7939
|
var Breadcrumbs = ({ children, ...props }) => {
|
|
7902
7940
|
const { isXsAndDown } = useMq();
|
|
7903
|
-
let crumbs =
|
|
7941
|
+
let crumbs = import_react24.Children.toArray(children);
|
|
7904
7942
|
if (isXsAndDown) {
|
|
7905
7943
|
crumbs = crumbs.slice(-1);
|
|
7906
7944
|
}
|
|
@@ -8089,7 +8127,7 @@ var Card = ({
|
|
|
8089
8127
|
Card.displayName = "Card";
|
|
8090
8128
|
|
|
8091
8129
|
// src/components/Center/Center.tsx
|
|
8092
|
-
var
|
|
8130
|
+
var import_react25 = require("react");
|
|
8093
8131
|
var import_styled_components32 = __toESM(require("styled-components"));
|
|
8094
8132
|
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8095
8133
|
var StyledCenter = import_styled_components32.default.div`
|
|
@@ -8104,7 +8142,7 @@ var StyledCenter = import_styled_components32.default.div`
|
|
|
8104
8142
|
align-items: center;
|
|
8105
8143
|
`}
|
|
8106
8144
|
`;
|
|
8107
|
-
var Center = (0,
|
|
8145
|
+
var Center = (0, import_react25.forwardRef)(
|
|
8108
8146
|
({ maxWidth = "100%", gutterWidth = "space-00", intrinsic = false, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8109
8147
|
StyledCenter,
|
|
8110
8148
|
{
|
|
@@ -8120,7 +8158,7 @@ var Center = (0, import_react23.forwardRef)(
|
|
|
8120
8158
|
Center.displayName = "Center";
|
|
8121
8159
|
|
|
8122
8160
|
// src/components/Checkbox/Checkbox.tsx
|
|
8123
|
-
var
|
|
8161
|
+
var import_react26 = require("react");
|
|
8124
8162
|
var import_styled_components36 = __toESM(require("styled-components"));
|
|
8125
8163
|
var import_type_guards25 = require("@wistia/type-guards");
|
|
8126
8164
|
|
|
@@ -8340,7 +8378,7 @@ var StyledHiddenCheckboxInput = import_styled_components36.default.input`
|
|
|
8340
8378
|
display: block;
|
|
8341
8379
|
}
|
|
8342
8380
|
`;
|
|
8343
|
-
var Checkbox = (0,
|
|
8381
|
+
var Checkbox = (0, import_react26.forwardRef)(
|
|
8344
8382
|
({
|
|
8345
8383
|
checked,
|
|
8346
8384
|
disabled = false,
|
|
@@ -8355,7 +8393,7 @@ var Checkbox = (0, import_react24.forwardRef)(
|
|
|
8355
8393
|
hideLabel = false,
|
|
8356
8394
|
...props
|
|
8357
8395
|
}, ref) => {
|
|
8358
|
-
const generatedId = (0,
|
|
8396
|
+
const generatedId = (0, import_react26.useId)();
|
|
8359
8397
|
const computedId = (0, import_type_guards25.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
8360
8398
|
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
8361
8399
|
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
@@ -8398,9 +8436,9 @@ var Checkbox = (0, import_react24.forwardRef)(
|
|
|
8398
8436
|
Checkbox.displayName = "Checkbox";
|
|
8399
8437
|
|
|
8400
8438
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
8401
|
-
var
|
|
8439
|
+
var import_react27 = require("react");
|
|
8402
8440
|
var ClickRegion = ({ children, targetRef }) => {
|
|
8403
|
-
(0,
|
|
8441
|
+
(0, import_react27.useEffect)(() => {
|
|
8404
8442
|
if (targetRef.current && targetRef.current.tagName === "A") {
|
|
8405
8443
|
targetRef.current.setAttribute("data-click-region-target-link", "");
|
|
8406
8444
|
} else if (targetRef.current && targetRef.current.tagName === "BUTTON") {
|
|
@@ -8408,7 +8446,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8408
8446
|
} else {
|
|
8409
8447
|
}
|
|
8410
8448
|
}, [targetRef]);
|
|
8411
|
-
const handleClick = (0,
|
|
8449
|
+
const handleClick = (0, import_react27.useCallback)(
|
|
8412
8450
|
(event) => {
|
|
8413
8451
|
const node = targetRef.current;
|
|
8414
8452
|
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")) {
|
|
@@ -8425,7 +8463,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8425
8463
|
},
|
|
8426
8464
|
[targetRef]
|
|
8427
8465
|
);
|
|
8428
|
-
return (0,
|
|
8466
|
+
return (0, import_react27.cloneElement)(import_react27.Children.only(children), {
|
|
8429
8467
|
"data-click-region": true,
|
|
8430
8468
|
onClick: handleClick
|
|
8431
8469
|
});
|
|
@@ -8458,11 +8496,11 @@ var Collapsible = ({
|
|
|
8458
8496
|
Collapsible.displayName = "Collapsible";
|
|
8459
8497
|
|
|
8460
8498
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
8461
|
-
var
|
|
8499
|
+
var import_react28 = require("react");
|
|
8462
8500
|
var import_react_collapsible2 = require("@radix-ui/react-collapsible");
|
|
8463
8501
|
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
8464
8502
|
var CollapsibleTrigger = ({ children }) => {
|
|
8465
|
-
|
|
8503
|
+
import_react28.Children.only(children);
|
|
8466
8504
|
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(import_react_collapsible2.Trigger, { asChild: true, children });
|
|
8467
8505
|
};
|
|
8468
8506
|
|
|
@@ -8489,7 +8527,7 @@ var import_styled_components40 = __toESM(require("styled-components"));
|
|
|
8489
8527
|
var import_type_guards29 = require("@wistia/type-guards");
|
|
8490
8528
|
|
|
8491
8529
|
// src/components/Heading/Heading.tsx
|
|
8492
|
-
var
|
|
8530
|
+
var import_react29 = require("react");
|
|
8493
8531
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8494
8532
|
var import_type_guards28 = require("@wistia/type-guards");
|
|
8495
8533
|
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
@@ -8585,7 +8623,7 @@ var variantElementMap = {
|
|
|
8585
8623
|
heading5: "h5",
|
|
8586
8624
|
heading6: "h6"
|
|
8587
8625
|
};
|
|
8588
|
-
var HeadingComponent = (0,
|
|
8626
|
+
var HeadingComponent = (0, import_react29.forwardRef)(
|
|
8589
8627
|
({
|
|
8590
8628
|
align = "left",
|
|
8591
8629
|
colorScheme = "inherit",
|
|
@@ -8749,7 +8787,7 @@ DataCards.displayName = "DataCards";
|
|
|
8749
8787
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8750
8788
|
|
|
8751
8789
|
// src/components/Text/Text.tsx
|
|
8752
|
-
var
|
|
8790
|
+
var import_react30 = require("react");
|
|
8753
8791
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
8754
8792
|
var import_type_guards30 = require("@wistia/type-guards");
|
|
8755
8793
|
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
@@ -8924,7 +8962,7 @@ var StyledText = import_styled_components42.default.div`
|
|
|
8924
8962
|
}
|
|
8925
8963
|
`}
|
|
8926
8964
|
`;
|
|
8927
|
-
var TextComponent = (0,
|
|
8965
|
+
var TextComponent = (0, import_react30.forwardRef)(
|
|
8928
8966
|
({
|
|
8929
8967
|
align = "left",
|
|
8930
8968
|
colorScheme = "inherit",
|
|
@@ -9037,7 +9075,7 @@ Divider.displayName = "Divider";
|
|
|
9037
9075
|
|
|
9038
9076
|
// src/components/EditableHeading/EditableHeading.tsx
|
|
9039
9077
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
9040
|
-
var
|
|
9078
|
+
var import_react32 = require("react");
|
|
9041
9079
|
|
|
9042
9080
|
// src/components/Tooltip/Tooltip.tsx
|
|
9043
9081
|
var import_react_tooltip2 = require("@radix-ui/react-tooltip");
|
|
@@ -9135,7 +9173,7 @@ var Tooltip = ({
|
|
|
9135
9173
|
Tooltip.displayName = "Tooltip";
|
|
9136
9174
|
|
|
9137
9175
|
// src/components/Input/Input.tsx
|
|
9138
|
-
var
|
|
9176
|
+
var import_react31 = require("react");
|
|
9139
9177
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9140
9178
|
var import_type_guards31 = require("@wistia/type-guards");
|
|
9141
9179
|
|
|
@@ -9270,7 +9308,7 @@ var StyledInputContainer = import_styled_components47.default.div`
|
|
|
9270
9308
|
padding-right: 32px;
|
|
9271
9309
|
}
|
|
9272
9310
|
`;
|
|
9273
|
-
var Input = (0,
|
|
9311
|
+
var Input = (0, import_react31.forwardRef)(
|
|
9274
9312
|
({
|
|
9275
9313
|
fullWidth = true,
|
|
9276
9314
|
monospace = false,
|
|
@@ -9280,7 +9318,7 @@ var Input = (0, import_react29.forwardRef)(
|
|
|
9280
9318
|
rightIcon,
|
|
9281
9319
|
...props
|
|
9282
9320
|
}, externalRef) => {
|
|
9283
|
-
const internalRef = (0,
|
|
9321
|
+
const internalRef = (0, import_react31.useRef)();
|
|
9284
9322
|
const ref = (
|
|
9285
9323
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
9286
9324
|
(0, import_type_guards31.isNotNil)(externalRef) && (0, import_type_guards31.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
@@ -9290,14 +9328,14 @@ var Input = (0, import_react29.forwardRef)(
|
|
|
9290
9328
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(Icon, { type: "search" });
|
|
9291
9329
|
}
|
|
9292
9330
|
if ((0, import_type_guards31.isNotNil)(leftIconToDisplay)) {
|
|
9293
|
-
leftIconToDisplay = (0,
|
|
9331
|
+
leftIconToDisplay = (0, import_react31.cloneElement)(leftIconToDisplay, {
|
|
9294
9332
|
size: "md",
|
|
9295
9333
|
className: "wui-input-left-icon"
|
|
9296
9334
|
});
|
|
9297
9335
|
}
|
|
9298
9336
|
let rightIconToDisplay = rightIcon;
|
|
9299
9337
|
if ((0, import_type_guards31.isNotNil)(rightIconToDisplay)) {
|
|
9300
|
-
rightIconToDisplay = (0,
|
|
9338
|
+
rightIconToDisplay = (0, import_react31.cloneElement)(rightIconToDisplay, {
|
|
9301
9339
|
size: "md",
|
|
9302
9340
|
className: "wui-input-right-icon"
|
|
9303
9341
|
});
|
|
@@ -9389,11 +9427,11 @@ var EditableHeading = ({
|
|
|
9389
9427
|
__forceEditing = false,
|
|
9390
9428
|
editingDisabled = false
|
|
9391
9429
|
}) => {
|
|
9392
|
-
const [isEditing, setIsEditing] = (0,
|
|
9393
|
-
const [value, setValue] = (0,
|
|
9394
|
-
const [previousValue, setPreviousValue] = (0,
|
|
9395
|
-
const [headingHeight, setHeadingHeight] = (0,
|
|
9396
|
-
const headingRef = (0,
|
|
9430
|
+
const [isEditing, setIsEditing] = (0, import_react32.useState)(false);
|
|
9431
|
+
const [value, setValue] = (0, import_react32.useState)(children);
|
|
9432
|
+
const [previousValue, setPreviousValue] = (0, import_react32.useState)(children);
|
|
9433
|
+
const [headingHeight, setHeadingHeight] = (0, import_react32.useState)("60");
|
|
9434
|
+
const headingRef = (0, import_react32.useRef)(null);
|
|
9397
9435
|
const handleSetEditing = (editing) => {
|
|
9398
9436
|
if (editingDisabled) return;
|
|
9399
9437
|
if (editing && headingRef.current) {
|
|
@@ -9472,12 +9510,12 @@ var EditableHeading = ({
|
|
|
9472
9510
|
};
|
|
9473
9511
|
|
|
9474
9512
|
// src/components/Form/Form.tsx
|
|
9475
|
-
var
|
|
9513
|
+
var import_react34 = require("react");
|
|
9476
9514
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
9477
9515
|
var import_type_guards32 = require("@wistia/type-guards");
|
|
9478
9516
|
|
|
9479
9517
|
// src/components/Stack/Stack.tsx
|
|
9480
|
-
var
|
|
9518
|
+
var import_react33 = require("react");
|
|
9481
9519
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9482
9520
|
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9483
9521
|
var DEFAULT_ELEMENT4 = "div";
|
|
@@ -9487,7 +9525,7 @@ var StyledStack = import_styled_components49.default.div`
|
|
|
9487
9525
|
gap: ${({ $gap }) => `var(--wui-${$gap})`};
|
|
9488
9526
|
align-items: ${({ $alignItems }) => $alignItems};
|
|
9489
9527
|
`;
|
|
9490
|
-
var StackComponent = (0,
|
|
9528
|
+
var StackComponent = (0, import_react33.forwardRef)(
|
|
9491
9529
|
({ renderAs, direction = "vertical", gap = "space-02", alignItems = "stretch", ...props }, ref) => {
|
|
9492
9530
|
const responsiveGap = useResponsiveProp(gap);
|
|
9493
9531
|
const responsiveDirection = useResponsiveProp(direction);
|
|
@@ -9516,7 +9554,7 @@ var StyledForm = import_styled_components50.default.form`
|
|
|
9516
9554
|
max-width: ${({ $fullWidth }) => $fullWidth ? "auto" : "var(--form-default-width)"};
|
|
9517
9555
|
align-items: ${({ $fullWidth }) => $fullWidth ? "stretch" : "flex-start"};
|
|
9518
9556
|
`;
|
|
9519
|
-
var FormContext = (0,
|
|
9557
|
+
var FormContext = (0, import_react34.createContext)({
|
|
9520
9558
|
values: {},
|
|
9521
9559
|
errors: {},
|
|
9522
9560
|
hasSubmitted: false,
|
|
@@ -9532,11 +9570,11 @@ var FormComponent = ({
|
|
|
9532
9570
|
fullWidth = false,
|
|
9533
9571
|
...props
|
|
9534
9572
|
}, forwardedRef) => {
|
|
9535
|
-
const [errors, setErrors] = (0,
|
|
9536
|
-
const [hasSubmitted, setHasSubmitted] = (0,
|
|
9537
|
-
const innerRef = (0,
|
|
9573
|
+
const [errors, setErrors] = (0, import_react34.useState)({});
|
|
9574
|
+
const [hasSubmitted, setHasSubmitted] = (0, import_react34.useState)(false);
|
|
9575
|
+
const innerRef = (0, import_react34.useRef)();
|
|
9538
9576
|
const ref = forwardedRef ?? innerRef;
|
|
9539
|
-
const autoId = (0,
|
|
9577
|
+
const autoId = (0, import_react34.useId)();
|
|
9540
9578
|
const id = props.id ?? autoId;
|
|
9541
9579
|
const handleValidate = (nextFormData) => {
|
|
9542
9580
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
@@ -9578,7 +9616,7 @@ var FormComponent = ({
|
|
|
9578
9616
|
void action(null);
|
|
9579
9617
|
}
|
|
9580
9618
|
};
|
|
9581
|
-
const context = (0,
|
|
9619
|
+
const context = (0, import_react34.useMemo)(() => {
|
|
9582
9620
|
return {
|
|
9583
9621
|
values,
|
|
9584
9622
|
errors,
|
|
@@ -9607,15 +9645,15 @@ var FormComponent = ({
|
|
|
9607
9645
|
);
|
|
9608
9646
|
};
|
|
9609
9647
|
FormComponent.displayName = "Form";
|
|
9610
|
-
var Form = (0,
|
|
9648
|
+
var Form = (0, import_react34.forwardRef)(FormComponent);
|
|
9611
9649
|
|
|
9612
9650
|
// src/components/Form/useFormState.tsx
|
|
9613
|
-
var
|
|
9651
|
+
var import_react35 = require("react");
|
|
9614
9652
|
var useFormState = (action, initialData = {}) => {
|
|
9615
|
-
const [data, setData] = (0,
|
|
9616
|
-
const [isPending, setIsPending] = (0,
|
|
9617
|
-
const [error, setError] = (0,
|
|
9618
|
-
const formAction = (0,
|
|
9653
|
+
const [data, setData] = (0, import_react35.useState)(initialData);
|
|
9654
|
+
const [isPending, setIsPending] = (0, import_react35.useState)(false);
|
|
9655
|
+
const [error, setError] = (0, import_react35.useState)(null);
|
|
9656
|
+
const formAction = (0, import_react35.useCallback)(
|
|
9619
9657
|
async (nextFormData) => {
|
|
9620
9658
|
if (nextFormData === null) {
|
|
9621
9659
|
setData(initialData);
|
|
@@ -9646,15 +9684,15 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9646
9684
|
};
|
|
9647
9685
|
|
|
9648
9686
|
// src/components/Form/FormErrorSummary.tsx
|
|
9649
|
-
var
|
|
9687
|
+
var import_react36 = require("react");
|
|
9650
9688
|
var import_type_guards33 = require("@wistia/type-guards");
|
|
9651
9689
|
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9652
9690
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9653
9691
|
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
9654
9692
|
};
|
|
9655
9693
|
var FormErrorSummary = ({ description }) => {
|
|
9656
|
-
const ref = (0,
|
|
9657
|
-
const { formId, errors, hasSubmitted } = (0,
|
|
9694
|
+
const ref = (0, import_react36.useRef)(null);
|
|
9695
|
+
const { formId, errors, hasSubmitted } = (0, import_react36.useContext)(FormContext);
|
|
9658
9696
|
const isValid = Object.keys(errors).length === 0;
|
|
9659
9697
|
if (isValid || !hasSubmitted) {
|
|
9660
9698
|
return null;
|
|
@@ -9684,7 +9722,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9684
9722
|
};
|
|
9685
9723
|
|
|
9686
9724
|
// src/components/FormField/FormField.tsx
|
|
9687
|
-
var
|
|
9725
|
+
var import_react39 = require("react");
|
|
9688
9726
|
var import_styled_components53 = __toESM(require("styled-components"));
|
|
9689
9727
|
var import_type_guards34 = require("@wistia/type-guards");
|
|
9690
9728
|
|
|
@@ -9749,11 +9787,11 @@ var Label = ({
|
|
|
9749
9787
|
Label.displayName = "Label";
|
|
9750
9788
|
|
|
9751
9789
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9752
|
-
var
|
|
9790
|
+
var import_react38 = require("react");
|
|
9753
9791
|
|
|
9754
9792
|
// src/components/FormGroup/FormGroup.tsx
|
|
9755
9793
|
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9756
|
-
var
|
|
9794
|
+
var import_react37 = require("react");
|
|
9757
9795
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9758
9796
|
var StyledFieldset = import_styled_components52.default.fieldset`
|
|
9759
9797
|
border: 0;
|
|
@@ -9762,7 +9800,7 @@ var StyledLegend = import_styled_components52.default.legend`
|
|
|
9762
9800
|
margin-bottom: var(--space-01);
|
|
9763
9801
|
`;
|
|
9764
9802
|
var FormGroup = ({ children, label, ...props }) => {
|
|
9765
|
-
const ref = (0,
|
|
9803
|
+
const ref = (0, import_react37.useRef)();
|
|
9766
9804
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
9767
9805
|
Stack,
|
|
9768
9806
|
{
|
|
@@ -9787,7 +9825,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
9787
9825
|
|
|
9788
9826
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9789
9827
|
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9790
|
-
var CheckboxGroupContext = (0,
|
|
9828
|
+
var CheckboxGroupContext = (0, import_react38.createContext)(null);
|
|
9791
9829
|
var CheckboxGroup = ({
|
|
9792
9830
|
children,
|
|
9793
9831
|
name,
|
|
@@ -9795,7 +9833,7 @@ var CheckboxGroup = ({
|
|
|
9795
9833
|
value,
|
|
9796
9834
|
...props
|
|
9797
9835
|
}) => {
|
|
9798
|
-
const context = (0,
|
|
9836
|
+
const context = (0, import_react38.useMemo)(() => {
|
|
9799
9837
|
return {
|
|
9800
9838
|
name,
|
|
9801
9839
|
onChange
|
|
@@ -9880,8 +9918,8 @@ var FormField = ({
|
|
|
9880
9918
|
value,
|
|
9881
9919
|
...props
|
|
9882
9920
|
}) => {
|
|
9883
|
-
const formState = (0,
|
|
9884
|
-
const checkboxGroup = (0,
|
|
9921
|
+
const formState = (0, import_react39.useContext)(FormContext);
|
|
9922
|
+
const checkboxGroup = (0, import_react39.useContext)(CheckboxGroupContext);
|
|
9885
9923
|
const defaultValue = formState.values[name];
|
|
9886
9924
|
const isIntegratedLabel = children.type === Checkbox;
|
|
9887
9925
|
const computedId = id ?? `${formState.formId}-${name}`;
|
|
@@ -9919,7 +9957,7 @@ var FormField = ({
|
|
|
9919
9957
|
"aria-invalid": (0, import_type_guards34.isNotNil)(error)
|
|
9920
9958
|
};
|
|
9921
9959
|
}
|
|
9922
|
-
|
|
9960
|
+
import_react39.Children.only(children);
|
|
9923
9961
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(
|
|
9924
9962
|
StyledFormField,
|
|
9925
9963
|
{
|
|
@@ -9928,7 +9966,7 @@ var FormField = ({
|
|
|
9928
9966
|
children: [
|
|
9929
9967
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
9930
9968
|
(0, import_type_guards34.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9931
|
-
(0,
|
|
9969
|
+
(0, import_react39.cloneElement)(children, childProps),
|
|
9932
9970
|
(0, import_type_guards34.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(import_jsx_runtime227.Fragment, { children: [
|
|
9933
9971
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("div", {}),
|
|
9934
9972
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
@@ -9946,9 +9984,9 @@ var FormField = ({
|
|
|
9946
9984
|
FormField.displayName = "FormField";
|
|
9947
9985
|
|
|
9948
9986
|
// src/components/FormGroup/RadioGroup.tsx
|
|
9949
|
-
var
|
|
9987
|
+
var import_react40 = require("react");
|
|
9950
9988
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
9951
|
-
var RadioGroupContext = (0,
|
|
9989
|
+
var RadioGroupContext = (0, import_react40.createContext)(null);
|
|
9952
9990
|
var RadioGroup = ({
|
|
9953
9991
|
children,
|
|
9954
9992
|
name,
|
|
@@ -9956,7 +9994,7 @@ var RadioGroup = ({
|
|
|
9956
9994
|
value,
|
|
9957
9995
|
...props
|
|
9958
9996
|
}) => {
|
|
9959
|
-
const context = (0,
|
|
9997
|
+
const context = (0, import_react40.useMemo)(() => {
|
|
9960
9998
|
return {
|
|
9961
9999
|
name,
|
|
9962
10000
|
onChange
|
|
@@ -9967,7 +10005,7 @@ var RadioGroup = ({
|
|
|
9967
10005
|
RadioGroup.displayName = "RadioGroup";
|
|
9968
10006
|
|
|
9969
10007
|
// src/components/IconButton/IconButton.tsx
|
|
9970
|
-
var
|
|
10008
|
+
var import_react41 = require("react");
|
|
9971
10009
|
var import_styled_components54 = __toESM(require("styled-components"));
|
|
9972
10010
|
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
9973
10011
|
var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
@@ -9984,7 +10022,7 @@ var StyledButton2 = (0, import_styled_components54.default)(Button)`
|
|
|
9984
10022
|
align-items: center;
|
|
9985
10023
|
line-height: 1;
|
|
9986
10024
|
`;
|
|
9987
|
-
var IconButton = (0,
|
|
10025
|
+
var IconButton = (0, import_react41.forwardRef)(
|
|
9988
10026
|
({ children, label, size = "md", ...props }, ref) => {
|
|
9989
10027
|
const responsiveSize = useResponsiveProp(size);
|
|
9990
10028
|
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
@@ -9995,7 +10033,7 @@ var IconButton = (0, import_react39.forwardRef)(
|
|
|
9995
10033
|
"aria-label": label,
|
|
9996
10034
|
"data-wistia-ui-icon-button": true,
|
|
9997
10035
|
size: responsiveSize,
|
|
9998
|
-
children: (0,
|
|
10036
|
+
children: (0, import_react41.cloneElement)(import_react41.Children.only(children), {
|
|
9999
10037
|
size: responsiveSize
|
|
10000
10038
|
})
|
|
10001
10039
|
}
|
|
@@ -10006,7 +10044,7 @@ IconButton.displayName = "IconButton";
|
|
|
10006
10044
|
|
|
10007
10045
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
10008
10046
|
var import_styled_components55 = __toESM(require("styled-components"));
|
|
10009
|
-
var
|
|
10047
|
+
var import_react42 = require("react");
|
|
10010
10048
|
var import_type_guards35 = require("@wistia/type-guards");
|
|
10011
10049
|
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
10012
10050
|
var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
@@ -10019,10 +10057,10 @@ var StyledInput2 = (0, import_styled_components55.default)(Input)`
|
|
|
10019
10057
|
}
|
|
10020
10058
|
`;
|
|
10021
10059
|
var COPY_SUCCESS_DURATION = 2e3;
|
|
10022
|
-
var InputClickToCopy = (0,
|
|
10060
|
+
var InputClickToCopy = (0, import_react42.forwardRef)(
|
|
10023
10061
|
({ value, onCopy, ...props }, ref) => {
|
|
10024
|
-
const [isCopied, setIsCopied] = (0,
|
|
10025
|
-
(0,
|
|
10062
|
+
const [isCopied, setIsCopied] = (0, import_react42.useState)(false);
|
|
10063
|
+
(0, import_react42.useEffect)(() => {
|
|
10026
10064
|
if (isCopied) {
|
|
10027
10065
|
const timeout = setTimeout(() => {
|
|
10028
10066
|
setIsCopied(false);
|
|
@@ -10072,12 +10110,12 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
10072
10110
|
var import_styled_components56 = __toESM(require("styled-components"));
|
|
10073
10111
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
10074
10112
|
var import_type_guards36 = require("@wistia/type-guards");
|
|
10075
|
-
var
|
|
10113
|
+
var import_react44 = require("react");
|
|
10076
10114
|
|
|
10077
10115
|
// src/components/Menu/MenuContext.tsx
|
|
10078
|
-
var
|
|
10079
|
-
var MenuContext = (0,
|
|
10080
|
-
var useMenuContext = () => (0,
|
|
10116
|
+
var import_react43 = require("react");
|
|
10117
|
+
var MenuContext = (0, import_react43.createContext)({ compact: false });
|
|
10118
|
+
var useMenuContext = () => (0, import_react43.useContext)(MenuContext);
|
|
10081
10119
|
|
|
10082
10120
|
// src/components/Menu/Menu.tsx
|
|
10083
10121
|
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
@@ -10181,7 +10219,7 @@ var Menu = ({
|
|
|
10181
10219
|
onInteractOutside,
|
|
10182
10220
|
...props
|
|
10183
10221
|
}) => {
|
|
10184
|
-
const contextValue = (0,
|
|
10222
|
+
const contextValue = (0, import_react44.useMemo)(() => ({ compact }), [compact]);
|
|
10185
10223
|
let controlProps = {
|
|
10186
10224
|
...(0, import_type_guards36.isNotNil)(onOpenChange) && (0, import_type_guards36.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
10187
10225
|
};
|
|
@@ -10255,13 +10293,13 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
10255
10293
|
MenuLabel.displayName = "MenuLabel";
|
|
10256
10294
|
|
|
10257
10295
|
// src/components/Menu/SubMenu.tsx
|
|
10258
|
-
var
|
|
10296
|
+
var import_react46 = require("react");
|
|
10259
10297
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
10260
10298
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
10261
10299
|
var import_type_guards38 = require("@wistia/type-guards");
|
|
10262
10300
|
|
|
10263
10301
|
// src/components/Menu/MenuItemButton.tsx
|
|
10264
|
-
var
|
|
10302
|
+
var import_react45 = require("react");
|
|
10265
10303
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
10266
10304
|
var import_type_guards37 = require("@wistia/type-guards");
|
|
10267
10305
|
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
@@ -10338,7 +10376,7 @@ var StyledBadgeContainer = import_styled_components58.default.div`
|
|
|
10338
10376
|
font-size: var(--wui-typography-label-4-size);
|
|
10339
10377
|
color: var(--wui-color-text-secondary);
|
|
10340
10378
|
`;
|
|
10341
|
-
var MenuItemButton = (0,
|
|
10379
|
+
var MenuItemButton = (0, import_react45.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
10342
10380
|
let { colorScheme, badge } = props;
|
|
10343
10381
|
if (appearance === "dangerous") {
|
|
10344
10382
|
if ((0, import_type_guards37.isNotUndefined)(colorScheme)) {
|
|
@@ -10434,7 +10472,7 @@ var SubMenu = ({
|
|
|
10434
10472
|
...props
|
|
10435
10473
|
}) => {
|
|
10436
10474
|
const { isSmAndUp } = useMq();
|
|
10437
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
10475
|
+
const [isExpanded, setIsExpanded] = (0, import_react46.useState)(false);
|
|
10438
10476
|
const { compact } = useMenuContext();
|
|
10439
10477
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
10440
10478
|
/* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
@@ -10463,10 +10501,10 @@ var SubMenu = ({
|
|
|
10463
10501
|
SubMenu.displayName = "SubMenu";
|
|
10464
10502
|
|
|
10465
10503
|
// src/components/Menu/MenuItem.tsx
|
|
10466
|
-
var
|
|
10504
|
+
var import_react47 = require("react");
|
|
10467
10505
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
10468
10506
|
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
10469
|
-
var MenuItem = (0,
|
|
10507
|
+
var MenuItem = (0, import_react47.forwardRef)(
|
|
10470
10508
|
({ onSelect = () => null, ...props }, ref) => {
|
|
10471
10509
|
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
10472
10510
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
@@ -10618,7 +10656,7 @@ var CheckboxMenuItem = ({
|
|
|
10618
10656
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
10619
10657
|
|
|
10620
10658
|
// src/components/Modal/Modal.tsx
|
|
10621
|
-
var
|
|
10659
|
+
var import_react51 = require("react");
|
|
10622
10660
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
10623
10661
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
10624
10662
|
var import_type_guards41 = require("@wistia/type-guards");
|
|
@@ -10678,19 +10716,19 @@ var ModalHeader = ({
|
|
|
10678
10716
|
};
|
|
10679
10717
|
|
|
10680
10718
|
// src/components/Modal/ModalContent.tsx
|
|
10681
|
-
var
|
|
10719
|
+
var import_react49 = require("react");
|
|
10682
10720
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
10683
10721
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
10684
10722
|
|
|
10685
10723
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10686
|
-
var
|
|
10724
|
+
var import_react48 = require("react");
|
|
10687
10725
|
var import_type_guards40 = require("@wistia/type-guards");
|
|
10688
10726
|
var useFocusRestore = () => {
|
|
10689
|
-
const previouslyFocusedRef = (0,
|
|
10690
|
-
(0,
|
|
10727
|
+
const previouslyFocusedRef = (0, import_react48.useRef)(null);
|
|
10728
|
+
(0, import_react48.useEffect)(() => {
|
|
10691
10729
|
previouslyFocusedRef.current = document.activeElement;
|
|
10692
10730
|
}, []);
|
|
10693
|
-
(0,
|
|
10731
|
+
(0, import_react48.useEffect)(() => {
|
|
10694
10732
|
return () => {
|
|
10695
10733
|
if ((0, import_type_guards40.isNotNil)(previouslyFocusedRef.current)) {
|
|
10696
10734
|
setTimeout(() => {
|
|
@@ -10744,7 +10782,7 @@ var StyledModalContent = (0, import_styled_components63.default)(import_react_di
|
|
|
10744
10782
|
}
|
|
10745
10783
|
}
|
|
10746
10784
|
`;
|
|
10747
|
-
var ModalContent = (0,
|
|
10785
|
+
var ModalContent = (0, import_react49.forwardRef)(
|
|
10748
10786
|
({ fullHeight, width, children, ...props }, ref) => {
|
|
10749
10787
|
useFocusRestore();
|
|
10750
10788
|
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
@@ -10762,7 +10800,7 @@ var ModalContent = (0, import_react47.forwardRef)(
|
|
|
10762
10800
|
);
|
|
10763
10801
|
|
|
10764
10802
|
// src/private/components/Backdrop/Backdrop.tsx
|
|
10765
|
-
var
|
|
10803
|
+
var import_react50 = require("react");
|
|
10766
10804
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
10767
10805
|
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
10768
10806
|
var backdropAnimationDuration = 150;
|
|
@@ -10800,7 +10838,7 @@ var BackdropComponent = import_styled_components64.default.div`
|
|
|
10800
10838
|
}
|
|
10801
10839
|
}
|
|
10802
10840
|
`;
|
|
10803
|
-
var Backdrop = (0,
|
|
10841
|
+
var Backdrop = (0, import_react50.forwardRef)(
|
|
10804
10842
|
({ alignHorizontal = "center", alignVertical = "center", children, ...otherProps }, ref) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
10805
10843
|
BackdropComponent,
|
|
10806
10844
|
{
|
|
@@ -10822,7 +10860,7 @@ var ModalBody = import_styled_components65.default.div`
|
|
|
10822
10860
|
display: flex;
|
|
10823
10861
|
order: 2;
|
|
10824
10862
|
`;
|
|
10825
|
-
var Modal = (0,
|
|
10863
|
+
var Modal = (0, import_react51.forwardRef)(
|
|
10826
10864
|
({
|
|
10827
10865
|
children,
|
|
10828
10866
|
fullHeight = false,
|
|
@@ -11036,7 +11074,7 @@ var ProgressBar = ({
|
|
|
11036
11074
|
ProgressBar.displayName = "ProgressBar";
|
|
11037
11075
|
|
|
11038
11076
|
// src/components/Radio/Radio.tsx
|
|
11039
|
-
var
|
|
11077
|
+
var import_react52 = require("react");
|
|
11040
11078
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11041
11079
|
var import_type_guards44 = require("@wistia/type-guards");
|
|
11042
11080
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
@@ -11139,7 +11177,7 @@ var StyledHiddenRadioInput = import_styled_components68.default.input`
|
|
|
11139
11177
|
display: block;
|
|
11140
11178
|
}
|
|
11141
11179
|
`;
|
|
11142
|
-
var Radio = (0,
|
|
11180
|
+
var Radio = (0, import_react52.forwardRef)(
|
|
11143
11181
|
({
|
|
11144
11182
|
checked,
|
|
11145
11183
|
disabled = false,
|
|
@@ -11154,7 +11192,7 @@ var Radio = (0, import_react50.forwardRef)(
|
|
|
11154
11192
|
hideLabel = false,
|
|
11155
11193
|
...props
|
|
11156
11194
|
}, ref) => {
|
|
11157
|
-
const generatedId = (0,
|
|
11195
|
+
const generatedId = (0, import_react52.useId)();
|
|
11158
11196
|
const computedId = (0, import_type_guards44.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11159
11197
|
return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(
|
|
11160
11198
|
StyledRadioWrapper,
|
|
@@ -11204,20 +11242,20 @@ var Radio = (0, import_react50.forwardRef)(
|
|
|
11204
11242
|
Radio.displayName = "Radio";
|
|
11205
11243
|
|
|
11206
11244
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
11207
|
-
var
|
|
11245
|
+
var import_react55 = require("react");
|
|
11208
11246
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
11209
11247
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
11210
11248
|
var import_type_guards45 = require("@wistia/type-guards");
|
|
11211
11249
|
|
|
11212
11250
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11213
|
-
var
|
|
11251
|
+
var import_react53 = require("react");
|
|
11214
11252
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
11215
|
-
var SelectedItemStyleContext = (0,
|
|
11253
|
+
var SelectedItemStyleContext = (0, import_react53.createContext)(null);
|
|
11216
11254
|
var SelectedItemStyleProvider = ({
|
|
11217
11255
|
children
|
|
11218
11256
|
}) => {
|
|
11219
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
11220
|
-
const selectedItemIndicatorStyle = (0,
|
|
11257
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react53.useState)(null);
|
|
11258
|
+
const selectedItemIndicatorStyle = (0, import_react53.useMemo)(
|
|
11221
11259
|
() => selectedItemMeasurements != null ? {
|
|
11222
11260
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
11223
11261
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
@@ -11227,7 +11265,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11227
11265
|
},
|
|
11228
11266
|
[selectedItemMeasurements]
|
|
11229
11267
|
);
|
|
11230
|
-
const contextValue = (0,
|
|
11268
|
+
const contextValue = (0, import_react53.useMemo)(
|
|
11231
11269
|
() => ({
|
|
11232
11270
|
setSelectedItemMeasurements,
|
|
11233
11271
|
selectedItemIndicatorStyle
|
|
@@ -11237,7 +11275,7 @@ var SelectedItemStyleProvider = ({
|
|
|
11237
11275
|
return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
11238
11276
|
};
|
|
11239
11277
|
var useSelectedItemStyle = () => {
|
|
11240
|
-
const context = (0,
|
|
11278
|
+
const context = (0, import_react53.useContext)(SelectedItemStyleContext);
|
|
11241
11279
|
if (context === null) {
|
|
11242
11280
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
11243
11281
|
}
|
|
@@ -11248,11 +11286,11 @@ var useSelectedItemStyle = () => {
|
|
|
11248
11286
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
11249
11287
|
|
|
11250
11288
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
11251
|
-
var
|
|
11252
|
-
var SegmentedControlValueContext = (0,
|
|
11289
|
+
var import_react54 = require("react");
|
|
11290
|
+
var SegmentedControlValueContext = (0, import_react54.createContext)(null);
|
|
11253
11291
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
11254
11292
|
var useSegmentedControlValue = () => {
|
|
11255
|
-
const context = (0,
|
|
11293
|
+
const context = (0, import_react54.useContext)(SegmentedControlValueContext);
|
|
11256
11294
|
if (context === null) {
|
|
11257
11295
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
11258
11296
|
}
|
|
@@ -11298,7 +11336,7 @@ var segmentedControlStyles = import_styled_components70.css`
|
|
|
11298
11336
|
var StyledSegmentedControl = (0, import_styled_components70.default)(import_react_toggle_group.Root)`
|
|
11299
11337
|
${segmentedControlStyles}
|
|
11300
11338
|
`;
|
|
11301
|
-
var SegmentedControl = (0,
|
|
11339
|
+
var SegmentedControl = (0, import_react55.forwardRef)(
|
|
11302
11340
|
({
|
|
11303
11341
|
children,
|
|
11304
11342
|
disabled = false,
|
|
@@ -11333,7 +11371,7 @@ var SegmentedControl = (0, import_react53.forwardRef)(
|
|
|
11333
11371
|
SegmentedControl.displayName = "SegmentedControl";
|
|
11334
11372
|
|
|
11335
11373
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
11336
|
-
var
|
|
11374
|
+
var import_react56 = require("react");
|
|
11337
11375
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
11338
11376
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
11339
11377
|
var import_type_guards46 = require("@wistia/type-guards");
|
|
@@ -11401,11 +11439,11 @@ var segmentedControlItemStyles = import_styled_components71.css`
|
|
|
11401
11439
|
var StyledSegmentedControlItem = (0, import_styled_components71.default)(import_react_toggle_group2.Item)`
|
|
11402
11440
|
${segmentedControlItemStyles}
|
|
11403
11441
|
`;
|
|
11404
|
-
var SegmentedControlItem = (0,
|
|
11442
|
+
var SegmentedControlItem = (0, import_react56.forwardRef)(
|
|
11405
11443
|
({ disabled, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
11406
11444
|
const selectedValue = useSegmentedControlValue();
|
|
11407
11445
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
11408
|
-
const buttonRef = (0,
|
|
11446
|
+
const buttonRef = (0, import_react56.useRef)(null);
|
|
11409
11447
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
11410
11448
|
const handleClick = (event) => {
|
|
11411
11449
|
const target = event.target;
|
|
@@ -11414,7 +11452,7 @@ var SegmentedControlItem = (0, import_react54.forwardRef)(
|
|
|
11414
11452
|
event.preventDefault();
|
|
11415
11453
|
}
|
|
11416
11454
|
};
|
|
11417
|
-
(0,
|
|
11455
|
+
(0, import_react56.useEffect)(() => {
|
|
11418
11456
|
const buttonElem = buttonRef.current;
|
|
11419
11457
|
if (!buttonElem) {
|
|
11420
11458
|
return void 0;
|
|
@@ -11460,7 +11498,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
11460
11498
|
|
|
11461
11499
|
// src/components/Select/Select.tsx
|
|
11462
11500
|
var import_react_select = require("@radix-ui/react-select");
|
|
11463
|
-
var
|
|
11501
|
+
var import_react57 = require("react");
|
|
11464
11502
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
11465
11503
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11466
11504
|
var StyledTrigger = (0, import_styled_components72.default)(import_react_select.Trigger)`
|
|
@@ -11525,7 +11563,7 @@ var StyledContent3 = (0, import_styled_components72.default)(import_react_select
|
|
|
11525
11563
|
max-height: var(--radix-select-content-available-height);
|
|
11526
11564
|
z-index: var(--wui-zindex-select);
|
|
11527
11565
|
`;
|
|
11528
|
-
var Select = (0,
|
|
11566
|
+
var Select = (0, import_react57.forwardRef)(
|
|
11529
11567
|
({
|
|
11530
11568
|
colorScheme = "inherit",
|
|
11531
11569
|
children,
|
|
@@ -11574,7 +11612,7 @@ Select.displayName = "Select";
|
|
|
11574
11612
|
|
|
11575
11613
|
// src/components/Select/SelectOption.tsx
|
|
11576
11614
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11577
|
-
var
|
|
11615
|
+
var import_react58 = require("react");
|
|
11578
11616
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11579
11617
|
var import_type_guards47 = require("@wistia/type-guards");
|
|
11580
11618
|
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
@@ -11605,7 +11643,7 @@ var StyledItem = (0, import_styled_components73.default)(import_react_select2.It
|
|
|
11605
11643
|
var StyledIconContainer = import_styled_components73.default.span`
|
|
11606
11644
|
width: 12px;
|
|
11607
11645
|
`;
|
|
11608
|
-
var SelectOption = (0,
|
|
11646
|
+
var SelectOption = (0, import_react58.forwardRef)(
|
|
11609
11647
|
({ children, selectedDisplayValue, ...props }, forwardedRef) => {
|
|
11610
11648
|
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(
|
|
11611
11649
|
StyledItem,
|
|
@@ -11653,7 +11691,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11653
11691
|
};
|
|
11654
11692
|
|
|
11655
11693
|
// src/components/Switch/Switch.tsx
|
|
11656
|
-
var
|
|
11694
|
+
var import_react59 = require("react");
|
|
11657
11695
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11658
11696
|
var import_type_guards48 = require("@wistia/type-guards");
|
|
11659
11697
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
@@ -11758,7 +11796,7 @@ var StyledHiddenSwitchInput = import_styled_components75.default.input`
|
|
|
11758
11796
|
}
|
|
11759
11797
|
}
|
|
11760
11798
|
`;
|
|
11761
|
-
var Switch = (0,
|
|
11799
|
+
var Switch = (0, import_react59.forwardRef)(
|
|
11762
11800
|
({
|
|
11763
11801
|
checked,
|
|
11764
11802
|
disabled = false,
|
|
@@ -11773,7 +11811,7 @@ var Switch = (0, import_react57.forwardRef)(
|
|
|
11773
11811
|
hideLabel = false,
|
|
11774
11812
|
...props
|
|
11775
11813
|
}, ref) => {
|
|
11776
|
-
const generatedId = (0,
|
|
11814
|
+
const generatedId = (0, import_react59.useId)();
|
|
11777
11815
|
const computedId = (0, import_type_guards48.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11778
11816
|
return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
11779
11817
|
/* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
@@ -11822,22 +11860,29 @@ var StyledTable = import_styled_components76.default.table`
|
|
|
11822
11860
|
width: 100%;
|
|
11823
11861
|
border-collapse: collapse;
|
|
11824
11862
|
|
|
11863
|
+
${({ $divided }) => $divided && import_styled_components76.css`
|
|
11864
|
+
tr {
|
|
11865
|
+
border-bottom: 1px solid var(--wui-color-border);
|
|
11866
|
+
}
|
|
11867
|
+
`}
|
|
11868
|
+
|
|
11825
11869
|
${({ $striped }) => $striped && import_styled_components76.css`
|
|
11826
11870
|
tbody tr:nth-child(even) {
|
|
11827
11871
|
background-color: var(--wui-color-bg-surface-secondary);
|
|
11828
11872
|
}
|
|
11829
11873
|
`}
|
|
11830
11874
|
|
|
11831
|
-
${({ $
|
|
11832
|
-
|
|
11833
|
-
|
|
11875
|
+
${({ $visuallyHiddenHeader }) => $visuallyHiddenHeader && import_styled_components76.css`
|
|
11876
|
+
thead {
|
|
11877
|
+
${visuallyHiddenStyle}
|
|
11834
11878
|
}
|
|
11835
11879
|
`}
|
|
11836
11880
|
`;
|
|
11837
11881
|
var Table = ({
|
|
11838
11882
|
children,
|
|
11839
|
-
striped = false,
|
|
11840
11883
|
divided = false,
|
|
11884
|
+
striped = false,
|
|
11885
|
+
visuallyHiddenHeader = false,
|
|
11841
11886
|
...props
|
|
11842
11887
|
}) => {
|
|
11843
11888
|
return /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
@@ -11845,6 +11890,7 @@ var Table = ({
|
|
|
11845
11890
|
{
|
|
11846
11891
|
$divided: divided,
|
|
11847
11892
|
$striped: striped,
|
|
11893
|
+
$visuallyHiddenHeader: visuallyHiddenHeader,
|
|
11848
11894
|
...props,
|
|
11849
11895
|
children
|
|
11850
11896
|
}
|
|
@@ -11855,18 +11901,18 @@ var Table = ({
|
|
|
11855
11901
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
11856
11902
|
|
|
11857
11903
|
// src/components/Table/TableSectionContext.ts
|
|
11858
|
-
var
|
|
11859
|
-
var TableSectionContext = (0,
|
|
11904
|
+
var import_react60 = require("react");
|
|
11905
|
+
var TableSectionContext = (0, import_react60.createContext)(null);
|
|
11860
11906
|
|
|
11861
11907
|
// src/components/Table/TableBody.tsx
|
|
11862
11908
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
11863
|
-
var
|
|
11909
|
+
var StyledTableBody = import_styled_components77.default.tbody``;
|
|
11864
11910
|
var TableBody = ({ children, ...props }) => {
|
|
11865
|
-
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(TableSectionContext.Provider, { value: "body", children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
11911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(TableSectionContext.Provider, { value: "body", children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledTableBody, { ...props, children }) });
|
|
11866
11912
|
};
|
|
11867
11913
|
|
|
11868
11914
|
// src/components/Table/TableCell.tsx
|
|
11869
|
-
var
|
|
11915
|
+
var import_react61 = require("react");
|
|
11870
11916
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
11871
11917
|
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
11872
11918
|
var sharedStyles = import_styled_components78.css`
|
|
@@ -11887,19 +11933,19 @@ var StyledTd = import_styled_components78.default.td`
|
|
|
11887
11933
|
line-height: var(--wui-typography-body-2-line-height);
|
|
11888
11934
|
`;
|
|
11889
11935
|
var TableCell = ({ children, ...props }) => {
|
|
11890
|
-
const section = (0,
|
|
11936
|
+
const section = (0, import_react61.useContext)(TableSectionContext);
|
|
11891
11937
|
if (section === "head") {
|
|
11892
11938
|
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(StyledTh, { ...props, children });
|
|
11893
11939
|
}
|
|
11894
11940
|
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(StyledTd, { ...props, children });
|
|
11895
11941
|
};
|
|
11896
11942
|
|
|
11897
|
-
// src/components/Table/
|
|
11943
|
+
// src/components/Table/TableFoot.tsx
|
|
11898
11944
|
var import_styled_components79 = __toESM(require("styled-components"));
|
|
11899
11945
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
11900
|
-
var
|
|
11901
|
-
var
|
|
11902
|
-
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(TableSectionContext.Provider, { value: "footer", children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
11946
|
+
var StyledTableFoot = import_styled_components79.default.tfoot``;
|
|
11947
|
+
var TableFoot = ({ children, ...props }) => {
|
|
11948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(TableSectionContext.Provider, { value: "footer", children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(StyledTableFoot, { ...props, children }) });
|
|
11903
11949
|
};
|
|
11904
11950
|
|
|
11905
11951
|
// src/components/Table/TableHead.tsx
|
|
@@ -11913,13 +11959,13 @@ var TableHead = ({ children, ...props }) => {
|
|
|
11913
11959
|
// src/components/Table/TableRow.tsx
|
|
11914
11960
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
11915
11961
|
var import_jsx_runtime261 = require("react/jsx-runtime");
|
|
11916
|
-
var
|
|
11962
|
+
var StyledTableRow = import_styled_components81.default.tr``;
|
|
11917
11963
|
var TableRow = ({ children, ...props }) => {
|
|
11918
|
-
return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(
|
|
11964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(StyledTableRow, { ...props, children });
|
|
11919
11965
|
};
|
|
11920
11966
|
|
|
11921
11967
|
// src/components/Tabs/Tabs.tsx
|
|
11922
|
-
var
|
|
11968
|
+
var import_react65 = require("react");
|
|
11923
11969
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
11924
11970
|
var import_type_guards50 = require("@wistia/type-guards");
|
|
11925
11971
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
@@ -11974,17 +12020,17 @@ var TabList = ({
|
|
|
11974
12020
|
TabList.displayName = "TabList";
|
|
11975
12021
|
|
|
11976
12022
|
// src/components/Tabs/TabItem.tsx
|
|
11977
|
-
var
|
|
12023
|
+
var import_react63 = require("react");
|
|
11978
12024
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
11979
12025
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
11980
12026
|
var import_type_guards49 = require("@wistia/type-guards");
|
|
11981
12027
|
|
|
11982
12028
|
// src/components/Tabs/useTabsValue.tsx
|
|
11983
|
-
var
|
|
11984
|
-
var TabsValueContext = (0,
|
|
12029
|
+
var import_react62 = require("react");
|
|
12030
|
+
var TabsValueContext = (0, import_react62.createContext)(null);
|
|
11985
12031
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
11986
12032
|
var useTabsValue = () => {
|
|
11987
|
-
const context = (0,
|
|
12033
|
+
const context = (0, import_react62.useContext)(TabsValueContext);
|
|
11988
12034
|
if (context === null) {
|
|
11989
12035
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
11990
12036
|
}
|
|
@@ -12000,13 +12046,13 @@ var StyledTabItem = (0, import_styled_components84.default)(import_react_tabs3.T
|
|
|
12000
12046
|
outline: none;
|
|
12001
12047
|
}
|
|
12002
12048
|
`;
|
|
12003
|
-
var TabItem = (0,
|
|
12049
|
+
var TabItem = (0, import_react63.forwardRef)(
|
|
12004
12050
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value }, forwardedRef) => {
|
|
12005
12051
|
const selectedValue = useTabsValue();
|
|
12006
12052
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
12007
|
-
const buttonRef = (0,
|
|
12053
|
+
const buttonRef = (0, import_react63.useRef)(null);
|
|
12008
12054
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
12009
|
-
(0,
|
|
12055
|
+
(0, import_react63.useEffect)(() => {
|
|
12010
12056
|
const buttonElem = buttonRef.current;
|
|
12011
12057
|
if (!buttonElem) {
|
|
12012
12058
|
return void 0;
|
|
@@ -12050,16 +12096,16 @@ var TabItem = (0, import_react61.forwardRef)(
|
|
|
12050
12096
|
TabItem.displayName = "TabItem";
|
|
12051
12097
|
|
|
12052
12098
|
// src/components/Tabs/extractTabItems.ts
|
|
12053
|
-
var
|
|
12099
|
+
var import_react64 = require("react");
|
|
12054
12100
|
var extractTabItems = (children) => {
|
|
12055
12101
|
const tabItems = [];
|
|
12056
|
-
|
|
12057
|
-
if (!(0,
|
|
12102
|
+
import_react64.Children.forEach(children, (child) => {
|
|
12103
|
+
if (!(0, import_react64.isValidElement)(child)) {
|
|
12058
12104
|
return;
|
|
12059
12105
|
}
|
|
12060
12106
|
if (typeof child.type !== "string" && child.type.displayName === "Tab") {
|
|
12061
12107
|
tabItems.push(child);
|
|
12062
|
-
} else if (child.type ===
|
|
12108
|
+
} else if (child.type === import_react64.Fragment) {
|
|
12063
12109
|
const fragmentElement = child;
|
|
12064
12110
|
tabItems.push(...extractTabItems(fragmentElement.props.children));
|
|
12065
12111
|
} else if ((child.props.children ?? null) != null) {
|
|
@@ -12106,7 +12152,7 @@ var StyledTabsRoot = (0, import_styled_components86.default)(import_react_tabs4.
|
|
|
12106
12152
|
flex-direction: column;
|
|
12107
12153
|
height: ${({ $stickyHeaders }) => $stickyHeaders ? "100%" : "auto"};
|
|
12108
12154
|
`;
|
|
12109
|
-
var Tabs = (0,
|
|
12155
|
+
var Tabs = (0, import_react65.forwardRef)(
|
|
12110
12156
|
({
|
|
12111
12157
|
children,
|
|
12112
12158
|
fullWidth = true,
|
|
@@ -12118,7 +12164,7 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12118
12164
|
...props
|
|
12119
12165
|
}, ref) => {
|
|
12120
12166
|
const tabItems = extractTabItems(children);
|
|
12121
|
-
const [internalSelectedValue, setInternalSelectedValue] = (0,
|
|
12167
|
+
const [internalSelectedValue, setInternalSelectedValue] = (0, import_react65.useState)(defaultSelectedValue);
|
|
12122
12168
|
const modeProps = defaultSelectedValue !== void 0 ? {
|
|
12123
12169
|
defaultValue: defaultSelectedValue,
|
|
12124
12170
|
onValueChange: setInternalSelectedValue
|
|
@@ -12204,15 +12250,15 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12204
12250
|
Tabs.displayName = "Tabs";
|
|
12205
12251
|
|
|
12206
12252
|
// src/components/Tabs/Tab.tsx
|
|
12207
|
-
var
|
|
12253
|
+
var import_react66 = require("react");
|
|
12208
12254
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
12209
|
-
var Tab = (0,
|
|
12255
|
+
var Tab = (0, import_react66.forwardRef)(({ children }, ref) => {
|
|
12210
12256
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("div", { ref, children });
|
|
12211
12257
|
});
|
|
12212
12258
|
Tab.displayName = "Tab";
|
|
12213
12259
|
|
|
12214
12260
|
// src/components/Tag/Tag.tsx
|
|
12215
|
-
var
|
|
12261
|
+
var import_react67 = require("react");
|
|
12216
12262
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
12217
12263
|
var import_type_guards51 = require("@wistia/type-guards");
|
|
12218
12264
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
@@ -12329,7 +12375,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12329
12375
|
)
|
|
12330
12376
|
] });
|
|
12331
12377
|
};
|
|
12332
|
-
var Tag = (0,
|
|
12378
|
+
var Tag = (0, import_react67.forwardRef)(
|
|
12333
12379
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12334
12380
|
const hasIcon = (0, import_type_guards51.isNotNil)(icon);
|
|
12335
12381
|
const labelProps = (0, import_type_guards51.isNotNil)(href) && (0, import_type_guards51.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
@@ -12403,7 +12449,7 @@ var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
|
12403
12449
|
ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
12404
12450
|
|
|
12405
12451
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12406
|
-
var
|
|
12452
|
+
var import_react68 = require("react");
|
|
12407
12453
|
var import_styled_components90 = __toESM(require("styled-components"));
|
|
12408
12454
|
var import_type_guards54 = require("@wistia/type-guards");
|
|
12409
12455
|
|
|
@@ -12590,7 +12636,7 @@ var StyledThumbnail = import_styled_components90.default.div`
|
|
|
12590
12636
|
border-radius: calc(8% * (9 / 16)) / 8%;
|
|
12591
12637
|
}
|
|
12592
12638
|
`;
|
|
12593
|
-
var Thumbnail = (0,
|
|
12639
|
+
var Thumbnail = (0, import_react68.forwardRef)(
|
|
12594
12640
|
({
|
|
12595
12641
|
gradientBackground = "defaultMidOne",
|
|
12596
12642
|
thumbnailImageType = "square",
|
|
@@ -12626,7 +12672,7 @@ var Thumbnail = (0, import_react66.forwardRef)(
|
|
|
12626
12672
|
Thumbnail.displayName = "Thumbnail";
|
|
12627
12673
|
|
|
12628
12674
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
12629
|
-
var
|
|
12675
|
+
var import_react69 = __toESM(require("react"));
|
|
12630
12676
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
12631
12677
|
var import_type_guards55 = require("@wistia/type-guards");
|
|
12632
12678
|
var import_jsx_runtime271 = (
|
|
@@ -12706,10 +12752,10 @@ var ThumbnailCollage = ({
|
|
|
12706
12752
|
gradientBackground = "defaultMidOne",
|
|
12707
12753
|
...props
|
|
12708
12754
|
}) => {
|
|
12709
|
-
const thumbnailArray =
|
|
12755
|
+
const thumbnailArray = import_react69.default.Children.toArray(children);
|
|
12710
12756
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
12711
12757
|
const thumbnails = (0, import_type_guards55.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
12712
|
-
return
|
|
12758
|
+
return import_react69.default.cloneElement(child, {
|
|
12713
12759
|
...child.props,
|
|
12714
12760
|
children: void 0
|
|
12715
12761
|
});
|
|
@@ -12926,7 +12972,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
12926
12972
|
Table,
|
|
12927
12973
|
TableBody,
|
|
12928
12974
|
TableCell,
|
|
12929
|
-
|
|
12975
|
+
TableFoot,
|
|
12930
12976
|
TableHead,
|
|
12931
12977
|
TableRow,
|
|
12932
12978
|
Tabs,
|
|
@@ -12947,6 +12993,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
12947
12993
|
useActiveMq,
|
|
12948
12994
|
useAriaLive,
|
|
12949
12995
|
useBoolean,
|
|
12996
|
+
useClipboard,
|
|
12950
12997
|
useFilePicker,
|
|
12951
12998
|
useFocusTrap,
|
|
12952
12999
|
useFormState,
|