@linzjs/lui 16.2.1 → 16.2.4

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,24 @@
1
+ ## [16.2.4](https://github.com/linz/lui/compare/v16.2.3...v16.2.4) (2022-03-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * wrong type for mandatory ([#639](https://github.com/linz/lui/issues/639)) ([f6fdffa](https://github.com/linz/lui/commit/f6fdffa936345fe701e32e709dc9e185290997d7))
7
+
8
+ ## [16.2.3](https://github.com/linz/lui/compare/v16.2.2...v16.2.3) (2022-03-28)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Adding classname to luitextinput ([#638](https://github.com/linz/lui/issues/638)) ([92dc54f](https://github.com/linz/lui/commit/92dc54f595c6678c53a3393cc8d05d127be38d3a))
14
+
15
+ ## [16.2.2](https://github.com/linz/lui/compare/v16.2.1...v16.2.2) (2022-03-24)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Adding conditional class name ([#636](https://github.com/linz/lui/issues/636)) ([5bd6858](https://github.com/linz/lui/commit/5bd6858d8d579622ba23aac64a27e8b4c7d1ae79))
21
+
1
22
  ## [16.2.1](https://github.com/linz/lui/compare/v16.2.0...v16.2.1) (2022-03-23)
2
23
 
3
24
 
@@ -8,5 +8,6 @@ export interface LuiCheckboxProps {
8
8
  error?: string;
9
9
  inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
10
10
  className?: string;
11
+ mandatory?: boolean;
11
12
  }
12
13
  export declare const LuiCheckboxInput: (props: LuiCheckboxProps) => JSX.Element;
@@ -13,6 +13,7 @@ export interface LuiTextInputProps {
13
13
  * A padlock will be displayed on right side of input
14
14
  */
15
15
  showPadlockIcon?: boolean;
16
+ className?: string;
16
17
  value: string;
17
18
  icon?: JSX.Element;
18
19
  }
package/dist/index.js CHANGED
@@ -867,7 +867,7 @@ function useGenerateOrDefaultId(idFromProps) {
867
867
  var LuiTextInput = function (props) {
868
868
  var _a;
869
869
  var id = useGenerateOrDefaultId((_a = props.inputProps) === null || _a === void 0 ? void 0 : _a.id);
870
- return (React__default["default"].createElement("div", { className: clsx('LuiTextInput', props.error && 'hasError') },
870
+ return (React__default["default"].createElement("div", { className: clsx('LuiTextInput', props.error && 'hasError', props.className) },
871
871
  React__default["default"].createElement("label", { className: 'LuiTextInput-label', htmlFor: id },
872
872
  props.mandatory && React__default["default"].createElement("span", { className: "LuiTextInput-mandatory" }, "*"),
873
873
  React__default["default"].createElement("span", { className: 'LuiTextInput-label-text ' +
@@ -888,8 +888,9 @@ var LuiCheckboxInput = function (props) {
888
888
  'LuiCheckboxInput--isChecked': props.isChecked,
889
889
  'LuiCheckboxInput--hasError': !!props.error,
890
890
  'LuiCheckboxInput--isDisabled': !!props.isDisabled,
891
- }) },
891
+ }, props.className) },
892
892
  React__default["default"].createElement("label", { htmlFor: id, className: "LuiCheckboxInput-group" },
893
+ props.mandatory && (React__default["default"].createElement("span", { "aria-label": "Required", className: "LuiCheckboxInput-mandatory" }, "*")),
893
894
  React__default["default"].createElement("input", __assign({ className: clsx('LuiCheckboxInput-input'), id: id, type: "checkbox", value: props.value, onChange: props.onChange, checked: props.isChecked, disabled: props.isDisabled }, props.inputProps)),
894
895
  React__default["default"].createElement("span", { className: "LuiCheckboxInput-label" },
895
896
  props.label,