@wistia/ui 0.18.0-beta.d6f1661d.d5ef03f → 0.18.1-beta.341b7714.c1c1bd7

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.d6f1661d.d5ef03f
3
+ * @license @wistia/ui v0.18.1-beta.341b7714.c1c1bd7
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -307,11 +307,6 @@ var globalStyleAdjustmentsCss = import_styled_components.css`
307
307
  font-size: inherit;
308
308
  }
309
309
 
310
- /* Make sure textareas without a rows attribute are not tiny */
311
- textarea:not([rows]) {
312
- min-height: 10em;
313
- }
314
-
315
310
  /* Anything that has been anchored to should have extra scroll margin */
316
311
  &:target {
317
312
  scroll-margin-block: 5ex;
@@ -11774,11 +11769,13 @@ var inputStyles = import_styled_components62.css`
11774
11769
  }
11775
11770
  }
11776
11771
  `;
11772
+ var calculateTextareaHeight = (rows = 1) => `calc((var(--wui-input-line-height) * ${rows}) + (var(--wui-input-vertical-padding) * 2));`;
11777
11773
  var StyledInputContainer = import_styled_components62.styled.div`
11778
11774
  display: inline-flex;
11779
11775
  position: relative;
11780
11776
  ${inputStyles};
11781
11777
  width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
11778
+ height: ${({ $fullHeight, $isMultiline }) => $fullHeight && $isMultiline ? "100%" : "auto"};
11782
11779
 
11783
11780
  input,
