@opencosmos/ui 1.3.2 → 1.3.4
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.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +38 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/components/layout/AppSidebar.tsx +52 -5
- package/LICENSE +0 -21
package/dist/index.d.mts
CHANGED
|
@@ -2459,16 +2459,18 @@ interface AppSidebarProps {
|
|
|
2459
2459
|
logo?: React__default.ReactNode;
|
|
2460
2460
|
/** Wordmark shown next to the logo when expanded */
|
|
2461
2461
|
title?: string;
|
|
2462
|
-
/** Navigation items */
|
|
2462
|
+
/** Navigation items rendered at the top (below the header) */
|
|
2463
2463
|
items?: AppSidebarNavItem[];
|
|
2464
|
-
/**
|
|
2464
|
+
/** Navigation items rendered at the bottom (above the footer) */
|
|
2465
|
+
bottomItems?: AppSidebarNavItem[];
|
|
2466
|
+
/** Body slot — rendered in the flex-1 mid-section (e.g. conversation history). Only visible when expanded. */
|
|
2465
2467
|
children?: React__default.ReactNode;
|
|
2466
2468
|
/** Footer slot — auth section, user avatar, sign-in prompt, etc. */
|
|
2467
2469
|
footer?: React__default.ReactNode;
|
|
2468
2470
|
/** Additional className for the <aside> */
|
|
2469
2471
|
className?: string;
|
|
2470
2472
|
}
|
|
2471
|
-
declare function AppSidebar({ logo, title, items, children, footer, className, }: AppSidebarProps): react_jsx_runtime.JSX.Element;
|
|
2473
|
+
declare function AppSidebar({ logo, title, items, bottomItems, children, footer, className, }: AppSidebarProps): react_jsx_runtime.JSX.Element;
|
|
2472
2474
|
|
|
2473
2475
|
interface StackProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
2474
2476
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -2459,16 +2459,18 @@ interface AppSidebarProps {
|
|
|
2459
2459
|
logo?: React__default.ReactNode;
|
|
2460
2460
|
/** Wordmark shown next to the logo when expanded */
|
|
2461
2461
|
title?: string;
|
|
2462
|
-
/** Navigation items */
|
|
2462
|
+
/** Navigation items rendered at the top (below the header) */
|
|
2463
2463
|
items?: AppSidebarNavItem[];
|
|
2464
|
-
/**
|
|
2464
|
+
/** Navigation items rendered at the bottom (above the footer) */
|
|
2465
|
+
bottomItems?: AppSidebarNavItem[];
|
|
2466
|
+
/** Body slot — rendered in the flex-1 mid-section (e.g. conversation history). Only visible when expanded. */
|
|
2465
2467
|
children?: React__default.ReactNode;
|
|
2466
2468
|
/** Footer slot — auth section, user avatar, sign-in prompt, etc. */
|
|
2467
2469
|
footer?: React__default.ReactNode;
|
|
2468
2470
|
/** Additional className for the <aside> */
|
|
2469
2471
|
className?: string;
|
|
2470
2472
|
}
|
|
2471
|
-
declare function AppSidebar({ logo, title, items, children, footer, className, }: AppSidebarProps): react_jsx_runtime.JSX.Element;
|
|
2473
|
+
declare function AppSidebar({ logo, title, items, bottomItems, children, footer, className, }: AppSidebarProps): react_jsx_runtime.JSX.Element;
|
|
2472
2474
|
|
|
2473
2475
|
interface StackProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
2474
2476
|
/**
|
package/dist/index.js
CHANGED
|
@@ -11118,6 +11118,7 @@ function AppSidebar({
|
|
|
11118
11118
|
logo,
|
|
11119
11119
|
title,
|
|
11120
11120
|
items = [],
|
|
11121
|
+
bottomItems = [],
|
|
11121
11122
|
children,
|
|
11122
11123
|
footer,
|
|
11123
11124
|
className
|
|
@@ -11190,7 +11191,7 @@ function AppSidebar({
|
|
|
11190
11191
|
}
|
|
11191
11192
|
)
|
|
11192
11193
|
] }),
|
|
11193
|
-
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("nav", { className: "px-2 py-2 space-y-
|
|
11194
|
+
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("nav", { className: "px-2 py-2 space-y-1 shrink-0", "aria-label": "Main navigation", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
11194
11195
|
"a",
|
|
11195
11196
|
{
|
|
11196
11197
|
href: item.href,
|
|
@@ -11201,7 +11202,7 @@ function AppSidebar({
|
|
|
11201
11202
|
className: cn(
|
|
11202
11203
|
"flex items-center rounded-lg transition-colors duration-150",
|
|
11203
11204
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus)]",
|
|
11204
|
-
isOpen ? "gap-3 px-3 py-
|
|
11205
|
+
isOpen ? "gap-3 px-3 py-3" : "justify-center w-9 h-9 mx-auto",
|
|
11205
11206
|
item.active ? "bg-foreground/8 text-foreground font-medium" : "text-[var(--color-text-secondary)] hover:bg-foreground/5 hover:text-[var(--color-text-primary)]"
|
|
11206
11207
|
),
|
|
11207
11208
|
children: [
|
|
@@ -11232,12 +11233,46 @@ function AppSidebar({
|
|
|
11232
11233
|
children
|
|
11233
11234
|
}
|
|
11234
11235
|
),
|
|
11236
|
+
bottomItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("nav", { className: "px-2 py-2 space-y-1 shrink-0 border-t border-foreground/8", "aria-label": "Bottom navigation", children: bottomItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
11237
|
+
"a",
|
|
11238
|
+
{
|
|
11239
|
+
href: item.href,
|
|
11240
|
+
target: item.external ? "_blank" : void 0,
|
|
11241
|
+
rel: item.external ? "noopener noreferrer" : void 0,
|
|
11242
|
+
title: !isOpen ? item.label : void 0,
|
|
11243
|
+
"aria-label": !isOpen ? item.label : void 0,
|
|
11244
|
+
className: cn(
|
|
11245
|
+
"flex items-center rounded-lg transition-colors duration-150",
|
|
11246
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus)]",
|
|
11247
|
+
isOpen ? "gap-3 px-3 py-3" : "justify-center w-9 h-9 mx-auto",
|
|
11248
|
+
item.active ? "bg-foreground/8 text-foreground font-medium" : "text-[var(--color-text-secondary)] hover:bg-foreground/5 hover:text-[var(--color-text-primary)]"
|
|
11249
|
+
),
|
|
11250
|
+
children: [
|
|
11251
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "shrink-0 flex items-center justify-center w-4 h-4", children: item.icon }),
|
|
11252
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11253
|
+
"span",
|
|
11254
|
+
{
|
|
11255
|
+
className: "text-sm whitespace-nowrap",
|
|
11256
|
+
style: {
|
|
11257
|
+
opacity: isOpen ? 1 : 0,
|
|
11258
|
+
width: isOpen ? "auto" : 0,
|
|
11259
|
+
overflow: "hidden",
|
|
11260
|
+
pointerEvents: isOpen ? "auto" : "none",
|
|
11261
|
+
transition: shouldAnimate ? `opacity ${Math.round(duration * 0.55)}ms ease-out` : "none"
|
|
11262
|
+
},
|
|
11263
|
+
children: item.label
|
|
11264
|
+
}
|
|
11265
|
+
)
|
|
11266
|
+
]
|
|
11267
|
+
},
|
|
11268
|
+
item.label
|
|
11269
|
+
)) }),
|
|
11235
11270
|
footer && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11236
11271
|
"div",
|
|
11237
11272
|
{
|
|
11238
11273
|
className: cn(
|
|
11239
11274
|
"shrink-0 border-t border-foreground/8",
|
|
11240
|
-
isOpen ? "
|
|
11275
|
+
isOpen ? "px-4 py-4 space-y-3" : "px-2 py-3 flex justify-center"
|
|
11241
11276
|
),
|
|
11242
11277
|
children: footer
|
|
11243
11278
|
}
|