@dust-tt/sparkle 0.2.116 → 0.2.117
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.
|
@@ -10,6 +10,7 @@ type InputProps = {
|
|
|
10
10
|
isPassword?: boolean;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
className?: string;
|
|
13
|
+
label?: string;
|
|
13
14
|
};
|
|
14
|
-
export declare function Input({ placeholder, value, size, onChange, error, showErrorLabel, name, isPassword, disabled, className, }: InputProps): React.JSX.Element;
|
|
15
|
+
export declare function Input({ placeholder, value, size, onChange, error, showErrorLabel, name, isPassword, disabled, className, label, }: InputProps): React.JSX.Element;
|
|
15
16
|
export {};
|
package/dist/cjs/index.js
CHANGED
|
@@ -33806,8 +33806,9 @@ var sizeInputClasses = {
|
|
|
33806
33806
|
md: "s-text-lg s-rounded-lg s-py-2 s-pl-4 s-pr-10",
|
|
33807
33807
|
};
|
|
33808
33808
|
function Input(_a) {
|
|
33809
|
-
var placeholder = _a.placeholder, value = _a.value, _b = _a.size, size = _b === void 0 ? "sm" : _b, onChange = _a.onChange, error = _a.error, _c = _a.showErrorLabel, showErrorLabel = _c === void 0 ? false : _c, name = _a.name, _d = _a.isPassword, isPassword = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.className, className = _f === void 0 ? "" : _f;
|
|
33809
|
+
var placeholder = _a.placeholder, value = _a.value, _b = _a.size, size = _b === void 0 ? "sm" : _b, onChange = _a.onChange, error = _a.error, _c = _a.showErrorLabel, showErrorLabel = _c === void 0 ? false : _c, name = _a.name, _d = _a.isPassword, isPassword = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.className, className = _f === void 0 ? "" : _f, label = _a.label;
|
|
33810
33810
|
return (React.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
|
|
33811
|
+
label && (React.createElement("label", { htmlFor: name, className: "s-text-sm s-text-element-800 dark:s-text-element-800-dark" }, label)),
|
|
33811
33812
|
React.createElement("input", { type: isPassword ? "password" : "text", name: name, id: name, className: classNames("s-w-full s-border-0 s-outline-none s-ring-1 focus:s-outline-none focus:s-ring-2", "s-bg-structure-50 s-text-element-900 s-placeholder-element-600", "dark:s-bg-structure-50-dark dark:s-text-element-800-dark dark:s-placeholder-element-600-dark", sizeInputClasses[size], "s-transition-all s-duration-300 s-ease-out", className !== null && className !== void 0 ? className : "", !error
|
|
33812
33813
|
? classNames("s-ring-structure-200 focus:s-ring-action-300", "dark:s-ring-structure-300-dark dark:focus:s-ring-action-300-dark")
|
|
33813
33814
|
: classNames("s-ring-warning-200 focus:s-ring-warning-300", "dark:s-ring-warning-200-dark dark:focus:s-ring-warning-300-dark")), placeholder: placeholder, value: value !== null && value !== void 0 ? value : "", onChange: function (e) {
|