@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.cjs 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
  *
@@ -17678,7 +17678,7 @@ var StyledThumbnailBadge = import_styled_components123.styled.div`
17678
17678
  align-items: center;
17679
17679
  background-color: rgb(0 0 0 / 50%);
17680
17680
  border-radius: var(--wui-border-radius-01);
17681
- bottom: var(--wui-space-01);
17681
+ bottom: var(--wui-thumbnail-badge-offset);
17682
17682
  color: var(--wui-color-text-on-fill);
17683
17683
  display: flex;
17684
17684
  font-size: var(--wui-typography-body-4-size);
@@ -17686,7 +17686,7 @@ var StyledThumbnailBadge = import_styled_components123.styled.div`
17686
17686
  gap: var(--wui-space-01);
17687
17687
  padding: 0 var(--wui-space-01);
17688
17688
  position: absolute;
17689
- right: var(--wui-space-01);
17689
+ right: var(--wui-thumbnail-badge-offset);
17690
17690
  z-index: 1;
17691
17691
 
17692
17692
  svg {
@@ -17981,14 +17981,6 @@ var ThumbnailStoryboardViewer = ({
17981
17981
 
17982
17982
  // src/components/Thumbnail/Thumbnail.tsx
17983
17983
  var import_jsx_runtime327 = require("react/jsx-runtime");
17984
- var WIDE_ASPECT_RATIO = 16 / 9;
17985
- var SQUARE_ASPECT_RATIO = 1;
17986
- var getAspectRatioValue = (aspectRatio) => {
17987
- if (aspectRatio === "square") {
17988
- return SQUARE_ASPECT_RATIO;
17989
- }
17990
- return WIDE_ASPECT_RATIO;
17991
- };
17992
17984
  var WideThumbnailImage = import_styled_components126.styled.img`
17993
17985
  height: 100%;
17994
17986
  object-fit: cover;
@@ -18019,7 +18011,15 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
18019
18011
  }
18020
18012
  );
18021
18013
  };
18014
+ var StyledThumbnailContainer = import_styled_components126.styled.div`
18015
+ container-type: inline-size;
18016
+ aspect-ratio: 16 / 9;
18017
+ width: ${({ $width }) => $width};
18018
+ display: flex;
18019
+ `;
18022
18020
  var StyledThumbnail = import_styled_components126.styled.div`
18021
+ --wui-thumbnail-badge-offset: var(--wui-space-01);
18022
+
18023
18023
  background-image: ${({ $backgroundUrl }) => (0, import_type_guards74.isNotNil)($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
18024
18024
  ${({ $backgroundUrl, $gradientBackground }) => (
18025
18025
  // if we don't have $backgroundUrl show a gradient
@@ -18027,19 +18027,35 @@ var StyledThumbnail = import_styled_components126.styled.div`
18027
18027
  )};
18028
18028
  background-position: center center;
18029
18029
  background-size: cover;
18030
- aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};
18031
- display: flex;
18030
+ width: 100%;
18031
+ aspect-ratio: 16 / 9;
18032
18032
  overflow: hidden;
18033
18033
  position: relative;
18034
- width: ${({ $width }) => $width};
18034
+ display: flex;
18035
+
18035
18036
  ${({ $isScrubbable }) => $isScrubbable && "cursor: pointer;"}
18036
18037
 
18037
18038
  &,
18038
18039
  img {
18039
- border-radius: ${({ $aspectRatio }) => {
18040
- const heightPercentage = 8 / $aspectRatio;
18041
- return `calc(8% * (1 / ${$aspectRatio})) / ${heightPercentage}%`;
18042
- }};
18040
+ border-radius: var(--wui-border-radius-02);
18041
+ }
18042
+
18043
+ @container (min-width: 200px) {
18044
+ &,
18045
+ img {
18046
+ border-radius: var(--wui-border-radius-03);
18047
+ }
18048
+
18049
+ --wui-thumbnail-badge-offset: var(--wui-space-02);
18050
+ }
18051
+
18052
+ @container (min-width: 400px) {
18053
+ &,
18054
+ img {
18055
+ border-radius: var(--wui-border-radius-05);
18056
+ }
18057
+
18058
+ --wui-thumbnail-badge-offset: var(--wui-space-03);
18043
18059
  }
18044
18060
  `;
18045
18061
  var StoryboardRenderer = ({
@@ -18047,10 +18063,17 @@ var StoryboardRenderer = ({
18047
18063
  width,
18048
18064
  percent,
18049
18065
  cursorPosition,
18050
- isStoryboardReady,
18051
- aspectRatio
18066
+ isStoryboardReady
18052
18067
  }) => {
18053
- const { url, width: sbWidth, height: sbHeight, frameHeight, frameWidth, frameCount } = storyboard;
18068
+ const {
18069
+ url,
18070
+ width: sbWidth,
18071
+ height: sbHeight,
18072
+ frameHeight,
18073
+ frameWidth,
18074
+ frameCount,
18075
+ aspectRatio
18076
+ } = storyboard;
18054
18077
  const targetWidth = (0, import_type_guards74.isString)(width) ? parseInt(width, 10) : Number(width);
18055
18078
  const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
18056
18079
  return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
@@ -18064,7 +18087,7 @@ var StoryboardRenderer = ({
18064
18087
  storyboardHeight: sbHeight,
18065
18088
  storyboardUrl: url,
18066
18089
  storyboardWidth: sbWidth,
18067
- targetAspectRatio: getAspectRatioValue(aspectRatio),
18090
+ targetAspectRatio: aspectRatio,
18068
18091
  targetWidth
18069
18092
  }
18070
18093
  );
@@ -18087,7 +18110,6 @@ var Thumbnail = (0, import_react100.forwardRef)(
18087
18110
  children,
18088
18111
  storyboard,
18089
18112
  height,
18090
- aspectRatio = "wide",
18091
18113
  ...props
18092
18114
  }, ref) => {
18093
18115
  const [percent, setPercent] = (0, import_react100.useState)(0);
@@ -18139,7 +18161,6 @@ var Thumbnail = (0, import_react100.forwardRef)(
18139
18161
  thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
18140
18162
  StoryboardRenderer,
18141
18163
  {
18142
- aspectRatio,
18143
18164
  cursorPosition,
18144
18165
  isStoryboardReady,
18145
18166
  percent,
@@ -18158,12 +18179,11 @@ var Thumbnail = (0, import_react100.forwardRef)(
18158
18179
  } else {
18159
18180
  thumbnailContent = null;
18160
18181
  }
18161
- return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(
18182
+ return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(StyledThumbnailContainer, { $width: width, children: /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(
18162
18183
  StyledThumbnail,
18163
18184
  {
18164
18185
  ref,
18165
18186
  ...props,
18166
- $aspectRatio: getAspectRatioValue(aspectRatio),
18167
18187
  $backgroundUrl: backgroundUrl,
18168
18188
  $gradientBackground: gradientBackground,
18169
18189
  $isScrubbable: isScrubbable,
@@ -18177,7 +18197,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
18177
18197
  thumbnailContent
18178
18198
  ]
18179
18199
  }
18180
- );
18200
+ ) });
18181
18201
  }
18182
18202
  );
18183
18203
  Thumbnail.displayName = "Thumbnail_UI";