geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
50 lines (49 loc) • 1.66 kB
JavaScript
import * as e from "react";
import { cn as u } from "./index.es85.js";
import { Typography as n } from "./index.es19.js";
import "lucide-react";
import "./index.es56.js";
import "./index.es86.js";
import "./index.es29.js";
import "./index.es35.js";
import { TextAreaVariants as m } from "./index.es101.js";
const g = e.forwardRef(
({ className: o, inputLabel: i, showTextCount: l, maximumTextCount: a, id: d, ...t }, f) => {
const [r, s] = e.useState(!1), c = e.useRef(null);
return e.useEffect(() => {
r && c.current?.focus();
}, [r]), /* @__PURE__ */ e.createElement("div", { id: d }, i && /* @__PURE__ */ e.createElement(n, { variant: "body4", className: "text-light-3" }, i), /* @__PURE__ */ e.createElement(
"textarea",
{
className: u(
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
o,
m({
isFocused: r,
disabled: t.disabled,
className: o
})
),
onFocus: () => s(!0),
onBlur: () => s(!1),
ref: f,
maxLength: a,
...t
}
), l && /* @__PURE__ */ e.createElement(
n,
{
variant: "body4",
className: "text-light-4 mt-1.5 flex justify-end"
},
t.value?.toString().length,
"/",
a
));
}
);
g.displayName = "Textarea";
export {
g as Textarea
};
//# sourceMappingURL=index.es16.js.map