react-ui-suite 1.1.11 → 1.1.12

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.
@@ -14,15 +14,19 @@
14
14
  color: var(--rui-color-text-muted);
15
15
  }
16
16
 
17
- .rui-textarea__shell {
18
- --rui-textarea-footer-height: 1.75rem;
19
- --rui-textarea-footer-offset: 0.5rem;
20
- position: relative;
21
- box-sizing: border-box;
22
- width: 100%;
23
- max-width: 100%;
24
- min-width: 0;
25
- overflow: hidden;
17
+ .rui-textarea__shell {
18
+ --rui-textarea-footer-height: 1.75rem;
19
+ --rui-textarea-footer-offset: 0.5rem;
20
+ position: relative;
21
+ display: flex;
22
+ flex-direction: column;
23
+ box-sizing: border-box;
24
+ width: 100%;
25
+ height: 100%;
26
+ max-width: 100%;
27
+ min-width: 0;
28
+ min-height: 0;
29
+ overflow: hidden;
26
30
  border-radius: 1rem;
27
31
  border: 1px solid var(--rui-color-border);
28
32
  background-color: var(--rui-color-surface);
@@ -52,12 +56,14 @@
52
56
  box-shadow: none;
53
57
  }
54
58
 
55
- .rui-textarea__control {
56
- box-sizing: border-box;
57
- display: block;
58
- width: 100%;
59
- max-width: 100%;
60
- min-width: 0;
59
+ .rui-textarea__control {
60
+ box-sizing: border-box;
61
+ display: block;
62
+ flex: 1 1 auto;
63
+ width: 100%;
64
+ height: 100%;
65
+ max-width: 100%;
66
+ min-width: 0;
61
67
  min-height: 120px;
62
68
  border: none;
63
69
  background: transparent;
package/dist/index.js CHANGED
@@ -4615,7 +4615,7 @@ function Table({
4615
4615
  // components/Textarea/Textarea.tsx
4616
4616
  import * as React23 from "react";
4617
4617
  import clsx25 from "clsx";
4618
- import "./Textarea-ETXFJO7T.css";
4618
+ import "./Textarea-PT4QYEE7.css";
4619
4619
  import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
4620
4620
  var MIN_THUMB2 = 24;
4621
4621
  var TRACK_THICKNESS2 = 6;
@@ -4652,6 +4652,7 @@ var Textarea = React23.forwardRef(function Textarea2({
4652
4652
  const resolvedAriaDescribedBy = hintIds.length ? hintIds.join(" ") : void 0;
4653
4653
  const [value, setValue] = React23.useState((_b = (_a = rest.defaultValue) == null ? void 0 : _a.toString()) != null ? _b : "");
4654
4654
  const [height, setHeight] = React23.useState(void 0);
4655
+ const [isUserResized, setIsUserResized] = React23.useState(false);
4655
4656
  const [width, setWidth] = React23.useState(void 0);
4656
4657
  const setRefs = React23.useCallback(
4657
4658
  (node) => {
@@ -4715,12 +4716,19 @@ var Textarea = React23.forwardRef(function Textarea2({
4715
4716
  }
4716
4717
  };
4717
4718
  }, []);
4719
+ React23.useEffect(() => {
4720
+ const allowY2 = resizeDirection === "vertical" || resizeDirection === "both";
4721
+ if (!allowY2) {
4722
+ setIsUserResized(false);
4723
+ setHeight(void 0);
4724
+ }
4725
+ }, [resizeDirection]);
4718
4726
  const handleResizeStart = (event) => {
4719
4727
  var _a2, _b2, _c, _d, _e, _f, _g;
4720
4728
  if (event.pointerType === "mouse" && event.button !== 0) return;
4721
4729
  event.preventDefault();
4722
4730
  if (!textareaRef.current) return;
4723
- const allowY = resizeDirection === "vertical" || resizeDirection === "both";
4731
+ const allowY2 = resizeDirection === "vertical" || resizeDirection === "both";
4724
4732
  const allowX2 = resizeDirection === "horizontal" || resizeDirection === "both";
4725
4733
  const startY = event.clientY;
4726
4734
  const startX = event.clientX;
@@ -4730,9 +4738,10 @@ var Textarea = React23.forwardRef(function Textarea2({
4730
4738
  const minWidth = 240;
4731
4739
  const parentWidth = (_e = (_d = (_c = shellRef.current) == null ? void 0 : _c.parentElement) == null ? void 0 : _d.clientWidth) != null ? _e : startWidth;
4732
4740
  const onMove = (moveEvent) => {
4733
- if (allowY) {
4741
+ if (allowY2) {
4734
4742
  const nextHeight = Math.max(minHeight, startHeight + (moveEvent.clientY - startY));
4735
4743
  setHeight(nextHeight);
4744
+ setIsUserResized(true);
4736
4745
  }
4737
4746
  if (allowX2) {
4738
4747
  const proposed = startWidth + (moveEvent.clientX - startX);
@@ -4797,9 +4806,10 @@ var Textarea = React23.forwardRef(function Textarea2({
4797
4806
  const count = value.length;
4798
4807
  const limit = maxLength != null ? maxLength : void 0;
4799
4808
  const { style, ...restProps } = rest;
4809
+ const allowY = resizeDirection === "vertical" || resizeDirection === "both";
4800
4810
  const textareaStyle = {
4801
4811
  ...style,
4802
- ...height !== void 0 ? { height } : null
4812
+ ...isUserResized && allowY && height !== void 0 ? { height } : null
4803
4813
  };
4804
4814
  const allowX = resizeDirection === "horizontal" || resizeDirection === "both";
4805
4815
  const shellStyle = width !== void 0 && allowX ? { width } : void 0;