@arkyn/components 3.0.1-beta.51 → 3.0.1-beta.52
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.
@@ -1,12 +1,14 @@
|
|
1
1
|
import { TextareaHTMLAttributes } from "react";
|
2
2
|
import "./styles.css";
|
3
|
-
type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "name"> & {
|
3
|
+
type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "name" | "value" | "defaultValue"> & {
|
4
4
|
name: string;
|
5
5
|
label?: string;
|
6
6
|
showAsterisk?: boolean;
|
7
7
|
errorMessage?: string;
|
8
8
|
size?: "md" | "lg";
|
9
9
|
variant?: "solid" | "outline";
|
10
|
+
value?: string | null;
|
11
|
+
defaultValue?: string | null;
|
10
12
|
};
|
11
13
|
/**
|
12
14
|
* Textarea component - used for multi-line text input with customizable styling and validation
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EAIvB,MAAM,OAAO,CAAC;AAOf,OAAO,cAAc,CAAC;AAEtB,KAAK,aAAa,GAAG,IAAI,CACvB,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,MAAM,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EAIvB,MAAM,OAAO,CAAC;AAOf,OAAO,cAAc,CAAC;AAEtB,KAAK,aAAa,GAAG,IAAI,CACvB,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,MAAM,GAAG,OAAO,GAAG,cAAc,CAClC,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE9B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,2CA4ErC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
@@ -96,7 +96,7 @@ import "./styles.css";
|
|
96
96
|
* ```
|
97
97
|
*/
|
98
98
|
function Textarea(props) {
|
99
|
-
const { variant = "solid", size = "md", className: baseClassName, errorMessage: baseErrorMessage, disabled = false, readOnly = false, label, showAsterisk, name, onFocus, onBlur, title, style, id, ...rest } = props;
|
99
|
+
const { variant = "solid", size = "md", className: baseClassName, errorMessage: baseErrorMessage, disabled = false, readOnly = false, label, showAsterisk, name, onFocus, onBlur, title, style, value, defaultValue, placeholder, id, ...rest } = props;
|
100
100
|
const { fieldErrors } = useForm();
|
101
101
|
const [isFocused, setIsFocused] = useState(false);
|
102
102
|
const textareaRef = useRef(null);
|
@@ -123,6 +123,6 @@ function Textarea(props) {
|
|
123
123
|
if (onBlur)
|
124
124
|
onBlur(e);
|
125
125
|
}
|
126
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsx("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: _jsx("textarea", { id: textareaId, disabled: disabled, readOnly: readOnly, ref: textareaRef, onFocus: handleFocus, onBlur: handleBlur, ...rest }) }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
126
|
+
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsx("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: _jsx("textarea", { id: textareaId, disabled: disabled, readOnly: readOnly, ref: textareaRef, onFocus: handleFocus, onBlur: handleBlur, placeholder: disabled ? value || placeholder : placeholder, value: disabled ? undefined : value, ...rest }) }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
127
127
|
}
|
128
128
|
export { Textarea };
|