avt-rct-lib 1.0.2 → 1.0.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.cjs CHANGED
@@ -1078,8 +1078,8 @@ var useSidebar = () => React3.useContext(SidebarContext);
1078
1078
  function Sidebar({
1079
1079
  collapsed = false,
1080
1080
  glass = true,
1081
- width = "240px",
1082
- collapsedWidth = "64px",
1081
+ width = "210px",
1082
+ collapsedWidth = "52px",
1083
1083
  overlay = false,
1084
1084
  onOverlayClose,
1085
1085
  className,
@@ -1142,28 +1142,28 @@ function SidebarBrand({ logo, title, subtitle, className, ...props }) {
1142
1142
  return /* @__PURE__ */ jsxRuntime.jsxs(
1143
1143
  "div",
1144
1144
  {
1145
- className: cn("flex items-center gap-3 px-4 py-5", collapsed && "justify-center px-0", className),
1145
+ className: cn("flex items-center gap-2.5 px-3 py-3", collapsed && "justify-center px-0", className),
1146
1146
  ...props,
1147
1147
  children: [
1148
1148
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: logo }),
1149
1149
  !collapsed && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 overflow-hidden", children: [
1150
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[13px] font-semibold tracking-[-0.01em] text-[#1C1C1E]", children: title }),
1151
- subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[11px] text-[#8E8E93]", children: subtitle })
1150
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[12px] font-semibold tracking-[-0.01em] text-[#1C1C1E]", children: title }),
1151
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[10px] text-[#8E8E93]", children: subtitle })
1152
1152
  ] })
1153
1153
  ]
1154
1154
  }
1155
1155
  );
1156
1156
  }
1157
1157
  function SidebarDivider({ className }) {
1158
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mx-3 my-1 h-px bg-[#E5E5EA]", className) });
1158
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mx-2 my-0.5 h-px bg-[#E5E5EA]", className) });
1159
1159
  }
1160
1160
  function SidebarContent({ className, ...props }) {
1161
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 overflow-y-auto px-2 py-2 avt-scroll space-y-0.5", className), ...props });
1161
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 overflow-y-auto px-1.5 py-1.5 avt-scroll space-y-px", className), ...props });
1162
1162
  }
1163
1163
  function SidebarGroup({ label, className, children, ...props }) {
1164
1164
  const { collapsed } = useSidebar();
1165
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mb-1", className), ...props, children: [
1166
- label && !collapsed && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 px-3 text-[10px] font-semibold uppercase tracking-widest text-[#C7C7CC]", children: label }),
1165
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mb-0.5", className), ...props, children: [
1166
+ label && !collapsed && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-0.5 px-2.5 text-[9px] font-semibold uppercase tracking-widest text-[#C7C7CC]", children: label }),
1167
1167
  children
1168
1168
  ] });
1169
1169
  }
@@ -1185,11 +1185,10 @@ function SidebarItem({
1185
1185
  ...tagProps,
1186
1186
  title: collapsed ? label : void 0,
1187
1187
  className: cn(
1188
- "flex w-full items-center gap-2.5 rounded-xl transition-all duration-150",
1189
- "text-[13px] font-medium select-none outline-none",
1188
+ "flex w-full items-center gap-2 rounded-lg transition-all duration-150",
1189
+ "text-[12px] font-medium select-none outline-none",
1190
1190
  "focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
1191
- // Mobile-friendly touch target
1192
- collapsed ? "justify-center px-0 mx-auto w-10 h-10 min-h-[44px] min-w-[44px]" : "px-3 py-2.5 min-h-[44px]",
1191
+ collapsed ? "justify-center px-0 mx-auto w-8 h-8 min-h-[36px] min-w-[36px]" : "px-2.5 py-1.5 min-h-[30px]",
1193
1192
  active ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
1194
1193
  className
1195
1194
  ),
@@ -1201,8 +1200,8 @@ function SidebarItem({
1201
1200
  "span",
1202
1201
  {
1203
1202
  className: cn(
1204
- "ml-auto flex h-5 min-w-5 items-center justify-center rounded-full px-1.5",
1205
- "text-[10px] font-bold",
1203
+ "ml-auto flex h-4 min-w-4 items-center justify-center rounded-full px-1",
1204
+ "text-[9px] font-bold",
1206
1205
  active ? "bg-white/20 text-white" : "bg-[#E5E5EA] text-[#8E8E93]"
1207
1206
  ),
1208
1207
  children: badge
@@ -1212,8 +1211,132 @@ function SidebarItem({
1212
1211
  }
1213
1212
  );
1214
1213
  }
1214
+ function SidebarSubMenu({
1215
+ icon,
1216
+ label,
1217
+ badge,
1218
+ defaultOpen = false,
1219
+ open: controlledOpen,
1220
+ onOpenChange,
1221
+ activeChild = false,
1222
+ children,
1223
+ className
1224
+ }) {
1225
+ const { collapsed } = useSidebar();
1226
+ const [internalOpen, setInternalOpen] = React3.useState(defaultOpen);
1227
+ const isOpen = controlledOpen ?? internalOpen;
1228
+ const toggle = () => {
1229
+ const next = !isOpen;
1230
+ setInternalOpen(next);
1231
+ onOpenChange?.(next);
1232
+ };
1233
+ if (collapsed) {
1234
+ return /* @__PURE__ */ jsxRuntime.jsx(
1235
+ "button",
1236
+ {
1237
+ type: "button",
1238
+ title: label,
1239
+ onClick: toggle,
1240
+ className: cn(
1241
+ "mx-auto flex h-8 w-8 min-h-[36px] min-w-[36px] items-center justify-center rounded-lg",
1242
+ "select-none outline-none transition-all duration-150",
1243
+ "focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
1244
+ activeChild ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
1245
+ className
1246
+ ),
1247
+ children: icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("flex-shrink-0", !activeChild && "text-[#8E8E93]"), children: icon })
1248
+ }
1249
+ );
1250
+ }
1251
+ const triggerActive = activeChild && !isOpen;
1252
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-px", className), children: [
1253
+ /* @__PURE__ */ jsxRuntime.jsxs(
1254
+ "button",
1255
+ {
1256
+ type: "button",
1257
+ onClick: toggle,
1258
+ className: cn(
1259
+ "flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 min-h-[30px]",
1260
+ "text-[12px] font-medium select-none outline-none transition-all duration-150",
1261
+ "focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
1262
+ triggerActive ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]"
1263
+ ),
1264
+ children: [
1265
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("flex-shrink-0", !triggerActive && "text-[#8E8E93]"), children: icon }),
1266
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-left", children: label }),
1267
+ badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
1268
+ "span",
1269
+ {
1270
+ className: cn(
1271
+ "flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9px] font-bold",
1272
+ triggerActive ? "bg-white/20 text-white" : "bg-[#E5E5EA] text-[#8E8E93]"
1273
+ ),
1274
+ children: badge
1275
+ }
1276
+ ),
1277
+ /* @__PURE__ */ jsxRuntime.jsx(
1278
+ "svg",
1279
+ {
1280
+ className: cn(
1281
+ "h-3 w-3 flex-shrink-0 transition-transform duration-200",
1282
+ triggerActive ? "text-white/60" : "text-[#C7C7CC]",
1283
+ isOpen && "rotate-90"
1284
+ ),
1285
+ viewBox: "0 0 24 24",
1286
+ fill: "none",
1287
+ stroke: "currentColor",
1288
+ strokeWidth: "2.5",
1289
+ strokeLinecap: "round",
1290
+ strokeLinejoin: "round",
1291
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 18l6-6-6-6" })
1292
+ }
1293
+ )
1294
+ ]
1295
+ }
1296
+ ),
1297
+ /* @__PURE__ */ jsxRuntime.jsx(
1298
+ "div",
1299
+ {
1300
+ className: cn(
1301
+ "overflow-hidden transition-all duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]",
1302
+ isOpen ? "max-h-96 opacity-100" : "max-h-0 opacity-0 pointer-events-none"
1303
+ ),
1304
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-2.5 space-y-px border-l border-[#E5E5EA] py-0.5 pl-1.5", children })
1305
+ }
1306
+ )
1307
+ ] });
1308
+ }
1309
+ function SidebarSubMenuItem({
1310
+ icon,
1311
+ label,
1312
+ active = false,
1313
+ href,
1314
+ as: Tag = "button",
1315
+ className,
1316
+ ...props
1317
+ }) {
1318
+ const tagProps = href ? { href } : { type: "button" };
1319
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1320
+ Tag,
1321
+ {
1322
+ ...tagProps,
1323
+ className: cn(
1324
+ "flex w-full items-center gap-1.5 rounded-md px-2 py-1 min-h-[26px]",
1325
+ "text-[11px] font-medium select-none outline-none transition-all duration-150",
1326
+ "focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
1327
+ active ? "bg-[#007AFF] text-white shadow-[0_1px_4px_rgba(0,122,255,0.20)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
1328
+ className
1329
+ ),
1330
+ ...props,
1331
+ children: [
1332
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("flex-shrink-0", !active && "text-[#8E8E93]"), children: icon }),
1333
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-left", children: label })
1334
+ ]
1335
+ }
1336
+ );
1337
+ }
1215
1338
  function SidebarFooter({ className, ...props }) {
1216
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-shrink-0 p-3", className), ...props });
1339
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-shrink-0 p-2", className), ...props });
1217
1340
  }
