@knkcs/anker 2.0.9 → 2.1.0

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/CLAUDE-ANKER.md CHANGED
@@ -77,7 +77,7 @@ Available templates:
77
77
 
78
78
  | Template | Use for |
79
79
  |---|---|
80
- | `<AppShell>` | Authenticated chrome (sidebar · main · rail). Provides `usePageActions(node)` and `usePageRail(node)` hooks. |
80
+ | `<AppShell>` | Authenticated chrome (sidebar · main · rail). Provides `usePageActions(node)`, `usePageHeader(node)`, and `usePageRail(node)` hooks. Page templates register their `<PageHeader>` via `usePageHeader`, which renders it as a band spanning main + rail. |
81
81
  | `<IndexPageTemplate>` | List pages — header + optional tabs + toolbar + DataTable |
82
82
  | `<DetailPageTemplate>` | Single-entity pages — header + optional tabs + body |
83
83
  | `<SettingsPageTemplate>` | Tabbed settings pages with form Cards |
@@ -428,7 +428,7 @@ var ContextRailRoot = ({ storageKey, children }) => {
428
428
  window.localStorage.setItem(storageKey, String(collapsed));
429
429
  }
430
430
  }, [collapsed, storageKey]);
431
- return /* @__PURE__ */ jsx(RailRootContext.Provider, { value: true, children: /* @__PURE__ */ jsx(
431
+ return /* @__PURE__ */ jsx(RailRootContext.Provider, { value: true, children: /* @__PURE__ */ jsxs(
432
432
  Box,
433
433
  {
434
434
  "data-testid": "context-rail",
@@ -436,32 +436,33 @@ var ContextRailRoot = ({ storageKey, children }) => {
436
436
  w: collapsed ? COLLAPSED_WIDTH : EXPANDED_WIDTH,
437
437
  minH: "100vh",
438
438
  transition: "width 250ms ease-out",
439
- overflow: "hidden",
440
439
  position: "relative",
441
- children: collapsed ? /* @__PURE__ */ jsx(Flex, { direction: "column", align: "center", pt: "3", gap: "3", children: /* @__PURE__ */ jsx(
442
- IconButton,
443
- {
444
- "data-testid": "context-rail-toggle",
445
- "aria-label": "Expand context rail",
446
- variant: "ghost",
447
- size: "sm",
448
- onClick: () => setCollapsed(false),
449
- children: /* @__PURE__ */ jsx(PanelRightOpen, { size: 16 })
450
- }
451
- ) }) : /* @__PURE__ */ jsxs(Flex, { direction: "column", h: "full", children: [
452
- /* @__PURE__ */ jsx(Flex, { justify: "flex-end", px: "3", pt: "3", children: /* @__PURE__ */ jsx(
440
+ children: [
441
+ /* @__PURE__ */ jsx(
453
442
  IconButton,
454
443
  {
455
444
  "data-testid": "context-rail-toggle",
456
- "aria-label": "Collapse context rail",
457
- variant: "ghost",
458
- size: "sm",
459
- onClick: () => setCollapsed(true),
460
- children: /* @__PURE__ */ jsx(PanelRightClose, { size: 16 })
445
+ "aria-label": collapsed ? "Expand context rail" : "Collapse context rail",
446
+ onClick: () => setCollapsed((c) => !c),
447
+ variant: "outline",
448
+ size: "xs",
449
+ position: "absolute",
450
+ top: "6",
451
+ left: "-3.5",
452
+ width: "7",
453
+ height: "7",
454
+ minW: "7",
455
+ borderRadius: "full",
456
+ bg: "bg-surface",
457
+ borderColor: "border",
458
+ boxShadow: "sm",
459
+ zIndex: 1,
460
+ _hover: { bg: "bg-muted" },
461
+ children: collapsed ? /* @__PURE__ */ jsx(PanelRightOpen, { size: 14 }) : /* @__PURE__ */ jsx(PanelRightClose, { size: 14 })
461
462
  }
462
- ) }),
463
- /* @__PURE__ */ jsx(Box, { flex: "1", overflowY: "auto", px: "4", pb: "4", children })
464
- ] })
463
+ ),
464
+ collapsed ? null : /* @__PURE__ */ jsx(Box, { h: "full", overflowY: "auto", px: "4", pt: "4", pb: "4", children })
465
+ ]
465
466
  }
466
467
  ) });
467
468
  };