dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
49 lines (48 loc) • 1.48 kB
JavaScript
import { F as R, S as W } from "../../chunks/Search-DunDXQgP.es.js";
import { jsxs as l, jsx as t } from "react/jsx-runtime";
import { p as c } from "../../chunks/index-E1NtSoNr.es.js";
import { Button as f } from "dgz-ui/button";
import { Input as u } from "dgz-ui/form";
import { cn as d } from "dgz-ui/utils";
import { g as h } from "../../chunks/MyInput-ByJ5vTAN.es.js";
import { useState as g } from "react";
import { useTranslation as x } from "react-i18next";
import { K as y } from "../../chunks/Keyboard-CJVAJWdO.es.js";
const C = ({
placeholder: a,
onSearchChange: o,
className: p,
inputProps: s,
...i
}) => {
const { t: n } = x(), [e, m] = g("");
return /* @__PURE__ */ l("div", { ...i, className: d("relative w-full", p), children: [
/* @__PURE__ */ t(
u,
{
...s,
placeholder: a || n("Type text and press CTRL + Enter"),
onInput: (r) => m(h(r, "target.value", "")),
onKeyUp: (r) => {
r.key === y.ENTER && (r.ctrlKey && o(e || void 0), r.stopPropagation(), r.preventDefault());
}
}
),
/* @__PURE__ */ t(
f,
{
type: "button",
variant: "ghost",
className: "text-foreground absolute top-0 right-0 cursor-pointer rounded-md bg-transparent!",
onClick: () => o(e),
children: /* @__PURE__ */ t(c, {})
}
)
] });
};
export {
R as FilterWrapper,
W as Search,
C as SearchWithCtrl
};
//# sourceMappingURL=index.es.js.map