@wistia/ui 0.18.1 → 0.18.2-beta.055fa0b4.dbaa6cc
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 +58 -57
- 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 +58 -57
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4118,6 +4118,7 @@ declare const gradients: {
|
|
|
4118
4118
|
};
|
|
4119
4119
|
type GradientNameType = keyof typeof gradients;
|
|
4120
4120
|
|
|
4121
|
+
type AspectRatioType = 'square' | 'wide';
|
|
4121
4122
|
type Storyboard = {
|
|
4122
4123
|
__typename?: string;
|
|
4123
4124
|
aspectRatio: number;
|
|
@@ -4160,6 +4161,11 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
|
|
|
4160
4161
|
* Example: '180px'
|
|
4161
4162
|
*/
|
|
4162
4163
|
height?: string;
|
|
4164
|
+
/**
|
|
4165
|
+
* The aspect ratio of the thumbnail container.
|
|
4166
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4167
|
+
*/
|
|
4168
|
+
aspectRatio?: AspectRatioType;
|
|
4163
4169
|
};
|
|
4164
4170
|
/**
|
|
4165
4171
|
* A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
|
|
@@ -4195,6 +4201,11 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
|
|
|
4195
4201
|
* Example: '180px'
|
|
4196
4202
|
*/
|
|
4197
4203
|
height?: string;
|
|
4204
|
+
/**
|
|
4205
|
+
* The aspect ratio of the thumbnail container.
|
|
4206
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4207
|
+
*/
|
|
4208
|
+
aspectRatio?: AspectRatioType;
|
|
4198
4209
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
4199
4210
|
|
|
4200
4211
|
type ThumbnailCollageProps = {
|
package/dist/index.d.ts
CHANGED
|
@@ -4118,6 +4118,7 @@ declare const gradients: {
|
|
|
4118
4118
|
};
|
|
4119
4119
|
type GradientNameType = keyof typeof gradients;
|
|
4120
4120
|
|
|
4121
|
+
type AspectRatioType = 'square' | 'wide';
|
|
4121
4122
|
type Storyboard = {
|
|
4122
4123
|
__typename?: string;
|
|
4123
4124
|
aspectRatio: number;
|
|
@@ -4160,6 +4161,11 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
|
|
|
4160
4161
|
* Example: '180px'
|
|
4161
4162
|
*/
|
|
4162
4163
|
height?: string;
|
|
4164
|
+
/**
|
|
4165
|
+
* The aspect ratio of the thumbnail container.
|
|
4166
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4167
|
+
*/
|
|
4168
|
+
aspectRatio?: AspectRatioType;
|
|
4163
4169
|
};
|
|
4164
4170
|
/**
|
|
4165
4171
|
* A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
|
|
@@ -4195,6 +4201,11 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
|
|
|
4195
4201
|
* Example: '180px'
|
|
4196
4202
|
*/
|
|
4197
4203
|
height?: string;
|
|
4204
|
+
/**
|
|
4205
|
+
* The aspect ratio of the thumbnail container.
|
|
4206
|
+
* 'wide' maps to 16:9 ratio, 'square' maps to 1:1 ratio.
|
|
4207
|
+
*/
|
|
4208
|
+
aspectRatio?: AspectRatioType;
|
|
4198
4209
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
4199
4210
|
|
|
4200
4211
|
type ThumbnailCollageProps = {
|
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.2-beta.055fa0b4.dbaa6cc
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -17588,7 +17588,7 @@ var StyledThumbnailBadge = styled104.div`
|
|
|
17588
17588
|
align-items: center;
|
|
17589
17589
|
background-color: rgb(0 0 0 / 50%);
|
|
17590
17590
|
border-radius: var(--wui-border-radius-01);
|
|
17591
|
-
bottom: var(--wui-
|
|
17591
|
+
bottom: var(--wui-thumbnail-badge-offset);
|
|
17592
17592
|
color: var(--wui-color-text-on-fill);
|
|
17593
17593
|
display: flex;
|
|
17594
17594
|
font-size: var(--wui-typography-body-4-size);
|
|
@@ -17596,7 +17596,7 @@ var StyledThumbnailBadge = styled104.div`
|
|
|
17596
17596
|
gap: var(--wui-space-01);
|
|
17597
17597
|
padding: 0 var(--wui-space-01);
|
|
17598
17598
|
position: absolute;
|
|
17599
|
-
right: var(--wui-
|
|
17599
|
+
right: var(--wui-thumbnail-badge-offset);
|
|
17600
17600
|
z-index: 1;
|
|
17601
17601
|
|
|
17602
17602
|
svg {
|
|
@@ -17891,6 +17891,14 @@ var ThumbnailStoryboardViewer = ({
|
|
|
17891
17891
|
|
|
17892
17892
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
17893
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
|
+
};
|
|
17894
17902
|
var WideThumbnailImage = styled106.img`
|
|
17895
17903
|
height: 100%;
|
|
17896
17904
|
object-fit: cover;
|
|
@@ -17921,7 +17929,17 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
|
|
|
17921
17929
|
}
|
|
17922
17930
|
);
|
|
17923
17931
|
};
|
|
17932
|
+
var StyledThumbnailContainer = styled106.div`
|
|
17933
|
+
container-type: size;
|
|
17934
|
+
aspect-ratio: ${({ $aspectRatio }) => getAspectRatioValue($aspectRatio)};
|
|
17935
|
+
width: ${({ $width }) => $width};
|
|
17936
|
+
display: flex;
|
|
17937
|
+
overflow: hidden;
|
|
17938
|
+
${({ $isScrubbable }) => $isScrubbable && "cursor: pointer;"}
|
|
17939
|
+
`;
|
|
17924
17940
|
var StyledThumbnail = styled106.div`
|
|
17941
|
+
--wui-thumbnail-badge-offset: var(--wui-space-01);
|
|
17942
|
+
|
|
17925
17943
|
background-image: ${({ $backgroundUrl }) => isNotNil43($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
17926
17944
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
17927
17945
|
// if we don't have $backgroundUrl show a gradient
|
|
@@ -17929,16 +17947,14 @@ var StyledThumbnail = styled106.div`
|
|
|
17929
17947
|
)};
|
|
17930
17948
|
background-position: center center;
|
|
17931
17949
|
background-size: cover;
|
|
17932
|
-
aspect-ratio: 16 / 9;
|
|
17933
17950
|
display: flex;
|
|
17951
|
+
width: 100%;
|
|
17934
17952
|
overflow: hidden;
|
|
17935
17953
|
position: relative;
|
|
17936
|
-
|
|
17937
|
-
${({ $isScrubbable }) => $isScrubbable && "cursor: pointer;"}
|
|
17954
|
+
border-radius: clamp(var(--wui-border-radius-01), 8cqh, var(--wui-border-radius-05));
|
|
17938
17955
|
|
|
17939
|
-
|
|
17940
|
-
|
|
17941
|
-
border-radius: calc(8% * (9 / 16)) / 8%;
|
|
17956
|
+
@container (min-width: 200px) {
|
|
17957
|
+
--wui-thumbnail-badge-offset: var(--wui-space-02);
|
|
17942
17958
|
}
|
|
17943
17959
|
`;
|
|
17944
17960
|
var StoryboardRenderer = ({
|
|
@@ -17946,17 +17962,10 @@ var StoryboardRenderer = ({
|
|
|
17946
17962
|
width,
|
|
17947
17963
|
percent,
|
|
17948
17964
|
cursorPosition,
|
|
17949
|
-
isStoryboardReady
|
|
17965
|
+
isStoryboardReady,
|
|
17966
|
+
aspectRatio
|
|
17950
17967
|
}) => {
|
|
17951
|
-
const {
|
|
17952
|
-
url,
|
|
17953
|
-
width: sbWidth,
|
|
17954
|
-
height: sbHeight,
|
|
17955
|
-
frameHeight,
|
|
17956
|
-
frameWidth,
|
|
17957
|
-
frameCount,
|
|
17958
|
-
aspectRatio
|
|
17959
|
-
} = storyboard;
|
|
17968
|
+
const { url, width: sbWidth, height: sbHeight, frameHeight, frameWidth, frameCount } = storyboard;
|
|
17960
17969
|
const targetWidth = isString4(width) ? parseInt(width, 10) : Number(width);
|
|
17961
17970
|
const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
|
|
17962
17971
|
return /* @__PURE__ */ jsx325(
|
|
@@ -17970,7 +17979,7 @@ var StoryboardRenderer = ({
|
|
|
17970
17979
|
storyboardHeight: sbHeight,
|
|
17971
17980
|
storyboardUrl: url,
|
|
17972
17981
|
storyboardWidth: sbWidth,
|
|
17973
|
-
targetAspectRatio: aspectRatio,
|
|
17982
|
+
targetAspectRatio: getAspectRatioValue(aspectRatio),
|
|
17974
17983
|
targetWidth
|
|
17975
17984
|
}
|
|
17976
17985
|
);
|
|
@@ -17993,6 +18002,7 @@ var Thumbnail = forwardRef37(
|
|
|
17993
18002
|
children,
|
|
17994
18003
|
storyboard,
|
|
17995
18004
|
height,
|
|
18005
|
+
aspectRatio = "wide",
|
|
17996
18006
|
...props
|
|
17997
18007
|
}, ref) => {
|
|
17998
18008
|
const [percent, setPercent] = useState26(0);
|
|
@@ -18044,6 +18054,7 @@ var Thumbnail = forwardRef37(
|
|
|
18044
18054
|
thumbnailContent = /* @__PURE__ */ jsx325(
|
|
18045
18055
|
StoryboardRenderer,
|
|
18046
18056
|
{
|
|
18057
|
+
aspectRatio,
|
|
18047
18058
|
cursorPosition,
|
|
18048
18059
|
isStoryboardReady,
|
|
18049
18060
|
percent,
|
|
@@ -18062,23 +18073,31 @@ var Thumbnail = forwardRef37(
|
|
|
18062
18073
|
} else {
|
|
18063
18074
|
thumbnailContent = null;
|
|
18064
18075
|
}
|
|
18065
|
-
return /* @__PURE__ */
|
|
18066
|
-
|
|
18076
|
+
return /* @__PURE__ */ jsx325(
|
|
18077
|
+
StyledThumbnailContainer,
|
|
18067
18078
|
{
|
|
18068
18079
|
ref,
|
|
18069
|
-
|
|
18070
|
-
$backgroundUrl: backgroundUrl,
|
|
18071
|
-
$gradientBackground: gradientBackground,
|
|
18080
|
+
$aspectRatio: aspectRatio,
|
|
18072
18081
|
$isScrubbable: isScrubbable,
|
|
18073
18082
|
$width: width,
|
|
18083
|
+
"data-wui-thumbnail-container": true,
|
|
18074
18084
|
onBlur: handleMouseOut,
|
|
18075
18085
|
onMouseMove: handleMouseMove,
|
|
18076
18086
|
onMouseOut: handleMouseOut,
|
|
18077
18087
|
role: "presentation",
|
|
18078
|
-
|
|
18079
|
-
|
|
18080
|
-
|
|
18081
|
-
|
|
18088
|
+
...props,
|
|
18089
|
+
children: /* @__PURE__ */ jsxs69(
|
|
18090
|
+
StyledThumbnail,
|
|
18091
|
+
{
|
|
18092
|
+
$backgroundUrl: backgroundUrl,
|
|
18093
|
+
$gradientBackground: gradientBackground,
|
|
18094
|
+
"data-testid": "thumbnail-inner",
|
|
18095
|
+
children: [
|
|
18096
|
+
isNotNil43(children) ? children : null,
|
|
18097
|
+
thumbnailContent
|
|
18098
|
+
]
|
|
18099
|
+
}
|
|
18100
|
+
)
|
|
18082
18101
|
}
|
|
18083
18102
|
);
|
|
18084
18103
|
}
|
|
@@ -18090,72 +18109,54 @@ import React5 from "react";
|
|
|
18090
18109
|
import { styled as styled107 } from "styled-components";
|
|
18091
18110
|
import { isNonEmptyArray } from "@wistia/type-guards";
|
|
18092
18111
|
import { jsx as jsx326 } from "react/jsx-runtime";
|
|
18112
|
+
var ThumbnailCollageContainer = styled107.div`
|
|
18113
|
+
container-type: size;
|
|
18114
|
+
width: 100%;
|
|
18115
|
+
aspect-ratio: 16 / 9;
|
|
18116
|
+
display: flex;
|
|
18117
|
+
`;
|
|
18093
18118
|
var StyledThumbnailCollage = styled107.div`
|
|
18094
18119
|
display: grid;
|
|
18095
18120
|
gap: var(--wui-space-01);
|
|
18096
18121
|
width: 100%;
|
|
18097
18122
|
grid-template-columns: 3fr 2fr;
|
|
18098
18123
|
grid-template-rows: 1fr 1fr;
|
|
18099
|
-
aspect-ratio: 16 / 9;
|
|
18100
18124
|
|
|
18101
18125
|
&:has(:nth-child(1)) {
|
|
18102
|
-
--wui-collage-thumbnail-first-border-radius: calc(8% * (9 / 16)) / 8%;
|
|
18103
|
-
|
|
18104
18126
|
grid-template-areas:
|
|
18105
18127
|
'a a'
|
|
18106
18128
|
'a a';
|
|
18107
18129
|
}
|
|
18108
18130
|
|
|
18109
18131
|
&:has(:nth-child(2)) {
|
|
18110
|
-
--wui-collage-thumbnail-first-border-radius: 7.5% / 8%;
|
|
18111
|
-
--wui-collage-thumbnail-second-border-radius: 11.5% / 8%;
|
|
18112
|
-
|
|
18113
18132
|
grid-template-areas:
|
|
18114
18133
|
'a b'
|
|
18115
18134
|
'a b';
|
|
18116
18135
|
}
|
|
18117
18136
|
|
|
18118
18137
|
&:has(:nth-child(3)) {
|
|
18119
|
-
--wui-collage-thumbnail-first-border-radius: 7.5% / 8%;
|
|
18120
|
-
--wui-collage-thumbnail-second-border-radius: 11.5% / 16%;
|
|
18121
|
-
--wui-collage-thumbnail-third-border-radius: 11.5% / 16%;
|
|
18122
|
-
|
|
18123
18138
|
grid-template-areas:
|
|
18124
18139
|
'a b'
|
|
18125
18140
|
'a c';
|
|
18126
18141
|
}
|
|
18127
18142
|
|
|
18128
18143
|
> :nth-child(1) {
|
|
18129
|
-
--wui-collage-thumbnail-border-radius: var(--wui-collage-thumbnail-first-border-radius);
|
|
18130
|
-
|
|
18131
18144
|
grid-area: a;
|
|
18132
18145
|
}
|
|
18133
18146
|
|
|
18134
18147
|
> :nth-child(2) {
|
|
18135
|
-
--wui-collage-thumbnail-border-radius: var(--wui-collage-thumbnail-second-border-radius);
|
|
18136
|
-
|
|
18137
18148
|
grid-area: b;
|
|
18138
18149
|
}
|
|
18139
18150
|
|
|
18140
18151
|
> :nth-child(3) {
|
|
18141
|
-
--wui-collage-thumbnail-border-radius: var(--wui-collage-thumbnail-third-border-radius);
|
|
18142
|
-
|
|
18143
18152
|
grid-area: c;
|
|
18144
18153
|
}
|
|
18145
18154
|
|
|
18146
|
-
|
|
18155
|
+
[data-thumbnail-container] {
|
|
18156
|
+
container-type: unset;
|
|
18147
18157
|
aspect-ratio: unset;
|
|
18148
18158
|
height: 100%;
|
|
18149
18159
|
width: 100%;
|
|
18150
|
-
border-radius: var(--wui-collage-thumbnail-border-radius);
|
|
18151
|
-
|
|
18152
|
-
img {
|
|
18153
|
-
border-radius: var(--wui-collage-thumbnail-border-radius);
|
|
18154
|
-
}
|
|
18155
|
-
|
|
18156
|
-
> :not(img) {
|
|
18157
|
-
display: none;
|
|
18158
|
-
}
|
|
18159
18160
|
}
|
|
18160
18161
|
`;
|
|
18161
18162
|
var ThumbnailCollage = ({
|
|
@@ -18181,7 +18182,7 @@ var ThumbnailCollage = ({
|
|
|
18181
18182
|
"fallback"
|
|
18182
18183
|
)
|
|
18183
18184
|
];
|
|
18184
|
-
return /* @__PURE__ */ jsx326(
|
|
18185
|
+
return /* @__PURE__ */ jsx326(ThumbnailCollageContainer, { children: /* @__PURE__ */ jsx326(
|
|
18185
18186
|
StyledThumbnailCollage,
|
|
18186
18187
|
{
|
|
18187
18188
|
$gradientBackground: gradientBackground,
|
|
@@ -18189,7 +18190,7 @@ var ThumbnailCollage = ({
|
|
|
18189
18190
|
...props,
|
|
18190
18191
|
children: thumbnails
|
|
18191
18192
|
}
|
|
18192
|
-
);
|
|
18193
|
+
) });
|
|
18193
18194
|
};
|
|
18194
18195
|
|
|
18195
18196
|
// src/components/WistiaLogo/WistiaLogo.tsx
|