@wistia/ui 0.18.0-beta.1338688d.84af1a8 → 0.18.0-beta.3a151a03.96acbe5
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 +21 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.mjs +21 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4108,6 +4108,7 @@ declare const gradients: {
|
|
|
4108
4108
|
};
|
|
4109
4109
|
type GradientNameType = keyof typeof gradients;
|
|
4110
4110
|
|
|
4111
|
+
type AspectRatioType = 'square' | 'wide';
|
|
4111
4112
|
type Storyboard = {
|
|
4112
4113
|
__typename?: string;
|
|
4113
4114
|
aspectRatio: number;
|
|
@@ -4150,6 +4151,11 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
|
|
|
4150
4151
|
* Example: '180px'
|
|
4151
4152
|
*/
|
|
4152
4153
|
height?: string;
|
|
4154
|
+
/**
|
|
4155
|
+
* The aspect ratio of the thumbnail container.
|
|
4156
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4157
|
+
*/
|
|
4158
|
+
aspectRatio?: AspectRatioType;
|
|
4153
4159
|
};
|
|
4154
4160
|
/**
|
|
4155
4161
|
* A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
|
|
@@ -4185,6 +4191,11 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
|
|
|
4185
4191
|
* Example: '180px'
|
|
4186
4192
|
*/
|
|
4187
4193
|
height?: string;
|
|
4194
|
+
/**
|
|
4195
|
+
* The aspect ratio of the thumbnail container.
|
|
4196
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4197
|
+
*/
|
|
4198
|
+
aspectRatio?: AspectRatioType;
|
|
4188
4199
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
4189
4200
|
|
|
4190
4201
|
type ThumbnailCollageProps = {
|
package/dist/index.d.ts
CHANGED
|
@@ -4108,6 +4108,7 @@ declare const gradients: {
|
|
|
4108
4108
|
};
|
|
4109
4109
|
type GradientNameType = keyof typeof gradients;
|
|
4110
4110
|
|
|
4111
|
+
type AspectRatioType = 'square' | 'wide';
|
|
4111
4112
|
type Storyboard = {
|
|
4112
4113
|
__typename?: string;
|
|
4113
4114
|
aspectRatio: number;
|
|
@@ -4150,6 +4151,11 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
|
|
|
4150
4151
|
* Example: '180px'
|
|
4151
4152
|
*/
|
|
4152
4153
|
height?: string;
|
|
4154
|
+
/**
|
|
4155
|
+
* The aspect ratio of the thumbnail container.
|
|
4156
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4157
|
+
*/
|
|
4158
|
+
aspectRatio?: AspectRatioType;
|
|
4153
4159
|
};
|
|
4154
4160
|
/**
|
|
4155
4161
|
* A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
|
|
@@ -4185,6 +4191,11 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
|
|
|
4185
4191
|
* Example: '180px'
|
|
4186
4192
|
*/
|
|
4187
4193
|
height?: string;
|
|
4194
|
+
/**
|
|
4195
|
+
* The aspect ratio of the thumbnail container.
|
|
4196
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4197
|
+
*/
|
|
4198
|
+
aspectRatio?: AspectRatioType;
|
|
4188
4199
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
4189
4200
|
|
|
4190
4201
|
type ThumbnailCollageProps = {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.18.0-beta.
|
|
3
|
+
* @license @wistia/ui v0.18.0-beta.3a151a03.96acbe5
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -47,7 +47,6 @@ var globalStyleAdjustmentsCss = css`
|
|
|
47
47
|
* 1. Without this fonts are too heavy weight in OS X Firefox
|
|
48
48
|
* 2. Design decision
|
|
49
49
|
3. See: https://allthingssmitty.com/2020/05/11/css-fix-for-100vh-in-mobile-webkit/
|
|
50
|
-
4. Default font settings that all elements should get unless overridden
|
|
51
50
|
*/
|
|
52
51
|
body {
|
|
53
52
|
-moz-osx-font-smoothing: grayscale; /* 1 */
|
|
@@ -55,13 +54,6 @@ var globalStyleAdjustmentsCss = css`
|
|
|
55
54
|
line-height: 1.5; /* 2 */
|
|
56
55
|
min-height: 100vh; /* 3 */
|
|
57
56
|
min-height: -webkit-fill-available; /* 3 */
|
|
58
|
-
color: var(--wui-color-text-high-contrast); /* 4 */
|
|
59
|
-
font-family: var(--wui-typography-body-2-family); /* 4 */
|
|
60
|
-
font-size: var(--wui-typography-body-2-size); /* 4 */
|
|
61
|
-
font-weight: var(--wui-typography-body-2-weight); /* 4 */
|
|
62
|
-
|
|
63
|
-
/* line-height: var(--wui-typography-body-2-line-height); */
|
|
64
|
-
margin: 0; /* 2 */
|
|
65
57
|
}
|
|
66
58
|
|
|
67
59
|
/* Remove default margin in favour of better control in authored CSS */
|
|
@@ -17853,6 +17845,14 @@ var ThumbnailStoryboardViewer = ({
|
|
|
17853
17845
|
|
|
17854
17846
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17855
17847
|
import { jsx as jsx325, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
17848
|
+
var WIDE_ASPECT_RATIO = 16 / 9;
|
|
17849
|
+
var SQUARE_ASPECT_RATIO = 1;
|
|
17850
|
+
var getAspectRatioValue = (aspectRatio) => {
|
|
17851
|
+
if (aspectRatio === "square") {
|
|
17852
|
+
return SQUARE_ASPECT_RATIO;
|
|
17853
|
+
}
|
|
17854
|
+
return WIDE_ASPECT_RATIO;
|
|
17855
|
+
};
|
|
17856
17856
|
var WideThumbnailImage = styled106.img`
|
|
17857
17857
|
height: 100%;
|
|
17858
17858
|
object-fit: cover;
|
|
@@ -17891,7 +17891,7 @@ var StyledThumbnail = styled106.div`
|
|
|
17891
17891
|
)};
|
|
17892
17892
|
background-position: center center;
|
|
17893
17893
|
background-size: cover;
|
|
17894
|
-
aspect-ratio:
|
|
17894
|
+
aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};
|
|
17895
17895
|
display: flex;
|
|
17896
17896
|
overflow: hidden;
|
|
17897
17897
|
position: relative;
|
|
@@ -17900,7 +17900,10 @@ var StyledThumbnail = styled106.div`
|
|
|
17900
17900
|
|
|
17901
17901
|
&,
|
|
17902
17902
|
img {
|
|
17903
|
-
border-radius:
|
|
17903
|
+
border-radius: ${({ $aspectRatio }) => {
|
|
17904
|
+
const heightPercentage = 8 / $aspectRatio;
|
|
17905
|
+
return `calc(8% * (1 / ${$aspectRatio})) / ${heightPercentage}%`;
|
|
17906
|
+
}};
|
|
17904
17907
|
}
|
|
17905
17908
|
`;
|
|
17906
17909
|
var StoryboardRenderer = ({
|
|
@@ -17908,17 +17911,10 @@ var StoryboardRenderer = ({
|
|
|
17908
17911
|
width,
|
|
17909
17912
|
percent,
|
|
17910
17913
|
cursorPosition,
|
|
17911
|
-
isStoryboardReady
|
|
17914
|
+
isStoryboardReady,
|
|
17915
|
+
aspectRatio
|
|
17912
17916
|
}) => {
|
|
17913
|
-
const {
|
|
17914
|
-
url,
|
|
17915
|
-
width: sbWidth,
|
|
17916
|
-
height: sbHeight,
|
|
17917
|
-
frameHeight,
|
|
17918
|
-
frameWidth,
|
|
17919
|
-
frameCount,
|
|
17920
|
-
aspectRatio
|
|
17921
|
-
} = storyboard;
|
|
17917
|
+
const { url, width: sbWidth, height: sbHeight, frameHeight, frameWidth, frameCount } = storyboard;
|
|
17922
17918
|
const targetWidth = isString4(width) ? parseInt(width, 10) : Number(width);
|
|
17923
17919
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
17924
17920
|
return /* @__PURE__ */ jsx325(
|
|
@@ -17932,7 +17928,7 @@ var StoryboardRenderer = ({
|
|
|
17932
17928
|
storyboardHeight: sbHeight,
|
|
17933
17929
|
storyboardUrl: url,
|
|
17934
17930
|
storyboardWidth: sbWidth,
|
|
17935
|
-
targetAspectRatio: aspectRatio,
|
|
17931
|
+
targetAspectRatio: getAspectRatioValue(aspectRatio),
|
|
17936
17932
|
targetWidth
|
|
17937
17933
|
}
|
|
17938
17934
|
);
|
|
@@ -17955,6 +17951,7 @@ var Thumbnail = forwardRef37(
|
|
|
17955
17951
|
children,
|
|
17956
17952
|
storyboard,
|
|
17957
17953
|
height,
|
|
17954
|
+
aspectRatio = "wide",
|
|
17958
17955
|
...props
|
|
17959
17956
|
}, ref) => {
|
|
17960
17957
|
const [percent, setPercent] = useState26(0);
|
|
@@ -18006,6 +18003,7 @@ var Thumbnail = forwardRef37(
|
|
|
18006
18003
|
thumbnailContent = /* @__PURE__ */ jsx325(
|
|
18007
18004
|
StoryboardRenderer,
|
|
18008
18005
|
{
|
|
18006
|
+
aspectRatio,
|
|
18009
18007
|
cursorPosition,
|
|
18010
18008
|
isStoryboardReady,
|
|
18011
18009
|
percent,
|
|
@@ -18029,6 +18027,7 @@ var Thumbnail = forwardRef37(
|
|
|
18029
18027
|
{
|
|
18030
18028
|
ref,
|
|
18031
18029
|
...props,
|
|
18030
|
+
$aspectRatio: getAspectRatioValue(aspectRatio),
|
|
18032
18031
|
$backgroundUrl: backgroundUrl,
|
|
18033
18032
|
$gradientBackground: gradientBackground,
|
|
18034
18033
|
$isScrubbable: isScrubbable,
|