@wistia/ui 0.6.45-beta.e259c017.064d232 → 0.6.45
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 +96 -120
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.mjs +68 -94
- 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.6.45
|
|
3
|
+
* @license @wistia/ui v0.6.45
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -118,6 +118,8 @@ __export(index_exports, {
|
|
|
118
118
|
colorSchemeOptions: () => colorSchemeOptions,
|
|
119
119
|
copyToClipboard: () => copyToClipboard,
|
|
120
120
|
dateTime: () => dateTime,
|
|
121
|
+
ellipsisFlexParentStyle: () => ellipsisFlexParentStyle,
|
|
122
|
+
ellipsisStyle: () => ellipsisStyle,
|
|
121
123
|
iconSizeMap: () => iconSizeMap,
|
|
122
124
|
mergeRefs: () => mergeRefs,
|
|
123
125
|
mq: () => mq,
|
|
@@ -2107,10 +2109,6 @@ var isValidRef = (value) => {
|
|
|
2107
2109
|
return (0, import_type_guards7.isNotNil)(value) && (0, import_type_guards7.isRecord)(value) && "current" in value;
|
|
2108
2110
|
};
|
|
2109
2111
|
|
|
2110
|
-
// src/private/helpers/noOpFn/noOpFn.ts
|
|
2111
|
-
var noOpFn = () => {
|
|
2112
|
-
};
|
|
2113
|
-
|
|
2114
2112
|
// src/private/hooks/useEvent/useEvent.ts
|
|
2115
2113
|
var isEventTargetSupported = (eventTarget) => (
|
|
2116
2114
|
// @ts-expect-error the compiler thinks that addEventListener may not exist on eventTarget, but we still need to check it.
|
|
@@ -2135,7 +2133,8 @@ var useEvent = (eventName, eventHandler, eventTarget = window, eventOptions = {}
|
|
|
2135
2133
|
if (savedEventHandler.current !== void 0) {
|
|
2136
2134
|
return savedEventHandler.current(event);
|
|
2137
2135
|
}
|
|
2138
|
-
return
|
|
2136
|
+
return () => {
|
|
2137
|
+
};
|
|
2139
2138
|
};
|
|
2140
2139
|
target.addEventListener(eventName, eventListener, savedEventOptions.current);
|
|
2141
2140
|
return () => {
|
|
@@ -2209,7 +2208,8 @@ var useLockBodyScroll = (locked) => {
|
|
|
2209
2208
|
document.body.style.overflow = originalStyle;
|
|
2210
2209
|
};
|
|
2211
2210
|
}
|
|
2212
|
-
return
|
|
2211
|
+
return () => {
|
|
2212
|
+
};
|
|
2213
2213
|
}, [locked]);
|
|
2214
2214
|
};
|
|
2215
2215
|
|
|
@@ -2346,12 +2346,6 @@ var ellipsisStyle = import_styled_components13.css`
|
|
|
2346
2346
|
}
|
|
2347
2347
|
}
|
|
2348
2348
|
`;
|
|
2349
|
-
var lineClampStyle = import_styled_components13.css`
|
|
2350
|
-
-webkit-box-orient: vertical;
|
|
2351
|
-
-webkit-line-clamp: 1;
|
|
2352
|
-
display: -webkit-box !important;
|
|
2353
|
-
white-space: initial;
|
|
2354
|
-
`;
|
|
2355
2349
|
var ellipsisFlexParentStyle = import_styled_components13.css`
|
|
2356
2350
|
min-width: 0;
|
|
2357
2351
|
`;
|
|
@@ -2360,8 +2354,10 @@ var EllipsisComponent = import_styled_components13.default.span`
|
|
|
2360
2354
|
${({ $lines }) => {
|
|
2361
2355
|
if ((0, import_type_guards9.isNotNil)($lines)) {
|
|
2362
2356
|
return import_styled_components13.css`
|
|
2363
|
-
|
|
2357
|
+
-webkit-box-orient: vertical;
|
|
2364
2358
|
-webkit-line-clamp: ${$lines};
|
|
2359
|
+
display: -webkit-box;
|
|
2360
|
+
white-space: initial;
|
|
2365
2361
|
`;
|
|
2366
2362
|
}
|
|
2367
2363
|
return void 0;
|
|
@@ -8480,12 +8476,11 @@ var CollapsibleContent = ({ clamp, children }) => {
|
|
|
8480
8476
|
|
|
8481
8477
|
// src/components/DataCards/DataCard.tsx
|
|
8482
8478
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
8483
|
-
var
|
|
8479
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
8484
8480
|
|
|
8485
8481
|
// src/components/Heading/Heading.tsx
|
|
8486
8482
|
var import_react26 = require("react");
|
|
8487
8483
|
var import_styled_components38 = __toESM(require("styled-components"));
|
|
8488
|
-
var import_type_guards28 = require("@wistia/type-guards");
|
|
8489
8484
|
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
8490
8485
|
var heroStyle = import_styled_components38.css`
|
|
8491
8486
|
--font-family: var(--wui-typography-heading-hero-family);
|
|
@@ -8547,18 +8542,7 @@ var StyledHeading = import_styled_components38.default.div`
|
|
|
8547
8542
|
line-height: var(--line-height);
|
|
8548
8543
|
color: var(--wui-color-text);
|
|
8549
8544
|
${({ $variant }) => variantStyleMap[$variant]}
|
|
8550
|
-
${({ $
|
|
8551
|
-
if ((0, import_type_guards28.isNotNil)($truncate)) {
|
|
8552
|
-
return import_styled_components38.css`
|
|
8553
|
-
${ellipsisStyle};
|
|
8554
|
-
-webkit-box-orient: vertical;
|
|
8555
|
-
-webkit-line-clamp: ${$truncate};
|
|
8556
|
-
display: -webkit-box;
|
|
8557
|
-
white-space: initial;
|
|
8558
|
-
`;
|
|
8559
|
-
}
|
|
8560
|
-
return void 0;
|
|
8561
|
-
}}
|
|
8545
|
+
${({ $ellipsis }) => $ellipsis && ellipsisStyle};
|
|
8562
8546
|
${({ $inline }) => $inline && import_styled_components38.css`
|
|
8563
8547
|
display: inline-block;
|
|
8564
8548
|
`}
|
|
@@ -8587,9 +8571,9 @@ var HeadingComponent = (0, import_react26.forwardRef)(
|
|
|
8587
8571
|
align = "left",
|
|
8588
8572
|
colorScheme = "inherit",
|
|
8589
8573
|
disabled = false,
|
|
8574
|
+
ellipsis = false,
|
|
8590
8575
|
inline = false,
|
|
8591
8576
|
preventUserSelect = false,
|
|
8592
|
-
truncate,
|
|
8593
8577
|
variant = "heading1",
|
|
8594
8578
|
renderAs,
|
|
8595
8579
|
...props
|
|
@@ -8600,9 +8584,9 @@ var HeadingComponent = (0, import_react26.forwardRef)(
|
|
|
8600
8584
|
$align: align,
|
|
8601
8585
|
$colorScheme: colorScheme,
|
|
8602
8586
|
$disabled: disabled,
|
|
8587
|
+
$ellipsis: ellipsis,
|
|
8603
8588
|
$inline: inline,
|
|
8604
8589
|
$preventUserSelect: preventUserSelect,
|
|
8605
|
-
$truncate: truncate,
|
|
8606
8590
|
$variant: variant,
|
|
8607
8591
|
as: renderAs ?? variantElementMap[variant],
|
|
8608
8592
|
...props
|
|
@@ -8701,8 +8685,8 @@ var DataCard = ({
|
|
|
8701
8685
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(StyledLoadingValue, {}) : value
|
|
8702
8686
|
}
|
|
8703
8687
|
),
|
|
8704
|
-
(0,
|
|
8705
|
-
(0,
|
|
8688
|
+
(0, import_type_guards28.isNotNull)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
8689
|
+
(0, import_type_guards28.isNotNull)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
8706
8690
|
]
|
|
8707
8691
|
}
|
|
8708
8692
|
);
|
|
@@ -8748,7 +8732,6 @@ var import_styled_components42 = __toESM(require("styled-components"));
|
|
|
8748
8732
|
// src/components/Text/Text.tsx
|
|
8749
8733
|
var import_react27 = require("react");
|
|
8750
8734
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
8751
|
-
var import_type_guards30 = require("@wistia/type-guards");
|
|
8752
8735
|
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
8753
8736
|
var bodyBoldStyles = import_styled_components41.css`
|
|
8754
8737
|
> strong,
|
|
@@ -8892,16 +8875,7 @@ var StyledText = import_styled_components41.default.div`
|
|
|
8892
8875
|
font-style: normal;
|
|
8893
8876
|
margin: 0;
|
|
8894
8877
|
${({ $variant }) => variantStyleMap2[$variant]}
|
|
8895
|
-
${({ $
|
|
8896
|
-
if ((0, import_type_guards30.isNotNil)($truncate)) {
|
|
8897
|
-
return import_styled_components41.css`
|
|
8898
|
-
${ellipsisStyle};
|
|
8899
|
-
${lineClampStyle};
|
|
8900
|
-
-webkit-line-clamp: ${$truncate};
|
|
8901
|
-
`;
|
|
8902
|
-
}
|
|
8903
|
-
return void 0;
|
|
8904
|
-
}}
|
|
8878
|
+
${({ $ellipsis }) => $ellipsis && ellipsisStyle};
|
|
8905
8879
|
${({ $inline }) => $inline && import_styled_components41.css`
|
|
8906
8880
|
display: inline-block;
|
|
8907
8881
|
`}
|
|
@@ -8927,10 +8901,10 @@ var TextComponent = (0, import_react27.forwardRef)(
|
|
|
8927
8901
|
align = "left",
|
|
8928
8902
|
colorScheme = "inherit",
|
|
8929
8903
|
disabled = false,
|
|
8904
|
+
ellipsis = false,
|
|
8930
8905
|
inline = false,
|
|
8931
8906
|
preventUserSelect = false,
|
|
8932
8907
|
prominence = "primary",
|
|
8933
|
-
truncate,
|
|
8934
8908
|
variant = "body2",
|
|
8935
8909
|
renderAs,
|
|
8936
8910
|
...props
|
|
@@ -8942,10 +8916,10 @@ var TextComponent = (0, import_react27.forwardRef)(
|
|
|
8942
8916
|
$align: align,
|
|
8943
8917
|
$colorScheme: colorScheme,
|
|
8944
8918
|
$disabled: disabled,
|
|
8919
|
+
$ellipsis: ellipsis,
|
|
8945
8920
|
$inline: inline,
|
|
8946
8921
|
$preventUserSelect: preventUserSelect,
|
|
8947
8922
|
$prominence: prominence,
|
|
8948
|
-
$truncate: truncate,
|
|
8949
8923
|
$variant: variant,
|
|
8950
8924
|
as: renderAs ?? variantElementMap2[variant],
|
|
8951
8925
|
...props
|
|
@@ -9146,7 +9120,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
9146
9120
|
// src/components/Input/Input.tsx
|
|
9147
9121
|
var import_react28 = require("react");
|
|
9148
9122
|
var import_styled_components46 = __toESM(require("styled-components"));
|
|
9149
|
-
var
|
|
9123
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
9150
9124
|
|
|
9151
9125
|
// src/css/sharedStyles/inputCssVariables.ts
|
|
9152
9126
|
var import_styled_components45 = require("styled-components");
|
|
@@ -9284,27 +9258,27 @@ var Input = (0, import_react28.forwardRef)(
|
|
|
9284
9258
|
const internalRef = (0, import_react28.useRef)();
|
|
9285
9259
|
const ref = (
|
|
9286
9260
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
9287
|
-
(0,
|
|
9261
|
+
(0, import_type_guards29.isNotNil)(externalRef) && (0, import_type_guards29.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
9288
9262
|
);
|
|
9289
9263
|
let leftIconToDisplay = leftIcon;
|
|
9290
|
-
if ((0,
|
|
9264
|
+
if ((0, import_type_guards29.isNil)(leftIcon) && type === "search") {
|
|
9291
9265
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(Icon, { type: "search" });
|
|
9292
9266
|
}
|
|
9293
|
-
if ((0,
|
|
9267
|
+
if ((0, import_type_guards29.isNotNil)(leftIconToDisplay)) {
|
|
9294
9268
|
leftIconToDisplay = (0, import_react28.cloneElement)(leftIconToDisplay, {
|
|
9295
9269
|
size: "md",
|
|
9296
9270
|
className: "wui-input-left-icon"
|
|
9297
9271
|
});
|
|
9298
9272
|
}
|
|
9299
9273
|
let rightIconToDisplay = rightIcon;
|
|
9300
|
-
if ((0,
|
|
9274
|
+
if ((0, import_type_guards29.isNotNil)(rightIconToDisplay)) {
|
|
9301
9275
|
rightIconToDisplay = (0, import_react28.cloneElement)(rightIconToDisplay, {
|
|
9302
9276
|
size: "md",
|
|
9303
9277
|
className: "wui-input-right-icon"
|
|
9304
9278
|
});
|
|
9305
9279
|
}
|
|
9306
9280
|
const handleFocus2 = (event) => {
|
|
9307
|
-
if ((0,
|
|
9281
|
+
if ((0, import_type_guards29.isNotNil)(props.onFocus)) {
|
|
9308
9282
|
props.onFocus(event);
|
|
9309
9283
|
}
|
|
9310
9284
|
if (autoSelect && isValidRef(ref) && "current" in ref) {
|
|
@@ -9485,7 +9459,7 @@ var EditableHeading = ({
|
|
|
9485
9459
|
// src/components/Form/Form.tsx
|
|
9486
9460
|
var import_react31 = require("react");
|
|
9487
9461
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
9488
|
-
var
|
|
9462
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
9489
9463
|
|
|
9490
9464
|
// src/components/Stack/Stack.tsx
|
|
9491
9465
|
var import_react30 = require("react");
|
|
@@ -9551,7 +9525,7 @@ var FormComponent = ({
|
|
|
9551
9525
|
const id = props.id ?? autoId;
|
|
9552
9526
|
const handleValidate = (nextFormData) => {
|
|
9553
9527
|
const nextData = Object.fromEntries(nextFormData.entries());
|
|
9554
|
-
if ((0,
|
|
9528
|
+
if ((0, import_type_guards30.isUndefined)(validate)) {
|
|
9555
9529
|
return {};
|
|
9556
9530
|
}
|
|
9557
9531
|
return validate(nextData);
|
|
@@ -9561,7 +9535,7 @@ var FormComponent = ({
|
|
|
9561
9535
|
props.onBlur(event);
|
|
9562
9536
|
}
|
|
9563
9537
|
const formData = new FormData(event.currentTarget);
|
|
9564
|
-
if ((0,
|
|
9538
|
+
if ((0, import_type_guards30.isNotUndefined)(validate)) {
|
|
9565
9539
|
handleValidate(formData);
|
|
9566
9540
|
}
|
|
9567
9541
|
};
|
|
@@ -9658,7 +9632,7 @@ var useFormState = (action, initialData = {}) => {
|
|
|
9658
9632
|
|
|
9659
9633
|
// src/components/Form/FormErrorSummary.tsx
|
|
9660
9634
|
var import_react33 = require("react");
|
|
9661
|
-
var
|
|
9635
|
+
var import_type_guards31 = require("@wistia/type-guards");
|
|
9662
9636
|
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9663
9637
|
var ErrorItem = ({ name, error, formId }) => {
|
|
9664
9638
|
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
@@ -9672,8 +9646,8 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9672
9646
|
}
|
|
9673
9647
|
return /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)("div", { ref, children: [
|
|
9674
9648
|
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)("p", { children: description }),
|
|
9675
|
-
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0,
|
|
9676
|
-
([name, error]) => (0,
|
|
9649
|
+
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards31.isNotUndefined)(error)).map(
|
|
9650
|
+
([name, error]) => (0, import_type_guards31.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
9677
9651
|
ErrorItem,
|
|
9678
9652
|
{
|
|
9679
9653
|
error: err,
|
|
@@ -9697,7 +9671,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9697
9671
|
// src/components/FormField/FormField.tsx
|
|
9698
9672
|
var import_react36 = require("react");
|
|
9699
9673
|
var import_styled_components52 = __toESM(require("styled-components"));
|
|
9700
|
-
var
|
|
9674
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
9701
9675
|
|
|
9702
9676
|
// src/components/Label/Label.tsx
|
|
9703
9677
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
@@ -9857,7 +9831,7 @@ var StyledErrorList = import_styled_components52.default.ul`
|
|
|
9857
9831
|
gap: var(--wui-space-01);
|
|
9858
9832
|
`;
|
|
9859
9833
|
var ErrorMessages = ({ errors, id }) => {
|
|
9860
|
-
const isMultipleErrors = (0,
|
|
9834
|
+
const isMultipleErrors = (0, import_type_guards32.isArray)(errors);
|
|
9861
9835
|
return isMultipleErrors ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(StyledErrorList, { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
9862
9836
|
Text,
|
|
9863
9837
|
{
|
|
@@ -9907,19 +9881,19 @@ var FormField = ({
|
|
|
9907
9881
|
"aria-describedby": ariaDescribedby,
|
|
9908
9882
|
...props
|
|
9909
9883
|
};
|
|
9910
|
-
if ((0,
|
|
9884
|
+
if ((0, import_type_guards32.isUndefined)(value) && (0, import_type_guards32.isNotUndefined)(defaultValue)) {
|
|
9911
9885
|
childProps = {
|
|
9912
9886
|
...childProps,
|
|
9913
9887
|
defaultValue
|
|
9914
9888
|
};
|
|
9915
9889
|
}
|
|
9916
|
-
if ((0,
|
|
9917
|
-
const computedName = (0,
|
|
9890
|
+
if ((0, import_type_guards32.isNotNil)(checkboxGroup)) {
|
|
9891
|
+
const computedName = (0, import_type_guards32.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
9918
9892
|
const handleChange = (event) => {
|
|
9919
|
-
if ((0,
|
|
9893
|
+
if ((0, import_type_guards32.isNotUndefined)(props.onChange)) {
|
|
9920
9894
|
props.onChange(event);
|
|
9921
9895
|
}
|
|
9922
|
-
if ((0,
|
|
9896
|
+
if ((0, import_type_guards32.isNotUndefined)(checkboxGroup.onChange)) {
|
|
9923
9897
|
checkboxGroup.onChange(event);
|
|
9924
9898
|
}
|
|
9925
9899
|
};
|
|
@@ -9927,7 +9901,7 @@ var FormField = ({
|
|
|
9927
9901
|
...childProps,
|
|
9928
9902
|
name: computedName,
|
|
9929
9903
|
onChange: handleChange,
|
|
9930
|
-
"aria-invalid": (0,
|
|
9904
|
+
"aria-invalid": (0, import_type_guards32.isNotNil)(error)
|
|
9931
9905
|
};
|
|
9932
9906
|
}
|
|
9933
9907
|
import_react36.Children.only(children);
|
|
@@ -9938,9 +9912,9 @@ var FormField = ({
|
|
|
9938
9912
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
9939
9913
|
children: [
|
|
9940
9914
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
9941
|
-
(0,
|
|
9915
|
+
(0, import_type_guards32.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9942
9916
|
(0, import_react36.cloneElement)(children, childProps),
|
|
9943
|
-
(0,
|
|
9917
|
+
(0, import_type_guards32.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(import_jsx_runtime227.Fragment, { children: [
|
|
9944
9918
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)("div", {}),
|
|
9945
9919
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
9946
9920
|
ErrorMessages,
|
|
@@ -10018,7 +9992,7 @@ IconButton.displayName = "IconButton";
|
|
|
10018
9992
|
// src/components/Menu/Menu.tsx
|
|
10019
9993
|
var import_styled_components54 = __toESM(require("styled-components"));
|
|
10020
9994
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
10021
|
-
var
|
|
9995
|
+
var import_type_guards33 = require("@wistia/type-guards");
|
|
10022
9996
|
var import_react40 = require("react");
|
|
10023
9997
|
|
|
10024
9998
|
// src/components/Menu/MenuContext.tsx
|
|
@@ -10130,7 +10104,7 @@ var Menu = ({
|
|
|
10130
10104
|
}) => {
|
|
10131
10105
|
const contextValue = (0, import_react40.useMemo)(() => ({ compact }), [compact]);
|
|
10132
10106
|
let controlProps = {
|
|
10133
|
-
...(0,
|
|
10107
|
+
...(0, import_type_guards33.isNotNil)(onOpenChange) && (0, import_type_guards33.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
10134
10108
|
};
|
|
10135
10109
|
if (disabled) {
|
|
10136
10110
|
controlProps = {
|
|
@@ -10144,7 +10118,7 @@ var Menu = ({
|
|
|
10144
10118
|
modal: false,
|
|
10145
10119
|
...controlProps,
|
|
10146
10120
|
children: [
|
|
10147
|
-
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0,
|
|
10121
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards33.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
10148
10122
|
Button,
|
|
10149
10123
|
{
|
|
10150
10124
|
"aria-expanded": isOpen,
|
|
@@ -10205,12 +10179,12 @@ MenuLabel.displayName = "MenuLabel";
|
|
|
10205
10179
|
var import_react42 = require("react");
|
|
10206
10180
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
10207
10181
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
10208
|
-
var
|
|
10182
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
10209
10183
|
|
|
10210
10184
|
// src/components/Menu/MenuItemButton.tsx
|
|
10211
10185
|
var import_react41 = require("react");
|
|
10212
10186
|
var import_styled_components56 = __toESM(require("styled-components"));
|
|
10213
|
-
var
|
|
10187
|
+
var import_type_guards34 = require("@wistia/type-guards");
|
|
10214
10188
|
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
10215
10189
|
var StyledButton3 = (0, import_styled_components56.default)(Button)`
|
|
10216
10190
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -10288,7 +10262,7 @@ var StyledBadgeContainer = import_styled_components56.default.div`
|
|
|
10288
10262
|
var MenuItemButton = (0, import_react41.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
10289
10263
|
let { colorScheme, badge } = props;
|
|
10290
10264
|
if (appearance === "dangerous") {
|
|
10291
|
-
if ((0,
|
|
10265
|
+
if ((0, import_type_guards34.isNotUndefined)(colorScheme)) {
|
|
10292
10266
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
10293
10267
|
}
|
|
10294
10268
|
colorScheme = "error";
|
|
@@ -10318,7 +10292,7 @@ var MenuItemButton = (0, import_react41.forwardRef)(({ children, appearance, com
|
|
|
10318
10292
|
children: [
|
|
10319
10293
|
props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
10320
10294
|
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
10321
|
-
(0,
|
|
10295
|
+
(0, import_type_guards34.isNotNil)(badge) || (0, import_type_guards34.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
10322
10296
|
props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
10323
10297
|
]
|
|
10324
10298
|
}
|
|
@@ -10386,7 +10360,7 @@ var SubMenu = ({
|
|
|
10386
10360
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
10387
10361
|
/* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
10388
10362
|
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(MenuItemLabel, { children: label }),
|
|
10389
|
-
(0,
|
|
10363
|
+
(0, import_type_guards35.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(MenuItemDescription, { children: description }) : null
|
|
10390
10364
|
] }),
|
|
10391
10365
|
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
10392
10366
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
@@ -10566,7 +10540,7 @@ CheckboxMenuItem.displayName = "CheckboxMenuItem";
|
|
|
10566
10540
|
var import_react47 = require("react");
|
|
10567
10541
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
10568
10542
|
var import_react_dialog4 = require("@radix-ui/react-dialog");
|
|
10569
|
-
var
|
|
10543
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
10570
10544
|
|
|
10571
10545
|
// src/components/Modal/ModalHeader.tsx
|
|
10572
10546
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
@@ -10629,7 +10603,7 @@ var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
|
10629
10603
|
|
|
10630
10604
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
10631
10605
|
var import_react44 = require("react");
|
|
10632
|
-
var
|
|
10606
|
+
var import_type_guards36 = require("@wistia/type-guards");
|
|
10633
10607
|
var useFocusRestore = () => {
|
|
10634
10608
|
const previouslyFocusedRef = (0, import_react44.useRef)(null);
|
|
10635
10609
|
(0, import_react44.useEffect)(() => {
|
|
@@ -10637,7 +10611,7 @@ var useFocusRestore = () => {
|
|
|
10637
10611
|
}, []);
|
|
10638
10612
|
(0, import_react44.useEffect)(() => {
|
|
10639
10613
|
return () => {
|
|
10640
|
-
if ((0,
|
|
10614
|
+
if ((0, import_type_guards36.isNotNil)(previouslyFocusedRef.current)) {
|
|
10641
10615
|
setTimeout(() => {
|
|
10642
10616
|
previouslyFocusedRef.current?.focus();
|
|
10643
10617
|
}, 0);
|
|
@@ -10784,7 +10758,7 @@ var Modal = (0, import_react47.forwardRef)(
|
|
|
10784
10758
|
import_react_dialog4.Root,
|
|
10785
10759
|
{
|
|
10786
10760
|
onOpenChange: (open2) => {
|
|
10787
|
-
if (!open2 && (0,
|
|
10761
|
+
if (!open2 && (0, import_type_guards37.isNotNil)(onRequestClose)) {
|
|
10788
10762
|
onRequestClose();
|
|
10789
10763
|
}
|
|
10790
10764
|
},
|
|
@@ -10797,7 +10771,7 @@ var Modal = (0, import_react47.forwardRef)(
|
|
|
10797
10771
|
ref,
|
|
10798
10772
|
fullHeight,
|
|
10799
10773
|
onOpenAutoFocus: (event) => {
|
|
10800
|
-
if ((0,
|
|
10774
|
+
if ((0, import_type_guards37.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
10801
10775
|
event.preventDefault();
|
|
10802
10776
|
requestAnimationFrame(() => {
|
|
10803
10777
|
initialFocusRef.current?.focus();
|
|
@@ -10831,9 +10805,9 @@ var import_react_popover = require("@radix-ui/react-popover");
|
|
|
10831
10805
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
10832
10806
|
|
|
10833
10807
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
10834
|
-
var
|
|
10808
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
10835
10809
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
10836
|
-
return (0,
|
|
10810
|
+
return (0, import_type_guards38.isNotNil)(onOpenChange) && (0, import_type_guards38.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
10837
10811
|
};
|
|
10838
10812
|
|
|
10839
10813
|
// src/components/Popover/Popover.tsx
|
|
@@ -10901,7 +10875,7 @@ Popover.displayName = "Popover";
|
|
|
10901
10875
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
10902
10876
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
10903
10877
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
10904
|
-
var
|
|
10878
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
10905
10879
|
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
10906
10880
|
var ProgressBarWrapper = import_styled_components65.default.div`
|
|
10907
10881
|
--progress-bar-height: 8px;
|
|
@@ -10956,7 +10930,7 @@ var ProgressBar = ({
|
|
|
10956
10930
|
...props
|
|
10957
10931
|
}) => {
|
|
10958
10932
|
return /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)(ProgressBarWrapper, { children: [
|
|
10959
|
-
(0,
|
|
10933
|
+
(0, import_type_guards39.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
10960
10934
|
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
10961
10935
|
StyledProgressBar,
|
|
10962
10936
|
{
|
|
@@ -10972,7 +10946,7 @@ var ProgressBar = ({
|
|
|
10972
10946
|
)
|
|
10973
10947
|
}
|
|
10974
10948
|
),
|
|
10975
|
-
(0,
|
|
10949
|
+
(0, import_type_guards39.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
10976
10950
|
] });
|
|
10977
10951
|
};
|
|
10978
10952
|
ProgressBar.displayName = "ProgressBar";
|
|
@@ -10980,7 +10954,7 @@ ProgressBar.displayName = "ProgressBar";
|
|
|
10980
10954
|
// src/components/Radio/Radio.tsx
|
|
10981
10955
|
var import_react48 = require("react");
|
|
10982
10956
|
var import_styled_components66 = __toESM(require("styled-components"));
|
|
10983
|
-
var
|
|
10957
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
10984
10958
|
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
10985
10959
|
var RadioIcon = () => /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
10986
10960
|
"svg",
|
|
@@ -11097,7 +11071,7 @@ var Radio = (0, import_react48.forwardRef)(
|
|
|
11097
11071
|
...props
|
|
11098
11072
|
}, ref) => {
|
|
11099
11073
|
const generatedId = (0, import_react48.useId)();
|
|
11100
|
-
const computedId = (0,
|
|
11074
|
+
const computedId = (0, import_type_guards40.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
11101
11075
|
return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(
|
|
11102
11076
|
StyledRadioWrapper,
|
|
11103
11077
|
{
|
|
@@ -11149,7 +11123,7 @@ Radio.displayName = "Radio";
|
|
|
11149
11123
|
var import_react52 = require("react");
|
|
11150
11124
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
11151
11125
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
11152
|
-
var
|
|
11126
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
11153
11127
|
|
|
11154
11128
|
// src/components/SegmentedControl/useSelectedItemMeasurements.tsx
|
|
11155
11129
|
var import_react49 = require("react");
|
|
@@ -11260,7 +11234,7 @@ var SegmentedControl = (0, import_react52.forwardRef)(
|
|
|
11260
11234
|
onSelectedValueChange,
|
|
11261
11235
|
...props
|
|
11262
11236
|
}, ref) => {
|
|
11263
|
-
if ((0,
|
|
11237
|
+
if ((0, import_type_guards41.isNil)(children)) {
|
|
11264
11238
|
return null;
|
|
11265
11239
|
}
|
|
11266
11240
|
return /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
@@ -11289,7 +11263,7 @@ SegmentedControl.displayName = "SegmentedControl";
|
|
|
11289
11263
|
var import_react53 = require("react");
|
|
11290
11264
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
11291
11265
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
11292
|
-
var
|
|
11266
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
11293
11267
|
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
11294
11268
|
var segmentedControlItemStyles = import_styled_components69.css`
|
|
11295
11269
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -11396,8 +11370,8 @@ var SegmentedControlItem = (0, import_react53.forwardRef)(
|
|
|
11396
11370
|
StyledSegmentedControlItem,
|
|
11397
11371
|
{
|
|
11398
11372
|
ref: combinedRef,
|
|
11399
|
-
$hasLabel: (0,
|
|
11400
|
-
"aria-label": (0,
|
|
11373
|
+
$hasLabel: (0, import_type_guards42.isNotNil)(label),
|
|
11374
|
+
"aria-label": (0, import_type_guards42.isNotNil)(label) ? void 0 : ariaLabel,
|
|
11401
11375
|
disabled,
|
|
11402
11376
|
onClick: handleClick,
|
|
11403
11377
|
value,
|
|
@@ -11529,7 +11503,7 @@ Select.displayName = "Select";
|
|
|
11529
11503
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
11530
11504
|
var import_react55 = require("react");
|
|
11531
11505
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
11532
|
-
var
|
|
11506
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
11533
11507
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
11534
11508
|
var StyledItem = (0, import_styled_components71.default)(import_react_select2.Item)`
|
|
11535
11509
|
${variantStyleMap2.body3};
|
|
@@ -11573,7 +11547,7 @@ var SelectOption = (0, import_react55.forwardRef)(
|
|
|
11573
11547
|
type: "checkmark"
|
|
11574
11548
|
}
|
|
11575
11549
|
) }) }),
|
|
11576
|
-
(0,
|
|
11550
|
+
(0, import_type_guards43.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)("div", { children: [
|
|
11577
11551
|
children,
|
|
11578
11552
|
/* @__PURE__ */ (0, import_jsx_runtime252.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
11579
11553
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_react_select2.ItemText, { children })
|
|
@@ -11608,7 +11582,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
11608
11582
|
// src/components/Switch/Switch.tsx
|
|
11609
11583
|
var import_react56 = require("react");
|
|
11610
11584
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11611
|
-
var
|
|
11585
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
11612
11586
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
11613
11587
|
var sizeSmall3 = import_styled_components73.css`
|
|
11614
11588
|
--wui-size-small-width: 24px;
|
|
@@ -11727,7 +11701,7 @@ var Switch = (0, import_react56.forwardRef)(
|
|
|
11727
11701
|
...props
|
|
11728
11702
|
}, ref) => {
|
|
11729
11703
|
const generatedId = (0, import_react56.useId)();
|
|
11730
|
-
const computedId = (0,
|
|
11704
|
+
const computedId = (0, import_type_guards44.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11731
11705
|
return /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
11732
11706
|
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
11733
11707
|
StyledHiddenSwitchInput,
|
|
@@ -11874,7 +11848,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
11874
11848
|
// src/components/Tabs/Tabs.tsx
|
|
11875
11849
|
var import_react63 = require("react");
|
|
11876
11850
|
var import_react_tabs4 = require("@radix-ui/react-tabs");
|
|
11877
|
-
var
|
|
11851
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
11878
11852
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
11879
11853
|
|
|
11880
11854
|
// src/components/Tabs/TabPanel.tsx
|
|
@@ -11930,7 +11904,7 @@ TabList.displayName = "TabList";
|
|
|
11930
11904
|
var import_react60 = require("react");
|
|
11931
11905
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
11932
11906
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
11933
|
-
var
|
|
11907
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
11934
11908
|
|
|
11935
11909
|
// src/components/Tabs/useTabsValue.tsx
|
|
11936
11910
|
var import_react59 = require("react");
|
|
@@ -11988,8 +11962,8 @@ var TabItem = (0, import_react60.forwardRef)(
|
|
|
11988
11962
|
StyledTabItem,
|
|
11989
11963
|
{
|
|
11990
11964
|
ref: combinedRef,
|
|
11991
|
-
$hasLabel: (0,
|
|
11992
|
-
"aria-label": (0,
|
|
11965
|
+
$hasLabel: (0, import_type_guards45.isNotNil)(label),
|
|
11966
|
+
"aria-label": (0, import_type_guards45.isNotNil)(label) ? void 0 : ariaLabel,
|
|
11993
11967
|
disabled,
|
|
11994
11968
|
value,
|
|
11995
11969
|
children: [
|
|
@@ -12119,7 +12093,7 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12119
12093
|
label,
|
|
12120
12094
|
"aria-label": ariaLabelForTab
|
|
12121
12095
|
} = tab.props;
|
|
12122
|
-
if ((0,
|
|
12096
|
+
if ((0, import_type_guards46.isNil)(icon)) {
|
|
12123
12097
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
12124
12098
|
TabItem,
|
|
12125
12099
|
{
|
|
@@ -12130,7 +12104,7 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12130
12104
|
value
|
|
12131
12105
|
);
|
|
12132
12106
|
}
|
|
12133
|
-
if ((0,
|
|
12107
|
+
if ((0, import_type_guards46.isNotNil)(label)) {
|
|
12134
12108
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
12135
12109
|
TabItem,
|
|
12136
12110
|
{
|
|
@@ -12142,7 +12116,7 @@ var Tabs = (0, import_react63.forwardRef)(
|
|
|
12142
12116
|
value
|
|
12143
12117
|
);
|
|
12144
12118
|
}
|
|
12145
|
-
if ((0,
|
|
12119
|
+
if ((0, import_type_guards46.isNotNil)(ariaLabelForTab)) {
|
|
12146
12120
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
12147
12121
|
TabItem,
|
|
12148
12122
|
{
|
|
@@ -12185,7 +12159,7 @@ Tab.displayName = "Tab";
|
|
|
12185
12159
|
// src/components/Tag/Tag.tsx
|
|
12186
12160
|
var import_react65 = require("react");
|
|
12187
12161
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
12188
|
-
var
|
|
12162
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
12189
12163
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
12190
12164
|
var TagLabel = import_styled_components85.default.a`
|
|
12191
12165
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -12270,10 +12244,10 @@ var StyledTag = import_styled_components85.default.div`
|
|
|
12270
12244
|
}
|
|
12271
12245
|
`;
|
|
12272
12246
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
12273
|
-
if ((0,
|
|
12247
|
+
if ((0, import_type_guards47.isNil)(onClickRemove)) {
|
|
12274
12248
|
return null;
|
|
12275
12249
|
}
|
|
12276
|
-
if ((0,
|
|
12250
|
+
if ((0, import_type_guards47.isNil)(onClickRemoveLabel)) {
|
|
12277
12251
|
throw new Error(
|
|
12278
12252
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
12279
12253
|
);
|
|
@@ -12302,8 +12276,8 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12302
12276
|
};
|
|
12303
12277
|
var Tag = (0, import_react65.forwardRef)(
|
|
12304
12278
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12305
|
-
const hasIcon = (0,
|
|
12306
|
-
const labelProps = (0,
|
|
12279
|
+
const hasIcon = (0, import_type_guards47.isNotNil)(icon);
|
|
12280
|
+
const labelProps = (0, import_type_guards47.isNotNil)(href) && (0, import_type_guards47.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
12307
12281
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(
|
|
12308
12282
|
StyledTag,
|
|
12309
12283
|
{
|
|
@@ -12339,7 +12313,7 @@ Tag.displayName = "Tag";
|
|
|
12339
12313
|
|
|
12340
12314
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
12341
12315
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
12342
|
-
var
|
|
12316
|
+
var import_type_guards48 = require("@wistia/type-guards");
|
|
12343
12317
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
12344
12318
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
12345
12319
|
if (iconOnly) {
|
|
@@ -12452,7 +12426,7 @@ var WistiaLogo = ({
|
|
|
12452
12426
|
...props,
|
|
12453
12427
|
children: [
|
|
12454
12428
|
/* @__PURE__ */ (0, import_jsx_runtime268.jsx)("title", { children: title }),
|
|
12455
|
-
(0,
|
|
12429
|
+
(0, import_type_guards48.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("desc", { children: description }) : null,
|
|
12456
12430
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
12457
12431
|
renderLogotype(logotypeColor, iconOnly)
|
|
12458
12432
|
]
|
|
@@ -12464,7 +12438,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
12464
12438
|
|
|
12465
12439
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
12466
12440
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
12467
|
-
var
|
|
12441
|
+
var import_type_guards49 = require("@wistia/type-guards");
|
|
12468
12442
|
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
12469
12443
|
var StyledThumbnailBadge = import_styled_components87.default.div`
|
|
12470
12444
|
align-items: center;
|
|
@@ -12492,7 +12466,7 @@ var StyledThumbnailBadge = import_styled_components87.default.div`
|
|
|
12492
12466
|
`;
|
|
12493
12467
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
12494
12468
|
return /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(StyledThumbnailBadge, { ...props, children: [
|
|
12495
|
-
(0,
|
|
12469
|
+
(0, import_type_guards49.isNotNil)(icon) && icon,
|
|
12496
12470
|
/* @__PURE__ */ (0, import_jsx_runtime269.jsx)("span", { children: label })
|
|
12497
12471
|
] });
|
|
12498
12472
|
};
|
|
@@ -12501,10 +12475,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
|
12501
12475
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12502
12476
|
var import_react66 = require("react");
|
|
12503
12477
|
var import_styled_components89 = __toESM(require("styled-components"));
|
|
12504
|
-
var
|
|
12478
|
+
var import_type_guards51 = require("@wistia/type-guards");
|
|
12505
12479
|
|
|
12506
12480
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
12507
|
-
var
|
|
12481
|
+
var import_type_guards50 = require("@wistia/type-guards");
|
|
12508
12482
|
var import_styled_components88 = require("styled-components");
|
|
12509
12483
|
var gradients = {
|
|
12510
12484
|
defaultDarkOne: import_styled_components88.css`
|
|
@@ -12632,7 +12606,7 @@ var gradients = {
|
|
|
12632
12606
|
};
|
|
12633
12607
|
var gradientMap = Object.keys(gradients);
|
|
12634
12608
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
12635
|
-
return (0,
|
|
12609
|
+
return (0, import_type_guards50.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
12636
12610
|
};
|
|
12637
12611
|
|
|
12638
12612
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
@@ -12666,10 +12640,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
12666
12640
|
);
|
|
12667
12641
|
};
|
|
12668
12642
|
var StyledThumbnail = import_styled_components89.default.div`
|
|
12669
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
12643
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards51.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
12670
12644
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
12671
12645
|
// if we don't have $backgroundUrl show a gradient
|
|
12672
|
-
(0,
|
|
12646
|
+
(0, import_type_guards51.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
12673
12647
|
)};
|
|
12674
12648
|
background-position: center center;
|
|
12675
12649
|
background-size: cover;
|
|
@@ -12689,7 +12663,7 @@ var Thumbnail = (0, import_react66.forwardRef)(
|
|
|
12689
12663
|
children,
|
|
12690
12664
|
...props
|
|
12691
12665
|
}, ref) => {
|
|
12692
|
-
const backgroundUrl = thumbnailImageType === "square" && (0,
|
|
12666
|
+
const backgroundUrl = thumbnailImageType === "square" && (0, import_type_guards51.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0;
|
|
12693
12667
|
return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(
|
|
12694
12668
|
StyledThumbnail,
|
|
12695
12669
|
{
|
|
@@ -12699,8 +12673,8 @@ var Thumbnail = (0, import_react66.forwardRef)(
|
|
|
12699
12673
|
$width: width,
|
|
12700
12674
|
...props,
|
|
12701
12675
|
children: [
|
|
12702
|
-
(0,
|
|
12703
|
-
(0,
|
|
12676
|
+
(0, import_type_guards51.isNotNil)(children) ? children : null,
|
|
12677
|
+
(0, import_type_guards51.isNotNil)(thumbnailUrl) ? /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(
|
|
12704
12678
|
ThumbnailImage,
|
|
12705
12679
|
{
|
|
12706
12680
|
thumbnailImageType,
|
|
@@ -12794,6 +12768,8 @@ Thumbnail.displayName = "Thumbnail";
|
|
|
12794
12768
|
colorSchemeOptions,
|
|
12795
12769
|
copyToClipboard,
|
|
12796
12770
|
dateTime,
|
|
12771
|
+
ellipsisFlexParentStyle,
|
|
12772
|
+
ellipsisStyle,
|
|
12797
12773
|
iconSizeMap,
|
|
12798
12774
|
mergeRefs,
|
|
12799
12775
|
mq,
|