@wistia/ui 0.18.0-beta.ce6c1712.725e361 → 0.18.0-beta.d5accfdd.0ddbbc0

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.ce6c1712.725e361
3
+ * @license @wistia/ui v0.18.0-beta.d5accfdd.0ddbbc0
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;
@@ -2992,26 +2987,11 @@ var useForceUpdate = () => {
2992
2987
  var import_react11 = require("react");
2993
2988
  var useIsHovered = () => {
2994
2989
  const [isHovered, setIsHovered] = (0, import_react11.useState)(false);
2995
- const onFocus = (event) => {
2996
- if (event.target !== event.currentTarget) return;
2997
- setIsHovered(true);
2998
- };
2999
- const onMouseEnter = (event) => {
3000
- if (event.target !== event.currentTarget) return;
3001
- setIsHovered(true);
3002
- };
3003
- const onMouseMove = (event) => {
3004
- if (event.target !== event.currentTarget) return;
3005
- setIsHovered(true);
3006
- };
3007
- const onBlur = (event) => {
3008
- if (event.target !== event.currentTarget) return;
3009
- setIsHovered(false);
3010
- };
3011
- const onMouseLeave = (event) => {
3012
- if (event.target !== event.currentTarget) return;
3013
- setIsHovered(false);
3014
- };
2990
+ const onFocus = () => setIsHovered(true);
2991
+ const onMouseEnter = () => setIsHovered(true);
2992
+ const onMouseMove = () => setIsHovered(true);
2993
+ const onBlur = () => setIsHovered(false);
2994
+ const onMouseLeave = () => setIsHovered(false);
3015
2995
  const hoverProps = {
3016
2996
  onFocus,
3017
2997
  onMouseEnter,
@@ -11789,6 +11769,7 @@ var inputStyles = import_styled_components62.css`
11789
11769
  }
11790
11770
  }
11791
11771
  `;
11772
+ var calculateTextareaHeight = (rows = 1) => `calc((var(--wui-input-line-height) * ${rows}) + (var(--wui-input-vertical-padding) * 2));`;
11792
11773
  var StyledInputContainer = import_styled_components62.styled.div`
11793
11774
  display: inline-flex;
11794
11775
  position: relative;
@@ -11802,9 +11783,35 @@ var StyledInputContainer = import_styled_components62.styled.div`
11802
11783
  }
11803
11784
 
11804
11785
  textarea {
11786
+ --wui-input-line-height: var(--wui-typography-body-3-line-height);
11787
+
11805
11788
  border-radius: var(--wui-input-multiline-border-radius);
11806
11789
 
11807
- --wui-input-line-height: var(--wui-typography-body-3-line-height);
11790
+ /* height based on rows attribute (1-5) */
11791
+ &[rows='1'] {
11792
+ height: ${calculateTextareaHeight(1)};
11793
+ }
11794
+
11795
+ &[rows='2'] {
11796
+ height: ${calculateTextareaHeight(2)};
11797
+ }
11798
+
11799
+ &[rows='3'] {
11800
+ height: ${calculateTextareaHeight(3)};
11801
+ }
11802
+
11803
+ &[rows='4'] {
11804
+ height: ${calculateTextareaHeight(4)};
11805
+ }
11806
+
11807
+ &[rows='5'] {
11808
+ height: ${calculateTextareaHeight(5)};
11809
+ }
11810
+
11811
+ /* make sure textareas without a rows attribute are not tiny */
11812
+ &:not([rows]) {
11813
+ height: ${calculateTextareaHeight(5)};
11814
+ }
11808
11815
  }
11809
11816
 
11810
11817
  [type='search'] {
@@ -14206,6 +14213,10 @@ var StyledInput = (0, import_styled_components81.styled)(Input)`
14206
14213
  min-height: unset;
14207
14214
  }
14208
14215
 
14216
+ &:focus {
14217
+ height: ${({ $height }) => `${$height}px !important`};
14218
+ }
14219
+
14209
14220
  && {
14210
14221
  ${({ $variant }) => variantStyleMap[$variant]}
14211
14222
  /* The input font styles (edit mode) needs the same font styles as Heading */
@@ -15005,6 +15016,7 @@ var FormField = ({
15005
15016
  id: computedId,
15006
15017
  label: isIntegratedLabel ? label : void 0,
15007
15018
  "aria-describedby": ariaDescribedby,
15019
+ "aria-invalid": (0, import_type_guards49.isNotNil)(computedError),
15008
15020
  ...props
15009
15021
  };
15010
15022
  if ((0, import_type_guards49.isUndefined)(value) && (0, import_type_guards49.isNotUndefined)(defaultValue)) {
@@ -15026,8 +15038,7 @@ var FormField = ({
15026
15038
  childProps = {
15027
15039
  ...childProps,
15028
15040
  name: computedName,
15029
- onChange: handleChange,
15030
- "aria-invalid": (0, import_type_guards49.isNotNil)(error)
15041
+ onChange: handleChange
15031
15042
  };
15032
15043
  }
15033
15044
  import_react73.Children.only(children);