@wistia/ui 0.12.0 → 0.12.1-beta.0e37a70c.9bf7e67
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 +289 -263
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.mjs +184 -158
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.12.
|
|
3
|
+
* @license @wistia/ui v0.12.1-beta.0e37a70c.9bf7e67
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8934,7 +8934,7 @@ Center.displayName = "Center";
|
|
|
8934
8934
|
// src/components/Checkbox/Checkbox.tsx
|
|
8935
8935
|
var import_react38 = require("react");
|
|
8936
8936
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
8937
|
-
var
|
|
8937
|
+
var import_type_guards31 = require("@wistia/type-guards");
|
|
8938
8938
|
|
|
8939
8939
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
8940
8940
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
@@ -9058,11 +9058,12 @@ FormControlLabel.displayName = "FormControlLabel";
|
|
|
9058
9058
|
|
|
9059
9059
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9060
9060
|
var import_react37 = require("react");
|
|
9061
|
-
var
|
|
9061
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
9062
9062
|
|
|
9063
9063
|
// src/components/FormGroup/FormGroup.tsx
|
|
9064
9064
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
9065
9065
|
var import_react35 = require("react");
|
|
9066
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
9066
9067
|
|
|
9067
9068
|
// src/components/Stack/Stack.tsx
|
|
9068
9069
|
var import_react34 = require("react");
|
|
@@ -9102,25 +9103,42 @@ var StyledFieldset = import_styled_components41.default.fieldset`
|
|
|
9102
9103
|
border: 0;
|
|
9103
9104
|
`;
|
|
9104
9105
|
var StyledLegend = import_styled_components41.default.legend`
|
|
9105
|
-
|
|
9106
|
+
padding-inline: 0;
|
|
9106
9107
|
`;
|
|
9107
|
-
var FormGroup = ({
|
|
9108
|
+
var FormGroup = ({
|
|
9109
|
+
children,
|
|
9110
|
+
label,
|
|
9111
|
+
description,
|
|
9112
|
+
...props
|
|
9113
|
+
}) => {
|
|
9108
9114
|
const ref = (0, import_react35.useRef)(null);
|
|
9109
9115
|
return /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(
|
|
9110
9116
|
Stack,
|
|
9111
9117
|
{
|
|
9112
9118
|
...props,
|
|
9113
9119
|
ref,
|
|
9120
|
+
"aria-describedby": (0, import_type_guards28.isNotNil)(description) ? `${props.name}-description` : void 0,
|
|
9114
9121
|
renderAs: StyledFieldset,
|
|
9115
9122
|
children: [
|
|
9116
|
-
/* @__PURE__ */ (0, import_jsx_runtime217.
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9123
|
+
((0, import_type_guards28.isNotNil)(label) || (0, import_type_guards28.isNotNil)(description)) && /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(Stack, { gap: "space-01", children: [
|
|
9124
|
+
(0, import_type_guards28.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
9125
|
+
Heading,
|
|
9126
|
+
{
|
|
9127
|
+
renderAs: StyledLegend,
|
|
9128
|
+
variant: "heading5",
|
|
9129
|
+
children: label
|
|
9130
|
+
}
|
|
9131
|
+
),
|
|
9132
|
+
(0, import_type_guards28.isNotNil)(description) && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
9133
|
+
Text,
|
|
9134
|
+
{
|
|
9135
|
+
id: `${props.name}-description`,
|
|
9136
|
+
prominence: "secondary",
|
|
9137
|
+
variant: "body4",
|
|
9138
|
+
children: description
|
|
9139
|
+
}
|
|
9140
|
+
)
|
|
9141
|
+
] }),
|
|
9124
9142
|
children
|
|
9125
9143
|
]
|
|
9126
9144
|
}
|
|
@@ -9131,7 +9149,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
9131
9149
|
// src/components/Form/Form.tsx
|
|
9132
9150
|
var import_react36 = require("react");
|
|
9133
9151
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
9134
|
-
var
|
|
9152
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
9135
9153
|
|
|
9136
9154
|
// src/components/Form/serializeFormData.tsx
|
|
9137
9155
|
var ARRAY_SUFFIX = "[]";
|
|
@@ -9180,7 +9198,7 @@ var Form = (0, import_react36.forwardRef)(
|
|
|
9180
9198
|
const id = props.id ?? autoId;
|
|
9181
9199
|
const handleValidate = (nextFormData) => {
|
|
9182
9200
|
const nextData = serializeFormData(nextFormData);
|
|
9183
|
-
if ((0,
|
|
9201
|
+
if ((0, import_type_guards29.isUndefined)(validate)) {
|
|
9184
9202
|
return {};
|
|
9185
9203
|
}
|
|
9186
9204
|
return validate(nextData);
|
|
@@ -9190,7 +9208,7 @@ var Form = (0, import_react36.forwardRef)(
|
|
|
9190
9208
|
props.onBlur(event);
|
|
9191
9209
|
}
|
|
9192
9210
|
const formData = new FormData(event.currentTarget);
|
|
9193
|
-
if ((0,
|
|
9211
|
+
if ((0, import_type_guards29.isNotUndefined)(validate)) {
|
|
9194
9212
|
handleValidate(formData);
|
|
9195
9213
|
}
|
|
9196
9214
|
};
|
|
@@ -9263,7 +9281,7 @@ var CheckboxGroup = ({
|
|
|
9263
9281
|
...props
|
|
9264
9282
|
}) => {
|
|
9265
9283
|
const formState = (0, import_react37.useContext)(FormContext);
|
|
9266
|
-
const derivedValue = (0,
|
|
9284
|
+
const derivedValue = (0, import_type_guards30.isArray)(formState.values[name]) ? formState.values[name] : value;
|
|
9267
9285
|
const context = (0, import_react37.useMemo)(() => {
|
|
9268
9286
|
return {
|
|
9269
9287
|
name: `${name}[]`,
|
|
@@ -9391,21 +9409,21 @@ var Checkbox = (0, import_react38.forwardRef)(
|
|
|
9391
9409
|
...props
|
|
9392
9410
|
}, ref) => {
|
|
9393
9411
|
const generatedId = (0, import_react38.useId)();
|
|
9394
|
-
const computedId = (0,
|
|
9412
|
+
const computedId = (0, import_type_guards31.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
9395
9413
|
const checkboxGroupContext = useCheckboxGroup();
|
|
9396
9414
|
const contextName = checkboxGroupContext?.name;
|
|
9397
9415
|
const contextOnChange = checkboxGroupContext?.onChange;
|
|
9398
9416
|
const contextValue = checkboxGroupContext?.value;
|
|
9399
9417
|
const checkboxName = name ?? contextName;
|
|
9400
9418
|
const handleOnChange = onChange ?? contextOnChange;
|
|
9401
|
-
const defaultChecked = (0,
|
|
9419
|
+
const defaultChecked = (0, import_type_guards31.isNotUndefined)(value) && contextValue ? contextValue.includes(value) : void 0;
|
|
9402
9420
|
return /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(StyledCheckboxWrapper, { disabled, children: [
|
|
9403
9421
|
/* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
9404
9422
|
StyledHiddenCheckboxInput,
|
|
9405
9423
|
{
|
|
9406
9424
|
...props,
|
|
9407
9425
|
ref,
|
|
9408
|
-
...(0,
|
|
9426
|
+
...(0, import_type_guards31.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked },
|
|
9409
9427
|
disabled,
|
|
9410
9428
|
id: computedId,
|
|
9411
9429
|
name: checkboxName,
|
|
@@ -9484,7 +9502,7 @@ ClickRegion.displayName = "ClickRegion";
|
|
|
9484
9502
|
|
|
9485
9503
|
// src/components/Collapsible/Collapsible.tsx
|
|
9486
9504
|
var import_react_collapsible = require("@radix-ui/react-collapsible");
|
|
9487
|
-
var
|
|
9505
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
9488
9506
|
var import_styled_components44 = __toESM(require("styled-components"));
|
|
9489
9507
|
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
9490
9508
|
var StyledRoot = (0, import_styled_components44.default)(import_react_collapsible.Root)`
|
|
@@ -9501,7 +9519,7 @@ var Collapsible = ({
|
|
|
9501
9519
|
onOpenChange
|
|
9502
9520
|
}) => {
|
|
9503
9521
|
const controlProps = {
|
|
9504
|
-
...(0,
|
|
9522
|
+
...(0, import_type_guards32.isNotNil)(onOpenChange) && (0, import_type_guards32.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
9505
9523
|
};
|
|
9506
9524
|
return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(StyledRoot, { ...controlProps, children });
|
|
9507
9525
|
};
|
|
@@ -9563,13 +9581,13 @@ CollapsibleTriggerIcon.displayName = "CollapsibleTriggerIcon";
|
|
|
9563
9581
|
// src/components/Collapsible/CollapsibleContent.tsx
|
|
9564
9582
|
var import_styled_components46 = __toESM(require("styled-components"));
|
|
9565
9583
|
var import_react_collapsible3 = require("@radix-ui/react-collapsible");
|
|
9566
|
-
var
|
|
9584
|
+
var import_type_guards33 = require("@wistia/type-guards");
|
|
9567
9585
|
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
9568
9586
|
var ClampedContent = import_styled_components46.default.div`
|
|
9569
9587
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
9570
9588
|
`;
|
|
9571
9589
|
var CollapsibleContent = ({ clamp, children }) => {
|
|
9572
|
-
if ((0,
|
|
9590
|
+
if ((0, import_type_guards33.isNotUndefined)(clamp)) {
|
|
9573
9591
|
return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
9574
9592
|
ClampedContent,
|
|
9575
9593
|
{
|
|
@@ -9594,7 +9612,7 @@ var import_styled_components49 = __toESM(require("styled-components"));
|
|
|
9594
9612
|
// src/components/Tag/Tag.tsx
|
|
9595
9613
|
var import_react41 = require("react");
|
|
9596
9614
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
9597
|
-
var
|
|
9615
|
+
var import_type_guards34 = require("@wistia/type-guards");
|
|
9598
9616
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9599
9617
|
var TagLabel = import_styled_components47.default.a`
|
|
9600
9618
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -9679,10 +9697,10 @@ var StyledTag = import_styled_components47.default.div`
|
|
|
9679
9697
|
}
|
|
9680
9698
|
`;
|
|
9681
9699
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
9682
|
-
if ((0,
|
|
9700
|
+
if ((0, import_type_guards34.isNil)(onClickRemove)) {
|
|
9683
9701
|
return null;
|
|
9684
9702
|
}
|
|
9685
|
-
if ((0,
|
|
9703
|
+
if ((0, import_type_guards34.isNil)(onClickRemoveLabel)) {
|
|
9686
9704
|
throw new Error(
|
|
9687
9705
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
9688
9706
|
);
|
|
@@ -9711,8 +9729,8 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
9711
9729
|
};
|
|
9712
9730
|
var Tag = (0, import_react41.forwardRef)(
|
|
9713
9731
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
9714
|
-
const hasIcon = (0,
|
|
9715
|
-
const labelProps = (0,
|
|
9732
|
+
const hasIcon = (0, import_type_guards34.isNotNil)(icon);
|
|
9733
|
+
const labelProps = (0, import_type_guards34.isNotNil)(href) && (0, import_type_guards34.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
9716
9734
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(
|
|
9717
9735
|
StyledTag,
|
|
9718
9736
|
{
|
|
@@ -10022,7 +10040,7 @@ var Combobox2 = ({
|
|
|
10022
10040
|
// src/components/DataCards/DataCard.tsx
|
|
10023
10041
|
var import_react43 = require("react");
|
|
10024
10042
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
10025
|
-
var
|
|
10043
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
10026
10044
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
10027
10045
|
var StyledDataCard = import_styled_components50.default.div`
|
|
10028
10046
|
display: grid;
|
|
@@ -10153,8 +10171,8 @@ var DataCardInner = ({
|
|
|
10153
10171
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(StyledLoadingValue, {}) : value
|
|
10154
10172
|
}
|
|
10155
10173
|
),
|
|
10156
|
-
(0,
|
|
10157
|
-
(0,
|
|
10174
|
+
(0, import_type_guards35.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
10175
|
+
(0, import_type_guards35.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
10158
10176
|
]
|
|
10159
10177
|
}
|
|
10160
10178
|
);
|
|
@@ -10167,7 +10185,7 @@ var DataCardArrowIcon = /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
|
10167
10185
|
);
|
|
10168
10186
|
var DataCard = (props) => {
|
|
10169
10187
|
const ref = (0, import_react43.useRef)(null);
|
|
10170
|
-
if ((0,
|
|
10188
|
+
if ((0, import_type_guards35.isNotNil)(props.href) || (0, import_type_guards35.isNotNil)(props.onClick)) {
|
|
10171
10189
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
10172
10190
|
DataCardInner,
|
|
10173
10191
|
{
|
|
@@ -10177,7 +10195,7 @@ var DataCard = (props) => {
|
|
|
10177
10195
|
Button,
|
|
10178
10196
|
{
|
|
10179
10197
|
ref,
|
|
10180
|
-
...(0,
|
|
10198
|
+
...(0, import_type_guards35.isNotNil)(props.beforeAction) ? { beforeAction: props.beforeAction } : {},
|
|
10181
10199
|
disabled: props.disabled ?? false,
|
|
10182
10200
|
href: props.href,
|
|
10183
10201
|
onClick: props.onClick,
|
|
@@ -10460,7 +10478,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
10460
10478
|
// src/components/Input/Input.tsx
|
|
10461
10479
|
var import_react44 = require("react");
|
|
10462
10480
|
var import_styled_components55 = __toESM(require("styled-components"));
|
|
10463
|
-
var
|
|
10481
|
+
var import_type_guards36 = require("@wistia/type-guards");
|
|
10464
10482
|
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
10465
10483
|
var inputStyles = import_styled_components55.css`
|
|
10466
10484
|
${inputCss}
|
|
@@ -10577,27 +10595,27 @@ var Input = (0, import_react44.forwardRef)(
|
|
|
10577
10595
|
const internalRef = (0, import_react44.useRef)();
|
|
10578
10596
|
const ref = (
|
|
10579
10597
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
10580
|
-
(0,
|
|
10598
|
+
(0, import_type_guards36.isNotNil)(externalRef) && (0, import_type_guards36.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
10581
10599
|
);
|
|
10582
10600
|
let leftIconToDisplay = leftIcon;
|
|
10583
|
-
if ((0,
|
|
10601
|
+
if ((0, import_type_guards36.isNil)(leftIcon) && type === "search") {
|
|
10584
10602
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Icon, { type: "search" });
|
|
10585
10603
|
}
|
|
10586
|
-
if ((0,
|
|
10604
|
+
if ((0, import_type_guards36.isNotNil)(leftIconToDisplay)) {
|
|
10587
10605
|
leftIconToDisplay = (0, import_react44.cloneElement)(leftIconToDisplay, {
|
|
10588
10606
|
size: "md",
|
|
10589
10607
|
className: "wui-input-left-icon"
|
|
10590
10608
|
});
|
|
10591
10609
|
}
|
|
10592
10610
|
let rightIconToDisplay = rightIcon;
|
|
10593
|
-
if ((0,
|
|
10611
|
+
if ((0, import_type_guards36.isNotNil)(rightIconToDisplay)) {
|
|
10594
10612
|
rightIconToDisplay = (0, import_react44.cloneElement)(rightIconToDisplay, {
|
|
10595
10613
|
size: "md",
|
|
10596
10614
|
className: "wui-input-right-icon"
|
|
10597
10615
|
});
|
|
10598
10616
|
}
|
|
10599
10617
|
const handleFocus2 = (event) => {
|
|
10600
|
-
if ((0,
|
|
10618
|
+
if ((0, import_type_guards36.isNotNil)(props.onFocus)) {
|
|
10601
10619
|
props.onFocus(event);
|
|
10602
10620
|
}
|
|
10603
10621
|
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
@@ -10804,7 +10822,7 @@ var useFormState = (action, initialData = {}) => {
|
|
|
10804
10822
|
|
|
10805
10823
|
// src/components/Form/FormErrorSummary.tsx
|
|
10806
10824
|
var import_react47 = require("react");
|
|
10807
|
-
var
|
|
10825
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
10808
10826
|
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
10809
10827
|
var ErrorItem = ({ name, error, formId }) => {
|
|
10810
10828
|
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
@@ -10818,8 +10836,8 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10818
10836
|
}
|
|
10819
10837
|
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { ref, children: [
|
|
10820
10838
|
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("p", { children: description }),
|
|
10821
|
-
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0,
|
|
10822
|
-
([name, error]) => (0,
|
|
10839
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards37.isNotUndefined)(error)).map(
|
|
10840
|
+
([name, error]) => (0, import_type_guards37.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
10823
10841
|
ErrorItem,
|
|
10824
10842
|
{
|
|
10825
10843
|
error: err,
|
|
@@ -10843,7 +10861,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
10843
10861
|
// src/components/FormField/FormField.tsx
|
|
10844
10862
|
var import_react48 = require("react");
|
|
10845
10863
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
10846
|
-
var
|
|
10864
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
10847
10865
|
|
|
10848
10866
|
// src/components/Label/Label.tsx
|
|
10849
10867
|
var import_styled_components57 = __toESM(require("styled-components"));
|
|
@@ -10946,7 +10964,7 @@ var StyledErrorList = import_styled_components58.default.ul`
|
|
|
10946
10964
|
gap: var(--wui-space-01);
|
|
10947
10965
|
`;
|
|
10948
10966
|
var ErrorMessages = ({ errors, id }) => {
|
|
10949
|
-
const isErrorArray = (0,
|
|
10967
|
+
const isErrorArray = (0, import_type_guards38.isArray)(errors);
|
|
10950
10968
|
const isMultipleErrors = isErrorArray && errors.length > 1;
|
|
10951
10969
|
if (!isErrorArray) {
|
|
10952
10970
|
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
@@ -11014,19 +11032,19 @@ var FormField = ({
|
|
|
11014
11032
|
"aria-describedby": ariaDescribedby,
|
|
11015
11033
|
...props
|
|
11016
11034
|
};
|
|
11017
|
-
if ((0,
|
|
11035
|
+
if ((0, import_type_guards38.isUndefined)(value) && (0, import_type_guards38.isNotUndefined)(defaultValue)) {
|
|
11018
11036
|
childProps = {
|
|
11019
11037
|
...childProps,
|
|
11020
11038
|
defaultValue
|
|
11021
11039
|
};
|
|
11022
11040
|
}
|
|
11023
|
-
if ((0,
|
|
11024
|
-
const computedName = (0,
|
|
11041
|
+
if ((0, import_type_guards38.isNotNil)(checkboxGroup)) {
|
|
11042
|
+
const computedName = (0, import_type_guards38.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
11025
11043
|
const handleChange = (event) => {
|
|
11026
|
-
if ((0,
|
|
11044
|
+
if ((0, import_type_guards38.isNotUndefined)(props.onChange)) {
|
|
11027
11045
|
props.onChange(event);
|
|
11028
11046
|
}
|
|
11029
|
-
if ((0,
|
|
11047
|
+
if ((0, import_type_guards38.isNotUndefined)(checkboxGroup.onChange)) {
|
|
11030
11048
|
checkboxGroup.onChange(event);
|
|
11031
11049
|
}
|
|
11032
11050
|
};
|
|
@@ -11034,7 +11052,7 @@ var FormField = ({
|
|
|
11034
11052
|
...childProps,
|
|
11035
11053
|
name: computedName,
|
|
11036
11054
|
onChange: handleChange,
|
|
11037
|
-
"aria-invalid": (0,
|
|
11055
|
+
"aria-invalid": (0, import_type_guards38.isNotNil)(error)
|
|
11038
11056
|
};
|
|
11039
11057
|
}
|
|
11040
11058
|
import_react48.Children.only(children);
|
|
@@ -11045,9 +11063,9 @@ var FormField = ({
|
|
|
11045
11063
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
11046
11064
|
children: [
|
|
11047
11065
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
11048
|
-
(0,
|
|
11066
|
+
(0, import_type_guards38.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
11049
11067
|
(0, import_react48.cloneElement)(children, childProps),
|
|
11050
|
-
(0,
|
|
11068
|
+
(0, import_type_guards38.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(import_jsx_runtime236.Fragment, { children: [
|
|
11051
11069
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)("div", {}),
|
|
11052
11070
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
11053
11071
|
ErrorMessages,
|
|
@@ -11091,9 +11109,11 @@ var RadioGroup = ({
|
|
|
11091
11109
|
RadioGroup.displayName = "RadioGroup";
|
|
11092
11110
|
|
|
11093
11111
|
// src/components/Grid/Grid.tsx
|
|
11112
|
+
var import_react50 = require("react");
|
|
11094
11113
|
var import_styled_components59 = __toESM(require("styled-components"));
|
|
11095
|
-
var
|
|
11114
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
11096
11115
|
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
11116
|
+
var DEFAULT_ELEMENT5 = "div";
|
|
11097
11117
|
var StyledGrid = import_styled_components59.default.div`
|
|
11098
11118
|
--wui-grid-column-gap: ${({ $columnGap }) => `var(--wui-${$columnGap})`};
|
|
11099
11119
|
--wui-grid-row-gap: ${({ $rowGap }) => `var(--wui-${$rowGap})`};
|
|
@@ -11135,35 +11155,34 @@ var StyledGrid = import_styled_components59.default.div`
|
|
|
11135
11155
|
`;
|
|
11136
11156
|
}}
|
|
11137
11157
|
`;
|
|
11138
|
-
var
|
|
11139
|
-
children,
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
Grid.displayName = "Grid";
|
|
11158
|
+
var GridComponent = (0, import_react50.forwardRef)(
|
|
11159
|
+
({ children, columns = "auto", minChildWidth = "auto", gap = "space-04", renderAs, ...props }, ref) => {
|
|
11160
|
+
const responsiveGap = useResponsiveProp(gap);
|
|
11161
|
+
const { column, row } = (0, import_type_guards39.isRecord)(responsiveGap) ? responsiveGap : { column: responsiveGap, row: responsiveGap };
|
|
11162
|
+
const responsiveColumns = useResponsiveProp(columns);
|
|
11163
|
+
const responsiveMinChildWidth = useResponsiveProp(minChildWidth);
|
|
11164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
11165
|
+
StyledGrid,
|
|
11166
|
+
{
|
|
11167
|
+
ref,
|
|
11168
|
+
$columnGap: column,
|
|
11169
|
+
$maxColumns: responsiveColumns,
|
|
11170
|
+
$minChildWidth: responsiveMinChildWidth,
|
|
11171
|
+
$rowGap: row,
|
|
11172
|
+
as: renderAs ?? DEFAULT_ELEMENT5,
|
|
11173
|
+
...props,
|
|
11174
|
+
children
|
|
11175
|
+
}
|
|
11176
|
+
);
|
|
11177
|
+
}
|
|
11178
|
+
);
|
|
11179
|
+
GridComponent.displayName = "Grid";
|
|
11180
|
+
var Grid = makePolymorphic(GridComponent);
|
|
11162
11181
|
|
|
11163
11182
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
11164
11183
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
11165
|
-
var
|
|
11166
|
-
var
|
|
11184
|
+
var import_react51 = require("react");
|
|
11185
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
11167
11186
|
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
11168
11187
|
var StyledInput2 = (0, import_styled_components60.default)(Input)`
|
|
11169
11188
|
&:not([aria-disabled='true']) {
|
|
@@ -11175,10 +11194,10 @@ var StyledInput2 = (0, import_styled_components60.default)(Input)`
|
|
|
11175
11194
|
}
|
|
11176
11195
|
`;
|
|
11177
11196
|
var COPY_SUCCESS_DURATION = 2e3;
|
|
11178
|
-
var InputClickToCopy = (0,
|
|
11197
|
+
var InputClickToCopy = (0, import_react51.forwardRef)(
|
|
11179
11198
|
({ value, onCopy, ...props }, ref) => {
|
|
11180
|
-
const [isCopied, setIsCopied] = (0,
|
|
11181
|
-
(0,
|
|
11199
|
+
const [isCopied, setIsCopied] = (0, import_react51.useState)(false);
|
|
11200
|
+
(0, import_react51.useEffect)(() => {
|
|
11182
11201
|
if (isCopied) {
|
|
11183
11202
|
const timeout = setTimeout(() => {
|
|
11184
11203
|
setIsCopied(false);
|
|
@@ -11191,12 +11210,12 @@ var InputClickToCopy = (0, import_react50.forwardRef)(
|
|
|
11191
11210
|
}, [isCopied]);
|
|
11192
11211
|
const handleClick = (event) => {
|
|
11193
11212
|
event.preventDefault();
|
|
11194
|
-
if ((0,
|
|
11213
|
+
if ((0, import_type_guards40.isFunction)(props.onClick)) {
|
|
11195
11214
|
props.onClick(event);
|
|
11196
11215
|
}
|
|
11197
11216
|
void copyToClipboard(value).then(() => {
|
|
11198
11217
|
setIsCopied(true);
|
|
11199
|
-
if ((0,
|
|
11218
|
+
if ((0, import_type_guards40.isFunction)(onCopy)) {
|
|
11200
11219
|
onCopy(value);
|
|
11201
11220
|
}
|
|
11202
11221
|
return value;
|
|
@@ -11226,7 +11245,7 @@ InputClickToCopy.displayName = "InputClickToCopy";
|
|
|
11226
11245
|
|
|
11227
11246
|
// src/components/KeyboardShortcut/KeyboardShortcut.tsx
|
|
11228
11247
|
var import_styled_components61 = __toESM(require("styled-components"));
|
|
11229
|
-
var
|
|
11248
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
11230
11249
|
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
11231
11250
|
var StyledKeyboardShortcut = import_styled_components61.default.div`
|
|
11232
11251
|
align-items: center;
|
|
@@ -11320,7 +11339,7 @@ var KeyboardShortcut = ({
|
|
|
11320
11339
|
$fullWidth: fullWidth,
|
|
11321
11340
|
...otherProps,
|
|
11322
11341
|
children: [
|
|
11323
|
-
(0,
|
|
11342
|
+
(0, import_type_guards41.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(Label2, { children: label }),
|
|
11324
11343
|
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
11325
11344
|
StyledKey,
|
|
11326
11345
|
{
|
|
@@ -11334,18 +11353,18 @@ var KeyboardShortcut = ({
|
|
|
11334
11353
|
KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
11335
11354
|
|
|
11336
11355
|
// src/components/List/List.tsx
|
|
11337
|
-
var
|
|
11356
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
11338
11357
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
11339
11358
|
|
|
11340
11359
|
// src/components/List/ListItem.tsx
|
|
11341
11360
|
var import_styled_components62 = __toESM(require("styled-components"));
|
|
11342
|
-
var
|
|
11361
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
11343
11362
|
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
11344
11363
|
var ListItemComponent = import_styled_components62.default.li`
|
|
11345
11364
|
margin-bottom: var(--wui-space-02);
|
|
11346
11365
|
`;
|
|
11347
11366
|
var ListItem = ({ children }) => {
|
|
11348
|
-
if ((0,
|
|
11367
|
+
if ((0, import_type_guards42.isNil)(children)) {
|
|
11349
11368
|
return null;
|
|
11350
11369
|
}
|
|
11351
11370
|
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(ListItemComponent, { children });
|
|
@@ -11475,13 +11494,13 @@ var List = ({
|
|
|
11475
11494
|
...otherProps
|
|
11476
11495
|
}) => {
|
|
11477
11496
|
const listVariant = variant ?? "bullets";
|
|
11478
|
-
if ((0,
|
|
11497
|
+
if ((0, import_type_guards43.isNotNil)(children)) {
|
|
11479
11498
|
if (Array.isArray(children) && !children.length) {
|
|
11480
11499
|
return null;
|
|
11481
11500
|
}
|
|
11482
11501
|
return renderListComponent(children, listVariant, otherProps);
|
|
11483
11502
|
}
|
|
11484
|
-
if ((0,
|
|
11503
|
+
if ((0, import_type_guards43.isNotNil)(items)) {
|
|
11485
11504
|
if (!items.length) {
|
|
11486
11505
|
return null;
|
|
11487
11506
|
}
|
|
@@ -11492,15 +11511,15 @@ var List = ({
|
|
|
11492
11511
|
List.displayName = "List";
|
|
11493
11512
|
|
|
11494
11513
|
// src/components/Menu/Menu.tsx
|
|
11495
|
-
var
|
|
11514
|
+
var import_react53 = require("react");
|
|
11496
11515
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
11497
11516
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
11498
|
-
var
|
|
11517
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
11499
11518
|
|
|
11500
11519
|
// src/components/Menu/MenuContext.tsx
|
|
11501
|
-
var
|
|
11502
|
-
var MenuContext = (0,
|
|
11503
|
-
var useMenuContext = () => (0,
|
|
11520
|
+
var import_react52 = require("react");
|
|
11521
|
+
var MenuContext = (0, import_react52.createContext)({ compact: false });
|
|
11522
|
+
var useMenuContext = () => (0, import_react52.useContext)(MenuContext);
|
|
11504
11523
|
|
|
11505
11524
|
// src/components/Menu/Menu.tsx
|
|
11506
11525
|
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
@@ -11592,7 +11611,7 @@ var MenuContent = (0, import_styled_components64.default)(import_react_dropdown_
|
|
|
11592
11611
|
${menuContentCss}
|
|
11593
11612
|
min-width: var(--radix-dropdown-menu-trigger-width);
|
|
11594
11613
|
`;
|
|
11595
|
-
var Menu = (0,
|
|
11614
|
+
var Menu = (0, import_react53.forwardRef)(
|
|
11596
11615
|
({
|
|
11597
11616
|
align = "start",
|
|
11598
11617
|
children,
|
|
@@ -11606,9 +11625,9 @@ var Menu = (0, import_react52.forwardRef)(
|
|
|
11606
11625
|
onInteractOutside,
|
|
11607
11626
|
...props
|
|
11608
11627
|
}, ref) => {
|
|
11609
|
-
const contextValue = (0,
|
|
11628
|
+
const contextValue = (0, import_react53.useMemo)(() => ({ compact }), [compact]);
|
|
11610
11629
|
let controlProps = {
|
|
11611
|
-
...(0,
|
|
11630
|
+
...(0, import_type_guards44.isNotNil)(onOpenChange) && (0, import_type_guards44.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
11612
11631
|
};
|
|
11613
11632
|
if (disabled) {
|
|
11614
11633
|
controlProps = {
|
|
@@ -11622,7 +11641,7 @@ var Menu = (0, import_react52.forwardRef)(
|
|
|
11622
11641
|
modal: false,
|
|
11623
11642
|
...controlProps,
|
|
11624
11643
|
children: [
|
|
11625
|
-
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0,
|
|
11644
|
+
/* @__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)(
|
|
11626
11645
|
Button,
|
|
11627
11646
|
{
|
|
11628
11647
|
ref,
|
|
@@ -11684,15 +11703,15 @@ var MenuLabel = ({ children, ...props }) => {
|
|
|
11684
11703
|
MenuLabel.displayName = "MenuLabel";
|
|
11685
11704
|
|
|
11686
11705
|
// src/components/Menu/SubMenu.tsx
|
|
11687
|
-
var
|
|
11706
|
+
var import_react55 = require("react");
|
|
11688
11707
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11689
11708
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
11690
|
-
var
|
|
11709
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
11691
11710
|
|
|
11692
11711
|
// src/components/Menu/MenuItemButton.tsx
|
|
11693
|
-
var
|
|
11712
|
+
var import_react54 = require("react");
|
|
11694
11713
|
var import_styled_components66 = __toESM(require("styled-components"));
|
|
11695
|
-
var
|
|
11714
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
11696
11715
|
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
11697
11716
|
var StyledButton3 = (0, import_styled_components66.default)(Button)`
|
|
11698
11717
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -11767,10 +11786,10 @@ var StyledBadgeContainer = import_styled_components66.default.div`
|
|
|
11767
11786
|
font-size: var(--wui-typography-label-4-size);
|
|
11768
11787
|
color: var(--wui-color-text-secondary);
|
|
11769
11788
|
`;
|
|
11770
|
-
var MenuItemButton = (0,
|
|
11789
|
+
var MenuItemButton = (0, import_react54.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
11771
11790
|
let { colorScheme, badge } = props;
|
|
11772
11791
|
if (appearance === "dangerous") {
|
|
11773
|
-
if ((0,
|
|
11792
|
+
if ((0, import_type_guards45.isNotUndefined)(colorScheme)) {
|
|
11774
11793
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
11775
11794
|
}
|
|
11776
11795
|
colorScheme = "error";
|
|
@@ -11800,7 +11819,7 @@ var MenuItemButton = (0, import_react53.forwardRef)(({ children, appearance, com
|
|
|
11800
11819
|
children: [
|
|
11801
11820
|
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
11802
11821
|
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
11803
|
-
(0,
|
|
11822
|
+
(0, import_type_guards45.isNotNil)(badge) || (0, import_type_guards45.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
11804
11823
|
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
11805
11824
|
]
|
|
11806
11825
|
}
|
|
@@ -11867,12 +11886,12 @@ var SubMenu = ({
|
|
|
11867
11886
|
...props
|
|
11868
11887
|
}) => {
|
|
11869
11888
|
const { isSmAndUp } = useMq();
|
|
11870
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
11889
|
+
const [isExpanded, setIsExpanded] = (0, import_react55.useState)(false);
|
|
11871
11890
|
const { compact } = useMenuContext();
|
|
11872
11891
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
11873
11892
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
11874
11893
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(MenuItemLabel, { children: label }),
|
|
11875
|
-
(0,
|
|
11894
|
+
(0, import_type_guards46.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(MenuItemDescription, { children: description }) : null
|
|
11876
11895
|
] }),
|
|
11877
11896
|
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
11878
11897
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
@@ -11896,10 +11915,10 @@ var SubMenu = ({
|
|
|
11896
11915
|
SubMenu.displayName = "SubMenu";
|
|
11897
11916
|
|
|
11898
11917
|
// src/components/Menu/MenuItem.tsx
|
|
11899
|
-
var
|
|
11918
|
+
var import_react56 = require("react");
|
|
11900
11919
|
var import_react_dropdown_menu4 = require("@radix-ui/react-dropdown-menu");
|
|
11901
11920
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
11902
|
-
var MenuItem = (0,
|
|
11921
|
+
var MenuItem = (0, import_react56.forwardRef)(
|
|
11903
11922
|
({ onSelect = () => null, ...props }, ref) => {
|
|
11904
11923
|
return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
|
|
11905
11924
|
import_react_dropdown_menu4.DropdownMenuItem,
|
|
@@ -11964,7 +11983,7 @@ RadioMenuItem.displayName = "RadioMenuItem";
|
|
|
11964
11983
|
|
|
11965
11984
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
11966
11985
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
11967
|
-
var
|
|
11986
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
11968
11987
|
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
11969
11988
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
11970
11989
|
return checked ? /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
@@ -12038,8 +12057,8 @@ var CheckboxMenuItem = ({
|
|
|
12038
12057
|
MenuItemButton,
|
|
12039
12058
|
{
|
|
12040
12059
|
...props,
|
|
12041
|
-
leftIcon: (0,
|
|
12042
|
-
rightIcon: (0,
|
|
12060
|
+
leftIcon: (0, import_type_guards47.isNotNil)(props.icon) ? props.icon : /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(CheckboxIndicator, { checked }),
|
|
12061
|
+
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
|
|
12043
12062
|
}
|
|
12044
12063
|
)
|
|
12045
12064
|
}
|
|
@@ -12048,17 +12067,17 @@ var CheckboxMenuItem = ({
|
|
|
12048
12067
|
CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
12049
12068
|
|
|
12050
12069
|
// src/components/Menu/FilterMenu.tsx
|
|
12051
|
-
var
|
|
12070
|
+
var import_react57 = require("react");
|
|
12071
|
+
var import_react_dropdown_menu8 = require("@radix-ui/react-dropdown-menu");
|
|
12052
12072
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
12053
12073
|
var FilterMenuItem = CheckboxMenuItem;
|
|
12054
|
-
var FilterMenu = (0,
|
|
12074
|
+
var FilterMenu = (0, import_react57.forwardRef)(
|
|
12055
12075
|
({ value, onChange, searchValue, onSearchValueChange, children, ...props }, ref) => {
|
|
12056
12076
|
return /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
|
|
12057
12077
|
Menu,
|
|
12058
12078
|
{
|
|
12059
12079
|
...props,
|
|
12060
12080
|
ref,
|
|
12061
|
-
isOpen: true,
|
|
12062
12081
|
children: [
|
|
12063
12082
|
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
12064
12083
|
Card,
|
|
@@ -12082,7 +12101,6 @@ var FilterMenu = (0, import_react56.forwardRef)(
|
|
|
12082
12101
|
onChange: (event) => {
|
|
12083
12102
|
onSearchValueChange(event.target.value);
|
|
12084
12103
|
},
|
|
12085
|
-
onClick: (event) => event.preventDefault(),
|
|
12086
12104
|
onKeyDown: (event) => {
|
|
12087
12105
|
if (event.key === "ArrowDown") {
|
|
12088
12106
|
event.preventDefault();
|
|
@@ -12096,7 +12114,8 @@ var FilterMenu = (0, import_react56.forwardRef)(
|
|
|
12096
12114
|
},
|
|
12097
12115
|
placeholder: "Search...",
|
|
12098
12116
|
tabIndex: 0,
|
|
12099
|
-
type: "search"
|
|
12117
|
+
type: "search",
|
|
12118
|
+
value: searchValue
|
|
12100
12119
|
}
|
|
12101
12120
|
)
|
|
12102
12121
|
}
|
|
@@ -12109,32 +12128,39 @@ var FilterMenu = (0, import_react56.forwardRef)(
|
|
|
12109
12128
|
children: " "
|
|
12110
12129
|
}
|
|
12111
12130
|
),
|
|
12112
|
-
|
|
12113
|
-
value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
12114
|
-
|
|
12131
|
+
import_react57.Children.toArray(children).length > 0 ? children : /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(MenuItem, { disabled: true, children: "No results found" }),
|
|
12132
|
+
value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
12133
|
+
import_react_dropdown_menu8.DropdownMenuItem,
|
|
12115
12134
|
{
|
|
12116
|
-
|
|
12117
|
-
|
|
12118
|
-
borderRadius: "border-radius-02",
|
|
12119
|
-
paddingSize: "space-01",
|
|
12120
|
-
prominence: "default",
|
|
12121
|
-
style: {
|
|
12122
|
-
position: "absolute",
|
|
12123
|
-
bottom: 0,
|
|
12124
|
-
left: 0,
|
|
12125
|
-
right: 0,
|
|
12126
|
-
margin: "1px"
|
|
12127
|
-
},
|
|
12135
|
+
disabled: true,
|
|
12136
|
+
style: { marginTop: "24px" },
|
|
12128
12137
|
children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
12129
|
-
|
|
12138
|
+
Card,
|
|
12130
12139
|
{
|
|
12131
|
-
|
|
12132
|
-
|
|
12133
|
-
|
|
12140
|
+
alignItems: "flex-end",
|
|
12141
|
+
border: false,
|
|
12142
|
+
borderRadius: "border-radius-02",
|
|
12143
|
+
paddingSize: "space-01",
|
|
12144
|
+
prominence: "default",
|
|
12145
|
+
style: {
|
|
12146
|
+
position: "absolute",
|
|
12147
|
+
bottom: 0,
|
|
12148
|
+
left: 0,
|
|
12149
|
+
right: 0,
|
|
12150
|
+
margin: "1px"
|
|
12151
|
+
},
|
|
12152
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
12153
|
+
Button,
|
|
12154
|
+
{
|
|
12155
|
+
onClick: () => onChange([]),
|
|
12156
|
+
size: "sm",
|
|
12157
|
+
children: "Clear"
|
|
12158
|
+
}
|
|
12159
|
+
)
|
|
12134
12160
|
}
|
|
12135
12161
|
)
|
|
12136
12162
|
}
|
|
12137
|
-
)
|
|
12163
|
+
)
|
|
12138
12164
|
]
|
|
12139
12165
|
}
|
|
12140
12166
|
);
|
|
@@ -12143,10 +12169,10 @@ var FilterMenu = (0, import_react56.forwardRef)(
|
|
|
12143
12169
|
FilterMenu.displayName = "FilterMenu";
|
|
12144
12170
|
|
|
12145
12171
|
// src/components/Modal/Modal.tsx
|
|
12146
|
-
var
|
|
12172
|
+
var import_react60 = require("react");
|
|
12147
12173
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
12148
12174
|
var import_react_dialog5 = require("@radix-ui/react-dialog");
|
|
12149
|
-
var
|
|
12175
|
+
var import_type_guards49 = require("@wistia/type-guards");
|
|
12150
12176
|
|
|
12151
12177
|
// src/components/Modal/ModalHeader.tsx
|
|
12152
12178
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
@@ -12203,21 +12229,21 @@ var ModalHeader = ({
|
|
|
12203
12229
|
};
|
|
12204
12230
|
|
|
12205
12231
|
// src/components/Modal/ModalContent.tsx
|
|
12206
|
-
var
|
|
12232
|
+
var import_react59 = require("react");
|
|
12207
12233
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
12208
12234
|
var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
12209
12235
|
|
|
12210
12236
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
12211
|
-
var
|
|
12212
|
-
var
|
|
12237
|
+
var import_react58 = require("react");
|
|
12238
|
+
var import_type_guards48 = require("@wistia/type-guards");
|
|
12213
12239
|
var useFocusRestore = () => {
|
|
12214
|
-
const previouslyFocusedRef = (0,
|
|
12215
|
-
(0,
|
|
12240
|
+
const previouslyFocusedRef = (0, import_react58.useRef)(null);
|
|
12241
|
+
(0, import_react58.useEffect)(() => {
|
|
12216
12242
|
previouslyFocusedRef.current = document.activeElement;
|
|
12217
12243
|
}, []);
|
|
12218
|
-
(0,
|
|
12244
|
+
(0, import_react58.useEffect)(() => {
|
|
12219
12245
|
return () => {
|
|
12220
|
-
if ((0,
|
|
12246
|
+
if ((0, import_type_guards48.isNotNil)(previouslyFocusedRef.current)) {
|
|
12221
12247
|
setTimeout(() => {
|
|
12222
12248
|
previouslyFocusedRef.current?.focus();
|
|
12223
12249
|
}, 0);
|
|
@@ -12353,7 +12379,7 @@ var StyledModalContent = (0, import_styled_components71.default)(import_react_di
|
|
|
12353
12379
|
${({ $positionVariant }) => positionStyleMap[$positionVariant]}
|
|
12354
12380
|
}
|
|
12355
12381
|
`;
|
|
12356
|
-
var ModalContent = (0,
|
|
12382
|
+
var ModalContent = (0, import_react59.forwardRef)(
|
|
12357
12383
|
({ width, positionVariant = "fixed-top", children, ...props }, ref) => {
|
|
12358
12384
|
useFocusRestore();
|
|
12359
12385
|
return /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
@@ -12412,7 +12438,7 @@ var ModalBody = import_styled_components73.default.div`
|
|
|
12412
12438
|
flex: 1 0 0;
|
|
12413
12439
|
order: 2;
|
|
12414
12440
|
`;
|
|
12415
|
-
var Modal = (0,
|
|
12441
|
+
var Modal = (0, import_react60.forwardRef)(
|
|
12416
12442
|
({
|
|
12417
12443
|
children,
|
|
12418
12444
|
hideCloseButton = false,
|
|
@@ -12429,7 +12455,7 @@ var Modal = (0, import_react59.forwardRef)(
|
|
|
12429
12455
|
import_react_dialog5.Root,
|
|
12430
12456
|
{
|
|
12431
12457
|
onOpenChange: (open2) => {
|
|
12432
|
-
if (!open2 && (0,
|
|
12458
|
+
if (!open2 && (0, import_type_guards49.isNotNil)(onRequestClose)) {
|
|
12433
12459
|
onRequestClose();
|
|
12434
12460
|
}
|
|
12435
12461
|
},
|
|
@@ -12441,7 +12467,7 @@ var Modal = (0, import_react59.forwardRef)(
|
|
|
12441
12467
|
{
|
|
12442
12468
|
ref,
|
|
12443
12469
|
onOpenAutoFocus: (event) => {
|
|
12444
|
-
if ((0,
|
|
12470
|
+
if ((0, import_type_guards49.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
12445
12471
|
event.preventDefault();
|
|
12446
12472
|
requestAnimationFrame(() => {
|
|
12447
12473
|
initialFocusRef.current?.focus();
|
|
@@ -12476,9 +12502,9 @@ var import_react_popover2 = require("@radix-ui/react-popover");
|
|
|
12476
12502
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
12477
12503
|
|
|
12478
12504
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
12479
|
-
var
|
|
12505
|
+
var import_type_guards50 = require("@wistia/type-guards");
|
|
12480
12506
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
12481
|
-
return (0,
|
|
12507
|
+
return (0, import_type_guards50.isNotNil)(onOpenChange) && (0, import_type_guards50.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
12482
12508
|
};
|
|
12483
12509
|
|
|
12484
12510
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -12633,7 +12659,7 @@ Popover2.displayName = "Popover";
|
|
|
12633
12659
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
12634
12660
|
var import_styled_components76 = __toESM(require("styled-components"));
|
|
12635
12661
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
12636
|
-
var
|
|
12662
|
+
var import_type_guards51 = require("@wistia/type-guards");
|
|
12637
12663
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
12638
12664
|
var ProgressBarWrapper = import_styled_components76.default.div`
|
|
12639
12665
|
--progress-bar-height: 8px;
|
|
@@ -12688,7 +12714,7 @@ var ProgressBar = ({
|
|
|
12688
12714
|
...props
|
|
12689
12715
|
}) => {
|
|
12690
12716
|
return /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(ProgressBarWrapper, { children: [
|
|
12691
|
-
(0,
|
|
12717
|
+
(0, import_type_guards51.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
12692
12718
|
/* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
12693
12719
|
StyledProgressBar,
|
|
12694
12720
|
{
|
|
@@ -12704,15 +12730,15 @@ var ProgressBar = ({
|
|
|
12704
12730
|
)
|
|
12705
12731
|
}
|
|
12706
12732
|
),
|
|
12707
|
-
(0,
|
|
12733
|
+
(0, import_type_guards51.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
12708
12734
|
] });
|
|
12709
12735
|
};
|
|
12710
12736
|
ProgressBar.displayName = "ProgressBar";
|
|
12711
12737
|
|
|
12712
12738
|
// src/components/Radio/Radio.tsx
|
|
12713
|
-
var
|
|
12739
|
+
var import_react61 = require("react");
|
|
12714
12740
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
12715
|
-
var
|
|
12741
|
+
var import_type_guards52 = require("@wistia/type-guards");
|
|
12716
12742
|
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
12717
12743
|
var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
12718
12744
|
"svg",
|
|
@@ -12813,7 +12839,7 @@ var StyledHiddenRadioInput = import_styled_components77.default.input`
|
|
|
12813
12839
|
display: block;
|
|
12814
12840
|
}
|
|
12815
12841
|
`;
|
|
12816
|
-
var Radio = (0,
|
|
12842
|
+
var Radio = (0, import_react61.forwardRef)(
|
|
12817
12843
|
({
|
|
12818
12844
|
checked,
|
|
12819
12845
|
disabled = false,
|
|
@@ -12828,15 +12854,15 @@ var Radio = (0, import_react60.forwardRef)(
|
|
|
12828
12854
|
hideLabel = false,
|
|
12829
12855
|
...props
|
|
12830
12856
|
}, ref) => {
|
|
12831
|
-
const generatedId = (0,
|
|
12832
|
-
const computedId = (0,
|
|
12857
|
+
const generatedId = (0, import_react61.useId)();
|
|
12858
|
+
const computedId = (0, import_type_guards52.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
12833
12859
|
const radioGroupContext = useRadioGroup();
|
|
12834
12860
|
const contextName = radioGroupContext?.name;
|
|
12835
12861
|
const contextOnChange = radioGroupContext?.onChange;
|
|
12836
12862
|
const contextValue = radioGroupContext?.value;
|
|
12837
12863
|
const radioName = name ?? contextName;
|
|
12838
12864
|
const handleOnChange = onChange ?? contextOnChange;
|
|
12839
|
-
const defaultChecked = (0,
|
|
12865
|
+
const defaultChecked = (0, import_type_guards52.isNotUndefined)(value) && (0, import_type_guards52.isNotUndefined)(contextValue) ? contextValue.includes(value) : void 0;
|
|
12840
12866
|
return /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(
|
|
12841
12867
|
StyledRadioWrapper,
|
|
12842
12868
|
{
|
|
@@ -12855,7 +12881,7 @@ var Radio = (0, import_react60.forwardRef)(
|
|
|
12855
12881
|
required,
|
|
12856
12882
|
type: "radio",
|
|
12857
12883
|
value,
|
|
12858
|
-
...(0,
|
|
12884
|
+
...(0, import_type_guards52.isNotUndefined)(defaultChecked) ? { defaultChecked } : { checked }
|
|
12859
12885
|
}
|
|
12860
12886
|
),
|
|
12861
12887
|
/* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
@@ -12885,20 +12911,20 @@ var Radio = (0, import_react60.forwardRef)(
|
|
|
12885
12911
|
Radio.displayName = "Radio";
|
|
12886
12912
|
|
|
12887
12913
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
12888
|
-
var
|
|
12914
|
+
var import_react64 = require("react");
|
|
12889
12915
|
var import_styled_components79 = __toESM(require("styled-components"));
|
|
12890
12916
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
12891
|
-
var
|
|
12917
|
+
var import_type_guards54 = require("@wistia/type-guards");
|
|
12892
12918
|
|
|
12893
12919
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
12894
|
-
var
|
|
12920
|
+
var import_react62 = require("react");
|
|
12895
12921
|
var import_jsx_runtime261 = require("react/jsx-runtime");
|
|
12896
|
-
var SelectedItemStyleContext = (0,
|
|
12922
|
+
var SelectedItemStyleContext = (0, import_react62.createContext)(null);
|
|
12897
12923
|
var SelectedItemStyleProvider = ({
|
|
12898
12924
|
children
|
|
12899
12925
|
}) => {
|
|
12900
|
-
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0,
|
|
12901
|
-
const selectedItemIndicatorStyle = (0,
|
|
12926
|
+
const [selectedItemMeasurements, setSelectedItemMeasurements] = (0, import_react62.useState)(null);
|
|
12927
|
+
const selectedItemIndicatorStyle = (0, import_react62.useMemo)(
|
|
12902
12928
|
() => selectedItemMeasurements != null ? {
|
|
12903
12929
|
height: `${selectedItemMeasurements.offsetHeight}px`,
|
|
12904
12930
|
transform: `translateX(${selectedItemMeasurements.offsetLeft}px) translateY(-50%)`,
|
|
@@ -12906,7 +12932,7 @@ var SelectedItemStyleProvider = ({
|
|
|
12906
12932
|
} : void 0,
|
|
12907
12933
|
[selectedItemMeasurements]
|
|
12908
12934
|
);
|
|
12909
|
-
const contextValue = (0,
|
|
12935
|
+
const contextValue = (0, import_react62.useMemo)(
|
|
12910
12936
|
() => ({
|
|
12911
12937
|
setSelectedItemMeasurements,
|
|
12912
12938
|
selectedItemIndicatorStyle
|
|
@@ -12916,7 +12942,7 @@ var SelectedItemStyleProvider = ({
|
|
|
12916
12942
|
return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(SelectedItemStyleContext.Provider, { value: contextValue, children });
|
|
12917
12943
|
};
|
|
12918
12944
|
var useSelectedItemStyle = () => {
|
|
12919
|
-
const context = (0,
|
|
12945
|
+
const context = (0, import_react62.useContext)(SelectedItemStyleContext);
|
|
12920
12946
|
if (context === null) {
|
|
12921
12947
|
throw new Error("useSelectedItemStyle must be used within a SelectedItemStyleProvider");
|
|
12922
12948
|
}
|
|
@@ -12925,14 +12951,14 @@ var useSelectedItemStyle = () => {
|
|
|
12925
12951
|
|
|
12926
12952
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
12927
12953
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12928
|
-
var
|
|
12954
|
+
var import_type_guards53 = require("@wistia/type-guards");
|
|
12929
12955
|
|
|
12930
12956
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
12931
|
-
var
|
|
12932
|
-
var SegmentedControlValueContext = (0,
|
|
12957
|
+
var import_react63 = require("react");
|
|
12958
|
+
var SegmentedControlValueContext = (0, import_react63.createContext)(null);
|
|
12933
12959
|
var SegmentedControlValueProvider = SegmentedControlValueContext.Provider;
|
|
12934
12960
|
var useSegmentedControlValue = () => {
|
|
12935
|
-
const context = (0,
|
|
12961
|
+
const context = (0, import_react63.useContext)(SegmentedControlValueContext);
|
|
12936
12962
|
if (context === null) {
|
|
12937
12963
|
throw new Error("useSegmentedControlValue must be used within a SegmentedControlValueProvider");
|
|
12938
12964
|
}
|
|
@@ -12959,7 +12985,7 @@ var SelectedItemIndicatorDiv = import_styled_components78.default.div`
|
|
|
12959
12985
|
var SelectedItemIndicator = () => {
|
|
12960
12986
|
const selectedValue = useSegmentedControlValue();
|
|
12961
12987
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
12962
|
-
if (!selectedValue || (0,
|
|
12988
|
+
if (!selectedValue || (0, import_type_guards53.isUndefined)(selectedItemIndicatorStyle)) {
|
|
12963
12989
|
return null;
|
|
12964
12990
|
}
|
|
12965
12991
|
return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(
|
|
@@ -12987,7 +13013,7 @@ var segmentedControlStyles = import_styled_components79.css`
|
|
|
12987
13013
|
var StyledSegmentedControl = (0, import_styled_components79.default)(import_react_toggle_group.Root)`
|
|
12988
13014
|
${segmentedControlStyles}
|
|
12989
13015
|
`;
|
|
12990
|
-
var SegmentedControl = (0,
|
|
13016
|
+
var SegmentedControl = (0, import_react64.forwardRef)(
|
|
12991
13017
|
({
|
|
12992
13018
|
children,
|
|
12993
13019
|
disabled = false,
|
|
@@ -12996,7 +13022,7 @@ var SegmentedControl = (0, import_react63.forwardRef)(
|
|
|
12996
13022
|
onSelectedValueChange,
|
|
12997
13023
|
...props
|
|
12998
13024
|
}, ref) => {
|
|
12999
|
-
if ((0,
|
|
13025
|
+
if ((0, import_type_guards54.isNil)(children)) {
|
|
13000
13026
|
return null;
|
|
13001
13027
|
}
|
|
13002
13028
|
return /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(
|
|
@@ -13022,10 +13048,10 @@ var SegmentedControl = (0, import_react63.forwardRef)(
|
|
|
13022
13048
|
SegmentedControl.displayName = "SegmentedControl";
|
|
13023
13049
|
|
|
13024
13050
|
// src/components/SegmentedControl/SegmentedControlItem.tsx
|
|
13025
|
-
var
|
|
13051
|
+
var import_react65 = require("react");
|
|
13026
13052
|
var import_styled_components80 = __toESM(require("styled-components"));
|
|
13027
13053
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
13028
|
-
var
|
|
13054
|
+
var import_type_guards55 = require("@wistia/type-guards");
|
|
13029
13055
|
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
13030
13056
|
var segmentedControlItemStyles = import_styled_components80.css`
|
|
13031
13057
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -13097,11 +13123,11 @@ var segmentedControlItemStyles = import_styled_components80.css`
|
|
|
13097
13123
|
var StyledSegmentedControlItem = (0, import_styled_components80.default)(import_react_toggle_group2.Item)`
|
|
13098
13124
|
${segmentedControlItemStyles}
|
|
13099
13125
|
`;
|
|
13100
|
-
var SegmentedControlItem = (0,
|
|
13126
|
+
var SegmentedControlItem = (0, import_react65.forwardRef)(
|
|
13101
13127
|
({ disabled, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
|
|
13102
13128
|
const selectedValue = useSegmentedControlValue();
|
|
13103
13129
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
13104
|
-
const buttonRef = (0,
|
|
13130
|
+
const buttonRef = (0, import_react65.useRef)(null);
|
|
13105
13131
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
13106
13132
|
const handleClick = (event) => {
|
|
13107
13133
|
const target = event.target;
|
|
@@ -13110,7 +13136,7 @@ var SegmentedControlItem = (0, import_react64.forwardRef)(
|
|
|
13110
13136
|
event.preventDefault();
|
|
13111
13137
|
}
|
|
13112
13138
|
};
|
|
13113
|
-
(0,
|
|
13139
|
+
(0, import_react65.useEffect)(() => {
|
|
13114
13140
|
const buttonElem = buttonRef.current;
|
|
13115
13141
|
if (!buttonElem) {
|
|
13116
13142
|
return void 0;
|
|
@@ -13140,8 +13166,8 @@ var SegmentedControlItem = (0, import_react64.forwardRef)(
|
|
|
13140
13166
|
{
|
|
13141
13167
|
ref: combinedRef,
|
|
13142
13168
|
...otherProps,
|
|
13143
|
-
$hasLabel: (0,
|
|
13144
|
-
"aria-label": (0,
|
|
13169
|
+
$hasLabel: (0, import_type_guards55.isNotNil)(label),
|
|
13170
|
+
"aria-label": (0, import_type_guards55.isNotNil)(label) ? void 0 : ariaLabel,
|
|
13145
13171
|
disabled,
|
|
13146
13172
|
onClick: handleClick,
|
|
13147
13173
|
value,
|
|
@@ -13157,7 +13183,7 @@ SegmentedControlItem.displayName = "SegmentedControlItem";
|
|
|
13157
13183
|
|
|
13158
13184
|
// src/components/Select/Select.tsx
|
|
13159
13185
|
var import_react_select = require("@radix-ui/react-select");
|
|
13160
|
-
var
|
|
13186
|
+
var import_react66 = require("react");
|
|
13161
13187
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
13162
13188
|
var import_jsx_runtime265 = require("react/jsx-runtime");
|
|
13163
13189
|
var StyledTrigger2 = (0, import_styled_components81.default)(import_react_select.Trigger)`
|
|
@@ -13222,7 +13248,7 @@ var StyledContent3 = (0, import_styled_components81.default)(import_react_select
|
|
|
13222
13248
|
max-height: var(--radix-select-content-available-height);
|
|
13223
13249
|
z-index: var(--wui-zindex-select);
|
|
13224
13250
|
`;
|
|
13225
|
-
var Select = (0,
|
|
13251
|
+
var Select = (0, import_react66.forwardRef)(
|
|
13226
13252
|
({
|
|
13227
13253
|
colorScheme = "inherit",
|
|
13228
13254
|
children,
|
|
@@ -13271,9 +13297,9 @@ Select.displayName = "Select";
|
|
|
13271
13297
|
|
|
13272
13298
|
// src/components/Select/SelectOption.tsx
|
|
13273
13299
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
13274
|
-
var
|
|
13300
|
+
var import_react67 = require("react");
|
|
13275
13301
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
13276
|
-
var
|
|
13302
|
+
var import_type_guards56 = require("@wistia/type-guards");
|
|
13277
13303
|
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
13278
13304
|
var StyledItem = (0, import_styled_components82.default)(import_react_select2.Item)`
|
|
13279
13305
|
${variantStyleMap2.body3};
|
|
@@ -13302,7 +13328,7 @@ var StyledItem = (0, import_styled_components82.default)(import_react_select2.It
|
|
|
13302
13328
|
var StyledIconContainer = import_styled_components82.default.span`
|
|
13303
13329
|
width: 12px;
|
|
13304
13330
|
`;
|
|
13305
|
-
var SelectOption = (0,
|
|
13331
|
+
var SelectOption = (0, import_react67.forwardRef)(
|
|
13306
13332
|
({ children, selectedDisplayValue, ...props }, forwardedRef) => {
|
|
13307
13333
|
return /* @__PURE__ */ (0, import_jsx_runtime266.jsxs)(
|
|
13308
13334
|
StyledItem,
|
|
@@ -13317,7 +13343,7 @@ var SelectOption = (0, import_react66.forwardRef)(
|
|
|
13317
13343
|
type: "checkmark"
|
|
13318
13344
|
}
|
|
13319
13345
|
) }) }),
|
|
13320
|
-
(0,
|
|
13346
|
+
(0, import_type_guards56.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime266.jsxs)("div", { children: [
|
|
13321
13347
|
children,
|
|
13322
13348
|
/* @__PURE__ */ (0, import_jsx_runtime266.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
13323
13349
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(import_react_select2.ItemText, { children })
|
|
@@ -13352,7 +13378,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
13352
13378
|
// src/components/Slider/Slider.tsx
|
|
13353
13379
|
var import_react_slider = require("@radix-ui/react-slider");
|
|
13354
13380
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
13355
|
-
var
|
|
13381
|
+
var import_type_guards57 = require("@wistia/type-guards");
|
|
13356
13382
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
13357
13383
|
var SliderContainer = import_styled_components84.default.div`
|
|
13358
13384
|
--wui-slider-track-color: var(--wui-gray-6);
|
|
@@ -13431,7 +13457,7 @@ var Slider = ({
|
|
|
13431
13457
|
"data-testid": dataTestId = "ui-slider",
|
|
13432
13458
|
...otherProps
|
|
13433
13459
|
}) => {
|
|
13434
|
-
if (!((0,
|
|
13460
|
+
if (!((0, import_type_guards57.isNonEmptyString)(ariaLabel) || (0, import_type_guards57.isNonEmptyString)(ariaLabelledby))) {
|
|
13435
13461
|
throw new Error(
|
|
13436
13462
|
"UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
|
|
13437
13463
|
);
|
|
@@ -13477,9 +13503,9 @@ var Slider = ({
|
|
|
13477
13503
|
Slider.displayName = "Slider";
|
|
13478
13504
|
|
|
13479
13505
|
// src/components/Switch/Switch.tsx
|
|
13480
|
-
var
|
|
13506
|
+
var import_react68 = require("react");
|
|
13481
13507
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
13482
|
-
var
|
|
13508
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
13483
13509
|
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
13484
13510
|
var sizeSmall3 = import_styled_components85.css`
|
|
13485
13511
|
--wui-size-small-width: 24px;
|
|
@@ -13582,7 +13608,7 @@ var StyledHiddenSwitchInput = import_styled_components85.default.input`
|
|
|
13582
13608
|
}
|
|
13583
13609
|
}
|
|
13584
13610
|
`;
|
|
13585
|
-
var Switch = (0,
|
|
13611
|
+
var Switch = (0, import_react68.forwardRef)(
|
|
13586
13612
|
({
|
|
13587
13613
|
align = "left",
|
|
13588
13614
|
checked,
|
|
@@ -13598,8 +13624,8 @@ var Switch = (0, import_react67.forwardRef)(
|
|
|
13598
13624
|
hideLabel = false,
|
|
13599
13625
|
...props
|
|
13600
13626
|
}, ref) => {
|
|
13601
|
-
const generatedId = (0,
|
|
13602
|
-
const computedId = (0,
|
|
13627
|
+
const generatedId = (0, import_react68.useId)();
|
|
13628
|
+
const computedId = (0, import_type_guards58.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
13603
13629
|
return /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
13604
13630
|
/* @__PURE__ */ (0, import_jsx_runtime269.jsx)(
|
|
13605
13631
|
StyledHiddenSwitchInput,
|
|
@@ -13689,8 +13715,8 @@ var Table = ({
|
|
|
13689
13715
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
13690
13716
|
|
|
13691
13717
|
// src/components/Table/TableSectionContext.ts
|
|
13692
|
-
var
|
|
13693
|
-
var TableSectionContext = (0,
|
|
13718
|
+
var import_react69 = require("react");
|
|
13719
|
+
var TableSectionContext = (0, import_react69.createContext)(null);
|
|
13694
13720
|
|
|
13695
13721
|
// src/components/Table/TableBody.tsx
|
|
13696
13722
|
var import_jsx_runtime271 = require("react/jsx-runtime");
|
|
@@ -13700,7 +13726,7 @@ var TableBody = ({ children, ...props }) => {
|
|
|
13700
13726
|
};
|
|
13701
13727
|
|
|
13702
13728
|
// src/components/Table/TableCell.tsx
|
|
13703
|
-
var
|
|
13729
|
+
var import_react70 = require("react");
|
|
13704
13730
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
13705
13731
|
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
13706
13732
|
var sharedStyles = import_styled_components88.css`
|
|
@@ -13721,7 +13747,7 @@ var StyledTd = import_styled_components88.default.td`
|
|
|
13721
13747
|
line-height: var(--wui-typography-body-2-line-height);
|
|
13722
13748
|
`;
|
|
13723
13749
|
var TableCell = ({ children, ...props }) => {
|
|
13724
|
-
const section = (0,
|
|
13750
|
+
const section = (0, import_react70.useContext)(TableSectionContext);
|
|
13725
13751
|
if (section === "head") {
|
|
13726
13752
|
return /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(StyledTh, { ...props, children });
|
|
13727
13753
|
}
|
|
@@ -13754,15 +13780,15 @@ var TableRow = ({ children, ...props }) => {
|
|
|
13754
13780
|
|
|
13755
13781
|
// src/components/Tabs/Tabs.tsx
|
|
13756
13782
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
13757
|
-
var
|
|
13758
|
-
var
|
|
13783
|
+
var import_react72 = require("react");
|
|
13784
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
13759
13785
|
|
|
13760
13786
|
// src/components/Tabs/useTabsValue.tsx
|
|
13761
|
-
var
|
|
13762
|
-
var TabsValueContext = (0,
|
|
13787
|
+
var import_react71 = require("react");
|
|
13788
|
+
var TabsValueContext = (0, import_react71.createContext)(null);
|
|
13763
13789
|
var TabsValueProvider = TabsValueContext.Provider;
|
|
13764
13790
|
var useTabsValue = () => {
|
|
13765
|
-
const context = (0,
|
|
13791
|
+
const context = (0, import_react71.useContext)(TabsValueContext);
|
|
13766
13792
|
if (context === null) {
|
|
13767
13793
|
throw new Error("useTabsValue must be used within a TabsValueProvider");
|
|
13768
13794
|
}
|
|
@@ -13778,8 +13804,8 @@ var Tabs = ({
|
|
|
13778
13804
|
defaultValue,
|
|
13779
13805
|
...props
|
|
13780
13806
|
}) => {
|
|
13781
|
-
const [value, setValue] = (0,
|
|
13782
|
-
const onValueChange = (0,
|
|
13807
|
+
const [value, setValue] = (0, import_react72.useState)(valueProp ?? defaultValue);
|
|
13808
|
+
const onValueChange = (0, import_react72.useCallback)(
|
|
13783
13809
|
(newValue) => {
|
|
13784
13810
|
setValue(newValue);
|
|
13785
13811
|
if (onValueChangeProp) {
|
|
@@ -13792,10 +13818,10 @@ var Tabs = ({
|
|
|
13792
13818
|
...props,
|
|
13793
13819
|
onValueChange
|
|
13794
13820
|
};
|
|
13795
|
-
if ((0,
|
|
13821
|
+
if ((0, import_type_guards59.isNotNil)(value)) {
|
|
13796
13822
|
rootProps.value = value;
|
|
13797
13823
|
}
|
|
13798
|
-
if ((0,
|
|
13824
|
+
if ((0, import_type_guards59.isNotNil)(defaultValue)) {
|
|
13799
13825
|
rootProps.defaultValue = defaultValue;
|
|
13800
13826
|
}
|
|
13801
13827
|
return /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(import_react_tabs.Root, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -13815,7 +13841,7 @@ var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
|
13815
13841
|
var import_styled_components93 = __toESM(require("styled-components"));
|
|
13816
13842
|
|
|
13817
13843
|
// src/components/Tabs/SelectedTabIndicator.tsx
|
|
13818
|
-
var
|
|
13844
|
+
var import_type_guards60 = require("@wistia/type-guards");
|
|
13819
13845
|
|
|
13820
13846
|
// src/components/Tabs/TabsSelectedItemIndicatorDiv.tsx
|
|
13821
13847
|
var import_styled_components92 = __toESM(require("styled-components"));
|
|
@@ -13830,7 +13856,7 @@ var import_jsx_runtime278 = require("react/jsx-runtime");
|
|
|
13830
13856
|
var SelectedTabIndicator = () => {
|
|
13831
13857
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
13832
13858
|
const selectedValue = useTabsValue();
|
|
13833
|
-
if (selectedValue == null || (0,
|
|
13859
|
+
if (selectedValue == null || (0, import_type_guards60.isUndefined)(selectedItemIndicatorStyle)) {
|
|
13834
13860
|
return null;
|
|
13835
13861
|
}
|
|
13836
13862
|
return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(
|
|
@@ -13863,8 +13889,8 @@ var TabsList = ({ children, fullWidth = true, ...props }) => {
|
|
|
13863
13889
|
TabsList.displayName = "TabsList";
|
|
13864
13890
|
|
|
13865
13891
|
// src/components/Tabs/TabsTrigger.tsx
|
|
13866
|
-
var
|
|
13867
|
-
var
|
|
13892
|
+
var import_react73 = require("react");
|
|
13893
|
+
var import_type_guards61 = require("@wistia/type-guards");
|
|
13868
13894
|
|
|
13869
13895
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
13870
13896
|
var import_styled_components94 = __toESM(require("styled-components"));
|
|
@@ -13879,13 +13905,13 @@ var StyledRadixTabsTrigger = (0, import_styled_components94.default)(import_reac
|
|
|
13879
13905
|
|
|
13880
13906
|
// src/components/Tabs/TabsTrigger.tsx
|
|
13881
13907
|
var import_jsx_runtime280 = require("react/jsx-runtime");
|
|
13882
|
-
var TabsTrigger = (0,
|
|
13908
|
+
var TabsTrigger = (0, import_react73.forwardRef)(
|
|
13883
13909
|
({ disabled = false, icon, label, "aria-label": ariaLabel, value, ...otherProps }, forwardedRef) => {
|
|
13884
13910
|
const selectedValue = useTabsValue();
|
|
13885
13911
|
const { setSelectedItemMeasurements } = useSelectedItemStyle();
|
|
13886
|
-
const buttonRef = (0,
|
|
13912
|
+
const buttonRef = (0, import_react73.useRef)(null);
|
|
13887
13913
|
const combinedRef = mergeRefs([buttonRef, forwardedRef]);
|
|
13888
|
-
(0,
|
|
13914
|
+
(0, import_react73.useEffect)(() => {
|
|
13889
13915
|
const buttonElem = buttonRef.current;
|
|
13890
13916
|
if (!buttonElem) {
|
|
13891
13917
|
return void 0;
|
|
@@ -13915,8 +13941,8 @@ var TabsTrigger = (0, import_react72.forwardRef)(
|
|
|
13915
13941
|
{
|
|
13916
13942
|
...otherProps,
|
|
13917
13943
|
ref: combinedRef,
|
|
13918
|
-
$hasLabel: (0,
|
|
13919
|
-
"aria-label": (0,
|
|
13944
|
+
$hasLabel: (0, import_type_guards61.isNotNil)(label),
|
|
13945
|
+
"aria-label": (0, import_type_guards61.isNotNil)(label) ? void 0 : ariaLabel,
|
|
13920
13946
|
disabled,
|
|
13921
13947
|
value,
|
|
13922
13948
|
children: [
|
|
@@ -13931,7 +13957,7 @@ TabsTrigger.displayName = "TabsTrigger";
|
|
|
13931
13957
|
|
|
13932
13958
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
13933
13959
|
var import_styled_components95 = __toESM(require("styled-components"));
|
|
13934
|
-
var
|
|
13960
|
+
var import_type_guards62 = require("@wistia/type-guards");
|
|
13935
13961
|
var import_jsx_runtime281 = require("react/jsx-runtime");
|
|
13936
13962
|
var StyledThumbnailBadge = import_styled_components95.default.div`
|
|
13937
13963
|
align-items: center;
|
|
@@ -13959,19 +13985,19 @@ var StyledThumbnailBadge = import_styled_components95.default.div`
|
|
|
13959
13985
|
`;
|
|
13960
13986
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
13961
13987
|
return /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(StyledThumbnailBadge, { ...props, children: [
|
|
13962
|
-
(0,
|
|
13988
|
+
(0, import_type_guards62.isNotNil)(icon) && icon,
|
|
13963
13989
|
/* @__PURE__ */ (0, import_jsx_runtime281.jsx)("span", { children: label })
|
|
13964
13990
|
] });
|
|
13965
13991
|
};
|
|
13966
13992
|
ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
13967
13993
|
|
|
13968
13994
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
13969
|
-
var
|
|
13995
|
+
var import_react74 = require("react");
|
|
13970
13996
|
var import_styled_components98 = __toESM(require("styled-components"));
|
|
13971
|
-
var
|
|
13997
|
+
var import_type_guards65 = require("@wistia/type-guards");
|
|
13972
13998
|
|
|
13973
13999
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
13974
|
-
var
|
|
14000
|
+
var import_type_guards63 = require("@wistia/type-guards");
|
|
13975
14001
|
var import_styled_components96 = require("styled-components");
|
|
13976
14002
|
var gradients = {
|
|
13977
14003
|
defaultDarkOne: import_styled_components96.css`
|
|
@@ -14099,12 +14125,12 @@ var gradients = {
|
|
|
14099
14125
|
};
|
|
14100
14126
|
var gradientMap = Object.keys(gradients);
|
|
14101
14127
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
14102
|
-
return (0,
|
|
14128
|
+
return (0, import_type_guards63.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
14103
14129
|
};
|
|
14104
14130
|
|
|
14105
14131
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
14106
14132
|
var import_styled_components97 = __toESM(require("styled-components"));
|
|
14107
|
-
var
|
|
14133
|
+
var import_type_guards64 = require("@wistia/type-guards");
|
|
14108
14134
|
var import_jsx_runtime282 = require("react/jsx-runtime");
|
|
14109
14135
|
var ScrubLine = import_styled_components97.default.div`
|
|
14110
14136
|
position: absolute;
|
|
@@ -14190,8 +14216,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
14190
14216
|
);
|
|
14191
14217
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
14192
14218
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
14193
|
-
const showScrubLine = (0,
|
|
14194
|
-
const scrubLinePosition = (0,
|
|
14219
|
+
const showScrubLine = (0, import_type_guards64.isNotNil)(cursorPosition);
|
|
14220
|
+
const scrubLinePosition = (0, import_type_guards64.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
14195
14221
|
const viewerStyles = {
|
|
14196
14222
|
position: "relative",
|
|
14197
14223
|
overflow: "hidden",
|
|
@@ -14262,10 +14288,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
14262
14288
|
);
|
|
14263
14289
|
};
|
|
14264
14290
|
var StyledThumbnail = import_styled_components98.default.div`
|
|
14265
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
14291
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards65.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
14266
14292
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
14267
14293
|
// if we don't have $backgroundUrl show a gradient
|
|
14268
|
-
(0,
|
|
14294
|
+
(0, import_type_guards65.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
14269
14295
|
)};
|
|
14270
14296
|
background-position: center center;
|
|
14271
14297
|
background-size: cover;
|
|
@@ -14290,7 +14316,7 @@ var getRelativeMousePosition = (elem, mouseEvent) => {
|
|
|
14290
14316
|
left: relativeLeft
|
|
14291
14317
|
};
|
|
14292
14318
|
};
|
|
14293
|
-
var Thumbnail = (0,
|
|
14319
|
+
var Thumbnail = (0, import_react74.forwardRef)(
|
|
14294
14320
|
({
|
|
14295
14321
|
gradientBackground = "defaultMidOne",
|
|
14296
14322
|
thumbnailImageType = "wide",
|
|
@@ -14301,17 +14327,17 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14301
14327
|
height,
|
|
14302
14328
|
...props
|
|
14303
14329
|
}, ref) => {
|
|
14304
|
-
const [percent, setPercent] = (0,
|
|
14305
|
-
const [isMouseOver, setIsMouseOver] = (0,
|
|
14306
|
-
const [isStoryboardReady, setIsStoryboardReady] = (0,
|
|
14307
|
-
const storyboardElementRef = (0,
|
|
14308
|
-
const [cursorPosition, setCursorPosition] = (0,
|
|
14309
|
-
const backgroundUrl = (0,
|
|
14310
|
-
() => thumbnailImageType === "square" && (0,
|
|
14330
|
+
const [percent, setPercent] = (0, import_react74.useState)(0);
|
|
14331
|
+
const [isMouseOver, setIsMouseOver] = (0, import_react74.useState)(false);
|
|
14332
|
+
const [isStoryboardReady, setIsStoryboardReady] = (0, import_react74.useState)(false);
|
|
14333
|
+
const storyboardElementRef = (0, import_react74.useRef)(null);
|
|
14334
|
+
const [cursorPosition, setCursorPosition] = (0, import_react74.useState)(null);
|
|
14335
|
+
const backgroundUrl = (0, import_react74.useMemo)(
|
|
14336
|
+
() => thumbnailImageType === "square" && (0, import_type_guards65.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
14311
14337
|
[thumbnailImageType, thumbnailUrl]
|
|
14312
14338
|
);
|
|
14313
|
-
const isScrubbable = (0,
|
|
14314
|
-
const trackStoryboardLoadStatus = (0,
|
|
14339
|
+
const isScrubbable = (0, import_type_guards65.isNotNil)(storyboard);
|
|
14340
|
+
const trackStoryboardLoadStatus = (0, import_react74.useCallback)(() => {
|
|
14315
14341
|
if (storyboardElementRef.current || !storyboard) {
|
|
14316
14342
|
return storyboardElementRef.current;
|
|
14317
14343
|
}
|
|
@@ -14321,7 +14347,7 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14321
14347
|
storyboardElementRef.current = asset;
|
|
14322
14348
|
return storyboardElementRef.current;
|
|
14323
14349
|
}, [storyboard]);
|
|
14324
|
-
const handleMouseMove = (0,
|
|
14350
|
+
const handleMouseMove = (0, import_react74.useCallback)(
|
|
14325
14351
|
(mouseEvent) => {
|
|
14326
14352
|
if (!isScrubbable) return;
|
|
14327
14353
|
const elem = mouseEvent.currentTarget;
|
|
@@ -14334,16 +14360,16 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14334
14360
|
},
|
|
14335
14361
|
[isScrubbable, trackStoryboardLoadStatus]
|
|
14336
14362
|
);
|
|
14337
|
-
const handleMouseOut = (0,
|
|
14363
|
+
const handleMouseOut = (0, import_react74.useCallback)(() => {
|
|
14338
14364
|
if (!isScrubbable) return;
|
|
14339
14365
|
setIsMouseOver(false);
|
|
14340
14366
|
setCursorPosition(null);
|
|
14341
14367
|
}, [isScrubbable]);
|
|
14342
|
-
const shouldRenderStoryboard = (0,
|
|
14368
|
+
const shouldRenderStoryboard = (0, import_react74.useMemo)(() => {
|
|
14343
14369
|
return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
|
|
14344
14370
|
}, [isScrubbable, isMouseOver, isStoryboardReady]);
|
|
14345
|
-
const renderStoryboard = (0,
|
|
14346
|
-
if (!storyboard || (0,
|
|
14371
|
+
const renderStoryboard = (0, import_react74.useCallback)(() => {
|
|
14372
|
+
if (!storyboard || (0, import_type_guards65.isUndefined)(height) || (0, import_type_guards65.isEmptyString)(height)) return null;
|
|
14347
14373
|
const {
|
|
14348
14374
|
url,
|
|
14349
14375
|
width: sbWidth,
|
|
@@ -14353,7 +14379,7 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14353
14379
|
frameCount,
|
|
14354
14380
|
aspectRatio
|
|
14355
14381
|
} = storyboard;
|
|
14356
|
-
const targetWidth = (0,
|
|
14382
|
+
const targetWidth = (0, import_type_guards65.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
14357
14383
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
14358
14384
|
return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
14359
14385
|
ThumbnailStoryboardViewer,
|
|
@@ -14374,7 +14400,7 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14374
14400
|
let thumbnailContent = null;
|
|
14375
14401
|
if (shouldRenderStoryboard) {
|
|
14376
14402
|
thumbnailContent = renderStoryboard();
|
|
14377
|
-
} else if ((0,
|
|
14403
|
+
} else if ((0, import_type_guards65.isNotNil)(thumbnailUrl)) {
|
|
14378
14404
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
14379
14405
|
ThumbnailImage,
|
|
14380
14406
|
{
|
|
@@ -14399,7 +14425,7 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14399
14425
|
onMouseOut: handleMouseOut,
|
|
14400
14426
|
role: "presentation",
|
|
14401
14427
|
children: [
|
|
14402
|
-
(0,
|
|
14428
|
+
(0, import_type_guards65.isNotNil)(children) ? children : null,
|
|
14403
14429
|
thumbnailContent
|
|
14404
14430
|
]
|
|
14405
14431
|
}
|
|
@@ -14409,9 +14435,9 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14409
14435
|
Thumbnail.displayName = "Thumbnail";
|
|
14410
14436
|
|
|
14411
14437
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
14412
|
-
var
|
|
14438
|
+
var import_react75 = __toESM(require("react"));
|
|
14413
14439
|
var import_styled_components99 = __toESM(require("styled-components"));
|
|
14414
|
-
var
|
|
14440
|
+
var import_type_guards66 = require("@wistia/type-guards");
|
|
14415
14441
|
var import_jsx_runtime284 = (
|
|
14416
14442
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
14417
14443
|
require("react/jsx-runtime")
|
|
@@ -14489,10 +14515,10 @@ var ThumbnailCollage = ({
|
|
|
14489
14515
|
gradientBackground = "defaultMidOne",
|
|
14490
14516
|
...props
|
|
14491
14517
|
}) => {
|
|
14492
|
-
const thumbnailArray =
|
|
14518
|
+
const thumbnailArray = import_react75.default.Children.toArray(children);
|
|
14493
14519
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
14494
|
-
const thumbnails = (0,
|
|
14495
|
-
return
|
|
14520
|
+
const thumbnails = (0, import_type_guards66.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
14521
|
+
return import_react75.default.cloneElement(child, {
|
|
14496
14522
|
...child.props,
|
|
14497
14523
|
children: void 0
|
|
14498
14524
|
});
|
|
@@ -14519,7 +14545,7 @@ var ThumbnailCollage = ({
|
|
|
14519
14545
|
|
|
14520
14546
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
14521
14547
|
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14522
|
-
var
|
|
14548
|
+
var import_type_guards67 = require("@wistia/type-guards");
|
|
14523
14549
|
var import_jsx_runtime285 = require("react/jsx-runtime");
|
|
14524
14550
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
14525
14551
|
if (iconOnly) {
|
|
@@ -14632,7 +14658,7 @@ var WistiaLogo = ({
|
|
|
14632
14658
|
...props,
|
|
14633
14659
|
children: [
|
|
14634
14660
|
/* @__PURE__ */ (0, import_jsx_runtime285.jsx)("title", { children: title }),
|
|
14635
|
-
(0,
|
|
14661
|
+
(0, import_type_guards67.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("desc", { children: description }) : null,
|
|
14636
14662
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
14637
14663
|
renderLogotype(logotypeColor, iconOnly)
|
|
14638
14664
|
]
|
|
@@ -14644,8 +14670,8 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
14644
14670
|
|
|
14645
14671
|
// src/components/InputPassword/InputPassword.tsx
|
|
14646
14672
|
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14647
|
-
var
|
|
14648
|
-
var
|
|
14673
|
+
var import_react76 = require("react");
|
|
14674
|
+
var import_type_guards68 = require("@wistia/type-guards");
|
|
14649
14675
|
var import_jsx_runtime286 = require("react/jsx-runtime");
|
|
14650
14676
|
var StyledIconButton = (0, import_styled_components101.default)(IconButton)`
|
|
14651
14677
|
/* override size for icon button since prop gets changed by Input */
|
|
@@ -14655,13 +14681,13 @@ var StyledIconButton = (0, import_styled_components101.default)(IconButton)`
|
|
|
14655
14681
|
/* override input padding variable since it is used for Input Icon positioning */
|
|
14656
14682
|
--wui-input-horizontal-padding: 4px;
|
|
14657
14683
|
`;
|
|
14658
|
-
var InputPassword = (0,
|
|
14684
|
+
var InputPassword = (0, import_react76.forwardRef)(
|
|
14659
14685
|
({ onVisibilityToggle, disabled = false, ...props }, ref) => {
|
|
14660
|
-
const [isVisible, setIsVisible] = (0,
|
|
14686
|
+
const [isVisible, setIsVisible] = (0, import_react76.useState)(false);
|
|
14661
14687
|
const handleClick = () => {
|
|
14662
14688
|
const newVisibility = !isVisible;
|
|
14663
14689
|
setIsVisible(newVisibility);
|
|
14664
|
-
if ((0,
|
|
14690
|
+
if ((0, import_type_guards68.isFunction)(onVisibilityToggle)) {
|
|
14665
14691
|
onVisibilityToggle(newVisibility);
|
|
14666
14692
|
}
|
|
14667
14693
|
};
|