@papernote/ui 1.7.0 → 1.7.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.
package/dist/index.js CHANGED
@@ -7283,12 +7283,24 @@ function Breadcrumbs({ items, showHome = true }) {
7283
7283
  return (jsxRuntime.jsxs("nav", { "aria-label": "Breadcrumb", className: "flex items-center space-x-2 text-sm", children: [showHome && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(reactRouterDom.Link, { to: "/", className: "text-ink-500 hover:text-ink-900 transition-colors", "aria-label": "Home", children: jsxRuntime.jsx(lucideReact.Home, { className: "h-4 w-4" }) }), items.length > 0 && jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 text-ink-400" })] })), items.map((item, index) => {
7284
7284
  const isLast = index === items.length - 1;
7285
7285
  const isActive = isLast;
7286
- return (jsxRuntime.jsxs(React.Fragment, { children: [item.href && !isActive ? (jsxRuntime.jsxs(reactRouterDom.Link, { to: item.href, className: "flex items-center gap-2 text-ink-500 hover:text-ink-900 hover:underline transition-colors", children: [item.icon && jsxRuntime.jsx("span", { className: "flex-shrink-0", children: item.icon }), jsxRuntime.jsx("span", { children: item.label })] })) : (jsxRuntime.jsxs("span", { className: `
7287
- flex items-center gap-2 px-2 py-1 rounded-md transition-colors
7288
- ${isActive
7289
- ? 'bg-accent-50 text-accent-900 font-semibold'
7290
- : 'text-ink-700 font-medium'}
7291
- `, "aria-current": isActive ? 'page' : undefined, children: [item.icon && jsxRuntime.jsx("span", { className: "flex-shrink-0", children: item.icon }), jsxRuntime.jsx("span", { children: item.label })] })), !isLast && jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 text-ink-400" })] }, index));
7286
+ const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [item.icon && jsxRuntime.jsx("span", { className: "flex-shrink-0", children: item.icon }), jsxRuntime.jsx("span", { children: item.label })] }));
7287
+ const renderBreadcrumb = () => {
7288
+ // Active item (last item) - always render as non-clickable span
7289
+ if (isActive) {
7290
+ return (jsxRuntime.jsx("span", { className: "flex items-center gap-2 px-2 py-1 rounded-md bg-accent-50 text-accent-900 font-semibold transition-colors", "aria-current": "page", children: content }));
7291
+ }
7292
+ // Has href - render as Link, also call onClick if provided
7293
+ if (item.href) {
7294
+ return (jsxRuntime.jsx(reactRouterDom.Link, { to: item.href, onClick: item.onClick, className: "flex items-center gap-2 text-ink-500 hover:text-ink-900 hover:underline transition-colors", children: content }));
7295
+ }
7296
+ // Only onClick (no href) - render as button
7297
+ if (item.onClick) {
7298
+ return (jsxRuntime.jsx("button", { type: "button", onClick: item.onClick, className: "flex items-center gap-2 text-ink-500 hover:text-ink-900 hover:underline transition-colors bg-transparent border-none cursor-pointer p-0", children: content }));
7299
+ }
7300
+ // Neither href nor onClick - render as non-clickable span
7301
+ return (jsxRuntime.jsx("span", { className: "flex items-center gap-2 text-ink-700 font-medium", children: content }));
7302
+ };
7303
+ return (jsxRuntime.jsxs(React.Fragment, { children: [renderBreadcrumb(), !isLast && jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 text-ink-400" })] }, index));
7292
7304
  })] }));
7293
7305
  }
7294
7306