@plasmicpkgs/react-aria 0.0.146 → 0.0.147

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.
@@ -4653,13 +4653,15 @@ function BaseTextArea_(props, ref) {
4653
4653
  plasmicUpdateVariant,
4654
4654
  setControlContextData,
4655
4655
  value,
4656
- resize
4656
+ resize,
4657
+ autoResize
4657
4658
  } = _a, restProps = __objRest$2(_a, [
4658
4659
  "className",
4659
4660
  "plasmicUpdateVariant",
4660
4661
  "setControlContextData",
4661
4662
  "value",
4662
- "resize"
4663
+ "resize",
4664
+ "autoResize"
4663
4665
  ]);
4664
4666
  const textFieldContext = React__default.default.useContext(PlasmicTextFieldContext);
4665
4667
  const [textAreaContextProps, textAreaRef] = reactAriaComponents.useContextProps(
@@ -4678,7 +4680,7 @@ function BaseTextArea_(props, ref) {
4678
4680
  hoverProps,
4679
4681
  {
4680
4682
  value: isDefined(textFieldContext) ? void 0 : value,
4681
- style: __spreadValues$2(__spreadValues$2({}, COMMON_STYLES), resize ? { resize } : {}),
4683
+ style: __spreadValues$2(__spreadValues$2({}, COMMON_STYLES), autoResize ? { resize: "none" } : resize ? { resize } : {}),
4682
4684
  className
4683
4685
  }
4684
4686
  );
@@ -4687,6 +4689,13 @@ function BaseTextArea_(props, ref) {
4687
4689
  setControlContextData == null ? void 0 : setControlContextData({
4688
4690
  parent: textFieldContext
4689
4691
  });
4692
+ React__default.default.useEffect(() => {
4693
+ const el = textAreaRef.current;
4694
+ if (autoResize && el) {
4695
+ el.style.height = "auto";
4696
+ el.style.height = `${el.scrollHeight}px`;
4697
+ }
4698
+ }, [mergedProps.value]);
4690
4699
  React.useEffect(() => {
4691
4700
  if (plasmicUpdateVariant) {
4692
4701
  plasmicUpdateVariant({
@@ -4747,6 +4756,12 @@ function registerTextArea(loader, overrides) {
4747
4756
  "onBeforeInput",
4748
4757
  "onInput"
4749
4758
  ])), {
4759
+ autoResize: {
4760
+ type: "boolean",
4761
+ displayName: "Auto resize",
4762
+ defaultValueHint: false,
4763
+ description: "Grows or shrinks the element automatically based on text content. Disables manual resizing."
4764
+ },
4750
4765
  resize: {
4751
4766
  type: "choice",
4752
4767
  description: "Controls if and how the element can be resized.",
@@ -4758,7 +4773,9 @@ function registerTextArea(loader, overrides) {
4758
4773
  "inline",
4759
4774
  "none"
4760
4775
  ],
4761
- defaultValueHint: "both"
4776
+ defaultValueHint: "both",
4777
+ hidden: (props) => Boolean(props.autoResize),
4778
+ advanced: true
4762
4779
  }
4763
4780
  }),
4764
4781
  states: {