@olwiba/ui 0.0.33 → 0.0.34

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/dist/index.d.ts CHANGED
@@ -103,6 +103,8 @@ interface AppShellProps {
103
103
  user?: AppShellUser;
104
104
  /** Text shown in the top header bar */
105
105
  pageTitle?: string;
106
+ /** Slot rendered at the start of the top header bar, after the sidebar trigger. */
107
+ headerStart?: ReactNode;
106
108
  /** Override link rendering for SPA navigation. Defaults to a native <a>. */
107
109
  renderLink?: AppShellRenderLink;
108
110
  children?: ReactNode;
@@ -122,7 +124,7 @@ interface AppShellProps {
122
124
  /** Which side the sidebar sits on. @default "left" */
123
125
  side?: 'left' | 'right';
124
126
  }
125
- declare function AppShell({ brand, navItems, action, user, pageTitle, renderLink, collapsible, sidebarPosition, side, children, }?: AppShellProps): react_jsx_runtime.JSX.Element;
127
+ declare function AppShell({ brand, navItems, action, user, pageTitle, headerStart, renderLink, collapsible, sidebarPosition, side, children, }?: AppShellProps): react_jsx_runtime.JSX.Element;
126
128
 
127
129
  interface AuthFormProps {
128
130
  /** Controls form title, fields, and footer text. @default 'signin' */
package/dist/index.js CHANGED
@@ -193,9 +193,10 @@ function ShellSidebar({
193
193
  /* @__PURE__ */ jsx(SidebarFooter, { children: /* @__PURE__ */ jsx(NavUser, { user }) })
194
194
  ] });
195
195
  }
196
- function ShellHeader({ pageTitle }) {
196
+ function ShellHeader({ pageTitle, headerStart }) {
197
197
  return /* @__PURE__ */ jsx("header", { className: "flex h-12 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6", children: [
198
198
  /* @__PURE__ */ jsx(SidebarTrigger, { className: "-ml-1" }),
199
+ headerStart && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: headerStart }),
199
200
  /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mx-2 data-[orientation=vertical]:h-4" }),
200
201
  /* @__PURE__ */ jsx("h1", { className: "text-base font-medium", children: pageTitle })
201
202
  ] }) });
@@ -215,6 +216,7 @@ function AppShell({
215
216
  action,
216
217
  user = defaultUser,
217
218
  pageTitle = "Dashboard",
219
+ headerStart,
218
220
  renderLink = defaultRenderLink,
219
221
  collapsible = "icon",
220
222
  sidebarPosition = "viewport",
@@ -242,7 +244,7 @@ function AppShell({
242
244
  }
243
245
  ),
244
246
  /* @__PURE__ */ jsxs(SidebarInset, { className: isContained ? void 0 : "overflow-y-auto", children: [
245
- /* @__PURE__ */ jsx(ShellHeader, { pageTitle }),
247
+ /* @__PURE__ */ jsx(ShellHeader, { pageTitle, headerStart }),
246
248
  children
247
249
  ] })
248
250
  ]
@@ -1273,7 +1275,14 @@ function ThemeSwitchMinimal() {
1273
1275
  localStorage.setItem("theme", next);
1274
1276
  document.documentElement.classList.toggle("dark", next === "dark");
1275
1277
  };
1276
- return /* @__PURE__ */ jsx(Button$1, { variant: "ghost", size: "icon", onClick: toggle, className: "size-8", "aria-label": "Toggle theme", children: theme === "dark" ? /* @__PURE__ */ jsx(Sun, { className: "size-4" }) : /* @__PURE__ */ jsx(Moon, { className: "size-4" }) });
1278
+ return /* @__PURE__ */ jsx(Button$1, { variant: "ghost", size: "icon", onClick: toggle, className: "size-8", "aria-label": "Toggle theme", children: /* @__PURE__ */ jsx(
1279
+ "span",
1280
+ {
1281
+ className: "inline-flex size-4 items-center justify-center animate-in fade-in zoom-in-75 spin-in-90 duration-200 motion-reduce:animate-none",
1282
+ children: theme === "dark" ? /* @__PURE__ */ jsx(Sun, { className: "size-4" }) : /* @__PURE__ */ jsx(Moon, { className: "size-4" })
1283
+ },
1284
+ theme
1285
+ ) });
1277
1286
  }
1278
1287
  var defaultRenderLink7 = ({ href, children, className }) => /* @__PURE__ */ jsx("a", { href, className, children });
1279
1288
  function Navbar({