11784
11781
  textarea {
@@ -11787,9 +11784,51 @@ var StyledInputContainer = import_styled_components62.styled.div`
11787
11784
  }
11788
11785
 
11789
11786
  textarea {
11787
+ --wui-input-line-height: var(--wui-typography-body-3-line-height);
11788
+
11790
11789
  border-radius: var(--wui-input-multiline-border-radius);
11790
+ height: ${({ $fullHeight }) => $fullHeight ? "100%" : "auto"};
11791
+
11792
+ /* override height calculations when fullHeight is enabled */
11793
+ ${({ $fullHeight }) => $fullHeight && `
11794
+ &[rows='1'],
11795
+ &[rows='2'],
11796
+ &[rows='3'],
11797
+ &[rows='4'],
11798
+ &[rows='5'],
11799
+ &:not([rows]) {
11800
+ height: 100%;
11801
+ resize: none;
11802
+ }
11803
+ `}
11791
11804
 
11792
- --wui-input-line-height: var(--wui-typography-body-3-line-height);
11805
+ /* height based on rows attribute (1-5) - only when fullHeight is not enabled */
11806
+ ${({ $fullHeight }) => !$fullHeight && `
11807
+ &[rows='1'] {
11808
+ height: ${calculateTextareaHeight(1)};
11809
+ }
11810
+
11811
+ &[rows='2'] {
11812
+ height: ${calculateTextareaHeight(2)};
11813
+ }
11814
+
11815
+ &[rows='3'] {
11816
+ height: ${calculateTextareaHeight(3)};
11817
+ }
11818
+
11819
+ &[rows='4'] {
11820
+ height: ${calculateTextareaHeight(4)};
11821
+ }
11822
+
11823
+ &[rows='5'] {
11824
+ height: ${calculateTextareaHeight(5)};
11825
+ }
11826
+
11827
+ /* make sure textareas without a rows attribute are not tiny */
11828
+ &:not([rows]) {
11829
+ height: ${calculateTextareaHeight(5)};
11830
+ }
11831
+ `}
11793
11832
  }
11794
11833
 
11795
11834
  [type='search'] {
@@ -11844,6 +11883,7 @@ var StyledInputContainer = import_styled_components62.styled.div`
11844
11883
  var Input = (0, import_react47.forwardRef)(
11845
11884
  ({
11846
11885
  fullWidth = true,
11886
+ fullHeight = false,
11847
11887
  monospace = false,
11848
11888
  type = "text",
11849
11889
  autoSelect = false,
@@ -11883,7 +11923,9 @@ var Input = (0, import_react47.forwardRef)(
11883
11923
  return /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
11884
11924
  StyledInputContainer,
11885
11925
  {
11926
+ $fullHeight: fullHeight,
11886
11927
  $fullWidth: fullWidth,
11928
+ $isMultiline: type === "multiline",
11887
11929
  $monospace: monospace,
11888
11930
  "data-wui-input-container": true,
11889
11931
  children: [
@@ -12586,7 +12628,7 @@ var SaturationAndValuePicker = ({
12586
12628
  SaturationAndValuePicker.displayName = "SaturationAndValuePicker_UI";
12587
12629
 
12588
12630
  // src/components/Combobox/Combobox.tsx
12589
- var Ariakit = __toESM(require("@ariakit/react"), 1);
12631
+ var Ariakit = __toESM(require("@ariakit/react"));
12590
12632
  var import_react54 = require("react");
12591
12633
  var import_match_sorter = require("match-sorter");
12592
12634
  var import_styled_components69 = require("styled-components");
@@ -14191,6 +14233,10 @@ var StyledInput = (0, import_styled_components81.styled)(Input)`
14191
14233
  min-height: unset;
14192
14234
  }
14193
14235
 
14236
+ &:focus {
14237
+ height: ${({ $height }) => `${$height}px !important`};
14238
+ }
14239
+
14194
14240
  && {
14195
14241
  ${({ $variant }) => variantStyleMap[$variant]}
14196
14242
  /* The input font styles (edit mode) needs the same font styles as Heading */
@@ -14990,6 +15036,7 @@ var FormField = ({
14990
15036
  id: computedId,
14991
15037
  label: isIntegratedLabel ? label : void 0,
14992
15038
  "aria-describedby": ariaDescribedby,
15039
+ "aria-invalid": (0, import_type_guards49.isNotNil)(computedError),
14993
15040
  ...props
14994
15041
  };
14995
15042
  if ((0, import_type_guards49.isUndefined)(value) && (0, import_type_guards49.isNotUndefined)(defaultValue)) {
@@ -15011,8 +15058,7 @@ var FormField = ({
15011
15058
  childProps = {
15012
15059
  ...childProps,
15013
15060
  name: computedName,
15014
- onChange: handleChange,
15015
- "aria-invalid": (0, import_type_guards49.isNotNil)(error)
15061
+ onChange: handleChange
15016
15062
  };
15017
15063
  }
15018
15064
  import_react73.Children.only(children);
@@ -17981,6 +18027,14 @@ var ThumbnailStoryboardViewer = ({
17981
18027
 
17982
18028
  // src/components/Thumbnail/Thumbnail.tsx
17983
18029
  var import_jsx_runtime327 = require("react/jsx-runtime");
18030
+ var WIDE_ASPECT_RATIO = 16 / 9;
18031
+ var SQUARE_ASPECT_RATIO = 1;
18032
+ var getAspectRatioValue = (aspectRatio) => {
18033
+ if (aspectRatio === "square") {
18034
+ return SQUARE_ASPECT_RATIO;
18035
+ }
18036
+ return WIDE_ASPECT_RATIO;
18037
+ };
17984
18038
  var WideThumbnailImage = import_styled_components126.styled.img`
17985
18039
  height: 100%;
17986
18040
  object-fit: cover;
@@ -18019,7 +18073,7 @@ var StyledThumbnail = import_styled_components126.styled.div`
18019
18073
  )};
18020
18074
  background-position: center center;
18021
18075
  background-size: cover;
18022
- aspect-ratio: 16 / 9;
18076
+ aspect-ratio: ${({ $aspectRatio }) => getAspectRatioValue($aspectRatio)};
18023
18077
  display: flex;
18024
18078
  overflow: hidden;
18025
18079
  position: relative;
@@ -18028,7 +18082,12 @@ var StyledThumbnail = import_styled_components126.styled.div`
18028
18082
 
18029
18083
  &,
18030
18084
  img {
18031
- border-radius: calc(8% * (9 / 16)) / 8%;
18085
+ border-radius: ${({ $aspectRatio }) => {
18086
+ if ($aspectRatio === "square") {
18087
+ return "8%";
18088
+ }
18089
+ return `calc(8% * (9 / 16)) / 8%`;
18090
+ }};
18032
18091
  }
18033
18092
  `;
18034
18093
  var StoryboardRenderer = ({
@@ -18036,17 +18095,10 @@ var StoryboardRenderer = ({
18036
18095
  width,
18037
18096
  percent,
18038
18097
  cursorPosition,
18039
- isStoryboardReady
18098
+ isStoryboardReady,
18099
+ aspectRatio
18040
18100
  }) => {
18041
- const {
18042
- url,
18043
- width: sbWidth,
18044
- height: sbHeight,
18045
- frameHeight,
18046
- frameWidth,
18047
- frameCount,
18048
- aspectRatio
18049
- } = storyboard;
18101
+ const { url, width: sbWidth, height: sbHeight, frameHeight, frameWidth, frameCount } = storyboard;
18050
18102
  const targetWidth = (0, import_type_guards74.isString)(width) ? parseInt(width, 10) : Number(width);
18051
18103
  const effectiveCursorPosition = isStoryboardReady ? cursorPosition : null;
18052
18104
  return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
@@ -18060,7 +18112,7 @@ var StoryboardRenderer = ({
18060
18112
  storyboardHeight: sbHeight,
18061
18113
  storyboardUrl: url,
18062
18114
  storyboardWidth: sbWidth,
18063
- targetAspectRatio: aspectRatio,
18115
+ targetAspectRatio: getAspectRatioValue(aspectRatio),
18064
18116
  targetWidth
18065
18117
  }
18066
18118
  );
@@ -18083,6 +18135,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
18083
18135
  children,
18084
18136
  storyboard,
18085
18137
  height,
18138
+ aspectRatio = "wide",
18086
18139
  ...props
18087
18140
  }, ref) => {
18088
18141
  const [percent, setPercent] = (0, import_react100.useState)(0);
@@ -18134,6 +18187,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
18134
18187
  thumbnailContent = /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
18135
18188
  StoryboardRenderer,
18136
18189
  {
18190
+ aspectRatio,
18137
18191
  cursorPosition,
18138
18192
  isStoryboardReady,
18139
18193
  percent,
@@ -18157,6 +18211,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
18157
18211
  {
18158
18212
  ref,
18159
18213
  ...props,
18214
+ $aspectRatio: aspectRatio,
18160
18215
  $backgroundUrl: backgroundUrl,
18161
18216
  $gradientBackground: gradientBackground,
18162
18217
  $isScrubbable: isScrubbable,
@@ -18176,7 +18231,7 @@ var Thumbnail = (0, import_react100.forwardRef)(
18176
18231
  Thumbnail.displayName = "Thumbnail_UI";
18177
18232
 
18178
18233
  // src/components/ThumbnailCollage/ThumbnailCollage.tsx
18179
- var import_react101 = __toESM(require("react"), 1);
18234
+ var import_react101 = __toESM(require("react"));
18180
18235
  var import_styled_components127 = require("styled-components");
18181
18236
  var import_type_guards75 = require("@wistia/type-guards");
18182
18237
  var import_jsx_runtime328 = (