@wistia/ui 0.18.0-beta.9dd31b7e.fa98d59 → 0.18.0-beta.bf141d35.57288dc

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,6 +4108,7 @@ declare const gradients: {
4108
4108
  };
4109
4109
  type GradientNameType = keyof typeof gradients;
4110
4110
 
4111
+ type AspectRatioType = 'square' | 'wide';
4111
4112
  type Storyboard = {
4112
4113
  __typename?: string;
4113
4114
  aspectRatio: number;
@@ -4150,6 +4151,11 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
4150
4151
  * Example: '180px'
4151
4152
  */
4152
4153
  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;
4153
4159
  };
4154
4160
  /**
4155
4161
  * A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
@@ -4185,6 +4191,11 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
4185
4191
  * Example: '180px'
4186
4192
  */
4187
4193
  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;
4188
4199
  } & react.RefAttributes<HTMLDivElement>>;
4189
4200
 
4190
4201
  type ThumbnailCollageProps = {
package/dist/index.d.ts CHANGED
@@ -4108,6 +4108,7 @@ declare const gradients: {
4108
4108
  };
4109
4109
  type GradientNameType = keyof typeof gradients;
4110
4110
 
4111
+ type AspectRatioType = 'square' | 'wide';
4111
4112
  type Storyboard = {
4112
4113
  __typename?: string;
4113
4114
  aspectRatio: number;
@@ -4150,6 +4151,11 @@ type ThumbnailProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> & {
4150
4151
  * Example: '180px'
4151
4152
  */
4152
4153
  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;
4153
4159
  };
4154
4160
  /**
4155
4161
  * A `Thumbnail` is a small, reduced-size version of an image or video used as a preview or representative image.
@@ -4185,6 +4191,11 @@ declare const Thumbnail: react.ForwardRefExoticComponent<Omit<Omit<react.Detaile
4185
4191
  * Example: '180px'
4186
4192
  */
4187
4193
  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;
4188
4199
  } & react.RefAttributes<HTMLDivElement>>;
4189
4200
 
4190
4201
  type ThumbnailCollageProps = {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.18.0-beta.9dd31b7e.fa98d59
3
+ * @license @wistia/ui v0.18.0-beta.bf141d35.57288dc
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -14840,7 +14840,6 @@ var FormField = ({
14840
14840
  id: computedId,
14841
14841
  label: isIntegratedLabel ? label : void 0,
14842
14842
  "aria-describedby": ariaDescribedby,
14843
- "aria-invalid": isNotNil28(computedError),
14844
14843
  ...props
14845
14844
  };
14846
14845
  if (isUndefined4(value) && isNotUndefined12(defaultValue)) {
@@ -14862,7 +14861,8 @@ var FormField = ({
14862
14861
  childProps = {
14863
14862
  ...childProps,
14864
14863
  name: computedName,
14865
- onChange: handleChange
14864
+ onChange: handleChange,
14865
+ "aria-invalid": isNotNil28(error)
14866
14866
  };
14867
14867
  }
14868
14868
  Children10.only(children);
@@ -17845,6 +17845,14 @@ 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
+ };
17848
17856
  var WideThumbnailImage = styled106.img`
17849
17857
  height: 100%;
17850
17858
  object-fit: cover;
@@ -17883,7 +17891,7 @@ var StyledThumbnail = styled106.div`
17883
17891
  )};
17884
17892
  background-position: center center;
17885
17893
  background-size: cover;
17886
- aspect-ratio: 16 / 9;
17894
+ aspect-ratio: ${({ $aspectRatio }) => getAspectRatioValue($aspectRatio)};
17887
17895
  display: flex;
17888
17896
  overflow: hidden;
17889
17897
  position: relative;
@@ -17892,7 +17900,12 @@ var StyledThumbnail = styled106.div`
17892
17900
 
17893
17901
  &,
17894
17902
  img {
17895
- border-radius: calc(8% * (9 / 16)) / 8%;
17903
+ border-radius: ${({ $aspectRatio }) => {
17904
+ if ($aspectRatio === "square") {
17905
+ return "8%";
17906
+ }
17907
+ return `calc(8% * (9 / 16)) / 8%`;
17908
+ }};
17896
17909
  }
17897
17910
  `;
17898
17911
  var StoryboardRenderer = ({
@@ -17900,17 +17913,10 @@ var StoryboardRenderer = ({
17900
17913
  width,
17901
17914
  percent,
17902
17915
  cursorPosition,
17903
- isStoryboardReady
17916
+ isStoryboardReady,
17917
+ aspectRatio
17904
17918
  }) => {
17905
- const {
17906
- url,
17907
- width: sbWidth,
17908
- height: sbHeight,
17909
- frameHeight,
17910
- frameWidth,
17911
- frameCount,
17912
- aspectRatio
17913
- } = storyboard;
17919
+ const { url, width: sbWidth, height: sbHeight, frameHeight, frameWidth, frameCount } = storyboard;
17914
17920
  const targetWidth = isString4(width) ? parseInt(width, 10) : Number(width);
17915
17921
  const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
17916
17922
  return /* @__PURE__ */ jsx325(
@@ -17924,7 +17930,7 @@ var StoryboardRenderer = ({
17924
17930
  storyboardHeight: sbHeight,
17925
17931
  storyboardUrl: url,
17926
17932
  storyboardWidth: sbWidth,
17927
- targetAspectRatio: aspectRatio,
17933
+ targetAspectRatio: getAspectRatioValue(aspectRatio),
17928
17934
  targetWidth
17929
17935
  }
17930
17936
  );
@@ -17947,6 +17953,7 @@ var Thumbnail = forwardRef37(
17947
17953
  children,
17948
17954
  storyboard,
17949
17955
  height,
17956
+ aspectRatio = "wide",
17950
17957
  ...props
17951
17958
  }, ref) => {
17952
17959
  const [percent, setPercent] = useState26(0);
@@ -17998,6 +18005,7 @@ var Thumbnail = forwardRef37(
17998
18005
  thumbnailContent = /* @__PURE__ */ jsx325(
17999
18006
  StoryboardRenderer,
18000
18007
  {
18008
+ aspectRatio,
18001
18009
  cursorPosition,
18002
18010
  isStoryboardReady,
18003
18011
  percent,
@@ -18021,6 +18029,7 @@ var Thumbnail = forwardRef37(
18021
18029
  {
18022
18030
  ref,
18023
18031
  ...props,
18032
+ $aspectRatio: aspectRatio,
18024
18033
  $backgroundUrl: backgroundUrl,
18025
18034
  $gradientBackground: gradientBackground,
18026
18035
  $isScrubbable: isScrubbable,