@linzjs/lui 11.9.0 → 11.10.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
+ # [11.10.0](https://github.com/linz/lui/compare/v11.9.0...v11.10.0) (2022-01-11)
2
+
3
+
4
+ ### Features
5
+
6
+ * **LuiSelectInput & LuiTextAreaInput:** Added Mandatory star ([#506](https://github.com/linz/lui/issues/506)) ([cd296bf](https://github.com/linz/lui/commit/cd296bf67a686bccfd05b0c1d143da5298b7ee12))
7
+
1
8
  # [11.9.0](https://github.com/linz/lui/compare/v11.8.0...v11.9.0) (2022-01-11)
2
9
 
3
10
 
@@ -9,6 +9,7 @@ export interface SelectProps {
9
9
  onChange?: ChangeEventHandler<HTMLSelectElement>;
10
10
  options: SelectOptions[];
11
11
  value: string;
12
+ mandatory?: boolean;
12
13
  hideLabel?: boolean;
13
14
  selectProps?: SelectHTMLAttributes<HTMLSelectElement>;
14
15
  label: JSX.Element | string;
@@ -29,3 +29,7 @@ export declare const Error: {
29
29
  (): JSX.Element;
30
30
  storyName: string;
31
31
  };
32
+ export declare const MandatoryStar: {
33
+ (): JSX.Element;
34
+ storyName: string;
35
+ };
@@ -1,6 +1,7 @@
1
1
  import { ChangeEventHandler, InputHTMLAttributes } from 'react';
2
2
  export interface LuiTextAreaInputProps {
3
3
  label: JSX.Element | string;
4
+ mandatory?: boolean;
4
5
  inputProps?: InputHTMLAttributes<HTMLTextAreaElement>;
5
6
  onChange?: ChangeEventHandler<HTMLTextAreaElement>;
6
7
  value: string;
@@ -24,3 +24,7 @@ export declare const Error: {
24
24
  (): JSX.Element;
25
25
  storyName: string;
26
26
  };
27
+ export declare const Mandatory: {
28
+ (): JSX.Element;
29
+ storyName: string;
30
+ };
@@ -1174,7 +1174,9 @@ var LuiSelectInput = function LuiSelectInput(props) {
1174
1174
  }, React__default.createElement("label", {
1175
1175
  htmlFor: id,
1176
1176
  className: "LuiSelect-label"
1177
- }, React__default.createElement("span", {
1177
+ }, props.mandatory && React__default.createElement("span", {
1178
+ className: "LuiSelect-mandatory"
1179
+ }, "*"), React__default.createElement("span", {
1178
1180
  className: clsx('LuiSelect-label-text', props.hideLabel ? 'LuiScreenReadersOnly' : '')
1179
1181
  }, props.label), React__default.createElement("div", {
1180
1182
  className: "LuiSelect-wrapper"
@@ -1215,7 +1217,9 @@ var LuiTextAreaInput = function LuiTextAreaInput(props) {
1215
1217
  className: clsx('LuiTextAreaInput')
1216
1218
  }, React__default.createElement("label", {
1217
1219
  htmlFor: id
1218
- }, React__default.createElement("span", {
1220
+ }, props.mandatory && React__default.createElement("span", {
1221
+ className: "LuiTextAreaInput-mandatory"
1222
+ }, "*"), React__default.createElement("span", {
1219
1223
  className: "LuiTextAreaInput-label"
1220
1224
  }, props.label), React__default.createElement("textarea", Object.assign({
1221
1225
  id: id,