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