@wistia/ui 0.13.0 → 0.13.1
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 +231 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +34 -2
- package/dist/index.d.ts +34 -2
- package/dist/index.mjs +183 -90
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.13.
|
|
3
|
+
* @license @wistia/ui v0.13.1
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8793,7 +8793,7 @@ Center.displayName = "Center";
|
|
|
8793
8793
|
// src/components/Checkbox/Checkbox.tsx
|
|
8794
8794
|
import { forwardRef as forwardRef12, useId as useId2 } from "react";
|
|
8795
8795
|
import styled27, { css as css25 } from "styled-components";
|
|
8796
|
-
import { isNonEmptyString as
|
|
8796
|
+
import { isNonEmptyString as isNonEmptyString3, isNotUndefined as isNotUndefined7 } from "@wistia/type-guards";
|
|
8797
8797
|
|
|
8798
8798
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
8799
8799
|
import styled23, { css as css24 } from "styled-components";
|
|
@@ -8922,6 +8922,7 @@ import { isArray } from "@wistia/type-guards";
|
|
|
8922
8922
|
// src/components/FormGroup/FormGroup.tsx
|
|
8923
8923
|
import styled25 from "styled-components";
|
|
8924
8924
|
import { useRef as useRef7 } from "react";
|
|
8925
|
+
import { isNonEmptyString as isNonEmptyString2, isNotNil as isNotNil16 } from "@wistia/type-guards";
|
|
8925
8926
|
|
|
8926
8927
|
// src/components/Stack/Stack.tsx
|
|
8927
8928
|
import { forwardRef as forwardRef10 } from "react";
|
|
@@ -8959,12 +8960,31 @@ var Stack = makePolymorphic(StackComponent);
|
|
|
8959
8960
|
import { jsx as jsx217, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
8960
8961
|
var StyledFieldset = styled25.fieldset`
|
|
8961
8962
|
border: 0;
|
|
8963
|
+
|
|
8964
|
+
/* * {
|
|
8965
|
+
outline: 1px solid red;
|
|
8966
|
+
} */
|
|
8962
8967
|
`;
|
|
8963
8968
|
var StyledLegend = styled25.legend`
|
|
8969
|
+
padding-inline: 0;
|
|
8970
|
+
display: flex;
|
|
8971
|
+
flex-direction: column;
|
|
8972
|
+
gap: var(--wui-space-01);
|
|
8964
8973
|
margin-bottom: var(--wui-space-02);
|
|
8974
|
+
|
|
8975
|
+
&:has([data-wui-form-group-description]) {
|
|
8976
|
+
margin-bottom: var(--wui-space-01);
|
|
8977
|
+
}
|
|
8965
8978
|
`;
|
|
8966
|
-
var FormGroup = ({
|
|
8979
|
+
var FormGroup = ({
|
|
8980
|
+
children,
|
|
8981
|
+
label,
|
|
8982
|
+
description,
|
|
8983
|
+
...props
|
|
8984
|
+
}) => {
|
|
8967
8985
|
const ref = useRef7(null);
|
|
8986
|
+
const hasLabel = isNotNil16(label) && isNonEmptyString2(label);
|
|
8987
|
+
const hasDescription = isNotNil16(description) && isNonEmptyString2(description);
|
|
8968
8988
|
return /* @__PURE__ */ jsxs17(
|
|
8969
8989
|
Stack,
|
|
8970
8990
|
{
|
|
@@ -8972,14 +8992,26 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
8972
8992
|
ref,
|
|
8973
8993
|
renderAs: StyledFieldset,
|
|
8974
8994
|
children: [
|
|
8975
|
-
/* @__PURE__ */
|
|
8995
|
+
hasLabel || hasDescription ? /* @__PURE__ */ jsxs17(
|
|
8976
8996
|
Heading,
|
|
8977
8997
|
{
|
|
8978
8998
|
renderAs: StyledLegend,
|
|
8979
8999
|
variant: "heading5",
|
|
8980
|
-
children:
|
|
9000
|
+
children: [
|
|
9001
|
+
hasLabel ? label : null,
|
|
9002
|
+
hasDescription ? /* @__PURE__ */ jsx217(
|
|
9003
|
+
Text,
|
|
9004
|
+
{
|
|
9005
|
+
"data-wui-form-group-description": true,
|
|
9006
|
+
prominence: "secondary",
|
|
9007
|
+
renderAs: "span",
|
|
9008
|
+
variant: "body4",
|
|
9009
|
+
children: description
|
|
9010
|
+
}
|
|
9011
|
+
) : null
|
|
9012
|
+
]
|
|
8981
9013
|
}
|
|
8982
|
-
),
|
|
9014
|
+
) : null,
|
|
8983
9015
|
children
|
|
8984
9016
|
]
|
|
8985
9017
|
}
|
|
@@ -9250,7 +9282,7 @@ var Checkbox = forwardRef12(
|
|
|
9250
9282
|
...props
|
|
9251
9283
|
}, ref) => {
|
|
9252
9284
|
const generatedId = useId2();
|
|
9253
|
-
const computedId =
|
|
9285
|
+
const computedId = isNonEmptyString3(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
9254
9286
|
const checkboxGroupContext = useCheckboxGroup();
|
|
9255
9287
|
const contextName = checkboxGroupContext?.name;
|
|
9256
9288
|
const contextOnChange = checkboxGroupContext?.onChange;
|
|
@@ -9343,7 +9375,7 @@ ClickRegion.displayName = "ClickRegion";
|
|
|
9343
9375
|
|
|
9344
9376
|
// src/components/Collapsible/Collapsible.tsx
|
|
9345
9377
|
import { Root as CollapsibleRoot } from "@radix-ui/react-collapsible";
|
|
9346
|
-
import { isNotNil as
|
|
9378
|
+
import { isNotNil as isNotNil17 } from "@wistia/type-guards";
|
|
9347
9379
|
import styled28 from "styled-components";
|
|
9348
9380
|
import { jsx as jsx221 } from "react/jsx-runtime";
|
|
9349
9381
|
var StyledRoot = styled28(CollapsibleRoot)`
|
|
@@ -9360,7 +9392,7 @@ var Collapsible = ({
|
|
|
9360
9392
|
onOpenChange
|
|
9361
9393
|
}) => {
|
|
9362
9394
|
const controlProps = {
|
|
9363
|
-
...
|
|
9395
|
+
...isNotNil17(onOpenChange) && isNotNil17(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
9364
9396
|
};
|
|
9365
9397
|
return /* @__PURE__ */ jsx221(StyledRoot, { ...controlProps, children });
|
|
9366
9398
|
};
|
|
@@ -9461,7 +9493,7 @@ import styled32 from "styled-components";
|
|
|
9461
9493
|
// src/components/Tag/Tag.tsx
|
|
9462
9494
|
import { forwardRef as forwardRef13 } from "react";
|
|
9463
9495
|
import styled31 from "styled-components";
|
|
9464
|
-
import { isNil as isNil13, isNotNil as
|
|
9496
|
+
import { isNil as isNil13, isNotNil as isNotNil18, isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
|
|
9465
9497
|
import { Fragment as Fragment5, jsx as jsx225, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
9466
9498
|
var TagLabel = styled31.a`
|
|
9467
9499
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -9578,8 +9610,8 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
9578
9610
|
};
|
|
9579
9611
|
var Tag = forwardRef13(
|
|
9580
9612
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
9581
|
-
const hasIcon =
|
|
9582
|
-
const labelProps =
|
|
9613
|
+
const hasIcon = isNotNil18(icon);
|
|
9614
|
+
const labelProps = isNotNil18(href) && isNonEmptyString4(href) ? { href, as: "a" } : { as: "span" };
|
|
9583
9615
|
return /* @__PURE__ */ jsxs20(
|
|
9584
9616
|
StyledTag,
|
|
9585
9617
|
{
|
|
@@ -9889,7 +9921,7 @@ var Combobox2 = ({
|
|
|
9889
9921
|
// src/components/DataCards/DataCard.tsx
|
|
9890
9922
|
import { useRef as useRef10 } from "react";
|
|
9891
9923
|
import styled33, { keyframes } from "styled-components";
|
|
9892
|
-
import { isNotNil as
|
|
9924
|
+
import { isNotNil as isNotNil19, isNotNull } from "@wistia/type-guards";
|
|
9893
9925
|
import { jsx as jsx227, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9894
9926
|
var StyledDataCard = styled33.div`
|
|
9895
9927
|
display: grid;
|
|
@@ -10034,7 +10066,7 @@ var DataCardArrowIcon = /* @__PURE__ */ jsx227(
|
|
|
10034
10066
|
);
|
|
10035
10067
|
var DataCard = (props) => {
|
|
10036
10068
|
const ref = useRef10(null);
|
|
10037
|
-
if (
|
|
10069
|
+
if (isNotNil19(props.href) || isNotNil19(props.onClick)) {
|
|
10038
10070
|
return /* @__PURE__ */ jsx227(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ jsx227(
|
|
10039
10071
|
DataCardInner,
|
|
10040
10072
|
{
|
|
@@ -10044,7 +10076,7 @@ var DataCard = (props) => {
|
|
|
10044
10076
|
Button,
|
|
10045
10077
|
{
|
|
10046
10078
|
ref,
|
|
10047
|
-
...
|
|
10079
|
+
...isNotNil19(props.beforeAction) ? { beforeAction: props.beforeAction } : {},
|
|
10048
10080
|
disabled: props.disabled ?? false,
|
|
10049
10081
|
href: props.href,
|
|
10050
10082
|
onClick: props.onClick,
|
|
@@ -10333,7 +10365,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
10333
10365
|
// src/components/Input/Input.tsx
|
|
10334
10366
|
import { forwardRef as forwardRef14, cloneElement as cloneElement4, useRef as useRef11 } from "react";
|
|
10335
10367
|
import styled38, { css as css28 } from "styled-components";
|
|
10336
|
-
import { isNil as isNil14, isNotNil as
|
|
10368
|
+
import { isNil as isNil14, isNotNil as isNotNil20, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
10337
10369
|
import { jsx as jsx232, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
10338
10370
|
var inputStyles = css28`
|
|
10339
10371
|
${inputCss}
|
|
@@ -10450,27 +10482,27 @@ var Input = forwardRef14(
|
|
|
10450
10482
|
const internalRef = useRef11();
|
|
10451
10483
|
const ref = (
|
|
10452
10484
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
10453
|
-
|
|
10485
|
+
isNotNil20(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
10454
10486
|
);
|
|
10455
10487
|
let leftIconToDisplay = leftIcon;
|
|
10456
10488
|
if (isNil14(leftIcon) && type === "search") {
|
|
10457
10489
|
leftIconToDisplay = /* @__PURE__ */ jsx232(Icon, { type: "search" });
|
|
10458
10490
|
}
|
|
10459
|
-
if (
|
|
10491
|
+
if (isNotNil20(leftIconToDisplay)) {
|
|
10460
10492
|
leftIconToDisplay = cloneElement4(leftIconToDisplay, {
|
|
10461
10493
|
size: "md",
|
|
10462
10494
|
className: "wui-input-left-icon"
|
|
10463
10495
|
});
|
|
10464
10496
|
}
|
|
10465
10497
|
let rightIconToDisplay = rightIcon;
|
|
10466
|
-
if (
|
|
10498
|
+
if (isNotNil20(rightIconToDisplay)) {
|
|
10467
10499
|
rightIconToDisplay = cloneElement4(rightIconToDisplay, {
|
|
10468
10500
|
size: "md",
|
|
10469
10501
|
className: "wui-input-right-icon"
|
|
10470
10502
|
});
|
|
10471
10503
|
}
|
|
10472
10504
|
const handleFocus2 = (event) => {
|
|
10473
|
-
if (
|
|
10505
|
+
if (isNotNil20(props.onFocus)) {
|
|
10474
10506
|
props.onFocus(event);
|
|
10475
10507
|
}
|
|
10476
10508
|
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
@@ -10716,7 +10748,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10716
10748
|
// src/components/FormField/FormField.tsx
|
|
10717
10749
|
import { Children as Children6, cloneElement as cloneElement5, useContext as useContext5 } from "react";
|
|
10718
10750
|
import styled41 from "styled-components";
|
|
10719
|
-
import { isArray as isArray3, isNotNil as
|
|
10751
|
+
import { isArray as isArray3, isNotNil as isNotNil21, isNotUndefined as isNotUndefined10, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
10720
10752
|
|
|
10721
10753
|
// src/components/Label/Label.tsx
|
|
10722
10754
|
import styled40, { css as css30 } from "styled-components";
|
|
@@ -10893,8 +10925,8 @@ var FormField = ({
|
|
|
10893
10925
|
defaultValue
|
|
10894
10926
|
};
|
|
10895
10927
|
}
|
|
10896
|
-
if (
|
|
10897
|
-
const computedName =
|
|
10928
|
+
if (isNotNil21(checkboxGroup)) {
|
|
10929
|
+
const computedName = isNotNil21(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
10898
10930
|
const handleChange = (event) => {
|
|
10899
10931
|
if (isNotUndefined10(props.onChange)) {
|
|
10900
10932
|
props.onChange(event);
|
|
@@ -10907,7 +10939,7 @@ var FormField = ({
|
|
|
10907
10939
|
...childProps,
|
|
10908
10940
|
name: computedName,
|
|
10909
10941
|
onChange: handleChange,
|
|
10910
|
-
"aria-invalid":
|
|
10942
|
+
"aria-invalid": isNotNil21(error)
|
|
10911
10943
|
};
|
|
10912
10944
|
}
|
|
10913
10945
|
Children6.only(children);
|
|
@@ -10918,9 +10950,9 @@ var FormField = ({
|
|
|
10918
10950
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
10919
10951
|
children: [
|
|
10920
10952
|
!isIntegratedLabel && /* @__PURE__ */ jsx236(Label, { htmlFor: computedId, children: label }),
|
|
10921
|
-
|
|
10953
|
+
isNotNil21(description) ? /* @__PURE__ */ jsx236(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
10922
10954
|
cloneElement5(children, childProps),
|
|
10923
|
-
|
|
10955
|
+
isNotNil21(computedError) ? /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
10924
10956
|
/* @__PURE__ */ jsx236("div", {}),
|
|
10925
10957
|
/* @__PURE__ */ jsx236(
|
|
10926
10958
|
ErrorMessages,
|
|
@@ -11100,7 +11132,7 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
11100
11132
|
|
|
11101
11133
|
// src/components/KeyboardShortcut/KeyboardShortcut.tsx
|
|
11102
11134
|
import styled44 from "styled-components";
|
|
11103
|
-
import { isNotNil as
|
|
11135
|
+
import { isNotNil as isNotNil22 } from "@wistia/type-guards";
|
|
11104
11136
|
import { jsx as jsx240, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
11105
11137
|
var StyledKeyboardShortcut = styled44.div`
|
|
11106
11138
|
align-items: center;
|
|
@@ -11194,7 +11226,7 @@ var KeyboardShortcut = ({
|
|
|
11194
11226
|
$fullWidth: fullWidth,
|
|
11195
11227
|
...otherProps,
|
|
11196
11228
|
children: [
|
|
11197
|
-
|
|
11229
|
+
isNotNil22(label) && /* @__PURE__ */ jsx240(Label2, { children: label }),
|
|
11198
11230
|
/* @__PURE__ */ jsx240(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ jsx240(
|
|
11199
11231
|
StyledKey,
|
|
11200
11232
|
{
|
|
@@ -11208,7 +11240,7 @@ var KeyboardShortcut = ({
|
|
|
11208
11240
|
KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
11209
11241
|
|
|
11210
11242
|
// src/components/List/List.tsx
|
|
11211
|
-
import { isNotNil as
|
|
11243
|
+
import { isNotNil as isNotNil23 } from "@wistia/type-guards";
|
|
11212
11244
|
import styled46, { css as css32 } from "styled-components";
|
|
11213
11245
|
|
|
11214
11246
|
// src/components/List/ListItem.tsx
|
|
@@ -11349,13 +11381,13 @@ var List = ({
|
|
|
11349
11381
|
...otherProps
|
|
11350
11382
|
}) => {
|
|
11351
11383
|
const listVariant = variant ?? "bullets";
|
|
11352
|
-
if (
|
|
11384
|
+
if (isNotNil23(children)) {
|
|
11353
11385
|
if (Array.isArray(children) && !children.length) {
|
|
11354
11386
|
return null;
|
|
11355
11387
|
}
|
|
11356
11388
|
return renderListComponent(children, listVariant, otherProps);
|
|
11357
11389
|
}
|
|
11358
|
-
if (
|
|
11390
|
+
if (isNotNil23(items)) {
|
|
11359
11391
|
if (!items.length) {
|
|
11360
11392
|
return null;
|
|
11361
11393
|
}
|
|
@@ -11374,7 +11406,7 @@ import {
|
|
|
11374
11406
|
DropdownMenuPortal,
|
|
11375
11407
|
DropdownMenuContent
|
|
11376
11408
|
} from "@radix-ui/react-dropdown-menu";
|
|
11377
|
-
import { isNotNil as
|
|
11409
|
+
import { isNotNil as isNotNil24, isNotUndefined as isNotUndefined11 } from "@wistia/type-guards";
|
|
11378
11410
|
|
|
11379
11411
|
// src/components/Menu/MenuContext.tsx
|
|
11380
11412
|
import { createContext as createContext6, useContext as useContext7 } from "react";
|
|
@@ -11487,7 +11519,7 @@ var Menu = forwardRef17(
|
|
|
11487
11519
|
}, ref) => {
|
|
11488
11520
|
const contextValue = useMemo10(() => ({ compact }), [compact]);
|
|
11489
11521
|
let controlProps = {
|
|
11490
|
-
...
|
|
11522
|
+
...isNotNil24(onOpenChange) && isNotNil24(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
11491
11523
|
};
|
|
11492
11524
|
if (disabled) {
|
|
11493
11525
|
controlProps = {
|
|
@@ -11520,10 +11552,11 @@ var Menu = forwardRef17(
|
|
|
11520
11552
|
$compact: compact,
|
|
11521
11553
|
align,
|
|
11522
11554
|
collisionPadding: 8,
|
|
11523
|
-
sideOffset: 6,
|
|
11524
11555
|
onFocusOutside: (event) => {
|
|
11525
11556
|
event.preventDefault();
|
|
11526
11557
|
},
|
|
11558
|
+
side: "bottom",
|
|
11559
|
+
sideOffset: 6,
|
|
11527
11560
|
children
|
|
11528
11561
|
}
|
|
11529
11562
|
) })
|
|
@@ -11573,12 +11606,12 @@ import {
|
|
|
11573
11606
|
DropdownMenuSubTrigger,
|
|
11574
11607
|
DropdownMenuItem
|
|
11575
11608
|
} from "@radix-ui/react-dropdown-menu";
|
|
11576
|
-
import { isNotNil as
|
|
11609
|
+
import { isNotNil as isNotNil26 } from "@wistia/type-guards";
|
|
11577
11610
|
|
|
11578
11611
|
// src/components/Menu/MenuItemButton.tsx
|
|
11579
11612
|
import { forwardRef as forwardRef18 } from "react";
|
|
11580
11613
|
import styled49 from "styled-components";
|
|
11581
|
-
import { isNotNil as
|
|
11614
|
+
import { isNotNil as isNotNil25, isNotUndefined as isNotUndefined12 } from "@wistia/type-guards";
|
|
11582
11615
|
import { jsx as jsx245, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11583
11616
|
var StyledButton3 = styled49(Button)`
|
|
11584
11617
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -11686,7 +11719,7 @@ var MenuItemButton = forwardRef18(({ children, appearance, command, icon, ...pro
|
|
|
11686
11719
|
children: [
|
|
11687
11720
|
props.leftIcon ? /* @__PURE__ */ jsx245(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
11688
11721
|
/* @__PURE__ */ jsx245(StyledLabelAndDescriptionContainer, { children }),
|
|
11689
|
-
|
|
11722
|
+
isNotNil25(badge) || isNotNil25(command) ? /* @__PURE__ */ jsx245(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
11690
11723
|
props.rightIcon ? /* @__PURE__ */ jsx245(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
11691
11724
|
]
|
|
11692
11725
|
}
|
|
@@ -11758,7 +11791,7 @@ var SubMenu = ({
|
|
|
11758
11791
|
return isSmAndUp ? /* @__PURE__ */ jsxs33(DropdownMenuSub, { onOpenChange, children: [
|
|
11759
11792
|
/* @__PURE__ */ jsxs33(SubMenuTrigger, { ...props, children: [
|
|
11760
11793
|
/* @__PURE__ */ jsx247(MenuItemLabel, { children: label }),
|
|
11761
|
-
|
|
11794
|
+
isNotNil26(description) ? /* @__PURE__ */ jsx247(MenuItemDescription, { children: description }) : null
|
|
11762
11795
|
] }),
|
|
11763
11796
|
/* @__PURE__ */ jsx247(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx247(SubMenuContent, { $compact: compact, children }) })
|
|
11764
11797
|
] }) : /* @__PURE__ */ jsxs33(DropdownMenuGroup, { children: [
|
|
@@ -11858,7 +11891,7 @@ import {
|
|
|
11858
11891
|
DropdownMenuCheckboxItem,
|
|
11859
11892
|
DropdownMenuItemIndicator as DropdownMenuItemIndicator2
|
|
11860
11893
|
} from "@radix-ui/react-dropdown-menu";
|
|
11861
|
-
import { isNotNil as
|
|
11894
|
+
import { isNotNil as isNotNil27 } from "@wistia/type-guards";
|
|
11862
11895
|
import { jsx as jsx251, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
11863
11896
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
11864
11897
|
return checked ? /* @__PURE__ */ jsxs34(
|
|
@@ -11932,8 +11965,8 @@ var CheckboxMenuItem = ({
|
|
|
11932
11965
|
MenuItemButton,
|
|
11933
11966
|
{
|
|
11934
11967
|
...props,
|
|
11935
|
-
leftIcon:
|
|
11936
|
-
rightIcon:
|
|
11968
|
+
leftIcon: isNotNil27(props.icon) ? props.icon : /* @__PURE__ */ jsx251(CheckboxIndicator, { checked }),
|
|
11969
|
+
rightIcon: isNotNil27(props.icon) ? /* @__PURE__ */ jsx251(DropdownMenuItemIndicator2, { children: /* @__PURE__ */ jsx251(Icon, { type: "checkmark" }) }) : void 0
|
|
11937
11970
|
}
|
|
11938
11971
|
)
|
|
11939
11972
|
}
|
|
@@ -12047,7 +12080,7 @@ FilterMenu.displayName = "FilterMenu";
|
|
|
12047
12080
|
import { forwardRef as forwardRef22 } from "react";
|
|
12048
12081
|
import styled56 from "styled-components";
|
|
12049
12082
|
import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
|
|
12050
|
-
import { isNotNil as
|
|
12083
|
+
import { isNotNil as isNotNil29 } from "@wistia/type-guards";
|
|
12051
12084
|
|
|
12052
12085
|
// src/components/Modal/ModalHeader.tsx
|
|
12053
12086
|
import styled53 from "styled-components";
|
|
@@ -12110,7 +12143,7 @@ import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
|
12110
12143
|
|
|
12111
12144
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
12112
12145
|
import { useRef as useRef14, useEffect as useEffect12 } from "react";
|
|
12113
|
-
import { isNotNil as
|
|
12146
|
+
import { isNotNil as isNotNil28 } from "@wistia/type-guards";
|
|
12114
12147
|
var useFocusRestore = () => {
|
|
12115
12148
|
const previouslyFocusedRef = useRef14(null);
|
|
12116
12149
|
useEffect12(() => {
|
|
@@ -12118,7 +12151,7 @@ var useFocusRestore = () => {
|
|
|
12118
12151
|
}, []);
|
|
12119
12152
|
useEffect12(() => {
|
|
12120
12153
|
return () => {
|
|
12121
|
-
if (
|
|
12154
|
+
if (isNotNil28(previouslyFocusedRef.current)) {
|
|
12122
12155
|
setTimeout(() => {
|
|
12123
12156
|
previouslyFocusedRef.current?.focus();
|
|
12124
12157
|
}, 0);
|
|
@@ -12330,7 +12363,7 @@ var Modal = forwardRef22(
|
|
|
12330
12363
|
DialogRoot,
|
|
12331
12364
|
{
|
|
12332
12365
|
onOpenChange: (open2) => {
|
|
12333
|
-
if (!open2 &&
|
|
12366
|
+
if (!open2 && isNotNil29(onRequestClose)) {
|
|
12334
12367
|
onRequestClose();
|
|
12335
12368
|
}
|
|
12336
12369
|
},
|
|
@@ -12342,7 +12375,7 @@ var Modal = forwardRef22(
|
|
|
12342
12375
|
{
|
|
12343
12376
|
ref,
|
|
12344
12377
|
onOpenAutoFocus: (event) => {
|
|
12345
|
-
if (
|
|
12378
|
+
if (isNotNil29(initialFocusRef) && initialFocusRef.current) {
|
|
12346
12379
|
event.preventDefault();
|
|
12347
12380
|
requestAnimationFrame(() => {
|
|
12348
12381
|
initialFocusRef.current?.focus();
|
|
@@ -12377,9 +12410,9 @@ import { Root, Trigger as Trigger2, Portal, Content as Content2, Close } from "@
|
|
|
12377
12410
|
import styled58, { css as css36 } from "styled-components";
|
|
12378
12411
|
|
|
12379
12412
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
12380
|
-
import { isNotNil as
|
|
12413
|
+
import { isNotNil as isNotNil30 } from "@wistia/type-guards";
|
|
12381
12414
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
12382
|
-
return
|
|
12415
|
+
return isNotNil30(onOpenChange) && isNotNil30(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
12383
12416
|
};
|
|
12384
12417
|
|
|
12385
12418
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -12534,7 +12567,7 @@ Popover2.displayName = "Popover";
|
|
|
12534
12567
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
12535
12568
|
import styled59 from "styled-components";
|
|
12536
12569
|
import { Root as ProgressRoot, Indicator as ProgressIndicator } from "@radix-ui/react-progress";
|
|
12537
|
-
import { isNotNil as
|
|
12570
|
+
import { isNotNil as isNotNil31 } from "@wistia/type-guards";
|
|
12538
12571
|
import { jsx as jsx259, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
12539
12572
|
var ProgressBarWrapper = styled59.div`
|
|
12540
12573
|
--progress-bar-height: 8px;
|
|
@@ -12589,7 +12622,7 @@ var ProgressBar = ({
|
|
|
12589
12622
|
...props
|
|
12590
12623
|
}) => {
|
|
12591
12624
|
return /* @__PURE__ */ jsxs40(ProgressBarWrapper, { children: [
|
|
12592
|
-
|
|
12625
|
+
isNotNil31(labelLeft) ? /* @__PURE__ */ jsx259(ProgressBarLabel, { children: labelLeft }) : null,
|
|
12593
12626
|
/* @__PURE__ */ jsx259(
|
|
12594
12627
|
StyledProgressBar,
|
|
12595
12628
|
{
|
|
@@ -12605,7 +12638,7 @@ var ProgressBar = ({
|
|
|
12605
12638
|
)
|
|
12606
12639
|
}
|
|
12607
12640
|
),
|
|
12608
|
-
|
|
12641
|
+
isNotNil31(labelRight) ? /* @__PURE__ */ jsx259(ProgressBarLabel, { children: labelRight }) : null
|
|
12609
12642
|
] });
|
|
12610
12643
|
};
|
|
12611
12644
|
ProgressBar.displayName = "ProgressBar";
|
|
@@ -12613,7 +12646,7 @@ ProgressBar.displayName = "ProgressBar";
|
|
|
12613
12646
|
// src/components/Radio/Radio.tsx
|
|
12614
12647
|
import { forwardRef as forwardRef23, useId as useId3 } from "react";
|
|
12615
12648
|
import styled60, { css as css37 } from "styled-components";
|
|
12616
|
-
import { isNonEmptyString as
|
|
12649
|
+
import { isNonEmptyString as isNonEmptyString5, isNotUndefined as isNotUndefined13 } from "@wistia/type-guards";
|
|
12617
12650
|
import { jsx as jsx260, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
12618
12651
|
var RadioIcon = () => /* @__PURE__ */ jsx260(
|
|
12619
12652
|
"svg",
|
|
@@ -12730,7 +12763,7 @@ var Radio = forwardRef23(
|
|
|
12730
12763
|
...props
|
|
12731
12764
|
}, ref) => {
|
|
12732
12765
|
const generatedId = useId3();
|
|
12733
|
-
const computedId =
|
|
12766
|
+
const computedId = isNonEmptyString5(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
12734
12767
|
const radioGroupContext = useRadioGroup();
|
|
12735
12768
|
const contextName = radioGroupContext?.name;
|
|
12736
12769
|
const contextOnChange = radioGroupContext?.onChange;
|
|
@@ -12791,7 +12824,7 @@ import { forwardRef as forwardRef25 } from "react";
|
|
|
12791
12824
|
// src/components/RadioCard/RadioCardRoot.tsx
|
|
12792
12825
|
import { forwardRef as forwardRef24, useId as useId4 } from "react";
|
|
12793
12826
|
import styled61, { css as css38 } from "styled-components";
|
|
12794
|
-
import { isNonEmptyString as
|
|
12827
|
+
import { isNonEmptyString as isNonEmptyString6, isNotUndefined as isNotUndefined14 } from "@wistia/type-guards";
|
|
12795
12828
|
import { jsx as jsx261, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
12796
12829
|
var checkedStyles = css38`
|
|
12797
12830
|
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
@@ -12912,7 +12945,7 @@ var RadioCardRoot = forwardRef24(
|
|
|
12912
12945
|
...props
|
|
12913
12946
|
}, ref) => {
|
|
12914
12947
|
const generatedId = useId4();
|
|
12915
|
-
const computedId =
|
|
12948
|
+
const computedId = isNonEmptyString6(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
12916
12949
|
const radioGroupContext = useRadioGroup();
|
|
12917
12950
|
const contextName = radioGroupContext?.name;
|
|
12918
12951
|
const contextOnChange = radioGroupContext?.onChange;
|
|
@@ -12951,7 +12984,7 @@ RadioCardRoot.displayName = "RadioCardRoot";
|
|
|
12951
12984
|
|
|
12952
12985
|
// src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
12953
12986
|
import styled63 from "styled-components";
|
|
12954
|
-
import { isNotNil as
|
|
12987
|
+
import { isNotNil as isNotNil32 } from "@wistia/type-guards";
|
|
12955
12988
|
|
|
12956
12989
|
// src/components/RadioCard/RadioCardIndicator.tsx
|
|
12957
12990
|
import styled62 from "styled-components";
|
|
@@ -13025,17 +13058,17 @@ var RadioCardDefaultLayout = ({
|
|
|
13025
13058
|
showIndicator = true
|
|
13026
13059
|
}) => {
|
|
13027
13060
|
return /* @__PURE__ */ jsxs43(StyledCardContent, { children: [
|
|
13028
|
-
showIndicator ? /* @__PURE__ */ jsx262(StyledIndicatorContainer, { $hasIcon:
|
|
13061
|
+
showIndicator ? /* @__PURE__ */ jsx262(StyledIndicatorContainer, { $hasIcon: isNotNil32(icon), children: /* @__PURE__ */ jsx262(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" }) }) : null,
|
|
13029
13062
|
/* @__PURE__ */ jsxs43(Stack, { gap: "space-02", children: [
|
|
13030
|
-
|
|
13063
|
+
isNotNil32(icon) && /* @__PURE__ */ jsx262(StyledCardIcon, { "data-wui-radio-card-icon": true, children: icon }),
|
|
13031
13064
|
/* @__PURE__ */ jsxs43(
|
|
13032
13065
|
Stack,
|
|
13033
13066
|
{
|
|
13034
13067
|
gap: "space-01",
|
|
13035
|
-
style:
|
|
13068
|
+
style: isNotNil32(icon) ? { paddingLeft: 2 } : void 0,
|
|
13036
13069
|
children: [
|
|
13037
13070
|
/* @__PURE__ */ jsx262(Text, { variant: "label3", children: /* @__PURE__ */ jsx262("strong", { children: label }) }),
|
|
13038
|
-
|
|
13071
|
+
isNotNil32(description) && /* @__PURE__ */ jsx262(
|
|
13039
13072
|
Text,
|
|
13040
13073
|
{
|
|
13041
13074
|
prominence: "secondary",
|
|
@@ -13244,7 +13277,7 @@ SegmentedControl.displayName = "SegmentedControl";
|
|
|
13244
13277
|
import { forwardRef as forwardRef28, useEffect as useEffect13, useRef as useRef15 } from "react";
|
|
13245
13278
|
import styled66, { css as css41 } from "styled-components";
|
|
13246
13279
|
import { Item as ToggleGroupItem } from "@radix-ui/react-toggle-group";
|
|
13247
|
-
import { isNotNil as
|
|
13280
|
+
import { isNotNil as isNotNil33 } from "@wistia/type-guards";
|
|
13248
13281
|
import { jsxs as jsxs45 } from "react/jsx-runtime";
|
|
13249
13282
|
var segmentedControlItemStyles = css41`
|
|
13250
13283
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -13359,8 +13392,8 @@ var SegmentedControlItem = forwardRef28(
|
|
|
13359
13392
|
{
|
|
13360
13393
|
ref: combinedRef,
|
|
13361
13394
|
...otherProps,
|
|
13362
|
-
$hasLabel:
|
|
13363
|
-
"aria-label":
|
|
13395
|
+
$hasLabel: isNotNil33(label),
|
|
13396
|
+
"aria-label": isNotNil33(label) ? void 0 : ariaLabel,
|
|
13364
13397
|
disabled,
|
|
13365
13398
|
onClick: handleClick,
|
|
13366
13399
|
value,
|
|
@@ -13501,7 +13534,7 @@ Select.displayName = "Select";
|
|
|
13501
13534
|
import { Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
|
|
13502
13535
|
import { forwardRef as forwardRef30 } from "react";
|
|
13503
13536
|
import styled68 from "styled-components";
|
|
13504
|
-
import { isNotNil as
|
|
13537
|
+
import { isNotNil as isNotNil34 } from "@wistia/type-guards";
|
|
13505
13538
|
import { jsx as jsx269, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
13506
13539
|
var StyledItem = styled68(Item)`
|
|
13507
13540
|
${variantStyleMap2.body3};
|
|
@@ -13545,7 +13578,7 @@ var SelectOption = forwardRef30(
|
|
|
13545
13578
|
type: "checkmark"
|
|
13546
13579
|
}
|
|
13547
13580
|
) }) }),
|
|
13548
|
-
|
|
13581
|
+
isNotNil34(selectedDisplayValue) ? /* @__PURE__ */ jsxs47("div", { children: [
|
|
13549
13582
|
children,
|
|
13550
13583
|
/* @__PURE__ */ jsx269("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx269(ItemText, { children: selectedDisplayValue }) })
|
|
13551
13584
|
] }) : /* @__PURE__ */ jsx269(ItemText, { children })
|
|
@@ -13585,7 +13618,7 @@ import {
|
|
|
13585
13618
|
Thumb as RadixSliderThumb
|
|
13586
13619
|
} from "@radix-ui/react-slider";
|
|
13587
13620
|
import styled70 from "styled-components";
|
|
13588
|
-
import { isNonEmptyString as
|
|
13621
|
+
import { isNonEmptyString as isNonEmptyString7 } from "@wistia/type-guards";
|
|
13589
13622
|
import { jsx as jsx271, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
13590
13623
|
var SliderContainer = styled70.div`
|
|
13591
13624
|
--wui-slider-track-color: var(--wui-gray-6);
|
|
@@ -13664,7 +13697,7 @@ var Slider = ({
|
|
|
13664
13697
|
"data-testid": dataTestId = "ui-slider",
|
|
13665
13698
|
...otherProps
|
|
13666
13699
|
}) => {
|
|
13667
|
-
if (!(
|
|
13700
|
+
if (!(isNonEmptyString7(ariaLabel) || isNonEmptyString7(ariaLabelledby))) {
|
|
13668
13701
|
throw new Error(
|
|
13669
13702
|
"UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
|
|
13670
13703
|
);
|
|
@@ -13712,7 +13745,7 @@ Slider.displayName = "Slider";
|
|
|
13712
13745
|
// src/components/Switch/Switch.tsx
|
|
13713
13746
|
import { forwardRef as forwardRef31, useId as useId5 } from "react";
|
|
13714
13747
|
import styled71, { css as css42 } from "styled-components";
|
|
13715
|
-
import { isNonEmptyString as
|
|
13748
|
+
import { isNonEmptyString as isNonEmptyString8 } from "@wistia/type-guards";
|
|
13716
13749
|
import { jsx as jsx272, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
13717
13750
|
var sizeSmall3 = css42`
|
|
13718
13751
|
--wui-size-small-width: 24px;
|
|
@@ -13832,7 +13865,7 @@ var Switch = forwardRef31(
|
|
|
13832
13865
|
...props
|
|
13833
13866
|
}, ref) => {
|
|
13834
13867
|
const generatedId = useId5();
|
|
13835
|
-
const computedId =
|
|
13868
|
+
const computedId = isNonEmptyString8(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
13836
13869
|
return /* @__PURE__ */ jsxs50(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
13837
13870
|
/* @__PURE__ */ jsx272(
|
|
13838
13871
|
StyledHiddenSwitchInput,
|
|
@@ -13988,7 +14021,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
13988
14021
|
// src/components/Tabs/Tabs.tsx
|
|
13989
14022
|
import { Root as RadixTabsRoot } from "@radix-ui/react-tabs";
|
|
13990
14023
|
import { useCallback as useCallback10, useState as useState18 } from "react";
|
|
13991
|
-
import { isNotNil as
|
|
14024
|
+
import { isNotNil as isNotNil35 } from "@wistia/type-guards";
|
|
13992
14025
|
|
|
13993
14026
|
// src/components/Tabs/useTabsValue.tsx
|
|
13994
14027
|
import { createContext as createContext10, useContext as useContext11 } from "react";
|
|
@@ -14025,10 +14058,10 @@ var Tabs = ({
|
|
|
14025
14058
|
...props,
|
|
14026
14059
|
onValueChange
|
|
14027
14060
|
};
|
|
14028
|
-
if (
|
|
14061
|
+
if (isNotNil35(value)) {
|
|
14029
14062
|
rootProps.value = value;
|
|
14030
14063
|
}
|
|
14031
|
-
if (
|
|
14064
|
+
if (isNotNil35(defaultValue)) {
|
|
14032
14065
|
rootProps.defaultValue = defaultValue;
|
|
14033
14066
|
}
|
|
14034
14067
|
return /* @__PURE__ */ jsx279(RadixTabsRoot, { ...rootProps, children: /* @__PURE__ */ jsx279(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ jsx279(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -14097,7 +14130,7 @@ TabsList.displayName = "TabsList";
|
|
|
14097
14130
|
|
|
14098
14131
|
// src/components/Tabs/TabsTrigger.tsx
|
|
14099
14132
|
import { forwardRef as forwardRef32, useEffect as useEffect14, useRef as useRef16 } from "react";
|
|
14100
|
-
import { isNotNil as
|
|
14133
|
+
import { isNotNil as isNotNil36 } from "@wistia/type-guards";
|
|
14101
14134
|
|
|
14102
14135
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
14103
14136
|
import styled80 from "styled-components";
|
|
@@ -14148,8 +14181,8 @@ var TabsTrigger = forwardRef32(
|
|
|
14148
14181
|
{
|
|
14149
14182
|
...otherProps,
|
|
14150
14183
|
ref: combinedRef,
|
|
14151
|
-
$hasLabel:
|
|
14152
|
-
"aria-label":
|
|
14184
|
+
$hasLabel: isNotNil36(label),
|
|
14185
|
+
"aria-label": isNotNil36(label) ? void 0 : ariaLabel,
|
|
14153
14186
|
disabled,
|
|
14154
14187
|
value,
|
|
14155
14188
|
children: [
|
|
@@ -14164,7 +14197,7 @@ TabsTrigger.displayName = "TabsTrigger";
|
|
|
14164
14197
|
|
|
14165
14198
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
14166
14199
|
import styled81 from "styled-components";
|
|
14167
|
-
import { isNotNil as
|
|
14200
|
+
import { isNotNil as isNotNil37 } from "@wistia/type-guards";
|
|
14168
14201
|
import { jsx as jsx283, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
14169
14202
|
var StyledThumbnailBadge = styled81.div`
|
|
14170
14203
|
align-items: center;
|
|
@@ -14192,7 +14225,7 @@ var StyledThumbnailBadge = styled81.div`
|
|
|
14192
14225
|
`;
|
|
14193
14226
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
14194
14227
|
return /* @__PURE__ */ jsxs53(StyledThumbnailBadge, { ...props, children: [
|
|
14195
|
-
|
|
14228
|
+
isNotNil37(icon) && icon,
|
|
14196
14229
|
/* @__PURE__ */ jsx283("span", { children: label })
|
|
14197
14230
|
] });
|
|
14198
14231
|
};
|
|
@@ -14201,10 +14234,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
|
14201
14234
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
14202
14235
|
import { forwardRef as forwardRef33, useState as useState19, useRef as useRef17, useCallback as useCallback11, useMemo as useMemo12 } from "react";
|
|
14203
14236
|
import styled83 from "styled-components";
|
|
14204
|
-
import { isNil as isNil17, isNotNil as
|
|
14237
|
+
import { isNil as isNil17, isNotNil as isNotNil40, isUndefined as isUndefined7, isEmptyString as isEmptyString2, isString as isString2 } from "@wistia/type-guards";
|
|
14205
14238
|
|
|
14206
14239
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
14207
|
-
import { isNotNil as
|
|
14240
|
+
import { isNotNil as isNotNil38 } from "@wistia/type-guards";
|
|
14208
14241
|
import { css as css45 } from "styled-components";
|
|
14209
14242
|
var gradients = {
|
|
14210
14243
|
defaultDarkOne: css45`
|
|
@@ -14332,12 +14365,12 @@ var gradients = {
|
|
|
14332
14365
|
};
|
|
14333
14366
|
var gradientMap = Object.keys(gradients);
|
|
14334
14367
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
14335
|
-
return
|
|
14368
|
+
return isNotNil38(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
14336
14369
|
};
|
|
14337
14370
|
|
|
14338
14371
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
14339
14372
|
import styled82 from "styled-components";
|
|
14340
|
-
import { isNotNil as
|
|
14373
|
+
import { isNotNil as isNotNil39 } from "@wistia/type-guards";
|
|
14341
14374
|
import { jsx as jsx284, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
14342
14375
|
var ScrubLine = styled82.div`
|
|
14343
14376
|
position: absolute;
|
|
@@ -14423,8 +14456,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
14423
14456
|
);
|
|
14424
14457
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
14425
14458
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
14426
|
-
const showScrubLine =
|
|
14427
|
-
const scrubLinePosition =
|
|
14459
|
+
const showScrubLine = isNotNil39(cursorPosition);
|
|
14460
|
+
const scrubLinePosition = isNotNil39(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
14428
14461
|
const viewerStyles = {
|
|
14429
14462
|
position: "relative",
|
|
14430
14463
|
overflow: "hidden",
|
|
@@ -14495,7 +14528,7 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
14495
14528
|
);
|
|
14496
14529
|
};
|
|
14497
14530
|
var StyledThumbnail = styled83.div`
|
|
14498
|
-
background-image: ${({ $backgroundUrl }) =>
|
|
14531
|
+
background-image: ${({ $backgroundUrl }) => isNotNil40($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
14499
14532
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
14500
14533
|
// if we don't have $backgroundUrl show a gradient
|
|
14501
14534
|
isNil17($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
@@ -14540,10 +14573,10 @@ var Thumbnail = forwardRef33(
|
|
|
14540
14573
|
const storyboardElementRef = useRef17(null);
|
|
14541
14574
|
const [cursorPosition, setCursorPosition] = useState19(null);
|
|
14542
14575
|
const backgroundUrl = useMemo12(
|
|
14543
|
-
() => thumbnailImageType === "square" &&
|
|
14576
|
+
() => thumbnailImageType === "square" && isNotNil40(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
14544
14577
|
[thumbnailImageType, thumbnailUrl]
|
|
14545
14578
|
);
|
|
14546
|
-
const isScrubbable =
|
|
14579
|
+
const isScrubbable = isNotNil40(storyboard);
|
|
14547
14580
|
const trackStoryboardLoadStatus = useCallback11(() => {
|
|
14548
14581
|
if (storyboardElementRef.current || !storyboard) {
|
|
14549
14582
|
return storyboardElementRef.current;
|
|
@@ -14607,7 +14640,7 @@ var Thumbnail = forwardRef33(
|
|
|
14607
14640
|
let thumbnailContent = null;
|
|
14608
14641
|
if (shouldRenderStoryboard) {
|
|
14609
14642
|
thumbnailContent = renderStoryboard();
|
|
14610
|
-
} else if (
|
|
14643
|
+
} else if (isNotNil40(thumbnailUrl)) {
|
|
14611
14644
|
thumbnailContent = /* @__PURE__ */ jsx285(
|
|
14612
14645
|
ThumbnailImage,
|
|
14613
14646
|
{
|
|
@@ -14632,7 +14665,7 @@ var Thumbnail = forwardRef33(
|
|
|
14632
14665
|
onMouseOut: handleMouseOut,
|
|
14633
14666
|
role: "presentation",
|
|
14634
14667
|
children: [
|
|
14635
|
-
|
|
14668
|
+
isNotNil40(children) ? children : null,
|
|
14636
14669
|
thumbnailContent
|
|
14637
14670
|
]
|
|
14638
14671
|
}
|
|
@@ -14750,7 +14783,7 @@ var ThumbnailCollage = ({
|
|
|
14750
14783
|
|
|
14751
14784
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
14752
14785
|
import styled85, { css as css46 } from "styled-components";
|
|
14753
|
-
import { isNotNil as
|
|
14786
|
+
import { isNotNil as isNotNil41 } from "@wistia/type-guards";
|
|
14754
14787
|
import { jsx as jsx287, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
14755
14788
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
14756
14789
|
if (iconOnly) {
|
|
@@ -14863,7 +14896,7 @@ var WistiaLogo = ({
|
|
|
14863
14896
|
...props,
|
|
14864
14897
|
children: [
|
|
14865
14898
|
/* @__PURE__ */ jsx287("title", { children: title }),
|
|
14866
|
-
|
|
14899
|
+
isNotNil41(description) ? /* @__PURE__ */ jsx287("desc", { children: description }) : null,
|
|
14867
14900
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
14868
14901
|
renderLogotype(logotypeColor, iconOnly)
|
|
14869
14902
|
]
|
|
@@ -14919,6 +14952,65 @@ var InputPassword = forwardRef34(
|
|
|
14919
14952
|
}
|
|
14920
14953
|
);
|
|
14921
14954
|
InputPassword.displayName = "InputPassword";
|
|
14955
|
+
|
|
14956
|
+
// src/components/ContextMenu/ContextMenu.tsx
|
|
14957
|
+
import { useEffect as useEffect15, useState as useState21 } from "react";
|
|
14958
|
+
import { isNil as isNil18, isNotNil as isNotNil42 } from "@wistia/type-guards";
|
|
14959
|
+
import { jsx as jsx289 } from "react/jsx-runtime";
|
|
14960
|
+
var ContextMenu = ({
|
|
14961
|
+
position,
|
|
14962
|
+
triggerRef,
|
|
14963
|
+
children,
|
|
14964
|
+
onRequestClose = () => null
|
|
14965
|
+
}) => {
|
|
14966
|
+
const [isRightClicked, setIsRightClicked] = useState21(false);
|
|
14967
|
+
const [menuPosition, setMenuPosition] = useState21(position ?? { x: 0, y: 0 });
|
|
14968
|
+
useEffect15(() => {
|
|
14969
|
+
if (isNil18(position)) {
|
|
14970
|
+
const onContextMenu = (event) => {
|
|
14971
|
+
event.preventDefault();
|
|
14972
|
+
setMenuPosition({ x: event.clientX, y: event.clientY });
|
|
14973
|
+
setIsRightClicked(true);
|
|
14974
|
+
};
|
|
14975
|
+
const triggerEl = triggerRef?.current;
|
|
14976
|
+
triggerEl?.addEventListener("contextmenu", onContextMenu);
|
|
14977
|
+
return () => {
|
|
14978
|
+
triggerEl?.removeEventListener("contextmenu", onContextMenu);
|
|
14979
|
+
};
|
|
14980
|
+
}
|
|
14981
|
+
return () => null;
|
|
14982
|
+
}, [position, triggerRef]);
|
|
14983
|
+
const isOpen = isNotNil42(position) || isRightClicked;
|
|
14984
|
+
return isOpen ? /* @__PURE__ */ jsx289(
|
|
14985
|
+
Menu,
|
|
14986
|
+
{
|
|
14987
|
+
avoidCollisions: false,
|
|
14988
|
+
isOpen,
|
|
14989
|
+
onOpenChange: (next) => {
|
|
14990
|
+
setIsRightClicked(next);
|
|
14991
|
+
if (!next) {
|
|
14992
|
+
onRequestClose();
|
|
14993
|
+
}
|
|
14994
|
+
},
|
|
14995
|
+
trigger: /* @__PURE__ */ jsx289(
|
|
14996
|
+
"button",
|
|
14997
|
+
{
|
|
14998
|
+
"aria-label": "context menu",
|
|
14999
|
+
style: {
|
|
15000
|
+
width: "1px",
|
|
15001
|
+
height: "1px",
|
|
15002
|
+
all: "unset",
|
|
15003
|
+
position: "fixed",
|
|
15004
|
+
top: menuPosition.y,
|
|
15005
|
+
left: menuPosition.x
|
|
15006
|
+
},
|
|
15007
|
+
type: "button"
|
|
15008
|
+
}
|
|
15009
|
+
),
|
|
15010
|
+
children
|
|
15011
|
+
}
|
|
15012
|
+
) : null;
|
|
15013
|
+
};
|
|
14922
15014
|
export {
|
|
14923
15015
|
ActionButton,
|
|
14924
15016
|
Avatar,
|
|
@@ -14942,6 +15034,7 @@ export {
|
|
|
14942
15034
|
ColorSchemeWrapper,
|
|
14943
15035
|
Combobox2 as Combobox,
|
|
14944
15036
|
ComboboxOption,
|
|
15037
|
+
ContextMenu,
|
|
14945
15038
|
DataCard,
|
|
14946
15039
|
DataCardTrend,
|
|
14947
15040
|
DataCards,
|