@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.mjs 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
  *
@@ -118,11 +118,6 @@ var globalStyleAdjustmentsCss = css`
118
118
  font-size: inherit;
119
119
  }
120
120
 
121
- /* Make sure textareas without a rows attribute are not tiny */
122
- textarea:not([rows]) {
123
- min-height: 10em;
124
- }
125
-
126
121
  /* Anything that has been anchored to should have extra scroll margin */
127
122
  &:target {
128
123
  scroll-margin-block: 5ex;
@@ -2812,26 +2807,11 @@ var useForceUpdate = () => {
2812
2807
  import { useState as useState6 } from "react";
2813
2808
  var useIsHovered = () => {
2814
2809
  const [isHovered, setIsHovered] = useState6(false);
2815
- const onFocus = (event) => {
2816
- if (event.target !== event.currentTarget) return;
2817
- setIsHovered(true);
2818
- };
2819
- const onMouseEnter = (event) => {
2820
- if (event.target !== event.currentTarget) return;
2821
- setIsHovered(true);
2822
- };
2823
- const onMouseMove = (event) => {
2824
- if (event.target !== event.currentTarget) return;
2825
- setIsHovered(true);
2826
- };
2827
- const onBlur = (event) => {
2828
- if (event.target !== event.currentTarget) return;
2829
- setIsHovered(false);
2830
- };
2831
- const onMouseLeave = (event) => {
2832
- if (event.target !== event.currentTarget) return;
2833
- setIsHovered(false);
2834
- };
2810
+ const onFocus = () => setIsHovered(true);
2811
+ const onMouseEnter = () => setIsHovered(true);
2812
+ const onMouseMove = () => setIsHovered(true);
2813
+ const onBlur = () => setIsHovered(false);
2814
+ const onMouseLeave = () => setIsHovered(false);
2835
2815
  const hoverProps = {
2836
2816
  onFocus,
2837
2817
  onMouseEnter,
@@ -11615,6 +11595,7 @@ var inputStyles = css30`
11615
11595
  }
11616
11596
  }
11617
11597
  `;
11598
+ var calculateTextareaHeight = (rows = 1) => `calc((var(--wui-input-line-height) * ${rows}) + (var(--wui-input-vertical-padding) * 2));`;
11618
11599
  var StyledInputContainer = styled44.div`
11619
11600
  display: inline-flex;
11620
11601
  position: relative;
@@ -11628,9 +11609,35 @@ var StyledInputContainer = styled44.div`
11628
11609
  }
11629
11610
 
11630
11611
  textarea {
11612
+ --wui-input-line-height: var(--wui-typography-body-3-line-height);
11613
+
11631
11614
  border-radius: var(--wui-input-multiline-border-radius);
11632
11615
 
11633
- --wui-input-line-height: var(--wui-typography-body-3-line-height);
11616
+ /* height based on rows attribute (1-5) */
11617
+ &[rows='1'] {
11618
+ height: ${calculateTextareaHeight(1)};
11619
+ }
11620
+
11621
+ &[rows='2'] {
11622
+ height: ${calculateTextareaHeight(2)};
11623
+ }
11624
+
11625
+ &[rows='3'] {
11626
+ height: ${calculateTextareaHeight(3)};
11627
+ }
11628
+
11629
+ &[rows='4'] {
11630
+ height: ${calculateTextareaHeight(4)};
11631
+ }
11632
+
11633
+ &[rows='5'] {
11634
+ height: ${calculateTextareaHeight(5)};
11635
+ }
11636
+
11637
+ /* make sure textareas without a rows attribute are not tiny */
11638
+ &:not([rows]) {
11639
+ height: ${calculateTextareaHeight(5)};
11640
+ }
11634
11641
  }
11635
11642
 
11636
11643
  [type='search'] {
@@ -14056,6 +14063,10 @@ var StyledInput = styled62(Input)`
14056
14063
  min-height: unset;
14057
14064
  }
14058
14065
 
14066
+ &:focus {
14067
+ height: ${({ $height }) => `${$height}px !important`};
14068
+ }
14069
+
14059
14070
  && {
14060
14071
  ${({ $variant }) => variantStyleMap[$variant]}
14061
14072
  /* The input font styles (edit mode) needs the same font styles as Heading */
@@ -14855,6 +14866,7 @@ var FormField = ({
14855
14866
  id: computedId,
14856
14867
  label: isIntegratedLabel ? label : void 0,
14857
14868
  "aria-describedby": ariaDescribedby,
14869
+ "aria-invalid": isNotNil28(computedError),
14858
14870
  ...props
14859
14871
  };
14860
14872
  if (isUndefined4(value) && isNotUndefined12(defaultValue)) {
@@ -14876,8 +14888,7 @@ var FormField = ({
14876
14888
  childProps = {
14877
14889
  ...childProps,
14878
14890
  name: computedName,
14879
- onChange: handleChange,
14880
- "aria-invalid": isNotNil28(error)
14891
+ onChange: handleChange
14881
14892
  };
14882
14893
  }
14883
14894
  Children10.only(children);