@wistia/ui 0.18.4 → 0.18.5-beta.9ab561d6.6f99781

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
@@ -4138,7 +4138,7 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
4138
4138
  /**
4139
4139
  * The URL of the thumbnail image to display
4140
4140
  */
4141
- thumbnailUrl: string | null;
4141
+ thumbnailUrl: string | null | undefined;
4142
4142
  /**
4143
4143
  * Children to render inside the thumbnail; must be a `ThumbnailBadge` component
4144
4144
  */
@@ -4178,7 +4178,7 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
4178
4178
  /**
4179
4179
  * The URL of the thumbnail image to display
4180
4180
  */
4181
- thumbnailUrl: string | null;
4181
+ thumbnailUrl: string | null | undefined;
4182
4182
  /**
4183
4183
  * Children to render inside the thumbnail; must be a `ThumbnailBadge` component
4184
4184
  */
package/dist/index.d.ts CHANGED
@@ -4138,7 +4138,7 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
4138
4138
  /**
4139
4139
  * The URL of the thumbnail image to display
4140
4140
  */
4141
- thumbnailUrl: string | null;
4141
+ thumbnailUrl: string | null | undefined;
4142
4142
  /**
4143
4143
  * Children to render inside the thumbnail; must be a `ThumbnailBadge` component
4144
4144
  */
@@ -4178,7 +4178,7 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
4178
4178
  /**
4179
4179
  * The URL of the thumbnail image to display
4180
4180
  */
4181
- thumbnailUrl: string | null;
4181
+ thumbnailUrl: string | null | undefined;
4182
4182
  /**
4183
4183
  * Children to render inside the thumbnail; must be a `ThumbnailBadge` component
4184
4184
  */
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.18.4
3
+ * @license @wistia/ui v0.18.5-beta.9ab561d6.6f99781
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -17699,7 +17699,14 @@ ThumbnailBadge.displayName = "ThumbnailBadge_UI";
17699
17699
  // src/components/Thumbnail/Thumbnail.tsx
17700
17700
  import { forwardRef as forwardRef37, useState as useState26, useRef as useRef24, useCallback as useCallback20, useMemo as useMemo17 } from "react";
17701
17701
  import { styled as styled107 } from "styled-components";
17702
- import { isNil as isNil19, isNotNil as isNotNil43, isUndefined as isUndefined7, isEmptyString as isEmptyString2, isString as isString4 } from "@wistia/type-guards";
17702
+ import {
17703
+ isNil as isNil19,
17704
+ isNotNil as isNotNil43,
17705
+ isUndefined as isUndefined7,
17706
+ isEmptyString as isEmptyString2,
17707
+ isString as isString4,
17708
+ isNonEmptyString as isNonEmptyString10
17709
+ } from "@wistia/type-guards";
17703
17710
 
17704
17711
  // src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
17705
17712
  import { isNotNil as isNotNil41 } from "@wistia/type-guards";
@@ -18018,6 +18025,11 @@ var StyledThumbnailContainer = styled107.div`
18018
18025
  `;
18019
18026
  var StyledThumbnail = styled107.div`
18020
18027
  --wui-thumbnail-badge-offset: var(--wui-space-01);
18028
+ --wui-thumbnail-border-radius: clamp(
18029
+ var(--wui-border-radius-01),
18030
+ calc(8cqh - var(--wui-thumbnail-collage-padding, 0px)),
18031
+ var(--wui-border-radius-05)
18032
+ );
18021
18033
 
18022
18034
  background-image: ${({ $backgroundUrl }) => isNotNil43($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
18023
18035
  ${({ $backgroundUrl, $gradientBackground }) => (
@@ -18030,7 +18042,22 @@ var StyledThumbnail = styled107.div`
18030
18042
  width: 100%;
18031
18043
  overflow: hidden;
18032
18044
  position: relative;
