@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.d.mts
CHANGED
|
@@ -1814,6 +1814,11 @@ type TextProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
1814
1814
|
* Display the text as inline content
|
|
1815
1815
|
*/
|
|
1816
1816
|
inline?: boolean;
|
|
1817
|
+
/**
|
|
1818
|
+
* Maximum number of characters to display before truncating. Must be >= 1.
|
|
1819
|
+
* When truncated, an ellipsis (...) will be added to the end.
|
|
1820
|
+
*/
|
|
1821
|
+
maxChars?: number;
|
|
1817
1822
|
/**
|
|
1818
1823
|
* Prevents text from being highlighted and copied
|
|
1819
1824
|
*/
|
|
@@ -1907,6 +1912,11 @@ type HeadingProps = ComponentPropsWithoutRef<typeof DEFAULT_ELEMENT> & {
|
|
|
1907
1912
|
* Display the text as inline content
|
|
1908
1913
|
*/
|
|
1909
1914
|
inline?: boolean;
|
|
1915
|
+
/**
|
|
1916
|
+
* Maximum number of characters to display before truncating. Must be >= 1.
|
|
1917
|
+
* When truncated, an ellipsis (...) will be added to the end.
|
|
1918
|
+
*/
|
|
1919
|
+
maxChars?: number;
|
|
1910
1920
|
/**
|
|
1911
1921
|
* Text prominence affects color. Use 'primary' for main non-interactive text, 'secondary' for supporting text, and 'button' in specific cases where text is used in an interactive component.
|
|
1912
1922
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1814,6 +1814,11 @@ type TextProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
1814
1814
|
* Display the text as inline content
|
|
1815
1815
|
*/
|
|
1816
1816
|
inline?: boolean;
|
|
1817
|
+
/**
|
|
1818
|
+
* Maximum number of characters to display before truncating. Must be >= 1.
|
|
1819
|
+
* When truncated, an ellipsis (...) will be added to the end.
|
|
1820
|
+
*/
|
|
1821
|
+
maxChars?: number;
|
|
1817
1822
|
/**
|
|
1818
1823
|
* Prevents text from being highlighted and copied
|
|
1819
1824
|
*/
|
|
@@ -1907,6 +1912,11 @@ type HeadingProps = ComponentPropsWithoutRef<typeof DEFAULT_ELEMENT> & {
|
|
|
1907
1912
|
* Display the text as inline content
|
|
1908
1913
|
*/
|
|
1909
1914
|
inline?: boolean;
|
|
1915
|
+
/**
|
|
1916
|
+
* Maximum number of characters to display before truncating. Must be >= 1.
|
|
1917
|
+
* When truncated, an ellipsis (...) will be added to the end.
|
|
1918
|
+
*/
|
|
1919
|
+
maxChars?: number;
|
|
1910
1920
|
/**
|
|
1911
1921
|
* Text prominence affects color. Use 'primary' for main non-interactive text, 'secondary' for supporting text, and 'button' in specific cases where text is used in an interactive component.
|
|
1912
1922
|
*/
|
package/dist/index.mjs
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
|
*
|
|
@@ -8307,7 +8307,7 @@ Badge.displayName = "Badge_UI";
|
|
|
8307
8307
|
// src/components/Banner/Banner.tsx
|
|
8308
8308
|
import { useEffect as useEffect8, useState as useState10, useMemo as useMemo5 } from "react";
|
|
8309
8309
|
import styled16 from "styled-components";
|
|
8310
|
-
import { isNil as
|
|
8310
|
+
import { isNil as isNil11, isNotNil as isNotNil13 } from "@wistia/type-guards";
|
|
8311
8311
|
|
|
8312
8312
|
// src/components/Box/Box.tsx
|
|
8313
8313
|
import { forwardRef as forwardRef5 } from "react";
|
|
@@ -8510,6 +8510,38 @@ var Box = makePolymorphic(BoxComponent);
|
|
|
8510
8510
|
import { forwardRef as forwardRef6 } from "react";
|
|
8511
8511
|
import styled12, { css as css21 } from "styled-components";
|
|
8512
8512
|
import { isNotNil as isNotNil11 } from "@wistia/type-guards";
|
|
8513
|
+
|
|
8514
|
+
// src/private/helpers/applyMaxCharsToChildren/applyMaxCharsToChildren.ts
|
|
8515
|
+
import { isString as isString2, isNumber, isNil as isNil9 } from "@wistia/type-guards";
|
|
8516
|
+
|
|
8517
|
+
// src/private/helpers/truncateString/truncateString.ts
|
|
8518
|
+
var truncateString = (text, maxChars) => {
|
|
8519
|
+
if (maxChars < 1) {
|
|
8520
|
+
throw new Error("maxChars must be >= 1");
|
|
8521
|
+
}
|
|
8522
|
+
if (text.length <= maxChars) {
|
|
8523
|
+
return text;
|
|
8524
|
+
}
|
|
8525
|
+
return text.slice(0, maxChars);
|
|
8526
|
+
};
|
|
8527
|
+
|
|
8528
|
+
// src/private/helpers/applyMaxCharsToChildren/applyMaxCharsToChildren.ts
|
|
8529
|
+
var applyMaxCharsToChildren = (children, maxChars) => {
|
|
8530
|
+
if (isNil9(maxChars)) {
|
|
8531
|
+
return children;
|
|
8532
|
+
}
|
|
8533
|
+
if (isString2(children)) {
|
|
8534
|
+
return truncateString(children, maxChars);
|
|
8535
|
+
}
|
|
8536
|
+
if (isNumber(children)) {
|
|
8537
|
+
const numberString = String(children);
|
|
8538
|
+
return truncateString(numberString, maxChars);
|
|
8539
|
+
}
|
|
8540
|
+
const textContent = typeof children === "object" ? JSON.stringify(children) : String(children);
|
|
8541
|
+
return truncateString(textContent, maxChars);
|
|
8542
|
+
};
|
|
8543
|
+
|
|
8544
|
+
// src/components/Heading/Heading.tsx
|
|
8513
8545
|
import { jsx as jsx207 } from "react/jsx-runtime";
|
|
8514
8546
|
var heroStyle = css21`
|
|
8515
8547
|
--font-family: var(--wui-typography-heading-hero-family);
|
|
@@ -8618,31 +8650,37 @@ var variantElementMap = {
|
|
|
8618
8650
|
var HeadingComponent = forwardRef6(
|
|
8619
8651
|
({
|
|
8620
8652
|
align = "left",
|
|
8653
|
+
children,
|
|
8621
8654
|
colorScheme = "inherit",
|
|
8622
8655
|
disabled = false,
|
|
8623
8656
|
inline = false,
|
|
8657
|
+
maxChars,
|
|
8624
8658
|
preventUserSelect = false,
|
|
8625
8659
|
prominence = "primary",
|
|
8626
8660
|
truncate,
|
|
8627
8661
|
variant = "heading1",
|
|
8628
8662
|
renderAs,
|
|
8629
8663
|
...props
|
|
8630
|
-
}, ref) =>
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8664
|
+
}, ref) => {
|
|
8665
|
+
const processedChildren = applyMaxCharsToChildren(children, maxChars);
|
|
8666
|
+
return /* @__PURE__ */ jsx207(
|
|
8667
|
+
StyledHeading,
|
|
8668
|
+
{
|
|
8669
|
+
ref,
|
|
8670
|
+
$align: align,
|
|
8671
|
+
$colorScheme: colorScheme,
|
|
8672
|
+
$disabled: disabled,
|
|
8673
|
+
$inline: inline,
|
|
8674
|
+
$preventUserSelect: preventUserSelect,
|
|
8675
|
+
$prominence: prominence,
|
|
8676
|
+
$truncate: truncate,
|
|
8677
|
+
$variant: variant,
|
|
8678
|
+
as: renderAs ?? variantElementMap[variant] ?? DEFAULT_ELEMENT2,
|
|
8679
|
+
...props,
|
|
8680
|
+
children: processedChildren
|
|
8681
|
+
}
|
|
8682
|
+
);
|
|
8683
|
+
}
|
|
8646
8684
|
);
|
|
8647
8685
|
HeadingComponent.displayName = "Heading_UI";
|
|
8648
8686
|
var Heading = makePolymorphic(HeadingComponent);
|
|
@@ -8835,9 +8873,11 @@ var StyledText = styled13.div`
|
|
|
8835
8873
|
var TextComponent = forwardRef7(
|
|
8836
8874
|
({
|
|
8837
8875
|
align = "left",
|
|
8876
|
+
children,
|
|
8838
8877
|
colorScheme = "inherit",
|
|
8839
8878
|
disabled = false,
|
|
8840
8879
|
inline = false,
|
|
8880
|
+
maxChars,
|
|
8841
8881
|
preventUserSelect = false,
|
|
8842
8882
|
prominence = "primary",
|
|
8843
8883
|
truncate,
|
|
@@ -8845,6 +8885,7 @@ var TextComponent = forwardRef7(
|
|
|
8845
8885
|
renderAs,
|
|
8846
8886
|
...props
|
|
8847
8887
|
}, ref) => {
|
|
8888
|
+
const processedChildren = applyMaxCharsToChildren(children, maxChars);
|
|
8848
8889
|
return /* @__PURE__ */ jsx208(
|
|
8849
8890
|
StyledText,
|
|
8850
8891
|
{
|
|
@@ -8858,7 +8899,8 @@ var TextComponent = forwardRef7(
|
|
|
8858
8899
|
$truncate: truncate,
|
|
8859
8900
|
$variant: variant,
|
|
8860
8901
|
as: renderAs ?? variantElementMap2[variant] ?? DEFAULT_ELEMENT3,
|
|
8861
|
-
...props
|
|
8902
|
+
...props,
|
|
8903
|
+
children: processedChildren
|
|
8862
8904
|
}
|
|
8863
8905
|
);
|
|
8864
8906
|
}
|
|
@@ -8868,7 +8910,7 @@ var Text = makePolymorphic(TextComponent);
|
|
|
8868
8910
|
|
|
8869
8911
|
// src/components/ButtonGroup/ButtonGroup.tsx
|
|
8870
8912
|
import styled14, { css as css23 } from "styled-components";
|
|
8871
|
-
import { isNil as
|
|
8913
|
+
import { isNil as isNil10 } from "@wistia/type-guards";
|
|
8872
8914
|
import { jsx as jsx209 } from "react/jsx-runtime";
|
|
8873
8915
|
var getAlignment = (align) => {
|
|
8874
8916
|
if (align === "center") {
|
|
@@ -8928,7 +8970,7 @@ var ButtonGroup = ({
|
|
|
8928
8970
|
...props
|
|
8929
8971
|
}) => {
|
|
8930
8972
|
const responsiveButtonSize = useResponsiveProp(buttonSize);
|
|
8931
|
-
if (
|
|
8973
|
+
if (isNil10(children)) {
|
|
8932
8974
|
return null;
|
|
8933
8975
|
}
|
|
8934
8976
|
return /* @__PURE__ */ jsx209(
|
|
@@ -9048,7 +9090,7 @@ var Banner = ({
|
|
|
9048
9090
|
const hasImage = isNotNil13(image);
|
|
9049
9091
|
const shouldShowImage = hasImage && (isVerticalLayout || width >= MIN_IMAGE_WIDTH);
|
|
9050
9092
|
const iconPosition = useMemo5(() => {
|
|
9051
|
-
if (
|
|
9093
|
+
if (isNil11(icon)) return "none";
|
|
9052
9094
|
if (isSmallContainer) return shouldShowImage ? "inline" : "above";
|
|
9053
9095
|
return prominence === "secondary" ? "inline" : "above";
|
|
9054
9096
|
}, [icon, isSmallContainer, shouldShowImage, prominence]);
|
|
@@ -9324,7 +9366,7 @@ import { forwardRef as forwardRef12, useId as useId2 } from "react";
|
|
|
9324
9366
|
import styled27, { css as css26 } from "styled-components";
|
|
9325
9367
|
|
|
9326
9368
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
9327
|
-
import { isNil as
|
|
9369
|
+
import { isNil as isNil13, isNotNil as isNotNil15 } from "@wistia/type-guards";
|
|
9328
9370
|
import styled23, { css as css25 } from "styled-components";
|
|
9329
9371
|
|
|
9330
9372
|
// src/components/ScreenReaderOnly/ScreenReaderOnly.tsx
|
|
@@ -9351,7 +9393,7 @@ ScreenReaderOnly.displayName = "ScreenReaderOnly_UI";
|
|
|
9351
9393
|
|
|
9352
9394
|
// src/private/components/FormControlLabel/FormControlLabelDescription.tsx
|
|
9353
9395
|
import styled22, { css as css24 } from "styled-components";
|
|
9354
|
-
import { isNil as
|
|
9396
|
+
import { isNil as isNil12 } from "@wistia/type-guards";
|
|
9355
9397
|
import { jsx as jsx217 } from "react/jsx-runtime";
|
|
9356
9398
|
var disabledStyle = css24`
|
|
9357
9399
|
color: var(--wui-color-text-disabled);
|
|
@@ -9370,7 +9412,7 @@ var FormControlLabelDescription = ({
|
|
|
9370
9412
|
disabled = false,
|
|
9371
9413
|
...props
|
|
9372
9414
|
}) => {
|
|
9373
|
-
if (
|
|
9415
|
+
if (isNil12(children)) {
|
|
9374
9416
|
return null;
|
|
9375
9417
|
}
|
|
9376
9418
|
return /* @__PURE__ */ jsx217(
|
|
@@ -9418,7 +9460,7 @@ var FormControlLabel = ({
|
|
|
9418
9460
|
hideLabel = false,
|
|
9419
9461
|
...props
|
|
9420
9462
|
}) => {
|
|
9421
|
-
if (
|
|
9463
|
+
if (isNil13(label)) {
|
|
9422
9464
|
return null;
|
|
9423
9465
|
}
|
|
9424
9466
|
const labelContent = hideLabel ? /* @__PURE__ */ jsx218(ScreenReaderOnly, { children: label }) : /* @__PURE__ */ jsxs16(StyledLabelWrapper, { children: [
|
|
@@ -11487,7 +11529,7 @@ import { parseHex as parseHex2 } from "culori/fn";
|
|
|
11487
11529
|
// src/components/Input/Input.tsx
|
|
11488
11530
|
import { isValidElement as isValidElement2, forwardRef as forwardRef15, cloneElement as cloneElement4, useRef as useRef9 } from "react";
|
|
11489
11531
|
import styled44, { css as css30 } from "styled-components";
|
|
11490
|
-
import { isNil as
|
|
11532
|
+
import { isNil as isNil14, isNotNil as isNotNil18, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
11491
11533
|
|
|
11492
11534
|
// src/css/inputCss.ts
|
|
11493
11535
|
import { css as css29 } from "styled-components";
|
|
@@ -11633,13 +11675,12 @@ var Input = forwardRef15(
|
|
|
11633
11675
|
autoSelect = false,
|
|
11634
11676
|
leftIcon,
|
|
11635
11677
|
rightIcon,
|
|
11636
|
-
className,
|
|
11637
11678
|
...props
|
|
11638
11679
|
}, externalRef) => {
|
|
11639
11680
|
const internalRef = useRef9(null);
|
|
11640
11681
|
const ref = isNotNil18(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef;
|
|
11641
11682
|
let leftIconToDisplay = leftIcon;
|
|
11642
|
-
if (
|
|
11683
|
+
if (isNil14(leftIcon) && type === "search") {
|
|
11643
11684
|
leftIconToDisplay = /* @__PURE__ */ jsx249(Icon, { type: "search" });
|
|
11644
11685
|
}
|
|
11645
11686
|
if (isNotNil18(leftIconToDisplay) && isValidElement2(leftIconToDisplay)) {
|
|
@@ -11670,7 +11711,6 @@ var Input = forwardRef15(
|
|
|
11670
11711
|
{
|
|
11671
11712
|
$fullWidth: fullWidth,
|
|
11672
11713
|
$monospace: monospace,
|
|
11673
|
-
className,
|
|
11674
11714
|
"data-wui-input-container": true,
|
|
11675
11715
|
children: [
|
|
11676
11716
|
leftIconToDisplay ?? null,
|
|
@@ -12388,12 +12428,12 @@ import {
|
|
|
12388
12428
|
} from "react";
|
|
12389
12429
|
import { matchSorter } from "match-sorter";
|
|
12390
12430
|
import styled50 from "styled-components";
|
|
12391
|
-
import { isArray as isArray2, isString as
|
|
12431
|
+
import { isArray as isArray2, isString as isString3 } from "@wistia/type-guards";
|
|
12392
12432
|
|
|
12393
12433
|
// src/components/Tag/Tag.tsx
|
|
12394
12434
|
import { forwardRef as forwardRef16 } from "react";
|
|
12395
12435
|
import styled49 from "styled-components";
|
|
12396
|
-
import { isNil as
|
|
12436
|
+
import { isNil as isNil15, isNotNil as isNotNil19, isNonEmptyString as isNonEmptyString5 } from "@wistia/type-guards";
|
|
12397
12437
|
import { Fragment as Fragment7, jsx as jsx255, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
12398
12438
|
var TagLabel = styled49.a`
|
|
12399
12439
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -12479,10 +12519,10 @@ var StyledTag = styled49.div`
|
|
|
12479
12519
|
}
|
|
12480
12520
|
`;
|
|
12481
12521
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
12482
|
-
if (
|
|
12522
|
+
if (isNil15(onClickRemove)) {
|
|
12483
12523
|
return null;
|
|
12484
12524
|
}
|
|
12485
|
-
if (
|
|
12525
|
+
if (isNil15(onClickRemoveLabel)) {
|
|
12486
12526
|
throw new Error(
|
|
12487
12527
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
12488
12528
|
);
|
|
@@ -12752,11 +12792,11 @@ var Combobox2 = ({
|
|
|
12752
12792
|
return () => null;
|
|
12753
12793
|
}, []);
|
|
12754
12794
|
const handleRemoveValue = (valueToRemove) => {
|
|
12755
|
-
if (
|
|
12795
|
+
if (isString3(value)) {
|
|
12756
12796
|
onChange("");
|
|
12757
12797
|
return;
|
|
12758
12798
|
}
|
|
12759
|
-
onChange(
|
|
12799
|
+
onChange(isString3(value) ? "" : value.filter((val) => val !== valueToRemove));
|
|
12760
12800
|
};
|
|
12761
12801
|
const matches = useMemo11(() => {
|
|
12762
12802
|
return matchSorter(Object.keys(options), searchValue);
|
|
@@ -12835,7 +12875,7 @@ var Combobox2 = ({
|
|
|
12835
12875
|
};
|
|
12836
12876
|
|
|
12837
12877
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
12838
|
-
import { isNil as
|
|
12878
|
+
import { isNil as isNil16, isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
12839
12879
|
import { useEffect as useEffect16, useState as useState17 } from "react";
|
|
12840
12880
|
|
|
12841
12881
|
// src/components/Menu/Menu.tsx
|
|
@@ -13523,7 +13563,7 @@ var ContextMenu = ({
|
|
|
13523
13563
|
const [isRightClicked, setIsRightClicked] = useState17(false);
|
|
13524
13564
|
const [menuPosition, setMenuPosition] = useState17(position ?? { x: 0, y: 0 });
|
|
13525
13565
|
useEffect16(() => {
|
|
13526
|
-
if (
|
|
13566
|
+
if (isNil16(position)) {
|
|
13527
13567
|
const onContextMenu = (event) => {
|
|
13528
13568
|
event.preventDefault();
|
|
13529
13569
|
setMenuPosition({ x: event.clientX, y: event.clientY });
|
|
@@ -13987,26 +14027,24 @@ import styled62, { css as css34 } from "styled-components";
|
|
|
13987
14027
|
import { useState as useState18, useRef as useRef16 } from "react";
|
|
13988
14028
|
import { Fragment as Fragment8, jsx as jsx276, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
13989
14029
|
var StyledInput = styled62(Input)`
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
}
|
|
14030
|
+
&:not([rows]) {
|
|
14031
|
+
min-height: unset;
|
|
14032
|
+
}
|
|
13994
14033
|
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14034
|
+
&& {
|
|
14035
|
+
${({ $variant }) => variantStyleMap[$variant]}
|
|
14036
|
+
/* The input font styles (edit mode) needs the same font styles as Heading */
|
|
14037
|
+
--wui-input-font-size: var(--font-size);
|
|
14038
|
+
--wui-input-font-weight: var(--font-weight);
|
|
14039
|
+
--wui-input-line-height: var(--line-height);
|
|
14001
14040
|
|
|
14002
|
-
|
|
14003
|
-
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
}
|
|
14041
|
+
font-family: var(--font-family);
|
|
14042
|
+
width: 100%;
|
|
14043
|
+
padding: var(--wui-space-02);
|
|
14044
|
+
border: none;
|
|
14045
|
+
height: ${({ $height }) => `${$height}px`};
|
|
14046
|
+
min-height: ${({ $height }) => `${$height}px`};
|
|
14047
|
+
resize: none;
|
|
14010
14048
|
}
|
|
14011
14049
|
`;
|
|
14012
14050
|
var editableStyles = css34`
|
|
@@ -15141,13 +15179,13 @@ import styled72, { css as css37 } from "styled-components";
|
|
|
15141
15179
|
|
|
15142
15180
|
// src/components/List/ListItem.tsx
|
|
15143
15181
|
import styled71 from "styled-components";
|
|
15144
|
-
import { isNil as
|
|
15182
|
+
import { isNil as isNil17 } from "@wistia/type-guards";
|
|
15145
15183
|
import { jsx as jsx289 } from "react/jsx-runtime";
|
|
15146
15184
|
var ListItemComponent = styled71.li`
|
|
15147
15185
|
margin-bottom: var(--wui-space-02);
|
|
15148
15186
|
`;
|
|
15149
15187
|
var ListItem = ({ children }) => {
|
|
15150
|
-
if (
|
|
15188
|
+
if (isNil17(children)) {
|
|
15151
15189
|
return null;
|
|
15152
15190
|
}
|
|
15153
15191
|
return /* @__PURE__ */ jsx289(ListItemComponent, { children });
|
|
@@ -16517,7 +16555,7 @@ ScrollArea.displayName = "ScrollArea_UI";
|
|
|
16517
16555
|
import { forwardRef as forwardRef32 } from "react";
|
|
16518
16556
|
import styled89, { css as css44 } from "styled-components";
|
|
16519
16557
|
import { Root as ToggleGroupRoot2 } from "@radix-ui/react-toggle-group";
|
|
16520
|
-
import { isNil as
|
|
16558
|
+
import { isNil as isNil18 } from "@wistia/type-guards";
|
|
16521
16559
|
|
|
16522
16560
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
16523
16561
|
import { createContext as createContext9, useContext as useContext15, useMemo as useMemo16, useState as useState24 } from "react";
|
|
@@ -16625,7 +16663,7 @@ var SegmentedControl = forwardRef32(
|
|
|
16625
16663
|
onSelectedValueChange,
|
|
16626
16664
|
...props
|
|
16627
16665
|
}, ref) => {
|
|
16628
|
-
if (
|
|
16666
|
+
if (isNil18(children)) {
|
|
16629
16667
|
return null;
|
|
16630
16668
|
}
|
|
16631
16669
|
return /* @__PURE__ */ jsx308(
|
|
@@ -17484,7 +17522,7 @@ ThumbnailBadge.displayName = "ThumbnailBadge_UI";
|
|
|
17484
17522
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17485
17523
|
import { forwardRef as forwardRef37, useState as useState26, useRef as useRef24, useCallback as useCallback20, useMemo as useMemo17 } from "react";
|
|
17486
17524
|
import styled106 from "styled-components";
|
|
17487
|
-
import { isNil as
|
|
17525
|
+
import { isNil as isNil19, isNotNil as isNotNil43, isUndefined as isUndefined7, isEmptyString as isEmptyString2, isString as isString4 } from "@wistia/type-guards";
|
|
17488
17526
|
|
|
17489
17527
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
17490
17528
|
import { isNotNil as isNotNil41 } from "@wistia/type-guards";
|
|
@@ -17789,7 +17827,7 @@ var StyledThumbnail = styled106.div`
|
|
|
17789
17827
|
background-image: ${({ $backgroundUrl }) => isNotNil43($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
17790
17828
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
17791
17829
|
// if we don't have $backgroundUrl show a gradient
|
|
17792
|
-
|
|
17830
|
+
isNil19($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
17793
17831
|
)};
|
|
17794
17832
|
background-position: center center;
|
|
17795
17833
|
background-size: cover;
|
|
@@ -17821,7 +17859,7 @@ var StoryboardRenderer = ({
|
|
|
17821
17859
|
frameCount,
|
|
17822
17860
|
aspectRatio
|
|
17823
17861
|
} = storyboard;
|
|
17824
|
-
const targetWidth =
|
|
17862
|
+
const targetWidth = isString4(width) ? parseInt(width, 10) : Number(width);
|
|
17825
17863
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
17826
17864
|
return /* @__PURE__ */ jsx325(
|
|
17827
17865
|
ThumbnailStoryboardViewer,
|
|
@@ -17898,7 +17936,7 @@ var Thumbnail = forwardRef37(
|
|
|
17898
17936
|
setCursorPosition(null);
|
|
17899
17937
|
}, [isScrubbable]);
|
|
17900
17938
|
const shouldRenderStoryboard = useMemo17(() => {
|
|
17901
|
-
if (
|
|
17939
|
+
if (isNil19(storyboard) || isUndefined7(height) || isEmptyString2(height)) {
|
|
17902
17940
|
return false;
|
|
17903
17941
|
}
|
|
17904
17942
|
return isScrubbable && isMouseOver && isStoryboardReady;
|