@wistia/ui 0.10.13 → 0.10.14
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 +72 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +72 -48
- 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.10.
|
|
3
|
+
* @license @wistia/ui v0.10.14
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -12626,7 +12626,7 @@ Radio.displayName = "Radio";
|
|
|
12626
12626
|
var import_react63 = require("react");
|
|
12627
12627
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12628
12628
|
var import_react_toggle_group = require("@radix-ui/react-toggle-group");
|
|
12629
|
-
var
|
|
12629
|
+
var import_type_guards52 = require("@wistia/type-guards");
|
|
12630
12630
|
|
|
12631
12631
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
12632
12632
|
var import_react61 = require("react");
|
|
@@ -12663,6 +12663,7 @@ var useSelectedItemStyle = () => {
|
|
|
12663
12663
|
|
|
12664
12664
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
12665
12665
|
var import_styled_components77 = __toESM(require("styled-components"));
|
|
12666
|
+
var import_type_guards51 = require("@wistia/type-guards");
|
|
12666
12667
|
|
|
12667
12668
|
// src/components/SegmentedControl/useSegmentedControlValue.tsx
|
|
12668
12669
|
var import_react62 = require("react");
|
|
@@ -12678,13 +12679,16 @@ var useSegmentedControlValue = () => {
|
|
|
12678
12679
|
|
|
12679
12680
|
// src/components/SegmentedControl/SelectedItemIndicator.tsx
|
|
12680
12681
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
12681
|
-
var
|
|
12682
|
+
var selectedItemIndicatorStyles = import_styled_components77.css`
|
|
12682
12683
|
background-color: var(--wui-color-bg-fill-white);
|
|
12683
12684
|
border-radius: var(--wui-border-radius-rounded);
|
|
12685
|
+
box-shadow: var(--wui-elevation-01);
|
|
12686
|
+
`;
|
|
12687
|
+
var SelectedItemIndicatorDiv = import_styled_components77.default.div`
|
|
12688
|
+
${selectedItemIndicatorStyles}
|
|
12684
12689
|
left: 0;
|
|
12685
12690
|
position: absolute;
|
|
12686
12691
|
top: 50%;
|
|
12687
|
-
box-shadow: var(--wui-elevation-01);
|
|
12688
12692
|
transition:
|
|
12689
12693
|
transform var(--wui-motion-duration-02) var(--wui-motion-ease-out),
|
|
12690
12694
|
width var(--wui-motion-duration-02) var(--wui-motion-ease-out);
|
|
@@ -12693,10 +12697,16 @@ var SelectedItemIndicatorDiv = import_styled_components77.default.div`
|
|
|
12693
12697
|
var SelectedItemIndicator = () => {
|
|
12694
12698
|
const selectedValue = useSegmentedControlValue();
|
|
12695
12699
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
12696
|
-
if (!selectedValue) {
|
|
12700
|
+
if (!selectedValue || (0, import_type_guards51.isUndefined)(selectedItemIndicatorStyle)) {
|
|
12697
12701
|
return null;
|
|
12698
12702
|
}
|
|
12699
|
-
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
12703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
12704
|
+
SelectedItemIndicatorDiv,
|
|
12705
|
+
{
|
|
12706
|
+
"data-wui-selected-item-indicator": true,
|
|
12707
|
+
style: selectedItemIndicatorStyle
|
|
12708
|
+
}
|
|
12709
|
+
);
|
|
12700
12710
|
};
|
|
12701
12711
|
|
|
12702
12712
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
@@ -12724,7 +12734,7 @@ var SegmentedControl = (0, import_react63.forwardRef)(
|
|
|
12724
12734
|
onSelectedValueChange,
|
|
12725
12735
|
...props
|
|
12726
12736
|
}, ref) => {
|
|
12727
|
-
if ((0,
|
|
12737
|
+
if ((0, import_type_guards52.isNil)(children)) {
|
|
12728
12738
|
return null;
|
|
12729
12739
|
}
|
|
12730
12740
|
return /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
@@ -12740,8 +12750,8 @@ var SegmentedControl = (0, import_react63.forwardRef)(
|
|
|
12740
12750
|
value: selectedValue,
|
|
12741
12751
|
...props,
|
|
12742
12752
|
children: /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(SegmentedControlValueProvider, { value: selectedValue, children: /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(SelectedItemStyleProvider, { children: [
|
|
12743
|
-
|
|
12744
|
-
|
|
12753
|
+
children,
|
|
12754
|
+
/* @__PURE__ */ (0, import_jsx_runtime260.jsx)(SelectedItemIndicator, {})
|
|
12745
12755
|
] }) })
|
|
12746
12756
|
}
|
|
12747
12757
|
);
|
|
@@ -12753,7 +12763,7 @@ SegmentedControl.displayName = "SegmentedControl";
|
|
|
12753
12763
|
var import_react64 = require("react");
|
|
12754
12764
|
var import_styled_components79 = __toESM(require("styled-components"));
|
|
12755
12765
|
var import_react_toggle_group2 = require("@radix-ui/react-toggle-group");
|
|
12756
|
-
var
|
|
12766
|
+
var import_type_guards53 = require("@wistia/type-guards");
|
|
12757
12767
|
var import_jsx_runtime261 = require("react/jsx-runtime");
|
|
12758
12768
|
var segmentedControlItemStyles = import_styled_components79.css`
|
|
12759
12769
|
all: unset; /* ToggleGroupItem is a button element */
|
|
@@ -12802,6 +12812,11 @@ var segmentedControlItemStyles = import_styled_components79.css`
|
|
|
12802
12812
|
svg path {
|
|
12803
12813
|
fill: var(--wui-color-icon-selected);
|
|
12804
12814
|
}
|
|
12815
|
+
|
|
12816
|
+
/* This mkaes sure that the active styles appear on the initial value when the component renders */
|
|
12817
|
+
&:not(:has(~ [data-wui-selected-item-indicator])) {
|
|
12818
|
+
${selectedItemIndicatorStyles}
|
|
12819
|
+
}
|
|
12805
12820
|
}
|
|
12806
12821
|
|
|
12807
12822
|
&[data-disabled] {
|
|
@@ -12863,8 +12878,8 @@ var SegmentedControlItem = (0, import_react64.forwardRef)(
|
|
|
12863
12878
|
{
|
|
12864
12879
|
ref: combinedRef,
|
|
12865
12880
|
...otherProps,
|
|
12866
|
-
$hasLabel: (0,
|
|
12867
|
-
"aria-label": (0,
|
|
12881
|
+
$hasLabel: (0, import_type_guards53.isNotNil)(label),
|
|
12882
|
+
"aria-label": (0, import_type_guards53.isNotNil)(label) ? void 0 : ariaLabel,
|
|
12868
12883
|
disabled,
|
|
12869
12884
|
onClick: handleClick,
|
|
12870
12885
|
value,
|
|
@@ -12996,7 +13011,7 @@ Select.displayName = "Select";
|
|
|
12996
13011
|
var import_react_select2 = require("@radix-ui/react-select");
|
|
12997
13012
|
var import_react66 = require("react");
|
|
12998
13013
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
12999
|
-
var
|
|
13014
|
+
var import_type_guards54 = require("@wistia/type-guards");
|
|
13000
13015
|
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
13001
13016
|
var StyledItem = (0, import_styled_components81.default)(import_react_select2.Item)`
|
|
13002
13017
|
${variantStyleMap2.body3};
|
|
@@ -13040,7 +13055,7 @@ var SelectOption = (0, import_react66.forwardRef)(
|
|
|
13040
13055
|
type: "checkmark"
|
|
13041
13056
|
}
|
|
13042
13057
|
) }) }),
|
|
13043
|
-
(0,
|
|
13058
|
+
(0, import_type_guards54.isNotNil)(selectedDisplayValue) ? /* @__PURE__ */ (0, import_jsx_runtime263.jsxs)("div", { children: [
|
|
13044
13059
|
children,
|
|
13045
13060
|
/* @__PURE__ */ (0, import_jsx_runtime263.jsx)("div", { style: { display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(import_react_select2.ItemText, { children: selectedDisplayValue }) })
|
|
13046
13061
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(import_react_select2.ItemText, { children })
|
|
@@ -13075,7 +13090,7 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
|
|
|
13075
13090
|
// src/components/Slider/Slider.tsx
|
|
13076
13091
|
var import_react_slider = require("@radix-ui/react-slider");
|
|
13077
13092
|
var import_styled_components83 = __toESM(require("styled-components"));
|
|
13078
|
-
var
|
|
13093
|
+
var import_type_guards55 = require("@wistia/type-guards");
|
|
13079
13094
|
var import_jsx_runtime265 = require("react/jsx-runtime");
|
|
13080
13095
|
var SliderContainer = import_styled_components83.default.div`
|
|
13081
13096
|
--wui-slider-track-color: var(--wui-gray-6);
|
|
@@ -13154,7 +13169,7 @@ var Slider = ({
|
|
|
13154
13169
|
"data-testid": dataTestId = "ui-slider",
|
|
13155
13170
|
...otherProps
|
|
13156
13171
|
}) => {
|
|
13157
|
-
if (!((0,
|
|
13172
|
+
if (!((0, import_type_guards55.isNonEmptyString)(ariaLabel) || (0, import_type_guards55.isNonEmptyString)(ariaLabelledby))) {
|
|
13158
13173
|
throw new Error(
|
|
13159
13174
|
"UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
|
|
13160
13175
|
);
|
|
@@ -13202,7 +13217,7 @@ Slider.displayName = "Slider";
|
|
|
13202
13217
|
// src/components/Switch/Switch.tsx
|
|
13203
13218
|
var import_react67 = require("react");
|
|
13204
13219
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
13205
|
-
var
|
|
13220
|
+
var import_type_guards56 = require("@wistia/type-guards");
|
|
13206
13221
|
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
13207
13222
|
var sizeSmall3 = import_styled_components84.css`
|
|
13208
13223
|
--wui-size-small-width: 24px;
|
|
@@ -13321,7 +13336,7 @@ var Switch = (0, import_react67.forwardRef)(
|
|
|
13321
13336
|
...props
|
|
13322
13337
|
}, ref) => {
|
|
13323
13338
|
const generatedId = (0, import_react67.useId)();
|
|
13324
|
-
const computedId = (0,
|
|
13339
|
+
const computedId = (0, import_type_guards56.isNonEmptyString)(id) ? id : `wistia-ui-switch-${generatedId}`;
|
|
13325
13340
|
return /* @__PURE__ */ (0, import_jsx_runtime266.jsxs)(StyledSwitchWrapper, { $disabled: disabled, children: [
|
|
13326
13341
|
/* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
13327
13342
|
StyledHiddenSwitchInput,
|
|
@@ -13476,7 +13491,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
13476
13491
|
// src/components/Tabs/Tabs.tsx
|
|
13477
13492
|
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
13478
13493
|
var import_react71 = require("react");
|
|
13479
|
-
var
|
|
13494
|
+
var import_type_guards57 = require("@wistia/type-guards");
|
|
13480
13495
|
|
|
13481
13496
|
// src/components/Tabs/useTabsValue.tsx
|
|
13482
13497
|
var import_react70 = require("react");
|
|
@@ -13513,10 +13528,10 @@ var Tabs = ({
|
|
|
13513
13528
|
...props,
|
|
13514
13529
|
onValueChange
|
|
13515
13530
|
};
|
|
13516
|
-
if ((0,
|
|
13531
|
+
if ((0, import_type_guards57.isNotNil)(value)) {
|
|
13517
13532
|
rootProps.value = value;
|
|
13518
13533
|
}
|
|
13519
|
-
if ((0,
|
|
13534
|
+
if ((0, import_type_guards57.isNotNil)(defaultValue)) {
|
|
13520
13535
|
rootProps.defaultValue = defaultValue;
|
|
13521
13536
|
}
|
|
13522
13537
|
return /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_react_tabs.Root, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(TabsValueProvider, { value: value ?? defaultValue, children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(SelectedItemStyleProvider, { children }) }) });
|
|
@@ -13535,6 +13550,9 @@ TabsContent.displayName = "TabsContent";
|
|
|
13535
13550
|
var import_react_tabs3 = require("@radix-ui/react-tabs");
|
|
13536
13551
|
var import_styled_components92 = __toESM(require("styled-components"));
|
|
13537
13552
|
|
|
13553
|
+
// src/components/Tabs/SelectedTabIndicator.tsx
|
|
13554
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
13555
|
+
|
|
13538
13556
|
// src/components/Tabs/TabsSelectedItemIndicatorDiv.tsx
|
|
13539
13557
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
13540
13558
|
var TabsSelectedItemIndicatorDiv = (0, import_styled_components91.default)(SelectedItemIndicatorDiv)`
|
|
@@ -13548,10 +13566,16 @@ var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
|
13548
13566
|
var SelectedTabIndicator = () => {
|
|
13549
13567
|
const { selectedItemIndicatorStyle } = useSelectedItemStyle();
|
|
13550
13568
|
const selectedValue = useTabsValue();
|
|
13551
|
-
if (selectedValue == null ||
|
|
13569
|
+
if (selectedValue == null || (0, import_type_guards58.isUndefined)(selectedItemIndicatorStyle)) {
|
|
13552
13570
|
return null;
|
|
13553
13571
|
}
|
|
13554
|
-
return /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(
|
|
13572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(
|
|
13573
|
+
TabsSelectedItemIndicatorDiv,
|
|
13574
|
+
{
|
|
13575
|
+
"data-wui-selected-item-indicator": true,
|
|
13576
|
+
style: selectedItemIndicatorStyle
|
|
13577
|
+
}
|
|
13578
|
+
);
|
|
13555
13579
|
};
|
|
13556
13580
|
|
|
13557
13581
|
// src/components/Tabs/TabsList.tsx
|
|
@@ -13566,8 +13590,8 @@ var TabsList = ({ children, fullWidth = true, ...props }) => {
|
|
|
13566
13590
|
$fullWidth: fullWidth,
|
|
13567
13591
|
"aria-label": props["aria-label"],
|
|
13568
13592
|
children: [
|
|
13569
|
-
|
|
13570
|
-
|
|
13593
|
+
children,
|
|
13594
|
+
/* @__PURE__ */ (0, import_jsx_runtime276.jsx)(SelectedTabIndicator, {})
|
|
13571
13595
|
]
|
|
13572
13596
|
}
|
|
13573
13597
|
);
|
|
@@ -13576,7 +13600,7 @@ TabsList.displayName = "TabsList";
|
|
|
13576
13600
|
|
|
13577
13601
|
// src/components/Tabs/TabsTrigger.tsx
|
|
13578
13602
|
var import_react72 = require("react");
|
|
13579
|
-
var
|
|
13603
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
13580
13604
|
|
|
13581
13605
|
// src/components/Tabs/StyledRadixTabsTrigger.tsx
|
|
13582
13606
|
var import_styled_components93 = __toESM(require("styled-components"));
|
|
@@ -13627,8 +13651,8 @@ var TabsTrigger = (0, import_react72.forwardRef)(
|
|
|
13627
13651
|
{
|
|
13628
13652
|
...otherProps,
|
|
13629
13653
|
ref: combinedRef,
|
|
13630
|
-
$hasLabel: (0,
|
|
13631
|
-
"aria-label": (0,
|
|
13654
|
+
$hasLabel: (0, import_type_guards59.isNotNil)(label),
|
|
13655
|
+
"aria-label": (0, import_type_guards59.isNotNil)(label) ? void 0 : ariaLabel,
|
|
13632
13656
|
disabled,
|
|
13633
13657
|
value,
|
|
13634
13658
|
children: [
|
|
@@ -13643,7 +13667,7 @@ TabsTrigger.displayName = "TabsTrigger";
|
|
|
13643
13667
|
|
|
13644
13668
|
// src/components/Thumbnail/ThumbnailBadge.tsx
|
|
13645
13669
|
var import_styled_components94 = __toESM(require("styled-components"));
|
|
13646
|
-
var
|
|
13670
|
+
var import_type_guards60 = require("@wistia/type-guards");
|
|
13647
13671
|
var import_jsx_runtime278 = require("react/jsx-runtime");
|
|
13648
13672
|
var StyledThumbnailBadge = import_styled_components94.default.div`
|
|
13649
13673
|
align-items: center;
|
|
@@ -13671,7 +13695,7 @@ var StyledThumbnailBadge = import_styled_components94.default.div`
|
|
|
13671
13695
|
`;
|
|
13672
13696
|
var ThumbnailBadge = ({ icon, label, ...props }) => {
|
|
13673
13697
|
return /* @__PURE__ */ (0, import_jsx_runtime278.jsxs)(StyledThumbnailBadge, { ...props, children: [
|
|
13674
|
-
(0,
|
|
13698
|
+
(0, import_type_guards60.isNotNil)(icon) && icon,
|
|
13675
13699
|
/* @__PURE__ */ (0, import_jsx_runtime278.jsx)("span", { children: label })
|
|
13676
13700
|
] });
|
|
13677
13701
|
};
|
|
@@ -13680,10 +13704,10 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
|
13680
13704
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
13681
13705
|
var import_react73 = require("react");
|
|
13682
13706
|
var import_styled_components97 = __toESM(require("styled-components"));
|
|
13683
|
-
var
|
|
13707
|
+
var import_type_guards63 = require("@wistia/type-guards");
|
|
13684
13708
|
|
|
13685
13709
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
13686
|
-
var
|
|
13710
|
+
var import_type_guards61 = require("@wistia/type-guards");
|
|
13687
13711
|
var import_styled_components95 = require("styled-components");
|
|
13688
13712
|
var gradients = {
|
|
13689
13713
|
defaultDarkOne: import_styled_components95.css`
|
|
@@ -13811,12 +13835,12 @@ var gradients = {
|
|
|
13811
13835
|
};
|
|
13812
13836
|
var gradientMap = Object.keys(gradients);
|
|
13813
13837
|
var getBackgroundGradient = (gradientName = void 0) => {
|
|
13814
|
-
return (0,
|
|
13838
|
+
return (0, import_type_guards61.isNotNil)(gradientName) ? gradients[gradientName] : gradients.defaultDarkOne;
|
|
13815
13839
|
};
|
|
13816
13840
|
|
|
13817
13841
|
// src/components/Thumbnail/ThumbnailStoryboardViewer.tsx
|
|
13818
13842
|
var import_styled_components96 = __toESM(require("styled-components"));
|
|
13819
|
-
var
|
|
13843
|
+
var import_type_guards62 = require("@wistia/type-guards");
|
|
13820
13844
|
var import_jsx_runtime279 = require("react/jsx-runtime");
|
|
13821
13845
|
var ScrubLine = import_styled_components96.default.div`
|
|
13822
13846
|
position: absolute;
|
|
@@ -13902,8 +13926,8 @@ var ThumbnailStoryboardViewer = ({
|
|
|
13902
13926
|
);
|
|
13903
13927
|
const backgroundSize = `${scaledStoryboardWidth}px ${scaledStoryboardHeight}px`;
|
|
13904
13928
|
const backgroundImage = `url(${storyboardUrl})`;
|
|
13905
|
-
const showScrubLine = (0,
|
|
13906
|
-
const scrubLinePosition = (0,
|
|
13929
|
+
const showScrubLine = (0, import_type_guards62.isNotNil)(cursorPosition);
|
|
13930
|
+
const scrubLinePosition = (0, import_type_guards62.isNotNil)(cursorPosition) ? `${cursorPosition - 1}px` : "0";
|
|
13907
13931
|
const viewerStyles = {
|
|
13908
13932
|
position: "relative",
|
|
13909
13933
|
overflow: "hidden",
|
|
@@ -13973,10 +13997,10 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
13973
13997
|
);
|
|
13974
13998
|
};
|
|
13975
13999
|
var StyledThumbnail = import_styled_components97.default.div`
|
|
13976
|
-
background-image: ${({ $backgroundUrl }) => (0,
|
|
14000
|
+
background-image: ${({ $backgroundUrl }) => (0, import_type_guards63.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
13977
14001
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
13978
14002
|
// if we don't have $backgroundUrl show a gradient
|
|
13979
|
-
(0,
|
|
14003
|
+
(0, import_type_guards63.isNil)($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
13980
14004
|
)};
|
|
13981
14005
|
background-position: center center;
|
|
13982
14006
|
background-size: cover;
|
|
@@ -14018,10 +14042,10 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14018
14042
|
const storyboardElementRef = (0, import_react73.useRef)(null);
|
|
14019
14043
|
const [cursorPosition, setCursorPosition] = (0, import_react73.useState)(null);
|
|
14020
14044
|
const backgroundUrl = (0, import_react73.useMemo)(
|
|
14021
|
-
() => thumbnailImageType === "square" && (0,
|
|
14045
|
+
() => thumbnailImageType === "square" && (0, import_type_guards63.isNotNil)(thumbnailUrl) ? thumbnailUrl : void 0,
|
|
14022
14046
|
[thumbnailImageType, thumbnailUrl]
|
|
14023
14047
|
);
|
|
14024
|
-
const isScrubbable = (0,
|
|
14048
|
+
const isScrubbable = (0, import_type_guards63.isNotNil)(storyboard);
|
|
14025
14049
|
const trackStoryboardLoadStatus = (0, import_react73.useCallback)(() => {
|
|
14026
14050
|
if (storyboardElementRef.current || !storyboard) {
|
|
14027
14051
|
return storyboardElementRef.current;
|
|
@@ -14054,7 +14078,7 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14054
14078
|
return Boolean(isScrubbable && isMouseOver && isStoryboardReady);
|
|
14055
14079
|
}, [isScrubbable, isMouseOver, isStoryboardReady]);
|
|
14056
14080
|
const renderStoryboard = (0, import_react73.useCallback)(() => {
|
|
14057
|
-
if (!storyboard || (0,
|
|
14081
|
+
if (!storyboard || (0, import_type_guards63.isUndefined)(height) || (0, import_type_guards63.isEmptyString)(height)) return null;
|
|
14058
14082
|
const {
|
|
14059
14083
|
url,
|
|
14060
14084
|
width: sbWidth,
|
|
@@ -14064,7 +14088,7 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14064
14088
|
frameCount,
|
|
14065
14089
|
aspectRatio
|
|
14066
14090
|
} = storyboard;
|
|
14067
|
-
const targetWidth = (0,
|
|
14091
|
+
const targetWidth = (0, import_type_guards63.isString)(width) ? parseInt(width, 10) : Number(width);
|
|
14068
14092
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
14069
14093
|
return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(
|
|
14070
14094
|
ThumbnailStoryboardViewer,
|
|
@@ -14085,7 +14109,7 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14085
14109
|
let thumbnailContent = null;
|
|
14086
14110
|
if (shouldRenderStoryboard) {
|
|
14087
14111
|
thumbnailContent = renderStoryboard();
|
|
14088
|
-
} else if ((0,
|
|
14112
|
+
} else if ((0, import_type_guards63.isNotNil)(thumbnailUrl)) {
|
|
14089
14113
|
thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(
|
|
14090
14114
|
ThumbnailImage,
|
|
14091
14115
|
{
|
|
@@ -14110,7 +14134,7 @@ var Thumbnail = (0, import_react73.forwardRef)(
|
|
|
14110
14134
|
onMouseOut: handleMouseOut,
|
|
14111
14135
|
role: "presentation",
|
|
14112
14136
|
children: [
|
|
14113
|
-
(0,
|
|
14137
|
+
(0, import_type_guards63.isNotNil)(children) ? children : null,
|
|
14114
14138
|
thumbnailContent
|
|
14115
14139
|
]
|
|
14116
14140
|
}
|
|
@@ -14122,7 +14146,7 @@ Thumbnail.displayName = "Thumbnail";
|
|
|
14122
14146
|
// src/components/ThumbnailCollage/ThumbnailCollage.tsx
|
|
14123
14147
|
var import_react74 = __toESM(require("react"));
|
|
14124
14148
|
var import_styled_components98 = __toESM(require("styled-components"));
|
|
14125
|
-
var
|
|
14149
|
+
var import_type_guards64 = require("@wistia/type-guards");
|
|
14126
14150
|
var import_jsx_runtime281 = (
|
|
14127
14151
|
// ThumbnailCollage will fallback to a Thumbnail with a gradient background if no children are provided
|
|
14128
14152
|
require("react/jsx-runtime")
|
|
@@ -14202,7 +14226,7 @@ var ThumbnailCollage = ({
|
|
|
14202
14226
|
}) => {
|
|
14203
14227
|
const thumbnailArray = import_react74.default.Children.toArray(children);
|
|
14204
14228
|
const truncatedThumbnails = thumbnailArray.slice(0, 3);
|
|
14205
|
-
const thumbnails = (0,
|
|
14229
|
+
const thumbnails = (0, import_type_guards64.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
|
|
14206
14230
|
return import_react74.default.cloneElement(child, {
|
|
14207
14231
|
...child.props,
|
|
14208
14232
|
children: void 0
|
|
@@ -14230,7 +14254,7 @@ var ThumbnailCollage = ({
|
|
|
14230
14254
|
|
|
14231
14255
|
// src/components/WistiaLogo/WistiaLogo.tsx
|
|
14232
14256
|
var import_styled_components99 = __toESM(require("styled-components"));
|
|
14233
|
-
var
|
|
14257
|
+
var import_type_guards65 = require("@wistia/type-guards");
|
|
14234
14258
|
var import_jsx_runtime282 = require("react/jsx-runtime");
|
|
14235
14259
|
var renderBrandmark = (brandmarkColor, iconOnly) => {
|
|
14236
14260
|
if (iconOnly) {
|
|
@@ -14343,7 +14367,7 @@ var WistiaLogo = ({
|
|
|
14343
14367
|
...props,
|
|
14344
14368
|
children: [
|
|
14345
14369
|
/* @__PURE__ */ (0, import_jsx_runtime282.jsx)("title", { children: title }),
|
|
14346
|
-
(0,
|
|
14370
|
+
(0, import_type_guards65.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime282.jsx)("desc", { children: description }) : null,
|
|
14347
14371
|
renderBrandmark(brandmarkColor, iconOnly),
|
|
14348
14372
|
renderLogotype(logotypeColor, iconOnly)
|
|
14349
14373
|
]
|