@wistia/ui 0.18.0-beta.80cfc750.f949e60 → 0.18.0-beta.89fb236c.e8cb4a9

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.80cfc750.f949e60
3
+ * @license @wistia/ui v0.18.0-beta.89fb236c.e8cb4a9
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;
@@ -11600,11 +11595,13 @@ var inputStyles = css30`
11600
11595
  }
11601
11596
  }
11602
11597
  `;
11598
+ var calculateTextareaHeight = (rows = 1) => `calc((var(--wui-input-line-height) * ${rows}) + (var(--wui-input-vertical-padding) * 2));`;
11603
11599
  var StyledInputContainer = styled44.div`
11604
11600
  display: inline-flex;
11605
11601
  position: relative;
11606
11602
  ${inputStyles};
11607
11603
  width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
11604
+ height: ${({ $fullHeight, $isMultiline }) => $fullHeight && $isMultiline ? "100%" : "auto"};
11608
11605
 
11609
11606
  input,
11610
11607
  textarea {
@@ -11613,9 +11610,51 @@ var StyledInputContainer = styled44.div`
11613
11610
  }
11614
11611
 
11615
11612
  textarea {
11613
+ --wui-input-line-height: var(--wui-typography-body-3-line-height);
11614
+
11616
11615
  border-radius: var(--wui-input-multiline-border-radius);
11616
+ height: ${({ $fullHeight }) => $fullHeight ? "100%" : "auto"};
11617
+
11618
+ /* override height calculations when fullHeight is enabled */
11619
+ ${({ $fullHeight }) => $fullHeight && `
11620
+ &[rows='1'],
11621
+ &[rows='2'],
11622
+ &[rows='3'],
11623
+ &[rows='4'],
11624
+ &[rows='5'],
11625
+ &:not([rows]) {
11626
+ height: 100%;
11627
+ resize: none;
11628
+ }
11629
+ `}
11617
11630
 
11618
- --wui-input-line-height: var(--wui-typography-body-3-line-height);
11631
+ /* height based on rows attribute (1-5) - only when fullHeight is not enabled */
11632
+ ${({ $fullHeight }) => !$fullHeight && `
11633
+ &[rows='1'] {
11634
+ height: ${calculateTextareaHeight(1)};
11635
+ }
11636
+
11637
+ &[rows='2'] {
11638
+ height: ${calculateTextareaHeight(2)};
11639
+ }
11640
+
11641
+ &[rows='3'] {
11642
+ height: ${calculateTextareaHeight(3)};
11643
+ }
11644
+
11645
+ &[rows='4'] {
11646
+ height: ${calculateTextareaHeight(4)};
11647
+ }
11648
+
11649
+ &[rows='5'] {
11650
+ height: ${calculateTextareaHeight(5)};
11651
+ }
11652
+
11653
+ /* make sure textareas without a rows attribute are not tiny */
11654
+ &:not([rows]) {
11655
+ height: ${calculateTextareaHeight(5)};
11656
+ }
11657
+ `}
11619
11658
  }
11620
11659
 
11621
11660
  [type='search'] {
@@ -11670,6 +11709,7 @@ var StyledInputContainer = styled44.div`
11670
11709
  var Input = forwardRef15(
11671
11710
  ({
11672
11711
  fullWidth = true,
11712
+ fullHeight = false,
11673
11713
  monospace = false,
11674
11714
  type = "text",
11675
11715
  autoSelect = false,
@@ -11709,7 +11749,9 @@ var Input = forwardRef15(
11709
11749
  return /* @__PURE__ */ jsxs30(
11710
11750
  StyledInputContainer,
11711
11751
  {
11752
+ $fullHeight: fullHeight,
11712
11753
  $fullWidth: fullWidth,
11754
+ $isMultiline: type === "multiline",
11713
11755
  $monospace: monospace,
11714
11756
  "data-wui-input-container": true,
11715
11757
  children: [
@@ -14041,6 +14083,10 @@ var StyledInput = styled62(Input)`
14041
14083
  min-height: unset;
14042
14084
  }
14043
14085
 
14086
+ &:focus {
14087
+ height: ${({ $height }) => `${$height}px !important`};
14088
+ }
14089
+
14044
14090
  && {
14045
14091
  ${({ $variant }) => variantStyleMap[$variant]}
14046
14092
  /* The input font styles (edit mode) needs the same font styles as Heading */
@@ -14840,6 +14886,7 @@ var FormField = ({
14840
14886
  id: computedId,
14841
14887
  label: isIntegratedLabel ? label : void 0,
14842
14888
  "aria-describedby": ariaDescribedby,
14889
+ "aria-invalid": isNotNil28(computedError),
14843
14890
  ...props
14844
14891
  };
14845
14892
  if (isUndefined4(value) && isNotUndefined12(defaultValue)) {
@@ -14861,8 +14908,7 @@ var FormField = ({
14861
14908
  childProps = {
14862
14909
  ...childProps,
14863
14910
  name: computedName,
14864
- onChange: handleChange,
14865
- "aria-invalid": isNotNil28(error)
14911
+ onChange: handleChange
14866
14912
  };
14867
14913
  }
14868
14914
  Children10.only(children);