@blawness/admin-kit 0.2.0 → 0.2.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,10 +1,8 @@
1
- import type { ComponentType } from "react";
1
+ import type { ReactNode } from "react";
2
2
  export type NavItem = {
3
3
  href: string;
4
4
  label: string;
5
- icon: ComponentType<{
6
- className?: string;
7
- }>;
5
+ icon: ReactNode;
8
6
  adminOnly?: boolean;
9
7
  };
10
8
  export declare function AdminSidebar({ role, navItems, logoSrc, brandName }: {
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/shell/sidebar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAqB,EAAE,SAAmB,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BA0DvK"}
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/shell/sidebar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAqB,EAAE,SAAmB,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAyDvK"}
@@ -11,9 +11,8 @@ export function AdminSidebar({ role, navItems, logoSrc = "/logo.png", brandName
11
11
  .map((l) => {
12
12
  const active = pathname === l.href ||
13
13
  (l.href !== "/admin" && pathname.startsWith(l.href));
14
- const Icon = l.icon;
15
14
  return (_jsxs(Link, { href: l.href, className: `relative flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors ${active
16
15
  ? "bg-white/10 font-medium text-white"
17
- : "text-navy-200 hover:bg-white/5 hover:text-white"}`, children: [active && (_jsx("span", { className: "absolute left-0 top-1/2 h-5 w-1 -translate-y-1/2 rounded-r-full bg-gold-400" })), _jsx(Icon, { className: `h-4 w-4 ${active ? "text-gold-400" : "text-navy-300"}` }), l.label] }, l.href));
16
+ : "text-navy-200 hover:bg-white/5 hover:text-white"}`, children: [active && (_jsx("span", { className: "absolute left-0 top-1/2 h-5 w-1 -translate-y-1/2 rounded-r-full bg-gold-400" })), _jsx("span", { className: `h-4 w-4 shrink-0 ${active ? "text-gold-400" : "text-navy-300"}`, children: l.icon }), l.label] }, l.href));
18
17
  }) }), _jsx("div", { className: "border-t border-white/5 p-3", children: _jsx("form", { action: signOutAction, children: _jsxs("button", { type: "submit", className: "flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-navy-200 transition-colors hover:bg-white/5 hover:text-white", children: [_jsx(LogOut, { className: "h-4 w-4" }), "Keluar"] }) }) })] }));
19
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blawness/admin-kit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Reusable CMS core for Next.js 16 admin panels — auth, media, users, editor, shell",
5
5
  "license": "MIT",
6
6
  "author": "Blawness",
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/Blawness/admin-kit.git"
17
+ "url": "git+https://github.com/Blawness/admin-kit.git"
18
18
  },
19
19
  "homepage": "https://github.com/Blawness/admin-kit",
20
20
  "private": false,
@@ -3,13 +3,13 @@
3
3
  import Link from "next/link";
4
4
  import { usePathname } from "next/navigation";
5
5
  import { LogOut } from "lucide-react";
6
- import type { ComponentType } from "react";
6
+ import type { ReactNode } from "react";
7
7
  import { signOutAction } from "./actions";
8
8
 
9
9
  export type NavItem = {
10
10
  href: string;
11
11
  label: string;
12
- icon: ComponentType<{ className?: string }>;
12
+ icon: ReactNode;
13
13
  adminOnly?: boolean;
14
14
  };
15
15
 
@@ -35,7 +35,6 @@ export function AdminSidebar({ role, navItems, logoSrc = "/logo.png", brandName
35
35
  const active =
36
36
  pathname === l.href ||
37
37
  (l.href !== "/admin" && pathname.startsWith(l.href));
38
- const Icon = l.icon;
39
38
  return (
40
39
  <Link
41
40
  key={l.href}
@@ -49,9 +48,9 @@ export function AdminSidebar({ role, navItems, logoSrc = "/logo.png", brandName
49
48
  {active && (
50
49
  <span className="absolute left-0 top-1/2 h-5 w-1 -translate-y-1/2 rounded-r-full bg-gold-400" />
51
50
  )}
52
- <Icon
53
- className={`h-4 w-4 ${active ? "text-gold-400" : "text-navy-300"}`}
54
- />
51
+ <span className={`h-4 w-4 shrink-0 ${active ? "text-gold-400" : "text-navy-300"}`}>
52
+ {l.icon}
53
+ </span>
55
54
  {l.label}
56
55
  </Link>
57
56
  );