@plasmicpkgs/react-aria 0.0.145 → 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.
@@ -4644,12 +4644,16 @@ function BaseTextArea_(props, ref) {
4644
4644
  className,
4645
4645
  plasmicUpdateVariant,
4646
4646
  setControlContextData,
4647
- value
4647
+ value,
4648
+ resize,
4649
+ autoResize
4648
4650
  } = _a, restProps = __objRest$2(_a, [
4649
4651
  "className",
4650
4652
  "plasmicUpdateVariant",
4651
4653
  "setControlContextData",
4652
- "value"
4654
+ "value",
4655
+ "resize",
4656
+ "autoResize"
4653
4657
  ]);
4654
4658
  const textFieldContext = React.useContext(PlasmicTextFieldContext);
4655
4659
  const [textAreaContextProps, textAreaRef] = useContextProps(
@@ -4668,7 +4672,7 @@ function BaseTextArea_(props, ref) {
4668
4672
  hoverProps,
4669
4673
  {
4670
4674
  value: isDefined(textFieldContext) ? void 0 : value,
4671
- style: COMMON_STYLES,
4675
+ style: __spreadValues$2(__spreadValues$2({}, COMMON_STYLES), autoResize ? { resize: "none" } : resize ? { resize } : {}),
4672
4676
  className
4673
4677
  }
4674
4678
  );
@@ -4677,6 +4681,13 @@ function BaseTextArea_(props, ref) {
4677
4681
  setControlContextData == null ? void 0 : setControlContextData({
4678
4682
  parent: textFieldContext
4679
4683
  });
4684
+ React.useEffect(() => {
4685
+ const el = textAreaRef.current;
4686
+ if (autoResize && el) {
4687
+ el.style.height = "auto";
4688
+ el.style.height = `${el.scrollHeight}px`;
4689
+ }
4690
+ }, [mergedProps.value]);
4680
4691
  useEffect(() => {
4681
4692
  if (plasmicUpdateVariant) {
4682
4693
  plasmicUpdateVariant({
@@ -4710,7 +4721,7 @@ function registerTextArea(loader, overrides) {
4710
4721
  importPath: "@plasmicpkgs/react-aria/skinny/registerTextArea",
4711
4722
  importName: "BaseTextArea",
4712
4723
  variants: variants$1,
4713
- props: __spreadValues$2({}, getCommonProps("Text Area", [
4724
+ props: __spreadProps$2(__spreadValues$2({}, getCommonProps("Text Area", [
4714
4725
  "name",
4715
4726
  "disabled",
4716
4727
  "readOnly",
@@ -4736,7 +4747,29 @@ function registerTextArea(loader, overrides) {
4736
4747
  "onSelect",
4737
4748
  "onBeforeInput",
4738
4749
  "onInput"
4739
- ])),
4750
+ ])), {
4751
+ autoResize: {
4752
+ type: "boolean",
4753
+ displayName: "Auto resize",
4754
+ defaultValueHint: false,
4755
+ description: "Grows or shrinks the element automatically based on text content. Disables manual resizing."
4756
+ },
4757
+ resize: {
4758
+ type: "choice",
4759
+ description: "Controls if and how the element can be resized.",
4760
+ options: [
4761
+ "both",
4762
+ "horizontal",
4763
+ "vertical",
4764
+ "block",
4765
+ "inline",
4766
+ "none"
4767
+ ],
4768
+ defaultValueHint: "both",
4769
+ hidden: (props) => Boolean(props.autoResize),
4770
+ advanced: true
4771
+ }
4772
+ }),
4740
4773
  states: {
4741
4774
  value: __spreadValues$2({
4742
4775
  type: "writable",