@wistia/ui 0.15.12-beta.dc4eb744.2eece8b → 0.15.12-beta.e10a1dcd.8034c36
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 +251 -213
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.mjs +102 -64
- 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.15.12-beta.
|
|
3
|
+
* @license @wistia/ui v0.15.12-beta.e10a1dcd.8034c36
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8487,7 +8487,7 @@ Badge.displayName = "Badge_UI";
|
|
|
8487
8487
|
// src/components/Banner/Banner.tsx
|
|
8488
8488
|
var import_react31 = require("react");
|
|
8489
8489
|
var import_styled_components33 = __toESM(require("styled-components"));
|
|
8490
|
-
var
|
|
8490
|
+
var import_type_guards25 = require("@wistia/type-guards");
|
|
8491
8491
|
|
|
8492
8492
|
// src/components/Box/Box.tsx
|
|
8493
8493
|
var import_react27 = require("react");
|
|
@@ -8689,7 +8689,39 @@ var Box = makePolymorphic(BoxComponent);
|
|
|
8689
8689
|
// src/components/Heading/Heading.tsx
|
|
8690
8690
|
var import_react28 = require("react");
|
|
8691
8691
|
var import_styled_components29 = __toESM(require("styled-components"));
|
|
8692
|
+
var import_type_guards22 = require("@wistia/type-guards");
|
|
8693
|
+
|
|
8694
|
+
// src/private/helpers/applyMaxCharsToChildren/applyMaxCharsToChildren.ts
|
|
8692
8695
|
var import_type_guards21 = require("@wistia/type-guards");
|
|
8696
|
+
|
|
8697
|
+
// src/private/helpers/truncateString/truncateString.ts
|
|
8698
|
+
var truncateString = (text, maxChars) => {
|
|
8699
|
+
if (maxChars < 1) {
|
|
8700
|
+
throw new Error("maxChars must be >= 1");
|
|
8701
|
+
}
|
|
8702
|
+
if (text.length <= maxChars) {
|
|
8703
|
+
return text;
|
|
8704
|
+
}
|
|
8705
|
+
return text.slice(0, maxChars);
|
|
8706
|
+
};
|
|
8707
|
+
|
|
8708
|
+
// src/private/helpers/applyMaxCharsToChildren/applyMaxCharsToChildren.ts
|
|
8709
|
+
var applyMaxCharsToChildren = (children, maxChars) => {
|
|
8710
|
+
if ((0, import_type_guards21.isNil)(maxChars)) {
|
|
8711
|
+
return children;
|
|
8712
|
+
}
|
|
8713
|
+
if ((0, import_type_guards21.isString)(children)) {
|
|
8714
|
+
return truncateString(children, maxChars);
|
|
8715
|
+
}
|
|
8716
|
+
if ((0, import_type_guards21.isNumber)(children)) {
|
|
8717
|
+
const numberString = String(children);
|
|
8718
|
+
return truncateString(numberString, maxChars);
|
|
8719
|
+
}
|
|
8720
|
+
const textContent = typeof children === "object" ? JSON.stringify(children) : String(children);
|
|
8721
|
+
return truncateString(textContent, maxChars);
|
|
8722
|
+
};
|
|
8723
|
+
|
|
8724
|
+
// src/components/Heading/Heading.tsx
|
|
8693
8725
|
var import_jsx_runtime207 = require("react/jsx-runtime");
|
|
8694
8726
|
var heroStyle = import_styled_components29.css`
|
|
8695
8727
|
--font-family: var(--wui-typography-heading-hero-family);
|
|
@@ -8765,7 +8797,7 @@ var StyledHeading = import_styled_components29.default.div`
|
|
|
8765
8797
|
color: var(--text-color);
|
|
8766
8798
|
${({ $variant }) => variantStyleMap[$variant]}
|
|
8767
8799
|
${({ $truncate }) => {
|
|
8768
|
-
if ((0,
|
|
8800
|
+
if ((0, import_type_guards22.isNotNil)($truncate)) {
|
|
8769
8801
|
return import_styled_components29.css`
|
|
8770
8802
|
${ellipsisStyle};
|
|
8771
8803
|
${lineClampCss($truncate)};
|
|
@@ -8798,31 +8830,37 @@ var variantElementMap = {
|
|
|
8798
8830
|
var HeadingComponent = (0, import_react28.forwardRef)(
|
|
8799
8831
|
({
|
|
8800
8832
|
align = "left",
|
|
8833
|
+
children,
|
|
8801
8834
|
colorScheme = "inherit",
|
|
8802
8835
|
disabled = false,
|
|
8803
8836
|
inline = false,
|
|
8837
|
+
maxChars,
|
|
8804
8838
|
preventUserSelect = false,
|
|
8805
8839
|
prominence = "primary",
|
|
8806
8840
|
truncate,
|
|
8807
8841
|
variant = "heading1",
|
|
8808
8842
|
renderAs,
|
|
8809
8843
|
...props
|
|
8810
|
-
}, ref) =>
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8844
|
+
}, ref) => {
|
|
8845
|
+
const processedChildren = applyMaxCharsToChildren(children, maxChars);
|
|
8846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
8847
|
+
StyledHeading,
|
|
8848
|
+
{
|
|
8849
|
+
ref,
|
|
8850
|
+
$align: align,
|
|
8851
|
+
$colorScheme: colorScheme,
|
|
8852
|
+
$disabled: disabled,
|
|
8853
|
+
$inline: inline,
|
|
8854
|
+
$preventUserSelect: preventUserSelect,
|
|
8855
|
+
$prominence: prominence,
|
|
8856
|
+
$truncate: truncate,
|
|
8857
|
+
$variant: variant,
|
|
8858
|
+
as: renderAs ?? variantElementMap[variant] ?? DEFAULT_ELEMENT2,
|
|
8859
|
+
...props,
|
|
8860
|
+
children: processedChildren
|
|
8861
|
+
}
|
|
8862
|
+
);
|
|
8863
|
+
}
|
|
8826
8864
|
);
|
|
8827
8865
|
HeadingComponent.displayName = "Heading_UI";
|
|
8828
8866
|
var Heading = makePolymorphic(HeadingComponent);
|
|
@@ -8830,7 +8868,7 @@ var Heading = makePolymorphic(HeadingComponent);
|
|
|
8830
8868
|
// src/components/Text/Text.tsx
|
|
8831
8869
|
var import_react29 = require("react");
|
|
8832
8870
|
var import_styled_components30 = __toESM(require("styled-components"));
|
|
8833
|
-
var
|
|
8871
|
+
var import_type_guards23 = require("@wistia/type-guards");
|
|
8834
8872
|
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
8835
8873
|
var sharedBodyStyle = import_styled_components30.css`
|
|
8836
8874
|
> strong,
|
|
@@ -8984,7 +9022,7 @@ var StyledText = import_styled_components30.default.div`
|
|
|
8984
9022
|
margin: 0;
|
|
8985
9023
|
${({ $variant }) => variantStyleMap2[$variant]}
|
|
8986
9024
|
${({ $truncate }) => {
|
|
8987
|
-
if ((0,
|
|
9025
|
+
if ((0, import_type_guards23.isNotNil)($truncate)) {
|
|
8988
9026
|
return import_styled_components30.css`
|
|
8989
9027
|
${ellipsisStyle};
|
|
8990
9028
|
${lineClampCss($truncate)};
|
|
@@ -9015,9 +9053,11 @@ var StyledText = import_styled_components30.default.div`
|
|
|
9015
9053
|
var TextComponent = (0, import_react29.forwardRef)(
|
|
9016
9054
|
({
|
|
9017
9055
|
align = "left",
|
|
9056
|
+
children,
|
|
9018
9057
|
colorScheme = "inherit",
|
|
9019
9058
|
disabled = false,
|
|
9020
9059
|
inline = false,
|
|
9060
|
+
maxChars,
|
|
9021
9061
|
preventUserSelect = false,
|
|
9022
9062
|
prominence = "primary",
|
|
9023
9063
|
truncate,
|
|
@@ -9025,6 +9065,7 @@ var TextComponent = (0, import_react29.forwardRef)(
|
|
|
9025
9065
|
renderAs,
|
|
9026
9066
|
...props
|
|
9027
9067
|
}, ref) => {
|
|
9068
|
+
const processedChildren = applyMaxCharsToChildren(children, maxChars);
|
|
9028
9069
|
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
9029
9070
|
StyledText,
|
|
9030
9071
|
{
|
|
@@ -9038,7 +9079,8 @@ var TextComponent = (0, import_react29.forwardRef)(
|
|
|
9038
9079
|
$truncate: truncate,
|
|
9039
9080
|
$variant: variant,
|
|
9040
9081
|
as: renderAs ?? variantElementMap2[variant] ?? DEFAULT_ELEMENT3,
|
|
9041
|
-
...props
|
|
9082
|
+
...props,
|
|
9083
|
+
children: processedChildren
|
|
9042
9084
|
}
|
|
9043
9085
|
);
|
|
9044
9086
|
}
|
|
@@ -9048,7 +9090,7 @@ var Text = makePolymorphic(TextComponent);
|
|
|
9048
9090
|
|
|
9049
9091
|
// src/components/ButtonGroup/ButtonGroup.tsx
|
|
9050
9092
|
var import_styled_components31 = __toESM(require("styled-components"));
|
|
9051
|
-
var
|
|
9093
|
+
var import_type_guards24 = require("@wistia/type-guards");
|
|
9052
9094
|
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
9053
9095
|
var getAlignment = (align) => {
|
|
9054
9096
|
if (align === "center") {
|
|
@@ -9108,7 +9150,7 @@ var ButtonGroup = ({
|
|
|
9108
9150
|
...props
|
|
9109
9151
|
}) => {
|
|
9110
9152
|
const responsiveButtonSize = useResponsiveProp(buttonSize);
|
|
9111
|
-
if ((0,
|
|
9153
|
+
if ((0, import_type_guards24.isNil)(children)) {
|
|
9112
9154
|
return null;
|
|
9113
9155
|
}
|
|
9114
9156
|
return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
@@ -9225,14 +9267,14 @@ var Banner = ({
|
|
|
9225
9267
|
setIsVerticalLayout(width <= BREAKPOINT_WIDTH);
|
|
9226
9268
|
}
|
|
9227
9269
|
}, [width, orientation]);
|
|
9228
|
-
const hasImage = (0,
|
|
9270
|
+
const hasImage = (0, import_type_guards25.isNotNil)(image);
|
|
9229
9271
|
const shouldShowImage = hasImage && (isVerticalLayout || width >= MIN_IMAGE_WIDTH);
|
|
9230
9272
|
const iconPosition = (0, import_react31.useMemo)(() => {
|
|
9231
|
-
if ((0,
|
|
9273
|
+
if ((0, import_type_guards25.isNil)(icon)) return "none";
|
|
9232
9274
|
if (isSmallContainer) return shouldShowImage ? "inline" : "above";
|
|
9233
9275
|
return prominence === "secondary" ? "inline" : "above";
|
|
9234
9276
|
}, [icon, isSmallContainer, shouldShowImage, prominence]);
|
|
9235
|
-
const hasActions = (0,
|
|
9277
|
+
const hasActions = (0, import_type_guards25.isNotNil)(primaryAction) || (0, import_type_guards25.isNotNil)(secondaryAction);
|
|
9236
9278
|
const contentDirection = (0, import_react31.useMemo)(() => {
|
|
9237
9279
|
if (orientation === "horizontal" && !hasActions) return "row";
|
|
9238
9280
|
return !shouldShowImage && prominence === "default" && !isSmallContainer && !isVerticalLayout ? "row" : "column";
|
|
@@ -9279,7 +9321,7 @@ var Banner = ({
|
|
|
9279
9321
|
gap: iconPosition === "inline" ? "space-01" : "space-00",
|
|
9280
9322
|
justifyContent: "center",
|
|
9281
9323
|
children: [
|
|
9282
|
-
(0,
|
|
9324
|
+
(0, import_type_guards25.isNotNil)(headingText) ? /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(Heading, { variant: headingVariant, children: [
|
|
9283
9325
|
iconPosition === "inline" && /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(import_jsx_runtime211.Fragment, { children: [
|
|
9284
9326
|
icon,
|
|
9285
9327
|
" "
|
|
@@ -9297,15 +9339,15 @@ var Banner = ({
|
|
|
9297
9339
|
collapseOnSmallScreens: false,
|
|
9298
9340
|
style: { paddingRight: "var(--wui-space-02)" },
|
|
9299
9341
|
children: [
|
|
9300
|
-
(0,
|
|
9301
|
-
(0,
|
|
9342
|
+
(0, import_type_guards25.isNotNil)(primaryAction) && primaryAction,
|
|
9343
|
+
(0, import_type_guards25.isNotNil)(secondaryAction) && secondaryAction
|
|
9302
9344
|
]
|
|
9303
9345
|
}
|
|
9304
9346
|
) : null
|
|
9305
9347
|
]
|
|
9306
9348
|
}
|
|
9307
9349
|
),
|
|
9308
|
-
(0,
|
|
9350
|
+
(0, import_type_guards25.isNotNil)(onClose) && /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
9309
9351
|
IconButton,
|
|
9310
9352
|
{
|
|
9311
9353
|
label: "Close",
|
|
@@ -9499,17 +9541,17 @@ var Center = (0, import_react33.forwardRef)(
|
|
|
9499
9541
|
Center.displayName = "Center_UI";
|
|
9500
9542
|
|
|
9501
9543
|
// src/components/Checkbox/Checkbox.tsx
|
|
9502
|
-
var
|
|
9544
|
+
var import_type_guards32 = require("@wistia/type-guards");
|
|
9503
9545
|
var import_react38 = require("react");
|
|
9504
9546
|
var import_styled_components44 = __toESM(require("styled-components"));
|
|
9505
9547
|
|
|
9506
9548
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
9507
|
-
var
|
|
9549
|
+
var import_type_guards28 = require("@wistia/type-guards");
|
|
9508
9550
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
9509
9551
|
|
|
9510
9552
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
9511
9553
|
var import_styled_components38 = __toESM(require("styled-components"));
|
|
9512
|
-
var
|
|
9554
|
+
var import_type_guards26 = require("@wistia/type-guards");
|
|
9513
9555
|
var import_jsx_runtime216 = require("react/jsx-runtime");
|
|
9514
9556
|
var VisuallyHidden = import_styled_components38.default.div({ ...visuallyHiddenStyle });
|
|
9515
9557
|
var VisuallyHiddenButFocusable = import_styled_components38.default.div({
|
|
@@ -9521,7 +9563,7 @@ var ScreenReaderOnly = ({
|
|
|
9521
9563
|
focusable = false,
|
|
9522
9564
|
...props
|
|
9523
9565
|
}) => {
|
|
9524
|
-
const accessibleText = (0,
|
|
9566
|
+
const accessibleText = (0, import_type_guards26.isNotNil)(text) ? text : children;
|
|
9525
9567
|
if (focusable) {
|
|
9526
9568
|
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(VisuallyHiddenButFocusable, { ...props, children: accessibleText });
|
|
9527
9569
|
}
|
|
@@ -9531,7 +9573,7 @@ ScreenReaderOnly.displayName = "ScreenReaderOnly_UI";
|
|
|
9531
9573
|
|
|
9532
9574
|
// src/private/components/FormControlLabel/FormControlLabelDescription.tsx
|
|
9533
9575
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
9534
|
-
var
|
|
9576
|
+
var import_type_guards27 = require("@wistia/type-guards");
|
|
9535
9577
|
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
9536
9578
|
var disabledStyle = import_styled_components39.css`
|
|
9537
9579
|
color: var(--wui-color-text-disabled);
|
|
@@ -9550,7 +9592,7 @@ var FormControlLabelDescription = ({
|
|
|
9550
9592
|
disabled = false,
|
|
9551
9593
|
...props
|
|
9552
9594
|
}) => {
|
|
9553
|
-
if ((0,
|
|
9595
|
+
if ((0, import_type_guards27.isNil)(children)) {
|
|
9554
9596
|
return null;
|
|
9555
9597
|
}
|
|
9556
9598
|
return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
@@ -9598,14 +9640,14 @@ var FormControlLabel = ({
|
|
|
9598
9640
|
hideLabel = false,
|
|
9599
9641
|
...props
|
|
9600
9642
|
}) => {
|
|
9601
|
-
if ((0,
|
|
9643
|
+
if ((0, import_type_guards28.isNil)(label)) {
|
|
9602
9644
|
return null;
|
|
9603
9645
|
}
|
|
9604
9646
|
const labelContent = hideLabel ? /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(ScreenReaderOnly, { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(StyledLabelWrapper, { children: [
|
|
9605
9647
|
label,
|
|
9606
9648
|
/* @__PURE__ */ (0, import_jsx_runtime218.jsx)(FormControlLabelDescription, { children: description })
|
|
9607
9649
|
] });
|
|
9608
|
-
const slot = (0,
|
|
9650
|
+
const slot = (0, import_type_guards28.isNotNil)(controlSlot) ? controlSlot : null;
|
|
9609
9651
|
return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(
|
|
9610
9652
|
StyledFormControlLabel,
|
|
9611
9653
|
{
|
|
@@ -9624,12 +9666,12 @@ FormControlLabel.displayName = "FormControlLabel";
|
|
|
9624
9666
|
|
|
9625
9667
|
// src/components/FormGroup/CheckboxGroup.tsx
|
|
9626
9668
|
var import_react37 = require("react");
|
|
9627
|
-
var
|
|
9669
|
+
var import_type_guards31 = require("@wistia/type-guards");
|
|
9628
9670
|
|
|
9629
9671
|
// src/components/FormGroup/FormGroup.tsx
|
|
9630
9672
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
9631
9673
|
var import_react35 = require("react");
|
|
9632
|
-
var
|
|
9674
|
+
var import_type_guards29 = require("@wistia/type-guards");
|
|
9633
9675
|
|
|
9634
9676
|
// src/components/Stack/Stack.tsx
|
|
9635
9677
|
var import_react34 = require("react");
|
|
@@ -9684,8 +9726,8 @@ var FormGroup = ({
|
|
|
9684
9726
|
...props
|
|
9685
9727
|
}) => {
|
|
9686
9728
|
const ref = (0, import_react35.useRef)(null);
|
|
9687
|
-
const hasLabel = (0,
|
|
9688
|
-
const hasDescription = (0,
|
|
9729
|
+
const hasLabel = (0, import_type_guards29.isNotNil)(label) && (0, import_type_guards29.isNonEmptyString)(label);
|
|
9730
|
+
const hasDescription = (0, import_type_guards29.isNotNil)(description) && (0, import_type_guards29.isNonEmptyString)(description);
|
|
9689
9731
|
return /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(
|
|
9690
9732
|
Stack,
|
|
9691
9733
|
{
|
|
@@ -9723,7 +9765,7 @@ FormGroup.displayName = "FormGroup_UI";
|
|
|
9723
9765
|
// src/components/Form/Form.tsx
|
|
9724
9766
|
var import_react36 = require("react");
|
|
9725
9767
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
9726
|
-
var
|
|
9768
|
+
var import_type_guards30 = require("@wistia/type-guards");
|
|
9727
9769
|
|
|
9728
9770
|
// src/components/Form/serializeFormData.tsx
|
|
9729
9771
|
var ARRAY_SUFFIX = "[]";
|
|
@@ -9772,7 +9814,7 @@ var Form = (0, import_react36.forwardRef)(
|
|
|
9772
9814
|
const id = props.id ?? autoId;
|
|
9773
9815
|
const handleValidate = (nextFormData) => {
|
|
9774
9816
|
const nextData = serializeFormData(nextFormData);
|
|
9775
|
-
if ((0,
|
|
9817
|
+
if ((0, import_type_guards30.isUndefined)(validate)) {
|
|
9776
9818
|
return {};
|
|
9777
9819
|
}
|
|
9778
9820
|
return validate(nextData);
|
|
@@ -9782,7 +9824,7 @@ var Form = (0, import_react36.forwardRef)(
|
|
|
9782
9824
|
props.onBlur(event);
|
|
9783
9825
|
}
|
|
9784
9826
|
const formData = new FormData(event.currentTarget);
|
|
9785
|
-
if ((0,
|
|
9827
|
+
if ((0, import_type_guards30.isNotUndefined)(validate)) {
|
|
9786
9828
|
handleValidate(formData);
|
|
9787
9829
|
}
|
|
9788
9830
|
};
|
|
@@ -9855,7 +9897,7 @@ var CheckboxGroup = ({
|
|
|
9855
9897
|
...props
|
|
9856
9898
|
}) => {
|
|
9857
9899
|
const formState = (0, import_react37.useContext)(FormContext);
|
|
9858
|
-
const derivedValue = (0,
|
|
9900
|
+
const derivedValue = (0, import_type_guards31.isArray)(formState.values[name]) ? formState.values[name] : value;
|
|
9859
9901
|
const context = (0, import_react37.useMemo)(() => {
|
|
9860
9902
|
return {
|
|
9861
9903
|
name: `${name}[]`,
|
|
@@ -9987,14 +10029,14 @@ var Checkbox = (0, import_react38.forwardRef)(
|
|
|
9987
10029
|
...props
|
|
9988
10030
|
}, ref) => {
|
|
9989
10031
|
const generatedId = (0, import_react38.useId)();
|
|
9990
|
-
const computedId = (0,
|
|
10032
|
+
const computedId = (0, import_type_guards32.isNonEmptyString)(id) ? id : `wistia-ui-checkbox-${generatedId}`;
|
|
9991
10033
|
const checkboxGroupContext = useCheckboxGroup();
|
|
9992
10034
|
const contextName = checkboxGroupContext?.name;
|
|
9993
10035
|
const contextOnChange = checkboxGroupContext?.onChange;
|
|
9994
10036
|
const contextValue = checkboxGroupContext?.value;
|
|
9995
10037
|
const checkboxName = name ?? contextName;
|
|
9996
10038
|
const handleOnChange = onChange ?? contextOnChange;
|
|
9997
|
-
const isChecked = (0,
|
|
10039
|
+
const isChecked = (0, import_type_guards32.isNotUndefined)(value) && contextValue ? contextValue.includes(value) : checked;
|
|
9998
10040
|
return /* @__PURE__ */ (0, import_jsx_runtime223.jsxs)(
|
|
9999
10041
|
StyledCheckboxWrapper,
|
|
10000
10042
|
{
|
|
@@ -10087,7 +10129,7 @@ ClickRegion.displayName = "ClickRegion_UI";
|
|
|
10087
10129
|
|
|
10088
10130
|
// src/components/Collapsible/Collapsible.tsx
|
|
10089
10131
|
var import_react_collapsible = require("@radix-ui/react-collapsible");
|
|
10090
|
-
var
|
|
10132
|
+
var import_type_guards33 = require("@wistia/type-guards");
|
|
10091
10133
|
var import_styled_components45 = __toESM(require("styled-components"));
|
|
10092
10134
|
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
10093
10135
|
var StyledRoot = (0, import_styled_components45.default)(import_react_collapsible.Root)`
|
|
@@ -10104,7 +10146,7 @@ var Collapsible = ({
|
|
|
10104
10146
|
onOpenChange
|
|
10105
10147
|
}) => {
|
|
10106
10148
|
const controlProps = {
|
|
10107
|
-
...(0,
|
|
10149
|
+
...(0, import_type_guards33.isNotNil)(onOpenChange) && (0, import_type_guards33.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
10108
10150
|
};
|
|
10109
10151
|
return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(StyledRoot, { ...controlProps, children });
|
|
10110
10152
|
};
|
|
@@ -10166,13 +10208,13 @@ CollapsibleTriggerIcon.displayName = "CollapsibleTriggerIcon_UI";
|
|
|
10166
10208
|
// src/components/Collapsible/CollapsibleContent.tsx
|
|
10167
10209
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
10168
10210
|
var import_react_collapsible3 = require("@radix-ui/react-collapsible");
|
|
10169
|
-
var
|
|
10211
|
+
var import_type_guards34 = require("@wistia/type-guards");
|
|
10170
10212
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
10171
10213
|
var ClampedContent = import_styled_components47.default.div`
|
|
10172
10214
|
--wui-collapsible-content-clamp-lines: ${({ $clamp }) => $clamp};
|
|
10173
10215
|
`;
|
|
10174
10216
|
var CollapsibleContent = ({ clamp, children }) => {
|
|
10175
|
-
if ((0,
|
|
10217
|
+
if ((0, import_type_guards34.isNotUndefined)(clamp)) {
|
|
10176
10218
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
10177
10219
|
ClampedContent,
|
|
10178
10220
|
{
|
|
@@ -11450,7 +11492,7 @@ var import_react46 = require("react");
|
|
|
11450
11492
|
// src/components/Switch/Switch.tsx
|
|
11451
11493
|
var import_react45 = require("react");
|
|
11452
11494
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
11453
|
-
var
|
|
11495
|
+
var import_type_guards35 = require("@wistia/type-guards");
|
|
11454
11496
|
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
11455
11497
|
var switchHeightMap = {
|
|
11456
11498
|
sm: 16,
|
|
@@ -11542,7 +11584,7 @@ var Switch = (0, import_react45.forwardRef)(
|
|
|
11542
11584
|
...props
|
|
11543
11585
|
}, ref) => {
|
|
11544
11586
|
const generatedId = (0, import_react45.useId)();
|
|
11545
|
-
const computedId = (0,
|
|
11587
|
+
const computedId = (0, import_type_guards35.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
11546
11588
|
return /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)(
|
|
11547
11589
|
StyledSwitchWrapper,
|
|
11548
11590
|
{
|
|
@@ -11661,7 +11703,7 @@ var import_fn7 = require("culori/fn");
|
|
|
11661
11703
|
// src/components/Input/Input.tsx
|
|
11662
11704
|
var import_react47 = require("react");
|
|
11663
11705
|
var import_styled_components62 = __toESM(require("styled-components"));
|
|
11664
|
-
var
|
|
11706
|
+
var import_type_guards36 = require("@wistia/type-guards");
|
|
11665
11707
|
|
|
11666
11708
|
// src/css/inputCss.ts
|
|
11667
11709
|
var import_styled_components61 = require("styled-components");
|
|
@@ -11807,30 +11849,29 @@ var Input = (0, import_react47.forwardRef)(
|
|
|
11807
11849
|
autoSelect = false,
|
|
11808
11850
|
leftIcon,
|
|
11809
11851
|
rightIcon,
|
|
11810
|
-
className,
|
|
11811
11852
|
...props
|
|
11812
11853
|
}, externalRef) => {
|
|
11813
11854
|
const internalRef = (0, import_react47.useRef)(null);
|
|
11814
|
-
const ref = (0,
|
|
11855
|
+
const ref = (0, import_type_guards36.isNotNil)(externalRef) && (0, import_type_guards36.isRecord)(externalRef) && "current" in externalRef ? externalRef : internalRef;
|
|
11815
11856
|
let leftIconToDisplay = leftIcon;
|
|
11816
|
-
if ((0,
|
|
11857
|
+
if ((0, import_type_guards36.isNil)(leftIcon) && type === "search") {
|
|
11817
11858
|
leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(Icon, { type: "search" });
|
|
11818
11859
|
}
|
|
11819
|
-
if ((0,
|
|
11860
|
+
if ((0, import_type_guards36.isNotNil)(leftIconToDisplay) && (0, import_react47.isValidElement)(leftIconToDisplay)) {
|
|
11820
11861
|
leftIconToDisplay = (0, import_react47.cloneElement)(leftIconToDisplay, {
|
|
11821
11862
|
size: "md",
|
|
11822
11863
|
className: "wui-input-left-icon"
|
|
11823
11864
|
});
|
|
11824
11865
|
}
|
|
11825
11866
|
let rightIconToDisplay = rightIcon;
|
|
11826
|
-
if ((0,
|
|
11867
|
+
if ((0, import_type_guards36.isNotNil)(rightIconToDisplay) && (0, import_react47.isValidElement)(rightIconToDisplay)) {
|
|
11827
11868
|
rightIconToDisplay = (0, import_react47.cloneElement)(rightIconToDisplay, {
|
|
11828
11869
|
size: "md",
|
|
11829
11870
|
className: "wui-input-right-icon"
|
|
11830
11871
|
});
|
|
11831
11872
|
}
|
|
11832
11873
|
const handleFocus2 = (event) => {
|
|
11833
|
-
if ((0,
|
|
11874
|
+
if ((0, import_type_guards36.isNotNil)(props.onFocus)) {
|
|
11834
11875
|
props.onFocus(event);
|
|
11835
11876
|
}
|
|
11836
11877
|
if (autoSelect && type !== "multiline" && ref.current instanceof HTMLInputElement) {
|
|
@@ -11844,7 +11885,6 @@ var Input = (0, import_react47.forwardRef)(
|
|
|
11844
11885
|
{
|
|
11845
11886
|
$fullWidth: fullWidth,
|
|
11846
11887
|
$monospace: monospace,
|
|
11847
|
-
className,
|
|
11848
11888
|
"data-wui-input-container": true,
|
|
11849
11889
|
children: [
|
|
11850
11890
|
leftIconToDisplay ?? null,
|
|
@@ -12550,12 +12590,12 @@ var Ariakit = __toESM(require("@ariakit/react"));
|
|
|
12550
12590
|
var import_react54 = require("react");
|
|
12551
12591
|
var import_match_sorter = require("match-sorter");
|
|
12552
12592
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
12553
|
-
var
|
|
12593
|
+
var import_type_guards38 = require("@wistia/type-guards");
|
|
12554
12594
|
|
|
12555
12595
|
// src/components/Tag/Tag.tsx
|
|
12556
12596
|
var import_react53 = require("react");
|
|
12557
12597
|
var import_styled_components67 = __toESM(require("styled-components"));
|
|
12558
|
-
var
|
|
12598
|
+
var import_type_guards37 = require("@wistia/type-guards");
|
|
12559
12599
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
12560
12600
|
var TagLabel = import_styled_components67.default.a`
|
|
12561
12601
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -12641,10 +12681,10 @@ var StyledTag = import_styled_components67.default.div`
|
|
|
12641
12681
|
}
|
|
12642
12682
|
`;
|
|
12643
12683
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
12644
|
-
if ((0,
|
|
12684
|
+
if ((0, import_type_guards37.isNil)(onClickRemove)) {
|
|
12645
12685
|
return null;
|
|
12646
12686
|
}
|
|
12647
|
-
if ((0,
|
|
12687
|
+
if ((0, import_type_guards37.isNil)(onClickRemoveLabel)) {
|
|
12648
12688
|
throw new Error(
|
|
12649
12689
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
12650
12690
|
);
|
|
@@ -12673,8 +12713,8 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
|
12673
12713
|
};
|
|
12674
12714
|
var Tag = (0, import_react53.forwardRef)(
|
|
12675
12715
|
({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
|
|
12676
|
-
const hasIcon = (0,
|
|
12677
|
-
const labelProps = (0,
|
|
12716
|
+
const hasIcon = (0, import_type_guards37.isNotNil)(icon);
|
|
12717
|
+
const labelProps = (0, import_type_guards37.isNotNil)(href) && (0, import_type_guards37.isNonEmptyString)(href) ? { href, as: "a" } : { as: "span" };
|
|
12678
12718
|
return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(
|
|
12679
12719
|
StyledTag,
|
|
12680
12720
|
{
|
|
@@ -12897,7 +12937,7 @@ var Combobox2 = ({
|
|
|
12897
12937
|
const [wrapperWidth, setWrapperWidth] = (0, import_react54.useState)("auto");
|
|
12898
12938
|
const comboboxWrapperRef = (0, import_react54.useRef)(null);
|
|
12899
12939
|
const options = (0, import_react54.useMemo)(() => extractOptions(children), [children]);
|
|
12900
|
-
const isMultiSelect = (0,
|
|
12940
|
+
const isMultiSelect = (0, import_type_guards38.isArray)(value);
|
|
12901
12941
|
(0, import_react54.useEffect)(() => {
|
|
12902
12942
|
const comboboxWrapper = comboboxWrapperRef.current;
|
|
12903
12943
|
if (comboboxWrapper) {
|
|
@@ -12914,11 +12954,11 @@ var Combobox2 = ({
|
|
|
12914
12954
|
return () => null;
|
|
12915
12955
|
}, []);
|
|
12916
12956
|
const handleRemoveValue = (valueToRemove) => {
|
|
12917
|
-
if ((0,
|
|
12957
|
+
if ((0, import_type_guards38.isString)(value)) {
|
|
12918
12958
|
onChange("");
|
|
12919
12959
|
return;
|
|
12920
12960
|
}
|
|
12921
|
-
onChange((0,
|
|
12961
|
+
onChange((0, import_type_guards38.isString)(value) ? "" : value.filter((val) => val !== valueToRemove));
|
|
12922
12962
|
};
|
|
12923
12963
|
const matches = (0, import_react54.useMemo)(() => {
|
|
12924
12964
|
return (0, import_match_sorter.matchSorter)(Object.keys(options), searchValue);
|
|
@@ -12997,12 +13037,12 @@ var Combobox2 = ({
|
|
|
12997
13037
|
};
|
|
12998
13038
|
|
|
12999
13039
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
13000
|
-
var
|
|
13040
|
+
var import_type_guards43 = require("@wistia/type-guards");
|
|
13001
13041
|
var import_react61 = require("react");
|
|
13002
13042
|
|
|
13003
13043
|
// src/components/Menu/Menu.tsx
|
|
13004
13044
|
var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
13005
|
-
var
|
|
13045
|
+
var import_type_guards39 = require("@wistia/type-guards");
|
|
13006
13046
|
var import_react56 = require("react");
|
|
13007
13047
|
var import_styled_components70 = __toESM(require("styled-components"));
|
|
13008
13048
|
|
|
@@ -13117,7 +13157,7 @@ var Menu = (0, import_react56.forwardRef)(
|
|
|
13117
13157
|
}, ref) => {
|
|
13118
13158
|
const contextValue = (0, import_react56.useMemo)(() => ({ compact }), [compact]);
|
|
13119
13159
|
let controlProps = {
|
|
13120
|
-
...(0,
|
|
13160
|
+
...(0, import_type_guards39.isNotNil)(onOpenChange) && (0, import_type_guards39.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {}
|
|
13121
13161
|
};
|
|
13122
13162
|
if (disabled) {
|
|
13123
13163
|
controlProps = {
|
|
@@ -13131,7 +13171,7 @@ var Menu = (0, import_react56.forwardRef)(
|
|
|
13131
13171
|
modal: false,
|
|
13132
13172
|
...controlProps,
|
|
13133
13173
|
children: [
|
|
13134
|
-
/* @__PURE__ */ (0, import_jsx_runtime257.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0,
|
|
13174
|
+
/* @__PURE__ */ (0, import_jsx_runtime257.jsx)(import_react_dropdown_menu.DropdownMenuTrigger, { asChild: true, children: (0, import_type_guards39.isNotUndefined)(trigger) ? trigger : /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
13135
13175
|
Button,
|
|
13136
13176
|
{
|
|
13137
13177
|
ref,
|
|
@@ -13197,12 +13237,12 @@ MenuLabel.displayName = "MenuLabel_UI";
|
|
|
13197
13237
|
var import_react58 = require("react");
|
|
13198
13238
|
var import_styled_components74 = __toESM(require("styled-components"));
|
|
13199
13239
|
var import_react_dropdown_menu3 = require("@radix-ui/react-dropdown-menu");
|
|
13200
|
-
var
|
|
13240
|
+
var import_type_guards41 = require("@wistia/type-guards");
|
|
13201
13241
|
|
|
13202
13242
|
// src/components/Menu/MenuItemButton.tsx
|
|
13203
13243
|
var import_react57 = require("react");
|
|
13204
13244
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
13205
|
-
var
|
|
13245
|
+
var import_type_guards40 = require("@wistia/type-guards");
|
|
13206
13246
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
13207
13247
|
var StyledButton3 = (0, import_styled_components72.default)(Button)`
|
|
13208
13248
|
${({ colorScheme }) => getColorScheme(colorScheme)};
|
|
@@ -13282,7 +13322,7 @@ var StyledBadgeContainer = import_styled_components72.default.div`
|
|
|
13282
13322
|
var MenuItemButton = (0, import_react57.forwardRef)(({ children, appearance, command, icon, ...props }, ref) => {
|
|
13283
13323
|
let { colorScheme, badge } = props;
|
|
13284
13324
|
if (appearance === "dangerous") {
|
|
13285
|
-
if ((0,
|
|
13325
|
+
if ((0, import_type_guards40.isNotUndefined)(colorScheme)) {
|
|
13286
13326
|
console.warn("colorScheme prop is ignored when appearance is dangerous");
|
|
13287
13327
|
}
|
|
13288
13328
|
colorScheme = "error";
|
|
@@ -13310,10 +13350,10 @@ var MenuItemButton = (0, import_react57.forwardRef)(({ children, appearance, com
|
|
|
13310
13350
|
fullWidth: true,
|
|
13311
13351
|
unstyled: true,
|
|
13312
13352
|
children: [
|
|
13313
|
-
(0,
|
|
13353
|
+
(0, import_type_guards40.isNotNil)(props.leftIcon) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
|
|
13314
13354
|
/* @__PURE__ */ (0, import_jsx_runtime259.jsx)(StyledLabelAndDescriptionContainer, { children }),
|
|
13315
|
-
(0,
|
|
13316
|
-
(0,
|
|
13355
|
+
(0, import_type_guards40.isNotNil)(badge) || (0, import_type_guards40.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
|
|
13356
|
+
(0, import_type_guards40.isNotNil)(props.rightIcon) ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
|
|
13317
13357
|
]
|
|
13318
13358
|
}
|
|
13319
13359
|
);
|
|
@@ -13384,7 +13424,7 @@ var SubMenu = ({
|
|
|
13384
13424
|
return isSmAndUp ? /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_react_dropdown_menu3.DropdownMenuSub, { onOpenChange, children: [
|
|
13385
13425
|
/* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(SubMenuTrigger, { ...props, children: [
|
|
13386
13426
|
/* @__PURE__ */ (0, import_jsx_runtime261.jsx)(MenuItemLabel, { children: label }),
|
|
13387
|
-
(0,
|
|
13427
|
+
(0, import_type_guards41.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(MenuItemDescription, { children: description }) : null
|
|
13388
13428
|
] }),
|
|
13389
13429
|
/* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_react_dropdown_menu3.DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(SubMenuContent, { $compact: compact, children }) })
|
|
13390
13430
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_react_dropdown_menu3.DropdownMenuGroup, { children: [
|
|
@@ -13476,7 +13516,7 @@ RadioMenuItem.displayName = "RadioMenuItem_UI";
|
|
|
13476
13516
|
|
|
13477
13517
|
// src/components/Menu/CheckboxMenuItem.tsx
|
|
13478
13518
|
var import_react_dropdown_menu7 = require("@radix-ui/react-dropdown-menu");
|
|
13479
|
-
var
|
|
13519
|
+
var import_type_guards42 = require("@wistia/type-guards");
|
|
13480
13520
|
var import_jsx_runtime265 = require("react/jsx-runtime");
|
|
13481
13521
|
var CheckboxIndicator = ({ checked, ...props }) => {
|
|
13482
13522
|
return checked ? /* @__PURE__ */ (0, import_jsx_runtime265.jsxs)(
|
|
@@ -13550,8 +13590,8 @@ var CheckboxMenuItem = ({
|
|
|
13550
13590
|
MenuItemButton,
|
|
13551
13591
|
{
|
|
13552
13592
|
...props,
|
|
13553
|
-
leftIcon: (0,
|
|
13554
|
-
rightIcon: (0,
|
|
13593
|
+
leftIcon: (0, import_type_guards42.isNotNil)(props.icon) ? props.icon : /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(CheckboxIndicator, { checked }),
|
|
13594
|
+
rightIcon: (0, import_type_guards42.isNotNil)(props.icon) ? /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(import_react_dropdown_menu7.DropdownMenuItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(Icon, { type: "checkmark" }) }) : void 0
|
|
13555
13595
|
}
|
|
13556
13596
|
)
|
|
13557
13597
|
}
|
|
@@ -13673,7 +13713,7 @@ var ContextMenu = ({
|
|
|
13673
13713
|
const [isRightClicked, setIsRightClicked] = (0, import_react61.useState)(false);
|
|
13674
13714
|
const [menuPosition, setMenuPosition] = (0, import_react61.useState)(position ?? { x: 0, y: 0 });
|
|
13675
13715
|
(0, import_react61.useEffect)(() => {
|
|
13676
|
-
if ((0,
|
|
13716
|
+
if ((0, import_type_guards43.isNil)(position)) {
|
|
13677
13717
|
const onContextMenu = (event) => {
|
|
13678
13718
|
event.preventDefault();
|
|
13679
13719
|
setMenuPosition({ x: event.clientX, y: event.clientY });
|
|
@@ -13687,7 +13727,7 @@ var ContextMenu = ({
|
|
|
13687
13727
|
}
|
|
13688
13728
|
return () => null;
|
|
13689
13729
|
}, [position, triggerRef]);
|
|
13690
|
-
const isOpen = (0,
|
|
13730
|
+
const isOpen = (0, import_type_guards43.isNotNil)(position) || isRightClicked;
|
|
13691
13731
|
return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
13692
13732
|
Menu,
|
|
13693
13733
|
{
|
|
@@ -13722,7 +13762,7 @@ var ContextMenu = ({
|
|
|
13722
13762
|
// src/components/DataCards/DataCard.tsx
|
|
13723
13763
|
var import_react62 = require("react");
|
|
13724
13764
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
13725
|
-
var
|
|
13765
|
+
var import_type_guards44 = require("@wistia/type-guards");
|
|
13726
13766
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
13727
13767
|
var StyledDataCard = import_styled_components75.default.div`
|
|
13728
13768
|
--wui-data-card-text: var(--wui-color-text-button);
|
|
@@ -13876,8 +13916,8 @@ var DataCardInner = ({
|
|
|
13876
13916
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(StyledLoadingValue, {}) : value
|
|
13877
13917
|
}
|
|
13878
13918
|
),
|
|
13879
|
-
(0,
|
|
13880
|
-
(0,
|
|
13919
|
+
(0, import_type_guards44.isNotNil)(upperRightSlot) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(StyledSlot, { children: upperRightSlot }),
|
|
13920
|
+
(0, import_type_guards44.isNotNil)(subtitle) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(
|
|
13881
13921
|
StyledSubtitle,
|
|
13882
13922
|
{
|
|
13883
13923
|
"data-wui-data-card-subtitle": true,
|
|
@@ -13885,13 +13925,13 @@ var DataCardInner = ({
|
|
|
13885
13925
|
children: subtitle
|
|
13886
13926
|
}
|
|
13887
13927
|
),
|
|
13888
|
-
(0,
|
|
13928
|
+
(0, import_type_guards44.isNotNil)(trend) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(StyledDataCardTrendContainer, { children: trend })
|
|
13889
13929
|
]
|
|
13890
13930
|
}
|
|
13891
13931
|
);
|
|
13892
13932
|
var DataCard = (props) => {
|
|
13893
13933
|
const ref = (0, import_react62.useRef)(null);
|
|
13894
|
-
if ((0,
|
|
13934
|
+
if ((0, import_type_guards44.isNotNil)(props.href) || (0, import_type_guards44.isNotNil)(props.onClick)) {
|
|
13895
13935
|
const { "aria-pressed": ariaPressed, ...dataCardProps } = props;
|
|
13896
13936
|
return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(ClickRegion, { targetRef: ref, children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(
|
|
13897
13937
|
DataCardInner,
|
|
@@ -13902,8 +13942,8 @@ var DataCard = (props) => {
|
|
|
13902
13942
|
Button,
|
|
13903
13943
|
{
|
|
13904
13944
|
ref,
|
|
13905
|
-
...(0,
|
|
13906
|
-
...(0,
|
|
13945
|
+
...(0, import_type_guards44.isNotNil)(props.beforeAction) ? { beforeAction: props.beforeAction } : {},
|
|
13946
|
+
...(0, import_type_guards44.isNotNil)(props.reloadDocument) ? { reloadDocument: props.reloadDocument } : {},
|
|
13907
13947
|
"aria-pressed": ariaPressed,
|
|
13908
13948
|
disabled: props.disabled ?? false,
|
|
13909
13949
|
href: props.href,
|
|
@@ -14137,26 +14177,24 @@ var import_styled_components81 = __toESM(require("styled-components"));
|
|
|
14137
14177
|
var import_react63 = require("react");
|
|
14138
14178
|
var import_jsx_runtime276 = require("react/jsx-runtime");
|
|
14139
14179
|
var StyledInput = (0, import_styled_components81.default)(Input)`
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
}
|
|
14180
|
+
&:not([rows]) {
|
|
14181
|
+
min-height: unset;
|
|
14182
|
+
}
|
|
14144
14183
|
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14184
|
+
&& {
|
|
14185
|
+
${({ $variant }) => variantStyleMap[$variant]}
|
|
14186
|
+
/* The input font styles (edit mode) needs the same font styles as Heading */
|
|
14187
|
+
--wui-input-font-size: var(--font-size);
|
|
14188
|
+
--wui-input-font-weight: var(--font-weight);
|
|
14189
|
+
--wui-input-line-height: var(--line-height);
|
|
14151
14190
|
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
}
|
|
14191
|
+
font-family: var(--font-family);
|
|
14192
|
+
width: 100%;
|
|
14193
|
+
padding: var(--wui-space-02);
|
|
14194
|
+
border: none;
|
|
14195
|
+
height: ${({ $height }) => `${$height}px`};
|
|
14196
|
+
min-height: ${({ $height }) => `${$height}px`};
|
|
14197
|
+
resize: none;
|
|
14160
14198
|
}
|
|
14161
14199
|
`;
|
|
14162
14200
|
var editableStyles = import_styled_components81.css`
|
|
@@ -14273,11 +14311,11 @@ var EditableHeading = ({
|
|
|
14273
14311
|
// src/components/EditableText/EditableTextDisplay.tsx
|
|
14274
14312
|
var import_react65 = require("react");
|
|
14275
14313
|
var import_styled_components83 = __toESM(require("styled-components"));
|
|
14276
|
-
var
|
|
14314
|
+
var import_type_guards46 = require("@wistia/type-guards");
|
|
14277
14315
|
|
|
14278
14316
|
// src/components/EditableText/EditableTextRoot.tsx
|
|
14279
14317
|
var import_react64 = require("react");
|
|
14280
|
-
var
|
|
14318
|
+
var import_type_guards45 = require("@wistia/type-guards");
|
|
14281
14319
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
14282
14320
|
var import_jsx_runtime277 = require("react/jsx-runtime");
|
|
14283
14321
|
var StyledEditableTextRoot = import_styled_components82.default.div`
|
|
@@ -14312,7 +14350,7 @@ var EditableTextRoot = ({
|
|
|
14312
14350
|
const [isEditing, setIsEditing] = (0, import_react64.useState)(false);
|
|
14313
14351
|
const value = isControlled ? controlledValue : internalValue;
|
|
14314
14352
|
const generatedId = (0, import_react64.useId)();
|
|
14315
|
-
const computedId = (0,
|
|
14353
|
+
const computedId = (0, import_type_guards45.isNonEmptyString)(id) ? id : `wistia-ui-editable-text-${generatedId}`;
|
|
14316
14354
|
const handleSetIsEditing = (0, import_react64.useCallback)(
|
|
14317
14355
|
(editing) => {
|
|
14318
14356
|
if (editing && !isEditing) {
|
|
@@ -14399,7 +14437,7 @@ var StyledEditableTextDisplay = import_styled_components83.default.div`
|
|
|
14399
14437
|
margin: 0;
|
|
14400
14438
|
transition: all var(--wui-motion-duration-02) var(--wui-motion-ease);
|
|
14401
14439
|
${({ $maxLines }) => {
|
|
14402
|
-
if ((0,
|
|
14440
|
+
if ((0, import_type_guards46.isNotNil)($maxLines)) {
|
|
14403
14441
|
return import_styled_components83.css`
|
|
14404
14442
|
${ellipsisStyle};
|
|
14405
14443
|
${lineClampCss($maxLines)};
|
|
@@ -14407,7 +14445,7 @@ var StyledEditableTextDisplay = import_styled_components83.default.div`
|
|
|
14407
14445
|
}
|
|
14408
14446
|
return void 0;
|
|
14409
14447
|
}}
|
|
14410
|
-
${({ $minLines }) => (0,
|
|
14448
|
+
${({ $minLines }) => (0, import_type_guards46.isNotNil)($minLines) && import_styled_components83.css`
|
|
14411
14449
|
min-height: calc(${$minLines}lh + calc(var(--wui-editable-text-padding) * 2));
|
|
14412
14450
|
`}
|
|
14413
14451
|
word-break: break-word;
|
|
@@ -14494,12 +14532,12 @@ var EditableTextDisplay = makePolymorphic(
|
|
|
14494
14532
|
// src/components/EditableText/EditableTextInput.tsx
|
|
14495
14533
|
var import_react66 = require("react");
|
|
14496
14534
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
14497
|
-
var
|
|
14535
|
+
var import_type_guards47 = require("@wistia/type-guards");
|
|
14498
14536
|
var import_jsx_runtime279 = require("react/jsx-runtime");
|
|
14499
14537
|
var StyledInput2 = (0, import_styled_components84.default)(Input)`
|
|
14500
14538
|
&& {
|
|
14501
|
-
${({ $minLines }) => (0,
|
|
14502
|
-
${({ $maxLines }) => (0,
|
|
14539
|
+
${({ $minLines }) => (0, import_type_guards47.isNotNil)($minLines) && `min-height: calc(${$minLines}lh + calc(var(--wui-editable-text-padding) * 2));`}
|
|
14540
|
+
${({ $maxLines }) => (0, import_type_guards47.isNotNil)($maxLines) && `max-height: calc(${$maxLines}lh + calc(var(--wui-editable-text-padding) * 2));`}
|
|
14503
14541
|
${({ $typographicVariant }) => getTypographicStyles($typographicVariant)}
|
|
14504
14542
|
background-color: var(--wui-color-bg-surface);
|
|
14505
14543
|
border-radius: var(--wui-editable-text-border-radius);
|
|
@@ -14760,7 +14798,7 @@ var useFormState = (action, initialData = {}) => {
|
|
|
14760
14798
|
|
|
14761
14799
|
// src/components/Form/FormErrorSummary.tsx
|
|
14762
14800
|
var import_react72 = require("react");
|
|
14763
|
-
var
|
|
14801
|
+
var import_type_guards48 = require("@wistia/type-guards");
|
|
14764
14802
|
var import_jsx_runtime282 = require("react/jsx-runtime");
|
|
14765
14803
|
var ErrorItem = ({ name, error, formId }) => {
|
|
14766
14804
|
return /* @__PURE__ */ (0, import_jsx_runtime282.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(Link, { href: `#${formId}-${name}`, children: error }) }, name);
|
|
@@ -14774,8 +14812,8 @@ var FormErrorSummary = ({ description }) => {
|
|
|
14774
14812
|
}
|
|
14775
14813
|
return /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)("div", { ref, children: [
|
|
14776
14814
|
/* @__PURE__ */ (0, import_jsx_runtime282.jsx)("p", { children: description }),
|
|
14777
|
-
/* @__PURE__ */ (0, import_jsx_runtime282.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0,
|
|
14778
|
-
([name, error]) => (0,
|
|
14815
|
+
/* @__PURE__ */ (0, import_jsx_runtime282.jsx)("ul", { children: Object.entries(errors).filter(([, error]) => (0, import_type_guards48.isNotUndefined)(error)).map(
|
|
14816
|
+
([name, error]) => (0, import_type_guards48.isArray)(error) ? error.map((err) => /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(
|
|
14779
14817
|
ErrorItem,
|
|
14780
14818
|
{
|
|
14781
14819
|
error: err,
|
|
@@ -14799,7 +14837,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
14799
14837
|
// src/components/FormField/FormField.tsx
|
|
14800
14838
|
var import_react73 = require("react");
|
|
14801
14839
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
14802
|
-
var
|
|
14840
|
+
var import_type_guards49 = require("@wistia/type-guards");
|
|
14803
14841
|
var import_jsx_runtime283 = require("react/jsx-runtime");
|
|
14804
14842
|
var StyledFormField = import_styled_components85.default.div`
|
|
14805
14843
|
--form-field-spacing: var(--wui-space-01);
|
|
@@ -14840,7 +14878,7 @@ var StyledErrorList = import_styled_components85.default.ul`
|
|
|
14840
14878
|
gap: var(--wui-space-01);
|
|
14841
14879
|
`;
|
|
14842
14880
|
var ErrorMessages = ({ errors, id }) => {
|
|
14843
|
-
const isErrorArray = (0,
|
|
14881
|
+
const isErrorArray = (0, import_type_guards49.isArray)(errors);
|
|
14844
14882
|
const isMultipleErrors = isErrorArray && errors.length > 1;
|
|
14845
14883
|
if (!isErrorArray) {
|
|
14846
14884
|
return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
@@ -14908,19 +14946,19 @@ var FormField = ({
|
|
|
14908
14946
|
"aria-describedby": ariaDescribedby,
|
|
14909
14947
|
...props
|
|
14910
14948
|
};
|
|
14911
|
-
if ((0,
|
|
14949
|
+
if ((0, import_type_guards49.isUndefined)(value) && (0, import_type_guards49.isNotUndefined)(defaultValue)) {
|
|
14912
14950
|
childProps = {
|
|
14913
14951
|
...childProps,
|
|
14914
14952
|
defaultValue
|
|
14915
14953
|
};
|
|
14916
14954
|
}
|
|
14917
|
-
if ((0,
|
|
14918
|
-
const computedName = (0,
|
|
14955
|
+
if ((0, import_type_guards49.isNotNil)(checkboxGroup)) {
|
|
14956
|
+
const computedName = (0, import_type_guards49.isNotNil)(checkboxGroup.name) ? `${checkboxGroup.name}[${name}]` : name;
|
|
14919
14957
|
const handleChange = (event) => {
|
|
14920
|
-
if ((0,
|
|
14958
|
+
if ((0, import_type_guards49.isNotUndefined)(props.onChange)) {
|
|
14921
14959
|
props.onChange(event);
|
|
14922
14960
|
}
|
|
14923
|
-
if ((0,
|
|
14961
|
+
if ((0, import_type_guards49.isNotUndefined)(checkboxGroup.onChange)) {
|
|
14924
14962
|
checkboxGroup.onChange(event);
|
|
14925
14963
|
}
|
|
14926
14964
|
};
|
|
@@ -14928,7 +14966,7 @@ var FormField = ({
|
|
|
14928
14966
|
...childProps,
|
|
14929
14967
|
name: computedName,
|
|
14930
14968
|
onChange: handleChange,
|
|
14931
|
-
"aria-invalid": (0,
|
|
14969
|
+
"aria-invalid": (0, import_type_guards49.isNotNil)(error)
|
|
14932
14970
|
};
|
|
14933
14971
|
}
|
|
14934
14972
|
import_react73.Children.only(children);
|
|
@@ -14939,9 +14977,9 @@ var FormField = ({
|
|
|
14939
14977
|
"data-label-position": labelPosition ?? formState.labelPosition,
|
|
14940
14978
|
children: [
|
|
14941
14979
|
!isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(Label, { htmlFor: computedId, children: label }),
|
|
14942
|
-
(0,
|
|
14980
|
+
(0, import_type_guards49.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
14943
14981
|
(0, import_react73.cloneElement)(children, childProps),
|
|
14944
|
-
(0,
|
|
14982
|
+
(0, import_type_guards49.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)(import_jsx_runtime283.Fragment, { children: [
|
|
14945
14983
|
/* @__PURE__ */ (0, import_jsx_runtime283.jsx)("div", {}),
|
|
14946
14984
|
/* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
14947
14985
|
ErrorMessages,
|
|
@@ -14987,7 +15025,7 @@ RadioGroup.displayName = "RadioGroup_UI";
|
|
|
14987
15025
|
// src/components/Grid/Grid.tsx
|
|
14988
15026
|
var import_react75 = require("react");
|
|
14989
15027
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
14990
|
-
var
|
|
15028
|
+
var import_type_guards50 = require("@wistia/type-guards");
|
|
14991
15029
|
var import_jsx_runtime285 = require("react/jsx-runtime");
|
|
14992
15030
|
var DEFAULT_ELEMENT5 = "div";
|
|
14993
15031
|
var getGridTemplateColumns = (maxColumns, minChildWidth, expandItems) => {
|
|
@@ -15037,7 +15075,7 @@ var GridComponent = (0, import_react75.forwardRef)(
|
|
|
15037
15075
|
...props
|
|
15038
15076
|
}, ref) => {
|
|
15039
15077
|
const responsiveGap = useResponsiveProp(gap);
|
|
15040
|
-
const { column, row } = (0,
|
|
15078
|
+
const { column, row } = (0, import_type_guards50.isRecord)(responsiveGap) ? responsiveGap : { column: responsiveGap, row: responsiveGap };
|
|
15041
15079
|
const responsiveColumns = useResponsiveProp(columns);
|
|
15042
15080
|
const responsiveMinChildWidth = useResponsiveProp(minChildWidth);
|
|
15043
15081
|
return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(
|
|
@@ -15062,7 +15100,7 @@ var Grid = makePolymorphic(GridComponent);
|
|
|
15062
15100
|
// src/components/InputClickToCopy/InputClickToCopy.tsx
|
|
15063
15101
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
15064
15102
|
var import_react76 = require("react");
|
|
15065
|
-
var
|
|
15103
|
+
var import_type_guards51 = require("@wistia/type-guards");
|
|
15066
15104
|
var import_jsx_runtime286 = require("react/jsx-runtime");
|
|
15067
15105
|
var StyledIconButton = (0, import_styled_components87.default)(IconButton)`
|
|
15068
15106
|
/* override size for icon button since prop gets changed by Input */
|
|
@@ -15092,12 +15130,12 @@ var InputClickToCopy = (0, import_react76.forwardRef)(
|
|
|
15092
15130
|
if (disabled) {
|
|
15093
15131
|
return;
|
|
15094
15132
|
}
|
|
15095
|
-
if ((0,
|
|
15133
|
+
if ((0, import_type_guards51.isFunction)(props.onClick)) {
|
|
15096
15134
|
props.onClick(event);
|
|
15097
15135
|
}
|
|
15098
15136
|
void copyToClipboard(value).then(() => {
|
|
15099
15137
|
setIsCopied(true);
|
|
15100
|
-
if ((0,
|
|
15138
|
+
if ((0, import_type_guards51.isFunction)(onCopy)) {
|
|
15101
15139
|
onCopy(value);
|
|
15102
15140
|
}
|
|
15103
15141
|
return value;
|
|
@@ -15132,7 +15170,7 @@ InputClickToCopy.displayName = "InputClickToCopy_UI";
|
|
|
15132
15170
|
// src/components/InputPassword/InputPassword.tsx
|
|
15133
15171
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
15134
15172
|
var import_react77 = require("react");
|
|
15135
|
-
var
|
|
15173
|
+
var import_type_guards52 = require("@wistia/type-guards");
|
|
15136
15174
|
var import_jsx_runtime287 = require("react/jsx-runtime");
|
|
15137
15175
|
var StyledIconButton2 = (0, import_styled_components88.default)(IconButton)`
|
|
15138
15176
|
/* override size for icon button since prop gets changed by Input */
|
|
@@ -15148,7 +15186,7 @@ var InputPassword = (0, import_react77.forwardRef)(
|
|
|
15148
15186
|
const handleClick = () => {
|
|
15149
15187
|
const newVisibility = !isVisible;
|
|
15150
15188
|
setIsVisible(newVisibility);
|
|
15151
|
-
if ((0,
|
|
15189
|
+
if ((0, import_type_guards52.isFunction)(onVisibilityToggle)) {
|
|
15152
15190
|
onVisibilityToggle(newVisibility);
|
|
15153
15191
|
}
|
|
15154
15192
|
};
|
|
@@ -15178,7 +15216,7 @@ InputPassword.displayName = "InputPassword_UI";
|
|
|
15178
15216
|
|
|
15179
15217
|
// src/components/KeyboardShortcut/KeyboardShortcut.tsx
|
|
15180
15218
|
var import_styled_components89 = __toESM(require("styled-components"));
|
|
15181
|
-
var
|
|
15219
|
+
var import_type_guards53 = require("@wistia/type-guards");
|
|
15182
15220
|
var import_jsx_runtime288 = require("react/jsx-runtime");
|
|
15183
15221
|
var StyledKeyboardShortcut = import_styled_components89.default.div`
|
|
15184
15222
|
align-items: center;
|
|
@@ -15272,7 +15310,7 @@ var KeyboardShortcut = ({
|
|
|
15272
15310
|
$fullWidth: fullWidth,
|
|
15273
15311
|
...otherProps,
|
|
15274
15312
|
children: [
|
|
15275
|
-
(0,
|
|
15313
|
+
(0, import_type_guards53.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(Label2, { children: label }),
|
|
15276
15314
|
/* @__PURE__ */ (0, import_jsx_runtime288.jsx)(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(
|
|
15277
15315
|
StyledKey,
|
|
15278
15316
|
{
|
|
@@ -15286,18 +15324,18 @@ var KeyboardShortcut = ({
|
|
|
15286
15324
|
KeyboardShortcut.displayName = "KeyboardShortcut_UI";
|
|
15287
15325
|
|
|
15288
15326
|
// src/components/List/List.tsx
|
|
15289
|
-
var
|
|
15327
|
+
var import_type_guards55 = require("@wistia/type-guards");
|
|
15290
15328
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
15291
15329
|
|
|
15292
15330
|
// src/components/List/ListItem.tsx
|
|
15293
15331
|
var import_styled_components90 = __toESM(require("styled-components"));
|
|
15294
|
-
var
|
|
15332
|
+
var import_type_guards54 = require("@wistia/type-guards");
|
|
15295
15333
|
var import_jsx_runtime289 = require("react/jsx-runtime");
|
|
15296
15334
|
var ListItemComponent = import_styled_components90.default.li`
|
|
15297
15335
|
margin-bottom: var(--wui-space-02);
|
|
15298
15336
|
`;
|
|
15299
15337
|
var ListItem = ({ children }) => {
|
|
15300
|
-
if ((0,
|
|
15338
|
+
if ((0, import_type_guards54.isNil)(children)) {
|
|
15301
15339
|
return null;
|
|
15302
15340
|
}
|
|
15303
15341
|
return /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(ListItemComponent, { children });
|
|
@@ -15427,13 +15465,13 @@ var List = ({
|
|
|
15427
15465
|
...otherProps
|
|
15428
15466
|
}) => {
|
|
15429
15467
|
const listVariant = variant ?? "bullets";
|
|
15430
|
-
if ((0,
|
|
15468
|
+
if ((0, import_type_guards55.isNotNil)(children)) {
|
|
15431
15469
|
if (Array.isArray(children) && !children.length) {
|
|
15432
15470
|
return null;
|
|
15433
15471
|
}
|
|
15434
15472
|
return renderListComponent(children, listVariant, otherProps);
|
|
15435
15473
|
}
|
|
15436
|
-
if ((0,
|
|
15474
|
+
if ((0, import_type_guards55.isNotNil)(items)) {
|
|
15437
15475
|
if (!items.length) {
|
|
15438
15476
|
return null;
|
|
15439
15477
|
}
|
|
@@ -15468,7 +15506,7 @@ Mark.displayName = "Mark_UI";
|
|
|
15468
15506
|
var import_react80 = require("react");
|
|
15469
15507
|
var import_styled_components97 = __toESM(require("styled-components"));
|
|
15470
15508
|
var import_react_dialog5 = require("@radix-ui/react-dialog");
|
|
15471
|
-
var
|
|
15509
|
+
var import_type_guards57 = require("@wistia/type-guards");
|
|
15472
15510
|
|
|
15473
15511
|
// src/components/Modal/ModalHeader.tsx
|
|
15474
15512
|
var import_styled_components94 = __toESM(require("styled-components"));
|
|
@@ -15547,7 +15585,7 @@ var import_react_dialog3 = require("@radix-ui/react-dialog");
|
|
|
15547
15585
|
|
|
15548
15586
|
// src/private/hooks/useFocusRestore/useFocusRestore.ts
|
|
15549
15587
|
var import_react78 = require("react");
|
|
15550
|
-
var
|
|
15588
|
+
var import_type_guards56 = require("@wistia/type-guards");
|
|
15551
15589
|
var useFocusRestore = () => {
|
|
15552
15590
|
const previouslyFocusedRef = (0, import_react78.useRef)(null);
|
|
15553
15591
|
(0, import_react78.useEffect)(() => {
|
|
@@ -15555,7 +15593,7 @@ var useFocusRestore = () => {
|
|
|
15555
15593
|
}, []);
|
|
15556
15594
|
(0, import_react78.useEffect)(() => {
|
|
15557
15595
|
return () => {
|
|
15558
|
-
if ((0,
|
|
15596
|
+
if ((0, import_type_guards56.isNotNil)(previouslyFocusedRef.current)) {
|
|
15559
15597
|
setTimeout(() => {
|
|
15560
15598
|
previouslyFocusedRef.current?.focus();
|
|
15561
15599
|
}, 0);
|
|
@@ -15777,7 +15815,7 @@ var Modal = (0, import_react80.forwardRef)(
|
|
|
15777
15815
|
import_react_dialog5.Root,
|
|
15778
15816
|
{
|
|
15779
15817
|
onOpenChange: (open2) => {
|
|
15780
|
-
if (!open2 && (0,
|
|
15818
|
+
if (!open2 && (0, import_type_guards57.isNotNil)(onRequestClose)) {
|
|
15781
15819
|
onRequestClose();
|
|
15782
15820
|
}
|
|
15783
15821
|
},
|
|
@@ -15789,7 +15827,7 @@ var Modal = (0, import_react80.forwardRef)(
|
|
|
15789
15827
|
{
|
|
15790
15828
|
ref,
|
|
15791
15829
|
onOpenAutoFocus: (event) => {
|
|
15792
|
-
if ((0,
|
|
15830
|
+
if ((0, import_type_guards57.isNotNil)(initialFocusRef) && initialFocusRef.current) {
|
|
15793
15831
|
event.preventDefault();
|
|
15794
15832
|
requestAnimationFrame(() => {
|
|
15795
15833
|
initialFocusRef.current?.focus();
|
|
@@ -15801,7 +15839,7 @@ var Modal = (0, import_react80.forwardRef)(
|
|
|
15801
15839
|
...props,
|
|
15802
15840
|
children: [
|
|
15803
15841
|
/* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ModalScrollArea, { children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ModalBody, { children }) }),
|
|
15804
|
-
(0,
|
|
15842
|
+
(0, import_type_guards57.isNotNil)(footer) ? /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ModalFooter, { children: footer }) : null,
|
|
15805
15843
|
hideCloseButton && hideTitle ? null : /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
|
|
15806
15844
|
ModalHeader,
|
|
15807
15845
|
{
|
|
@@ -15847,9 +15885,9 @@ var import_react_popover5 = require("@radix-ui/react-popover");
|
|
|
15847
15885
|
var import_styled_components99 = __toESM(require("styled-components"));
|
|
15848
15886
|
|
|
15849
15887
|
// src/private/helpers/getControls/getControlProps.tsx
|
|
15850
|
-
var
|
|
15888
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
15851
15889
|
var getControlProps = (isOpen, onOpenChange) => {
|
|
15852
|
-
return (0,
|
|
15890
|
+
return (0, import_type_guards58.isNotNil)(onOpenChange) && (0, import_type_guards58.isNotNil)(isOpen) ? { open: isOpen, onOpenChange } : {};
|
|
15853
15891
|
};
|
|
15854
15892
|
|
|
15855
15893
|
// src/components/Popover/PopoverArrow.tsx
|
|
@@ -16005,7 +16043,7 @@ Popover.displayName = "Popover_UI";
|
|
|
16005
16043
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
16006
16044
|
var import_styled_components100 = __toESM(require("styled-components"));
|
|
16007
16045
|
var import_react_progress = require("@radix-ui/react-progress");
|
|
16008
|
-
var
|
|
16046
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
16009
16047
|
var import_jsx_runtime299 = require("react/jsx-runtime");
|
|
16010
16048
|
var ProgressBarWrapper = import_styled_components100.default.div`
|
|
16011
16049
|
--progress-bar-height: 8px;
|
|
@@ -16061,7 +16099,7 @@ var ProgressBar = ({
|
|
|
16061
16099
|
...props
|
|
16062
16100
|
}) => {
|
|
16063
16101
|
return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)(ProgressBarWrapper, { children: [
|
|
16064
|
-
(0,
|
|
16102
|
+
(0, import_type_guards59.isNotNil)(labelLeft) ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(ProgressBarLabel, { children: labelLeft }) : null,
|
|
16065
16103
|
/* @__PURE__ */ (0, import_jsx_runtime299.jsx)(
|
|
16066
16104
|
StyledProgressBar,
|
|
16067
16105
|
{
|
|
@@ -16079,13 +16117,13 @@ var ProgressBar = ({
|
|
|
16079
16117
|
)
|
|
16080
16118
|
}
|
|
16081
16119
|
),
|
|
16082
|
-
(0,
|
|
16120
|
+
(0, import_type_guards59.isNotNil)(labelRight) ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(ProgressBarLabel, { children: labelRight }) : null
|
|
16083
16121
|
] });
|
|
16084
16122
|
};
|
|
16085
16123
|
ProgressBar.displayName = "ProgressBar_UI";
|
|
16086
16124
|
|
|
16087
16125
|
// src/components/Radio/Radio.tsx
|
|
16088
|
-
var
|
|
16126
|
+
var import_type_guards60 = require("@wistia/type-guards");
|
|
16089
16127
|
var import_react81 = require("react");
|
|
16090
16128
|
var import_styled_components101 = __toESM(require("styled-components"));
|
|
16091
16129
|
var import_jsx_runtime300 = require("react/jsx-runtime");
|
|
@@ -16185,14 +16223,14 @@ var Radio = (0, import_react81.forwardRef)(
|
|
|
16185
16223
|
...props
|
|
16186
16224
|
}, ref) => {
|
|
16187
16225
|
const generatedId = (0, import_react81.useId)();
|
|
16188
|
-
const computedId = (0,
|
|
16226
|
+
const computedId = (0, import_type_guards60.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
16189
16227
|
const radioGroupContext = useRadioGroup();
|
|
16190
16228
|
const contextName = radioGroupContext?.name;
|
|
16191
16229
|
const contextOnChange = radioGroupContext?.onChange;
|
|
16192
16230
|
const contextValue = radioGroupContext?.value;
|
|
16193
16231
|
const radioName = name ?? contextName;
|
|
16194
16232
|
const handleOnChange = onChange ?? contextOnChange;
|
|
16195
|
-
const isChecked = (0,
|
|
16233
|
+
const isChecked = (0, import_type_guards60.isNotUndefined)(value) && (0, import_type_guards60.isNotUndefined)(contextValue) ? contextValue === value : checked;
|
|
16196
16234
|
return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)(
|
|
16197
16235
|
StyledRadioWrapper,
|
|
16198
16236
|
{
|
|
@@ -16239,7 +16277,7 @@ var import_react83 = require("react");
|
|
|
16239
16277
|
// src/components/RadioCard/RadioCardRoot.tsx
|
|
16240
16278
|
var import_react82 = require("react");
|
|
16241
16279
|
var import_styled_components102 = __toESM(require("styled-components"));
|
|
16242
|
-
var
|
|
16280
|
+
var import_type_guards61 = require("@wistia/type-guards");
|
|
16243
16281
|
var import_jsx_runtime301 = require("react/jsx-runtime");
|
|
16244
16282
|
var checkedStyles = import_styled_components102.css`
|
|
16245
16283
|
--wui-radio-card-border-color: var(--wui-color-focus-ring);
|
|
@@ -16361,14 +16399,14 @@ var RadioCardRoot = (0, import_react82.forwardRef)(
|
|
|
16361
16399
|
...props
|
|
16362
16400
|
}, ref) => {
|
|
16363
16401
|
const generatedId = (0, import_react82.useId)();
|
|
16364
|
-
const computedId = (0,
|
|
16402
|
+
const computedId = (0, import_type_guards61.isNonEmptyString)(id) ? id : `wistia-ui-radio-${generatedId}`;
|
|
16365
16403
|
const radioGroupContext = useRadioGroup();
|
|
16366
16404
|
const contextName = radioGroupContext?.name;
|
|
16367
16405
|
const contextOnChange = radioGroupContext?.onChange;
|
|
16368
16406
|
const contextValue = radioGroupContext?.value;
|
|
16369
16407
|
const radioName = name ?? contextName;
|
|
16370
16408
|
const handleOnChange = onChange ?? contextOnChange;
|
|
16371
|
-
const isChecked = (0,
|
|
16409
|
+
const isChecked = (0, import_type_guards61.isNotUndefined)(value) && (0, import_type_guards61.isNotUndefined)(contextValue) ? contextValue === value : checked;
|
|
16372
16410
|
return /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)(
|
|
16373
16411
|
StyledCard2,
|
|
16374
16412
|
{
|
|
@@ -16400,7 +16438,7 @@ RadioCardRoot.displayName = "RadioCardRoot_UI";
|
|
|
16400
16438
|
|
|
16401
16439
|
// src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
16402
16440
|
var import_styled_components104 = __toESM(require("styled-components"));
|
|
16403
|
-
var
|
|
16441
|
+
var import_type_guards62 = require("@wistia/type-guards");
|
|
16404
16442
|
|
|
16405
16443
|
// src/components/RadioCard/RadioCardIndicator.tsx
|
|
16406
16444
|
var import_styled_components103 = __toESM(require("styled-components"));
|
|
@@ -16474,17 +16512,17 @@ var RadioCardDefaultLayout = ({
|
|
|
16474
16512
|
showIndicator = true
|
|
16475
16513
|
}) => {
|
|
16476
16514
|
return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(StyledCardContent, { children: [
|
|
16477
|
-
showIndicator ? /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(StyledIndicatorContainer, { $hasIcon: (0,
|
|
16515
|
+
showIndicator ? /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(StyledIndicatorContainer, { $hasIcon: (0, import_type_guards62.isNotNil)(icon), children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" }) }) : null,
|
|
16478
16516
|
/* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(Stack, { gap: "space-02", children: [
|
|
16479
|
-
(0,
|
|
16517
|
+
(0, import_type_guards62.isNotNil)(icon) && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(StyledCardIcon, { "data-wui-radio-card-icon": true, children: icon }),
|
|
16480
16518
|
/* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
|
|
16481
16519
|
Stack,
|
|
16482
16520
|
{
|
|
16483
16521
|
gap: "space-01",
|
|
16484
|
-
style: (0,
|
|
16522
|
+
style: (0, import_type_guards62.isNotNil)(icon) ? { paddingLeft: 2 } : void 0,
|
|
16485
16523
|
children: [
|
|
16486
|
-
(0,
|
|
16487
|
-
(0,
|
|
16524
|
+
(0, import_type_guards62.isNotNil)(label) && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(Text, { variant: "label3", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("strong", { children: label }) }),
|
|
16525
|
+
(0, import_type_guards62.isNotNil)(description) && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
16488
16526
|
Text,
|
|
16489
16527
|
{
|
|
16490
16528
|
prominence: "secondary",
|
|
@@ -16667,7 +16705,7 @@ ScrollArea.displayName = "ScrollArea_UI";
|
|
|
16667
16705
|
var import_react88 = require("react");
|
|
16668
16706
|
var import_styled_components108 = __toESM(require("styled-components"));
|
|
16669
16707
|
var import_react_toggle_group3 = require("@radix-ui/react-toggle-group");
|
|
16670
|
-
var
|
|
16708
|
+
var import_type_guards64 = require("@wistia/type-guards");
|
|
16671
16709
|
|
|
16672
16710
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
16673
16711
|
var import_react86 = require("react");
|
|
@@ -16704,7 +16742,7 @@ var useSelectedItemStyle = () => {
|
|
|
16704
16742
|
|
|
16705
16743
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
16706
16744
|
var import_styled_components107 = __toESM(require("styled-components"));
|
|
16707
|
-
var
|
|
16745
|
+
var import_type_guards63 = require("@wistia/type-guards");
|
|
16708
16746
|
|
|
16709
16747
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
16710
16748
|
var import_react87 = require("react");
|
|
@@ -16738,7 +16776,7 @@ var SelectedItemIndicatorDiv = import_styled_components107.default.div`
|
|
|
16738
16776
|
var SelectedItemIndicator = () => {
|
|
16739
16777
|
const selectedValue = useSegmentedControlValue();
|
|
16740
16778
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
16741
|
-
if (!selectedValue || (0,
|
|
16779
|
+
if (!selectedValue || (0, import_type_guards63.isUndefined)(selectedItemIndicatorStyle)) {
|
|
16742
16780
|
return null;
|
|
16743
16781
|
}
|
|
16744
16782
|
return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
@@ -16775,7 +16813,7 @@ var SegmentedControl = (0, import_react88.forwardRef)(
|
|
|
16775
16813
|
onSelectedValueChange,
|
|
16776
16814
|
...props
|
|
16777
16815
|
}, ref) => {
|
|
16778
|
-
if ((0,
|
|
16816
|
+
if ((0, import_type_guards64.isNil)(children)) {
|
|
16779
16817
|
return null;
|
|
16780
16818
|
}
|
|
16781
16819
|
return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
@@ -16804,7 +16842,7 @@ SegmentedControl.displayName = "SegmentedControl_UI";
|
|
|
16804
16842
|
var import_react89 = require("react");
|
|
16805
16843
|
var import_styled_components109 = __toESM(require("styled-components"));
|
|
16806
16844
|
var import_react_toggle_group4 = require("@radix-ui/react-toggle-group");
|
|
16807
|
-
var
|
|
16845
|
+
var import_type_guards65 = require("@wistia/type-guards");
|
|
16808
16846
|
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
16809
16847
|
var segmentedControlItemStyles = import_styled_components109.css`
|
|
16810
16848
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -16920,8 +16958,8 @@ var SegmentedControlItem = (0, import_react89.forwardRef)(
|
|
|
16920
16958
|
{
|
|
16921
16959
|
ref: combinedRef,
|
|
16922
16960
|
...otherProps,
|
|
16923
|
-
$hasLabel: (0,
|
|
16924
|
-
"aria-label": (0,
|
|
16961
|
+
$hasLabel: (0, import_type_guards65.isNotNil)(label),
|
|
16962
|
+
"aria-label": (0, import_type_guards65.isNotNil)(label) ? void 0 : ariaLabel,
|
|
16925
16963
|
disabled,
|
|
16926
16964
|
onClick: handleClick,
|
|
16927
16965
|
value,
|
|
@@ -17086,7 +17124,7 @@ Select.displayName = "Select_UI";
|
|
|
17086
17124
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
17087
17125
|
var import_react91 = require("react");
|
|
17088
17126
|
var import_styled_components111 = __toESM(require("styled-components"));
|
|
17089
|
-
var
|
|
17127
|
+
var import_type_guards66 = require("@wistia/type-guards");
|
|
17090
17128
|
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
17091
17129
|
var StyledItem = (0, import_styled_components111.default)(import_react_select2.Item)`
|
|
17092
17130
|
${getTypographicStyles("label3")}
|
|
@@ -17123,7 +17161,7 @@ var SelectOption = (0, import_react91.forwardRef)(
|
|
|
17123
17161
|
ref: forwardedRef,
|
|
17124
17162
|
$checkmarkVerticalAlign: checkmarkVerticalAlign,
|
|
17125
17163
|
children: [
|
|
17126
|
-
(0,
|
|
17164
|
+
(0, import_type_guards66.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)("div", { children: [
|
|
17127
17165
|
children,
|
|
17128
17166
|
/* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
17129
17167
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(import_react_select2.ItemText, { children }),
|
|
@@ -17165,7 +17203,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
17165
17203
|
// src/components/Slider/Slider.tsx
|
|
17166
17204
|
var import_react_slider2 = require("@radix-ui/react-slider");
|
|
17167
17205
|
var import_styled_components113 = __toESM(require("styled-components"));
|
|
17168
|
-
var
|
|
17206
|
+
var import_type_guards67 = require("@wistia/type-guards");
|
|
17169
17207
|
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
17170
17208
|
var SliderContainer = import_styled_components113.default.div`
|
|
17171
17209
|
--wui-slider-track-color: var(--wui-gray-6);
|
|
@@ -17244,7 +17282,7 @@ var Slider = ({
|
|
|
17244
17282
|
"data-testid": dataTestId = "ui-slider",
|
|
17245
17283
|
...otherProps
|
|
17246
17284
|
}) => {
|
|
17247
|
-
if (!((0,
|
|
17285
|
+
if (!((0, import_type_guards67.isNonEmptyString)(ariaLabel) || (0, import_type_guards67.isNonEmptyString)(ariaLabelledby))) {
|
|
17248
17286
|
throw new Error(
|
|
17249
17287
|
"UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
|
|
17250
17288
|
);
|
|
@@ -17406,7 +17444,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
17406
17444
|
// src/components/Tabs/Tabs.tsx
|
|
17407
17445
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
17408
17446
|
var import_react98 = require("react");
|
|
17409
|
-
var
|
|
17447
|
+
var import_type_guards68 = require("@wistia/type-guards");
|
|
17410
17448
|
|
|
17411
17449
|
// src/components/Tabs/useTabsValue.tsx
|
|
17412
17450
|
var import_react97 = require("react");
|
|
@@ -17443,10 +17481,10 @@ var Tabs = ({
|
|
|
17443
17481
|
...props,
|
|
17444
17482
|
onValueChange
|
|
17445
17483
|
};
|
|
17446
|
-
if ((0,
|
|
17484
|
+
if ((0, import_type_guards68.isNotNil)(value)) {
|
|
17447
17485
|
rootProps.value = value;
|
|
17448
17486
|
}
|
|
17449
|
-
if ((0,
|
|
17487
|
+
if ((0, import_type_guards68.isNotNil)(defaultValue)) {
|
|
17450
17488
|
rootProps.defaultValue = defaultValue;
|
|
17451
17489
|
}
|
|
17452
17490
|
return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(import_react_tabs.Root, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -17466,7 +17504,7 @@ var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
|
17466
17504
|
var import_styled_components121 = __toESM(require("styled-components"));
|
|
17467
17505
|
|
|
17468
17506
|
// src/components/Tabs/SelectedTabIndicator.tsx
|
|
17469
|
-
var
|
|
17507
|
+
var import_type_guards69 = require("@wistia/type-guards");
|
|
17470
17508
|
|
|
17471
17509
|
// src/components/Tabs/TabsSelectedItemIndicatorDiv.tsx
|
|
17472
17510
|
var import_styled_components120 = __toESM(require("styled-components"));
|
|
@@ -17481,7 +17519,7 @@ var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
|
17481
17519
|
var SelectedTabIndicator = () => {
|
|
17482
17520
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
17483
17521
|
const selectedValue = useTabsValue();
|
|
17484
|
-
if (selectedValue == null || (0,
|
|
17522
|
+
if (selectedValue == null || (0, import_type_guards69.isUndefined)(selectedItemIndicatorStyle)) {
|
|
17485
17523
|
return null;
|
|
17486
17524
|
}
|
|
17487
17525
|
return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
@@ -17515,7 +17553,7 @@ TabsList.displayName = "TabsList_UI";
|
|
|
17515
17553
|
|
|
17516
17554
|
// src/components/Tabs/TabsTrigger.tsx
|
|
17517
17555
|
var import_react99 = require("react");
|
|
17518
|
-
var
|
|
17556
|
+
var import_type_guards70 = require("@wistia/type-guards");
|
|
17519
17557
|
|
|
17520
17558
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
17521
17559
|
var import_styled_components122 = __toESM(require("styled-components"));
|
|
@@ -17566,8 +17604,8 @@ var TabsTrigger = (0, import_react99.forwardRef)(
|
|
|
17566
17604
|
{
|
|
17567
17605
|
...otherProps,
|
|
17568
17606
|
ref: combinedRef,
|
|
17569
|
-
$hasLabel: (0,
|
|
17570
|
-
"aria-label": (0,
|
|
17607
|
+
$hasLabel: (0, import_type_guards70.isNotNil)(label),
|
|
17608
|
+
"aria-label": (0, import_type_guards70.isNotNil)(label) ? void 0 : ariaLabel,
|
|
17571
17609
|
disabled,
|
|
17572
17610
|
value,
|
|
17573
17611
|
children: [
|
|
@@ -17582,7 +17620,7 @@ TabsTrigger.displayName = "TabsTrigger_UI";
|
|
|
17582
17620
|
|
|
17583
17621
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
17584
17622
|
var import_styled_components123 = __toESM(require("styled-components"));
|
|
17585
|
-
var
|
|
17623
|
+
var import_type_guards71 = require("@wistia/type-guards");
|
|
17586
17624
|
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
17587
17625
|
var StyledThumbnailBadge = import_styled_components123.default.div`
|
|
17588
17626
|
align-items: center;
|
|
@@ -17611,7 +17649,7 @@ var StyledThumbnailBadge = import_styled_components123.default.div`
|
|
|
17611
17649
|
`;
|
|
17612
17650
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
17613
17651
|
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(StyledThumbnailBadge, { ...props, children: [
|
|
17614
|
-
(0,
|
|
17652
|
+
(0, import_type_guards71.isNotNil)(icon) && icon,
|
|
17615
17653
|
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("span", { children: label })
|
|
17616
17654
|
] });
|
|
17617
17655
|
};
|
|
@@ -17620,10 +17658,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge_UI";
|
|
|
17620
17658
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17621
17659
|
var import_react100 = require("react");
|
|
17622
17660
|
var import_styled_components126 = __toESM(require("styled-components"));
|
|
17623
|
-
var
|
|
17661
|
+
var import_type_guards74 = require("@wistia/type-guards");
|
|
17624
17662
|
|
|
17625
17663
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
17626
|
-
var
|
|
17664
|
+
var import_type_guards72 = require("@wistia/type-guards");
|
|
17627
17665
|
var import_styled_components124 = require("styled-components");
|
|
17628
17666
|
var gradients = {
|
|
17629
17667
|
defaultDarkOne: import_styled_components124.css`
|
|
@@ -17751,12 +17789,12 @@ var gradients = {
|
|
|
17751
17789
|
};
|
|
17752
17790
|
var gradientMap = Object.keys(gradients);
|
|
17753
17791
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
17754
|
-
return (0,
|
|
17792
|
+
return (0, import_type_guards72.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
17755
17793
|
};
|
|
17756
17794
|
|
|
17757
17795
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
17758
17796
|
var import_styled_components125 = __toESM(require("styled-components"));
|
|
17759
|
-
var
|
|
17797
|
+
var import_type_guards73 = require("@wistia/type-guards");
|
|
17760
17798
|
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
17761
17799
|
var ScrubLine = import_styled_components125.default.div`
|
|
17762
17800
|
position: absolute;
|
|
@@ -17850,8 +17888,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
17850
17888
|
);
|
|
17851
17889
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
17852
17890
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
17853
|
-
const showScrubLine = (0,
|
|
17854
|
-
const scrubLinePosition = (0,
|
|
17891
|
+
const showScrubLine = (0, import_type_guards73.isNotNil)(cursorPosition);
|
|
17892
|
+
const scrubLinePosition = (0, import_type_guards73.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
17855
17893
|
const viewerStyles = {
|
|
17856
17894
|
position: "relative",
|
|
17857
17895
|
overflow: "hidden",
|
|
@@ -17922,10 +17960,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
17922
17960
|
);
|
|
17923
17961
|
};
|
|
17924
17962
|
var StyledThumbnail = import_styled_components126.default.div`
|
|
17925
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
17963
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards74.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
17926
17964
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
17927
17965
|
// if we don't have $backgroundUrl show a gradient
|
|
17928
|
-
(0,
|
|
17966
|
+
(0, import_type_guards74.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
17929
17967
|
)};
|
|
17930
17968
|
background-position: center center;
|
|
17931
17969
|
background-size: cover;
|
|
@@ -17957,7 +17995,7 @@ var StoryboardRenderer = ({
|
|
|
17957
17995
|
frameCount,
|
|
17958
17996
|
aspectRatio
|
|
17959
17997
|
} = storyboard;
|
|
17960
|
-
const targetWidth = (0,
|
|
17998
|
+
const targetWidth = (0, import_type_guards74.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
17961
17999
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
17962
18000
|
return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
17963
18001
|
ThumbnailStoryboardViewer,
|
|
@@ -18001,10 +18039,10 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18001
18039
|
const storyboardElementRef = (0, import_react100.useRef)(null);
|
|
18002
18040
|
const [cursorPosition, setCursorPosition] = (0, import_react100.useState)(null);
|
|
18003
18041
|
const backgroundUrl = (0, import_react100.useMemo)(
|
|
18004
|
-
() => thumbnailImageType === "square" && (0,
|
|
18042
|
+
() => thumbnailImageType === "square" && (0, import_type_guards74.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
18005
18043
|
[thumbnailImageType, thumbnailUrl]
|
|
18006
18044
|
);
|
|
18007
|
-
const isScrubbable = (0,
|
|
18045
|
+
const isScrubbable = (0, import_type_guards74.isNotNil)(storyboard);
|
|
18008
18046
|
const trackStoryboardLoadStatus = (0, import_react100.useCallback)(() => {
|
|
18009
18047
|
if (storyboardElementRef.current || !storyboard) {
|
|
18010
18048
|
return storyboardElementRef.current;
|
|
@@ -18034,7 +18072,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18034
18072
|
setCursorPosition(null);
|
|
18035
18073
|
}, [isScrubbable]);
|
|
18036
18074
|
const shouldRenderStoryboard = (0, import_react100.useMemo)(() => {
|
|
18037
|
-
if ((0,
|
|
18075
|
+
if ((0, import_type_guards74.isNil)(storyboard) || (0, import_type_guards74.isUndefined)(height) || (0, import_type_guards74.isEmptyString)(height)) {
|
|
18038
18076
|
return false;
|
|
18039
18077
|
}
|
|
18040
18078
|
return isScrubbable && isMouseOver && isStoryboardReady;
|
|
@@ -18051,7 +18089,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18051
18089
|
width
|
|
18052
18090
|
}
|
|
18053
18091
|
);
|
|
18054
|
-
} else if ((0,
|
|
18092
|
+
} else if ((0, import_type_guards74.isNotNil)(thumbnailUrl)) {
|
|
18055
18093
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
18056
18094
|
ThumbnailImage,
|
|
18057
18095
|
{
|
|
@@ -18076,7 +18114,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
|
|
|
18076
18114
|
onMouseOut: handleMouseOut,
|
|
18077
18115
|
role: "presentation",
|
|
18078
18116
|
children: [
|
|
18079
|
-
(0,
|
|
18117
|
+
(0, import_type_guards74.isNotNil)(children) ? children : null,
|
|
18080
18118
|
thumbnailContent
|
|
18081
18119
|
]
|
|
18082
18120
|
}
|
|
@@ -18088,7 +18126,7 @@ Thumbnail.displayName = "Thumbnail_UI";
|
|
|
18088
18126
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
18089
18127
|
var import_react101 = __toESM(require("react"));
|
|
18090
18128
|
var import_styled_components127 = __toESM(require("styled-components"));
|
|
18091
|
-
var
|
|
18129
|
+
var import_type_guards75 = require("@wistia/type-guards");
|
|
18092
18130
|
var import_jsx_runtime328 = (
|
|
18093
18131
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
18094
18132
|
require("react/jsx-runtime")
|
|
@@ -18168,7 +18206,7 @@ var ThumbnailCollage = ({
|
|
|
18168
18206
|
}) => {
|
|
18169
18207
|
const thumbnailArray = import_react101.default.Children.toArray(children);
|
|
18170
18208
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
18171
|
-
const thumbnails = (0,
|
|
18209
|
+
const thumbnails = (0, import_type_guards75.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
18172
18210
|
return import_react101.default.cloneElement(child, {
|
|
18173
18211
|
...child.props,
|
|
18174
18212
|
children: void 0
|
|
@@ -18196,7 +18234,7 @@ var ThumbnailCollage = ({
|
|
|
18196
18234
|
|
|
18197
18235
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
18198
18236
|
var import_styled_components128 = __toESM(require("styled-components"));
|
|
18199
|
-
var
|
|
18237
|
+
var import_type_guards76 = require("@wistia/type-guards");
|
|
18200
18238
|
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
18201
18239
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
18202
18240
|
if (iconOnly) {
|
|
@@ -18309,7 +18347,7 @@ var WistiaLogo = ({
|
|
|
18309
18347
|
...props,
|
|
18310
18348
|
children: [
|
|
18311
18349
|
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)("title", { children: title }),
|
|
18312
|
-
(0,
|
|
18350
|
+
(0, import_type_guards76.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("desc", { children: description }) : null,
|
|
18313
18351
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
18314
18352
|
renderLogotype(logotypeColor, iconOnly)
|
|
18315
18353
|
]
|
|
@@ -18321,7 +18359,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
|
|
|
18321
18359
|
|
|
18322
18360
|
// src/components/SplitButton/SplitButton.tsx
|
|
18323
18361
|
var import_styled_components129 = __toESM(require("styled-components"));
|
|
18324
|
-
var
|
|
18362
|
+
var import_type_guards77 = require("@wistia/type-guards");
|
|
18325
18363
|
var import_react102 = require("react");
|
|
18326
18364
|
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
18327
18365
|
var StyledSplitButton = import_styled_components129.default.span`
|
|
@@ -18368,7 +18406,7 @@ var SplitButton = ({
|
|
|
18368
18406
|
children
|
|
18369
18407
|
}
|
|
18370
18408
|
),
|
|
18371
|
-
(0,
|
|
18409
|
+
(0, import_type_guards77.isNotNil)(menuItems) && /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
18372
18410
|
Menu,
|
|
18373
18411
|
{
|
|
18374
18412
|
...menuProps,
|
|
@@ -18387,7 +18425,7 @@ var SplitButton = ({
|
|
|
18387
18425
|
children: menuItems
|
|
18388
18426
|
}
|
|
18389
18427
|
),
|
|
18390
|
-
(0,
|
|
18428
|
+
(0, import_type_guards77.isNotNil)(secondaryAction) && (0, import_react102.cloneElement)(secondaryAction, { disabled, size, unstyled, variant, colorScheme })
|
|
18391
18429
|
] });
|
|
18392
18430
|
};
|
|
18393
18431
|
SplitButton.displayName = "SplitButton_UI";
|