@dust-tt/sparkle 0.2.156 → 0.2.157
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/components/Searchbar.d.ts +7 -7
- package/dist/cjs/index.js +4 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stories/Searchbar.stories.d.ts +10 -2
- package/dist/esm/components/Searchbar.d.ts +7 -7
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stories/Searchbar.stories.d.ts +10 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const Searchbar: React.ForwardRefExoticComponent<{
|
|
3
3
|
placeholder: string;
|
|
4
4
|
value: string | null;
|
|
5
|
-
onChange?: (value: string) => void;
|
|
6
|
-
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
5
|
+
onChange?: ((value: string) => void) | undefined;
|
|
6
|
+
onKeyDown?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
|
|
7
7
|
name: string;
|
|
8
|
-
size?: "xs" | "sm" | "md";
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
8
|
+
size?: "xs" | "sm" | "md" | undefined;
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
package/dist/cjs/index.js
CHANGED
|
@@ -97638,20 +97638,21 @@ var iconClasses = {
|
|
|
97638
97638
|
sm: "s-pr-3",
|
|
97639
97639
|
md: "s-pr-4",
|
|
97640
97640
|
};
|
|
97641
|
-
|
|
97641
|
+
var Searchbar = React.forwardRef(function (_a, ref) {
|
|
97642
97642
|
var placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, onKeyDown = _a.onKeyDown, name = _a.name, _b = _a.size, size = _b === void 0 ? "sm" : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.className, className = _d === void 0 ? "" : _d;
|
|
97643
97643
|
var clearInputField = function () {
|
|
97644
97644
|
onChange === null || onChange === void 0 ? void 0 : onChange("");
|
|
97645
97645
|
};
|
|
97646
97646
|
return (React.createElement("div", { className: "s-relative s-m-px s-flex-grow" },
|
|
97647
|
-
React.createElement("input", { type: "text", name: name, id: name, className: classNames("s-border-0 s-outline-none s-ring-1 s-ring-structure-200 focus:s-outline-none focus:s-ring-2", "s-w-full s-rounded-full s-bg-structure-50 s-font-normal s-placeholder-element-600", "s-ring-structure-200 focus:s-ring-action-300", "dark:s-ring-structure-300-dark dark:focus:s-ring-action-300-dark", "s-transition-all s-duration-300 s-ease-out", sizeClasses[size], className !== null && className !== void 0 ? className : "", disabled
|
|
97647
|
+
React.createElement("input", { type: "text", name: name, id: name, ref: ref, className: classNames("s-border-0 s-outline-none s-ring-1 s-ring-structure-200 focus:s-outline-none focus:s-ring-2", "s-w-full s-rounded-full s-bg-structure-50 s-font-normal s-placeholder-element-600", "s-ring-structure-200 focus:s-ring-action-300", "dark:s-ring-structure-300-dark dark:focus:s-ring-action-300-dark", "s-transition-all s-duration-300 s-ease-out", sizeClasses[size], className !== null && className !== void 0 ? className : "", disabled
|
|
97648
97648
|
? "s-cursor-default s-text-element-600"
|
|
97649
97649
|
: "s-text-element-900"), placeholder: placeholder, value: value !== null && value !== void 0 ? value : "", onChange: function (e) {
|
|
97650
97650
|
onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
|
|
97651
97651
|
}, onKeyDown: onKeyDown, disabled: disabled }),
|
|
97652
97652
|
React.createElement("div", { className: classNames("s-absolute s-inset-y-0 s-right-0 s-flex s-items-center s-pr-3", iconClasses[size]) }, value && onChange ? (React.createElement(IconButton, { icon: SvgXMark$1, variant: "secondary", size: size, onClick: clearInputField })) : (React.createElement("div", { className: classNames(disabled ? "s-text-element-600" : "s-text-element-900") },
|
|
97653
97653
|
React.createElement(Icon, { visual: SvgMagnifyingGlass, size: size }))))));
|
|
97654
|
-
}
|
|
97654
|
+
});
|
|
97655
|
+
Searchbar.displayName = "Searchbar";
|
|
97655
97656
|
|
|
97656
97657
|
var labelClasses = {
|
|
97657
97658
|
base: "s-text-sm s-text-element-800 dark:s-text-element-800-dark",
|