bmj-ui 1.0.5 → 1.0.6
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.
- package/package.json +1 -2
- package/src/components/ThemeToggle.tsx +1 -1
- package/src/components/bmj-ui/AppSidebar.tsx +2 -2
- package/src/components/bmj-ui/ChartCard.tsx +4 -4
- package/src/components/bmj-ui/DashboardLayout.tsx +4 -4
- package/src/components/bmj-ui/StatCard.tsx +4 -4
- package/src/components/bmj-ui/Topbar.tsx +6 -6
- package/src/components/bmj-ui/index.ts +5 -5
- package/src/components/index.ts +5 -0
- package/src/components/ui/badge.tsx +1 -1
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/dialog.tsx +2 -2
- package/src/components/ui/dropdown-menu.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/scroll-area.tsx +1 -1
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/separator.tsx +1 -1
- package/src/components/ui/sheet.tsx +2 -2
- package/src/components/ui/sidebar.tsx +8 -8
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/table.tsx +1 -1
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/index.ts +1 -7
- package/tsconfig.json +2 -2
- package/dist/index.d.ts +0 -53
- package/dist/index.js +0 -76
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -76
- package/dist/index.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bmj-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Headless component library meticulously crafted for rapid dashboard development. Professional, polished, and ready for production.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.mjs",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
|
-
"type": "module",
|
|
11
10
|
"scripts": {
|
|
12
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
13
12
|
"rollup": "rollup -c --bundleConfigAsCjs"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Moon, Sun } from "lucide-react";
|
|
3
|
-
import { Button } from "./ui/button
|
|
3
|
+
import { Button } from "./ui/button";
|
|
4
4
|
|
|
5
5
|
export function ThemeToggle({ className }: { className?: string }) {
|
|
6
6
|
const [theme, setTheme] = React.useState<"light" | "dark">(() => {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
SidebarGroupLabel,
|
|
12
12
|
SidebarGroupContent,
|
|
13
13
|
useSidebar,
|
|
14
|
-
} from "../ui/sidebar
|
|
14
|
+
} from "../ui/sidebar";
|
|
15
15
|
import {
|
|
16
16
|
LayoutDashboard,
|
|
17
17
|
Settings,
|
|
@@ -39,7 +39,7 @@ export interface SidebarItem {
|
|
|
39
39
|
url: string;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export function AppSidebar({
|
|
42
|
+
export default function AppSidebar({
|
|
43
43
|
items = defaultItems,
|
|
44
44
|
onItemClick,
|
|
45
45
|
activeItem,
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
CardHeader,
|
|
5
5
|
CardTitle,
|
|
6
6
|
CardDescription,
|
|
7
|
-
} from "../ui/card
|
|
8
|
-
import { Skeleton } from "../ui/skeleton
|
|
7
|
+
} from "../ui/card";
|
|
8
|
+
import { Skeleton } from "../ui/skeleton";
|
|
9
9
|
import {
|
|
10
10
|
ResponsiveContainer,
|
|
11
11
|
AreaChart,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
Tooltip,
|
|
22
22
|
CartesianGrid,
|
|
23
23
|
} from "recharts";
|
|
24
|
-
import { cn } from "../../lib/utils
|
|
24
|
+
import { cn } from "../../lib/utils";
|
|
25
25
|
|
|
26
26
|
interface ChartCardProps {
|
|
27
27
|
title: string;
|
|
@@ -35,7 +35,7 @@ interface ChartCardProps {
|
|
|
35
35
|
type?: "area" | "bar" | "line" | "scatter";
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export function ChartCard({
|
|
38
|
+
export default function ChartCard({
|
|
39
39
|
title,
|
|
40
40
|
description,
|
|
41
41
|
data,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { SidebarProvider, SidebarInset } from "../ui/sidebar
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { SidebarProvider, SidebarInset } from "../ui/sidebar";
|
|
3
|
+
import AppSidebar, { SidebarItem } from "./AppSidebar";
|
|
4
|
+
import Topbar from "./Topbar";
|
|
5
5
|
|
|
6
6
|
interface DashboardLayoutProps {
|
|
7
7
|
children: React.ReactNode;
|
|
@@ -10,7 +10,7 @@ interface DashboardLayoutProps {
|
|
|
10
10
|
activeSidebarItem?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export function DashboardLayout({
|
|
13
|
+
export default function DashboardLayout({
|
|
14
14
|
children,
|
|
15
15
|
sidebarItems,
|
|
16
16
|
onSidebarItemClick,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Card, CardContent, CardHeader, CardTitle } from "../ui/card
|
|
2
|
-
import { Skeleton } from "../ui/skeleton
|
|
1
|
+
import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
|
|
2
|
+
import { Skeleton } from "../ui/skeleton";
|
|
3
3
|
import { TrendingUp, TrendingDown, LucideIcon } from "lucide-react";
|
|
4
|
-
import { cn } from "../../lib/utils
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
5
|
import { motion } from "motion/react";
|
|
6
6
|
|
|
7
7
|
interface StatCardProps {
|
|
@@ -17,7 +17,7 @@ interface StatCardProps {
|
|
|
17
17
|
loading?: boolean;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function StatCard({
|
|
20
|
+
export default function StatCard({
|
|
21
21
|
title,
|
|
22
22
|
value,
|
|
23
23
|
description,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SidebarTrigger } from "../ui/sidebar
|
|
2
|
-
import { ThemeToggle } from "../ThemeToggle
|
|
1
|
+
import { SidebarTrigger } from "../ui/sidebar";
|
|
2
|
+
import { ThemeToggle } from "../ThemeToggle";
|
|
3
3
|
import {
|
|
4
4
|
Search,
|
|
5
5
|
Bell,
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
Zap,
|
|
10
10
|
LogOut,
|
|
11
11
|
} from "lucide-react";
|
|
12
|
-
import { Input } from "../ui/input
|
|
13
|
-
import { Button } from "../ui/button
|
|
12
|
+
import { Input } from "../ui/input";
|
|
13
|
+
import { Button } from "../ui/button";
|
|
14
14
|
import { toast } from "sonner";
|
|
15
15
|
import {
|
|
16
16
|
DropdownMenu,
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
DropdownMenuLabel,
|
|
21
21
|
DropdownMenuSeparator,
|
|
22
22
|
DropdownMenuTrigger,
|
|
23
|
-
} from "../ui/dropdown-menu
|
|
23
|
+
} from "../ui/dropdown-menu";
|
|
24
24
|
|
|
25
|
-
export function Topbar() {
|
|
25
|
+
export default function Topbar() {
|
|
26
26
|
const handleItemClick = (label: string) => {
|
|
27
27
|
toast.info(`${label} clicked`, {
|
|
28
28
|
description: "This feature will be implemented soon.",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export { default as DashboardLayout } from "./DashboardLayout";
|
|
2
|
+
export { default as StatCard } from "./StatCard";
|
|
3
|
+
export { default as ChartCard } from "./ChartCard";
|
|
4
|
+
export { default as AppSidebar } from "./AppSidebar";
|
|
5
|
+
export { default as Topbar } from "./Topbar";
|
|
@@ -2,7 +2,7 @@ import { mergeProps } from "@base-ui/react/merge-props";
|
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
3
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
4
|
|
|
5
|
-
import { cn } from "../../lib/utils
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
6
|
|
|
7
7
|
const badgeVariants = cva(
|
|
8
8
|
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
3
|
|
|
4
|
-
import { cn } from "../../lib/utils
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
5
|
|
|
6
6
|
const buttonVariants = cva(
|
|
7
7
|
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
5
5
|
|
|
6
|
-
import { cn } from "../../lib/utils
|
|
7
|
-
import { Button } from "./button
|
|
6
|
+
import { cn } from "../../lib/utils";
|
|
7
|
+
import { Button } from "./button";
|
|
8
8
|
import { XIcon } from "lucide-react";
|
|
9
9
|
|
|
10
10
|
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
3
3
|
|
|
4
|
-
import { cn } from "../../lib/utils
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
5
|
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
6
6
|
|
|
7
7
|
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
3
3
|
|
|
4
|
-
import { cn } from "../../lib/utils
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
5
|
|
|
6
6
|
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
7
7
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
3
3
|
|
|
4
|
-
import { cn } from "../../lib/utils
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
5
|
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
|
|
6
6
|
|
|
7
7
|
const Select = SelectPrimitive.Root;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
3
3
|
|
|
4
|
-
import { cn } from "../../lib/utils
|
|
5
|
-
import { Button } from "./button
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
import { Button } from "./button";
|
|
6
6
|
import { XIcon } from "lucide-react";
|
|
7
7
|
|
|
8
8
|
function Sheet({ ...props }: SheetPrimitive.Root.Props) {
|
|
@@ -5,20 +5,20 @@ import { mergeProps } from "@base-ui/react/merge-props";
|
|
|
5
5
|
import { useRender } from "@base-ui/react/use-render";
|
|
6
6
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
7
7
|
|
|
8
|
-
import { useIsMobile } from "../../hooks/use-mobile
|
|
9
|
-
import { cn } from "../../lib/utils
|
|
10
|
-
import { Button } from "./button
|
|
11
|
-
import { Input } from "./input
|
|
12
|
-
import { Separator } from "./separator
|
|
8
|
+
import { useIsMobile } from "../../hooks/use-mobile";
|
|
9
|
+
import { cn } from "../../lib/utils";
|
|
10
|
+
import { Button } from "./button";
|
|
11
|
+
import { Input } from "./input";
|
|
12
|
+
import { Separator } from "./separator";
|
|
13
13
|
import {
|
|
14
14
|
Sheet,
|
|
15
15
|
SheetContent,
|
|
16
16
|
SheetDescription,
|
|
17
17
|
SheetHeader,
|
|
18
18
|
SheetTitle,
|
|
19
|
-
} from "./sheet
|
|
20
|
-
import { Skeleton } from "./skeleton
|
|
21
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip
|
|
19
|
+
} from "./sheet";
|
|
20
|
+
import { Skeleton } from "./skeleton";
|
|
21
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip";
|
|
22
22
|
import { PanelLeftIcon } from "lucide-react";
|
|
23
23
|
|
|
24
24
|
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ChartCard } from "./components/bmj-ui/ChartCard.js";
|
|
3
|
-
import { DashboardLayout } from "./components/bmj-ui/DashboardLayout.js";
|
|
4
|
-
import { StatCard } from "./components/bmj-ui/StatCard.js";
|
|
5
|
-
import { Topbar } from "./components/bmj-ui/Topbar.js";
|
|
6
|
-
|
|
7
|
-
export { AppSidebar, ChartCard, DashboardLayout, StatCard, Topbar };
|
|
1
|
+
export * from "./components";
|
package/tsconfig.json
CHANGED
package/dist/index.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { LucideIcon } from 'lucide-react';
|
|
4
|
-
|
|
5
|
-
interface SidebarItem {
|
|
6
|
-
title: string;
|
|
7
|
-
icon: React.ElementType;
|
|
8
|
-
url: string;
|
|
9
|
-
}
|
|
10
|
-
declare function AppSidebar({ items, onItemClick, activeItem, }: {
|
|
11
|
-
items?: SidebarItem[];
|
|
12
|
-
onItemClick?: (title: string) => void;
|
|
13
|
-
activeItem?: string;
|
|
14
|
-
}): react_jsx_runtime.JSX.Element;
|
|
15
|
-
|
|
16
|
-
interface ChartCardProps {
|
|
17
|
-
title: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
data: any[];
|
|
20
|
-
dataKey: string;
|
|
21
|
-
categoryKey: string;
|
|
22
|
-
color?: string;
|
|
23
|
-
className?: string;
|
|
24
|
-
loading?: boolean;
|
|
25
|
-
type?: "area" | "bar" | "line" | "scatter";
|
|
26
|
-
}
|
|
27
|
-
declare function ChartCard({ title, description, data, dataKey, categoryKey, color, className, loading, type, }: ChartCardProps): react_jsx_runtime.JSX.Element;
|
|
28
|
-
|
|
29
|
-
interface DashboardLayoutProps {
|
|
30
|
-
children: React.ReactNode;
|
|
31
|
-
sidebarItems?: SidebarItem[];
|
|
32
|
-
onSidebarItemClick?: (title: string) => void;
|
|
33
|
-
activeSidebarItem?: string;
|
|
34
|
-
}
|
|
35
|
-
declare function DashboardLayout({ children, sidebarItems, onSidebarItemClick, activeSidebarItem, }: DashboardLayoutProps): react_jsx_runtime.JSX.Element;
|
|
36
|
-
|
|
37
|
-
interface StatCardProps {
|
|
38
|
-
title: string;
|
|
39
|
-
value: string | number;
|
|
40
|
-
description?: string;
|
|
41
|
-
trend?: {
|
|
42
|
-
value: number;
|
|
43
|
-
isPositive: boolean;
|
|
44
|
-
};
|
|
45
|
-
icon?: LucideIcon;
|
|
46
|
-
className?: string;
|
|
47
|
-
loading?: boolean;
|
|
48
|
-
}
|
|
49
|
-
declare function StatCard({ title, value, description, trend, icon: Icon, className, loading, }: StatCardProps): react_jsx_runtime.JSX.Element;
|
|
50
|
-
|
|
51
|
-
declare function Topbar(): react_jsx_runtime.JSX.Element;
|
|
52
|
-
|
|
53
|
-
export { AppSidebar, ChartCard, DashboardLayout, StatCard, Topbar };
|