{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "adminlte-tabs", "title": "AdminLTE Tabs", "description": "Tab navigation with colored header variants, custom box styling, header tools slot, and top/bottom position.", "registryDependencies": [ "https://raw.githubusercontent.com/dnachavez/adminlte-next/master/public/r/adminlte-theme.json" ], "files": [ { "path": "registry/new-york/adminlte-tabs/ui/adminlte-tabs.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/registry/new-york/adminlte-theme/lib/cn\"\n\ntype TabsVariant = \"default\" | \"primary\" | \"info\" | \"success\" | \"warning\" | \"danger\"\n\nconst tabsHeaderStyles: Record = {\n default: \"bg-[#f4f4f4]\",\n primary: \"bg-[#3c8dbc]\",\n info: \"bg-[#00c0ef]\",\n success: \"bg-[#00a65a]\",\n warning: \"bg-[#f39c12]\",\n danger: \"bg-[#dd4b39]\",\n}\n\nconst tabActiveStyles: Record = {\n default: \"bg-white text-[#444] border-t-[3px] border-t-[#3c8dbc]\",\n primary: \"bg-white text-[#444] border-t-[3px] border-t-[#3c8dbc]\",\n info: \"bg-white text-[#444] border-t-[3px] border-t-[#00c0ef]\",\n success: \"bg-white text-[#444] border-t-[3px] border-t-[#00a65a]\",\n warning: \"bg-white text-[#444] border-t-[3px] border-t-[#f39c12]\",\n danger: \"bg-white text-[#444] border-t-[3px] border-t-[#dd4b39]\",\n}\n\ninterface Tab {\n id: string\n label: React.ReactNode\n content: React.ReactNode\n icon?: React.ReactNode\n disabled?: boolean\n}\n\ninterface AdminLTETabsProps extends React.HTMLAttributes {\n tabs: Tab[]\n variant?: TabsVariant\n defaultActiveTab?: string\n activeTab?: string\n onTabChange?: (tabId: string) => void\n position?: \"top\" | \"bottom\" | \"left\" | \"right\"\n headerTools?: React.ReactNode\n custom?: boolean\n}\n\nconst AdminLTETabs = React.forwardRef(\n (\n {\n className,\n tabs,\n variant = \"default\",\n defaultActiveTab,\n activeTab: controlledActiveTab,\n onTabChange,\n position = \"top\",\n headerTools,\n custom = true,\n ...props\n },\n ref\n ) => {\n const [internalActiveTab, setInternalActiveTab] = React.useState(\n defaultActiveTab || tabs[0]?.id || \"\"\n )\n const activeTab = controlledActiveTab ?? internalActiveTab\n\n const handleTabClick = (tabId: string) => {\n setInternalActiveTab(tabId)\n onTabChange?.(tabId)\n }\n\n const tabNav = (\n \n {tabs.map((tab) => (\n
  • \n !tab.disabled && handleTabClick(tab.id)}\n disabled={tab.disabled}\n >\n {tab.icon && {tab.icon}}\n {tab.label}\n \n
  • \n ))}\n {headerTools && (\n
  • \n {headerTools}\n
  • \n )}\n \n )\n\n const tabContent = (\n \n {tabs.map((tab) => (\n \n {tab.content}\n \n ))}\n \n )\n\n return (\n \n {position === \"bottom\" ? (\n <>\n {tabContent}\n {tabNav}\n \n ) : (\n <>\n {tabNav}\n {tabContent}\n \n )}\n \n )\n }\n)\nAdminLTETabs.displayName = \"AdminLTETabs\"\n\nexport { AdminLTETabs }\nexport type { AdminLTETabsProps, Tab, TabsVariant }\n", "type": "registry:ui" } ], "type": "registry:ui" }