1218
1341
  function SidebarUser({
1219
1342
  name,
@@ -1230,8 +1353,8 @@ function SidebarUser({
1230
1353
  "div",
1231
1354
  {
1232
1355
  className: cn(
1233
- "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full",
1234
- `bg-gradient-to-br ${avatarColor} text-white text-xs font-semibold`
1356
+ "flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full",
1357
+ `bg-gradient-to-br ${avatarColor} text-white text-[10px] font-semibold`
1235
1358
  ),
1236
1359
  children: avatarFallback ?? name.charAt(0).toUpperCase()
1237
1360
  }
@@ -1239,11 +1362,11 @@ function SidebarUser({
1239
1362
  if (collapsed) {
1240
1363
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex justify-center", className), ...props, children: avatarNode });
1241
1364
  }
1242
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-xl bg-[#F2F2F7] p-3", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5", children: [
1365
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-lg bg-[#F2F2F7] p-2", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1243
1366
  avatarNode,
1244
1367
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
1245
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[12px] font-semibold text-[#1C1C1E]", children: name }),
1246
- subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[11px] text-[#8E8E93]", children: subtitle })
1368
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[11px] font-semibold text-[#1C1C1E]", children: name }),
1369
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-[10px] text-[#8E8E93]", children: subtitle })
1247
1370
  ] }),
1248
1371
  actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: actions })
1249
1372
  ] }) });
@@ -1254,7 +1377,7 @@ function SidebarToggle({ collapsed, className, ...props }) {
1254
1377
  {
1255
1378
  type: "button",
1256
1379
  className: cn(
1257
- "flex h-7 w-7 items-center justify-center rounded-lg",
1380
+ "flex h-6 w-6 items-center justify-center rounded-md",
1258
1381
  "text-[#8E8E93] hover:bg-[#F2F2F7] hover:text-[#3C3C43]",
1259
1382
  "transition-colors duration-150",
1260
1383
  className
@@ -1264,7 +1387,7 @@ function SidebarToggle({ collapsed, className, ...props }) {
1264
1387
  children: /* @__PURE__ */ jsxRuntime.jsx(
1265
1388
  "svg",
1266
1389
  {
1267
- className: cn("h-4 w-4 transition-transform duration-200", collapsed && "rotate-180"),
1390
+ className: cn("h-3.5 w-3.5 transition-transform duration-200", collapsed && "rotate-180"),
1268
1391
  viewBox: "0 0 24 24",
1269
1392
  fill: "none",
1270
1393
  stroke: "currentColor",
@@ -1337,6 +1460,8 @@ exports.SidebarFooter = SidebarFooter;
1337
1460
  exports.SidebarGroup = SidebarGroup;
1338
1461
  exports.SidebarHeader = SidebarHeader;
1339
1462
  exports.SidebarItem = SidebarItem;
1463
+ exports.SidebarSubMenu = SidebarSubMenu;
1464
+ exports.SidebarSubMenuItem = SidebarSubMenuItem;
1340
1465
  exports.SidebarToggle = SidebarToggle;
1341
1466
  exports.SidebarUser = SidebarUser;
1342
1467
  exports.Table = Table;
package/dist/index.d.cts CHANGED
@@ -279,6 +279,26 @@ 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
+ defaultOpen?: boolean;
287
+ open?: boolean;
288
+ onOpenChange?: (open: boolean) => void;
289
+ activeChild?: boolean;
290
+ children: React.ReactNode;
291
+ className?: string;
292
+ }
293
+ declare function SidebarSubMenu({ icon, label, badge, defaultOpen, open: controlledOpen, onOpenChange, activeChild, children, className, }: SidebarSubMenuProps): react_jsx_runtime.JSX.Element;
294
+ interface SidebarSubMenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
295
+ icon?: React.ReactNode;
296
+ label: string;
297
+ active?: boolean;
298
+ href?: string;
299
+ as?: React.ElementType;
300
+ }
301
+ declare function SidebarSubMenuItem({ icon, label, active, href, as: Tag, className, ...props }: SidebarSubMenuItemProps): react_jsx_runtime.JSX.Element;
282
302
  declare function SidebarFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
283
303
  interface SidebarUserProps extends React.HTMLAttributes<HTMLDivElement> {
284
304
  name: string;
@@ -320,4 +340,4 @@ declare const colors: {
320
340
  };
321
341
  declare function generateId(): string;
322
342
 
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 };
343
+ 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,26 @@ 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
+ defaultOpen?: boolean;
287
+ open?: boolean;
288
+ onOpenChange?: (open: boolean) => void;
289
+ activeChild?: boolean;
290
+ children: React.ReactNode;
291
+ className?: string;
292
+ }
293
+ declare function SidebarSubMenu({ icon, label, badge, defaultOpen, open: controlledOpen, onOpenChange, activeChild, children, className, }: SidebarSubMenuProps): react_jsx_runtime.JSX.Element;
294
+ interface SidebarSubMenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
295
+ icon?: React.ReactNode;
296
+ label: string;
297
+ active?: boolean;
298
+ href?: string;
299
+ as?: React.ElementType;
300
+ }
301
+ declare function SidebarSubMenuItem({ icon, label, active, href, as: Tag, className, ...props }: SidebarSubMenuItemProps): react_jsx_runtime.JSX.Element;
282
302
  declare function SidebarFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
283
303
  interface SidebarUserProps extends React.HTMLAttributes<HTMLDivElement> {
284
304
  name: string;
@@ -320,4 +340,4 @@ declare const colors: {
320
340
  };
321
341
  declare function generateId(): string;
322
342
 
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 };
343
+ 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
@@ -1072,8 +1072,8 @@ var useSidebar = () => useContext(SidebarContext);
1072
1072
  function Sidebar({
1073
1073
  collapsed = false,
1074
1074
  glass = true,
1075
- width = "240px",
1076
- collapsedWidth = "64px",
1075
+ width = "210px",
1076
+ collapsedWidth = "52px",
1077
1077
  overlay = false,
1078
1078
  onOverlayClose,
1079
1079
  className,
@@ -1136,28 +1136,28 @@ function SidebarBrand({ logo, title, subtitle, className, ...props }) {
1136
1136
  return /* @__PURE__ */ jsxs(
1137
1137
  "div",
1138
1138
  {
1139
- className: cn("flex items-center gap-3 px-4 py-5", collapsed && "justify-center px-0", className),
1139
+ className: cn("flex items-center gap-2.5 px-3 py-3", collapsed && "justify-center px-0", className),
1140
1140
  ...props,
1141
1141
  children: [
1142
1142
  /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: logo }),
1143
1143
  !collapsed && /* @__PURE__ */ jsxs("div", { className: "min-w-0 overflow-hidden", children: [
1144
- /* @__PURE__ */ jsx("p", { className: "truncate text-[13px] font-semibold tracking-[-0.01em] text-[#1C1C1E]", children: title }),
1145
- subtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-[11px] text-[#8E8E93]", children: subtitle })
1144
+ /* @__PURE__ */ jsx("p", { className: "truncate text-[12px] font-semibold tracking-[-0.01em] text-[#1C1C1E]", children: title }),
1145
+ subtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-[10px] text-[#8E8E93]", children: subtitle })
1146
1146
  ] })
1147
1147
  ]
1148
1148
  }
1149
1149
  );
1150
1150
  }
1151
1151
  function SidebarDivider({ className }) {
1152
- return /* @__PURE__ */ jsx("div", { className: cn("mx-3 my-1 h-px bg-[#E5E5EA]", className) });
1152
+ return /* @__PURE__ */ jsx("div", { className: cn("mx-2 my-0.5 h-px bg-[#E5E5EA]", className) });
1153
1153
  }
1154
1154
  function SidebarContent({ className, ...props }) {
1155
- return /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-y-auto px-2 py-2 avt-scroll space-y-0.5", className), ...props });
1155
+ return /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-y-auto px-1.5 py-1.5 avt-scroll space-y-px", className), ...props });
1156
1156
  }
1157
1157
  function SidebarGroup({ label, className, children, ...props }) {
1158
1158
  const { collapsed } = useSidebar();
1159
- return /* @__PURE__ */ jsxs("div", { className: cn("mb-1", className), ...props, children: [
1160
- label && !collapsed && /* @__PURE__ */ jsx("p", { className: "mb-1 px-3 text-[10px] font-semibold uppercase tracking-widest text-[#C7C7CC]", children: label }),
1159
+ return /* @__PURE__ */ jsxs("div", { className: cn("mb-0.5", className), ...props, children: [
1160
+ label && !collapsed && /* @__PURE__ */ jsx("p", { className: "mb-0.5 px-2.5 text-[9px] font-semibold uppercase tracking-widest text-[#C7C7CC]", children: label }),
1161
1161
  children
1162
1162
  ] });
1163
1163
  }
@@ -1179,11 +1179,10 @@ function SidebarItem({
1179
1179
  ...tagProps,
1180
1180
  title: collapsed ? label : void 0,
1181
1181
  className: cn(
1182
- "flex w-full items-center gap-2.5 rounded-xl transition-all duration-150",
1183
- "text-[13px] font-medium select-none outline-none",
1182
+ "flex w-full items-center gap-2 rounded-lg transition-all duration-150",
1183
+ "text-[12px] font-medium select-none outline-none",
1184
1184
  "focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
1185
- // Mobile-friendly touch target
1186
- collapsed ? "justify-center px-0 mx-auto w-10 h-10 min-h-[44px] min-w-[44px]" : "px-3 py-2.5 min-h-[44px]",
1185
+ collapsed ? "justify-center px-0 mx-auto w-8 h-8 min-h-[36px] min-w-[36px]" : "px-2.5 py-1.5 min-h-[30px]",
1187
1186
  active ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
1188
1187
  className
1189
1188
  ),
@@ -1195,8 +1194,8 @@ function SidebarItem({
1195
1194
  "span",
1196
1195
  {
1197
1196
  className: cn(
1198
- "ml-auto flex h-5 min-w-5 items-center justify-center rounded-full px-1.5",
1199
- "text-[10px] font-bold",
1197
+ "ml-auto flex h-4 min-w-4 items-center justify-center rounded-full px-1",
1198
+ "text-[9px] font-bold",
1200
1199
  active ? "bg-white/20 text-white" : "bg-[#E5E5EA] text-[#8E8E93]"
1201
1200
  ),
1202
1201
  children: badge
@@ -1206,8 +1205,132 @@ function SidebarItem({
1206
1205
  }
1207
1206
  );
1208
1207
  }
1208
+ function SidebarSubMenu({
1209
+ icon,
1210
+ label,
1211
+ badge,
1212
+ defaultOpen = false,
1213
+ open: controlledOpen,
1214
+ onOpenChange,
1215
+ activeChild = false,
1216
+ children,
1217
+ className
1218
+ }) {
1219
+ const { collapsed } = useSidebar();
1220
+ const [internalOpen, setInternalOpen] = useState(defaultOpen);
1221
+ const isOpen = controlledOpen ?? internalOpen;
1222
+ const toggle = () => {
1223
+ const next = !isOpen;
1224
+ setInternalOpen(next);
1225
+ onOpenChange?.(next);
1226
+ };
1227
+ if (collapsed) {
1228
+ return /* @__PURE__ */ jsx(
1229
+ "button",
1230
+ {
1231
+ type: "button",
1232
+ title: label,
1233
+ onClick: toggle,
1234
+ className: cn(
1235
+ "mx-auto flex h-8 w-8 min-h-[36px] min-w-[36px] items-center justify-center rounded-lg",
1236
+ "select-none outline-none transition-all duration-150",
1237
+ "focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
1238
+ activeChild ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
1239
+ className
1240
+ ),
1241
+ children: icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", !activeChild && "text-[#8E8E93]"), children: icon })
1242
+ }
1243
+ );
1244
+ }
1245
+ const triggerActive = activeChild && !isOpen;
1246
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-px", className), children: [
1247
+ /* @__PURE__ */ jsxs(
1248
+ "button",
1249
+ {
1250
+ type: "button",
1251
+ onClick: toggle,
1252
+ className: cn(
1253
+ "flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 min-h-[30px]",
1254
+ "text-[12px] font-medium select-none outline-none transition-all duration-150",
1255
+ "focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
1256
+ triggerActive ? "bg-[#007AFF] text-white shadow-[0_2px_8px_rgba(0,122,255,0.28)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]"
1257
+ ),
1258
+ children: [
1259
+ icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", !triggerActive && "text-[#8E8E93]"), children: icon }),
1260
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left", children: label }),
1261
+ badge !== void 0 && /* @__PURE__ */ jsx(
1262
+ "span",
1263
+ {
1264
+ className: cn(
1265
+ "flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9px] font-bold",
1266
+ triggerActive ? "bg-white/20 text-white" : "bg-[#E5E5EA] text-[#8E8E93]"
1267
+ ),
1268
+ children: badge
1269
+ }
1270
+ ),
1271
+ /* @__PURE__ */ jsx(
1272
+ "svg",
1273
+ {
1274
+ className: cn(
1275
+ "h-3 w-3 flex-shrink-0 transition-transform duration-200",
1276
+ triggerActive ? "text-white/60" : "text-[#C7C7CC]",
1277
+ isOpen && "rotate-90"
1278
+ ),
1279
+ viewBox: "0 0 24 24",
1280
+ fill: "none",
1281
+ stroke: "currentColor",
1282
+ strokeWidth: "2.5",
1283
+ strokeLinecap: "round",
1284
+ strokeLinejoin: "round",
1285
+ children: /* @__PURE__ */ jsx("path", { d: "M9 18l6-6-6-6" })
1286
+ }
1287
+ )
1288
+ ]
1289
+ }
1290
+ ),
1291
+ /* @__PURE__ */ jsx(
1292
+ "div",
1293
+ {
1294
+ className: cn(
1295
+ "overflow-hidden transition-all duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]",
1296
+ isOpen ? "max-h-96 opacity-100" : "max-h-0 opacity-0 pointer-events-none"
1297
+ ),
1298
+ children: /* @__PURE__ */ jsx("div", { className: "ml-2.5 space-y-px border-l border-[#E5E5EA] py-0.5 pl-1.5", children })
1299
+ }
1300
+ )
1301
+ ] });
1302
+ }
1303
+ function SidebarSubMenuItem({
1304
+ icon,
1305
+ label,
1306
+ active = false,
1307
+ href,
1308
+ as: Tag = "button",
1309
+ className,
1310
+ ...props
1311
+ }) {
1312
+ const tagProps = href ? { href } : { type: "button" };
1313
+ return /* @__PURE__ */ jsxs(
1314
+ Tag,
1315
+ {
1316
+ ...tagProps,
1317
+ className: cn(
1318
+ "flex w-full items-center gap-1.5 rounded-md px-2 py-1 min-h-[26px]",
1319
+ "text-[11px] font-medium select-none outline-none transition-all duration-150",
1320
+ "focus-visible:ring-2 focus-visible:ring-[#007AFF]/30",
1321
+ active ? "bg-[#007AFF] text-white shadow-[0_1px_4px_rgba(0,122,255,0.20)]" : "text-[#3C3C43] hover:bg-[#007AFF]/8 hover:text-[#007AFF]",
1322
+ className
1323
+ ),
1324
+ ...props,
1325
+ children: [
1326
+ icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", !active && "text-[#8E8E93]"), children: icon }),
1327
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left", children: label })
1328
+ ]
1329
+ }
1330
+ );
1331
+ }
1209
1332
  function SidebarFooter({ className, ...props }) {
1210
- return /* @__PURE__ */ jsx("div", { className: cn("flex-shrink-0 p-3", className), ...props });
1333
+ return /* @__PURE__ */ jsx("div", { className: cn("flex-shrink-0 p-2", className), ...props });
1211
1334
  }
1212
1335
  function SidebarUser({
1213
1336
  name,
@@ -1224,8 +1347,8 @@ function SidebarUser({
1224
1347
  "div",
1225
1348
  {
1226
1349
  className: cn(
1227
- "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full",
1228
- `bg-gradient-to-br ${avatarColor} text-white text-xs font-semibold`
1350
+ "flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full",
1351
+ `bg-gradient-to-br ${avatarColor} text-white text-[10px] font-semibold`
1229
1352
  ),
1230
1353
  children: avatarFallback ?? name.charAt(0).toUpperCase()
1231
1354
  }
@@ -1233,11 +1356,11 @@ function SidebarUser({
1233
1356
  if (collapsed) {
1234
1357
  return /* @__PURE__ */ jsx("div", { className: cn("flex justify-center", className), ...props, children: avatarNode });
1235
1358
  }
1236
- return /* @__PURE__ */ jsx("div", { className: cn("rounded-xl bg-[#F2F2F7] p-3", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5", children: [
1359
+ return /* @__PURE__ */ jsx("div", { className: cn("rounded-lg bg-[#F2F2F7] p-2", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1237
1360
  avatarNode,
1238
1361
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
1239
- /* @__PURE__ */ jsx("p", { className: "truncate text-[12px] font-semibold text-[#1C1C1E]", children: name }),
1240
- subtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-[11px] text-[#8E8E93]", children: subtitle })
1362
+ /* @__PURE__ */ jsx("p", { className: "truncate text-[11px] font-semibold text-[#1C1C1E]", children: name }),
1363
+ subtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-[10px] text-[#8E8E93]", children: subtitle })
1241
1364
  ] }),
1242
1365
  actions && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: actions })
1243
1366
  ] }) });
@@ -1248,7 +1371,7 @@ function SidebarToggle({ collapsed, className, ...props }) {
1248
1371
  {
1249
1372
  type: "button",
1250
1373
  className: cn(
1251
- "flex h-7 w-7 items-center justify-center rounded-lg",
1374
+ "flex h-6 w-6 items-center justify-center rounded-md",
1252
1375
  "text-[#8E8E93] hover:bg-[#F2F2F7] hover:text-[#3C3C43]",
1253
1376
  "transition-colors duration-150",
1254
1377
  className
@@ -1258,7 +1381,7 @@ function SidebarToggle({ collapsed, className, ...props }) {
1258
1381
  children: /* @__PURE__ */ jsx(
1259
1382
  "svg",
1260
1383
  {
1261
- className: cn("h-4 w-4 transition-transform duration-200", collapsed && "rotate-180"),
1384
+ className: cn("h-3.5 w-3.5 transition-transform duration-200", collapsed && "rotate-180"),
1262
1385
  viewBox: "0 0 24 24",
1263
1386
  fill: "none",
1264
1387
  stroke: "currentColor",
@@ -1287,4 +1410,4 @@ function useClickOutside(ref, handler, enabled = true) {
1287
1410
  }, [ref, handler, enabled]);
1288
1411
  }
1289
1412
 
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 };
1413
+ 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avt-rct-lib",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "AVT React Component Library — Tailwind only, zero other deps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",