@dust-tt/sparkle 0.2.248 → 0.2.249
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/cjs/index.js +5 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Input.d.ts +2 -1
- package/dist/esm/components/Input.d.ts.map +1 -1
- package/dist/esm/components/Input.js +6 -5
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/Searchbar.d.ts +9 -7
- package/dist/esm/components/Searchbar.d.ts.map +1 -1
- package/dist/esm/components/Searchbar.js.map +1 -1
- package/dist/esm/stories/Input.stories.d.ts +14 -2
- package/dist/esm/stories/Input.stories.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Input.tsx +76 -65
- package/src/components/Searchbar.tsx +12 -11
package/dist/cjs/index.js
CHANGED
|
@@ -107177,11 +107177,11 @@ var sizeInputClasses = {
|
|
|
107177
107177
|
sm: "s-text-base s-rounded-md s-py-1.5 s-pl-4 s-pr-8",
|
|
107178
107178
|
md: "s-text-lg s-rounded-lg s-py-2 s-pl-4 s-pr-10",
|
|
107179
107179
|
};
|
|
107180
|
-
|
|
107181
|
-
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;
|
|
107180
|
+
var Input = React.forwardRef(function (_a, ref) {
|
|
107181
|
+
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, maxLength = _a.maxLength;
|
|
107182
107182
|
return (React.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
|
|
107183
107183
|
label && (React.createElement("label", { htmlFor: name, className: "s-pb-1 s-text-sm s-font-medium s-text-element-700 dark:s-text-element-700-dark" }, label)),
|
|
107184
|
-
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-placeholder-element-700", "dark:s-bg-structure-50-dark dark:s-placeholder-element-700-dark", sizeInputClasses[size], "s-transition-all s-duration-300 s-ease-out", className !== null && className !== void 0 ? className : "", !error
|
|
107184
|
+
React.createElement("input", { ref: ref, type: isPassword ? "password" : "text", name: name, id: name, maxLength: maxLength, 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-placeholder-element-700", "dark:s-bg-structure-50-dark dark:s-placeholder-element-700-dark", sizeInputClasses[size], "s-transition-all s-duration-300 s-ease-out", className !== null && className !== void 0 ? className : "", !error
|
|
107185
107185
|
? classNames("s-ring-structure-200 focus:s-ring-action-300", "dark:s-ring-structure-300-dark dark:focus:s-ring-action-300-dark")
|
|
107186
107186
|
: classNames("s-ring-warning-200 focus:s-ring-warning-300", "dark:s-ring-warning-200-dark dark:focus:s-ring-warning-300-dark"), disabled
|
|
107187
107187
|
? "s-text-element-500 hover:s-cursor-not-allowed"
|
|
@@ -107189,7 +107189,8 @@ function Input(_a) {
|
|
|
107189
107189
|
onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
|
|
107190
107190
|
}, "data-1p-ignore": !isPassword, disabled: disabled }),
|
|
107191
107191
|
React.createElement("div", { className: "s-ml-2 s-text-sm s-text-warning-500" }, showErrorLabel && error ? error : null)));
|
|
107192
|
-
}
|
|
107192
|
+
});
|
|
107193
|
+
Input.displayName = "Input";
|
|
107193
107194
|
|
|
107194
107195
|
function ok$2() {}
|
|
107195
107196
|
|