@codeswayam/ui 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
5
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
4
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
+ size?: "icon" | "default" | "sm" | "lg" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
8
  asChild?: boolean;
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ export interface ModalProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ title?: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ icon?: React.ReactNode;
8
+ children: React.ReactNode;
9
+ className?: string;
10
+ /** Max width class, e.g. "max-w-md" (default) or "max-w-2xl" */
11
+ maxWidth?: string;
12
+ }
13
+ export declare function Modal({ open, onClose, title, description, icon, children, className, maxWidth, }: ModalProps): import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/base/modal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,QAAqB,GACtB,EAAE,UAAU,2CAqDZ"}
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
4
+ import { X } from "lucide-react";
5
+ import { cn } from "../../utils/cn";
6
+ export function Modal({ open, onClose, title, description, icon, children, className, maxWidth = "max-w-md", }) {
7
+ return (_jsx(DialogPrimitive.Root, { open: open, onOpenChange: (o) => !o && onClose(), children: _jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Overlay, { className: "fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }), _jsxs(DialogPrimitive.Content, { className: cn("fixed left-1/2 top-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2", "bg-background border border-border rounded-2xl shadow-2xl overflow-hidden", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]", "data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", maxWidth, className), children: [(title || description || icon) && (_jsxs("div", { className: "flex items-center justify-between px-6 py-5 border-b border-border bg-secondary/20", children: [_jsxs("div", { className: "flex items-center gap-3", children: [icon && (_jsx("div", { className: "w-10 h-10 rounded-xl bg-primary/15 border border-primary/30 flex items-center justify-center shrink-0", children: icon })), _jsxs("div", { children: [title && (_jsx(DialogPrimitive.Title, { className: "font-bold text-base leading-none", children: title })), description && (_jsx(DialogPrimitive.Description, { className: "text-xs text-muted-foreground mt-0.5", children: description }))] })] }), _jsxs(DialogPrimitive.Close, { onClick: onClose, className: "w-8 h-8 rounded-lg hover:bg-secondary flex items-center justify-center transition-colors", children: [_jsx(X, { size: 15 }), _jsx("span", { className: "sr-only", children: "Close" })] })] })), _jsx("div", { className: "p-6", children: children })] })] }) }));
8
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./components/base/modal";
1
2
  export * from "./components/base/button";
2
3
  export * from "./components/base/card";
3
4
  export * from "./components/base/badge";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAGhD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AAGjD,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAGhD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AAGjD,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // Base components
2
+ export * from "./components/base/modal";
2
3
  export * from "./components/base/button";
3
4
  export * from "./components/base/card";
4
5
  export * from "./components/base/badge";