@wistia/ui 0.18.0-beta.3a151a03.96acbe5 → 0.18.0-beta.44b5200e.b8bb378

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.d.mts CHANGED
@@ -4108,7 +4108,6 @@ declare const gradients: {
4108
4108
  };
4109
4109
  type GradientNameType = keyof typeof gradients;
4110
4110
 
4111
- type AspectRatioType = 'square' | 'wide';
4112
4111
  type Storyboard = {
4113
4112
  __typename?: string;
4114
4113
  aspectRatio: number;
@@ -4151,11 +4150,6 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
4151
4150
  * Example: '180px'
4152
4151
  */
4153
4152
  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;
4159
4153
  };
4160
4154
  /**
4161
4155
  * A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
@@ -4191,11 +4185,6 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
4191
4185
  * Example: '180px'
4192
4186
  */
4193
4187
  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;
4199
4188
  } & react.RefAttributes<HTMLDivElement>>;
4200
4189
 
4201
4190
  type ThumbnailCollageProps = {
package/dist/index.d.ts CHANGED
@@ -4108,7 +4108,6 @@ declare const gradients: {
4108
4108
  };
4109
4109
  type GradientNameType = keyof typeof gradients;
4110
4110
 
4111
- type AspectRatioType = 'square' | 'wide';
4112
4111
  type Storyboard = {
4113
4112
  __typename?: string;
4114
4113
  aspectRatio: number;
@@ -4151,11 +4150,6 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
4151
4150
  * Example: '180px'
4152
4151
  */
4153
4152
  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;
4159
4153
  };
4160
4154
  /**
4161
4155
  * A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
@@ -4191,11 +4185,6 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
4191
4185
  * Example: '180px'
4192
4186
  */
4193
4187
  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;
4199
4188
  } & react.RefAttributes<HTMLDivElement>>;
4200
4189
 
