react-frontend-common-components 0.0.72 → 0.0.73

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-frontend-common-components",
3
- "version": "0.0.72",
3
+ "version": "0.0.73",
4
4
  "description": "Reusable frontend library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -29,6 +29,7 @@ interface AppInputProps extends InputProps {
29
29
  errorMessage?: string;
30
30
  suffixIcon?: React.ReactNode;
31
31
  prefixIcon?: React.ReactNode;
32
+ required?:boolean;
32
33
  }
33
34
 
34
35
  const AppInput = ({
@@ -50,6 +51,7 @@ const AppInput = ({
50
51
  errorMessage,
51
52
  suffixIcon,
52
53
  prefixIcon,
54
+ required,
53
55
  ...props
54
56
  }: AppInputProps) => {
55
57
  const inputRef = useRef<InputRef>(null);
@@ -76,7 +78,7 @@ const AppInput = ({
76
78
  onClick={onClick}
77
79
  defaultValue={defaultValue}
78
80
  onPressEnter={onPressEnter}
79
- placeholder={placeholder}
81
+ placeholder={`${required ? placeholder + " (required)" : placeholder}`}
80
82
  ref={inputRef}
81
83
  prefix={prefixIcon && prefixIcon}
82
84
  suffix={suffixIcon && suffixIcon}
@@ -16,7 +16,7 @@ interface AppSelectProps extends SelectProps {
16
16
  required?: boolean;
17
17
  placeholder?: string;
18
18
  errorMessage?: string;
19
- showSearch?:boolean;
19
+ showSearch?: boolean;
20
20
  }
21
21
 
22
22
  const AppSelect = ({
@@ -28,6 +28,7 @@ const AppSelect = ({
28
28
  className,
29
29
  errorMessage,
30
30
  showSearch,
31
+ required,
31
32
  ...props
32
33
  }: AppSelectProps) => {
33
34
  return (
@@ -37,7 +38,7 @@ const AppSelect = ({
37
38
  showSearch={showSearch}
38
39
  disabled={disabled}
39
40
  value={value}
40
- placeholder={placeholder}
41
+ placeholder={`${required ? placeholder + " (required)" : placeholder}`}
41
42
  onChange={(value: string | string[]) =>
42
43
  handleChange && handleChange(value)
43
44
  }