@vela-ui/react
Version:
Vela UI React components
72 lines (68 loc) • 2.5 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/components/textarea.tsx
var textarea_exports = {};
__export(textarea_exports, {
Textarea: () => Textarea
});
module.exports = __toCommonJS(textarea_exports);
var import_react_aria_components = require("react-aria-components");
var import_tailwind_variants2 = require("tailwind-variants");
// src/lib/classes.ts
var import_tailwind_variants = require("tailwind-variants");
var focusRing = (0, import_tailwind_variants.tv)({
base: "outline-hidden",
variants: {
isFocusVisible: {
true: "border-ring ring-ring/50 ring-[3px]"
},
isInvalid: {
true: "ring-destructive/20 dark:ring-destructive/40 border-destructive"
}
}
});
// src/components/textarea.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var textAreaVariants = (0, import_tailwind_variants2.tv)({
extend: focusRing,
base: "border-input placeholder:text-muted-foreground dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
variants: {
isFocused: focusRing.variants.isFocusVisible
}
});
function Textarea({ className, ...props }) {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_react_aria_components.TextArea,
{
"data-slot": "textarea",
className: (0, import_react_aria_components.composeRenderProps)(
className,
(className2, renderProps) => textAreaVariants({
...renderProps,
className: className2
})
),
...props
}
);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Textarea
});