4201
4190
  type ThumbnailCollageProps = {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.18.0-beta.3a151a03.96acbe5
3
+ * @license @wistia/ui v0.18.0-beta.44b5200e.b8bb378
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -17542,7 +17542,7 @@ var StyledThumbnailBadge = styled104.div`
17542
17542
  align-items: center;
17543
17543
  background-color: rgb(0 0 0 / 50%);
17544
17544
  border-radius: var(--wui-border-radius-01);
17545
- bottom: var(--wui-space-01);
17545
+ bottom: var(--wui-thumbnail-badge-offset);
17546
17546
  color: var(--wui-color-text-on-fill);
17547
17547
  display: flex;
17548
17548
  font-size: var(--wui-typography-body-4-size);
@@ -17550,7 +17550,7 @@ var StyledThumbnailBadge = styled104.div`
17550
17550
  gap: var(--wui-space-01);
17551
17551
  padding: 0 var(--wui-space-01);
17552
17552
  position: absolute;
17553
- right: var(--wui-space-01);
17553
+ right: var(--wui-thumbnail-badge-offset);
17554
17554
  z-index: 1;
17555
17555
 
17556
17556
  svg {
@@ -17845,14 +17845,6 @@ var ThumbnailStoryboardViewer = ({
17845
17845
 
17846
17846
  // src/components/Thumbnail/Thumbnail.tsx
17847
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
17848
  var WideThumbnailImage = styled106.img`
17857
17849
  height: 100%;
17858
17850
  object-fit: cover;
@@ -17883,7 +17875,15 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
17883
17875
  }
17884
17876
  );
17885
17877
  };
17878
+ var StyledThumbnailContainer = styled106.div`
17879
+ container-type: inline-size;
17880
+ aspect-ratio: 16 / 9;
17881
+ width: ${({ $width }) => $width};
17882
+ display: flex;
17883
+ `;
17886
17884
  var StyledThumbnail = styled106.div`
17885
+ --wui-thumbnail-badge-offset: var(--wui-space-01);
17886
+
17887
17887
  background-image: ${({ $backgroundUrl }) => isNotNil43($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
17888
17888
  ${({ $backgroundUrl, $gradientBackground }) => (
17889
17889
  // if we don't have $backgroundUrl show a gradient
@@ -17891,19 +17891,35 @@ var StyledThumbnail = styled106.div`
17891
17891
  )};
17892
17892
  background-position: center center;
17893
17893
  background-size: cover;
17894
- aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};
17895
- display: flex;
17894
+ width: 100%;
17895
+ aspect-ratio: 16 / 9;
17896
17896
  overflow: hidden;
17897
17897
  position: relative;
17898
- width: ${({ $width }) => $width};
17898
+ display: flex;
17899
+
17899
17900
  ${({ $isScrubbable }) => $isScrubbable && "cursor: pointer;"}
17900
17901
 
17901
17902
  &,
17902
17903
  img {
17903
- border-radius: ${({ $aspectRatio }) => {
17904
- const heightPercentage = 8 / $aspectRatio;
17905
- return `calc(8% * (1 / ${$aspectRatio})) / ${heightPercentage}%`;
17906
- }};
17904
+ border-radius: var(--wui-border-radius-02);
17905
+ }
17906
+
17907
+ @container (min-width: 200px) {
17908
+ &,
17909
+ img {
17910
+ border-radius: var(--wui-border-radius-03);
17911
+ }
17912
+
17913
+ --wui-thumbnail-badge-offset: var(--wui-space-02);
17914
+ }
17915
+
17916
+ @container (min-width: 400px) {
17917
+ &,
17918
+ img {
17919
+ border-radius: var(--wui-border-radius-05);
17920
+ }
17921
+
17922
+ --wui-thumbnail-badge-offset: var(--wui-space-03);
17907
17923
  }
17908
17924
  `;
17909
17925
  var StoryboardRenderer = ({
@@ -17911,10 +17927,17 @@ var StoryboardRenderer = ({
17911
17927
  width,
17912
17928
  percent,
17913
17929
  cursorPosition,
17914
- isStoryboardReady,
17915
- aspectRatio
17930
+ isStoryboardReady
17916
17931
  }) => {
17917
- const { url, width: sbWidth, height: sbHeight, frameHeight, frameWidth, frameCount } = storyboard;
17932
+ const {
17933
+ url,
17934
+ width: sbWidth,
17935
+ height: sbHeight,
17936
+ frameHeight,
17937
+ frameWidth,
17938
+ frameCount,
17939
+ aspectRatio
17940
+ } = storyboard;
17918
17941
  const targetWidth = isString4(width) ? parseInt(width, 10) : Number(width);
17919
17942
  const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
17920
17943
  return /* @__PURE__ */ jsx325(
@@ -17928,7 +17951,7 @@ var StoryboardRenderer = ({
17928
17951
  storyboardHeight: sbHeight,
17929
17952
  storyboardUrl: url,
17930
17953
  storyboardWidth: sbWidth,
17931
- targetAspectRatio: getAspectRatioValue(aspectRatio),
17954
+ targetAspectRatio: aspectRatio,
17932
17955
  targetWidth
17933
17956
  }
17934
17957
  );
@@ -17951,7 +17974,6 @@ var Thumbnail = forwardRef37(
17951
17974
  children,
17952
17975
  storyboard,
17953
17976
  height,
17954
- aspectRatio = "wide",
17955
17977
  ...props
17956
17978
  }, ref) => {
17957
17979
  const [percent, setPercent] = useState26(0);
@@ -18003,7 +18025,6 @@ var Thumbnail = forwardRef37(
18003
18025
  thumbnailContent = /* @__PURE__ */ jsx325(
18004
18026
  StoryboardRenderer,
18005
18027
  {
18006
- aspectRatio,
18007
18028
  cursorPosition,
18008
18029
  isStoryboardReady,
18009
18030
  percent,
@@ -18022,12 +18043,11 @@ var Thumbnail = forwardRef37(
18022
18043
  } else {
18023
18044
  thumbnailContent = null;
18024
18045
  }
18025
- return /* @__PURE__ */ jsxs69(
18046
+ return /* @__PURE__ */ jsx325(StyledThumbnailContainer, { $width: width, children: /* @__PURE__ */ jsxs69(
18026
18047
  StyledThumbnail,
18027
18048
  {
18028
18049
  ref,
18029
18050
  ...props,
18030
- $aspectRatio: getAspectRatioValue(aspectRatio),
18031
18051
  $backgroundUrl: backgroundUrl,
18032
18052
  $gradientBackground: gradientBackground,
18033
18053
  $isScrubbable: isScrubbable,
@@ -18041,7 +18061,7 @@ var Thumbnail = forwardRef37(
18041
18061
  thumbnailContent
18042
18062
  ]
18043
18063
  }
18044
- );
18064
+ ) });
18045
18065
  }
18046
18066
  );
18047
18067
  Thumbnail.displayName = "Thumbnail_UI";