@linzjs/lui 17.11.2 → 17.11.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.11.3](https://github.com/linz/lui/compare/v17.11.2...v17.11.3) (2022-08-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added warning to text input and fixed msg alignment with icon ([#738](https://github.com/linz/lui/issues/738)) ([45b6e87](https://github.com/linz/lui/commit/45b6e8755fbf0663478b7cda81d55b429d35f744))
7
+
1
8
  ## [17.11.2](https://github.com/linz/lui/compare/v17.11.1...v17.11.2) (2022-08-23)
2
9
 
3
10
 
@@ -3,6 +3,7 @@ export interface LuiTextInputProps {
3
3
  onChange?: ChangeEventHandler<HTMLInputElement>;
4
4
  inputProps?: InputHTMLAttributes<HTMLInputElement>;
5
5
  error?: string;
6
+ warning?: string;
6
7
  hideLabel?: boolean;
7
8
  label: JSX.Element | string;
8
9
  /**
package/dist/index.js CHANGED
@@ -873,7 +873,7 @@ function useGenerateOrDefaultId(idFromProps) {
873
873
  }
874
874
  const LuiTextInput = (props) => {
875
875
  const id = useGenerateOrDefaultId(props.inputProps?.id);
876
- return (React__default["default"].createElement("div", { className: clsx('LuiTextInput', props.error && 'hasError', props.className) },
876
+ return (React__default["default"].createElement("div", { className: clsx('LuiTextInput', props.error && 'hasError', props.warning && 'hasWarning', props.className) },
877
877
  React__default["default"].createElement("label", { className: 'LuiTextInput-label', htmlFor: id },
878
878
  props.mandatory && React__default["default"].createElement("span", { className: "LuiTextInput-mandatory" }, "*"),
879
879
  React__default["default"].createElement("span", { className: 'LuiTextInput-label-text ' +
@@ -884,7 +884,10 @@ const LuiTextInput = (props) => {
884
884
  props.icon),
885
885
  props.error && (React__default["default"].createElement("span", { className: "LuiTextInput-error" },
886
886
  React__default["default"].createElement(LuiIcon, { alt: "error", name: "ic_error", className: "LuiTextInput-error-icon", size: "sm", status: "error" }),
887
- props.error)))));
887
+ props.error)),
888
+ props.warning && (React__default["default"].createElement("span", { className: "LuiTextInput-warning" },
889
+ React__default["default"].createElement(LuiIcon, { alt: "warning", name: "ic_warning", className: "LuiTextInput-warning-icon", size: "sm", status: "warning" }),
890
+ props.warning)))));
888
891
  };
889
892
 
890
893
  const LuiCheckboxInput = (props) => {