@paroicms/react-ui 0.5.10 → 0.5.11
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/dist/InputText.d.ts +2 -1
- package/dist/InputText.js +3 -3
- package/dist/PasswordInput.d.ts +2 -1
- package/dist/PasswordInput.js +2 -2
- package/dist/Textarea.d.ts +2 -1
- package/dist/Textarea.js +2 -2
- package/package.json +1 -1
package/dist/InputText.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ export interface InputTextProps extends Omit<InputHTMLAttributes<HTMLInputElemen
|
|
|
6
6
|
label?: string;
|
|
7
7
|
error?: string;
|
|
8
8
|
className?: string;
|
|
9
|
+
inputClassName?: string;
|
|
9
10
|
endElement?: ReactNode;
|
|
10
11
|
icon?: ReactNode;
|
|
11
12
|
iconPosition?: "left" | "right";
|
|
12
13
|
}
|
|
13
|
-
export declare function InputText({ value, onChange, label, error, className, endElement, icon, iconPosition, ...rest }: InputTextProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function InputText({ value, onChange, label, error, className, inputClassName, endElement, icon, iconPosition, ...rest }: InputTextProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/InputText.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import "../styles/InputText.css";
|
|
4
|
-
export function InputText({ value, onChange, label, error, className, endElement, icon, iconPosition = "left", ...rest }) {
|
|
4
|
+
export function InputText({ value, onChange, label, error, className, inputClassName, endElement, icon, iconPosition = "left", ...rest }) {
|
|
5
5
|
const handleChange = (e) => {
|
|
6
6
|
onChange?.(e.target.value, e);
|
|
7
7
|
};
|
|
8
|
-
const inputElement = (_jsx("input", { className: "PaTextInput", value: value, onChange: handleChange, ...rest }));
|
|
8
|
+
const inputElement = (_jsx("input", { className: clsx("PaTextInput", inputClassName), value: value, onChange: handleChange, ...rest }));
|
|
9
9
|
const hasWrapper = Boolean(endElement || icon);
|
|
10
10
|
const fieldContent = endElement ? (_jsxs("span", { className: "PaTextField-row", children: [inputElement, endElement] })) : icon ? (_jsxs("span", { className: clsx("PaTextField-iconWrapper", iconPosition === "right" && "iconRight"), children: [_jsx("span", { className: "PaTextField-icon", children: icon }), inputElement] })) : (inputElement);
|
|
11
|
-
return (_jsxs(_Fragment, { children: [label ? (_jsxs("label", { className: clsx("PaTextField PaField", error && "error", className), children: [_jsx("span", { className: "PaField-label", children: label }), fieldContent] })) : hasWrapper ? (_jsx("span", { className: clsx("PaTextField", error && "error", className), children: fieldContent })) : (_jsx("input", { className: clsx("PaTextInput", className), value: value, onChange: handleChange, ...rest })), error && _jsx("span", { className: "PaFieldError", children: error })] }));
|
|
11
|
+
return (_jsxs(_Fragment, { children: [label ? (_jsxs("label", { className: clsx("PaTextField PaField", error && "error", className), children: [_jsx("span", { className: "PaField-label", children: label }), fieldContent] })) : hasWrapper ? (_jsx("span", { className: clsx("PaTextField", error && "error", className), children: fieldContent })) : (_jsx("input", { className: clsx("PaTextInput", inputClassName, className), value: value, onChange: handleChange, ...rest })), error && _jsx("span", { className: "PaFieldError", children: error })] }));
|
|
12
12
|
}
|
package/dist/PasswordInput.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "../styles/PasswordInput.css";
|
|
2
2
|
import { type ChangeEvent, type InputHTMLAttributes, type Ref } from "react";
|
|
3
3
|
export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
|
|
4
|
+
inputClassName?: string;
|
|
4
5
|
value?: string;
|
|
5
6
|
onChange?: (value: string, ev: ChangeEvent<HTMLInputElement>) => void;
|
|
6
7
|
label?: string;
|
|
7
8
|
error?: string;
|
|
8
9
|
ref?: Ref<HTMLInputElement>;
|
|
9
10
|
}
|
|
10
|
-
export declare function PasswordInput({ className, label, error, value, onChange, ref, ...props }: PasswordInputProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function PasswordInput({ className, inputClassName, label, error, value, onChange, ref, ...props }: PasswordInputProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/PasswordInput.js
CHANGED
|
@@ -3,11 +3,11 @@ import "../styles/PasswordInput.css";
|
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
4
|
import { Eye, EyeOff } from "lucide-react";
|
|
5
5
|
import { useState } from "react";
|
|
6
|
-
export function PasswordInput({ className, label, error, value, onChange, ref, ...props }) {
|
|
6
|
+
export function PasswordInput({ className, inputClassName, label, error, value, onChange, ref, ...props }) {
|
|
7
7
|
const [visible, setVisible] = useState(false);
|
|
8
8
|
const handleChange = (e) => {
|
|
9
9
|
onChange?.(e.target.value, e);
|
|
10
10
|
};
|
|
11
|
-
const inputWithToggle = (_jsxs("span", { className: clsx("PaPasswordInput-inputWrapper", error && "error"), children: [_jsx("input", { ref: ref, type: visible ? "text" : "password", className: "PaPasswordInput-input", value: value, onChange: handleChange, ...props }), _jsx("button", { type: "button", className: "PaPasswordInput-toggle", onClick: () => setVisible(!visible), tabIndex: -1, "aria-label": visible ? "Hide password" : "Show password", children: visible ? _jsx(EyeOff, { size: 16 }) : _jsx(Eye, { size: 16 }) })] }));
|
|
11
|
+
const inputWithToggle = (_jsxs("span", { className: clsx("PaPasswordInput-inputWrapper", error && "error"), children: [_jsx("input", { ref: ref, type: visible ? "text" : "password", className: clsx("PaPasswordInput-input", inputClassName), value: value, onChange: handleChange, ...props }), _jsx("button", { type: "button", className: "PaPasswordInput-toggle", onClick: () => setVisible(!visible), tabIndex: -1, "aria-label": visible ? "Hide password" : "Show password", children: visible ? _jsx(EyeOff, { size: 16 }) : _jsx(Eye, { size: 16 }) })] }));
|
|
12
12
|
return (_jsxs(_Fragment, { children: [label ? (_jsxs("label", { className: clsx("PaPasswordInput PaField", error && "error", className), children: [_jsx("span", { className: "PaField-label", children: label }), inputWithToggle] })) : (inputWithToggle), error && _jsx("span", { className: "PaFieldError", children: error })] }));
|
|
13
13
|
}
|
package/dist/Textarea.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "../styles/Textarea.css";
|
|
2
2
|
import type { ChangeEvent, Ref, TextareaHTMLAttributes } from "react";
|
|
3
3
|
export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> {
|
|
4
|
+
inputClassName?: string;
|
|
4
5
|
value?: string;
|
|
5
6
|
onChange?: (value: string, ev: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
6
7
|
label?: string;
|
|
7
8
|
error?: string;
|
|
8
9
|
ref?: Ref<HTMLTextAreaElement>;
|
|
9
10
|
}
|
|
10
|
-
export declare function Textarea({ className, label, error, value, onChange, ref, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function Textarea({ className, inputClassName, label, error, value, onChange, ref, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/Textarea.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import "../styles/Textarea.css";
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
|
-
export function Textarea({ className, label, error, value, onChange, ref, ...props }) {
|
|
4
|
+
export function Textarea({ className, inputClassName, label, error, value, onChange, ref, ...props }) {
|
|
5
5
|
const handleChange = (e) => {
|
|
6
6
|
onChange?.(e.target.value, e);
|
|
7
7
|
};
|
|
8
|
-
const textareaElement = (_jsx("textarea", { ref: ref, className: clsx("PaTextarea", error && "error", !label && className), value: value, onChange: handleChange, ...props }));
|
|
8
|
+
const textareaElement = (_jsx("textarea", { ref: ref, className: clsx("PaTextarea", error && "error", inputClassName, !label && className), value: value, onChange: handleChange, ...props }));
|
|
9
9
|
return (_jsxs(_Fragment, { children: [label ? (_jsxs("label", { className: clsx("PaField", error && "error", className), children: [_jsx("span", { className: "PaField-label", children: label }), textareaElement] })) : (textareaElement), error && _jsx("span", { className: "PaFieldError", children: error })] }));
|
|
10
10
|
}
|