@snacky/ui 0.13.1 → 0.13.2
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/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -72,6 +72,7 @@ interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, '
|
|
|
72
72
|
value: string;
|
|
73
73
|
onChange: (value: string) => void;
|
|
74
74
|
searchIcon?: ReactNode;
|
|
75
|
+
clearIcon?: ReactNode;
|
|
75
76
|
onClear?: () => void;
|
|
76
77
|
}
|
|
77
78
|
/** Snacky Search Field - compact 40px field with a leading search icon and a clear button once filled. */
|
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, '
|
|
|
72
72
|
value: string;
|
|
73
73
|
onChange: (value: string) => void;
|
|
74
74
|
searchIcon?: ReactNode;
|
|
75
|
+
clearIcon?: ReactNode;
|
|
75
76
|
onClear?: () => void;
|
|
76
77
|
}
|
|
77
78
|
/** Snacky Search Field - compact 40px field with a leading search icon and a clear button once filled. */
|
package/dist/index.js
CHANGED
|
@@ -379,9 +379,9 @@ var TextField = forwardRef4(function TextField2({
|
|
|
379
379
|
// src/components/Input/SearchField.tsx
|
|
380
380
|
import { forwardRef as forwardRef5 } from "react";
|
|
381
381
|
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
382
|
-
var SearchField = forwardRef5(function SearchField2({ value, onChange, searchIcon, onClear, className, placeholder = "Search products...", ...rest }, ref) {
|
|
382
|
+
var SearchField = forwardRef5(function SearchField2({ value, onChange, searchIcon, clearIcon, onClear, className, placeholder = "Search products...", ...rest }, ref) {
|
|
383
383
|
return /* @__PURE__ */ jsxs3("div", { className: cx("snacky-search", className), children: [
|
|
384
|
-
|
|
384
|
+
/* @__PURE__ */ jsx6("span", { className: "snacky-search__icon", children: searchIcon ?? /* @__PURE__ */ jsx6(search, { width: 16, height: 16 }) }),
|
|
385
385
|
/* @__PURE__ */ jsx6(
|
|
386
386
|
"input",
|
|
387
387
|
{
|
|
@@ -393,7 +393,7 @@ var SearchField = forwardRef5(function SearchField2({ value, onChange, searchIco
|
|
|
393
393
|
...rest
|
|
394
394
|
}
|
|
395
395
|
),
|
|
396
|
-
value && onClear && /* @__PURE__ */ jsx6("button", { type: "button", className: "snacky-search__clear", onClick: onClear, "aria-label": "Clear search", children:
|
|
396
|
+
value && onClear && /* @__PURE__ */ jsx6("button", { type: "button", className: "snacky-search__clear", onClick: onClear, "aria-label": "Clear search", children: clearIcon ?? /* @__PURE__ */ jsx6(closeInput, { width: 16, height: 16 }) })
|
|
397
397
|
] });
|
|
398
398
|
});
|
|
399
399
|
|