@wistia/ui 0.18.0 → 0.18.1-beta.341b7714.c1c1bd7
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 +77 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +115 -94
- package/dist/index.d.ts +115 -94
- package/dist/index.mjs +77 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.18.
|
|
3
|
+
* @license @wistia/ui v0.18.1-beta.341b7714.c1c1bd7
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -118,11 +118,6 @@ var globalStyleAdjustmentsCss = css`
|
|
|
118
118
|
font-size: inherit;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
/* Make sure textareas without a rows attribute are not tiny */
|
|
122
|
-
textarea:not([rows]) {
|
|
123
|
-
min-height: 10em;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
121
|
/* Anything that has been anchored to should have extra scroll margin */
|
|
127
122
|
&:target {
|
|
128
123
|
scroll-margin-block: 5ex;
|
|
@@ -11600,11 +11595,13 @@ var inputStyles = css30`
|
|
|
11600
11595
|
}
|
|
11601
11596
|
}
|
|
11602
11597
|
`;
|
|
11598
|
+
var calculateTextareaHeight = (rows = 1) => `calc((var(--wui-input-line-height) * ${rows}) + (var(--wui-input-vertical-padding) * 2));`;
|
|
11603
11599
|
var StyledInputContainer = styled44.div`
|
|
11604
11600
|
display: inline-flex;
|
|
11605
11601
|
position: relative;
|
|
11606
11602
|
${inputStyles};
|
|
11607
11603
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
11604
|
+
height: ${({ $fullHeight, $isMultiline }) => $fullHeight && $isMultiline ? "100%" : "auto"};
|
|
11608
11605
|
|
|
11609
11606
|
input,
|
|
11610
11607
|
textarea {
|
|
@@ -11613,9 +11610,51 @@ var StyledInputContainer = styled44.div`
|
|
|
11613
11610
|
}
|
|
11614
11611
|
|
|
11615
11612
|
textarea {
|
|
11613
|
+
--wui-input-line-height: var(--wui-typography-body-3-line-height);
|
|
11614
|
+
|
|
11616
11615
|
border-radius: var(--wui-input-multiline-border-radius);
|
|
11616
|
+
height: ${({ $fullHeight }) => $fullHeight ? "100%" : "auto"};
|
|
11617
|
+
|
|
11618
|
+
/* override height calculations when fullHeight is enabled */
|
|
11619
|
+
${({ $fullHeight }) => $fullHeight && `
|
|
11620
|
+
&[rows='1'],
|
|
11621
|
+
&[rows='2'],
|
|
11622
|
+
&[rows='3'],
|
|
11623
|
+
&[rows='4'],
|
|
11624
|
+
&[rows='5'],
|
|
11625
|
+
&:not([rows]) {
|
|
11626
|
+
height: 100%;
|
|
11627
|
+
resize: none;
|
|
11628
|
+
}
|
|
11629
|
+
`}
|
|
11617
11630
|
|
|
11618
|
-
|
|
11631
|
+
/* height based on rows attribute (1-5) - only when fullHeight is not enabled */
|
|
11632
|
+
${({ $fullHeight }) => !$fullHeight && `
|
|
11633
|
+
&[rows='1'] {
|
|
11634
|
+
height: ${calculateTextareaHeight(1)};
|
|
11635
|
+
}
|
|
11636
|
+
|
|
11637
|
+
&[rows='2'] {
|
|
11638
|
+
height: ${calculateTextareaHeight(2)};
|
|
11639
|
+
}
|
|
11640
|
+
|
|
11641
|
+
&[rows='3'] {
|
|
11642
|
+
height: ${calculateTextareaHeight(3)};
|
|
11643
|
+
}
|
|
11644
|
+
|
|
11645
|
+
&[rows='4'] {
|
|
11646
|
+
height: ${calculateTextareaHeight(4)};
|
|
11647
|
+
}
|
|
11648
|
+
|
|
11649
|
+
&[rows='5'] {
|
|
11650
|
+
height: ${calculateTextareaHeight(5)};
|
|
11651
|
+
}
|
|
11652
|
+
|
|
11653
|
+
/* make sure textareas without a rows attribute are not tiny */
|
|
11654
|
+
&:not([rows]) {
|
|
11655
|
+
height: ${calculateTextareaHeight(5)};
|
|
11656
|
+
}
|
|
11657
|
+
`}
|
|
11619
11658
|
}
|
|
11620
11659
|
|
|
11621
11660
|
[type='search'] {
|
|
@@ -11670,6 +11709,7 @@ var StyledInputContainer = styled44.div`
|
|
|
11670
11709
|
var Input = forwardRef15(
|
|
11671
11710
|
({
|
|
11672
11711
|
fullWidth = true,
|
|
11712
|
+
fullHeight = false,
|
|
11673
11713
|
monospace = false,
|
|
11674
11714
|
type = "text",
|
|
11675
11715
|
autoSelect = false,
|
|
@@ -11709,7 +11749,9 @@ var Input = forwardRef15(
|
|
|
11709
11749
|
return /* @__PURE__ */ jsxs30(
|
|
11710
11750
|
StyledInputContainer,
|
|
11711
11751
|
{
|
|
11752
|
+
$fullHeight: fullHeight,
|
|
11712
11753
|
$fullWidth: fullWidth,
|
|
11754
|
+
$isMultiline: type === "multiline",
|
|
11713
11755
|
$monospace: monospace,
|
|
11714
11756
|
"data-wui-input-container": true,
|
|
11715
11757
|
children: [
|
|
@@ -14041,6 +14083,10 @@ var StyledInput = styled62(Input)`
|
|
|
14041
14083
|
min-height: unset;
|
|
14042
14084
|
}
|
|
14043
14085
|
|
|
14086
|
+
&:focus {
|
|
14087
|
+
height: ${({ $height }) => `${$height}px !important`};
|
|
14088
|
+
}
|
|
14089
|
+
|
|
14044
14090
|
&& {
|
|
14045
14091
|
${({ $variant }) => variantStyleMap[$variant]}
|
|
14046
14092
|
/* The input font styles (edit mode) needs the same font styles as Heading */
|
|
@@ -14840,6 +14886,7 @@ var FormField = ({
|
|
|
14840
14886
|
id: computedId,
|
|
14841
14887
|
label: isIntegratedLabel ? label : void 0,
|
|
14842
14888
|
"aria-describedby": ariaDescribedby,
|
|
14889
|
+
"aria-invalid": isNotNil28(computedError),
|
|
14843
14890
|
...props
|
|
14844
14891
|
};
|
|
14845
14892
|
if (isUndefined4(value) && isNotUndefined12(defaultValue)) {
|
|
@@ -14861,8 +14908,7 @@ var FormField = ({
|
|
|
14861
14908
|
childProps = {
|
|
14862
14909
|
...childProps,
|
|
14863
14910
|
name: computedName,
|
|
14864
|
-
onChange: handleChange
|
|
14865
|
-
"aria-invalid": isNotNil28(error)
|
|
14911
|
+
onChange: handleChange
|
|
14866
14912
|
};
|
|
14867
14913
|
}
|
|
14868
14914
|
Children10.only(children);
|
|
@@ -17845,6 +17891,14 @@ var ThumbnailStoryboardViewer = ({
|
|
|
17845
17891
|
|
|
17846
17892
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17847
17893
|
import { jsx as jsx325, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
17894
|
+
var WIDE_ASPECT_RATIO = 16 / 9;
|
|
17895
|
+
var SQUARE_ASPECT_RATIO = 1;
|
|
17896
|
+
var getAspectRatioValue = (aspectRatio) => {
|
|
17897
|
+
if (aspectRatio === "square") {
|
|
17898
|
+
return SQUARE_ASPECT_RATIO;
|
|
17899
|
+
}
|
|
17900
|
+
return WIDE_ASPECT_RATIO;
|
|
17901
|
+
};
|
|
17848
17902
|
var WideThumbnailImage = styled106.img`
|
|
17849
17903
|
height: 100%;
|
|
17850
17904
|
object-fit: cover;
|
|
@@ -17883,7 +17937,7 @@ var StyledThumbnail = styled106.div`
|
|
|
17883
17937
|
)};
|
|
17884
17938
|
background-position: center center;
|
|
17885
17939
|
background-size: cover;
|
|
17886
|
-
aspect-ratio:
|
|
17940
|
+
aspect-ratio: ${({ $aspectRatio }) => getAspectRatioValue($aspectRatio)};
|
|
17887
17941
|
display: flex;
|
|
17888
17942
|
overflow: hidden;
|
|
17889
17943
|
position: relative;
|
|
@@ -17892,7 +17946,12 @@ var StyledThumbnail = styled106.div`
|
|
|
17892
17946
|
|
|
17893
17947
|
&,
|
|
17894
17948
|
img {
|
|
17895
|
-
border-radius:
|
|
17949
|
+
border-radius: ${({ $aspectRatio }) => {
|
|
17950
|
+
if ($aspectRatio === "square") {
|
|
17951
|
+
return "8%";
|
|
17952
|
+
}
|
|
17953
|
+
return `calc(8% * (9 / 16)) / 8%`;
|
|
17954
|
+
}};
|
|
17896
17955
|
}
|
|
17897
17956
|
`;
|
|
17898
17957
|
var StoryboardRenderer = ({
|
|
@@ -17900,17 +17959,10 @@ var StoryboardRenderer = ({
|
|
|
17900
17959
|
width,
|
|
17901
17960
|
percent,
|
|
17902
17961
|
cursorPosition,
|
|
17903
|
-
isStoryboardReady
|
|
17962
|
+
isStoryboardReady,
|
|
17963
|
+
aspectRatio
|
|
17904
17964
|
}) => {
|
|
17905
|
-
const {
|
|
17906
|
-
url,
|
|
17907
|
-
width: sbWidth,
|
|
17908
|
-
height: sbHeight,
|
|
17909
|
-
frameHeight,
|
|
17910
|
-
frameWidth,
|
|
17911
|
-
frameCount,
|
|
17912
|
-
aspectRatio
|
|
17913
|
-
} = storyboard;
|
|
17965
|
+
const { url, width: sbWidth, height: sbHeight, frameHeight, frameWidth, frameCount } = storyboard;
|
|
17914
17966
|
const targetWidth = isString4(width) ? parseInt(width, 10) : Number(width);
|
|
17915
17967
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
17916
17968
|
return /* @__PURE__ */ jsx325(
|
|
@@ -17924,7 +17976,7 @@ var StoryboardRenderer = ({
|
|
|
17924
17976
|
storyboardHeight: sbHeight,
|
|
17925
17977
|
storyboardUrl: url,
|
|
17926
17978
|
storyboardWidth: sbWidth,
|
|
17927
|
-
targetAspectRatio: aspectRatio,
|
|
17979
|
+
targetAspectRatio: getAspectRatioValue(aspectRatio),
|
|
17928
17980
|
targetWidth
|
|
17929
17981
|
}
|
|
17930
17982
|
);
|
|
@@ -17947,6 +17999,7 @@ var Thumbnail = forwardRef37(
|
|
|
17947
17999
|
children,
|
|
17948
18000
|
storyboard,
|
|
17949
18001
|
height,
|
|
18002
|
+
aspectRatio = "wide",
|
|
17950
18003
|
...props
|
|
17951
18004
|
}, ref) => {
|
|
17952
18005
|
const [percent, setPercent] = useState26(0);
|
|
@@ -17998,6 +18051,7 @@ var Thumbnail = forwardRef37(
|
|
|
17998
18051
|
thumbnailContent = /* @__PURE__ */ jsx325(
|
|
17999
18052
|
StoryboardRenderer,
|
|
18000
18053
|
{
|
|
18054
|
+
aspectRatio,
|
|
18001
18055
|
cursorPosition,
|
|
18002
18056
|
isStoryboardReady,
|
|
18003
18057
|
percent,
|
|
@@ -18021,6 +18075,7 @@ var Thumbnail = forwardRef37(
|
|
|
18021
18075
|
{
|
|
18022
18076
|
ref,
|
|
18023
18077
|
...props,
|
|
18078
|
+
$aspectRatio: aspectRatio,
|
|
18024
18079
|
$backgroundUrl: backgroundUrl,
|
|
18025
18080
|
$gradientBackground: gradientBackground,
|
|
18026
18081
|
$isScrubbable: isScrubbable,
|