@wistia/ui 0.18.1-beta.341b7714.c1c1bd7 → 0.18.2-beta.4003271.cf839cf

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.18.1-beta.341b7714.c1c1bd7
3
+ * @license @wistia/ui v0.18.2-beta.4003271.cf839cf
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-space-01);
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-space-01);
17599
+ right: var(--wui-thumbnail-badge-offset);
17600
17600
  z-index: 1;
17601
17601
 
17602
17602
  svg {
@@ -17929,7 +17929,15 @@ var ThumbnailImage = ({ thumbnailImageType, thumbnailUrl }) => {
17929
17929
  }
17930
17930
  );
17931
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
+ `;
17932
17939
  var StyledThumbnail = styled106.div`
17940
+ --wui-thumbnail-badge-offset: var(--wui-space-01);
17933
17941
  background-image: ${({ $backgroundUrl }) => isNotNil43($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
17934
17942
  ${({ $backgroundUrl, $gradientBackground }) => (
17935
17943
  // if we don't have $backgroundUrl show a gradient
@@ -17937,22 +17945,19 @@ var StyledThumbnail = styled106.div`
17937
17945
  )};
17938
17946
  background-position: center center;
17939
17947
  background-size: cover;
17940
- aspect-ratio: ${({ $aspectRatio }) => getAspectRatioValue($aspectRatio)};
17948
+
17941
17949
  display: flex;
17950
+ width: 100%;
17942
17951
  overflow: hidden;
17943
17952
  position: relative;
17944
- width: ${({ $width }) => $width};
17945
- ${({ $isScrubbable }) => $isScrubbable && "cursor: pointer;"}
17953
+ display: flex;
17954
+ border-radius: clamp(var(--wui-border-radius-01), 8cqh, var(--wui-border-radius-05));
17946
17955
 
17947
- &,
17948
- img {
17949
- border-radius: ${({ $aspectRatio }) => {
17950
- if ($aspectRatio === "square") {
17951
- return "8%";
17952
- }
17953
- return `calc(8% * (9 / 16)) / 8%`;
17954
- }};
17956
+ @container (min-width: 200px) {
17957
+ --wui-thumbnail-badge-offset: var(--wui-space-02);
17955
17958
  }
17959
+
17960
+ ${({ $isScrubbable }) => $isScrubbable && "cursor: pointer;"}
17956
17961
  `;
17957
17962
  var StoryboardRenderer = ({
17958
17963
  storyboard,
@@ -18070,24 +18075,30 @@ var Thumbnail = forwardRef37(
18070
18075
  } else {
18071
18076
  thumbnailContent = null;
18072
18077
  }
18073
- return /* @__PURE__ */ jsxs69(
18074
- StyledThumbnail,
18078
+ return /* @__PURE__ */ jsx325(
18079
+ StyledThumbnailContainer,
18075
18080
  {
18076
18081
  ref,
18077
- ...props,
18078
18082
  $aspectRatio: aspectRatio,
18079
- $backgroundUrl: backgroundUrl,
18080
- $gradientBackground: gradientBackground,
18081
- $isScrubbable: isScrubbable,
18082
18083
  $width: width,
18083
- onBlur: handleMouseOut,
18084
- onMouseMove: handleMouseMove,
18085
- onMouseOut: handleMouseOut,
18086
- role: "presentation",
18087
- children: [
18088
- isNotNil43(children) ? children : null,
18089
- thumbnailContent
18090
- ]
18084
+ "data-thumbnail-container": true,
18085
+ ...props,
18086
+ children: /* @__PURE__ */ jsxs69(
18087
+ StyledThumbnail,
18088
+ {
18089
+ $backgroundUrl: backgroundUrl,
18090
+ $gradientBackground: gradientBackground,
18091
+ $isScrubbable: isScrubbable,
18092
+ onBlur: handleMouseOut,
18093
+ onMouseMove: handleMouseMove,
18094
+ onMouseOut: handleMouseOut,
18095
+ role: "presentation",
18096
+ children: [
18097
+ isNotNil43(children) ? children : null,
18098
+ thumbnailContent
18099
+ ]
18100
+ }
18101
+ )
18091
18102
  }
18092
18103
  );
18093
18104
  }
@@ -18099,72 +18110,55 @@ import React5 from "react";
18099
18110
  import { styled as styled107 } from "styled-components";
18100
18111
  import { isNonEmptyArray } from "@wistia/type-guards";
18101
18112
  import { jsx as jsx326 } from "react/jsx-runtime";
18113
+ var ThumbnailCollageContainer = styled107.div`
18114
+ container-type: size;
18115
+ width: 100%;
18116
+ aspect-ratio: 16 / 9;
18117
+ display: flex;
18118
+ `;
18102
18119
  var StyledThumbnailCollage = styled107.div`
18103
18120
  display: grid;
18104
18121
  gap: var(--wui-space-01);
18105
18122
  width: 100%;
18106
18123
  grid-template-columns: 3fr 2fr;
18107
18124
  grid-template-rows: 1fr 1fr;
18108
- aspect-ratio: 16 / 9;
18109
18125
 
18110
18126
  &:has(:nth-child(1)) {
18111
- --wui-collage-thumbnail-first-border-radius: calc(8% * (9 / 16)) / 8%;
18112
-
18113
18127
  grid-template-areas:
18114
18128
  'a a'
18115
18129
  'a a';
18116
18130
  }
18117
18131
 
18118
18132
  &:has(:nth-child(2)) {
18119
- --wui-collage-thumbnail-first-border-radius: 7.5% / 8%;
18120
- --wui-collage-thumbnail-second-border-radius: 11.5% / 8%;
18121
-
18122
18133
  grid-template-areas:
18123
18134
  'a b'
18124
18135
  'a b';
18125
18136
  }
18126
18137
 
18127
18138
  &:has(:nth-child(3)) {
18128
- --wui-collage-thumbnail-first-border-radius: 7.5% / 8%;
18129
- --wui-collage-thumbnail-second-border-radius: 11.5% / 16%;
18130
- --wui-collage-thumbnail-third-border-radius: 11.5% / 16%;
18131
-
18132
18139
  grid-template-areas:
18133
18140
  'a b'
18134
18141
  'a c';
18135
18142
  }
18136
18143
 
18137
18144
  > :nth-child(1) {
18138
- --wui-collage-thumbnail-border-radius: var(--wui-collage-thumbnail-first-border-radius);
18139
-
18140
18145
  grid-area: a;
18141
18146
  }
18142
18147
 
18143
18148
  > :nth-child(2) {
18144
- --wui-collage-thumbnail-border-radius: var(--wui-collage-thumbnail-second-border-radius);
18145
-
18146
18149
  grid-area: b;
18147
18150
  }
18148
18151
 
18149
18152
  > :nth-child(3) {
18150
- --wui-collage-thumbnail-border-radius: var(--wui-collage-thumbnail-third-border-radius);
18151
-
18152
18153
  grid-area: c;
18153
18154
  }
18154
18155
 
18155
- > * {
18156
+ [data-thumbnail-container] {
18157
+ //allows for the border radius to be based off the collage's dimensions
18158
+ container-type: unset;
18156
18159
  aspect-ratio: unset;
18157
18160
  height: 100%;
18158
18161
  width: 100%;
18159
- border-radius: var(--wui-collage-thumbnail-border-radius);
18160
-
18161
- img {
18162
- border-radius: var(--wui-collage-thumbnail-border-radius);
18163
- }
18164
-
18165
- > :not(img) {
18166
- display: none;
18167
- }
18168
18162
  }
18169
18163
  `;
18170
18164
  var ThumbnailCollage = ({
@@ -18190,7 +18184,7 @@ var ThumbnailCollage = ({
18190
18184
  "fallback"
18191
18185
  )
18192
18186
  ];
18193
- return /* @__PURE__ */ jsx326(
18187
+ return /* @__PURE__ */ jsx326(ThumbnailCollageContainer, { children: /* @__PURE__ */ jsx326(
18194
18188
  StyledThumbnailCollage,
18195
18189
  {
18196
18190
  $gradientBackground: gradientBackground,
@@ -18198,7 +18192,7 @@ var ThumbnailCollage = ({
18198
18192
  ...props,
18199
18193
  children: thumbnails
18200
18194
  }
18201
- );
18195
+ ) });
18202
18196
  };
18203
18197
 
18204
18198
  // src/components/WistiaLogo/WistiaLogo.tsx