{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"collapsible-icon-rail-sidebar-that-expands","type":"registry:component","title":"Collapsible Icon Rail Sidebar That Expands","description":"","dependencies":[],"files":[{"path":"components/we-inc/collapsible-icon-rail-sidebar-that-expands.tsx","type":"registry:component","content":"import { useState } from \"react\";\n\n// Sidebar links. Each icon is one 24x24 stroke path.\nconst links = [\n  { label: \"Overview\", path: \"M4 13h6V4H4zM14 20h6v-9h-6zM14 4v4h6V4zM4 20h6v-3H4z\", current: true },\n  { label: \"Orders\", path: \"M5 7h14l-1.5 12h-11zM9 7a3 3 0 016 0\" },\n  { label: \"Customers\", path: \"M9 11a3.5 3.5 0 100-7 3.5 3.5 0 000 7zM3 20a6 6 0 0112 0M16 4.5a3.5 3.5 0 010 6.5M21 20a6 6 0 00-4-5.6\" },\n  { label: \"Products\", path: \"M12 3l8 4.5v9L12 21l-8-4.5v-9zM4 7.5l8 4.5 8-4.5M12 12v9\" },\n  { label: \"Reports\", path: \"M4 20V10M10 20V4M16 20v-7M22 20H2\" },\n  { label: \"Settings\", path: \"M12 15a3 3 0 100-6 3 3 0 000 6zM19 12a7 7 0 00-.1-1.2l2-1.6-2-3.4-2.4 1a7 7 0 00-2-1.2L14 3h-4l-.5 2.6a7 7 0 00-2 1.2l-2.4-1-2 3.4 2 1.6a7 7 0 000 2.4l-2 1.6 2 3.4 2.4-1a7 7 0 002 1.2L10 21h4l.5-2.6a7 7 0 002-1.2l2.4 1 2-3.4-2-1.6c.1-.4.1-.8.1-1.2z\" },\n];\n\nfunction Icon({ d }: { d: string }) {\n  return (\n    <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" className=\"shrink-0\" aria-hidden=\"true\"><path d={d} /></svg>\n  );\n}\n\nexport default function CollapsibleIconRailSidebarThatExpands() {\n  const [expanded, setExpanded] = useState(true);\n\n  return (\n    <div className=\"bg-slate-100 px-4 py-10 sm:px-8\">\n      <div className=\"mx-auto flex h-[460px] max-w-4xl overflow-hidden rounded-2xl bg-white ring-1 ring-slate-200\">\n        <aside className={`flex shrink-0 flex-col border-r border-slate-200 bg-slate-50 p-3 transition-[width] duration-200 ease-out motion-reduce:transition-none ${expanded ? \"w-52\" : \"w-[68px]\"}`}>\n          <div className=\"flex h-10 items-center gap-2 px-2\">\n            <span className=\"grid h-7 w-7 shrink-0 place-items-center rounded-lg bg-indigo-600 text-xs font-bold text-white\" aria-hidden=\"true\">K</span>\n            {expanded && <span className=\"truncate text-sm font-semibold text-slate-900\">Kestrel Supply</span>}\n          </div>\n          <nav aria-label=\"Main\" className=\"mt-4 flex-1\">\n            <ul className=\"space-y-1\">\n              {links.map((l) => (\n                <li key={l.label}>\n                  <a\n                    href=\"#\"\n                    aria-current={l.current ? \"page\" : undefined}\n                    aria-label={expanded ? undefined : l.label}\n                    title={expanded ? undefined : l.label}\n                    className={`flex h-10 items-center gap-3 rounded-lg px-3 text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 ${l.current ? \"bg-indigo-600 text-white\" : \"text-slate-700 hover:bg-slate-200/70\"}`}\n                  >\n                    <Icon d={l.path} />\n                    {expanded && <span className=\"truncate\">{l.label}</span>}\n                  </a>\n                </li>\n              ))}\n            </ul>\n          </nav>\n          <button\n            type=\"button\"\n            aria-expanded={expanded}\n            aria-label={expanded ? \"Collapse sidebar\" : \"Expand sidebar\"}\n            onClick={() => setExpanded((v) => !v)}\n            className=\"flex h-10 items-center gap-3 rounded-lg px-3 text-sm font-medium text-slate-700 hover:bg-slate-200/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500\"\n          >\n            <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" className={`shrink-0 transition-transform duration-200 motion-reduce:transition-none ${expanded ? \"\" : \"rotate-180\"}`} aria-hidden=\"true\"><path d=\"M15 6l-6 6 6 6\" /></svg>\n            {expanded && <span>Collapse</span>}\n          </button>\n        </aside>\n        <main className=\"min-w-0 flex-1 p-4 sm:p-6\">\n          <h2 className=\"text-lg font-semibold text-slate-900\">Overview</h2>\n          <p className=\"mt-1 text-sm text-slate-600\">Week of 20 October</p>\n          <div className=\"mt-6 grid gap-4 sm:grid-cols-3\">\n            {[[\"Orders\", \"184\"], [\"Revenue\", \"$12,480\"], [\"Returns\", \"3\"]].map(([k, v]) => (\n              <div key={k} className=\"rounded-xl border border-slate-200 p-3 sm:p-4\">\n                <p className=\"text-sm text-slate-600\">{k}</p>\n                <p className=\"mt-1 text-xl font-semibold tabular-nums sm:text-2xl text-slate-900\">{v}</p>\n              </div>\n            ))}\n          </div>\n          <div className=\"mt-4 hidden h-32 rounded-xl bg-gradient-to-t from-indigo-50 to-white ring-1 ring-slate-200 sm:block\" aria-hidden=\"true\" />\n        </main>\n      </div>\n    </div>\n  );\n}\n"}]}
