@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.cjs
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
|
*
|
|
@@ -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) {
|
|
@@ -10647,11 +10680,13 @@ var StyledInput = (0, import_styled_components56.default)(Input)`
|
|
|
10647
10680
|
}
|
|
10648
10681
|
|
|
10649
10682
|
&& {
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
--wui-input-
|
|
10683
|
+
${({ $variant }) => variantStyleMap[$variant]}
|
|
10684
|
+
/* The input font styles (edit mode) needs the same font styles as Heading */
|
|
10685
|
+
--wui-input-font-size: var(--font-size);
|
|
10686
|
+
--wui-input-font-weight: var(--font-weight);
|
|
10687
|
+
--wui-input-line-height: var(--line-height);
|
|
10653
10688
|
|
|
10654
|
-
font-family: var(--
|
|
10689
|
+
font-family: var(--font-family);
|
|
10655
10690
|
width: 100%;
|
|
10656
10691
|
padding: var(--wui-space-02);
|
|
10657
10692
|
border: none;
|
|
@@ -10683,6 +10718,7 @@ var EditableHeading = ({
|
|
|
10683
10718
|
onEditingChange,
|
|
10684
10719
|
tooltipText = "Click to edit title",
|
|
10685
10720
|
ariaLabel = "Edit title",
|
|
10721
|
+
variant = "heading1",
|
|
10686
10722
|
__forceEditing = false,
|
|
10687
10723
|
editingDisabled = false
|
|
10688
10724
|
}) => {
|
|
@@ -10729,7 +10765,7 @@ var EditableHeading = ({
|
|
|
10729
10765
|
ref: headingRef,
|
|
10730
10766
|
$editingDisabled: editingDisabled,
|
|
10731
10767
|
onClick: () => handleSetEditing(true),
|
|
10732
|
-
variant
|
|
10768
|
+
variant,
|
|
10733
10769
|
children: value
|
|
10734
10770
|
}
|
|
10735
10771
|
);
|
|
@@ -10741,6 +10777,7 @@ var EditableHeading = ({
|
|
|
10741
10777
|
StyledInput,
|
|
10742
10778
|
{
|
|
10743
10779
|
$height: headingHeight,
|
|
10780
|
+
$variant: variant,
|
|
10744
10781
|
autoFocus: true,
|
|
10745
10782
|
fullWidth: true,
|
|
10746
10783
|
onBlur: handleFinishEditing,
|
|
@@ -10806,7 +10843,7 @@ var useFormState = (action, initialData = {}) => {
|
|
|
10806
10843
|
|
|
10807
10844
|
// src/components/Form/FormErrorSummary.tsx
|
|
10808
10845
|
var import_react47 = require("react");
|
|
10809
|
-
var
|
|
10846
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
10810
10847
|
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
10811
10848
|
var ErrorItem = ({ name, error, formId }) => {
|
|
10812
10849
|
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
@@ -10820,8 +10857,8 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10820
10857
|
}
|
|
10821
10858
|
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { ref, children: [
|
|
10822
10859
|
/* @__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,
|
|
10860
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards37.isNotUndefined)(error)).map(
|
|
10861
|
+
([name, error]) => (0, import_type_guards37.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
10825
10862
|
ErrorItem,
|
|
10826
10863
|
{
|
|
10827
10864
|
error: err,
|
|
@@ -10845,7 +10882,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10845
10882
|
// src/components/FormField/FormField.tsx
|
|
10846
10883
|
var import_react48 = require("react");
|
|
10847
10884
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
10848
|
-
var
|
|
10885
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
10849
10886
|
|
|
10850
10887
|
// src/components/Label/Label.tsx
|
|
10851
10888
|
var import_styled_components57 = __toESM(require("styled-components"));
|
|
@@ -10948,7 +10985,7 @@ var StyledErrorList = import_styled_components58.default.ul`
|
|
|
10948
10985
|
gap: var(--wui-space-01);
|
|
10949
10986
|
`;
|
|
10950
10987
|
var ErrorMessages = ({ errors, id }) => {
|
|
10951
|
-
const isErrorArray = (0,
|
|
10988
|
+
const isErrorArray = (0, import_type_guards38.isArray)(errors);
|
|
10952
10989
|
const isMultipleErrors = isErrorArray && errors.length > 1;
|
|
10953
10990
|
if (!isErrorArray) {
|
|
10954
10991
|
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
@@ -11016,19 +11053,19 @@ var FormField = ({
|
|
|
11016
11053
|
"aria-describedby": ariaDescribedby,
|
|
11017
11054
|
...props
|
|
11018
11055
|
};
|
|
11019
|
-
if ((0,
|
|
11056
|
+
if ((0, import_type_guards38.isUndefined)(value) && (0, import_type_guards38.isNotUndefined)(defaultValue)) {
|
|
11020
11057
|
childProps = {
|
|
11021
11058
|
...childProps,
|
|
11022
11059
|
defaultValue
|
|
11023
11060
|
};
|
|
11024
11061
|
}
|
|
11025
|
-
if ((0,
|
|
11026
|
-
const computedName = (0,
|
|
11062
|
+
if ((0, import_type_guards38.isNotNil)(checkboxGroup)) {
|
|
11063
|
+
const computedName = (0, import_type_guards38.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
11027
11064
|
const handleChange = (event) => {
|
|
11028
|
-
if ((0,
|
|
11065
|
+
if ((0, import_type_guards38.isNotUndefined)(props.onChange)) {
|
|
11029
11066
|
props.onChange(event);
|
|
11030
11067
|
}
|
|
11031
|
-
if ((0,
|
|
11068
|
+
if ((0, import_type_guards38.isNotUndefined)(checkboxGroup.onChange)) {
|
|
11032
11069
|
checkboxGroup.onChange(event);
|
|
11033
11070
|
}
|
|
11034
11071
|
};
|
|
@@ -11036,7 +11073,7 @@ var FormField = ({
|
|
|
11036
11073
|
...childProps,
|
|
11037
11074
|
name: computedName,
|
|
11038
11075
|
onChange: handleChange,
|
|
11039
|
-
"aria-invalid": (0,
|
|
11076
|
+
"aria-invalid": (0, import_type_guards38.isNotNil)(error)
|
|
11040
11077
|
};
|
|
11041
11078
|
}
|
|
11042
11079
|
import_react48.Children.only(children);
|
|
@@ -11047,9 +11084,9 @@ var FormField = ({
|
|
|
11047
11084
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
11048
11085
|
children: [
|
|
11049
11086
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
11050
|
-
(0,
|
|
11087
|
+
(0, import_type_guards38.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
11051
11088
|
(0, import_react48.cloneElement)(children, childProps),
|
|
11052
|
-
(0,
|
|
11089
|
+
(0, import_type_guards38.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(import_jsx_runtime236.Fragment, { children: [
|
|
11053
11090
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)("div", {}),
|
|
11054
11091
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
11055
11092
|
ErrorMessages,
|
|
@@ -11095,7 +11132,7 @@ RadioGroup.displayName = "RadioGroup";
|
|
|
11095
11132
|
// src/components/Grid/Grid.tsx
|
|
11096
11133
|
var import_react50 = require("react");
|
|
11097
11134
|
var import_styled_components59 = __toESM(require("styled-components"));
|
|
11098
|
-
var
|
|
11135
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
11099
11136
|
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
11100
11137
|
var DEFAULT_ELEMENT5 = "div";
|
|
11101
11138
|
var StyledGrid = import_styled_components59.default.div`
|
|
@@ -11142,7 +11179,7 @@ var StyledGrid = import_styled_components59.default.div`
|
|
|
11142
11179
|
var GridComponent = (0, import_react50.forwardRef)(
|
|
11143
11180
|
({ children, columns = "auto", minChildWidth = "auto", gap = "space-02", renderAs, ...props }, ref) => {
|
|
11144
11181
|
const responsiveGap = useResponsiveProp(gap);
|
|
11145
|
-
const { column, row } = (0,
|
|
11182
|
+
const { column, row } = (0, import_type_guards39.isRecord)(responsiveGap) ? responsiveGap : { column: responsiveGap, row: responsiveGap };
|
|
11146
11183
|
const responsiveColumns = useResponsiveProp(columns);
|
|
11147
11184
|
const responsiveMinChildWidth = useResponsiveProp(minChildWidth);
|
|
11148
11185
|
return /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
@@ -11166,7 +11203,7 @@ var Grid = makePolymorphic(GridComponent);
|
|
|
11166
11203
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
11167
11204
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
11168
11205
|
var import_react51 = require("react");
|
|
11169
|
-
var
|
|
11206
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
11170
11207
|
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
11171
11208
|
var StyledInput2 = (0, import_styled_components60.default)(Input)`
|
|
11172
11209
|
&:not([aria-disabled='true']) {
|
|
@@ -11194,12 +11231,12 @@ var InputClickToCopy = (0, import_react51.forwardRef)(
|
|
|
11194
11231
|
}, [isCopied]);
|
|
11195
11232
|
const handleClick = (event) => {
|
|
11196
11233
|
event.preventDefault();
|
|
11197
|
-
if ((0,
|
|
11234
|
+
if ((0, import_type_guards40.isFunction)(props.onClick)) {
|
|
11198
11235
|
props.onClick(event);
|
|
11199
11236
|
}
|
|
11200
11237
|
void copyToClipboard(value).then(() => {
|
|
11201
11238
|
setIsCopied(true);
|
|
11202
|
-
if ((0,
|
|
11239
|
+
if ((0, import_type_guards40.isFunction)(onCopy)) {
|
|
11203
11240
|
onCopy(value);
|
|
11204
11241
|
}
|
|
11205
11242
|
return value;
|
|
@@ -11229,7 +11266,7 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
11229
11266
|
|
|
11230
11267
|
// src/components/KeyboardShortcut/KeyboardShortcut.tsx
|
|
11231
11268
|
var import_styled_components61 = __toESM(require("styled-components"));
|
|
11232
|
-
var
|
|
11269
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
11233
11270
|
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
11234
11271
|
var StyledKeyboardShortcut = import_styled_components61.default.div`
|
|
11235
11272
|
align-items: center;
|
|
@@ -11323,7 +11360,7 @@ var KeyboardShortcut = ({
|
|
|
11323
11360
|
$fullWidth: fullWidth,
|
|
11324
11361
|
...otherProps,
|
|
11325
11362
|
children: [
|
|
11326
|
-
(0,
|
|
11363
|
+
(0, import_type_guards41.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(Label2, { children: label }),
|
|
11327
11364
|
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
11328
11365
|
StyledKey,
|
|
11329
11366
|
{
|
|
@@ -11337,18 +11374,18 @@ var KeyboardShortcut = ({
|
|
|
11337
11374
|
KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
11338
11375
|
|
|
11339
11376
|
// src/components/List/List.tsx
|
|
11340
|
-
var
|
|
11377
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
11341
11378
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
11342
11379
|
|
|
11343
11380
|
// src/components/List/ListItem.tsx
|
|
11344
11381
|
var import_styled_components62 = __toESM(require("styled-components"));
|
|
11345
|
-
var
|
|
11382
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
11346
11383
|
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
11347
11384
|
var ListItemComponent = import_styled_components62.default.li`
|
|
11348
11385
|
margin-bottom: var(--wui-space-02);
|
|
11349
11386
|
`;
|
|
11350
11387
|
var ListItem = ({ children }) => {
|
|
11351
|
-
if ((0,
|
|
11388
|
+
if ((0, import_type_guards42.isNil)(children)) {
|
|
11352
11389
|
return null;
|
|
11353
11390
|
}
|
|
11354
11391
|
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(ListItemComponent, { children });
|
|
@@ -11478,13 +11515,13 @@ var List = ({
|
|
|
11478
11515
|
...otherProps
|
|
11479
11516
|
}) => {
|
|
11480
11517
|
const listVariant = variant ?? "bullets";
|
|
11481
|
-
if ((0,
|
|
11518
|
+
if ((0, import_type_guards43.isNotNil)(children)) {
|
|
11482
11519
|
if (Array.isArray(children) && !children.length) {
|
|
11483
11520
|
return null;
|
|
11484
11521
|
}
|
|
11485
11522
|
return renderListComponent(children, listVariant, otherProps);
|
|
11486
11523
|
}
|
|
11487
|
-
if ((0,
|
|
11524
|
+
if ((0, import_type_guards43.isNotNil)(items)) {
|
|
11488
11525
|
if (!items.length) {
|
|
11489
11526
|
return null;
|
|
11490
11527
|
}
|
|
@@ -11498,7 +11535,7 @@ List.displayName = "List";
|
|
|
11498
11535
|
var import_react53 = require("react");
|
|
11499
11536
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
11500
11537
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
11501
|
-
var
|
|
11538
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
11502
11539
|
|
|
11503
11540
|
// src/components/Menu/MenuContext.tsx
|
|
11504
11541
|
var import_react52 = require("react");
|
|
@@ -11611,7 +11648,7 @@ var Menu = (0, import_react53.forwardRef)(
|
|
|
11611
11648
|
}, ref) => {
|
|
11612
11649
|
const contextValue = (0, import_react53.useMemo)(() => ({ compact }), [compact]);
|
|
11613
11650
|
let controlProps = {
|
|
11614
|
-
...(0,
|
|
11651
|
+
...(0, import_type_guards44.isNotNil)(onOpenChange) && (0, import_type_guards44.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
11615
11652
|
};
|
|
11616
11653
|
if (disabled) {
|
|
11617
11654
|
controlProps = {
|
|
@@ -11625,7 +11662,7 @@ var Menu = (0, import_react53.forwardRef)(
|
|
|
11625
11662
|
modal: false,
|
|
11626
11663
|
...controlProps,
|
|
11627
11664
|
children: [
|
|
11628
|
-
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0,
|
|
11665
|
+
/* @__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
11666
|
Button,
|
|
11630
11667
|
{
|
|
11631
11668
|
ref,
|
|
@@ -11644,10 +11681,11 @@ var Menu = (0, import_react53.forwardRef)(
|
|
|
11644
11681
|
$compact: compact,
|
|
11645
11682
|
align,
|
|
11646
11683
|
collisionPadding: 8,
|
|
11647
|
-
sideOffset: 6,
|
|
11648
11684
|
onFocusOutside: (event) => {
|
|
11649
11685
|
event.preventDefault();
|
|
11650
11686
|
},
|
|
11687
|
+
side: "bottom",
|
|
11688
|
+
sideOffset: 6,
|
|
11651
11689
|
children
|
|
11652
11690
|
}
|
|
11653
11691
|
) })
|
|
@@ -11690,12 +11728,12 @@ MenuLabel.displayName = "MenuLabel";
|
|
|
11690
11728
|
var import_react55 = require("react");
|
|
11691
11729
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11692
11730
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
11693
|
-
var
|
|
11731
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
11694
11732
|
|
|
11695
11733
|
// src/components/Menu/MenuItemButton.tsx
|
|
11696
11734
|
var import_react54 = require("react");
|
|
11697
11735
|
var import_styled_components66 = __toESM(require("styled-components"));
|
|
11698
|
-
var
|
|
11736
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
11699
11737
|
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
11700
11738
|
var StyledButton3 = (0, import_styled_components66.default)(Button)`
|
|
11701
11739
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -11773,7 +11811,7 @@ var StyledBadgeContainer = import_styled_components66.default.div`
|
|
|
11773
11811
|
var MenuItemButton = (0, import_react54.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
11774
11812
|
let { colorScheme, badge } = props;
|
|
11775
11813
|
if (appearance === "dangerous") {
|
|
11776
|
-
if ((0,
|
|
11814
|
+
if ((0, import_type_guards45.isNotUndefined)(colorScheme)) {
|
|
11777
11815
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
11778
11816
|
}
|
|
11779
11817
|
colorScheme = "error";
|
|
@@ -11803,7 +11841,7 @@ var MenuItemButton = (0, import_react54.forwardRef)(({ children, appearance, com
|
|
|
11803
11841
|
children: [
|
|
11804
11842
|
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
11805
11843
|
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
11806
|
-
(0,
|
|
11844
|
+
(0, import_type_guards45.isNotNil)(badge) || (0, import_type_guards45.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
11807
11845
|
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
11808
11846
|
]
|
|
11809
11847
|
}
|
|
@@ -11875,7 +11913,7 @@ var SubMenu = ({
|
|
|
11875
11913
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
11876
11914
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
11877
11915
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(MenuItemLabel, { children: label }),
|
|
11878
|
-
(0,
|
|
11916
|
+
(0, import_type_guards46.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(MenuItemDescription, { children: description }) : null
|
|
11879
11917
|
] }),
|
|
11880
11918
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
11881
11919
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
@@ -11967,7 +12005,7 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
11967
12005
|
|
|
11968
12006
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
11969
12007
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
11970
|
-
var
|
|
12008
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
11971
12009
|
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
11972
12010
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
11973
12011
|
return checked ? /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
@@ -12041,8 +12079,8 @@ var CheckboxMenuItem = ({
|
|
|
12041
12079
|
MenuItemButton,
|
|
12042
12080
|
{
|
|
12043
12081
|
...props,
|
|
12044
|
-
leftIcon: (0,
|
|
12045
|
-
rightIcon: (0,
|
|
12082
|
+
leftIcon: (0, import_type_guards47.isNotNil)(props.icon) ? props.icon : /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(CheckboxIndicator, { checked }),
|
|
12083
|
+
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
12084
|
}
|
|
12047
12085
|
)
|
|
12048
12086
|
}
|
|
@@ -12156,7 +12194,7 @@ FilterMenu.displayName = "FilterMenu";
|
|
|
12156
12194
|
var import_react60 = require("react");
|
|
12157
12195
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
12158
12196
|
var import_react_dialog5 = require("@radix-ui/react-dialog");
|
|
12159
|
-
var
|
|
12197
|
+
var import_type_guards49 = require("@wistia/type-guards");
|
|
12160
12198
|
|
|
12161
12199
|
// src/components/Modal/ModalHeader.tsx
|
|
12162
12200
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
@@ -12219,7 +12257,7 @@ var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
|
12219
12257
|
|
|
12220
12258
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
12221
12259
|
var import_react58 = require("react");
|
|
12222
|
-
var
|
|
12260
|
+
var import_type_guards48 = require("@wistia/type-guards");
|
|
12223
12261
|
var useFocusRestore = () => {
|
|
12224
12262
|
const previouslyFocusedRef = (0, import_react58.useRef)(null);
|
|
12225
12263
|
(0, import_react58.useEffect)(() => {
|
|
@@ -12227,7 +12265,7 @@ var useFocusRestore = () => {
|
|
|
12227
12265
|
}, []);
|
|
12228
12266
|
(0, import_react58.useEffect)(() => {
|
|
12229
12267
|
return () => {
|
|
12230
|
-
if ((0,
|
|
12268
|
+
if ((0, import_type_guards48.isNotNil)(previouslyFocusedRef.current)) {
|
|
12231
12269
|
setTimeout(() => {
|
|
12232
12270
|
previouslyFocusedRef.current?.focus();
|
|
12233
12271
|
}, 0);
|
|
@@ -12439,7 +12477,7 @@ var Modal = (0, import_react60.forwardRef)(
|
|
|
12439
12477
|
import_react_dialog5.Root,
|
|
12440
12478
|
{
|
|
12441
12479
|
onOpenChange: (open2) => {
|
|
12442
|
-
if (!open2 && (0,
|
|
12480
|
+
if (!open2 && (0, import_type_guards49.isNotNil)(onRequestClose)) {
|
|
12443
12481
|
onRequestClose();
|
|
12444
12482
|
}
|
|
12445
12483
|
},
|
|
@@ -12451,7 +12489,7 @@ var Modal = (0, import_react60.forwardRef)(
|
|
|
12451
12489
|
{
|
|
12452
12490
|
ref,
|
|
12453
12491
|
onOpenAutoFocus: (event) => {
|
|
12454
|
-
if ((0,
|
|
12492
|
+
if ((0, import_type_guards49.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
12455
12493
|
event.preventDefault();
|
|
12456
12494
|
requestAnimationFrame(() => {
|
|
12457
12495
|
initialFocusRef.current?.focus();
|
|
@@ -12486,9 +12524,9 @@ var import_react_popover2 = require("@radix-ui/react-popover");
|
|
|
12486
12524
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
12487
12525
|
|
|
12488
12526
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
12489
|
-
var
|
|
12527
|
+
var import_type_guards50 = require("@wistia/type-guards");
|
|
12490
12528
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
12491
|
-
return (0,
|
|
12529
|
+
return (0, import_type_guards50.isNotNil)(onOpenChange) && (0, import_type_guards50.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
12492
12530
|
};
|
|
12493
12531
|
|
|
12494
12532
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -12643,7 +12681,7 @@ Popover2.displayName = "Popover";
|
|
|
12643
12681
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
12644
12682
|
var import_styled_components76 = __toESM(require("styled-components"));
|
|
12645
12683
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
12646
|
-
var
|
|
12684
|
+
var import_type_guards51 = require("@wistia/type-guards");
|
|
12647
12685
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
12648
12686
|
var ProgressBarWrapper = import_styled_components76.default.div`
|
|
12649
12687
|
--progress-bar-height: 8px;
|
|
@@ -12698,7 +12736,7 @@ var ProgressBar = ({
|
|
|
12698
12736
|
...props
|
|
12699
12737
|
}) => {
|
|
12700
12738
|
return /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(ProgressBarWrapper, { children: [
|
|
12701
|
-
(0,
|
|
12739
|
+
(0, import_type_guards51.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
12702
12740
|
/* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
12703
12741
|
StyledProgressBar,
|
|
12704
12742
|
{
|
|
@@ -12714,7 +12752,7 @@ var ProgressBar = ({
|
|
|
12714
12752
|
)
|
|
12715
12753
|
}
|
|
12716
12754
|
),
|
|
12717
|
-
(0,
|
|
12755
|
+
(0, import_type_guards51.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
12718
12756
|
] });
|
|
12719
12757
|
};
|
|
12720
12758
|
ProgressBar.displayName = "ProgressBar";
|
|
@@ -12722,7 +12760,7 @@ ProgressBar.displayName = "ProgressBar";
|
|
|
12722
12760
|
// src/components/Radio/Radio.tsx
|
|
12723
12761
|
var import_react61 = require("react");
|
|
12724
12762
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
12725
|
-
var
|
|
12763
|
+
var import_type_guards52 = require("@wistia/type-guards");
|
|
12726
12764
|
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
12727
12765
|
var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
12728
12766
|
"svg",
|
|
@@ -12839,14 +12877,14 @@ var Radio = (0, import_react61.forwardRef)(
|
|
|
12839
12877
|
...props
|
|
12840
12878
|
}, ref) => {
|
|
12841
12879
|
const generatedId = (0, import_react61.useId)();
|
|
12842
|
-
const computedId = (0,
|
|
12880
|
+
const computedId = (0, import_type_guards52.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
12843
12881
|
const radioGroupContext = useRadioGroup();
|
|
12844
12882
|
const contextName = radioGroupContext?.name;
|
|
12845
12883
|
const contextOnChange = radioGroupContext?.onChange;
|
|
12846
12884
|
const contextValue = radioGroupContext?.value;
|
|
12847
12885
|
const radioName = name ?? contextName;
|
|
12848
12886
|
const handleOnChange = onChange ?? contextOnChange;
|
|
12849
|
-
const defaultChecked = (0,
|
|
12887
|
+
const defaultChecked = (0, import_type_guards52.isNotUndefined)(value) && (0, import_type_guards52.isNotUndefined)(contextValue) ? contextValue.includes(value) : void 0;
|
|
12850
12888
|
return /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(
|
|
12851
12889
|
StyledRadioWrapper,
|
|
12852
12890
|
{
|
|
@@ -12865,7 +12903,7 @@ var Radio = (0, import_react61.forwardRef)(
|
|
|
12865
12903
|
required,
|
|
12866
12904
|
type: "radio",
|
|
12867
12905
|
value,
|
|
12868
|
-
...(0,
|
|
12906
|
+
...(0, import_type_guards52.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked }
|
|
12869
12907
|
}
|
|
12870
12908
|
),
|
|
12871
12909
|
/* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
@@ -12900,7 +12938,7 @@ var import_react63 = require("react");
|
|
|
12900
12938
|
// src/components/RadioCard/RadioCardRoot.tsx
|
|
12901
12939
|
var import_react62 = require("react");
|
|
12902
12940
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12903
|
-
var
|
|
12941
|
+
var import_type_guards53 = require("@wistia/type-guards");
|
|
12904
12942
|
var import_jsx_runtime261 = require("react/jsx-runtime");
|
|
12905
12943
|
var checkedStyles = import_styled_components78.css`
|
|
12906
12944
|
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
@@ -13021,14 +13059,14 @@ var RadioCardRoot = (0, import_react62.forwardRef)(
|
|
|
13021
13059
|
...props
|
|
13022
13060
|
}, ref) => {
|
|
13023
13061
|
const generatedId = (0, import_react62.useId)();
|
|
13024
|
-
const computedId = (0,
|
|
13062
|
+
const computedId = (0, import_type_guards53.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
13025
13063
|
const radioGroupContext = useRadioGroup();
|
|
13026
13064
|
const contextName = radioGroupContext?.name;
|
|
13027
13065
|
const contextOnChange = radioGroupContext?.onChange;
|
|
13028
13066
|
const contextValue = radioGroupContext?.value;
|
|
13029
13067
|
const radioName = name ?? contextName;
|
|
13030
13068
|
const handleOnChange = onChange ?? contextOnChange;
|
|
13031
|
-
const defaultChecked = (0,
|
|
13069
|
+
const defaultChecked = (0, import_type_guards53.isNotUndefined)(value) && (0, import_type_guards53.isNotUndefined)(contextValue) ? contextValue.includes(value) : void 0;
|
|
13032
13070
|
return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(
|
|
13033
13071
|
StyledCard2,
|
|
13034
13072
|
{
|
|
@@ -13047,7 +13085,7 @@ var RadioCardRoot = (0, import_react62.forwardRef)(
|
|
|
13047
13085
|
onChange: handleOnChange,
|
|
13048
13086
|
type: "radio",
|
|
13049
13087
|
value,
|
|
13050
|
-
...(0,
|
|
13088
|
+
...(0, import_type_guards53.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked }
|
|
13051
13089
|
}
|
|
13052
13090
|
),
|
|
13053
13091
|
children
|
|
@@ -13060,7 +13098,7 @@ RadioCardRoot.displayName = "RadioCardRoot";
|
|
|
13060
13098
|
|
|
13061
13099
|
// src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
13062
13100
|
var import_styled_components80 = __toESM(require("styled-components"));
|
|
13063
|
-
var
|
|
13101
|
+
var import_type_guards54 = require("@wistia/type-guards");
|
|
13064
13102
|
|
|
13065
13103
|
// src/components/RadioCard/RadioCardIndicator.tsx
|
|
13066
13104
|
var import_styled_components79 = __toESM(require("styled-components"));
|
|
@@ -13134,17 +13172,17 @@ var RadioCardDefaultLayout = ({
|
|
|
13134
13172
|
showIndicator = true
|
|
13135
13173
|
}) => {
|
|
13136
13174
|
return /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(StyledCardContent, { children: [
|
|
13137
|
-
showIndicator ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(StyledIndicatorContainer, { $hasIcon: (0,
|
|
13175
|
+
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
13176
|
/* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(Stack, { gap: "space-02", children: [
|
|
13139
|
-
(0,
|
|
13177
|
+
(0, import_type_guards54.isNotNil)(icon) && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(StyledCardIcon, { "data-wui-radio-card-icon": true, children: icon }),
|
|
13140
13178
|
/* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(
|
|
13141
13179
|
Stack,
|
|
13142
13180
|
{
|
|
13143
13181
|
gap: "space-01",
|
|
13144
|
-
style: (0,
|
|
13182
|
+
style: (0, import_type_guards54.isNotNil)(icon) ? { paddingLeft: 2 } : void 0,
|
|
13145
13183
|
children: [
|
|
13146
13184
|
/* @__PURE__ */ (0, import_jsx_runtime262.jsx)(Text, { variant: "label3", children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("strong", { children: label }) }),
|
|
13147
|
-
(0,
|
|
13185
|
+
(0, import_type_guards54.isNotNil)(description) && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(
|
|
13148
13186
|
Text,
|
|
13149
13187
|
{
|
|
13150
13188
|
prominence: "secondary",
|
|
@@ -13216,7 +13254,7 @@ RadioCardImage.displayName = "RadioCardImage";
|
|
|
13216
13254
|
var import_react67 = require("react");
|
|
13217
13255
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
13218
13256
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
13219
|
-
var
|
|
13257
|
+
var import_type_guards56 = require("@wistia/type-guards");
|
|
13220
13258
|
|
|
13221
13259
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
13222
13260
|
var import_react65 = require("react");
|
|
@@ -13253,7 +13291,7 @@ var useSelectedItemStyle = () => {
|
|
|
13253
13291
|
|
|
13254
13292
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
13255
13293
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
13256
|
-
var
|
|
13294
|
+
var import_type_guards55 = require("@wistia/type-guards");
|
|
13257
13295
|
|
|
13258
13296
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
13259
13297
|
var import_react66 = require("react");
|
|
@@ -13287,7 +13325,7 @@ var SelectedItemIndicatorDiv = import_styled_components81.default.div`
|
|
|
13287
13325
|
var SelectedItemIndicator = () => {
|
|
13288
13326
|
const selectedValue = useSegmentedControlValue();
|
|
13289
13327
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
13290
|
-
if (!selectedValue || (0,
|
|
13328
|
+
if (!selectedValue || (0, import_type_guards55.isUndefined)(selectedItemIndicatorStyle)) {
|
|
13291
13329
|
return null;
|
|
13292
13330
|
}
|
|
13293
13331
|
return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
@@ -13324,7 +13362,7 @@ var SegmentedControl = (0, import_react67.forwardRef)(
|
|
|
13324
13362
|
onSelectedValueChange,
|
|
13325
13363
|
...props
|
|
13326
13364
|
}, ref) => {
|
|
13327
|
-
if ((0,
|
|
13365
|
+
if ((0, import_type_guards56.isNil)(children)) {
|
|
13328
13366
|
return null;
|
|
13329
13367
|
}
|
|
13330
13368
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
@@ -13353,7 +13391,7 @@ SegmentedControl.displayName = "SegmentedControl";
|
|
|
13353
13391
|
var import_react68 = require("react");
|
|
13354
13392
|
var import_styled_components83 = __toESM(require("styled-components"));
|
|
13355
13393
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
13356
|
-
var
|
|
13394
|
+
var import_type_guards57 = require("@wistia/type-guards");
|
|
13357
13395
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
13358
13396
|
var segmentedControlItemStyles = import_styled_components83.css`
|
|
13359
13397
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -13468,8 +13506,8 @@ var SegmentedControlItem = (0, import_react68.forwardRef)(
|
|
|
13468
13506
|
{
|
|
13469
13507
|
ref: combinedRef,
|
|
13470
13508
|
...otherProps,
|
|
13471
|
-
$hasLabel: (0,
|
|
13472
|
-
"aria-label": (0,
|
|
13509
|
+
$hasLabel: (0, import_type_guards57.isNotNil)(label),
|
|
13510
|
+
"aria-label": (0, import_type_guards57.isNotNil)(label) ? void 0 : ariaLabel,
|
|
13473
13511
|
disabled,
|
|
13474
13512
|
onClick: handleClick,
|
|
13475
13513
|
value,
|
|
@@ -13601,7 +13639,7 @@ Select.displayName = "Select";
|
|
|
13601
13639
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
13602
13640
|
var import_react70 = require("react");
|
|
13603
13641
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
13604
|
-
var
|
|
13642
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
13605
13643
|
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
13606
13644
|
var StyledItem = (0, import_styled_components85.default)(import_react_select2.Item)`
|
|
13607
13645
|
${variantStyleMap2.body3};
|
|
@@ -13645,7 +13683,7 @@ var SelectOption = (0, import_react70.forwardRef)(
|
|
|
13645
13683
|
type: "checkmark"
|
|
13646
13684
|
}
|
|
13647
13685
|
) }) }),
|
|
13648
|
-
(0,
|
|
13686
|
+
(0, import_type_guards58.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)("div", { children: [
|
|
13649
13687
|
children,
|
|
13650
13688
|
/* @__PURE__ */ (0, import_jsx_runtime270.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
13651
13689
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(import_react_select2.ItemText, { children })
|
|
@@ -13680,7 +13718,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
13680
13718
|
// src/components/Slider/Slider.tsx
|
|
13681
13719
|
var import_react_slider = require("@radix-ui/react-slider");
|
|
13682
13720
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
13683
|
-
var
|
|
13721
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
13684
13722
|
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
13685
13723
|
var SliderContainer = import_styled_components87.default.div`
|
|
13686
13724
|
--wui-slider-track-color: var(--wui-gray-6);
|
|
@@ -13759,7 +13797,7 @@ var Slider = ({
|
|
|
13759
13797
|
"data-testid": dataTestId = "ui-slider",
|
|
13760
13798
|
...otherProps
|
|
13761
13799
|
}) => {
|
|
13762
|
-
if (!((0,
|
|
13800
|
+
if (!((0, import_type_guards59.isNonEmptyString)(ariaLabel) || (0, import_type_guards59.isNonEmptyString)(ariaLabelledby))) {
|
|
13763
13801
|
throw new Error(
|
|
13764
13802
|
"UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
|
|
13765
13803
|
);
|
|
@@ -13807,7 +13845,7 @@ Slider.displayName = "Slider";
|
|
|
13807
13845
|
// src/components/Switch/Switch.tsx
|
|
13808
13846
|
var import_react71 = require("react");
|
|
13809
13847
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
13810
|
-
var
|
|
13848
|
+
var import_type_guards60 = require("@wistia/type-guards");
|
|
13811
13849
|
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
13812
13850
|
var sizeSmall3 = import_styled_components88.css`
|
|
13813
13851
|
--wui-size-small-width: 24px;
|
|
@@ -13927,7 +13965,7 @@ var Switch = (0, import_react71.forwardRef)(
|
|
|
13927
13965
|
...props
|
|
13928
13966
|
}, ref) => {
|
|
13929
13967
|
const generatedId = (0, import_react71.useId)();
|
|
13930
|
-
const computedId = (0,
|
|
13968
|
+
const computedId = (0, import_type_guards60.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
13931
13969
|
return /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
13932
13970
|
/* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
|
|
13933
13971
|
StyledHiddenSwitchInput,
|
|
@@ -14083,7 +14121,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
14083
14121
|
// src/components/Tabs/Tabs.tsx
|
|
14084
14122
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
14085
14123
|
var import_react75 = require("react");
|
|
14086
|
-
var
|
|
14124
|
+
var import_type_guards61 = require("@wistia/type-guards");
|
|
14087
14125
|
|
|
14088
14126
|
// src/components/Tabs/useTabsValue.tsx
|
|
14089
14127
|
var import_react74 = require("react");
|
|
@@ -14120,10 +14158,10 @@ var Tabs = ({
|
|
|
14120
14158
|
...props,
|
|
14121
14159
|
onValueChange
|
|
14122
14160
|
};
|
|
14123
|
-
if ((0,
|
|
14161
|
+
if ((0, import_type_guards61.isNotNil)(value)) {
|
|
14124
14162
|
rootProps.value = value;
|
|
14125
14163
|
}
|
|
14126
|
-
if ((0,
|
|
14164
|
+
if ((0, import_type_guards61.isNotNil)(defaultValue)) {
|
|
14127
14165
|
rootProps.defaultValue = defaultValue;
|
|
14128
14166
|
}
|
|
14129
14167
|
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 +14181,7 @@ var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
|
14143
14181
|
var import_styled_components96 = __toESM(require("styled-components"));
|
|
14144
14182
|
|
|
14145
14183
|
// src/components/Tabs/SelectedTabIndicator.tsx
|
|
14146
|
-
var
|
|
14184
|
+
var import_type_guards62 = require("@wistia/type-guards");
|
|
14147
14185
|
|
|
14148
14186
|
// src/components/Tabs/TabsSelectedItemIndicatorDiv.tsx
|
|
14149
14187
|
var import_styled_components95 = __toESM(require("styled-components"));
|
|
@@ -14158,7 +14196,7 @@ var import_jsx_runtime282 = require("react/jsx-runtime");
|
|
|
14158
14196
|
var SelectedTabIndicator = () => {
|
|
14159
14197
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
14160
14198
|
const selectedValue = useTabsValue();
|
|
14161
|
-
if (selectedValue == null || (0,
|
|
14199
|
+
if (selectedValue == null || (0, import_type_guards62.isUndefined)(selectedItemIndicatorStyle)) {
|
|
14162
14200
|
return null;
|
|
14163
14201
|
}
|
|
14164
14202
|
return /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(
|
|
@@ -14192,7 +14230,7 @@ TabsList.displayName = "TabsList";
|
|
|
14192
14230
|
|
|
14193
14231
|
// src/components/Tabs/TabsTrigger.tsx
|
|
14194
14232
|
var import_react76 = require("react");
|
|
14195
|
-
var
|
|
14233
|
+
var import_type_guards63 = require("@wistia/type-guards");
|
|
14196
14234
|
|
|
14197
14235
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
14198
14236
|
var import_styled_components97 = __toESM(require("styled-components"));
|
|
@@ -14243,8 +14281,8 @@ var TabsTrigger = (0, import_react76.forwardRef)(
|
|
|
14243
14281
|
{
|
|
14244
14282
|
...otherProps,
|
|
14245
14283
|
ref: combinedRef,
|
|
14246
|
-
$hasLabel: (0,
|
|
14247
|
-
"aria-label": (0,
|
|
14284
|
+
$hasLabel: (0, import_type_guards63.isNotNil)(label),
|
|
14285
|
+
"aria-label": (0, import_type_guards63.isNotNil)(label) ? void 0 : ariaLabel,
|
|
14248
14286
|
disabled,
|
|
14249
14287
|
value,
|
|
14250
14288
|
children: [
|
|
@@ -14259,7 +14297,7 @@ TabsTrigger.displayName = "TabsTrigger";
|
|
|
14259
14297
|
|
|
14260
14298
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
14261
14299
|
var import_styled_components98 = __toESM(require("styled-components"));
|
|
14262
|
-
var
|
|
14300
|
+
var import_type_guards64 = require("@wistia/type-guards");
|
|
14263
14301
|
var import_jsx_runtime285 = require("react/jsx-runtime");
|
|
14264
14302
|
var StyledThumbnailBadge = import_styled_components98.default.div`
|
|
14265
14303
|
align-items: center;
|
|
@@ -14287,7 +14325,7 @@ var StyledThumbnailBadge = import_styled_components98.default.div`
|
|
|
14287
14325
|
`;
|
|
14288
14326
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
14289
14327
|
return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)(StyledThumbnailBadge, { ...props, children: [
|
|
14290
|
-
(0,
|
|
14328
|
+
(0, import_type_guards64.isNotNil)(icon) && icon,
|
|
14291
14329
|
/* @__PURE__ */ (0, import_jsx_runtime285.jsx)("span", { children: label })
|
|
14292
14330
|
] });
|
|
14293
14331
|
};
|
|
@@ -14296,10 +14334,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
|
14296
14334
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
14297
14335
|
var import_react77 = require("react");
|
|
14298
14336
|
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14299
|
-
var
|
|
14337
|
+
var import_type_guards67 = require("@wistia/type-guards");
|
|
14300
14338
|
|
|
14301
14339
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
14302
|
-
var
|
|
14340
|
+
var import_type_guards65 = require("@wistia/type-guards");
|
|
14303
14341
|
var import_styled_components99 = require("styled-components");
|
|
14304
14342
|
var gradients = {
|
|
14305
14343
|
defaultDarkOne: import_styled_components99.css`
|
|
@@ -14427,12 +14465,12 @@ var gradients = {
|
|
|
14427
14465
|
};
|
|
14428
14466
|
var gradientMap = Object.keys(gradients);
|
|
14429
14467
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
14430
|
-
return (0,
|
|
14468
|
+
return (0, import_type_guards65.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
14431
14469
|
};
|
|
14432
14470
|
|
|
14433
14471
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
14434
14472
|
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14435
|
-
var
|
|
14473
|
+
var import_type_guards66 = require("@wistia/type-guards");
|
|
14436
14474
|
var import_jsx_runtime286 = require("react/jsx-runtime");
|
|
14437
14475
|
var ScrubLine = import_styled_components100.default.div`
|
|
14438
14476
|
position: absolute;
|
|
@@ -14518,8 +14556,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
14518
14556
|
);
|
|
14519
14557
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
14520
14558
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
14521
|
-
const showScrubLine = (0,
|
|
14522
|
-
const scrubLinePosition = (0,
|
|
14559
|
+
const showScrubLine = (0, import_type_guards66.isNotNil)(cursorPosition);
|
|
14560
|
+
const scrubLinePosition = (0, import_type_guards66.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
14523
14561
|
const viewerStyles = {
|
|
14524
14562
|
position: "relative",
|
|
14525
14563
|
overflow: "hidden",
|
|
@@ -14590,10 +14628,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
14590
14628
|
);
|
|
14591
14629
|
};
|
|
14592
14630
|
var StyledThumbnail = import_styled_components101.default.div`
|
|
14593
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
14631
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards67.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
14594
14632
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
14595
14633
|
// if we don't have $backgroundUrl show a gradient
|
|
14596
|
-
(0,
|
|
14634
|
+
(0, import_type_guards67.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
14597
14635
|
)};
|
|
14598
14636
|
background-position: center center;
|
|
14599
14637
|
background-size: cover;
|
|
@@ -14635,10 +14673,10 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14635
14673
|
const storyboardElementRef = (0, import_react77.useRef)(null);
|
|
14636
14674
|
const [cursorPosition, setCursorPosition] = (0, import_react77.useState)(null);
|
|
14637
14675
|
const backgroundUrl = (0, import_react77.useMemo)(
|
|
14638
|
-
() => thumbnailImageType === "square" && (0,
|
|
14676
|
+
() => thumbnailImageType === "square" && (0, import_type_guards67.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
14639
14677
|
[thumbnailImageType, thumbnailUrl]
|
|
14640
14678
|
);
|
|
14641
|
-
const isScrubbable = (0,
|
|
14679
|
+
const isScrubbable = (0, import_type_guards67.isNotNil)(storyboard);
|
|
14642
14680
|
const trackStoryboardLoadStatus = (0, import_react77.useCallback)(() => {
|
|
14643
14681
|
if (storyboardElementRef.current || !storyboard) {
|
|
14644
14682
|
return storyboardElementRef.current;
|
|
@@ -14671,7 +14709,7 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14671
14709
|
return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
|
|
14672
14710
|
}, [isScrubbable, isMouseOver, isStoryboardReady]);
|
|
14673
14711
|
const renderStoryboard = (0, import_react77.useCallback)(() => {
|
|
14674
|
-
if (!storyboard || (0,
|
|
14712
|
+
if (!storyboard || (0, import_type_guards67.isUndefined)(height) || (0, import_type_guards67.isEmptyString)(height)) return null;
|
|
14675
14713
|
const {
|
|
14676
14714
|
url,
|
|
14677
14715
|
width: sbWidth,
|
|
@@ -14681,7 +14719,7 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14681
14719
|
frameCount,
|
|
14682
14720
|
aspectRatio
|
|
14683
14721
|
} = storyboard;
|
|
14684
|
-
const targetWidth = (0,
|
|
14722
|
+
const targetWidth = (0, import_type_guards67.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
14685
14723
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
14686
14724
|
return /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(
|
|
14687
14725
|
ThumbnailStoryboardViewer,
|
|
@@ -14702,7 +14740,7 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14702
14740
|
let thumbnailContent = null;
|
|
14703
14741
|
if (shouldRenderStoryboard) {
|
|
14704
14742
|
thumbnailContent = renderStoryboard();
|
|
14705
|
-
} else if ((0,
|
|
14743
|
+
} else if ((0, import_type_guards67.isNotNil)(thumbnailUrl)) {
|
|
14706
14744
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(
|
|
14707
14745
|
ThumbnailImage,
|
|
14708
14746
|
{
|
|
@@ -14727,7 +14765,7 @@ var Thumbnail = (0, import_react77.forwardRef)(
|
|
|
14727
14765
|
onMouseOut: handleMouseOut,
|
|
14728
14766
|
role: "presentation",
|
|
14729
14767
|
children: [
|
|
14730
|
-
(0,
|
|
14768
|
+
(0, import_type_guards67.isNotNil)(children) ? children : null,
|
|
14731
14769
|
thumbnailContent
|
|
14732
14770
|
]
|
|
14733
14771
|
}
|
|
@@ -14739,7 +14777,7 @@ Thumbnail.displayName = "Thumbnail";
|
|
|
14739
14777
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
14740
14778
|
var import_react78 = __toESM(require("react"));
|
|
14741
14779
|
var import_styled_components102 = __toESM(require("styled-components"));
|
|
14742
|
-
var
|
|
14780
|
+
var import_type_guards68 = require("@wistia/type-guards");
|
|
14743
14781
|
var import_jsx_runtime288 = (
|
|
14744
14782
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
14745
14783
|
require("react/jsx-runtime")
|
|
@@ -14819,7 +14857,7 @@ var ThumbnailCollage = ({
|
|
|
14819
14857
|
}) => {
|
|
14820
14858
|
const thumbnailArray = import_react78.default.Children.toArray(children);
|
|
14821
14859
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
14822
|
-
const thumbnails = (0,
|
|
14860
|
+
const thumbnails = (0, import_type_guards68.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
14823
14861
|
return import_react78.default.cloneElement(child, {
|
|
14824
14862
|
...child.props,
|
|
14825
14863
|
children: void 0
|
|
@@ -14847,7 +14885,7 @@ var ThumbnailCollage = ({
|
|
|
14847
14885
|
|
|
14848
14886
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
14849
14887
|
var import_styled_components103 = __toESM(require("styled-components"));
|
|
14850
|
-
var
|
|
14888
|
+
var import_type_guards69 = require("@wistia/type-guards");
|
|
14851
14889
|
var import_jsx_runtime289 = require("react/jsx-runtime");
|
|
14852
14890
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
14853
14891
|
if (iconOnly) {
|
|
@@ -14960,7 +14998,7 @@ var WistiaLogo = ({
|
|
|
14960
14998
|
...props,
|
|
14961
14999
|
children: [
|
|
14962
15000
|
/* @__PURE__ */ (0, import_jsx_runtime289.jsx)("title", { children: title }),
|
|
14963
|
-
(0,
|
|
15001
|
+
(0, import_type_guards69.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime289.jsx)("desc", { children: description }) : null,
|
|
14964
15002
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
14965
15003
|
renderLogotype(logotypeColor, iconOnly)
|
|
14966
15004
|
]
|
|
@@ -14973,7 +15011,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
14973
15011
|
// src/components/InputPassword/InputPassword.tsx
|
|
14974
15012
|
var import_styled_components104 = __toESM(require("styled-components"));
|
|
14975
15013
|
var import_react79 = require("react");
|
|
14976
|
-
var
|
|
15014
|
+
var import_type_guards70 = require("@wistia/type-guards");
|
|
14977
15015
|
var import_jsx_runtime290 = require("react/jsx-runtime");
|
|
14978
15016
|
var StyledIconButton = (0, import_styled_components104.default)(IconButton)`
|
|
14979
15017
|
/* override size for icon button since prop gets changed by Input */
|
|
@@ -14989,7 +15027,7 @@ var InputPassword = (0, import_react79.forwardRef)(
|
|
|
14989
15027
|
const handleClick = () => {
|
|
14990
15028
|
const newVisibility = !isVisible;
|
|
14991
15029
|
setIsVisible(newVisibility);
|
|
14992
|
-
if ((0,
|
|
15030
|
+
if ((0, import_type_guards70.isFunction)(onVisibilityToggle)) {
|
|
14993
15031
|
onVisibilityToggle(newVisibility);
|
|
14994
15032
|
}
|
|
14995
15033
|
};
|
|
@@ -15016,6 +15054,65 @@ var InputPassword = (0, import_react79.forwardRef)(
|
|
|
15016
15054
|
}
|
|
15017
15055
|
);
|
|
15018
15056
|
InputPassword.displayName = "InputPassword";
|
|
15057
|
+
|
|
15058
|
+
// src/components/ContextMenu/ContextMenu.tsx
|
|
15059
|
+
var import_react80 = require("react");
|
|
15060
|
+
var import_type_guards71 = require("@wistia/type-guards");
|
|
15061
|
+
var import_jsx_runtime291 = require("react/jsx-runtime");
|
|
15062
|
+
var ContextMenu = ({
|
|
15063
|
+
position,
|
|
15064
|
+
triggerRef,
|
|
15065
|
+
children,
|
|
15066
|
+
onRequestClose = () => null
|
|
15067
|
+
}) => {
|
|
15068
|
+
const [isRightClicked, setIsRightClicked] = (0, import_react80.useState)(false);
|
|
15069
|
+
const [menuPosition, setMenuPosition] = (0, import_react80.useState)(position ?? { x: 0, y: 0 });
|
|
15070
|
+
(0, import_react80.useEffect)(() => {
|
|
15071
|
+
if ((0, import_type_guards71.isNil)(position)) {
|
|
15072
|
+
const onContextMenu = (event) => {
|
|
15073
|
+
event.preventDefault();
|
|
15074
|
+
setMenuPosition({ x: event.clientX, y: event.clientY });
|
|
15075
|
+
setIsRightClicked(true);
|
|
15076
|
+
};
|
|
15077
|
+
const triggerEl = triggerRef?.current;
|
|
15078
|
+
triggerEl?.addEventListener("contextmenu", onContextMenu);
|
|
15079
|
+
return () => {
|
|
15080
|
+
triggerEl?.removeEventListener("contextmenu", onContextMenu);
|
|
15081
|
+
};
|
|
15082
|
+
}
|
|
15083
|
+
return () => null;
|
|
15084
|
+
}, [position, triggerRef]);
|
|
15085
|
+
const isOpen = (0, import_type_guards71.isNotNil)(position) || isRightClicked;
|
|
15086
|
+
return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(
|
|
15087
|
+
Menu,
|
|
15088
|
+
{
|
|
15089
|
+
avoidCollisions: false,
|
|
15090
|
+
isOpen,
|
|
15091
|
+
onOpenChange: (next) => {
|
|
15092
|
+
setIsRightClicked(next);
|
|
15093
|
+
if (!next) {
|
|
15094
|
+
onRequestClose();
|
|
15095
|
+
}
|
|
15096
|
+
},
|
|
15097
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(
|
|
15098
|
+
"button",
|
|
15099
|
+
{
|
|
15100
|
+
"aria-label": "context menu",
|
|
15101
|
+
style: {
|
|
15102
|
+
width: "1px",
|
|
15103
|
+
height: "1px",
|
|
15104
|
+
all: "unset",
|
|
15105
|
+
position: "fixed",
|
|
15106
|
+
top: menuPosition.y,
|
|
15107
|
+
left: menuPosition.x
|
|
15108
|
+
},
|
|
15109
|
+
type: "button"
|
|
15110
|
+
}
|
|
15111
|
+
),
|
|
15112
|
+
children
|
|
15113
|
+
}
|
|
15114
|
+
) : null;
|
|
15115
|
+
};
|
|
15019
15116
|
// Annotate the CommonJS export names for ESM import in node:
|
|
15020
15117
|
0 && (module.exports = {
|
|
15021
15118
|
ActionButton,
|
|
@@ -15040,6 +15137,7 @@ InputPassword.displayName = "InputPassword";
|
|
|
15040
15137
|
ColorSchemeWrapper,
|
|
15041
15138
|
Combobox,
|
|
15042
15139
|
ComboboxOption,
|
|
15140
|
+
ContextMenu,
|
|
15043
15141
|
DataCard,
|
|
15044
15142
|
DataCardTrend,
|
|
15045
15143
|
DataCards,
|