avt-rct-lib 1.0.2 → 1.0.3
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.cjs +126 -0
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +125 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1212,6 +1212,130 @@ function SidebarItem({
|
|
|
1212
1212
|
}
|
|
1213
1213
|
);
|
|
1214
1214
|
}
|
|
1215
|
+
function SidebarSubMenu({
|
|
1216
|
+
icon,
|
|
1217
|
+
label,
|
|
1218
|
+
badge,
|
|
1219
|
+
defaultOpen = false,
|
|
1220
|
+
open: controlledOpen,
|
|
1221
|
+
onOpenChange,
|
|
1222
|
+
activeChild = false,
|
|
1223
|
+
children,
|
|
1224
|
+
className
|
|
1225
|
+
}) {
|
|
1226
|
+
const { collapsed } = useSidebar();
|
|
1227
|
+
const [internalOpen, setInternalOpen] = React3.useState(defaultOpen);
|
|
1228
|
+
const isOpen = controlledOpen ?? internalOpen;
|
|
1229
|
+
const toggle = () => {
|
|
1230
|
+
const next = !isOpen;
|
|
1231
|
+
setInternalOpen(next);
|
|
1232
|
+
onOpenChange?.(next);
|
|
1233
|
+
};
|
|
1234
|
+
if (collapsed) {
|
|
1235
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1236
|
+
"button",
|
|
1237
|
+
{
|
|
1238
|
+
type: "button",
|
|
1239
|
+
title: label,
|
|
1240
|
+
onClick: toggle,
|
|
1241
|
+
className: cn(
|
|
1242
|
+
"mx-auto flex h-10 w-10 min-h-[44px] min-w-[44px] items-center justify-center rounded-xl",
|
|
1243
|
+
"select-none outline-none transition-all duration-150",
|
|
1244
|
+
"focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
|
|
1245
|
+
activeChild ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
|
|
1246
|
+
className
|
|
1247
|
+
),
|
|
1248
|
+
children: icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("flex-shrink-0", !activeChild && "text-[#8E8E93]"), children: icon })
|
|
1249
|
+
}
|
|
1250
|
+
);
|
|
1251
|
+
}
|
|
1252
|
+
const triggerActive = activeChild && !isOpen;
|
|
1253
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-0.5", className), children: [
|
|
1254
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1255
|
+
"button",
|
|
1256
|
+
{
|
|
1257
|
+
type: "button",
|
|
1258
|
+
onClick: toggle,
|
|
1259
|
+
className: cn(
|
|
1260
|
+
"flex w-full items-center gap-2.5 rounded-xl px-3 py-2.5 min-h-[44px]",
|
|
1261
|
+
"text-[13px] font-medium select-none outline-none transition-all duration-150",
|
|
1262
|
+
"focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
|
|
1263
|
+
triggerActive ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]"
|
|
1264
|
+
),
|
|
1265
|
+
children: [
|
|
1266
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("flex-shrink-0", !triggerActive && "text-[#8E8E93]"), children: icon }),
|
|
1267
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-left", children: label }),
|
|
1268
|
+
badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1269
|
+
"span",
|
|
1270
|
+
{
|
|
1271
|
+
className: cn(
|
|
1272
|
+
"flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[10px] font-bold",
|
|
1273
|
+
triggerActive ? "bg-white/20 text-white" : "bg-[#E5E5EA] text-[#8E8E93]"
|
|
1274
|
+
),
|
|
1275
|
+
children: badge
|
|
1276
|
+
}
|
|
1277
|
+
),
|
|
1278
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1279
|
+
"svg",
|
|
1280
|
+
{
|
|
1281
|
+
className: cn(
|
|
1282
|
+
"h-3.5 w-3.5 flex-shrink-0 transition-transform duration-200",
|
|
1283
|
+
triggerActive ? "text-white/60" : "text-[#C7C7CC]",
|
|
1284
|
+
isOpen && "rotate-90"
|
|
1285
|
+
),
|
|
1286
|
+
viewBox: "0 0 24 24",
|
|
1287
|
+
fill: "none",
|
|
1288
|
+
stroke: "currentColor",
|
|
1289
|
+
strokeWidth: "2.5",
|
|
1290
|
+
strokeLinecap: "round",
|
|
1291
|
+
strokeLinejoin: "round",
|
|
1292
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 18l6-6-6-6" })
|
|
1293
|
+
}
|
|
1294
|
+
)
|
|
1295
|
+
]
|
|
1296
|
+
}
|
|
1297
|
+
),
|
|
1298
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1299
|
+
"div",
|
|
1300
|
+
{
|
|
1301
|
+
className: cn(
|
|
1302
|
+
"overflow-hidden transition-all duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
1303
|
+
isOpen ? "max-h-96 opacity-100" : "max-h-0 opacity-0 pointer-events-none"
|
|
1304
|
+
),
|
|
1305
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-3 space-y-0.5 border-l border-[#E5E5EA] py-0.5 pl-2", children })
|
|
1306
|
+
}
|
|
1307
|
+
)
|
|
1308
|
+
] });
|
|
1309
|
+
}
|
|
1310
|
+
function SidebarSubMenuItem({
|
|
1311
|
+
icon,
|
|
1312
|
+
label,
|
|
1313
|
+
active = false,
|
|
1314
|
+
href,
|
|
1315
|
+
as: Tag = "button",
|
|
1316
|
+
className,
|
|
1317
|
+
...props
|
|
1318
|
+
}) {
|
|
1319
|
+
const tagProps = href ? { href } : { type: "button" };
|
|
1320
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1321
|
+
Tag,
|
|
1322
|
+
{
|
|
1323
|
+
...tagProps,
|
|
1324
|
+
className: cn(
|
|
1325
|
+
"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 min-h-[36px]",
|
|
1326
|
+
"text-[12px] font-medium select-none outline-none transition-all duration-150",
|
|
1327
|
+
"focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
|
|
1328
|
+
active ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.20)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
|
|
1329
|
+
className
|
|
1330
|
+
),
|
|
1331
|
+
...props,
|
|
1332
|
+
children: [
|
|
1333
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("flex-shrink-0", !active && "text-[#8E8E93]"), children: icon }),
|
|
1334
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-left", children: label })
|
|
1335
|
+
]
|
|
1336
|
+
}
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1215
1339
|
function SidebarFooter({ className, ...props }) {
|
|
1216
1340
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-shrink-0 p-3", className), ...props });
|
|
1217
1341
|
}
|
|
@@ -1337,6 +1461,8 @@ exports.SidebarFooter = SidebarFooter;
|
|
|
1337
1461
|
exports.SidebarGroup = SidebarGroup;
|
|
1338
1462
|
exports.SidebarHeader = SidebarHeader;
|
|
1339
1463
|
exports.SidebarItem = SidebarItem;
|
|
1464
|
+
exports.SidebarSubMenu = SidebarSubMenu;
|
|
1465
|
+
exports.SidebarSubMenuItem = SidebarSubMenuItem;
|
|
1340
1466
|
exports.SidebarToggle = SidebarToggle;
|
|
1341
1467
|
exports.SidebarUser = SidebarUser;
|
|
1342
1468
|
exports.Table = Table;
|
package/dist/index.d.cts
CHANGED
|
@@ -279,6 +279,29 @@ interface SidebarItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
279
279
|
as?: React.ElementType;
|
|
280
280
|
}
|
|
281
281
|
declare function SidebarItem({ icon, label, active, badge, href, as: Tag, className, ...props }: SidebarItemProps): react_jsx_runtime.JSX.Element;
|
|
282
|
+
interface SidebarSubMenuProps {
|
|
283
|
+
icon?: React.ReactNode;
|
|
284
|
+
label: string;
|
|
285
|
+
badge?: string | number;
|
|
286
|
+
/** Initial open state (uncontrolled) */
|
|
287
|
+
defaultOpen?: boolean;
|
|
288
|
+
/** Controlled open state */
|
|
289
|
+
open?: boolean;
|
|
290
|
+
onOpenChange?: (open: boolean) => void;
|
|
291
|
+
/** True when one of the children is the currently active route */
|
|
292
|
+
activeChild?: boolean;
|
|
293
|
+
children: React.ReactNode;
|
|
294
|
+
className?: string;
|
|
295
|
+
}
|
|
296
|
+
declare function SidebarSubMenu({ icon, label, badge, defaultOpen, open: controlledOpen, onOpenChange, activeChild, children, className, }: SidebarSubMenuProps): react_jsx_runtime.JSX.Element;
|
|
297
|
+
interface SidebarSubMenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
298
|
+
icon?: React.ReactNode;
|
|
299
|
+
label: string;
|
|
300
|
+
active?: boolean;
|
|
301
|
+
href?: string;
|
|
302
|
+
as?: React.ElementType;
|
|
303
|
+
}
|
|
304
|
+
declare function SidebarSubMenuItem({ icon, label, active, href, as: Tag, className, ...props }: SidebarSubMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
282
305
|
declare function SidebarFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
283
306
|
interface SidebarUserProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
284
307
|
name: string;
|
|
@@ -320,4 +343,4 @@ declare const colors: {
|
|
|
320
343
|
};
|
|
321
344
|
declare function generateId(): string;
|
|
322
345
|
|
|
323
|
-
export { Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, type CardProps, CardTitle, DataTable, type DataTableColumn, type DataTablePaginationProps, type DataTableProps, Drawer, Input, type InputProps, MenuRoot as Menu, type MenuAlign, MenuButton, MenuContent, type MenuContentProps, MenuRoot as MenuDropdown, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuRoot, MenuSeparator, MenuTrigger, Navbar, NavbarBrand, type NavbarBrandProps, NavbarCenter, NavbarDivider, NavbarIconButton, type NavbarIconButtonProps, NavbarLeft, type NavbarProps, NavbarRight, NavbarSearch, type NavbarSearchProps, Scrollbar, type ScrollbarProps, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, type SheetProps, type SheetSide, SheetTitle, Sidebar, SidebarBrand, type SidebarBrandProps, SidebarContent, SidebarDivider, SidebarFooter, SidebarGroup, type SidebarGroupProps, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarToggle, type SidebarToggleProps, SidebarUser, type SidebarUserProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, type TableProps, TableRow, TableToolbar, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastItem, type ToastOptions, type ToastPosition, type ToastVariant, Toaster, type ToasterProps, cn, colors, dismissToast, generateId, toast, useClickOutside, useKeydown, useToast, withScrollbar };
|
|
346
|
+
export { Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, type CardProps, CardTitle, DataTable, type DataTableColumn, type DataTablePaginationProps, type DataTableProps, Drawer, Input, type InputProps, MenuRoot as Menu, type MenuAlign, MenuButton, MenuContent, type MenuContentProps, MenuRoot as MenuDropdown, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuRoot, MenuSeparator, MenuTrigger, Navbar, NavbarBrand, type NavbarBrandProps, NavbarCenter, NavbarDivider, NavbarIconButton, type NavbarIconButtonProps, NavbarLeft, type NavbarProps, NavbarRight, NavbarSearch, type NavbarSearchProps, Scrollbar, type ScrollbarProps, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, type SheetProps, type SheetSide, SheetTitle, Sidebar, SidebarBrand, type SidebarBrandProps, SidebarContent, SidebarDivider, SidebarFooter, SidebarGroup, type SidebarGroupProps, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSubMenu, SidebarSubMenuItem, type SidebarSubMenuItemProps, type SidebarSubMenuProps, SidebarToggle, type SidebarToggleProps, SidebarUser, type SidebarUserProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, type TableProps, TableRow, TableToolbar, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastItem, type ToastOptions, type ToastPosition, type ToastVariant, Toaster, type ToasterProps, cn, colors, dismissToast, generateId, toast, useClickOutside, useKeydown, useToast, withScrollbar };
|
package/dist/index.d.ts
CHANGED
|
@@ -279,6 +279,29 @@ interface SidebarItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
279
279
|
as?: React.ElementType;
|
|
280
280
|
}
|
|
281
281
|
declare function SidebarItem({ icon, label, active, badge, href, as: Tag, className, ...props }: SidebarItemProps): react_jsx_runtime.JSX.Element;
|
|
282
|
+
interface SidebarSubMenuProps {
|
|
283
|
+
icon?: React.ReactNode;
|
|
284
|
+
label: string;
|
|
285
|
+
badge?: string | number;
|
|
286
|
+
/** Initial open state (uncontrolled) */
|
|
287
|
+
defaultOpen?: boolean;
|
|
288
|
+
/** Controlled open state */
|
|
289
|
+
open?: boolean;
|
|
290
|
+
onOpenChange?: (open: boolean) => void;
|
|
291
|
+
/** True when one of the children is the currently active route */
|
|
292
|
+
activeChild?: boolean;
|
|
293
|
+
children: React.ReactNode;
|
|
294
|
+
className?: string;
|
|
295
|
+
}
|
|
296
|
+
declare function SidebarSubMenu({ icon, label, badge, defaultOpen, open: controlledOpen, onOpenChange, activeChild, children, className, }: SidebarSubMenuProps): react_jsx_runtime.JSX.Element;
|
|
297
|
+
interface SidebarSubMenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
298
|
+
icon?: React.ReactNode;
|
|
299
|
+
label: string;
|
|
300
|
+
active?: boolean;
|
|
301
|
+
href?: string;
|
|
302
|
+
as?: React.ElementType;
|
|
303
|
+
}
|
|
304
|
+
declare function SidebarSubMenuItem({ icon, label, active, href, as: Tag, className, ...props }: SidebarSubMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
282
305
|
declare function SidebarFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
283
306
|
interface SidebarUserProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
284
307
|
name: string;
|
|
@@ -320,4 +343,4 @@ declare const colors: {
|
|
|
320
343
|
};
|
|
321
344
|
declare function generateId(): string;
|
|
322
345
|
|
|
323
|
-
export { Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, type CardProps, CardTitle, DataTable, type DataTableColumn, type DataTablePaginationProps, type DataTableProps, Drawer, Input, type InputProps, MenuRoot as Menu, type MenuAlign, MenuButton, MenuContent, type MenuContentProps, MenuRoot as MenuDropdown, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuRoot, MenuSeparator, MenuTrigger, Navbar, NavbarBrand, type NavbarBrandProps, NavbarCenter, NavbarDivider, NavbarIconButton, type NavbarIconButtonProps, NavbarLeft, type NavbarProps, NavbarRight, NavbarSearch, type NavbarSearchProps, Scrollbar, type ScrollbarProps, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, type SheetProps, type SheetSide, SheetTitle, Sidebar, SidebarBrand, type SidebarBrandProps, SidebarContent, SidebarDivider, SidebarFooter, SidebarGroup, type SidebarGroupProps, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarToggle, type SidebarToggleProps, SidebarUser, type SidebarUserProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, type TableProps, TableRow, TableToolbar, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastItem, type ToastOptions, type ToastPosition, type ToastVariant, Toaster, type ToasterProps, cn, colors, dismissToast, generateId, toast, useClickOutside, useKeydown, useToast, withScrollbar };
|
|
346
|
+
export { Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, type CardProps, CardTitle, DataTable, type DataTableColumn, type DataTablePaginationProps, type DataTableProps, Drawer, Input, type InputProps, MenuRoot as Menu, type MenuAlign, MenuButton, MenuContent, type MenuContentProps, MenuRoot as MenuDropdown, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuRoot, MenuSeparator, MenuTrigger, Navbar, NavbarBrand, type NavbarBrandProps, NavbarCenter, NavbarDivider, NavbarIconButton, type NavbarIconButtonProps, NavbarLeft, type NavbarProps, NavbarRight, NavbarSearch, type NavbarSearchProps, Scrollbar, type ScrollbarProps, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, type SheetProps, type SheetSide, SheetTitle, Sidebar, SidebarBrand, type SidebarBrandProps, SidebarContent, SidebarDivider, SidebarFooter, SidebarGroup, type SidebarGroupProps, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarSubMenu, SidebarSubMenuItem, type SidebarSubMenuItemProps, type SidebarSubMenuProps, SidebarToggle, type SidebarToggleProps, SidebarUser, type SidebarUserProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, type TableProps, TableRow, TableToolbar, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastItem, type ToastOptions, type ToastPosition, type ToastVariant, Toaster, type ToasterProps, cn, colors, dismissToast, generateId, toast, useClickOutside, useKeydown, useToast, withScrollbar };
|
package/dist/index.js
CHANGED
|
@@ -1206,6 +1206,130 @@ function SidebarItem({
|
|
|
1206
1206
|
}
|
|
1207
1207
|
);
|
|
1208
1208
|
}
|
|
1209
|
+
function SidebarSubMenu({
|
|
1210
|
+
icon,
|
|
1211
|
+
label,
|
|
1212
|
+
badge,
|
|
1213
|
+
defaultOpen = false,
|
|
1214
|
+
open: controlledOpen,
|
|
1215
|
+
onOpenChange,
|
|
1216
|
+
activeChild = false,
|
|
1217
|
+
children,
|
|
1218
|
+
className
|
|
1219
|
+
}) {
|
|
1220
|
+
const { collapsed } = useSidebar();
|
|
1221
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
1222
|
+
const isOpen = controlledOpen ?? internalOpen;
|
|
1223
|
+
const toggle = () => {
|
|
1224
|
+
const next = !isOpen;
|
|
1225
|
+
setInternalOpen(next);
|
|
1226
|
+
onOpenChange?.(next);
|
|
1227
|
+
};
|
|
1228
|
+
if (collapsed) {
|
|
1229
|
+
return /* @__PURE__ */ jsx(
|
|
1230
|
+
"button",
|
|
1231
|
+
{
|
|
1232
|
+
type: "button",
|
|
1233
|
+
title: label,
|
|
1234
|
+
onClick: toggle,
|
|
1235
|
+
className: cn(
|
|
1236
|
+
"mx-auto flex h-10 w-10 min-h-[44px] min-w-[44px] items-center justify-center rounded-xl",
|
|
1237
|
+
"select-none outline-none transition-all duration-150",
|
|
1238
|
+
"focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
|
|
1239
|
+
activeChild ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
|
|
1240
|
+
className
|
|
1241
|
+
),
|
|
1242
|
+
children: icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", !activeChild && "text-[#8E8E93]"), children: icon })
|
|
1243
|
+
}
|
|
1244
|
+
);
|
|
1245
|
+
}
|
|
1246
|
+
const triggerActive = activeChild && !isOpen;
|
|
1247
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-0.5", className), children: [
|
|
1248
|
+
/* @__PURE__ */ jsxs(
|
|
1249
|
+
"button",
|
|
1250
|
+
{
|
|
1251
|
+
type: "button",
|
|
1252
|
+
onClick: toggle,
|
|
1253
|
+
className: cn(
|
|
1254
|
+
"flex w-full items-center gap-2.5 rounded-xl px-3 py-2.5 min-h-[44px]",
|
|
1255
|
+
"text-[13px] font-medium select-none outline-none transition-all duration-150",
|
|
1256
|
+
"focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
|
|
1257
|
+
triggerActive ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]"
|
|
1258
|
+
),
|
|
1259
|
+
children: [
|
|
1260
|
+
icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", !triggerActive && "text-[#8E8E93]"), children: icon }),
|
|
1261
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left", children: label }),
|
|
1262
|
+
badge !== void 0 && /* @__PURE__ */ jsx(
|
|
1263
|
+
"span",
|
|
1264
|
+
{
|
|
1265
|
+
className: cn(
|
|
1266
|
+
"flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[10px] font-bold",
|
|
1267
|
+
triggerActive ? "bg-white/20 text-white" : "bg-[#E5E5EA] text-[#8E8E93]"
|
|
1268
|
+
),
|
|
1269
|
+
children: badge
|
|
1270
|
+
}
|
|
1271
|
+
),
|
|
1272
|
+
/* @__PURE__ */ jsx(
|
|
1273
|
+
"svg",
|
|
1274
|
+
{
|
|
1275
|
+
className: cn(
|
|
1276
|
+
"h-3.5 w-3.5 flex-shrink-0 transition-transform duration-200",
|
|
1277
|
+
triggerActive ? "text-white/60" : "text-[#C7C7CC]",
|
|
1278
|
+
isOpen && "rotate-90"
|
|
1279
|
+
),
|
|
1280
|
+
viewBox: "0 0 24 24",
|
|
1281
|
+
fill: "none",
|
|
1282
|
+
stroke: "currentColor",
|
|
1283
|
+
strokeWidth: "2.5",
|
|
1284
|
+
strokeLinecap: "round",
|
|
1285
|
+
strokeLinejoin: "round",
|
|
1286
|
+
children: /* @__PURE__ */ jsx("path", { d: "M9 18l6-6-6-6" })
|
|
1287
|
+
}
|
|
1288
|
+
)
|
|
1289
|
+
]
|
|
1290
|
+
}
|
|
1291
|
+
),
|
|
1292
|
+
/* @__PURE__ */ jsx(
|
|
1293
|
+
"div",
|
|
1294
|
+
{
|
|
1295
|
+
className: cn(
|
|
1296
|
+
"overflow-hidden transition-all duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
1297
|
+
isOpen ? "max-h-96 opacity-100" : "max-h-0 opacity-0 pointer-events-none"
|
|
1298
|
+
),
|
|
1299
|
+
children: /* @__PURE__ */ jsx("div", { className: "ml-3 space-y-0.5 border-l border-[#E5E5EA] py-0.5 pl-2", children })
|
|
1300
|
+
}
|
|
1301
|
+
)
|
|
1302
|
+
] });
|
|
1303
|
+
}
|
|
1304
|
+
function SidebarSubMenuItem({
|
|
1305
|
+
icon,
|
|
1306
|
+
label,
|
|
1307
|
+
active = false,
|
|
1308
|
+
href,
|
|
1309
|
+
as: Tag = "button",
|
|
1310
|
+
className,
|
|
1311
|
+
...props
|
|
1312
|
+
}) {
|
|
1313
|
+
const tagProps = href ? { href } : { type: "button" };
|
|
1314
|
+
return /* @__PURE__ */ jsxs(
|
|
1315
|
+
Tag,
|
|
1316
|
+
{
|
|
1317
|
+
...tagProps,
|
|
1318
|
+
className: cn(
|
|
1319
|
+
"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 min-h-[36px]",
|
|
1320
|
+
"text-[12px] font-medium select-none outline-none transition-all duration-150",
|
|
1321
|
+
"focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
|
|
1322
|
+
active ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.20)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
|
|
1323
|
+
className
|
|
1324
|
+
),
|
|
1325
|
+
...props,
|
|
1326
|
+
children: [
|
|
1327
|
+
icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", !active && "text-[#8E8E93]"), children: icon }),
|
|
1328
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left", children: label })
|
|
1329
|
+
]
|
|
1330
|
+
}
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1209
1333
|
function SidebarFooter({ className, ...props }) {
|
|
1210
1334
|
return /* @__PURE__ */ jsx("div", { className: cn("flex-shrink-0 p-3", className), ...props });
|
|
1211
1335
|
}
|
|
@@ -1287,4 +1411,4 @@ function useClickOutside(ref, handler, enabled = true) {
|
|
|
1287
1411
|
}, [ref, handler, enabled]);
|
|
1288
1412
|
}
|
|
1289
1413
|
|
|
1290
|
-
export { Badge, Button, Card, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, CardTitle, DataTable, Drawer, Input, MenuRoot as Menu, MenuButton, MenuContent, MenuRoot as MenuDropdown, MenuItem, MenuLabel, MenuRoot, MenuSeparator, MenuTrigger, Navbar, NavbarBrand, NavbarCenter, NavbarDivider, NavbarIconButton, NavbarLeft, NavbarRight, NavbarSearch, Scrollbar, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, Sidebar, SidebarBrand, SidebarContent, SidebarDivider, SidebarFooter, SidebarGroup, SidebarHeader, SidebarItem, SidebarToggle, SidebarUser, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, TableRow, TableToolbar, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, cn, colors, dismissToast, generateId, toast, useClickOutside, useKeydown, useToast, withScrollbar };
|
|
1414
|
+
export { Badge, Button, Card, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, CardTitle, DataTable, Drawer, Input, MenuRoot as Menu, MenuButton, MenuContent, MenuRoot as MenuDropdown, MenuItem, MenuLabel, MenuRoot, MenuSeparator, MenuTrigger, Navbar, NavbarBrand, NavbarCenter, NavbarDivider, NavbarIconButton, NavbarLeft, NavbarRight, NavbarSearch, Scrollbar, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, Sidebar, SidebarBrand, SidebarContent, SidebarDivider, SidebarFooter, SidebarGroup, SidebarHeader, SidebarItem, SidebarSubMenu, SidebarSubMenuItem, SidebarToggle, SidebarUser, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, TableRow, TableToolbar, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, cn, colors, dismissToast, generateId, toast, useClickOutside, useKeydown, useToast, withScrollbar };
|