pmg-ui-kit 0.0.26 → 0.0.28

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.
@@ -9,5 +9,5 @@ type TextAreaProps = {
9
9
  required?: boolean;
10
10
  name?: string;
11
11
  };
12
- declare const Textarea: ({ rows, className, placeholder, value, bottomHint, handleOnChange, shouldBeValidateInWebchecker, required, name, }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
13
- export default Textarea;
12
+ export declare const Textarea: ({ rows, className, placeholder, value, bottomHint, handleOnChange, shouldBeValidateInWebchecker, required, name, }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -5,7 +5,7 @@ import { useEffect, useState } from "react";
5
5
  import { useValidatePattern } from "../../hooks/useValidatePattern";
6
6
  import { ValidationPatterns } from "../../consts/validationPatterns";
7
7
  import { Text } from "./Text";
8
- const Textarea = ({ rows = 4, className, placeholder = "", value, bottomHint, handleOnChange, shouldBeValidateInWebchecker = false, required, name, }) => {
8
+ export const Textarea = ({ rows = 4, className, placeholder = "", value, bottomHint, handleOnChange, shouldBeValidateInWebchecker = false, required, name, }) => {
9
9
  const isValid = useValidatePattern(ValidationPatterns.NON_EMPTY_PATTERN, value?.toString(), required ? false : true);
10
10
  useEffect(() => {
11
11
  setVal(value);
@@ -17,4 +17,3 @@ const Textarea = ({ rows = 4, className, placeholder = "", value, bottomHint, ha
17
17
  handleOnChange && handleOnChange(e);
18
18
  }, rows: rows, className: classNames("block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", className, !isValid && "!border-red-500 !focus:border-red-500"), placeholder: placeholder, required: required }), bottomHint && (_jsx(Text, { size: "sm", className: "mt-1 text-gray-600", children: bottomHint }))] }));
19
19
  };
20
- export default Textarea;
@@ -1,8 +1,8 @@
1
- import { FormField } from "../../types/formTypes";
1
+ import { type FormField as FormFieldType } from "../../types/formTypes";
2
2
  type FormFieldProps = {
3
- fieldSetup: FormField;
3
+ fieldSetup: FormFieldType;
4
4
  value: string | File[] | number;
5
5
  handleOnChange: (val: string | File[]) => void;
6
6
  };
7
- declare const FormField: ({ fieldSetup, value, handleOnChange, }: FormFieldProps) => React.ReactNode;
8
- export default FormField;
7
+ export declare const FormField: ({ fieldSetup, value, handleOnChange, }: FormFieldProps) => React.ReactNode;
8
+ export {};
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Input } from "../atoms/Input";
3
3
  import { InputTypeFileWithListing } from "../atoms/InputTypeFileWithListing";
4
4
  import { Select } from "../atoms/Select";
5
- import Textarea from "../atoms/Textarea";
6
- const FormField = ({ fieldSetup, value, handleOnChange, }) => {
5
+ import { Textarea } from "../atoms/Textarea";
6
+ export const FormField = ({ fieldSetup, value, handleOnChange, }) => {
7
7
  if (fieldSetup.fieldType === "text") {
8
8
  return (_jsx(Input, { onClick: (e) => e.currentTarget.classList.remove("border-red-500", "!border-red-500"), onBlur: (e) => e.currentTarget.classList.remove("border-red-500", "!border-red-500"), className: fieldSetup.inputClassName, required: fieldSetup.required, name: fieldSetup.name, value: value, handleOnChange: handleOnChange, pattern: fieldSetup.pattern, placeholder: fieldSetup.placeholder, bottomHint: fieldSetup.bottomHint, wrapperClassNames: fieldSetup.wrapperClassNames }));
9
9
  }
@@ -18,4 +18,3 @@ const FormField = ({ fieldSetup, value, handleOnChange, }) => {
18
18
  }
19
19
  return null;
20
20
  };
21
- export default FormField;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmg-ui-kit",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "description": "Components library for PMG projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",