@linzjs/lui 17.35.2 → 17.35.3

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
+ ## [17.35.3](https://github.com/linz/lui/compare/v17.35.2...v17.35.3) (2023-02-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * LuiTextInputProps now forwardsRefs ([#853](https://github.com/linz/lui/issues/853)) ([7160fdc](https://github.com/linz/lui/commit/7160fdcf16d0668f920c04bbe531ceb37e40cb3a))
7
+
1
8
  ## [17.35.2](https://github.com/linz/lui/compare/v17.35.1...v17.35.2) (2023-02-15)
2
9
 
3
10
 
@@ -1,7 +1,7 @@
1
- import { ChangeEventHandler, DetailedHTMLProps, InputHTMLAttributes } from 'react';
1
+ import React, { ChangeEventHandler } from 'react';
2
2
  export interface LuiTextInputProps {
3
3
  onChange?: ChangeEventHandler<HTMLInputElement>;
4
- inputProps?: Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'ref'>;
4
+ inputProps?: Omit<JSX.IntrinsicElements['input'], 'ref'>;
5
5
  error?: string;
6
6
  warning?: string;
7
7
  hideLabel?: boolean;
@@ -20,4 +20,4 @@ export interface LuiTextInputProps {
20
20
  size?: 'sm';
21
21
  }
22
22
  export declare function useGenerateOrDefaultId(idFromProps?: string): string;
23
- export declare const LuiTextInput: (props: LuiTextInputProps) => JSX.Element;
23
+ export declare const LuiTextInput: React.ForwardRefExoticComponent<LuiTextInputProps & React.RefAttributes<HTMLInputElement>>;
package/dist/index.js CHANGED
@@ -15662,8 +15662,8 @@ function useGenerateOrDefaultId(idFromProps) {
15662
15662
  var id = React$1.useState(idFromProps ? idFromProps : v4())[0];
15663
15663
  return id;
15664
15664
  }
15665
- var BareInput = function (props) { return (React__default["default"].createElement("input", __assign$3({}, props))); };
15666
- var LuiTextInput = function (props) {
15665
+ var BareInput = React$1.forwardRef(function (props, ref) { return React__default["default"].createElement("input", __assign$3({}, props, { ref: ref })); });
15666
+ var LuiTextInput = React$1.forwardRef(function (props, ref) {
15667
15667
  var _a, _b, _c;
15668
15668
  var id = useGenerateOrDefaultId((_a = props.inputProps) === null || _a === void 0 ? void 0 : _a.id);
15669
15669
  var LuiInput = ((_b = props.inputProps) === null || _b === void 0 ? void 0 : _b.type) === 'date' ? DateInput : BareInput;
@@ -15673,7 +15673,7 @@ var LuiTextInput = function (props) {
15673
15673
  React__default["default"].createElement("span", { className: 'LuiTextInput-label-text ' +
15674
15674
  clsx$1(props.hideLabel ? 'LuiScreenReadersOnly' : '') }, props.label),
15675
15675
  React__default["default"].createElement("span", { className: "LuiTextInput-inputWrapper" },
15676
- React__default["default"].createElement(LuiInput, __assign$3({ className: clsx$1('LuiTextInput-input', props.showPadlockIcon ? 'LuiTextInput-padlock-icon ' : '', props.size ? "LuiTextInput-".concat(props.size) : ''), min: ((_c = props.inputProps) === null || _c === void 0 ? void 0 : _c.type) === 'date' ? undefined : '0', value: props.value, onChange: props.onChange }, props.inputProps, { id: id })),
15676
+ React__default["default"].createElement(LuiInput, __assign$3({ ref: ref, className: clsx$1('LuiTextInput-input', props.showPadlockIcon ? 'LuiTextInput-padlock-icon ' : '', props.size ? "LuiTextInput-".concat(props.size) : ''), min: ((_c = props.inputProps) === null || _c === void 0 ? void 0 : _c.type) === 'date' ? undefined : '0', value: props.value, onChange: props.onChange }, props.inputProps, { id: id })),
15677
15677
  props.icon),
15678
15678
  props.error && (React__default["default"].createElement("span", { className: "LuiTextInput-error" },
15679
15679
  React__default["default"].createElement(LuiIcon, { alt: "error", name: "ic_error", className: "LuiTextInput-error-icon", size: "sm", status: "error" }),
@@ -15681,7 +15681,7 @@ var LuiTextInput = function (props) {
15681
15681
  props.warning && (React__default["default"].createElement("span", { className: "LuiTextInput-warning" },
15682
15682
  React__default["default"].createElement(LuiIcon, { alt: "warning", name: "ic_warning", className: "LuiTextInput-warning-icon", size: "sm", status: "warning" }),
15683
15683
  props.warning)))));
15684
- };
15684
+ });
15685
15685
 
15686
15686
  var LuiCheckboxInput = function (props) {
15687
15687
  var _a;