@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.cjs
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
|
*
|
|
@@ -61,6 +61,7 @@ __export(index_exports, {
|
|
|
61
61
|
ColorSchemeWrapper: () => ColorSchemeWrapper,
|
|
62
62
|
Combobox: () => Combobox2,
|
|
63
63
|
ComboboxOption: () => ComboboxOption,
|
|
64
|
+
ContextMenu: () => ContextMenu,
|
|
64
65
|
DataCard: () => DataCard,
|
|
65
66
|
DataCardTrend: () => DataCardTrend,
|
|
66
67
|
DataCards: () => DataCards,
|
|
@@ -8936,7 +8937,7 @@ Center.displayName = "Center";
|
|
|
8936
8937
|
// src/components/Checkbox/Checkbox.tsx
|
|
8937
8938
|
var import_react38 = require("react");
|
|
8938
8939
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8939
|
-
var
|
|
8940
|
+
var import_type_guards31 = require("@wistia/type-guards");
|
|
8940
8941
|
|
|
8941
8942
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
8942
8943
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
@@ -9060,11 +9061,12 @@ FormControlLabel.displayName = "FormControlLabel";
|
|
|
9060
9061
|
|
|
9061
9062
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9062
9063
|
var import_react37 = require("react");
|
|
9063
|
-
var
|
|
9064
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
9064
9065
|
|
|
9065
9066
|
// src/components/FormGroup/FormGroup.tsx
|
|
9066
9067
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
9067
9068
|
var import_react35 = require("react");
|
|
9069
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
9068
9070
|
|
|
9069
9071
|
// src/components/Stack/Stack.tsx
|
|
9070
9072
|
var import_react34 = require("react");
|
|
@@ -9102,12 +9104,31 @@ var Stack = makePolymorphic(StackComponent);
|
|
|
9102
9104
|
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
9103
9105
|
var StyledFieldset = import_styled_components41.default.fieldset`
|
|
9104
9106
|
border: 0;
|
|
9107
|
+
|
|
9108
|
+
/* * {
|
|
9109
|
+
outline: 1px solid red;
|
|
9110
|
+
} */
|
|
9105
9111
|
`;
|
|
9106
9112
|
var StyledLegend = import_styled_components41.default.legend`
|
|
9113
|
+
padding-inline: 0;
|
|
9114
|
+
display: flex;
|
|
9115
|
+
flex-direction: column;
|
|
9116
|
+
gap: var(--wui-space-01);
|
|
9107
9117
|
margin-bottom: var(--wui-space-02);
|
|
9118
|
+
|
|
9119
|
+
&:has([data-wui-form-group-description]) {
|
|
9120
|
+
margin-bottom: var(--wui-space-01);
|
|
9121
|
+
}
|
|
9108
9122
|
`;
|
|
9109
|
-
var FormGroup = ({
|
|
9123
|
+
var FormGroup = ({
|
|
9124
|
+
children,
|
|
9125
|
+
label,
|
|
9126
|
+
description,
|
|
9127
|
+
...props
|
|
9128
|
+
}) => {
|
|
9110
9129
|
const ref = (0, import_react35.useRef)(null);
|
|
9130
|
+
const hasLabel = (0, import_type_guards28.isNotNil)(label) && (0, import_type_guards28.isNonEmptyString)(label);
|
|
9131
|
+
const hasDescription = (0, import_type_guards28.isNotNil)(description) && (0, import_type_guards28.isNonEmptyString)(description);
|
|
9111
9132
|
return /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(
|
|
9112
9133
|
Stack,
|
|
9113
9134
|
{
|
|
@@ -9115,14 +9136,26 @@ var FormGroup = ({ children, label, ...props }) => {
|
|
|
9115
9136
|
ref,
|
|
9116
9137
|
renderAs: StyledFieldset,
|
|
9117
9138
|
children: [
|
|
9118
|
-
/* @__PURE__ */ (0, import_jsx_runtime217.
|
|
9139
|
+
hasLabel || hasDescription ? /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(
|
|
9119
9140
|
Heading,
|
|
9120
9141
|
{
|
|
9121
9142
|
renderAs: StyledLegend,
|
|
9122
9143
|
variant: "heading5",
|
|
9123
|
-
children:
|
|
9144
|
+
children: [
|
|
9145
|
+
hasLabel ? label : null,
|
|
9146
|
+
hasDescription ? /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
9147
|
+
Text,
|
|
9148
|
+
{
|
|
9149
|
+
"data-wui-form-group-description": true,
|
|
9150
|
+
prominence: "secondary",
|
|
9151
|
+
renderAs: "span",
|
|
9152
|
+
variant: "body4",
|
|
9153
|
+
children: description
|
|
9154
|
+
}
|
|
9155
|
+
) : null
|
|
9156
|
+
]
|
|
9124
9157
|
}
|
|
9125
|
-
),
|
|
9158
|
+
) : null,
|
|
9126
9159
|
children
|
|
9127
9160
|
]
|
|
9128
9161
|
}
|
|
@@ -9133,7 +9166,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
9133
9166
|
// src/components/Form/Form.tsx
|
|
9134
9167
|
var import_react36 = require("react");
|
|
9135
9168
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
9136
|
-
var
|
|
9169
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
9137
9170
|
|
|
9138
9171
|
// src/components/Form/serializeFormData.tsx
|
|
9139
9172
|
var ARRAY_SUFFIX = "[]";
|
|
@@ -9182,7 +9215,7 @@ var Form = (0, import_react36.forwardRef)(
|
|
|
9182
9215
|
const id = props.id ?? autoId;
|
|
9183
9216
|
const handleValidate = (nextFormData) => {
|
|
9184
9217
|
const nextData = serializeFormData(nextFormData);
|
|
9185
|
-
if ((0,
|
|
9218
|
+
if ((0, import_type_guards29.isUndefined)(validate)) {
|
|
9186
9219
|
return {};
|
|
9187
9220
|
}
|
|
9188
9221
|
return validate(nextData);
|
|
@@ -9192,7 +9225,7 @@ var Form = (0, import_react36.forwardRef)(
|
|
|
9192
9225
|
props.onBlur(event);
|
|
9193
9226
|
}
|
|
9194
9227
|
const formData = new FormData(event.currentTarget);
|
|
9195
|
-
if ((0,
|
|
9228
|
+
if ((0, import_type_guards29.isNotUndefined)(validate)) {
|
|
9196
9229
|
handleValidate(formData);
|
|
9197
9230
|
}
|
|
9198
9231
|
};
|
|
@@ -9265,7 +9298,7 @@ var CheckboxGroup = ({
|
|
|
9265
9298
|
...props
|
|
9266
9299
|
}) => {
|
|
9267
9300
|
const formState = (0, import_react37.useContext)(FormContext);
|
|
9268
|
-
const derivedValue = (0,
|
|
9301
|
+
const derivedValue = (0, import_type_guards30.isArray)(formState.values[name]) ? formState.values[name] : value;
|
|
9269
9302
|
const context = (0, import_react37.useMemo)(() => {
|
|
9270
9303
|
return {
|
|
9271
9304
|
name: `${name}[]`,
|
|
@@ -9393,21 +9426,21 @@ var Checkbox = (0, import_react38.forwardRef)(
|
|
|
9393
9426
|
...props
|
|
9394
9427
|
}, ref) => {
|
|
9395
9428
|
const generatedId = (0, import_react38.useId)();
|
|
9396
|
-
const computedId = (0,
|
|
9429
|
+
const computedId = (0, import_type_guards31.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
9397
9430
|
const checkboxGroupContext = useCheckboxGroup();
|
|
9398
9431
|
const contextName = checkboxGroupContext?.name;
|
|
9399
9432
|
const contextOnChange = checkboxGroupContext?.onChange;
|
|
9400
9433
|
const contextValue = checkboxGroupContext?.value;
|
|
9401
9434
|
const checkboxName = name ?? contextName;
|
|
9402
9435
|
const handleOnChange = onChange ?? contextOnChange;
|
|
9403
|
-
const defaultChecked = (0,
|
|
9436
|
+
const defaultChecked = (0, import_type_guards31.isNotUndefined)(value) && contextValue ? contextValue.includes(value) : void 0;
|
|
9404
9437
|
return /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
9405
9438
|
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
9406
9439
|
StyledHiddenCheckboxInput,
|
|
9407
9440
|
{
|
|
9408
9441
|
...props,
|
|
9409
9442
|
ref,
|
|
9410
|
-
...(0,
|
|
9443
|
+
...(0, import_type_guards31.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked },
|
|
9411
9444
|
disabled,
|
|
9412
9445
|
id: computedId,
|
|
9413
9446
|
name: checkboxName,
|
|
@@ -9486,7 +9519,7 @@ ClickRegion.displayName = "ClickRegion";
|
|
|
9486
9519
|
|
|
9487
9520
|
// src/components/Collapsible/Collapsible.tsx
|
|
9488
9521
|
var import_react_collapsible = require("@radix-ui/react-collapsible");
|
|
9489
|
-
var
|
|
9522
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
9490
9523
|
var import_styled_components44 = __toESM(require("styled-components"));
|
|
9491
9524
|
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9492
9525
|
var StyledRoot = (0, import_styled_components44.default)(import_react_collapsible.Root)`
|
|
@@ -9503,7 +9536,7 @@ var Collapsible = ({
|
|
|
9503
9536
|
onOpenChange
|
|
9504
9537
|
}) => {
|
|
9505
9538
|
const controlProps = {
|
|
9506
|
-
...(0,
|
|
9539
|
+
...(0, import_type_guards32.isNotNil)(onOpenChange) && (0, import_type_guards32.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
9507
9540
|
};
|
|
9508
9541
|
return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(StyledRoot, { ...controlProps, children });
|
|
9509
9542
|
};
|
|
@@ -9565,13 +9598,13 @@ CollapsibleTriggerIcon.displayName = "CollapsibleTriggerIcon";
|
|
|
9565
9598
|
// src/components/Collapsible/CollapsibleContent.tsx
|
|
9566
9599
|
var import_styled_components46 = __toESM(require("styled-components"));
|
|
9567
9600
|
var import_react_collapsible3 = require("@radix-ui/react-collapsible");
|
|
9568
|
-
var
|
|
9601
|
+
var import_type_guards33 = require("@wistia/type-guards");
|
|
9569
9602
|
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
9570
9603
|
var ClampedContent = import_styled_components46.default.div`
|
|
9571
9604
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
9572
9605
|
`;
|
|
9573
9606
|
var CollapsibleContent = ({ clamp, children }) => {
|
|
9574
|
-
if ((0,
|
|
9607
|
+
if ((0, import_type_guards33.isNotUndefined)(clamp)) {
|
|
9575
9608
|
return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
9576
9609
|
ClampedContent,
|
|
9577
9610
|
{
|
|
@@ -9596,7 +9629,7 @@ var import_styled_components49 = __toESM(require("styled-components"));
|
|
|
9596
9629
|
// src/components/Tag/Tag.tsx
|
|
9597
9630
|
var import_react41 = require("react");
|
|
9598
9631
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9599
|
-
var
|
|
9632
|
+
var import_type_guards34 = require("@wistia/type-guards");
|
|
9600
9633
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9601
9634
|
var TagLabel = import_styled_components47.default.a`
|
|
9602
9635
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -9681,10 +9714,10 @@ var StyledTag = import_styled_components47.default.div`
|
|
|
9681
9714
|
}
|
|
9682
9715
|
`;
|
|
9683
9716
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
9684
|
-
if ((0,
|
|
9717
|
+
if ((0, import_type_guards34.isNil)(onClickRemove)) {
|
|
9685
9718
|
return null;
|
|
9686
9719
|
}
|
|
9687
|
-
if ((0,
|
|
9720
|
+
if ((0, import_type_guards34.isNil)(onClickRemoveLabel)) {
|
|
9688
9721
|
throw new Error(
|
|
9689
9722
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
9690
9723
|
);
|
|
@@ -9713,8 +9746,8 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
9713
9746
|
};
|
|
9714
9747
|
var Tag = (0, import_react41.forwardRef)(
|
|
9715
9748
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
9716
|
-
const hasIcon = (0,
|
|
9717
|
-
const labelProps = (0,
|
|
9749
|
+
const hasIcon = (0, import_type_guards34.isNotNil)(icon);
|
|
9750
|
+
const labelProps = (0, import_type_guards34.isNotNil)(href) && (0, import_type_guards34.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
9718
9751
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
9719
9752
|
StyledTag,
|
|
9720
9753
|
{
|
|
@@ -10024,7 +10057,7 @@ var Combobox2 = ({
|
|
|
10024
10057
|
// src/components/DataCards/DataCard.tsx
|
|
10025
10058
|
var import_react43 = require("react");
|
|
10026
10059
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
10027
|
-
var
|
|
10060
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
10028
10061
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
10029
10062
|
var StyledDataCard = import_styled_components50.default.div`
|
|
10030
10063
|
display: grid;
|
|
@@ -10155,8 +10188,8 @@ var DataCardInner = ({
|
|
|
10155
10188
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(StyledLoadingValue, {}) : value
|
|
10156
10189
|
}
|
|
10157
10190
|
),
|
|
10158
|
-
(0,
|
|
10159
|
-
(0,
|
|
10191
|
+
(0, import_type_guards35.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
10192
|
+
(0, import_type_guards35.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
10160
10193
|
]
|
|
10161
10194
|
}
|
|
10162
10195
|
);
|
|
@@ -10169,7 +10202,7 @@ var DataCardArrowIcon = /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
|
10169
10202
|
);
|
|
10170
10203
|
var DataCard = (props) => {
|
|
10171
10204
|
const ref = (0, import_react43.useRef)(null);
|
|
10172
|
-
if ((0,
|
|
10205
|
+
if ((0, import_type_guards35.isNotNil)(props.href) || (0, import_type_guards35.isNotNil)(props.onClick)) {
|
|
10173
10206
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
10174
10207
|
DataCardInner,
|
|
10175
10208
|
{
|
|
@@ -10179,7 +10212,7 @@ var DataCard = (props) => {
|
|
|
10179
10212
|
Button,
|
|
10180
10213
|
{
|
|
10181
10214
|
ref,
|
|
10182
|
-
...(0,
|
|
10215
|
+
...(0, import_type_guards35.isNotNil)(props.beforeAction) ? { beforeAction: props.beforeAction } : {},
|
|
10183
10216
|
disabled: props.disabled ?? false,
|
|
10184
10217
|
href: props.href,
|
|
10185
10218
|
onClick: props.onClick,
|
|
@@ -10462,7 +10495,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
10462
10495
|
// src/components/Input/Input.tsx
|
|
10463
10496
|
var import_react44 = require("react");
|
|
10464
10497
|
var import_styled_components55 = __toESM(require("styled-components"));
|
|
10465
|
-
var
|
|
10498
|
+
var import_type_guards36 = require("@wistia/type-guards");
|
|
10466
10499
|
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
10467
10500
|
var inputStyles = import_styled_components55.css`
|
|
10468
10501
|
${inputCss}
|
|
@@ -10579,27 +10612,27 @@ var Input = (0, import_react44.forwardRef)(
|
|
|
10579
10612
|
const internalRef = (0, import_react44.useRef)();
|
|
10580
10613
|
const ref = (
|
|
10581
10614
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
10582
|
-
(0,
|
|
10615
|
+
(0, import_type_guards36.isNotNil)(externalRef) && (0, import_type_guards36.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
10583
10616
|
);
|
|
10584
10617
|
let leftIconToDisplay = leftIcon;
|
|
10585
|
-
if ((0,
|
|
10618
|
+
if ((0, import_type_guards36.isNil)(leftIcon) && type === "search") {
|
|
10586
10619
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Icon, { type: "search" });
|
|
10587
10620
|
}
|
|
10588
|
-
if ((0,
|
|
10621
|
+
if ((0, import_type_guards36.isNotNil)(leftIconToDisplay)) {
|
|
10589
10622
|
leftIconToDisplay = (0, import_react44.cloneElement)(leftIconToDisplay, {
|
|
10590
10623
|
size: "md",
|
|
10591
10624
|
className: "wui-input-left-icon"
|
|
10592
10625
|
});
|
|
10593
10626
|
}
|
|
10594
10627
|
let rightIconToDisplay = rightIcon;
|
|
10595
|
-
if ((0,
|
|
10628
|
+
if ((0, import_type_guards36.isNotNil)(rightIconToDisplay)) {
|
|
10596
10629
|
rightIconToDisplay = (0, import_react44.cloneElement)(rightIconToDisplay, {
|
|
10597
10630
|
size: "md",
|
|
10598
10631
|
className: "wui-input-right-icon"
|
|
10599
10632
|
});
|
|
10600
10633
|
}
|
|
10601
10634
|
const handleFocus2 = (event) => {
|
|
10602
|
-
if ((0,
|
|
10635
|
+
if ((0, import_type_guards36.isNotNil)(props.onFocus)) {
|
|
10603
10636
|
props.onFocus(event);
|
|
10604
10637
|
}
|
|
10605
10638
|
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
@@ -10806,7 +10839,7 @@ var useFormState = (action, initialData = {}) => {
|
|
|
10806
10839
|
|
|
10807
10840
|
// src/components/Form/FormErrorSummary.tsx
|
|
10808
10841
|
var import_react47 = require("react");
|
|
10809
|
-
var
|
|
10842
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
10810
10843
|
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
10811
10844
|
var ErrorItem = ({ name, error, formId }) => {
|
|
10812
10845
|
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
@@ -10820,8 +10853,8 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10820
10853
|
}
|
|
10821
10854
|
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { ref, children: [
|
|
10822
10855
|
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("p", { children: description }),
|
|
10823
|
-
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0,
|
|
10824
|
-
([name, error]) => (0,
|
|
10856
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards37.isNotUndefined)(error)).map(
|
|
10857
|
+
([name, error]) => (0, import_type_guards37.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
10825
10858
|
ErrorItem,
|
|
10826
10859
|
{
|
|
10827
10860
|
error: err,
|
|
@@ -10845,7 +10878,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10845
10878
|
// src/components/FormField/FormField.tsx
|
|
10846
10879
|
var import_react48 = require("react");
|
|
10847
10880
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
10848
|
-
var
|
|
10881
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
10849
10882
|
|
|
10850
10883
|
// src/components/Label/Label.tsx
|
|
10851
10884
|
var import_styled_components57 = __toESM(require("styled-components"));
|
|
@@ -10948,7 +10981,7 @@ var StyledErrorList = import_styled_components58.default.ul`
|
|
|
10948
10981
|
gap: var(--wui-space-01);
|
|
10949
10982
|
`;
|
|
10950
10983
|
var ErrorMessages = ({ errors, id }) => {
|
|
10951
|
-
const isErrorArray = (0,
|
|
10984
|
+
const isErrorArray = (0, import_type_guards38.isArray)(errors);
|
|
10952
10985
|
const isMultipleErrors = isErrorArray && errors.length > 1;
|
|
10953
10986
|
if (!isErrorArray) {
|
|
10954
10987
|
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
@@ -11016,19 +11049,19 @@ var FormField = ({
|
|
|
11016
11049
|
"aria-describedby": ariaDescribedby,
|
|
11017
11050
|
...props
|
|
11018
11051
|
};
|
|
11019
|
-
if ((0,
|
|
11052
|
+
if ((0, import_type_guards38.isUndefined)(value) && (0, import_type_guards38.isNotUndefined)(defaultValue)) {
|
|
11020
11053
|
childProps = {
|
|
11021
11054
|
...childProps,
|
|
11022
11055
|
defaultValue
|
|
11023
11056
|
};
|
|
11024
11057
|
}
|
|
11025
|
-
if ((0,
|
|
11026
|
-
const computedName = (0,
|
|
11058
|
+
if ((0, import_type_guards38.isNotNil)(checkboxGroup)) {
|
|
11059
|
+
const computedName = (0, import_type_guards38.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
11027
11060
|
const handleChange = (event) => {
|
|
11028
|
-
if ((0,
|
|
11061
|
+
if ((0, import_type_guards38.isNotUndefined)(props.onChange)) {
|
|
11029
11062
|
props.onChange(event);
|
|
11030
11063
|
}
|
|
11031
|
-
if ((0,
|
|
11064
|
+
if ((0, import_type_guards38.isNotUndefined)(checkboxGroup.onChange)) {
|
|
11032
11065
|
checkboxGroup.onChange(event);
|
|
11033
11066
|
}
|
|
11034
11067
|
};
|
|
@@ -11036,7 +11069,7 @@ var FormField = ({
|
|
|
11036
11069
|
...childProps,
|
|
11037
11070
|
name: computedName,
|
|
11038
11071
|
onChange: handleChange,
|
|
11039
|
-
"aria-invalid": (0,
|
|
11072
|
+
"aria-invalid": (0, import_type_guards38.isNotNil)(error)
|
|
11040
11073
|
};
|
|
11041
11074
|
}
|
|
11042
11075
|
import_react48.Children.only(children);
|
|
@@ -11047,9 +11080,9 @@ var FormField = ({
|
|
|
11047
11080
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
11048
11081
|
children: [
|
|
11049
11082
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
11050
|
-
(0,
|
|
11083
|
+
(0, import_type_guards38.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
11051
11084
|
(0, import_react48.cloneElement)(children, childProps),
|
|
11052
|
-
(0,
|
|
11085
|
+
(0, import_type_guards38.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(import_jsx_runtime236.Fragment, { children: [
|
|
11053
11086
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)("div", {}),
|
|
11054
11087
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
11055
11088
|
ErrorMessages,
|
|
@@ -11095,7 +11128,7 @@ RadioGroup.displayName = "RadioGroup";
|
|
|
11095
11128
|
// src/components/Grid/Grid.tsx
|
|
11096
11129
|
var import_react50 = require("react");
|
|
11097
11130
|
var import_styled_components59 = __toESM(require("styled-components"));
|
|
11098
|
-
var
|
|
11131
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
11099
11132
|
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
11100
11133
|
var DEFAULT_ELEMENT5 = "div";
|
|
11101
11134
|
var StyledGrid = import_styled_components59.default.div`
|
|
@@ -11142,7 +11175,7 @@ var StyledGrid = import_styled_components59.default.div`
|
|
|
11142
11175
|
var GridComponent = (0, import_react50.forwardRef)(
|
|
11143
11176
|
({ children, columns = "auto", minChildWidth = "auto", gap = "space-02", renderAs, ...props }, ref) => {
|
|
11144
11177
|
const responsiveGap = useResponsiveProp(gap);
|
|
11145
|
-
const { column, row } = (0,
|
|
11178
|
+
const { column, row } = (0, import_type_guards39.isRecord)(responsiveGap) ? responsiveGap : { column: responsiveGap, row: responsiveGap };
|
|
11146
11179
|
const responsiveColumns = useResponsiveProp(columns);
|
|
11147
11180
|
const responsiveMinChildWidth = useResponsiveProp(minChildWidth);
|
|
11148
11181
|
return /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
@@ -11166,7 +11199,7 @@ var Grid = makePolymorphic(GridComponent);
|
|
|
11166
11199
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
11167
11200
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
11168
11201
|
var import_react51 = require("react");
|
|
11169
|
-
var
|
|
11202
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
11170
11203
|
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
11171
11204
|
var StyledInput2 = (0, import_styled_components60.default)(Input)`
|
|
11172
11205
|
&:not([aria-disabled='true']) {
|
|
@@ -11194,12 +11227,12 @@ var InputClickToCopy = (0, import_react51.forwardRef)(
|
|
|
11194
11227
|
}, [isCopied]);
|
|
11195
11228
|
const handleClick = (event) => {
|
|
11196
11229
|
event.preventDefault();
|
|
11197
|
-
if ((0,
|
|
11230
|
+
if ((0, import_type_guards40.isFunction)(props.onClick)) {
|
|
11198
11231
|
props.onClick(event);
|
|
11199
11232
|
}
|
|
11200
11233
|
void copyToClipboard(value).then(() => {
|
|
11201
11234
|
setIsCopied(true);
|
|
11202
|
-
if ((0,
|
|
11235
|
+
if ((0, import_type_guards40.isFunction)(onCopy)) {
|
|
11203
11236
|
onCopy(value);
|
|
11204
11237
|
}
|
|
11205
11238
|
return value;
|
|
@@ -11229,7 +11262,7 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
11229
11262
|
|
|
11230
11263
|
// src/components/KeyboardShortcut/KeyboardShortcut.tsx
|
|
11231
11264
|
var import_styled_components61 = __toESM(require("styled-components"));
|
|
11232
|
-
var
|
|
11265
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
11233
11266
|
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
11234
11267
|
var StyledKeyboardShortcut = import_styled_components61.default.div`
|
|
11235
11268
|
align-items: center;
|
|
@@ -11323,7 +11356,7 @@ var KeyboardShortcut = ({
|
|
|
11323
11356
|
$fullWidth: fullWidth,
|
|
11324
11357
|
...otherProps,
|
|
11325
11358
|
children: [
|
|
11326
|
-
(0,
|
|
11359
|
+
(0, import_type_guards41.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(Label2, { children: label }),
|
|
11327
11360
|
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
11328
11361
|
StyledKey,
|
|
11329
11362
|
{
|
|
@@ -11337,18 +11370,18 @@ var KeyboardShortcut = ({
|
|
|
11337
11370
|
KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
11338
11371
|
|
|
11339
11372
|
// src/components/List/List.tsx
|
|
11340
|
-
var
|
|
11373
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
11341
11374
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
11342
11375
|
|
|
11343
11376
|
// src/components/List/ListItem.tsx
|
|
11344
11377
|
var import_styled_components62 = __toESM(require("styled-components"));
|
|
11345
|
-
var
|
|
11378
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
11346
11379
|
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
11347
11380
|
var ListItemComponent = import_styled_components62.default.li`
|
|
11348
11381
|
margin-bottom: var(--wui-space-02);
|
|
11349
11382
|
`;
|
|
11350
11383
|
var ListItem = ({ children }) => {
|
|
11351
|
-
if ((0,
|
|
11384
|
+
if ((0, import_type_guards42.isNil)(children)) {
|
|
11352
11385
|
return null;
|
|
11353
11386
|
}
|
|
11354
11387
|
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(ListItemComponent, { children });
|
|
@@ -11478,13 +11511,13 @@ var List = ({
|
|
|
11478
11511
|
...otherProps
|
|
11479
11512
|
}) => {
|
|
11480
11513
|
const listVariant = variant ?? "bullets";
|
|
11481
|
-
if ((0,
|
|
11514
|
+
if ((0, import_type_guards43.isNotNil)(children)) {
|
|
11482
11515
|
if (Array.isArray(children) && !children.length) {
|
|
11483
11516
|
return null;
|
|
11484
11517
|
}
|
|
11485
11518
|
return renderListComponent(children, listVariant, otherProps);
|
|
11486
11519
|
}
|
|
11487
|
-
if ((0,
|
|
11520
|
+
if ((0, import_type_guards43.isNotNil)(items)) {
|
|
11488
11521
|
if (!items.length) {
|
|
11489
11522
|
return null;
|
|
11490
11523
|
}
|
|
@@ -11498,7 +11531,7 @@ List.displayName = "List";
|
|
|
11498
11531
|
var import_react53 = require("react");
|
|
11499
11532
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
11500
11533
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
11501
|
-
var
|
|
11534
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
11502
11535
|
|
|
11503
11536
|
// src/components/Menu/MenuContext.tsx
|
|
11504
11537
|
var import_react52 = require("react");
|
|
@@ -11611,7 +11644,7 @@ var Menu = (0, import_react53.forwardRef)(
|
|
|
11611
11644
|
}, ref) => {
|
|
11612
11645
|
const contextValue = (0, import_react53.useMemo)(() => ({ compact }), [compact]);
|
|
11613
11646
|
let controlProps = {
|
|
11614
|
-
...(0,
|
|
11647
|
+
...(0, import_type_guards44.isNotNil)(onOpenChange) && (0, import_type_guards44.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
11615
11648
|
};
|
|
11616
11649
|
if (disabled) {
|
|
11617
11650
|
controlProps = {
|
|
@@ -11625,7 +11658,7 @@ var Menu = (0, import_react53.forwardRef)(
|
|
|
11625
11658
|
modal: false,
|
|
11626
11659
|
...controlProps,
|
|
11627
11660
|
children: [
|
|
11628
|
-
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0,
|
|
11661
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards44.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
11629
11662
|
Button,
|
|
11630
11663
|
{
|
|
11631
11664
|
ref,
|
|
@@ -11644,10 +11677,11 @@ var Menu = (0, import_react53.forwardRef)(
|
|
|
11644
11677
|
$compact: compact,
|
|
11645
11678
|
align,
|
|
11646
11679
|
collisionPadding: 8,
|
|
11647
|
-
sideOffset: 6,
|
|
11648
11680
|
onFocusOutside: (event) => {
|
|
11649
11681
|
event.preventDefault();
|
|
11650
11682
|
},
|
|
11683
|
+
side: "bottom",
|
|
11684
|
+
sideOffset: 6,
|
|
11651
11685
|
children
|
|
11652
11686
|
}
|
|
11653
11687
|
) })
|
|
@@ -11690,12 +11724,12 @@ MenuLabel.displayName = "MenuLabel";
|
|
|
11690
11724
|
var import_react55 = require("react");
|
|
11691
11725
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11692
11726
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
11693
|
-
var
|
|
11727
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
11694
11728
|
|
|
11695
11729
|
// src/components/Menu/MenuItemButton.tsx
|
|
11696
11730
|
var import_react54 = require("react");
|
|
11697
11731
|
var import_styled_components66 = __toESM(require("styled-components"));
|
|
11698
|
-
var
|
|
11732
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
11699
11733
|
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
11700
11734
|
var StyledButton3 = (0, import_styled_components66.default)(Button)`
|
|
11701
11735
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -11773,7 +11807,7 @@ var StyledBadgeContainer = import_styled_components66.default.div`
|
|
|
11773
11807
|
var MenuItemButton = (0, import_react54.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
11774
11808
|
let { colorScheme, badge } = props;
|
|
11775
11809
|
if (appearance === "dangerous") {
|
|
11776
|
-
if ((0,
|
|
11810
|
+
if ((0, import_type_guards45.isNotUndefined)(colorScheme)) {
|
|
11777
11811
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
11778
11812
|
}
|
|
11779
11813
|
colorScheme = "error";
|
|
@@ -11803,7 +11837,7 @@ var MenuItemButton = (0, import_react54.forwardRef)(({ children, appearance, com
|
|
|
11803
11837
|
children: [
|
|
11804
11838
|
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
11805
11839
|
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
11806
|
-
(0,
|
|
11840
|
+
(0, import_type_guards45.isNotNil)(badge) || (0, import_type_guards45.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
11807
11841
|
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
11808
11842
|
]
|
|
11809
11843
|
}
|
|
@@ -11875,7 +11909,7 @@ var SubMenu = ({
|
|
|
11875
11909
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
11876
11910
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
11877
11911
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(MenuItemLabel, { children: label }),
|
|
11878
|
-
(0,
|
|
11912
|
+
(0, import_type_guards46.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(MenuItemDescription, { children: description }) : null
|
|
11879
11913
|
] }),
|
|
11880
11914
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
11881
11915
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
@@ -11967,7 +12001,7 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
11967
12001
|
|
|
11968
12002
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
11969
12003
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
11970
|
-
var
|
|
12004
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
11971
12005
|
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
11972
12006
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
11973
12007
|
return checked ? /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
@@ -12041,8 +12075,8 @@ var CheckboxMenuItem = ({
|
|
|
12041
12075
|
MenuItemButton,
|
|
12042
12076
|
{
|
|
12043
12077
|
...props,
|
|
12044
|
-
leftIcon: (0,
|
|
12045
|
-
rightIcon: (0,
|
|
12078
|
+
leftIcon: (0, import_type_guards47.isNotNil)(props.icon) ? props.icon : /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(CheckboxIndicator, { checked }),
|
|
12079
|
+
rightIcon: (0, import_type_guards47.isNotNil)(props.icon) ? /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(import_react_dropdown_menu7.DropdownMenuItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(Icon, { type: "checkmark" }) }) : void 0
|
|
12046
12080
|
}
|
|
12047
12081
|
)
|
|
12048
12082
|
}
|
|
@@ -12156,7 +12190,7 @@ FilterMenu.displayName = "FilterMenu";
|
|
|
12156
12190
|
var import_react60 = require("react");
|
|
12157
12191
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
12158
12192
|
var import_react_dialog5 = require("@radix-ui/react-dialog");
|
|
12159
|
-
var
|
|
12193
|
+
var import_type_guards49 = require("@wistia/type-guards");
|
|
12160
12194
|
|
|
12161
12195
|
// src/components/Modal/ModalHeader.tsx
|
|
12162
12196
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
@@ -12219,7 +12253,7 @@ var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
|
12219
12253
|
|
|
12220
12254
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
12221
12255
|
var import_react58 = require("react");
|
|
12222
|
-
var
|
|
12256
|
+
var import_type_guards48 = require("@wistia/type-guards");
|
|
12223
12257
|
var useFocusRestore = () => {
|
|
12224
12258
|
const previouslyFocusedRef = (0, import_react58.useRef)(null);
|
|
12225
12259
|
(0, import_react58.useEffect)(() => {
|
|
@@ -12227,7 +12261,7 @@ var useFocusRestore = () => {
|
|
|
12227
12261
|
}, []);
|
|
12228
12262
|
(0, import_react58.useEffect)(() => {
|
|
12229
12263
|
return () => {
|
|
12230
|
-
if ((0,
|
|
12264
|
+
if ((0, import_type_guards48.isNotNil)(previouslyFocusedRef.current)) {
|
|
12231
12265
|
setTimeout(() => {
|
|
12232
12266
|
previouslyFocusedRef.current?.focus();
|
|
12233
12267
|
}, 0);
|
|
@@ -12439,7 +12473,7 @@ var Modal = (0, import_react60.forwardRef)(
|
|
|
12439
12473
|
import_react_dialog5.Root,
|
|
12440
12474
|
{
|
|
12441
12475
|
onOpenChange: (open2) => {
|
|
12442
|
-
if (!open2 && (0,
|
|
12476
|
+
if (!open2 && (0, import_type_guards49.isNotNil)(onRequestClose)) {
|
|
12443
12477
|
onRequestClose();
|
|
12444
12478
|
}
|
|
12445
12479
|
},
|
|
@@ -12451,7 +12485,7 @@ var Modal = (0, import_react60.forwardRef)(
|
|
|
12451
12485
|
{
|
|
12452
12486
|
ref,
|
|
12453
12487
|
onOpenAutoFocus: (event) => {
|
|
12454
|
-
if ((0,
|
|
12488
|
+
if ((0, import_type_guards49.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
12455
12489
|
event.preventDefault();
|
|
12456
12490
|
requestAnimationFrame(() => {
|
|
12457
12491
|
initialFocusRef.current?.focus();
|
|
@@ -12486,9 +12520,9 @@ var import_react_popover2 = require("@radix-ui/react-popover");
|
|
|
12486
12520
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
12487
12521
|
|
|
12488
12522
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
12489
|
-
var
|
|
12523
|
+
var import_type_guards50 = require("@wistia/type-guards");
|
|
12490
12524
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
12491
|
-
return (0,
|
|
12525
|
+
return (0, import_type_guards50.isNotNil)(onOpenChange) && (0, import_type_guards50.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
12492
12526
|
};
|
|
12493
12527
|
|
|
12494
12528
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -12643,7 +12677,7 @@ Popover2.displayName = "Popover";
|
|
|
12643
12677
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
12644
12678
|
var import_styled_components76 = __toESM(require("styled-components"));
|
|
12645
12679
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
12646
|
-
var
|
|
12680
|
+
var import_type_guards51 = require("@wistia/type-guards");
|
|
12647
12681
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
12648
12682
|
var ProgressBarWrapper = import_styled_components76.default.div`
|
|
12649
12683
|
--progress-bar-height: 8px;
|
|
@@ -12698,7 +12732,7 @@ var ProgressBar = ({
|
|
|
12698
12732
|
...props
|
|
12699
12733
|
}) => {
|
|
12700
12734
|
return /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(ProgressBarWrapper, { children: [
|
|
12701
|
-
(0,
|
|
12735
|
+
(0, import_type_guards51.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
12702
12736
|
/* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
12703
12737
|
StyledProgressBar,
|
|
12704
12738
|
{
|
|
@@ -12714,7 +12748,7 @@ var ProgressBar = ({
|
|
|
12714
12748
|
)
|
|
12715
12749
|
}
|
|
12716
12750
|
),
|
|
12717
|
-
(0,
|
|
12751
|
+
(0, import_type_guards51.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
12718
12752
|
] });
|
|
12719
12753
|
};
|
|
12720
12754
|
ProgressBar.displayName = "ProgressBar";
|
|
@@ -12722,7 +12756,7 @@ ProgressBar.displayName = "ProgressBar";
|
|
|
12722
12756
|
// src/components/Radio/Radio.tsx
|
|
12723
12757
|
var import_react61 = require("react");
|
|
12724
12758
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
12725
|
-
var
|
|
12759
|
+
var import_type_guards52 = require("@wistia/type-guards");
|
|
12726
12760
|
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
12727
12761
|
var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
12728
12762
|
"svg",
|
|
@@ -12839,14 +12873,14 @@ var Radio = (0, import_react61.forwardRef)(
|
|
|
12839
12873
|
...props
|
|
12840
12874
|
}, ref) => {
|
|
12841
12875
|
const generatedId = (0, import_react61.useId)();
|
|
12842
|
-
const computedId = (0,
|
|
12876
|
+
const computedId = (0, import_type_guards52.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
12843
12877
|
const radioGroupContext = useRadioGroup();
|
|
12844
12878
|
const contextName = radioGroupContext?.name;
|
|
12845
12879
|
const contextOnChange = radioGroupContext?.onChange;
|
|
12846
12880
|
const contextValue = radioGroupContext?.value;
|
|
12847
12881
|
const radioName = name ?? contextName;
|
|
12848
12882
|
const handleOnChange = onChange ?? contextOnChange;
|
|
12849
|
-
const defaultChecked = (0,
|
|
12883
|
+
const defaultChecked = (0, import_type_guards52.isNotUndefined)(value) && (0, import_type_guards52.isNotUndefined)(contextValue) ? contextValue.includes(value) : void 0;
|
|
12850
12884
|
return /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(
|
|
12851
12885
|
StyledRadioWrapper,
|
|
12852
12886
|
{
|
|
@@ -12865,7 +12899,7 @@ var Radio = (0, import_react61.forwardRef)(
|
|
|
12865
12899
|
required,
|
|
12866
12900
|
type: "radio",
|
|
12867
12901
|
value,
|
|
12868
|
-
...(0,
|
|
12902
|
+
...(0, import_type_guards52.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked }
|
|
12869
12903
|
}
|
|
12870
12904
|
),
|
|
12871
12905
|
/* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
@@ -12900,7 +12934,7 @@ var import_react63 = require("react");
|
|
|
12900
12934
|
// src/components/RadioCard/RadioCardRoot.tsx
|
|
12901
12935
|
var import_react62 = require("react");
|
|
12902
12936
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12903
|
-
var
|
|
12937
|
+
var import_type_guards53 = require("@wistia/type-guards");
|
|
12904
12938
|
var import_jsx_runtime261 = require("react/jsx-runtime");
|
|
12905
12939
|
var checkedStyles = import_styled_components78.css`
|
|
12906
12940
|
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
@@ -13021,14 +13055,14 @@ var RadioCardRoot = (0, import_react62.forwardRef)(
|
|
|
13021
13055
|
...props
|
|
13022
13056
|
}, ref) => {
|
|
13023
13057
|
const generatedId = (0, import_react62.useId)();
|
|
13024
|
-
const computedId = (0,
|
|
13058
|
+
const computedId = (0, import_type_guards53.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
13025
13059
|
const radioGroupContext = useRadioGroup();
|
|
13026
13060
|
const contextName = radioGroupContext?.name;
|
|
13027
13061
|
const contextOnChange = radioGroupContext?.onChange;
|
|
13028
13062
|
const contextValue = radioGroupContext?.value;
|
|
13029
13063
|
const radioName = name ?? contextName;
|
|
13030
13064
|
const handleOnChange = onChange ?? contextOnChange;
|
|
13031
|
-
const defaultChecked = (0,
|
|
13065
|
+
const defaultChecked = (0, import_type_guards53.isNotUndefined)(value) && (0, import_type_guards53.isNotUndefined)(contextValue) ? contextValue.includes(value) : void 0;
|
|
13032
13066
|
return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(
|
|
13033
13067
|
StyledCard2,
|
|
13034
13068
|
{
|
|
@@ -13047,7 +13081,7 @@ var RadioCardRoot = (0, import_react62.forwardRef)(
|
|
|
13047
13081
|
onChange: handleOnChange,
|
|
13048
13082
|
type: "radio",
|
|
13049
13083
|
value,
|
|
13050
|
-
...(0,
|
|
13084
|
+
...(0, import_type_guards53.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked }
|
|
13051
13085
|
}
|
|
13052
13086
|
),
|
|
13053
13087
|
children
|
|
@@ -13060,7 +13094,7 @@ RadioCardRoot.displayName = "RadioCardRoot";
|
|
|
13060
13094
|
|
|
13061
13095
|
// src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
13062
13096
|
var import_styled_components80 = __toESM(require("styled-components"));
|
|
13063
|
-
var
|
|
13097
|
+
var import_type_guards54 = require("@wistia/type-guards");
|
|
13064
13098
|
|
|
13065
13099
|
// src/components/RadioCard/RadioCardIndicator.tsx
|
|
13066
13100
|
var import_styled_components79 = __toESM(require("styled-components"));
|
|
@@ -13134,17 +13168,17 @@ var RadioCardDefaultLayout = ({
|
|
|
13134
13168
|
showIndicator = true
|
|
13135
13169
|
}) => {
|
|
13136
13170
|
return /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(StyledCardContent, { children: [
|
|
13137
|
-
showIndicator ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(StyledIndicatorContainer, { $hasIcon: (0,
|
|
13171
|
+
showIndicator ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(StyledIndicatorContainer, { $hasIcon: (0, import_type_guards54.isNotNil)(icon), children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" }) }) : null,
|
|
13138
13172
|
/* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(Stack, { gap: "space-02", children: [
|
|
13139
|
-
(0,
|
|
13173
|
+
(0, import_type_guards54.isNotNil)(icon) && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(StyledCardIcon, { "data-wui-radio-card-icon": true, children: icon }),
|
|
13140
13174
|
/* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(
|
|
13141
13175
|
Stack,
|
|
13142
13176
|
{
|
|
13143
13177
|
gap: "space-01",
|
|
13144
|
-
style: (0,
|
|
13178
|
+
style: (0, import_type_guards54.isNotNil)(icon) ? { paddingLeft: 2 } : void 0,
|
|
13145
13179
|
children: [
|
|
13146
13180
|
/* @__PURE__ */ (0, import_jsx_runtime262.jsx)(Text, { variant: "label3", children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("strong", { children: label }) }),
|
|
13147
|
-
(0,
|
|
13181
|
+
(0, import_type_guards54.isNotNil)(description) && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(
|
|
13148
13182
|
Text,
|
|
13149
13183
|
{
|
|
13150
13184
|
prominence: "secondary",
|
|
@@ -13216,7 +13250,7 @@ RadioCardImage.displayName = "RadioCardImage";
|
|
|
13216
13250
|
var import_react67 = require("react");
|
|
13217
13251
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
13218
13252
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
13219
|
-
var
|
|
13253
|
+
var import_type_guards56 = require("@wistia/type-guards");
|
|
13220
13254
|
|
|
13221
13255
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
13222
13256
|
var import_react65 = require("react");
|
|
@@ -13253,7 +13287,7 @@ var useSelectedItemStyle = () => {
|
|
|
13253
13287
|
|
|
13254
13288
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
13255
13289
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
13256
|
-
var
|
|
13290
|
+
var import_type_guards55 = require("@wistia/type-guards");
|
|
13257
13291
|
|
|
13258
13292
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
13259
13293
|
var import_react66 = require("react");
|
|
@@ -13287,7 +13321,7 @@ var SelectedItemIndicatorDiv = import_styled_components81.default.div`
|
|
|
13287
13321
|
var SelectedItemIndicator = () => {
|
|
13288
13322
|
const selectedValue = useSegmentedControlValue();
|
|
13289
13323
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
13290
|
-
if (!selectedValue || (0,
|
|
13324
|
+
if (!selectedValue || (0, import_type_guards55.isUndefined)(selectedItemIndicatorStyle)) {
|
|
13291
13325
|
return null;
|
|
13292
13326
|
}
|
|
13293
13327
|
return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
@@ -13324,7 +13358,7 @@ var SegmentedControl = (0, import_react67.forwardRef)(
|
|
|
13324
13358
|
onSelectedValueChange,
|
|
13325
13359
|
...props
|
|
13326
13360
|
}, ref) => {
|
|
13327
|
-
if ((0,
|
|
13361
|
+
if ((0, import_type_guards56.isNil)(children)) {
|
|
13328
13362
|
return null;
|
|
13329
13363
|
}
|
|
13330
13364
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
@@ -13353,7 +13387,7 @@ SegmentedControl.displayName = "SegmentedControl";
|
|
|
13353
13387
|
var import_react68 = require("react");
|
|
13354
13388
|
var import_styled_components83 = __toESM(require("styled-components"));
|
|
13355
13389
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
13356
|
-
var
|
|
13390
|
+
var import_type_guards57 = require("@wistia/type-guards");
|
|
13357
13391
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
13358
13392
|
var segmentedControlItemStyles = import_styled_components83.css`
|
|
13359
13393
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -13468,8 +13502,8 @@ var SegmentedControlItem = (0, import_react68.forwardRef)(
|
|
|
13468
13502
|
{
|
|
13469
13503
|
ref: combinedRef,
|
|
13470
13504
|
...otherProps,
|
|
13471
|
-
$hasLabel: (0,
|
|
13472
|
-
"aria-label": (0,
|
|
13505
|
+
$hasLabel: (0, import_type_guards57.isNotNil)(label),
|
|
13506
|
+
"aria-label": (0, import_type_guards57.isNotNil)(label) ? void 0 : ariaLabel,
|
|
13473
13507
|
disabled,
|
|
13474
13508
|
onClick: handleClick,
|
|
13475
13509
|
value,
|
|
@@ -13601,7 +13635,7 @@ Select.displayName = "Select";
|
|
|
13601
13635
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
13602
13636
|
var import_react70 = require("react");
|
|
13603
13637
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
13604
|
-
var
|
|
13638
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
13605
13639
|
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
13606
13640
|
var StyledItem = (0, import_styled_components85.default)(import_react_select2.Item)`
|
|
13607
13641
|
${variantStyleMap2.body3};
|
|
@@ -13645,7 +13679,7 @@ var SelectOption = (0, import_react70.forwardRef)(
|
|
|
13645
13679
|
type: "checkmark"
|
|
13646
13680
|
}
|
|
13647
13681
|
) }) }),
|
|
13648
|
-
(0,
|
|
13682
|
+
(0, import_type_guards58.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)("div", { children: [
|
|
13649
13683
|
children,
|
|
13650
13684
|
/* @__PURE__ */ (0, import_jsx_runtime270.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
13651
13685
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(import_react_select2.ItemText, { children })
|
|
@@ -13680,7 +13714,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
13680
13714
|
// src/components/Slider/Slider.tsx
|
|
13681
13715
|
var import_react_slider = require("@radix-ui/react-slider");
|
|
13682
13716
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
13683
|
-
var
|
|
13717
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
13684
13718
|
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
13685
13719
|
var SliderContainer = import_styled_components87.default.div`
|
|
13686
13720
|
--wui-slider-track-color: var(--wui-gray-6);
|
|
@@ -13759,7 +13793,7 @@ var Slider = ({
|
|
|
13759
13793
|
"data-testid": dataTestId = "ui-slider",
|
|
13760
13794
|
...otherProps
|
|
13761
13795
|
}) => {
|
|
13762
|
-
if (!((0,
|
|
13796
|
+
if (!((0, import_type_guards59.isNonEmptyString)(ariaLabel) || (0, import_type_guards59.isNonEmptyString)(ariaLabelledby))) {
|
|
13763
13797
|
throw new Error(
|
|
13764
13798
|
"UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
|
|
13765
13799
|
);
|
|
@@ -13807,7 +13841,7 @@ Slider.displayName = "Slider";
|
|
|
13807
13841
|
// src/components/Switch/Switch.tsx
|
|
13808
13842
|
var import_react71 = require("react");
|
|
13809
13843
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
13810
|
-
var
|
|
13844
|
+
var import_type_guards60 = require("@wistia/type-guards");
|
|
13811
13845
|
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
13812
13846
|
var sizeSmall3 = import_styled_components88.css`
|
|
13813
13847
|
--wui-size-small-width: 24px;
|
|
@@ -13927,7 +13961,7 @@ var Switch = (0, import_react71.forwardRef)(
|
|
|
13927
13961
|
...props
|
|
13928
13962
|
}, ref) => {
|
|
13929
13963
|
const generatedId = (0, import_react71.useId)();
|
|
13930
|
-
const computedId = (0,
|
|
13964
|
+
const computedId = (0, import_type_guards60.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
13931
13965
|
return /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
13932
13966
|
/* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
|
|
13933
13967
|
StyledHiddenSwitchInput,
|
|
@@ -14083,7 +14117,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
14083
14117
|
// src/components/Tabs/Tabs.tsx
|
|
14084
14118
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
14085
14119
|
var import_react75 = require("react");
|
|
14086
|
-
var
|
|
14120
|
+
var import_type_guards61 = require("@wistia/type-guards");
|
|
14087
14121
|
|
|
14088
14122
|
// src/components/Tabs/useTabsValue.tsx
|
|
14089
14123
|
var import_react74 = require("react");
|
|
@@ -14120,10 +14154,10 @@ var Tabs = ({
|
|
|
14120
14154
|
...props,
|
|
14121
14155
|
onValueChange
|
|
14122
14156
|
};
|
|
14123
|
-
if ((0,
|
|
14157
|
+
if ((0, import_type_guards61.isNotNil)(value)) {
|
|
14124
14158
|
rootProps.value = value;
|
|
14125
14159
|
}
|
|
14126
|
-
if ((0,
|
|
14160
|
+
if ((0, import_type_guards61.isNotNil)(defaultValue)) {
|
|
14127
14161
|
rootProps.defaultValue = defaultValue;
|
|
14128
14162
|
}
|
|
14129
14163
|
return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_react_tabs.Root, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -14143,7 +14177,7 @@ var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
|
14143
14177
|
var import_styled_components96 = __toESM(require("styled-components"));
|
|
14144
14178
|
|
|
14145
14179
|
// src/components/Tabs/SelectedTabIndicator.tsx
|
|
14146
|
-
var
|
|
14180
|
+
var import_type_guards62 = require("@wistia/type-guards");
|
|
14147
14181
|
|
|
14148
14182
|
// src/components/Tabs/TabsSelectedItemIndicatorDiv.tsx
|
|
14149
14183
|
var import_styled_components95 = __toESM(require("styled-components"));
|
|
@@ -14158,7 +14192,7 @@ var import_jsx_runtime282 = require("react/jsx-runtime");
|
|
|
14158
14192
|
var SelectedTabIndicator = () => {
|
|
14159
14193
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
14160
14194
|
const selectedValue = useTabsValue();
|
|
14161
|
-
if (selectedValue == null || (0,
|
|
14195
|
+
if (selectedValue == null || (0, import_type_guards62.isUndefined)(selectedItemIndicatorStyle)) {
|
|
14162
14196
|
return null;
|
|
14163
14197
|
}
|
|
14164
14198
|
return /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(
|
|
@@ -14192,7 +14226,7 @@ TabsList.displayName = "TabsList";
|
|
|
14192
14226
|
|
|
14193
14227
|
// src/components/Tabs/TabsTrigger.tsx
|
|
14194
14228
|
var import_react76 = require("react");
|
|
14195
|
-
var
|
|
14229
|
+
var import_type_guards63 = require("@wistia/type-guards");
|
|
14196
14230
|
|
|
14197
14231
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
14198
14232
|
var import_styled_components97 = __toESM(require("styled-components"));
|
|
@@ -14243,8 +14277,8 @@ var TabsTrigger = (0, import_react76.forwardRef)(
|
|
|
14243
14277
|
{
|
|
14244
14278
|
...otherProps,
|
|
14245
14279
|
ref: combinedRef,
|
|
14246
|
-
$hasLabel: (0,
|
|
14247
|
-
"aria-label": (0,
|
|
14280
|
+
$hasLabel: (0, import_type_guards63.isNotNil)(label),
|
|
14281
|
+
"aria-label": (0, import_type_guards63.isNotNil)(label) ? void 0 : ariaLabel,
|
|
14248
14282
|
disabled,
|
|
14249
14283
|
value,
|
|
14250
14284
|
children: [
|
|
@@ -14259,7 +14293,7 @@ TabsTrigger.displayName = "TabsTrigger";
|
|
|
14259
14293
|
|
|
14260
14294
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
14261
14295
|
var import_styled_components98 = __toESM(require("styled-components"));
|
|
14262
|
-
var
|
|
14296
|
+
var import_type_guards64 = require("@wistia/type-guards");
|
|
14263
14297
|
var import_jsx_runtime285 = require("react/jsx-runtime");
|
|
14264
14298
|
var StyledThumbnailBadge = import_styled_components98.default.div`
|
|
14265
14299
|
align-items: center;
|
|
@@ -14287,7 +14321,7 @@ var StyledThumbnailBadge = import_styled_components98.default.div`
|
|
|
14287
14321
|
`;
|
|
14288
14322
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
14289
14323
|
return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)(StyledThumbnailBadge, { ...props, children: [
|
|
14290
|
-
(0,
|
|
14324
|
+
(0, import_type_guards64.isNotNil)(icon) && icon,
|
|
14291
14325
|
/* @__PURE__ */ (0, import_jsx_runtime285.jsx)("span", { children: label })
|
|
14292
14326
|
] });
|
|
14293
14327
|
};
|
|
@@ -14296,10 +14330,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
|
14296
14330
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
14297
14331
|
var import_react77 = require("react");
|
|
14298
14332
|
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14299
|
-
var
|
|
14333
|
+
var import_type_guards67 = require("@wistia/type-guards");
|
|
14300
14334
|
|
|
14301
14335
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
14302
|
-
var
|
|
14336
|
+
var import_type_guards65 = require("@wistia/type-guards");
|
|
14303
14337
|
var import_styled_components99 = require("styled-components");
|
|
14304
14338
|
var gradients = {
|
|
14305
14339
|
defaultDarkOne: import_styled_components99.css`
|
|
@@ -14427,12 +14461,12 @@ var gradients = {
|
|
|
14427
14461
|
};
|
|
14428
14462
|
var gradientMap = Object.keys(gradients);
|
|
14429
14463
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
14430
|
-
return (0,
|
|
14464
|
+
return (0, import_type_guards65.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
14431
14465
|
};
|
|
14432
14466
|
|
|
14433
14467
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
14434
14468
|
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14435
|
-
var
|
|
14469
|
+
var import_type_guards66 = require("@wistia/type-guards");
|
|
14436
14470
|
var import_jsx_runtime286 = require("react/jsx-runtime");
|
|
14437
14471
|
var ScrubLine = import_styled_components100.default.div`
|
|
14438
14472
|
position: absolute;
|
|
@@ -14518,8 +14552,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
14518
14552
|
);
|
|
14519
14553
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
14520
14554
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
14521
|
-
const showScrubLine = (0,
|
|
14522
|
-
const scrubLinePosition = (0,
|
|
14555
|
+
const showScrubLine = (0, import_type_guards66.isNotNil)(cursorPosition);
|
|
14556
|
+
const scrubLinePosition = (0, import_type_guards66.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
14523
14557
|
const viewerStyles = {
|
|
14524
14558
|
position: "relative",
|
|
14525
14559
|
overflow: "hidden",
|
|
@@ -14590,10 +14624,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
14590
14624
|
);
|
|
14591
14625
|
};
|
|
14592
14626
|
var StyledThumbnail = import_styled_components101.default.div`
|
|
14593
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
14627
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards67.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
14594
14628
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
14595
14629
|
// if we don't have $backgroundUrl show a gradient
|
|
14596
|
-
(0,
|
|
14630
|
+
(0, import_type_guards67.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
14597
14631
|
)};
|
|
14598
14632
|
background-position: center center;
|
|
14599
14633
|
background-size: cover;
|
|
@@ -14635,10 +14669,10 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14635
14669
|
const storyboardElementRef = (0, import_react77.useRef)(null);
|
|
14636
14670
|
const [cursorPosition, setCursorPosition] = (0, import_react77.useState)(null);
|
|
14637
14671
|
const backgroundUrl = (0, import_react77.useMemo)(
|
|
14638
|
-
() => thumbnailImageType === "square" && (0,
|
|
14672
|
+
() => thumbnailImageType === "square" && (0, import_type_guards67.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
14639
14673
|
[thumbnailImageType, thumbnailUrl]
|
|
14640
14674
|
);
|
|
14641
|
-
const isScrubbable = (0,
|
|
14675
|
+
const isScrubbable = (0, import_type_guards67.isNotNil)(storyboard);
|
|
14642
14676
|
const trackStoryboardLoadStatus = (0, import_react77.useCallback)(() => {
|
|
14643
14677
|
if (storyboardElementRef.current || !storyboard) {
|
|
14644
14678
|
return storyboardElementRef.current;
|
|
@@ -14671,7 +14705,7 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14671
14705
|
return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
|
|
14672
14706
|
}, [isScrubbable, isMouseOver, isStoryboardReady]);
|
|
14673
14707
|
const renderStoryboard = (0, import_react77.useCallback)(() => {
|
|
14674
|
-
if (!storyboard || (0,
|
|
14708
|
+
if (!storyboard || (0, import_type_guards67.isUndefined)(height) || (0, import_type_guards67.isEmptyString)(height)) return null;
|
|
14675
14709
|
const {
|
|
14676
14710
|
url,
|
|
14677
14711
|
width: sbWidth,
|
|
@@ -14681,7 +14715,7 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14681
14715
|
frameCount,
|
|
14682
14716
|
aspectRatio
|
|
14683
14717
|
} = storyboard;
|
|
14684
|
-
const targetWidth = (0,
|
|
14718
|
+
const targetWidth = (0, import_type_guards67.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
14685
14719
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
14686
14720
|
return /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(
|
|
14687
14721
|
ThumbnailStoryboardViewer,
|
|
@@ -14702,7 +14736,7 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14702
14736
|
let thumbnailContent = null;
|
|
14703
14737
|
if (shouldRenderStoryboard) {
|
|
14704
14738
|
thumbnailContent = renderStoryboard();
|
|
14705
|
-
} else if ((0,
|
|
14739
|
+
} else if ((0, import_type_guards67.isNotNil)(thumbnailUrl)) {
|
|
14706
14740
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(
|
|
14707
14741
|
ThumbnailImage,
|
|
14708
14742
|
{
|
|
@@ -14727,7 +14761,7 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14727
14761
|
onMouseOut: handleMouseOut,
|
|
14728
14762
|
role: "presentation",
|
|
14729
14763
|
children: [
|
|
14730
|
-
(0,
|
|
14764
|
+
(0, import_type_guards67.isNotNil)(children) ? children : null,
|
|
14731
14765
|
thumbnailContent
|
|
14732
14766
|
]
|
|
14733
14767
|
}
|
|
@@ -14739,7 +14773,7 @@ Thumbnail.displayName = "Thumbnail";
|
|
|
14739
14773
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
14740
14774
|
var import_react78 = __toESM(require("react"));
|
|
14741
14775
|
var import_styled_components102 = __toESM(require("styled-components"));
|
|
14742
|
-
var
|
|
14776
|
+
var import_type_guards68 = require("@wistia/type-guards");
|
|
14743
14777
|
var import_jsx_runtime288 = (
|
|
14744
14778
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
14745
14779
|
require("react/jsx-runtime")
|
|
@@ -14819,7 +14853,7 @@ var ThumbnailCollage = ({
|
|
|
14819
14853
|
}) => {
|
|
14820
14854
|
const thumbnailArray = import_react78.default.Children.toArray(children);
|
|
14821
14855
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
14822
|
-
const thumbnails = (0,
|
|
14856
|
+
const thumbnails = (0, import_type_guards68.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
14823
14857
|
return import_react78.default.cloneElement(child, {
|
|
14824
14858
|
...child.props,
|
|
14825
14859
|
children: void 0
|
|
@@ -14847,7 +14881,7 @@ var ThumbnailCollage = ({
|
|
|
14847
14881
|
|
|
14848
14882
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
14849
14883
|
var import_styled_components103 = __toESM(require("styled-components"));
|
|
14850
|
-
var
|
|
14884
|
+
var import_type_guards69 = require("@wistia/type-guards");
|
|
14851
14885
|
var import_jsx_runtime289 = require("react/jsx-runtime");
|
|
14852
14886
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
14853
14887
|
if (iconOnly) {
|
|
@@ -14960,7 +14994,7 @@ var WistiaLogo = ({
|
|
|
14960
14994
|
...props,
|
|
14961
14995
|
children: [
|
|
14962
14996
|
/* @__PURE__ */ (0, import_jsx_runtime289.jsx)("title", { children: title }),
|
|
14963
|
-
(0,
|
|
14997
|
+
(0, import_type_guards69.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime289.jsx)("desc", { children: description }) : null,
|
|
14964
14998
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
14965
14999
|
renderLogotype(logotypeColor, iconOnly)
|
|
14966
15000
|
]
|
|
@@ -14973,7 +15007,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
14973
15007
|
// src/components/InputPassword/InputPassword.tsx
|
|
14974
15008
|
var import_styled_components104 = __toESM(require("styled-components"));
|
|
14975
15009
|
var import_react79 = require("react");
|
|
14976
|
-
var
|
|
15010
|
+
var import_type_guards70 = require("@wistia/type-guards");
|
|
14977
15011
|
var import_jsx_runtime290 = require("react/jsx-runtime");
|
|
14978
15012
|
var StyledIconButton = (0, import_styled_components104.default)(IconButton)`
|
|
14979
15013
|
/* override size for icon button since prop gets changed by Input */
|
|
@@ -14989,7 +15023,7 @@ var InputPassword = (0, import_react79.forwardRef)(
|
|
|
14989
15023
|
const handleClick = () => {
|
|
14990
15024
|
const newVisibility = !isVisible;
|
|
14991
15025
|
setIsVisible(newVisibility);
|
|
14992
|
-
if ((0,
|
|
15026
|
+
if ((0, import_type_guards70.isFunction)(onVisibilityToggle)) {
|
|
14993
15027
|
onVisibilityToggle(newVisibility);
|
|
14994
15028
|
}
|
|
14995
15029
|
};
|
|
@@ -15016,6 +15050,65 @@ var InputPassword = (0, import_react79.forwardRef)(
|
|
|
15016
15050
|
}
|
|
15017
15051
|
);
|
|
15018
15052
|
InputPassword.displayName = "InputPassword";
|
|
15053
|
+
|
|
15054
|
+
// src/components/ContextMenu/ContextMenu.tsx
|
|
15055
|
+
var import_react80 = require("react");
|
|
15056
|
+
var import_type_guards71 = require("@wistia/type-guards");
|
|
15057
|
+
var import_jsx_runtime291 = require("react/jsx-runtime");
|
|
15058
|
+
var ContextMenu = ({
|
|
15059
|
+
position,
|
|
15060
|
+
triggerRef,
|
|
15061
|
+
children,
|
|
15062
|
+
onRequestClose = () => null
|
|
15063
|
+
}) => {
|
|
15064
|
+
const [isRightClicked, setIsRightClicked] = (0, import_react80.useState)(false);
|
|
15065
|
+
const [menuPosition, setMenuPosition] = (0, import_react80.useState)(position ?? { x: 0, y: 0 });
|
|
15066
|
+
(0, import_react80.useEffect)(() => {
|
|
15067
|
+
if ((0, import_type_guards71.isNil)(position)) {
|
|
15068
|
+
const onContextMenu = (event) => {
|
|
15069
|
+
event.preventDefault();
|
|
15070
|
+
setMenuPosition({ x: event.clientX, y: event.clientY });
|
|
15071
|
+
setIsRightClicked(true);
|
|
15072
|
+
};
|
|
15073
|
+
const triggerEl = triggerRef?.current;
|
|
15074
|
+
triggerEl?.addEventListener("contextmenu", onContextMenu);
|
|
15075
|
+
return () => {
|
|
15076
|
+
triggerEl?.removeEventListener("contextmenu", onContextMenu);
|
|
15077
|
+
};
|
|
15078
|
+
}
|
|
15079
|
+
return () => null;
|
|
15080
|
+
}, [position, triggerRef]);
|
|
15081
|
+
const isOpen = (0, import_type_guards71.isNotNil)(position) || isRightClicked;
|
|
15082
|
+
return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(
|
|
15083
|
+
Menu,
|
|
15084
|
+
{
|
|
15085
|
+
avoidCollisions: false,
|
|
15086
|
+
isOpen,
|
|
15087
|
+
onOpenChange: (next) => {
|
|
15088
|
+
setIsRightClicked(next);
|
|
15089
|
+
if (!next) {
|
|
15090
|
+
onRequestClose();
|
|
15091
|
+
}
|
|
15092
|
+
},
|
|
15093
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(
|
|
15094
|
+
"button",
|
|
15095
|
+
{
|
|
15096
|
+
"aria-label": "context menu",
|
|
15097
|
+
style: {
|
|
15098
|
+
width: "1px",
|
|
15099
|
+
height: "1px",
|
|
15100
|
+
all: "unset",
|
|
15101
|
+
position: "fixed",
|
|
15102
|
+
top: menuPosition.y,
|
|
15103
|
+
left: menuPosition.x
|
|
15104
|
+
},
|
|
15105
|
+
type: "button"
|
|
15106
|
+
}
|
|
15107
|
+
),
|
|
15108
|
+
children
|
|
15109
|
+
}
|
|
15110
|
+
) : null;
|
|
15111
|
+
};
|
|
15019
15112
|
// Annotate the CommonJS export names for ESM import in node:
|
|
15020
15113
|
0 && (module.exports = {
|
|
15021
15114
|
ActionButton,
|
|
@@ -15040,6 +15133,7 @@ InputPassword.displayName = "InputPassword";
|
|
|
15040
15133
|
ColorSchemeWrapper,
|
|
15041
15134
|
Combobox,
|
|
15042
15135
|
ComboboxOption,
|
|
15136
|
+
ContextMenu,
|
|
15043
15137
|
DataCard,
|
|
15044
15138
|
DataCardTrend,
|
|
15045
15139
|
DataCards,
|