@linzjs/lui 23.5.0 → 23.6.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [23.6.0](https://github.com/linz/lui/compare/v23.5.0...v23.6.0) (2025-07-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * Adds an autoexpanding TextArea. Can be replaced with native CSS in a year ([#1235](https://github.com/linz/lui/issues/1235)) ([8ec3398](https://github.com/linz/lui/commit/8ec33987889a08ef9c9eb9a4aa13c6dbbcad9e5c))
7
+
1
8
  # [23.5.0](https://github.com/linz/lui/compare/v23.4.0...v23.5.0) (2025-07-02)
2
9
 
3
10
 
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { type LuiTextAreaInputProps } from './LuiTextAreaInput';
3
+ export declare const LuiAutoExpandTextAreaInput: (props: LuiTextAreaInputProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ChangeEventHandler, InputHTMLAttributes } from 'react';
1
+ import React, { ChangeEventHandler, InputHTMLAttributes } from 'react';
2
2
  export interface LuiTextAreaInputProps {
3
3
  label: JSX.Element | string;
4
4
  mandatory?: boolean;
@@ -7,5 +7,6 @@ export interface LuiTextAreaInputProps {
7
7
  value: string;
8
8
  error?: string | boolean;
9
9
  warning?: string;
10
+ rows?: number;
10
11
  }
11
- export declare const LuiTextAreaInput: (props: LuiTextAreaInputProps) => JSX.Element;
12
+ export declare const LuiTextAreaInput: React.ForwardRefExoticComponent<LuiTextAreaInputProps & React.RefAttributes<HTMLTextAreaElement>>;
package/dist/index.js CHANGED
@@ -7198,23 +7198,24 @@ var LuiSelectInput = function (props) {
7198
7198
  props.warning)))));
7199
7199
  };
7200
7200
 
7201
- var LuiTextAreaInput = function (props) {
7201
+ var LuiTextAreaInput = React__default["default"].forwardRef(function (props, ref) {
7202
7202
  var _a, _b;
7203
7203
  var id = useGenerateOrDefaultId((_a = props.inputProps) === null || _a === void 0 ? void 0 : _a.id);
7204
+ var rows = props.rows !== undefined ? props.rows : 5;
7205
+ console.log('🚀 ~ rows:', rows);
7204
7206
  return (React__default["default"].createElement("div", { className: clsx('LuiTextAreaInput', ((_b = props.inputProps) === null || _b === void 0 ? void 0 : _b.disabled) ? 'isDisabled' : '', props.error ? 'hasError' : '', props.warning ? 'hasWarning' : '') },
7205
7207
  React__default["default"].createElement("label", { htmlFor: id },
7206
7208
  props.mandatory && (React__default["default"].createElement("span", { className: "LuiTextAreaInput-mandatory" }, "*")),
7207
7209
  React__default["default"].createElement("span", { className: "LuiTextAreaInput-label" }, props.label),
7208
7210
  React__default["default"].createElement("div", { className: "LuiTextAreaInput-wrapper" },
7209
- ' ',
7210
- React__default["default"].createElement("textarea", __assign({ id: id, value: props.value, onChange: props.onChange, rows: 5 }, props.inputProps)))),
7211
+ React__default["default"].createElement("textarea", __assign({ id: id, value: props.value, onChange: props.onChange, ref: ref, rows: rows }, props.inputProps)))),
7211
7212
  props.error && (React__default["default"].createElement("span", { className: "LuiTextAreaInput-error" },
7212
7213
  React__default["default"].createElement(LuiIcon, { alt: "error", name: "ic_error", className: "LuiTextAreaInput-error-icon", size: "sm", status: "error" }),
7213
7214
  props.error)),
7214
7215
  props.warning && (React__default["default"].createElement("span", { className: "LuiTextAreaInput-warning" },
7215
7216
  React__default["default"].createElement(LuiIcon, { alt: "warning", name: "ic_warning", className: "LuiTextAreaInput-warning-icon", size: "sm", status: "warning" }),
7216
7217
  props.warning))));
7217
- };
7218
+ });
7218
7219
 
7219
7220
  var LuiDateInput = React__default["default"].forwardRef(function (_a, ref) {
7220
7221
  var inputProps = _a.inputProps, rest = __rest(_a, ["inputProps"]);