18033
- border-radius: clamp(var(--wui-border-radius-01), 8cqh, var(--wui-border-radius-05));
18045
+ border-radius: var(--wui-thumbnail-border-radius);
18046
+ box-shadow: inset 0 0 0 1px var(--wui-thumbnail-collage-border-color);
18047
+
18048
+ &,
18049
+ img,
18050
+ &::after {
18051
+ border-radius: var(--wui-thumbnail-border-radius);
18052
+ }
18053
+
18054
+ &::after {
18055
+ content: '';
18056
+ position: absolute;
18057
+ inset: 0;
18058
+ box-shadow: inset 0 0 0 1px var(--wui-thumbnail-collage-border-color);
18059
+ border-radius: var(--wui-thumbnail-border-radius);
18060
+ }
18034
18061
 
18035
18062
  @container (min-width: 200px) {
18036
18063
  --wui-thumbnail-badge-offset: var(--wui-space-02);
@@ -18072,6 +18099,9 @@ var getRelativeMousePosition = (elem, mouseEvent) => {
18072
18099
  left: relativeLeft
18073
18100
  };
18074
18101
  };
18102
+ var hasValidThumbnailUrl = (thumbnailUrl) => {
18103
+ return isNotNil43(thumbnailUrl) && isNonEmptyString10(thumbnailUrl);
18104
+ };
18075
18105
  var Thumbnail = forwardRef37(
18076
18106
  ({
18077
18107
  gradientBackground = "defaultMidOne",
@@ -18090,7 +18120,7 @@ var Thumbnail = forwardRef37(
18090
18120
  const storyboardElementRef = useRef24(null);
18091
18121
  const [cursorPosition, setCursorPosition] = useState26(null);
18092
18122
  const backgroundUrl = useMemo17(
18093
- () => thumbnailImageType === "square" && isNotNil43(thumbnailUrl) ? thumbnailUrl : void 0,
18123
+ () => thumbnailImageType === "square" && hasValidThumbnailUrl(thumbnailUrl) ? thumbnailUrl : void 0,
18094
18124
  [thumbnailImageType, thumbnailUrl]
18095
18125
  );
18096
18126
  const isScrubbable = isNotNil43(storyboard);
@@ -18141,7 +18171,7 @@ var Thumbnail = forwardRef37(
18141
18171
  width
18142
18172
  }
18143
18173
  );
18144
- } else if (isNotNil43(thumbnailUrl)) {
18174
+ } else if (hasValidThumbnailUrl(thumbnailUrl)) {
18145
18175
  thumbnailContent = /* @__PURE__ */ jsx326(
18146
18176
  ThumbnailImage,
18147
18177
  {
@@ -18195,11 +18225,17 @@ var ThumbnailCollageContainer = styled108.div`
18195
18225
  display: flex;
18196
18226
  `;
18197
18227
  var StyledThumbnailCollage = styled108.div`
18228
+ --wui-thumbnail-collage-border-color: rgba(0, 0, 0, 0.05);
18229
+ --wui-thumbnail-collage-padding: var(--wui-space-01);
18230
+ padding: var(--wui-thumbnail-collage-padding);
18231
+ background-color: var(--wui-color-bg-surface-tertiary);
18232
+ border-radius: clamp(var(--wui-border-radius-01), 8cqh, var(--wui-border-radius-05));
18198
18233
  display: grid;
18199
- gap: var(--wui-space-01);
18234
+ gap: var(--wui-thumbnail-collage-padding);
18200
18235
  width: 100%;
18201
18236
  grid-template-columns: 3fr 2fr;
18202
18237
  grid-template-rows: 1fr 1fr;
18238
+ border: 1px solid var(--wui-thumbnail-collage-border-color);
18203
18239
 
18204
18240
  &:has(:nth-child(1)) {
18205
18241
  grid-template-areas:
@@ -18237,6 +18273,10 @@ var StyledThumbnailCollage = styled108.div`
18237
18273
  height: 100%;
18238
18274
  width: 100%;
18239
18275
  }
18276
+
18277
+ @container (min-width: 200px) {
18278
+ --wui-thumbnail-collage-padding: var(--wui-space-02);
18279
+ }
18240
18280
  `;
18241
18281
  var ThumbnailCollage = ({
18242
18282
  children = [],