UNPKG

@vela-ui/react

Version:

Vela UI React components

90 lines (86 loc) 3 kB
"use strict"; 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/alert.tsx var alert_exports = {}; __export(alert_exports, { Alert: () => Alert, AlertDescription: () => AlertDescription, AlertTitle: () => AlertTitle }); module.exports = __toCommonJS(alert_exports); var import_tailwind_variants = require("tailwind-variants"); // src/lib/utils.ts var import_clsx = require("clsx"); var import_react_aria_components = require("react-aria-components"); var import_tailwind_merge = require("tailwind-merge"); var cn = (...inputs) => (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(...inputs)); // src/components/alert.tsx var import_jsx_runtime = require("react/jsx-runtime"); var alertVariants = (0, import_tailwind_variants.tv)({ base: "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", variants: { variant: { default: "bg-card text-card-foreground", destructive: "text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current" } }, defaultVariants: { variant: "default" } }); function Alert({ className, variant, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "div", { "data-slot": "alert", role: "alert", className: alertVariants({ variant, className }), ...props } ); } function AlertTitle({ className, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "div", { "data-slot": "alert-title", className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className), ...props } ); } function AlertDescription({ className, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "div", { "data-slot": "alert-description", className: cn( "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", className ), ...props } ); } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Alert, AlertDescription, AlertTitle });