@chittyos/shared
Version:
ChittyOS Shared Dependencies Framework - Consolidated dependencies for all ChittyOS components
155 lines (150 loc) • 4.8 kB
JavaScript
import {
cn
} from "./chunk-ADIDI7AJ.js";
// src/ui/components/button.tsx
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva } from "class-variance-authority";
import { jsx } from "react/jsx-runtime";
var buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
chitty: "bg-chitty-primary text-white hover:bg-chitty-primary/90"
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10"
}
},
defaultVariants: {
variant: "default",
size: "default"
}
}
);
var Button = React.forwardRef(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return /* @__PURE__ */ jsx(
Comp,
{
className: cn(buttonVariants({ variant, size, className })),
ref,
...props
}
);
}
);
Button.displayName = "Button";
// src/ui/components/card.tsx
import * as React2 from "react";
import { jsx as jsx2 } from "react/jsx-runtime";
var Card = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
"div",
{
ref,
className: cn(
"rounded-lg border bg-card text-card-foreground shadow-sm",
className
),
...props
}
));
Card.displayName = "Card";
var CardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
"div",
{
ref,
className: cn("flex flex-col space-y-1.5 p-6", className),
...props
}
));
CardHeader.displayName = "CardHeader";
var CardTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
"h3",
{
ref,
className: cn(
"text-2xl font-semibold leading-none tracking-tight",
className
),
...props
}
));
CardTitle.displayName = "CardTitle";
var CardDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
"p",
{
ref,
className: cn("text-sm text-muted-foreground", className),
...props
}
));
CardDescription.displayName = "CardDescription";
var CardContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2("div", { ref, className: cn("p-6 pt-0", className), ...props }));
CardContent.displayName = "CardContent";
var CardFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
"div",
{
ref,
className: cn("flex items-center p-6 pt-0", className),
...props
}
));
CardFooter.displayName = "CardFooter";
// src/ui/components/chitty-logo.tsx
import * as React3 from "react";
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
var ChittyLogo = React3.forwardRef(
({ className, size = "md", variant = "full", ...props }, ref) => {
const sizeClasses = {
sm: "h-6 text-sm",
md: "h-8 text-base",
lg: "h-12 text-lg",
xl: "h-16 text-xl"
};
return /* @__PURE__ */ jsxs(
"div",
{
ref,
className: cn(
"flex items-center gap-2 font-bold text-chitty-primary",
sizeClasses[size],
className
),
...props,
children: [
(variant === "full" || variant === "icon") && /* @__PURE__ */ jsx3("div", { className: cn(
"rounded-lg bg-gradient-to-br from-chitty-primary to-chitty-secondary flex items-center justify-center text-white font-black",
size === "sm" && "w-6 h-6 text-xs",
size === "md" && "w-8 h-8 text-sm",
size === "lg" && "w-12 h-12 text-lg",
size === "xl" && "w-16 h-16 text-xl"
), children: "C" }),
(variant === "full" || variant === "text") && /* @__PURE__ */ jsx3("span", { className: "bg-gradient-to-r from-chitty-primary to-chitty-secondary bg-clip-text text-transparent", children: "ChittyOS" })
]
}
);
}
);
ChittyLogo.displayName = "ChittyLogo";
export {
Button,
Card,
CardHeader,
CardTitle,
CardDescription,
CardContent,
CardFooter,
ChittyLogo
};