@wistia/ui 0.13.0 → 0.13.1-beta.dfa62396.22fa8d9
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 +240 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +95 -59
- package/dist/index.d.ts +95 -59
- package/dist/index.mjs +192 -95
- 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-beta.dfa62396.22fa8d9
|
|
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) {
|
|
@@ -10518,11 +10550,13 @@ var StyledInput = styled39(Input)`
|
|
|
10518
10550
|
}
|
|
10519
10551
|
|
|
10520
10552
|
&& {
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
--wui-input-
|
|
10553
|
+
${({ $variant }) => variantStyleMap[$variant]}
|
|
10554
|
+
/* The input font styles (edit mode) needs the same font styles as Heading */
|
|
10555
|
+
--wui-input-font-size: var(--font-size);
|
|
10556
|
+
--wui-input-font-weight: var(--font-weight);
|
|
10557
|
+
--wui-input-line-height: var(--line-height);
|
|
10524
10558
|
|
|
10525
|
-
font-family: var(--
|
|
10559
|
+
font-family: var(--font-family);
|
|
10526
10560
|
width: 100%;
|
|
10527
10561
|
padding: var(--wui-space-02);
|
|
10528
10562
|
border: none;
|
|
@@ -10554,6 +10588,7 @@ var EditableHeading = ({
|
|
|
10554
10588
|
onEditingChange,
|
|
10555
10589
|
tooltipText = "Click to edit title",
|
|
10556
10590
|
ariaLabel = "Edit title",
|
|
10591
|
+
variant = "heading1",
|
|
10557
10592
|
__forceEditing = false,
|
|
10558
10593
|
editingDisabled = false
|
|
10559
10594
|
}) => {
|
|
@@ -10600,7 +10635,7 @@ var EditableHeading = ({
|
|
|
10600
10635
|
ref: headingRef,
|
|
10601
10636
|
$editingDisabled: editingDisabled,
|
|
10602
10637
|
onClick: () => handleSetEditing(true),
|
|
10603
|
-
variant
|
|
10638
|
+
variant,
|
|
10604
10639
|
children: value
|
|
10605
10640
|
}
|
|
10606
10641
|
);
|
|
@@ -10612,6 +10647,7 @@ var EditableHeading = ({
|
|
|
10612
10647
|
StyledInput,
|
|
10613
10648
|
{
|
|
10614
10649
|
$height: headingHeight,
|
|
10650
|
+
$variant: variant,
|
|
10615
10651
|
autoFocus: true,
|
|
10616
10652
|
fullWidth: true,
|
|
10617
10653
|
onBlur: handleFinishEditing,
|
|
@@ -10716,7 +10752,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10716
10752
|
// src/components/FormField/FormField.tsx
|
|
10717
10753
|
import { Children as Children6, cloneElement as cloneElement5, useContext as useContext5 } from "react";
|
|
10718
10754
|
import styled41 from "styled-components";
|
|
10719
|
-
import { isArray as isArray3, isNotNil as
|
|
10755
|
+
import { isArray as isArray3, isNotNil as isNotNil21, isNotUndefined as isNotUndefined10, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
10720
10756
|
|
|
10721
10757
|
// src/components/Label/Label.tsx
|
|
10722
10758
|
import styled40, { css as css30 } from "styled-components";
|
|
@@ -10893,8 +10929,8 @@ var FormField = ({
|
|
|
10893
10929
|
defaultValue
|
|
10894
10930
|
};
|
|
10895
10931
|
}
|
|
10896
|
-
if (
|
|
10897
|
-
const computedName =
|
|
10932
|
+
if (isNotNil21(checkboxGroup)) {
|
|
10933
|
+
const computedName = isNotNil21(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
10898
10934
|
const handleChange = (event) => {
|
|
10899
10935
|
if (isNotUndefined10(props.onChange)) {
|
|
10900
10936
|
props.onChange(event);
|
|
@@ -10907,7 +10943,7 @@ var FormField = ({
|
|
|
10907
10943
|
...childProps,
|
|
10908
10944
|
name: computedName,
|
|
10909
10945
|
onChange: handleChange,
|
|
10910
|
-
"aria-invalid":
|
|
10946
|
+
"aria-invalid": isNotNil21(error)
|
|
10911
10947
|
};
|
|
10912
10948
|
}
|
|
10913
10949
|
Children6.only(children);
|
|
@@ -10918,9 +10954,9 @@ var FormField = ({
|
|
|
10918
10954
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
10919
10955
|
children: [
|
|
10920
10956
|
!isIntegratedLabel && /* @__PURE__ */ jsx236(Label, { htmlFor: computedId, children: label }),
|
|
10921
|
-
|
|
10957
|
+
isNotNil21(description) ? /* @__PURE__ */ jsx236(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
10922
10958
|
cloneElement5(children, childProps),
|
|
10923
|
-
|
|
10959
|
+
isNotNil21(computedError) ? /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
10924
10960
|
/* @__PURE__ */ jsx236("div", {}),
|
|
10925
10961
|
/* @__PURE__ */ jsx236(
|
|
10926
10962
|
ErrorMessages,
|
|
@@ -11100,7 +11136,7 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
11100
11136
|
|
|
11101
11137
|
// src/components/KeyboardShortcut/KeyboardShortcut.tsx
|
|
11102
11138
|
import styled44 from "styled-components";
|
|
11103
|
-
import { isNotNil as
|
|
11139
|
+
import { isNotNil as isNotNil22 } from "@wistia/type-guards";
|
|
11104
11140
|
import { jsx as jsx240, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
11105
11141
|
var StyledKeyboardShortcut = styled44.div`
|
|
11106
11142
|
align-items: center;
|
|
@@ -11194,7 +11230,7 @@ var KeyboardShortcut = ({
|
|
|
11194
11230
|
$fullWidth: fullWidth,
|
|
11195
11231
|
...otherProps,
|
|
11196
11232
|
children: [
|
|
11197
|
-
|
|
11233
|
+
isNotNil22(label) && /* @__PURE__ */ jsx240(Label2, { children: label }),
|
|
11198
11234
|
/* @__PURE__ */ jsx240(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ jsx240(
|
|
11199
11235
|
StyledKey,
|
|
11200
11236
|
{
|
|
@@ -11208,7 +11244,7 @@ var KeyboardShortcut = ({
|
|
|
11208
11244
|
KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
11209
11245
|
|
|
11210
11246
|
// src/components/List/List.tsx
|
|
11211
|
-
import { isNotNil as
|
|
11247
|
+
import { isNotNil as isNotNil23 } from "@wistia/type-guards";
|
|
11212
11248
|
import styled46, { css as css32 } from "styled-components";
|
|
11213
11249
|
|
|
11214
11250
|
// src/components/List/ListItem.tsx
|
|
@@ -11349,13 +11385,13 @@ var List = ({
|
|
|
11349
11385
|
...otherProps
|
|
11350
11386
|
}) => {
|
|
11351
11387
|
const listVariant = variant ?? "bullets";
|
|
11352
|
-
if (
|
|
11388
|
+
if (isNotNil23(children)) {
|
|
11353
11389
|
if (Array.isArray(children) && !children.length) {
|
|
11354
11390
|
return null;
|
|
11355
11391
|
}
|
|
11356
11392
|
return renderListComponent(children, listVariant, otherProps);
|
|
11357
11393
|
}
|
|
11358
|
-
if (
|
|
11394
|
+
if (isNotNil23(items)) {
|
|
11359
11395
|
if (!items.length) {
|
|
11360
11396
|
return null;
|
|
11361
11397
|
}
|
|
@@ -11374,7 +11410,7 @@ import {
|
|
|
11374
11410
|
DropdownMenuPortal,
|
|
11375
11411
|
DropdownMenuContent
|
|
11376
11412
|
} from "@radix-ui/react-dropdown-menu";
|
|
11377
|
-
import { isNotNil as
|
|
11413
|
+
import { isNotNil as isNotNil24, isNotUndefined as isNotUndefined11 } from "@wistia/type-guards";
|
|
11378
11414
|
|
|
11379
11415
|
// src/components/Menu/MenuContext.tsx
|
|
11380
11416
|
import { createContext as createContext6, useContext as useContext7 } from "react";
|
|
@@ -11487,7 +11523,7 @@ var Menu = forwardRef17(
|
|
|
11487
11523
|
}, ref) => {
|
|
11488
11524
|
const contextValue = useMemo10(() => ({ compact }), [compact]);
|
|
11489
11525
|
let controlProps = {
|
|
11490
|
-
...
|
|
11526
|
+
...isNotNil24(onOpenChange) && isNotNil24(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
11491
11527
|
};
|
|
11492
11528
|
if (disabled) {
|
|
11493
11529
|
controlProps = {
|
|
@@ -11520,10 +11556,11 @@ var Menu = forwardRef17(
|
|
|
11520
11556
|
$compact: compact,
|
|
11521
11557
|
align,
|
|
11522
11558
|
collisionPadding: 8,
|
|
11523
|
-
sideOffset: 6,
|
|
11524
11559
|
onFocusOutside: (event) => {
|
|
11525
11560
|
event.preventDefault();
|
|
11526
11561
|
},
|
|
11562
|
+
side: "bottom",
|
|
11563
|
+
sideOffset: 6,
|
|
11527
11564
|
children
|
|
11528
11565
|
}
|
|
11529
11566
|
) })
|
|
@@ -11573,12 +11610,12 @@ import {
|
|
|
11573
11610
|
DropdownMenuSubTrigger,
|
|
11574
11611
|
DropdownMenuItem
|
|
11575
11612
|
} from "@radix-ui/react-dropdown-menu";
|
|
11576
|
-
import { isNotNil as
|
|
11613
|
+
import { isNotNil as isNotNil26 } from "@wistia/type-guards";
|
|
11577
11614
|
|
|
11578
11615
|
// src/components/Menu/MenuItemButton.tsx
|
|
11579
11616
|
import { forwardRef as forwardRef18 } from "react";
|
|
11580
11617
|
import styled49 from "styled-components";
|
|
11581
|
-
import { isNotNil as
|
|
11618
|
+
import { isNotNil as isNotNil25, isNotUndefined as isNotUndefined12 } from "@wistia/type-guards";
|
|
11582
11619
|
import { jsx as jsx245, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11583
11620
|
var StyledButton3 = styled49(Button)`
|
|
11584
11621
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -11686,7 +11723,7 @@ var MenuItemButton = forwardRef18(({ children, appearance, command, icon, ...pro
|
|
|
11686
11723
|
children: [
|
|
11687
11724
|
props.leftIcon ? /* @__PURE__ */ jsx245(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
11688
11725
|
/* @__PURE__ */ jsx245(StyledLabelAndDescriptionContainer, { children }),
|
|
11689
|
-
|
|
11726
|
+
isNotNil25(badge) || isNotNil25(command) ? /* @__PURE__ */ jsx245(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
11690
11727
|
props.rightIcon ? /* @__PURE__ */ jsx245(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
11691
11728
|
]
|
|
11692
11729
|
}
|
|
@@ -11758,7 +11795,7 @@ var SubMenu = ({
|
|
|
11758
11795
|
return isSmAndUp ? /* @__PURE__ */ jsxs33(DropdownMenuSub, { onOpenChange, children: [
|
|
11759
11796
|
/* @__PURE__ */ jsxs33(SubMenuTrigger, { ...props, children: [
|
|
11760
11797
|
/* @__PURE__ */ jsx247(MenuItemLabel, { children: label }),
|
|
11761
|
-
|
|
11798
|
+
isNotNil26(description) ? /* @__PURE__ */ jsx247(MenuItemDescription, { children: description }) : null
|
|
11762
11799
|
] }),
|
|
11763
11800
|
/* @__PURE__ */ jsx247(DropdownMenuPortal2, { children: /* @__PURE__ */ jsx247(SubMenuContent, { $compact: compact, children }) })
|
|
11764
11801
|
] }) : /* @__PURE__ */ jsxs33(DropdownMenuGroup, { children: [
|
|
@@ -11858,7 +11895,7 @@ import {
|
|
|
11858
11895
|
DropdownMenuCheckboxItem,
|
|
11859
11896
|
DropdownMenuItemIndicator as DropdownMenuItemIndicator2
|
|
11860
11897
|
} from "@radix-ui/react-dropdown-menu";
|
|
11861
|
-
import { isNotNil as
|
|
11898
|
+
import { isNotNil as isNotNil27 } from "@wistia/type-guards";
|
|
11862
11899
|
import { jsx as jsx251, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
11863
11900
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
11864
11901
|
return checked ? /* @__PURE__ */ jsxs34(
|
|
@@ -11932,8 +11969,8 @@ var CheckboxMenuItem = ({
|
|
|
11932
11969
|
MenuItemButton,
|
|
11933
11970
|
{
|
|
11934
11971
|
...props,
|
|
11935
|
-
leftIcon:
|
|
11936
|
-
rightIcon:
|
|
11972
|
+
leftIcon: isNotNil27(props.icon) ? props.icon : /* @__PURE__ */ jsx251(CheckboxIndicator, { checked }),
|
|
11973
|
+
rightIcon: isNotNil27(props.icon) ? /* @__PURE__ */ jsx251(DropdownMenuItemIndicator2, { children: /* @__PURE__ */ jsx251(Icon, { type: "checkmark" }) }) : void 0
|
|
11937
11974
|
}
|
|
11938
11975
|
)
|
|
11939
11976
|
}
|
|
@@ -12047,7 +12084,7 @@ FilterMenu.displayName = "FilterMenu";
|
|
|
12047
12084
|
import { forwardRef as forwardRef22 } from "react";
|
|
12048
12085
|
import styled56 from "styled-components";
|
|
12049
12086
|
import { Root as DialogRoot, Portal as DialogPortal } from "@radix-ui/react-dialog";
|
|
12050
|
-
import { isNotNil as
|
|
12087
|
+
import { isNotNil as isNotNil29 } from "@wistia/type-guards";
|
|
12051
12088
|
|
|
12052
12089
|
// src/components/Modal/ModalHeader.tsx
|
|
12053
12090
|
import styled53 from "styled-components";
|
|
@@ -12110,7 +12147,7 @@ import { Content as DialogContent } from "@radix-ui/react-dialog";
|
|
|
12110
12147
|
|
|
12111
12148
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
12112
12149
|
import { useRef as useRef14, useEffect as useEffect12 } from "react";
|
|
12113
|
-
import { isNotNil as
|
|
12150
|
+
import { isNotNil as isNotNil28 } from "@wistia/type-guards";
|
|
12114
12151
|
var useFocusRestore = () => {
|
|
12115
12152
|
const previouslyFocusedRef = useRef14(null);
|
|
12116
12153
|
useEffect12(() => {
|
|
@@ -12118,7 +12155,7 @@ var useFocusRestore = () => {
|
|
|
12118
12155
|
}, []);
|
|
12119
12156
|
useEffect12(() => {
|
|
12120
12157
|
return () => {
|
|
12121
|
-
if (
|
|
12158
|
+
if (isNotNil28(previouslyFocusedRef.current)) {
|
|
12122
12159
|
setTimeout(() => {
|
|
12123
12160
|
previouslyFocusedRef.current?.focus();
|
|
12124
12161
|
}, 0);
|
|
@@ -12330,7 +12367,7 @@ var Modal = forwardRef22(
|
|
|
12330
12367
|
DialogRoot,
|
|
12331
12368
|
{
|
|
12332
12369
|
onOpenChange: (open2) => {
|
|
12333
|
-
if (!open2 &&
|
|
12370
|
+
if (!open2 && isNotNil29(onRequestClose)) {
|
|
12334
12371
|
onRequestClose();
|
|
12335
12372
|
}
|
|
12336
12373
|
},
|
|
@@ -12342,7 +12379,7 @@ var Modal = forwardRef22(
|
|
|
12342
12379
|
{
|
|
12343
12380
|
ref,
|
|
12344
12381
|
onOpenAutoFocus: (event) => {
|
|
12345
|
-
if (
|
|
12382
|
+
if (isNotNil29(initialFocusRef) && initialFocusRef.current) {
|
|
12346
12383
|
event.preventDefault();
|
|
12347
12384
|
requestAnimationFrame(() => {
|
|
12348
12385
|
initialFocusRef.current?.focus();
|
|
@@ -12377,9 +12414,9 @@ import { Root, Trigger as Trigger2, Portal, Content as Content2, Close } from "@
|
|
|
12377
12414
|
import styled58, { css as css36 } from "styled-components";
|
|
12378
12415
|
|
|
12379
12416
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
12380
|
-
import { isNotNil as
|
|
12417
|
+
import { isNotNil as isNotNil30 } from "@wistia/type-guards";
|
|
12381
12418
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
12382
|
-
return
|
|
12419
|
+
return isNotNil30(onOpenChange) && isNotNil30(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
12383
12420
|
};
|
|
12384
12421
|
|
|
12385
12422
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -12534,7 +12571,7 @@ Popover2.displayName = "Popover";
|
|
|
12534
12571
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
12535
12572
|
import styled59 from "styled-components";
|
|
12536
12573
|
import { Root as ProgressRoot, Indicator as ProgressIndicator } from "@radix-ui/react-progress";
|
|
12537
|
-
import { isNotNil as
|
|
12574
|
+
import { isNotNil as isNotNil31 } from "@wistia/type-guards";
|
|
12538
12575
|
import { jsx as jsx259, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
12539
12576
|
var ProgressBarWrapper = styled59.div`
|
|
12540
12577
|
--progress-bar-height: 8px;
|
|
@@ -12589,7 +12626,7 @@ var ProgressBar = ({
|
|
|
12589
12626
|
...props
|
|
12590
12627
|
}) => {
|
|
12591
12628
|
return /* @__PURE__ */ jsxs40(ProgressBarWrapper, { children: [
|
|
12592
|
-
|
|
12629
|
+
isNotNil31(labelLeft) ? /* @__PURE__ */ jsx259(ProgressBarLabel, { children: labelLeft }) : null,
|
|
12593
12630
|
/* @__PURE__ */ jsx259(
|
|
12594
12631
|
StyledProgressBar,
|
|
12595
12632
|
{
|
|
@@ -12605,7 +12642,7 @@ var ProgressBar = ({
|
|
|
12605
12642
|
)
|
|
12606
12643
|
}
|
|
12607
12644
|
),
|
|
12608
|
-
|
|
12645
|
+
isNotNil31(labelRight) ? /* @__PURE__ */ jsx259(ProgressBarLabel, { children: labelRight }) : null
|
|
12609
12646
|
] });
|
|
12610
12647
|
};
|
|
12611
12648
|
ProgressBar.displayName = "ProgressBar";
|
|
@@ -12613,7 +12650,7 @@ ProgressBar.displayName = "ProgressBar";
|
|
|
12613
12650
|
// src/components/Radio/Radio.tsx
|
|
12614
12651
|
import { forwardRef as forwardRef23, useId as useId3 } from "react";
|
|
12615
12652
|
import styled60, { css as css37 } from "styled-components";
|
|
12616
|
-
import { isNonEmptyString as
|
|
12653
|
+
import { isNonEmptyString as isNonEmptyString5, isNotUndefined as isNotUndefined13 } from "@wistia/type-guards";
|
|
12617
12654
|
import { jsx as jsx260, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
12618
12655
|
var RadioIcon = () => /* @__PURE__ */ jsx260(
|
|
12619
12656
|
"svg",
|
|
@@ -12730,7 +12767,7 @@ var Radio = forwardRef23(
|
|
|
12730
12767
|
...props
|
|
12731
12768
|
}, ref) => {
|
|
12732
12769
|
const generatedId = useId3();
|
|
12733
|
-
const computedId =
|
|
12770
|
+
const computedId = isNonEmptyString5(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
12734
12771
|
const radioGroupContext = useRadioGroup();
|
|
12735
12772
|
const contextName = radioGroupContext?.name;
|
|
12736
12773
|
const contextOnChange = radioGroupContext?.onChange;
|
|
@@ -12791,7 +12828,7 @@ import { forwardRef as forwardRef25 } from "react";
|
|
|
12791
12828
|
// src/components/RadioCard/RadioCardRoot.tsx
|
|
12792
12829
|
import { forwardRef as forwardRef24, useId as useId4 } from "react";
|
|
12793
12830
|
import styled61, { css as css38 } from "styled-components";
|
|
12794
|
-
import { isNonEmptyString as
|
|
12831
|
+
import { isNonEmptyString as isNonEmptyString6, isNotUndefined as isNotUndefined14 } from "@wistia/type-guards";
|
|
12795
12832
|
import { jsx as jsx261, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
12796
12833
|
var checkedStyles = css38`
|
|
12797
12834
|
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
@@ -12912,7 +12949,7 @@ var RadioCardRoot = forwardRef24(
|
|
|
12912
12949
|
...props
|
|
12913
12950
|
}, ref) => {
|
|
12914
12951
|
const generatedId = useId4();
|
|
12915
|
-
const computedId =
|
|
12952
|
+
const computedId = isNonEmptyString6(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
12916
12953
|
const radioGroupContext = useRadioGroup();
|
|
12917
12954
|
const contextName = radioGroupContext?.name;
|
|
12918
12955
|
const contextOnChange = radioGroupContext?.onChange;
|
|
@@ -12951,7 +12988,7 @@ RadioCardRoot.displayName = "RadioCardRoot";
|
|
|
12951
12988
|
|
|
12952
12989
|
// src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
12953
12990
|
import styled63 from "styled-components";
|
|
12954
|
-
import { isNotNil as
|
|
12991
|
+
import { isNotNil as isNotNil32 } from "@wistia/type-guards";
|
|
12955
12992
|
|
|
12956
12993
|
// src/components/RadioCard/RadioCardIndicator.tsx
|
|
12957
12994
|
import styled62 from "styled-components";
|
|
@@ -13025,17 +13062,17 @@ var RadioCardDefaultLayout = ({
|
|
|
13025
13062
|
showIndicator = true
|
|
13026
13063
|
}) => {
|
|
13027
13064
|
return /* @__PURE__ */ jsxs43(StyledCardContent, { children: [
|
|
13028
|
-
showIndicator ? /* @__PURE__ */ jsx262(StyledIndicatorContainer, { $hasIcon:
|
|
13065
|
+
showIndicator ? /* @__PURE__ */ jsx262(StyledIndicatorContainer, { $hasIcon: isNotNil32(icon), children: /* @__PURE__ */ jsx262(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" }) }) : null,
|
|
13029
13066
|
/* @__PURE__ */ jsxs43(Stack, { gap: "space-02", children: [
|
|
13030
|
-
|
|
13067
|
+
isNotNil32(icon) && /* @__PURE__ */ jsx262(StyledCardIcon, { "data-wui-radio-card-icon": true, children: icon }),
|
|
13031
13068
|
/* @__PURE__ */ jsxs43(
|
|
13032
13069
|
Stack,
|
|
13033
13070
|
{
|
|
13034
13071
|
gap: "space-01",
|
|
13035
|
-
style:
|
|
13072
|
+
style: isNotNil32(icon) ? { paddingLeft: 2 } : void 0,
|
|
13036
13073
|
children: [
|
|
13037
13074
|
/* @__PURE__ */ jsx262(Text, { variant: "label3", children: /* @__PURE__ */ jsx262("strong", { children: label }) }),
|
|
13038
|
-
|
|
13075
|
+
isNotNil32(description) && /* @__PURE__ */ jsx262(
|
|
13039
13076
|
Text,
|
|
13040
13077
|
{
|
|
13041
13078
|
prominence: "secondary",
|
|
@@ -13244,7 +13281,7 @@ SegmentedControl.displayName = "SegmentedControl";
|
|
|
13244
13281
|
import { forwardRef as forwardRef28, useEffect as useEffect13, useRef as useRef15 } from "react";
|
|
13245
13282
|
import styled66, { css as css41 } from "styled-components";
|
|
13246
13283
|
import { Item as ToggleGroupItem } from "@radix-ui/react-toggle-group";
|
|
13247
|
-
import { isNotNil as
|
|
13284
|
+
import { isNotNil as isNotNil33 } from "@wistia/type-guards";
|
|
13248
13285
|
import { jsxs as jsxs45 } from "react/jsx-runtime";
|
|
13249
13286
|
var segmentedControlItemStyles = css41`
|
|
13250
13287
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -13359,8 +13396,8 @@ var SegmentedControlItem = forwardRef28(
|
|
|
13359
13396
|
{
|
|
13360
13397
|
ref: combinedRef,
|
|
13361
13398
|
...otherProps,
|
|
13362
|
-
$hasLabel:
|
|
13363
|
-
"aria-label":
|
|
13399
|
+
$hasLabel: isNotNil33(label),
|
|
13400
|
+
"aria-label": isNotNil33(label) ? void 0 : ariaLabel,
|
|
13364
13401
|
disabled,
|
|
13365
13402
|
onClick: handleClick,
|
|
13366
13403
|
value,
|
|
@@ -13501,7 +13538,7 @@ Select.displayName = "Select";
|
|
|
13501
13538
|
import { Item, ItemText, ItemIndicator } from "@radix-ui/react-select";
|
|
13502
13539
|
import { forwardRef as forwardRef30 } from "react";
|
|
13503
13540
|
import styled68 from "styled-components";
|
|
13504
|
-
import { isNotNil as
|
|
13541
|
+
import { isNotNil as isNotNil34 } from "@wistia/type-guards";
|
|
13505
13542
|
import { jsx as jsx269, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
13506
13543
|
var StyledItem = styled68(Item)`
|
|
13507
13544
|
${variantStyleMap2.body3};
|
|
@@ -13545,7 +13582,7 @@ var SelectOption = forwardRef30(
|
|
|
13545
13582
|
type: "checkmark"
|
|
13546
13583
|
}
|
|
13547
13584
|
) }) }),
|
|
13548
|
-
|
|
13585
|
+
isNotNil34(selectedDisplayValue) ? /* @__PURE__ */ jsxs47("div", { children: [
|
|
13549
13586
|
children,
|
|
13550
13587
|
/* @__PURE__ */ jsx269("div", { style: { display: "none" }, children: /* @__PURE__ */ jsx269(ItemText, { children: selectedDisplayValue }) })
|
|
13551
13588
|
] }) : /* @__PURE__ */ jsx269(ItemText, { children })
|
|
@@ -13585,7 +13622,7 @@ import {
|
|
|
13585
13622
|
Thumb as RadixSliderThumb
|
|
13586
13623
|
} from "@radix-ui/react-slider";
|
|
13587
13624
|
import styled70 from "styled-components";
|
|
13588
|
-
import { isNonEmptyString as
|
|
13625
|
+
import { isNonEmptyString as isNonEmptyString7 } from "@wistia/type-guards";
|
|
13589
13626
|
import { jsx as jsx271, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
13590
13627
|
var SliderContainer = styled70.div`
|
|
13591
13628
|
--wui-slider-track-color: var(--wui-gray-6);
|
|
@@ -13664,7 +13701,7 @@ var Slider = ({
|
|
|
13664
13701
|
"data-testid": dataTestId = "ui-slider",
|
|
13665
13702
|
...otherProps
|
|
13666
13703
|
}) => {
|
|
13667
|
-
if (!(
|
|
13704
|
+
if (!(isNonEmptyString7(ariaLabel) || isNonEmptyString7(ariaLabelledby))) {
|
|
13668
13705
|
throw new Error(
|
|
13669
13706
|
"UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
|
|
13670
13707
|
);
|
|
@@ -13712,7 +13749,7 @@ Slider.displayName = "Slider";
|
|
|
13712
13749
|
// src/components/Switch/Switch.tsx
|
|
13713
13750
|
import { forwardRef as forwardRef31, useId as useId5 } from "react";
|
|
13714
13751
|
import styled71, { css as css42 } from "styled-components";
|
|
13715
|
-
import { isNonEmptyString as
|
|
13752
|
+
import { isNonEmptyString as isNonEmptyString8 } from "@wistia/type-guards";
|
|
13716
13753
|
import { jsx as jsx272, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
13717
13754
|
var sizeSmall3 = css42`
|
|
13718
13755
|
--wui-size-small-width: 24px;
|
|
@@ -13832,7 +13869,7 @@ var Switch = forwardRef31(
|
|
|
13832
13869
|
...props
|
|
13833
13870
|
}, ref) => {
|
|
13834
13871
|
const generatedId = useId5();
|
|
13835
|
-
const computedId =
|
|
13872
|
+
const computedId = isNonEmptyString8(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
13836
13873
|
return /* @__PURE__ */ jsxs50(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
13837
13874
|
/* @__PURE__ */ jsx272(
|
|
13838
13875
|
StyledHiddenSwitchInput,
|
|
@@ -13988,7 +14025,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
13988
14025
|
// src/components/Tabs/Tabs.tsx
|
|
13989
14026
|
import { Root as RadixTabsRoot } from "@radix-ui/react-tabs";
|
|
13990
14027
|
import { useCallback as useCallback10, useState as useState18 } from "react";
|
|
13991
|
-
import { isNotNil as
|
|
14028
|
+
import { isNotNil as isNotNil35 } from "@wistia/type-guards";
|
|
13992
14029
|
|
|
13993
14030
|
// src/components/Tabs/useTabsValue.tsx
|
|
13994
14031
|
import { createContext as createContext10, useContext as useContext11 } from "react";
|
|
@@ -14025,10 +14062,10 @@ var Tabs = ({
|
|
|
14025
14062
|
...props,
|
|
14026
14063
|
onValueChange
|
|
14027
14064
|
};
|
|
14028
|
-
if (
|
|
14065
|
+
if (isNotNil35(value)) {
|
|
14029
14066
|
rootProps.value = value;
|
|
14030
14067
|
}
|
|
14031
|
-
if (
|
|
14068
|
+
if (isNotNil35(defaultValue)) {
|
|
14032
14069
|
rootProps.defaultValue = defaultValue;
|
|
14033
14070
|
}
|
|
14034
14071
|
return /* @__PURE__ */ jsx279(RadixTabsRoot, { ...rootProps, children: /* @__PURE__ */ jsx279(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ jsx279(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -14097,7 +14134,7 @@ TabsList.displayName = "TabsList";
|
|
|
14097
14134
|
|
|
14098
14135
|
// src/components/Tabs/TabsTrigger.tsx
|
|
14099
14136
|
import { forwardRef as forwardRef32, useEffect as useEffect14, useRef as useRef16 } from "react";
|
|
14100
|
-
import { isNotNil as
|
|
14137
|
+
import { isNotNil as isNotNil36 } from "@wistia/type-guards";
|
|
14101
14138
|
|
|
14102
14139
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
14103
14140
|
import styled80 from "styled-components";
|
|
@@ -14148,8 +14185,8 @@ var TabsTrigger = forwardRef32(
|
|
|
14148
14185
|
{
|
|
14149
14186
|
...otherProps,
|
|
14150
14187
|
ref: combinedRef,
|
|
14151
|
-
$hasLabel:
|
|
14152
|
-
"aria-label":
|
|
14188
|
+
$hasLabel: isNotNil36(label),
|
|
14189
|
+
"aria-label": isNotNil36(label) ? void 0 : ariaLabel,
|
|
14153
14190
|
disabled,
|
|
14154
14191
|
value,
|
|
14155
14192
|
children: [
|
|
@@ -14164,7 +14201,7 @@ TabsTrigger.displayName = "TabsTrigger";
|
|
|
14164
14201
|
|
|
14165
14202
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
14166
14203
|
import styled81 from "styled-components";
|
|
14167
|
-
import { isNotNil as
|
|
14204
|
+
import { isNotNil as isNotNil37 } from "@wistia/type-guards";
|
|
14168
14205
|
import { jsx as jsx283, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
14169
14206
|
var StyledThumbnailBadge = styled81.div`
|
|
14170
14207
|
align-items: center;
|
|
@@ -14192,7 +14229,7 @@ var StyledThumbnailBadge = styled81.div`
|
|
|
14192
14229
|
`;
|
|
14193
14230
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
14194
14231
|
return /* @__PURE__ */ jsxs53(StyledThumbnailBadge, { ...props, children: [
|
|
14195
|
-
|
|
14232
|
+
isNotNil37(icon) && icon,
|
|
14196
14233
|
/* @__PURE__ */ jsx283("span", { children: label })
|
|
14197
14234
|
] });
|
|
14198
14235
|
};
|
|
@@ -14201,10 +14238,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
|
14201
14238
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
14202
14239
|
import { forwardRef as forwardRef33, useState as useState19, useRef as useRef17, useCallback as useCallback11, useMemo as useMemo12 } from "react";
|
|
14203
14240
|
import styled83 from "styled-components";
|
|
14204
|
-
import { isNil as isNil17, isNotNil as
|
|
14241
|
+
import { isNil as isNil17, isNotNil as isNotNil40, isUndefined as isUndefined7, isEmptyString as isEmptyString2, isString as isString2 } from "@wistia/type-guards";
|
|
14205
14242
|
|
|
14206
14243
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
14207
|
-
import { isNotNil as
|
|
14244
|
+
import { isNotNil as isNotNil38 } from "@wistia/type-guards";
|
|
14208
14245
|
import { css as css45 } from "styled-components";
|
|
14209
14246
|
var gradients = {
|
|
14210
14247
|
defaultDarkOne: css45`
|
|
@@ -14332,12 +14369,12 @@ var gradients = {
|
|
|
14332
14369
|
};
|
|
14333
14370
|
var gradientMap = Object.keys(gradients);
|
|
14334
14371
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
14335
|
-
return
|
|
14372
|
+
return isNotNil38(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
14336
14373
|
};
|
|
14337
14374
|
|
|
14338
14375
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
14339
14376
|
import styled82 from "styled-components";
|
|
14340
|
-
import { isNotNil as
|
|
14377
|
+
import { isNotNil as isNotNil39 } from "@wistia/type-guards";
|
|
14341
14378
|
import { jsx as jsx284, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
14342
14379
|
var ScrubLine = styled82.div`
|
|
14343
14380
|
position: absolute;
|
|
@@ -14423,8 +14460,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
14423
14460
|
);
|
|
14424
14461
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
14425
14462
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
14426
|
-
const showScrubLine =
|
|
14427
|
-
const scrubLinePosition =
|
|
14463
|
+
const showScrubLine = isNotNil39(cursorPosition);
|
|
14464
|
+
const scrubLinePosition = isNotNil39(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
14428
14465
|
const viewerStyles = {
|
|
14429
14466
|
position: "relative",
|
|
14430
14467
|
overflow: "hidden",
|
|
@@ -14495,7 +14532,7 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
14495
14532
|
);
|
|
14496
14533
|
};
|
|
14497
14534
|
var StyledThumbnail = styled83.div`
|
|
14498
|
-
background-image: ${({ $backgroundUrl }) =>
|
|
14535
|
+
background-image: ${({ $backgroundUrl }) => isNotNil40($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
14499
14536
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
14500
14537
|
// if we don't have $backgroundUrl show a gradient
|
|
14501
14538
|
isNil17($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
@@ -14540,10 +14577,10 @@ var Thumbnail = forwardRef33(
|
|
|
14540
14577
|
const storyboardElementRef = useRef17(null);
|
|
14541
14578
|
const [cursorPosition, setCursorPosition] = useState19(null);
|
|
14542
14579
|
const backgroundUrl = useMemo12(
|
|
14543
|
-
() => thumbnailImageType === "square" &&
|
|
14580
|
+
() => thumbnailImageType === "square" && isNotNil40(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
14544
14581
|
[thumbnailImageType, thumbnailUrl]
|
|
14545
14582
|
);
|
|
14546
|
-
const isScrubbable =
|
|
14583
|
+
const isScrubbable = isNotNil40(storyboard);
|
|
14547
14584
|
const trackStoryboardLoadStatus = useCallback11(() => {
|
|
14548
14585
|
if (storyboardElementRef.current || !storyboard) {
|
|
14549
14586
|
return storyboardElementRef.current;
|
|
@@ -14607,7 +14644,7 @@ var Thumbnail = forwardRef33(
|
|
|
14607
14644
|
let thumbnailContent = null;
|
|
14608
14645
|
if (shouldRenderStoryboard) {
|
|
14609
14646
|
thumbnailContent = renderStoryboard();
|
|
14610
|
-
} else if (
|
|
14647
|
+
} else if (isNotNil40(thumbnailUrl)) {
|
|
14611
14648
|
thumbnailContent = /* @__PURE__ */ jsx285(
|
|
14612
14649
|
ThumbnailImage,
|
|
14613
14650
|
{
|
|
@@ -14632,7 +14669,7 @@ var Thumbnail = forwardRef33(
|
|
|
14632
14669
|
onMouseOut: handleMouseOut,
|
|
14633
14670
|
role: "presentation",
|
|
14634
14671
|
children: [
|
|
14635
|
-
|
|
14672
|
+
isNotNil40(children) ? children : null,
|
|
14636
14673
|
thumbnailContent
|
|
14637
14674
|
]
|
|
14638
14675
|
}
|
|
@@ -14750,7 +14787,7 @@ var ThumbnailCollage = ({
|
|
|
14750
14787
|
|
|
14751
14788
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
14752
14789
|
import styled85, { css as css46 } from "styled-components";
|
|
14753
|
-
import { isNotNil as
|
|
14790
|
+
import { isNotNil as isNotNil41 } from "@wistia/type-guards";
|
|
14754
14791
|
import { jsx as jsx287, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
14755
14792
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
14756
14793
|
if (iconOnly) {
|
|
@@ -14863,7 +14900,7 @@ var WistiaLogo = ({
|
|
|
14863
14900
|
...props,
|
|
14864
14901
|
children: [
|
|
14865
14902
|
/* @__PURE__ */ jsx287("title", { children: title }),
|
|
14866
|
-
|
|
14903
|
+
isNotNil41(description) ? /* @__PURE__ */ jsx287("desc", { children: description }) : null,
|
|
14867
14904
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
14868
14905
|
renderLogotype(logotypeColor, iconOnly)
|
|
14869
14906
|
]
|
|
@@ -14919,6 +14956,65 @@ var InputPassword = forwardRef34(
|
|
|
14919
14956
|
}
|
|
14920
14957
|
);
|
|
14921
14958
|
InputPassword.displayName = "InputPassword";
|
|
14959
|
+
|
|
14960
|
+
// src/components/ContextMenu/ContextMenu.tsx
|
|
14961
|
+
import { useEffect as useEffect15, useState as useState21 } from "react";
|
|
14962
|
+
import { isNil as isNil18, isNotNil as isNotNil42 } from "@wistia/type-guards";
|
|
14963
|
+
import { jsx as jsx289 } from "react/jsx-runtime";
|
|
14964
|
+
var ContextMenu = ({
|
|
14965
|
+
position,
|
|
14966
|
+
triggerRef,
|
|
14967
|
+
children,
|
|
14968
|
+
onRequestClose = () => null
|
|
14969
|
+
}) => {
|
|
14970
|
+
const [isRightClicked, setIsRightClicked] = useState21(false);
|
|
14971
|
+
const [menuPosition, setMenuPosition] = useState21(position ?? { x: 0, y: 0 });
|
|
14972
|
+
useEffect15(() => {
|
|
14973
|
+
if (isNil18(position)) {
|
|
14974
|
+
const onContextMenu = (event) => {
|
|
14975
|
+
event.preventDefault();
|
|
14976
|
+
setMenuPosition({ x: event.clientX, y: event.clientY });
|
|
14977
|
+
setIsRightClicked(true);
|
|
14978
|
+
};
|
|
14979
|
+
const triggerEl = triggerRef?.current;
|
|
14980
|
+
triggerEl?.addEventListener("contextmenu", onContextMenu);
|
|
14981
|
+
return () => {
|
|
14982
|
+
triggerEl?.removeEventListener("contextmenu", onContextMenu);
|
|
14983
|
+
};
|
|
14984
|
+
}
|
|
14985
|
+
return () => null;
|
|
14986
|
+
}, [position, triggerRef]);
|
|
14987
|
+
const isOpen = isNotNil42(position) || isRightClicked;
|
|
14988
|
+
return isOpen ? /* @__PURE__ */ jsx289(
|
|
14989
|
+
Menu,
|
|
14990
|
+
{
|
|
14991
|
+
avoidCollisions: false,
|
|
14992
|
+
isOpen,
|
|
14993
|
+
onOpenChange: (next) => {
|
|
14994
|
+
setIsRightClicked(next);
|
|
14995
|
+
if (!next) {
|
|
14996
|
+
onRequestClose();
|
|
14997
|
+
}
|
|
14998
|
+
},
|
|
14999
|
+
trigger: /* @__PURE__ */ jsx289(
|
|
15000
|
+
"button",
|
|
15001
|
+
{
|
|
15002
|
+
"aria-label": "context menu",
|
|
15003
|
+
style: {
|
|
15004
|
+
width: "1px",
|
|
15005
|
+
height: "1px",
|
|
15006
|
+
all: "unset",
|
|
15007
|
+
position: "fixed",
|
|
15008
|
+
top: menuPosition.y,
|
|
15009
|
+
left: menuPosition.x
|
|
15010
|
+
},
|
|
15011
|
+
type: "button"
|
|
15012
|
+
}
|
|
15013
|
+
),
|
|
15014
|
+
children
|
|
15015
|
+
}
|
|
15016
|
+
) : null;
|
|
15017
|
+
};
|
|
14922
15018
|
export {
|
|
14923
15019
|
ActionButton,
|
|
14924
15020
|
Avatar,
|
|
@@ -14942,6 +15038,7 @@ export {
|
|
|
14942
15038
|
ColorSchemeWrapper,
|
|
14943
15039
|
Combobox2 as Combobox,
|
|
14944
15040
|
ComboboxOption,
|
|
15041
|
+
ContextMenu,
|
|
14945
15042
|
DataCard,
|
|
14946
15043
|
DataCardTrend,
|
|
14947
15044
|
DataCards,
|