@kushagradhawan/kookie-ui 0.1.27 → 0.1.29

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.
Files changed (61) hide show
  1. package/components.css +583 -241
  2. package/dist/cjs/components/accordion.d.ts +22 -0
  3. package/dist/cjs/components/accordion.d.ts.map +1 -0
  4. package/dist/cjs/components/accordion.js +2 -0
  5. package/dist/cjs/components/accordion.js.map +7 -0
  6. package/dist/cjs/components/accordion.props.d.ts +88 -0
  7. package/dist/cjs/components/accordion.props.d.ts.map +1 -0
  8. package/dist/cjs/components/accordion.props.js +2 -0
  9. package/dist/cjs/components/accordion.props.js.map +7 -0
  10. package/dist/cjs/components/dialog.props.d.ts +1 -1
  11. package/dist/cjs/components/index.d.ts +1 -0
  12. package/dist/cjs/components/index.d.ts.map +1 -1
  13. package/dist/cjs/components/index.js +1 -1
  14. package/dist/cjs/components/index.js.map +3 -3
  15. package/dist/cjs/components/scroll-area.js.map +1 -1
  16. package/dist/cjs/components/sidebar.d.ts +1 -1
  17. package/dist/cjs/components/sidebar.d.ts.map +1 -1
  18. package/dist/cjs/components/sidebar.js +1 -1
  19. package/dist/cjs/components/sidebar.js.map +2 -2
  20. package/dist/cjs/components/sidebar.props.d.ts +2 -2
  21. package/dist/cjs/components/sidebar.props.js +1 -1
  22. package/dist/cjs/components/sidebar.props.js.map +2 -2
  23. package/dist/cjs/helpers/extract-margin-props.d.ts +7 -7
  24. package/dist/esm/components/accordion.d.ts +22 -0
  25. package/dist/esm/components/accordion.d.ts.map +1 -0
  26. package/dist/esm/components/accordion.js +2 -0
  27. package/dist/esm/components/accordion.js.map +7 -0
  28. package/dist/esm/components/accordion.props.d.ts +88 -0
  29. package/dist/esm/components/accordion.props.d.ts.map +1 -0
  30. package/dist/esm/components/accordion.props.js +2 -0
  31. package/dist/esm/components/accordion.props.js.map +7 -0
  32. package/dist/esm/components/dialog.props.d.ts +1 -1
  33. package/dist/esm/components/index.d.ts +1 -0
  34. package/dist/esm/components/index.d.ts.map +1 -1
  35. package/dist/esm/components/index.js +1 -1
  36. package/dist/esm/components/index.js.map +3 -3
  37. package/dist/esm/components/scroll-area.js.map +1 -1
  38. package/dist/esm/components/sidebar.d.ts +1 -1
  39. package/dist/esm/components/sidebar.d.ts.map +1 -1
  40. package/dist/esm/components/sidebar.js +1 -1
  41. package/dist/esm/components/sidebar.js.map +2 -2
  42. package/dist/esm/components/sidebar.props.d.ts +2 -2
  43. package/dist/esm/components/sidebar.props.js +1 -1
  44. package/dist/esm/components/sidebar.props.js.map +2 -2
  45. package/dist/esm/helpers/extract-margin-props.d.ts +7 -7
  46. package/package.json +1 -1
  47. package/src/components/_internal/base-sidebar-menu.css +223 -0
  48. package/src/components/_internal/base-sidebar.css +141 -0
  49. package/src/components/accordion.css +254 -0
  50. package/src/components/accordion.props.tsx +84 -0
  51. package/src/components/accordion.tsx +162 -0
  52. package/src/components/index.css +1 -0
  53. package/src/components/index.tsx +1 -0
  54. package/src/components/scroll-area.tsx +2 -2
  55. package/src/components/sidebar.css +367 -628
  56. package/src/components/sidebar.props.tsx +2 -2
  57. package/src/components/sidebar.tsx +2 -2
  58. package/src/styles/tokens/radius.css +1 -1
  59. package/styles.css +584 -242
  60. package/tokens/base.css +1 -1
  61. package/tokens.css +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/sidebar.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from './slot.js';\nimport { Accordion } from 'radix-ui';\n\nimport { sidebarPropDefs } from './sidebar.props.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { IconButton } from './icon-button.js';\nimport { ScrollArea } from './scroll-area.js';\nimport { Separator } from './separator.js';\nimport { ChevronDownIcon, ThickChevronRightIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { Kbd } from './kbd.js';\nimport { Badge } from './badge.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { BadgeProps } from './badge.js';\n\n// Badge configuration type for sidebar menu buttons\ntype BadgeConfig = {\n content: React.ReactNode;\n variant?: BadgeProps['variant'];\n size?: BadgeProps['size'];\n color?: BadgeProps['color'];\n highContrast?: BadgeProps['highContrast'];\n radius?: BadgeProps['radius'];\n};\n\n// Sidebar context for state management\ntype SidebarContextProps = {\n state: 'expanded' | 'collapsed';\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n side: 'left' | 'right';\n type: 'sidebar' | 'floating';\n variant: 'soft' | 'surface' | 'ghost';\n menuVariant: 'solid' | 'soft';\n collapsible: 'offcanvas' | 'icon' | 'none';\n size: '1' | '2';\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n return context;\n}\n\n// Hook to detect mobile (simplified version)\nfunction useIsMobile() {\n const [isMobile, setIsMobile] = React.useState(false);\n\n React.useEffect(() => {\n const checkIsMobile = () => {\n setIsMobile(window.innerWidth < 768);\n };\n\n checkIsMobile();\n window.addEventListener('resize', checkIsMobile);\n return () => window.removeEventListener('resize', checkIsMobile);\n }, []);\n\n return isMobile;\n}\n\n// Provider component\ninterface SidebarProviderProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n side?: 'left' | 'right';\n}\n\nconst SidebarProvider = React.forwardRef<HTMLDivElement, SidebarProviderProps>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n side = 'left',\n className,\n children,\n ...props\n },\n forwardedRef,\n ) => {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n // Internal state for uncontrolled mode\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n\n // Use controlled state if provided, otherwise internal state\n const open = openProp ?? internalOpen;\n\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n setInternalOpen(openState);\n }\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // State for data attributes\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = React.useMemo<Partial<SidebarContextProps>>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n side,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, side],\n );\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarProvider', className)}\n data-state={state}\n data-side={side}\n >\n <SidebarContext.Provider value={contextValue as SidebarContextProps}>\n {children}\n </SidebarContext.Provider>\n </div>\n );\n },\n);\nSidebarProvider.displayName = 'Sidebar.Provider';\n\n// Main Sidebar component\ntype SidebarOwnProps = GetPropDefTypes<typeof sidebarPropDefs>;\ninterface SidebarProps extends ComponentPropsWithout<'div', RemovedProps>, SidebarOwnProps {}\n\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>((props, forwardedRef) => {\n const themeContext = useThemeContext();\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n const {\n size = sidebarPropDefs.size.default,\n variant = sidebarPropDefs.variant.default,\n menuVariant = sidebarPropDefs.menuVariant.default,\n type = sidebarPropDefs.type.default,\n side = sidebarPropDefs.side.default,\n collapsible = sidebarPropDefs.collapsible.default,\n panelBackground,\n color,\n highContrast = sidebarPropDefs.highContrast.default,\n asChild,\n } = props;\n\n const { className, children, ...rootProps } = extractProps(props, sidebarPropDefs);\n const { asChild: _, panelBackground: __, ...safeRootProps } = rootProps; // Remove asChild and panelBackground from DOM props\n const resolvedColor = color || themeContext.accentColor;\n\n // Update context with current props - we'll pass the resolved values\n const resolvedSize = typeof size === 'object' ? size.initial || '2' : size;\n const context = React.useContext(SidebarContext);\n if (context) {\n context.side = side;\n context.type = type;\n context.variant = variant;\n context.menuVariant = menuVariant;\n context.collapsible = collapsible;\n context.size = resolvedSize;\n }\n\n if (collapsible === 'none') {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', `rt-r-size-${size}`, className)}\n >\n <Theme>\n <div\n className={classNames('rt-SidebarContainer', `rt-variant-${variant}`)}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={openMobile ? 'open' : 'closed'}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', 'rt-SidebarRoot--mobile', className)}\n >\n <Theme>\n <div\n className={classNames(\n 'rt-SidebarContainer',\n `rt-variant-${variant}`,\n `rt-r-size-${size}`,\n )}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', className)}\n >\n <Theme>\n <div\n className={classNames(\n 'rt-SidebarContainer',\n `rt-variant-${variant}`,\n `rt-r-size-${size}`,\n )}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n});\nSidebar.displayName = 'Sidebar.Root';\n\n// Sidebar content area\ninterface SidebarContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarContent = React.forwardRef<HTMLDivElement, SidebarContentProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const {\n size = '2',\n menuVariant = 'soft',\n type = 'sidebar',\n collapsible = 'none',\n } = context || {};\n\n return (\n <ScrollArea type=\"auto\">\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-BaseMenuContent',\n 'rt-SidebarContent',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n className,\n )}\n data-type={type}\n data-collapsible={collapsible}\n >\n {children}\n </div>\n </ScrollArea>\n );\n },\n);\nSidebarContent.displayName = 'Sidebar.Content';\n\n// Sidebar header\ninterface SidebarHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarHeader = React.forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarHeader',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarHeader--container': asContainer,\n },\n className,\n )}\n />\n );\n },\n);\nSidebarHeader.displayName = 'Sidebar.Header';\n\n// Sidebar footer\ninterface SidebarFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarFooter = React.forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarFooter',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarFooter--container': asContainer,\n },\n className,\n )}\n />\n );\n },\n);\nSidebarFooter.displayName = 'Sidebar.Footer';\n\n// Sidebar trigger button\ninterface SidebarTriggerProps extends ComponentPropsWithout<typeof IconButton, RemovedProps> {}\n\nconst SidebarTrigger = React.forwardRef<React.ElementRef<typeof IconButton>, SidebarTriggerProps>(\n ({ onClick, children, ...props }, forwardedRef) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <IconButton\n {...props}\n ref={forwardedRef}\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n >\n {children || <ChevronDownIcon />}\n </IconButton>\n );\n },\n);\nSidebarTrigger.displayName = 'Sidebar.Trigger';\n\n// Removed SidebarInset - not needed\n\n// Sidebar separator\ninterface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {}\n\nconst SidebarSeparator = React.forwardRef<\n React.ComponentRef<typeof Separator>,\n SidebarSeparatorProps\n>(({ className, ...props }, forwardedRef) => (\n <Separator\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarSeparator', className)}\n />\n));\nSidebarSeparator.displayName = 'Sidebar.Separator';\n\n// Menu components - reusing dropdown menu structure\ninterface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {}\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, SidebarMenuProps>(\n ({ className, ...props }, forwardedRef) => (\n <ul\n {...props}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuViewport', 'rt-SidebarMenu', className)}\n />\n ),\n);\nSidebarMenu.displayName = 'Sidebar.Menu';\n\ninterface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {}\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, SidebarMenuItemProps>(\n ({ className, ...props }, forwardedRef) => (\n <li {...props} ref={forwardedRef} className={classNames('rt-SidebarMenuItem', className)} />\n ),\n);\nSidebarMenuItem.displayName = 'Sidebar.MenuItem';\n\ninterface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n isActive?: boolean;\n shortcut?: React.ReactNode;\n badge?: string | BadgeConfig;\n}\n\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n (\n {\n asChild = false,\n isActive = false,\n shortcut,\n badge,\n className,\n children,\n onMouseEnter,\n onMouseLeave,\n ...props\n },\n forwardedRef,\n ) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n const context = React.useContext(SidebarContext);\n const { size: sidebarSize = '2' } = context || {};\n\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-BaseMenuItem', 'rt-SidebarMenuButton', className)}\n data-active={isActive || undefined}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n {/* Badge with soft variant default and size mapping to sidebar size */}\n {badge && (\n <div className=\"rt-SidebarMenuBadge\">\n {typeof badge === 'string' ? (\n <Badge size={sidebarSize} variant=\"soft\">\n {badge}\n </Badge>\n ) : (\n <Badge\n size={badge.size || sidebarSize}\n variant={badge.variant || 'soft'}\n color={badge.color}\n highContrast={badge.highContrast}\n radius={badge.radius}\n >\n {badge.content}\n </Badge>\n )}\n </div>\n )}\n {shortcut && (\n <div className=\"rt-BaseMenuShortcut rt-SidebarMenuShortcut\">\n <Kbd size={sidebarSize}>{shortcut}</Kbd>\n </div>\n )}\n </>\n )}\n </Comp>\n );\n },\n);\nSidebarMenuButton.displayName = 'Sidebar.MenuButton';\n\n// Sub-menu components using Radix Accordion\ninterface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLDivElement, SidebarMenuSubProps>(\n ({ defaultOpen = false, children, ...props }, forwardedRef) => {\n return (\n <div {...props} ref={forwardedRef}>\n <Accordion.Root type=\"single\" collapsible defaultValue={defaultOpen ? 'item' : undefined}>\n <Accordion.Item value=\"item\">{children}</Accordion.Item>\n </Accordion.Root>\n </div>\n );\n },\n);\nSidebarMenuSub.displayName = 'Sidebar.MenuSub';\n\ninterface SidebarMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {\n asChild?: boolean;\n}\n\nconst SidebarMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof Accordion.Trigger>,\n SidebarMenuSubTriggerProps\n>(\n (\n { asChild = false, className, children, onMouseEnter, onMouseLeave, ...props },\n forwardedRef,\n ) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n\n return (\n <Accordion.Header asChild>\n <div>\n <Accordion.Trigger\n {...props}\n ref={forwardedRef}\n asChild={asChild}\n className={classNames(\n 'rt-reset',\n 'rt-BaseMenuItem',\n 'rt-SidebarMenuButton',\n 'rt-SidebarMenuSubTrigger',\n className,\n )}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <ThickChevronRightIcon\n className={classNames(\n 'rt-BaseMenuSubTriggerIcon',\n 'rt-SidebarMenuSubTriggerIcon',\n )}\n />\n </>\n )}\n </Accordion.Trigger>\n </div>\n </Accordion.Header>\n );\n },\n);\nSidebarMenuSubTrigger.displayName = 'Sidebar.MenuSubTrigger';\n\ninterface SidebarMenuSubContentProps\n extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {}\n\nconst SidebarMenuSubContent = React.forwardRef<\n React.ElementRef<typeof Accordion.Content>,\n SidebarMenuSubContentProps\n>(({ className, children, ...props }, forwardedRef) => {\n return (\n <Accordion.Content\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarMenuSubContent', className)}\n >\n <div className=\"rt-SidebarMenuSubList\">{children}</div>\n </Accordion.Content>\n );\n});\nSidebarMenuSubContent.displayName = 'Sidebar.MenuSubContent';\n\n// Group components\ninterface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, SidebarGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuGroup', 'rt-SidebarGroup', className)}\n />\n ),\n);\nSidebarGroup.displayName = 'Sidebar.Group';\n\ninterface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(\n ({ asChild = false, className, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : 'div';\n\n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuLabel', 'rt-SidebarGroupLabel', className)}\n />\n );\n },\n);\nSidebarGroupLabel.displayName = 'Sidebar.GroupLabel';\n\ninterface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, SidebarGroupContentProps>(\n ({ className, ...props }, forwardedRef) => (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarGroupContent', className)}\n />\n ),\n);\nSidebarGroupContent.displayName = 'Sidebar.GroupContent';\n\n// Export all components following shadcn's pattern\nexport {\n SidebarProvider as Provider,\n Sidebar as Root,\n SidebarContent as Content,\n SidebarHeader as Header,\n SidebarFooter as Footer,\n SidebarTrigger as Trigger,\n SidebarSeparator as Separator,\n SidebarMenu as Menu,\n SidebarMenuItem as MenuItem,\n SidebarMenuButton as MenuButton,\n SidebarMenuSub as MenuSub,\n SidebarMenuSubTrigger as MenuSubTrigger,\n SidebarMenuSubContent as MenuSubContent,\n SidebarGroup as Group,\n SidebarGroupLabel as GroupLabel,\n SidebarGroupContent as GroupContent,\n // Export hook\n useSidebar,\n};\n\n/**\n * Enhanced Sidebar Header and Footer Usage Examples:\n *\n * 1. Simple default container (backwards compatible):\n * <Sidebar.Header>\n * <Logo />\n * <span>App Name</span>\n * </Sidebar.Header>\n *\n * 2. Custom flex layout:\n * <Sidebar.Header className=\"rt-justify-between rt-gap-3\">\n * <Logo />\n * <Sidebar.MenuButton>\n * <SettingsIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n *\n * 3. Column layout for multiple rows:\n * <Sidebar.Header className=\"rt-flex-col rt-gap-2\" asContainer={false}>\n * <div className=\"rt-flex rt-items-center rt-gap-2\">\n * <Logo />\n * <span>App Name</span>\n * </div>\n * <Sidebar.MenuButton>\n * <UserAvatar />\n * <span>John Doe</span>\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n *\n * 4. Interactive footer with menu button:\n * <Sidebar.Footer>\n * <Sidebar.MenuButton>\n * <UserIcon />\n * <span>Settings</span>\n * <ChevronUpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n *\n * 5. Custom footer layout:\n * <Sidebar.Footer className=\"rt-justify-between\">\n * <span>v1.0.0</span>\n * <Sidebar.MenuButton>\n * <HelpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n *\n * Available utility classes:\n * - Layout: rt-flex-row, rt-flex-col\n * - Alignment: rt-items-center, rt-items-start, rt-items-end\n * - Justification: rt-justify-between, rt-justify-center, rt-justify-start, rt-justify-end\n * - Gap: rt-gap-1, rt-gap-2, rt-gap-3, rt-gap-4\n */\n\nexport type {\n SidebarProviderProps as ProviderProps,\n SidebarProps as RootProps,\n SidebarContentProps as ContentProps,\n SidebarHeaderProps as HeaderProps,\n SidebarFooterProps as FooterProps,\n SidebarTriggerProps as TriggerProps,\n BadgeConfig,\n};\n"],
5
- "mappings": "aAEA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,MAAY,YACrB,OAAS,aAAAC,MAAiB,WAE1B,OAAS,mBAAAC,MAAuB,qBAChC,OAAS,SAAAC,EAAO,mBAAAC,MAAuB,aACvC,OAAS,cAAAC,MAAkB,mBAC3B,OAAS,cAAAC,MAAkB,mBAC3B,OAAS,aAAAC,MAAiB,iBAC1B,OAAS,mBAAAC,EAAiB,yBAAAC,OAA6B,aACvD,OAAS,gBAAAC,OAAoB,8BAC7B,OAAS,OAAAC,OAAW,WACpB,OAAS,SAAAC,MAAa,aAiCtB,MAAMC,EAAiBf,EAAM,cAA0C,IAAI,EAE3E,SAASgB,GAAa,CACpB,MAAMC,EAAUjB,EAAM,WAAWe,CAAc,EAC/C,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,mDAAmD,EAErE,OAAOA,CACT,CAGA,SAASC,IAAc,CACrB,KAAM,CAACC,EAAUC,CAAW,EAAIpB,EAAM,SAAS,EAAK,EAEpD,OAAAA,EAAM,UAAU,IAAM,CACpB,MAAMqB,EAAgB,IAAM,CAC1BD,EAAY,OAAO,WAAa,GAAG,CACrC,EAEA,OAAAC,EAAc,EACd,OAAO,iBAAiB,SAAUA,CAAa,EACxC,IAAM,OAAO,oBAAoB,SAAUA,CAAa,CACjE,EAAG,CAAC,CAAC,EAEEF,CACT,CAUA,MAAMG,EAAkBtB,EAAM,WAC5B,CACE,CACE,YAAAuB,EAAc,GACd,KAAMC,EACN,aAAcC,EACd,KAAAC,EAAO,OACP,UAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,IACG,CACH,MAAMX,EAAWD,GAAY,EACvB,CAACa,EAAYC,CAAa,EAAIhC,EAAM,SAAS,EAAK,EAGlD,CAACiC,EAAcC,CAAe,EAA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,CACF,EACA8E,EAAsB,YAAc,yBAKpC,MAAMC,EAAwBhF,EAAM,WAGlC,CAAC,CAAE,UAAA2B,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IAElC9B,EAAA,cAACG,EAAU,QAAV,CACE,GAAG0B,EACJ,IAAKC,EACL,UAAW7B,EAAW,2BAA4B0B,CAAS,GAE3D3B,EAAA,cAAC,OAAI,UAAU,yBAAyB4B,CAAS,CACnD,CAEH,EACDoD,EAAsB,YAAc,yBAKpC,MAAMC,EAAejF,EAAM,WACzB,CAAC,CAAE,UAAA2B,EAAW,GAAGE,CAAM,EAAGC,IACxB9B,EAAA,cAAC,OACE,GAAG6B,EACJ,IAAKC,EACL,UAAW7B,EAAW,mBAAoB,kBAAmB0B,CAAS,EACxE,CAEJ,EACAsD,EAAa,YAAc,gBAM3B,MAAMC,EAAoBlF,EAAM,WAC9B,CAAC,CAAE,QAAAoD,EAAU,GAAO,UAAAzB,EAAW,GAAGE,CAAM,EAAGC,IAIvC9B,EAAA,cAHWoD,EAAUlD,EAAO,MAG3B,CACE,GAAG2B,EACJ,IAAKC,EACL,UAAW7B,EAAW,mBAAoB,uBAAwB0B,CAAS,EAC7E,CAGN,EACAuD,EAAkB,YAAc,qBAIhC,MAAMC,EAAsBnF,EAAM,WAChC,CAAC,CAAE,UAAA2B,EAAW,GAAGE,CAAM,EAAGC,IACxB9B,EAAA,cAAC,OACE,GAAG6B,EACJ,IAAKC,EACL,UAAW7B,EAAW,yBAA0B0B,CAAS,EAC3D,CAEJ,EACAwD,EAAoB,YAAc",
4
+ "sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from './slot.js';\nimport { Accordion } from 'radix-ui';\n\nimport { sidebarPropDefs } from './sidebar.props.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { IconButton } from './icon-button.js';\nimport { ScrollArea } from './scroll-area.js';\nimport { Separator } from './separator.js';\nimport { ChevronDownIcon, ThickChevronRightIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { Kbd } from './kbd.js';\nimport { Badge } from './badge.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { BadgeProps } from './badge.js';\n\n// Badge configuration type for sidebar menu buttons\ntype BadgeConfig = {\n content: React.ReactNode;\n variant?: BadgeProps['variant'];\n size?: BadgeProps['size'];\n color?: BadgeProps['color'];\n highContrast?: BadgeProps['highContrast'];\n radius?: BadgeProps['radius'];\n};\n\n// Sidebar context for state management\ntype SidebarContextProps = {\n state: 'expanded' | 'collapsed';\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n side: 'left' | 'right';\n type: 'sidebar' | 'floating';\n variant: 'soft' | 'outline' | 'surface' | 'ghost';\n menuVariant: 'solid' | 'soft';\n collapsible: 'offcanvas' | 'icon' | 'none';\n size: '1' | '2';\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n return context;\n}\n\n// Hook to detect mobile (simplified version)\nfunction useIsMobile() {\n const [isMobile, setIsMobile] = React.useState(false);\n\n React.useEffect(() => {\n const checkIsMobile = () => {\n setIsMobile(window.innerWidth < 768);\n };\n\n checkIsMobile();\n window.addEventListener('resize', checkIsMobile);\n return () => window.removeEventListener('resize', checkIsMobile);\n }, []);\n\n return isMobile;\n}\n\n// Provider component\ninterface SidebarProviderProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n side?: 'left' | 'right';\n}\n\nconst SidebarProvider = React.forwardRef<HTMLDivElement, SidebarProviderProps>(\n (\n {\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n side = 'left',\n className,\n children,\n ...props\n },\n forwardedRef,\n ) => {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n // Internal state for uncontrolled mode\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n\n // Use controlled state if provided, otherwise internal state\n const open = openProp ?? internalOpen;\n\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n setInternalOpen(openState);\n }\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // State for data attributes\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = React.useMemo<Partial<SidebarContextProps>>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n side,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, side],\n );\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarProvider', className)}\n data-state={state}\n data-side={side}\n >\n <SidebarContext.Provider value={contextValue as SidebarContextProps}>\n {children}\n </SidebarContext.Provider>\n </div>\n );\n },\n);\nSidebarProvider.displayName = 'Sidebar.Provider';\n\n// Main Sidebar component\ntype SidebarOwnProps = GetPropDefTypes<typeof sidebarPropDefs>;\ninterface SidebarProps extends ComponentPropsWithout<'div', RemovedProps>, SidebarOwnProps {}\n\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>((props, forwardedRef) => {\n const themeContext = useThemeContext();\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n const {\n size = sidebarPropDefs.size.default,\n variant = sidebarPropDefs.variant.default,\n menuVariant = sidebarPropDefs.menuVariant.default,\n type = sidebarPropDefs.type.default,\n side = sidebarPropDefs.side.default,\n collapsible = sidebarPropDefs.collapsible.default,\n panelBackground,\n color,\n highContrast = sidebarPropDefs.highContrast.default,\n asChild,\n } = props;\n\n const { className, children, ...rootProps } = extractProps(props, sidebarPropDefs);\n const { asChild: _, panelBackground: __, ...safeRootProps } = rootProps; // Remove asChild and panelBackground from DOM props\n const resolvedColor = color || themeContext.accentColor;\n\n // Update context with current props - we'll pass the resolved values\n const resolvedSize = typeof size === 'object' ? size.initial || '2' : size;\n const context = React.useContext(SidebarContext);\n if (context) {\n context.side = side;\n context.type = type;\n context.variant = variant;\n context.menuVariant = menuVariant;\n context.collapsible = collapsible;\n context.size = resolvedSize;\n }\n\n if (collapsible === 'none') {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', `rt-r-size-${size}`, className)}\n >\n <Theme>\n <div\n className={classNames('rt-SidebarContainer', `rt-variant-${variant}`)}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={openMobile ? 'open' : 'closed'}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', 'rt-SidebarRoot--mobile', className)}\n >\n <Theme>\n <div\n className={classNames(\n 'rt-SidebarContainer',\n `rt-variant-${variant}`,\n `rt-r-size-${size}`,\n )}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n }\n\n return (\n <div\n {...safeRootProps}\n ref={forwardedRef}\n data-accent-color={resolvedColor}\n data-state={state}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n className={classNames('rt-SidebarRoot', className)}\n >\n <Theme>\n <div\n className={classNames(\n 'rt-SidebarContainer',\n `rt-variant-${variant}`,\n `rt-r-size-${size}`,\n )}\n data-accent-color={resolvedColor}\n data-high-contrast={highContrast || undefined}\n data-side={side}\n data-type={type}\n data-collapsible={collapsible}\n data-panel-background={panelBackground}\n >\n {children}\n </div>\n </Theme>\n </div>\n );\n});\nSidebar.displayName = 'Sidebar.Root';\n\n// Sidebar content area\ninterface SidebarContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarContent = React.forwardRef<HTMLDivElement, SidebarContentProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const {\n size = '2',\n menuVariant = 'soft',\n type = 'sidebar',\n collapsible = 'none',\n } = context || {};\n\n return (\n <ScrollArea type=\"hover\">\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-BaseMenuContent',\n 'rt-SidebarContent',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n className,\n )}\n data-type={type}\n data-collapsible={collapsible}\n >\n {children}\n </div>\n </ScrollArea>\n );\n },\n);\nSidebarContent.displayName = 'Sidebar.Content';\n\n// Sidebar header\ninterface SidebarHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarHeader = React.forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarHeader',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarHeader--container': asContainer,\n },\n className,\n )}\n />\n );\n },\n);\nSidebarHeader.displayName = 'Sidebar.Header';\n\n// Sidebar footer\ninterface SidebarFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Whether to use the default flex container layout.\n * @default true\n */\n asContainer?: boolean;\n}\n\nconst SidebarFooter = React.forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, asContainer = true, ...props }, forwardedRef) => {\n const context = React.useContext(SidebarContext);\n const { size = '2', menuVariant = 'soft' } = context || {};\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'rt-SidebarFooter',\n `rt-r-size-${size}`,\n `rt-menu-variant-${menuVariant}`,\n {\n 'rt-SidebarFooter--container': asContainer,\n },\n className,\n )}\n />\n );\n },\n);\nSidebarFooter.displayName = 'Sidebar.Footer';\n\n// Sidebar trigger button\ninterface SidebarTriggerProps extends ComponentPropsWithout<typeof IconButton, RemovedProps> {}\n\nconst SidebarTrigger = React.forwardRef<React.ElementRef<typeof IconButton>, SidebarTriggerProps>(\n ({ onClick, children, ...props }, forwardedRef) => {\n const { toggleSidebar } = useSidebar();\n\n return (\n <IconButton\n {...props}\n ref={forwardedRef}\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n >\n {children || <ChevronDownIcon />}\n </IconButton>\n );\n },\n);\nSidebarTrigger.displayName = 'Sidebar.Trigger';\n\n// Removed SidebarInset - not needed\n\n// Sidebar separator\ninterface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {}\n\nconst SidebarSeparator = React.forwardRef<\n React.ComponentRef<typeof Separator>,\n SidebarSeparatorProps\n>(({ className, ...props }, forwardedRef) => (\n <Separator\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarSeparator', className)}\n />\n));\nSidebarSeparator.displayName = 'Sidebar.Separator';\n\n// Menu components - reusing dropdown menu structure\ninterface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {}\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, SidebarMenuProps>(\n ({ className, ...props }, forwardedRef) => (\n <ul\n {...props}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuViewport', 'rt-SidebarMenu', className)}\n />\n ),\n);\nSidebarMenu.displayName = 'Sidebar.Menu';\n\ninterface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {}\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, SidebarMenuItemProps>(\n ({ className, ...props }, forwardedRef) => (\n <li {...props} ref={forwardedRef} className={classNames('rt-SidebarMenuItem', className)} />\n ),\n);\nSidebarMenuItem.displayName = 'Sidebar.MenuItem';\n\ninterface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n isActive?: boolean;\n shortcut?: React.ReactNode;\n badge?: string | BadgeConfig;\n}\n\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n (\n {\n asChild = false,\n isActive = false,\n shortcut,\n badge,\n className,\n children,\n onMouseEnter,\n onMouseLeave,\n ...props\n },\n forwardedRef,\n ) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n const context = React.useContext(SidebarContext);\n const { size: sidebarSize = '2' } = context || {};\n\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-BaseMenuItem', 'rt-SidebarMenuButton', className)}\n data-active={isActive || undefined}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n {/* Badge with soft variant default and size mapping to sidebar size */}\n {badge && (\n <div className=\"rt-SidebarMenuBadge\">\n {typeof badge === 'string' ? (\n <Badge size={sidebarSize} variant=\"soft\">\n {badge}\n </Badge>\n ) : (\n <Badge\n size={badge.size || sidebarSize}\n variant={badge.variant || 'soft'}\n color={badge.color}\n highContrast={badge.highContrast}\n radius={badge.radius}\n >\n {badge.content}\n </Badge>\n )}\n </div>\n )}\n {shortcut && (\n <div className=\"rt-BaseMenuShortcut rt-SidebarMenuShortcut\">\n <Kbd size={sidebarSize}>{shortcut}</Kbd>\n </div>\n )}\n </>\n )}\n </Comp>\n );\n },\n);\nSidebarMenuButton.displayName = 'Sidebar.MenuButton';\n\n// Sub-menu components using Radix Accordion\ninterface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLDivElement, SidebarMenuSubProps>(\n ({ defaultOpen = false, children, ...props }, forwardedRef) => {\n return (\n <div {...props} ref={forwardedRef}>\n <Accordion.Root type=\"single\" collapsible defaultValue={defaultOpen ? 'item' : undefined}>\n <Accordion.Item value=\"item\">{children}</Accordion.Item>\n </Accordion.Root>\n </div>\n );\n },\n);\nSidebarMenuSub.displayName = 'Sidebar.MenuSub';\n\ninterface SidebarMenuSubTriggerProps\n extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {\n asChild?: boolean;\n}\n\nconst SidebarMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof Accordion.Trigger>,\n SidebarMenuSubTriggerProps\n>(\n (\n { asChild = false, className, children, onMouseEnter, onMouseLeave, ...props },\n forwardedRef,\n ) => {\n const [isHighlighted, setIsHighlighted] = React.useState(false);\n\n return (\n <Accordion.Header asChild>\n <div>\n <Accordion.Trigger\n {...props}\n ref={forwardedRef}\n asChild={asChild}\n className={classNames(\n 'rt-reset',\n 'rt-BaseMenuItem',\n 'rt-SidebarMenuButton',\n 'rt-SidebarMenuSubTrigger',\n className,\n )}\n data-highlighted={isHighlighted || undefined}\n onMouseEnter={(event) => {\n setIsHighlighted(true);\n onMouseEnter?.(event);\n }}\n onMouseLeave={(event) => {\n setIsHighlighted(false);\n onMouseLeave?.(event);\n }}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <ThickChevronRightIcon\n className={classNames(\n 'rt-BaseMenuSubTriggerIcon',\n 'rt-SidebarMenuSubTriggerIcon',\n )}\n />\n </>\n )}\n </Accordion.Trigger>\n </div>\n </Accordion.Header>\n );\n },\n);\nSidebarMenuSubTrigger.displayName = 'Sidebar.MenuSubTrigger';\n\ninterface SidebarMenuSubContentProps\n extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {}\n\nconst SidebarMenuSubContent = React.forwardRef<\n React.ElementRef<typeof Accordion.Content>,\n SidebarMenuSubContentProps\n>(({ className, children, ...props }, forwardedRef) => {\n return (\n <Accordion.Content\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarMenuSubContent', className)}\n >\n <div className=\"rt-SidebarMenuSubList\">{children}</div>\n </Accordion.Content>\n );\n});\nSidebarMenuSubContent.displayName = 'Sidebar.MenuSubContent';\n\n// Group components\ninterface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, SidebarGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuGroup', 'rt-SidebarGroup', className)}\n />\n ),\n);\nSidebarGroup.displayName = 'Sidebar.Group';\n\ninterface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(\n ({ asChild = false, className, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : 'div';\n\n return (\n <Comp\n {...props}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuLabel', 'rt-SidebarGroupLabel', className)}\n />\n );\n },\n);\nSidebarGroupLabel.displayName = 'Sidebar.GroupLabel';\n\ninterface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, SidebarGroupContentProps>(\n ({ className, ...props }, forwardedRef) => (\n <div\n {...props}\n ref={forwardedRef}\n className={classNames('rt-SidebarGroupContent', className)}\n />\n ),\n);\nSidebarGroupContent.displayName = 'Sidebar.GroupContent';\n\n// Export all components following shadcn's pattern\nexport {\n SidebarProvider as Provider,\n Sidebar as Root,\n SidebarContent as Content,\n SidebarHeader as Header,\n SidebarFooter as Footer,\n SidebarTrigger as Trigger,\n SidebarSeparator as Separator,\n SidebarMenu as Menu,\n SidebarMenuItem as MenuItem,\n SidebarMenuButton as MenuButton,\n SidebarMenuSub as MenuSub,\n SidebarMenuSubTrigger as MenuSubTrigger,\n SidebarMenuSubContent as MenuSubContent,\n SidebarGroup as Group,\n SidebarGroupLabel as GroupLabel,\n SidebarGroupContent as GroupContent,\n // Export hook\n useSidebar,\n};\n\n/**\n * Enhanced Sidebar Header and Footer Usage Examples:\n *\n * 1. Simple default container (backwards compatible):\n * <Sidebar.Header>\n * <Logo />\n * <span>App Name</span>\n * </Sidebar.Header>\n *\n * 2. Custom flex layout:\n * <Sidebar.Header className=\"rt-justify-between rt-gap-3\">\n * <Logo />\n * <Sidebar.MenuButton>\n * <SettingsIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n *\n * 3. Column layout for multiple rows:\n * <Sidebar.Header className=\"rt-flex-col rt-gap-2\" asContainer={false}>\n * <div className=\"rt-flex rt-items-center rt-gap-2\">\n * <Logo />\n * <span>App Name</span>\n * </div>\n * <Sidebar.MenuButton>\n * <UserAvatar />\n * <span>John Doe</span>\n * </Sidebar.MenuButton>\n * </Sidebar.Header>\n *\n * 4. Interactive footer with menu button:\n * <Sidebar.Footer>\n * <Sidebar.MenuButton>\n * <UserIcon />\n * <span>Settings</span>\n * <ChevronUpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n *\n * 5. Custom footer layout:\n * <Sidebar.Footer className=\"rt-justify-between\">\n * <span>v1.0.0</span>\n * <Sidebar.MenuButton>\n * <HelpIcon />\n * </Sidebar.MenuButton>\n * </Sidebar.Footer>\n *\n * Available utility classes:\n * - Layout: rt-flex-row, rt-flex-col\n * - Alignment: rt-items-center, rt-items-start, rt-items-end\n * - Justification: rt-justify-between, rt-justify-center, rt-justify-start, rt-justify-end\n * - Gap: rt-gap-1, rt-gap-2, rt-gap-3, rt-gap-4\n */\n\nexport type {\n SidebarProviderProps as ProviderProps,\n SidebarProps as RootProps,\n SidebarContentProps as ContentProps,\n SidebarHeaderProps as HeaderProps,\n SidebarFooterProps as FooterProps,\n SidebarTriggerProps as TriggerProps,\n BadgeConfig,\n};\n"],
5
+ "mappings": "aAEA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,MAAY,YACrB,OAAS,aAAAC,MAAiB,WAE1B,OAAS,mBAAAC,MAAuB,qBAChC,OAAS,SAAAC,EAAO,mBAAAC,MAAuB,aACvC,OAAS,cAAAC,MAAkB,mBAC3B,OAAS,cAAAC,MAAkB,mBAC3B,OAAS,aAAAC,MAAiB,iBAC1B,OAAS,mBAAAC,EAAiB,yBAAAC,OAA6B,aACvD,OAAS,gBAAAC,OAAoB,8BAC7B,OAAS,OAAAC,OAAW,WACpB,OAAS,SAAAC,MAAa,aAiCtB,MAAMC,EAAiBf,EAAM,cAA0C,IAAI,EAE3E,SAASgB,GAAa,CACpB,MAAMC,EAAUjB,EAAM,WAAWe,CAAc,EAC/C,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,mDAAmD,EAErE,OAAOA,CACT,CAGA,SAASC,IAAc,CACrB,KAAM,CAACC,EAAUC,CAAW,EAAIpB,EAAM,SAAS,EAAK,EAEpD,OAAAA,EAAM,UAAU,IAAM,CACpB,MAAMqB,EAAgB,IAAM,CAC1BD,EAAY,OAAO,WAAa,GAAG,CACrC,EAEA,OAAAC,EAAc,EACd,OAAO,iBAAiB,SAAUA,CAAa,EACxC,IAAM,OAAO,oBAAoB,SAAUA,CAAa,CACjE,EAAG,CAAC,CAAC,EAEEF,CACT,CAUA,MAAMG,EAAkBtB,EAAM,WAC5B,CACE,CACE,YAAAuB,EAAc,GACd,KAAMC,EACN,aAAcC,EACd,KAAAC,EAAO,OACP,UAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,IACG,CACH,MAAMX,E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A,cACG4B,EACD5B,EAAA,cAACW,GAAA,CACC,UAAWV,EACT,4BACA,8BACF,EACF,CACF,CAEJ,CACF,CACF,CAEJ,CACF,EACA8E,EAAsB,YAAc,yBAKpC,MAAMC,EAAwBhF,EAAM,WAGlC,CAAC,CAAE,UAAA2B,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IAElC9B,EAAA,cAACG,EAAU,QAAV,CACE,GAAG0B,EACJ,IAAKC,EACL,UAAW7B,EAAW,2BAA4B0B,CAAS,GAE3D3B,EAAA,cAAC,OAAI,UAAU,yBAAyB4B,CAAS,CACnD,CAEH,EACDoD,EAAsB,YAAc,yBAKpC,MAAMC,EAAejF,EAAM,WACzB,CAAC,CAAE,UAAA2B,EAAW,GAAGE,CAAM,EAAGC,IACxB9B,EAAA,cAAC,OACE,GAAG6B,EACJ,IAAKC,EACL,UAAW7B,EAAW,mBAAoB,kBAAmB0B,CAAS,EACxE,CAEJ,EACAsD,EAAa,YAAc,gBAM3B,MAAMC,EAAoBlF,EAAM,WAC9B,CAAC,CAAE,QAAAoD,EAAU,GAAO,UAAAzB,EAAW,GAAGE,CAAM,EAAGC,IAIvC9B,EAAA,cAHWoD,EAAUlD,EAAO,MAG3B,CACE,GAAG2B,EACJ,IAAKC,EACL,UAAW7B,EAAW,mBAAoB,uBAAwB0B,CAAS,EAC7E,CAGN,EACAuD,EAAkB,YAAc,qBAIhC,MAAMC,EAAsBnF,EAAM,WAChC,CAAC,CAAE,UAAA2B,EAAW,GAAGE,CAAM,EAAGC,IACxB9B,EAAA,cAAC,OACE,GAAG6B,EACJ,IAAKC,EACL,UAAW7B,EAAW,yBAA0B0B,CAAS,EAC3D,CAEJ,EACAwD,EAAoB,YAAc",
6
6
  "names": ["React", "classNames", "Slot", "Accordion", "sidebarPropDefs", "Theme", "useThemeContext", "IconButton", "ScrollArea", "Separator", "ChevronDownIcon", "ThickChevronRightIcon", "extractProps", "Kbd", "Badge", "SidebarContext", "useSidebar", "context", "useIsMobile", "isMobile", "setIsMobile", "checkIsMobile", "SidebarProvider", "defaultOpen", "openProp", "setOpenProp", "side", "className", "children", "props", "forwardedRef", "openMobile", "setOpenMobile", "internalOpen", "setInternalOpen", "open", "setOpen", "value", "openState", "toggleSidebar", "state", "contextValue", "Sidebar", "themeContext", "size", "variant", "menuVariant", "type", "collapsible", "panelBackground", "color", "highContrast", "asChild", "rootProps", "_", "__", "safeRootProps", "resolvedColor", "resolvedSize", "SidebarContent", "SidebarHeader", "asContainer", "SidebarFooter", "SidebarTrigger", "onClick", "event", "SidebarSeparator", "SidebarMenu", "SidebarMenuItem", "SidebarMenuButton", "isActive", "shortcut", "badge", "onMouseEnter", "onMouseLeave", "isHighlighted", "setIsHighlighted", "sidebarSize", "SidebarMenuSub", "SidebarMenuSubTrigger", "SidebarMenuSubContent", "SidebarGroup", "SidebarGroupLabel", "SidebarGroupContent"]
7
7
  }
@@ -20,8 +20,8 @@ declare const sidebarPropDefs: {
20
20
  variant: {
21
21
  type: "enum";
22
22
  className: string;
23
- values: readonly ["soft", "surface", "ghost"];
24
- default: "surface";
23
+ values: readonly ["soft", "outline", "surface", "ghost"];
24
+ default: "outline";
25
25
  };
26
26
  menuVariant: {
27
27
  type: "enum";
@@ -1,2 +1,2 @@
1
- import{asChildPropDef as e}from"../props/as-child.prop.js";import{colorPropDef as s}from"../props/color.prop.js";import{highContrastPropDef as a}from"../props/high-contrast.prop.js";import{baseMenuContentPropDefs as b,baseMenuItemPropDefs as D,baseMenuCheckboxItemPropDefs as P,baseMenuRadioItemPropDefs as y}from"./_internal/base-menu.props.js";const t=["1","2"],o=["soft","surface","ghost"],r=["solid","soft"],n=["sidebar","floating"],p=["left","right"],f=["offcanvas","icon","none"],i={...e,size:{type:"enum",className:"rt-r-size",values:t,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:o,default:"surface"},menuVariant:{type:"enum",className:"rt-menu-variant",values:r,default:"soft"},type:{type:"enum",className:"rt-type",values:n,default:"sidebar"},side:{type:"enum",className:"rt-side",values:p,default:"left"},collapsible:{type:"enum",className:"rt-collapsible",values:f,default:"offcanvas"},panelBackground:{type:"enum",values:["solid","translucent"],default:void 0},...s,...a};export{P as sidebarCheckboxItemPropDefs,b as sidebarContentPropDefs,D as sidebarItemPropDefs,i as sidebarPropDefs,y as sidebarRadioItemPropDefs};
1
+ import{asChildPropDef as e}from"../props/as-child.prop.js";import{colorPropDef as s}from"../props/color.prop.js";import{highContrastPropDef as a}from"../props/high-contrast.prop.js";import{baseMenuContentPropDefs as b,baseMenuItemPropDefs as D,baseMenuCheckboxItemPropDefs as P,baseMenuRadioItemPropDefs as y}from"./_internal/base-menu.props.js";const t=["1","2"],o=["soft","outline","surface","ghost"],r=["solid","soft"],n=["sidebar","floating"],p=["left","right"],f=["offcanvas","icon","none"],i={...e,size:{type:"enum",className:"rt-r-size",values:t,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:o,default:"outline"},menuVariant:{type:"enum",className:"rt-menu-variant",values:r,default:"soft"},type:{type:"enum",className:"rt-type",values:n,default:"sidebar"},side:{type:"enum",className:"rt-side",values:p,default:"left"},collapsible:{type:"enum",className:"rt-collapsible",values:f,default:"offcanvas"},panelBackground:{type:"enum",values:["solid","translucent"],default:void 0},...s,...a};export{P as sidebarCheckboxItemPropDefs,b as sidebarContentPropDefs,D as sidebarItemPropDefs,i as sidebarPropDefs,y as sidebarRadioItemPropDefs};
2
2
  //# sourceMappingURL=sidebar.props.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/sidebar.props.tsx"],
4
- "sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { highContrastPropDef } from '../props/high-contrast.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\n// Re-export base menu props for sidebar menu components\nexport {\n baseMenuContentPropDefs as sidebarContentPropDefs,\n baseMenuItemPropDefs as sidebarItemPropDefs,\n baseMenuCheckboxItemPropDefs as sidebarCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs as sidebarRadioItemPropDefs,\n} from './_internal/base-menu.props.js';\n\n// Sidebar container props\nconst sizes = ['1', '2'] as const;\nconst variants = ['soft', 'surface', 'ghost'] as const;\nconst menuVariants = ['solid', 'soft'] as const;\nconst types = ['sidebar', 'floating'] as const;\nconst sides = ['left', 'right'] as const;\nconst collapsibleModes = ['offcanvas', 'icon', 'none'] as const;\n\nconst sidebarPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'surface' },\n menuVariant: {\n type: 'enum',\n className: 'rt-menu-variant',\n values: menuVariants,\n default: 'soft',\n },\n type: { type: 'enum', className: 'rt-type', values: types, default: 'sidebar' },\n side: { type: 'enum', className: 'rt-side', values: sides, default: 'left' },\n collapsible: {\n type: 'enum',\n className: 'rt-collapsible',\n values: collapsibleModes,\n default: 'offcanvas',\n },\n panelBackground: { type: 'enum', values: ['solid', 'translucent'], default: undefined },\n ...colorPropDef,\n ...highContrastPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n menuVariant: PropDef<(typeof menuVariants)[number]>;\n type: PropDef<(typeof types)[number]>;\n side: PropDef<(typeof sides)[number]>;\n collapsible: PropDef<(typeof collapsibleModes)[number]>;\n panelBackground: PropDef<'solid' | 'translucent'>;\n};\n\nexport { sidebarPropDefs };\n"],
5
- "mappings": "AAAA,OAAS,kBAAAA,MAAsB,4BAC/B,OAAS,gBAAAC,MAAoB,yBAC7B,OAAS,uBAAAC,MAA2B,iCAKpC,OAC6B,2BAA3BC,EACwB,wBAAxBC,EACgC,gCAAhCC,EAC6B,6BAA7BC,MACK,iCAGP,MAAMC,EAAQ,CAAC,IAAK,GAAG,EACjBC,EAAW,CAAC,OAAQ,UAAW,OAAO,EACtCC,EAAe,CAAC,QAAS,MAAM,EAC/BC,EAAQ,CAAC,UAAW,UAAU,EAC9BC,EAAQ,CAAC,OAAQ,OAAO,EACxBC,EAAmB,CAAC,YAAa,OAAQ,MAAM,EAE/CC,EAAkB,CACtB,GAAGb,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQO,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,YAAa,CACX,KAAM,OACN,UAAW,kBACX,OAAQC,EACR,QAAS,MACX,EACA,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,SAAU,EAC9E,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,MAAO,EAC3E,YAAa,CACX,KAAM,OACN,UAAW,iBACX,OAAQC,EACR,QAAS,WACX,EACA,gBAAiB,CAAE,KAAM,OAAQ,OAAQ,CAAC,QAAS,aAAa,EAAG,QAAS,MAAU,EACtF,GAAGX,EACH,GAAGC,CACL",
4
+ "sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { highContrastPropDef } from '../props/high-contrast.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\n// Re-export base menu props for sidebar menu components\nexport {\n baseMenuContentPropDefs as sidebarContentPropDefs,\n baseMenuItemPropDefs as sidebarItemPropDefs,\n baseMenuCheckboxItemPropDefs as sidebarCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs as sidebarRadioItemPropDefs,\n} from './_internal/base-menu.props.js';\n\n// Sidebar container props\nconst sizes = ['1', '2'] as const;\nconst variants = ['soft', 'outline', 'surface', 'ghost'] as const;\nconst menuVariants = ['solid', 'soft'] as const;\nconst types = ['sidebar', 'floating'] as const;\nconst sides = ['left', 'right'] as const;\nconst collapsibleModes = ['offcanvas', 'icon', 'none'] as const;\n\nconst sidebarPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n menuVariant: {\n type: 'enum',\n className: 'rt-menu-variant',\n values: menuVariants,\n default: 'soft',\n },\n type: { type: 'enum', className: 'rt-type', values: types, default: 'sidebar' },\n side: { type: 'enum', className: 'rt-side', values: sides, default: 'left' },\n collapsible: {\n type: 'enum',\n className: 'rt-collapsible',\n values: collapsibleModes,\n default: 'offcanvas',\n },\n panelBackground: { type: 'enum', values: ['solid', 'translucent'], default: undefined },\n ...colorPropDef,\n ...highContrastPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n menuVariant: PropDef<(typeof menuVariants)[number]>;\n type: PropDef<(typeof types)[number]>;\n side: PropDef<(typeof sides)[number]>;\n collapsible: PropDef<(typeof collapsibleModes)[number]>;\n panelBackground: PropDef<'solid' | 'translucent'>;\n};\n\nexport { sidebarPropDefs };\n"],
5
+ "mappings": "AAAA,OAAS,kBAAAA,MAAsB,4BAC/B,OAAS,gBAAAC,MAAoB,yBAC7B,OAAS,uBAAAC,MAA2B,iCAKpC,OAC6B,2BAA3BC,EACwB,wBAAxBC,EACgC,gCAAhCC,EAC6B,6BAA7BC,MACK,iCAGP,MAAMC,EAAQ,CAAC,IAAK,GAAG,EACjBC,EAAW,CAAC,OAAQ,UAAW,UAAW,OAAO,EACjDC,EAAe,CAAC,QAAS,MAAM,EAC/BC,EAAQ,CAAC,UAAW,UAAU,EAC9BC,EAAQ,CAAC,OAAQ,OAAO,EACxBC,EAAmB,CAAC,YAAa,OAAQ,MAAM,EAE/CC,EAAkB,CACtB,GAAGb,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQO,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,YAAa,CACX,KAAM,OACN,UAAW,kBACX,OAAQC,EACR,QAAS,MACX,EACA,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,SAAU,EAC9E,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,MAAO,EAC3E,YAAa,CACX,KAAM,OACN,UAAW,iBACX,OAAQC,EACR,QAAS,WACX,EACA,gBAAiB,CAAE,KAAM,OAAQ,OAAQ,CAAC,QAAS,aAAa,EAAG,QAAS,MAAU,EACtF,GAAGX,EACH,GAAGC,CACL",
6
6
  "names": ["asChildPropDef", "colorPropDef", "highContrastPropDef", "baseMenuContentPropDefs", "baseMenuItemPropDefs", "baseMenuCheckboxItemPropDefs", "baseMenuRadioItemPropDefs", "sizes", "variants", "menuVariants", "types", "sides", "collapsibleModes", "sidebarPropDefs"]
7
7
  }
@@ -1,12 +1,12 @@
1
1
  import type { MarginProps } from '../props/margin.props.js';
2
2
  export declare function extractMarginProps<T extends MarginProps>(props: T): {
3
- m: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
4
- mx: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
5
- my: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
6
- mt: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
7
- mr: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
8
- mb: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
9
- ml: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
3
+ m: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
4
+ mx: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
5
+ my: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
6
+ mt: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
7
+ mr: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
8
+ mb: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
9
+ ml: import("../props/prop-def.js").Responsive<import("../props/prop-def.js").Union<string, "1" | "2" | "3" | "4" | "0" | "5" | "6" | "7" | "8" | "9" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "-9">> | undefined;
10
10
  rest: Omit<T, "m" | "ml" | "mr" | "mt" | "mb" | "mx" | "my">;
11
11
  };
12
12
  //# sourceMappingURL=extract-margin-props.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kushagradhawan/kookie-ui",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "A modern React component library with beautiful design tokens, flexible theming, and comprehensive docs",
5
5
  "keywords": [
6
6
  "react",
@@ -0,0 +1,223 @@
1
+ /* Base Sidebar Menu Styles */
2
+
3
+ /* Sidebar Menu - based on rt-BaseMenuViewport */
4
+ .rt-SidebarMenu {
5
+ flex: 1;
6
+ display: flex;
7
+ flex-direction: column;
8
+ padding: var(--base-menu-content-padding);
9
+ box-sizing: border-box;
10
+ list-style: none;
11
+ margin: 0;
12
+ min-height: 0;
13
+
14
+ :where(.rt-SidebarContent:has(.rt-ScrollAreaScrollbar[data-orientation='vertical'])) & {
15
+ padding-right: var(--space-3);
16
+ }
17
+ }
18
+
19
+ /* Sidebar Menu Item */
20
+ .rt-SidebarMenuItem {
21
+ list-style: none;
22
+ }
23
+
24
+ /* Sidebar Menu Button - inherit from BaseMenuItem */
25
+ .rt-SidebarMenuButton {
26
+ display: flex;
27
+ align-items: center;
28
+ gap: var(--space-2); /* Will be overridden by size-specific gap */
29
+ min-height: var(--base-menu-item-height);
30
+ padding-top: var(--base-menu-item-padding-y);
31
+ padding-bottom: var(--base-menu-item-padding-y);
32
+ padding-left: var(--base-menu-item-padding-left);
33
+ padding-right: var(--base-menu-item-padding-right);
34
+ box-sizing: border-box;
35
+ position: relative;
36
+ outline: none;
37
+ scroll-margin: var(--base-menu-content-padding) 0;
38
+ background: none;
39
+ border: none;
40
+ width: 100%;
41
+ text-align: left;
42
+ /* No default border radius - inherited from size-specific rules */
43
+
44
+ /* Transitions - inherit from base menu */
45
+ transition: var(--transition-menu);
46
+
47
+ /* Fix sticky text highlighting after selection in Firefox */
48
+ user-select: none;
49
+
50
+ /* Cursors */
51
+ cursor: var(--cursor-menu-item);
52
+ &:where([data-disabled]) {
53
+ cursor: default;
54
+ color: var(--gray-a8);
55
+ }
56
+
57
+ /* Active navigation state - always accent-based */
58
+ &:where([data-active], .rt-active) {
59
+ background-color: var(--accent-a3);
60
+ color: var(--accent-a12);
61
+ }
62
+
63
+ /* Focus state */
64
+ &:where(:focus-visible) {
65
+ outline: 2px solid var(--focus-8);
66
+ outline-offset: 2px;
67
+ }
68
+
69
+ /* Accent color support */
70
+ &:where([data-accent-color]) {
71
+ color: var(--accent-a11);
72
+ }
73
+
74
+ /* Gray text support - inherit from base menu */
75
+ & :where(.rt-Text[data-accent-color='gray'], [data-accent-color='gray']:not(.rt-Badge)) {
76
+ color: var(--gray-a10);
77
+ }
78
+
79
+ /* Ensure shortcuts inherit color in disabled/highlighted/active states */
80
+ &:where([data-disabled], [data-highlighted], [data-active]) {
81
+ & :where(.rt-SidebarMenuShortcut) {
82
+ color: inherit;
83
+ }
84
+ }
85
+
86
+ /* Reduced motion support */
87
+ @media (prefers-reduced-motion: reduce) {
88
+ transition: none;
89
+ }
90
+ }
91
+
92
+ /* Sidebar Menu Sub Components - Radix Accordion */
93
+ .rt-SidebarMenuSubTrigger {
94
+ justify-content: space-between;
95
+ }
96
+
97
+ /* Accordion trigger icon rotation */
98
+ .rt-SidebarMenuSubTrigger {
99
+ & :where(.rt-SidebarMenuSubTriggerIcon) {
100
+ transition: transform 0.2s ease;
101
+ }
102
+
103
+ &:where([data-state="open"]) :where(.rt-SidebarMenuSubTriggerIcon) {
104
+ transform: rotate(90deg);
105
+ }
106
+ }
107
+
108
+ .rt-SidebarMenuSubContent {
109
+ overflow: hidden;
110
+
111
+ /* Allow focus outlines to show */
112
+ &:where(:focus-within) {
113
+ overflow: visible;
114
+ }
115
+
116
+ /* Radix Accordion animation support */
117
+ &:where([data-state="open"]) {
118
+ animation: rt-sidebar-slide-down 200ms ease-out;
119
+ }
120
+
121
+ &:where([data-state="closed"]) {
122
+ animation: rt-sidebar-slide-up 200ms ease-out;
123
+ }
124
+ }
125
+
126
+ @keyframes rt-sidebar-slide-down {
127
+ from {
128
+ height: 0;
129
+ }
130
+ to {
131
+ height: var(--radix-accordion-content-height);
132
+ }
133
+ }
134
+
135
+ @keyframes rt-sidebar-slide-up {
136
+ from {
137
+ height: var(--radix-accordion-content-height);
138
+ }
139
+ to {
140
+ height: 0;
141
+ }
142
+ }
143
+
144
+ .rt-SidebarMenuSubList {
145
+ padding-left: var(--space-4);
146
+ border-left: 1px solid var(--gray-a5);
147
+ margin-left: var(--space-3);
148
+ }
149
+
150
+ /* Sub-menu items have consistent heights based on size - match dropdown menu exactly */
151
+ :where(.rt-SidebarContent.rt-r-size-1) :where(.rt-SidebarMenuSubList) .rt-SidebarMenuButton {
152
+ padding-left: var(--space-3);
153
+ padding-top: calc(var(--space-1) * 0.75);
154
+ padding-bottom: calc(var(--space-1) * 0.75);
155
+ min-height: var(--space-5); /* 20px */
156
+ font-size: var(--font-size-1);
157
+ }
158
+
159
+ :where(.rt-SidebarContent.rt-r-size-2) :where(.rt-SidebarMenuSubList) .rt-SidebarMenuButton {
160
+ padding-left: var(--space-3);
161
+ padding-top: var(--space-1);
162
+ padding-bottom: var(--space-1);
163
+ min-height: var(--space-6); /* 24px */
164
+ font-size: var(--font-size-2);
165
+ }
166
+
167
+ /* Sidebar Group Components - identical to base menu */
168
+ .rt-SidebarGroup {
169
+ /* No styling - purely semantic like BaseMenuGroup */
170
+ }
171
+
172
+ .rt-SidebarGroupLabel {
173
+ /* Inherit all BaseMenuLabel styles */
174
+ display: flex;
175
+ align-items: center;
176
+ min-height: var(--base-menu-item-height);
177
+ padding-top: var(--base-menu-item-padding-y);
178
+ padding-bottom: var(--base-menu-item-padding-y);
179
+ padding-left: var(--base-menu-item-padding-left);
180
+ padding-right: var(--base-menu-item-padding-right);
181
+ box-sizing: border-box;
182
+ color: var(--gray-a10);
183
+ user-select: none;
184
+ cursor: default;
185
+
186
+ /* Add margin-top when following menu items - identical to BaseMenuLabel */
187
+ :where(.rt-SidebarMenuItem) + & {
188
+ margin-top: var(--space-2);
189
+ }
190
+ }
191
+
192
+ /* Reduce right padding on menu buttons with trailing elements */
193
+ .rt-SidebarMenuButton:where(:has(.rt-SidebarMenuShortcut, .rt-SidebarMenuBadge)) {
194
+ /* Use base menu padding tokens */
195
+ :where(.rt-SidebarContent.rt-r-size-1) & {
196
+ padding-right: var(--base-menu-item-padding-y); /* Matches top/bottom padding */
197
+ }
198
+
199
+ :where(.rt-SidebarContent.rt-r-size-2) & {
200
+ padding-right: var(--base-menu-item-padding-y); /* Matches top/bottom padding */
201
+ }
202
+ }
203
+
204
+ .rt-SidebarMenuShortcut {
205
+ display: flex;
206
+ align-items: center;
207
+ margin-left: auto;
208
+ padding-left: var(--space-4);
209
+ color: var(--gray-a11);
210
+ }
211
+
212
+ .rt-SidebarMenuBadge {
213
+ display: flex;
214
+ align-items: center;
215
+ margin-left: auto;
216
+ padding-left: var(--space-2);
217
+ }
218
+
219
+ /* Add balanced spacing for sidebar menu items while preserving base menu border radius */
220
+ .rt-SidebarContent :where(.rt-BaseMenuItem) {
221
+ margin-top: calc(var(--space-1) / 2);
222
+ margin-bottom: calc(var(--space-1) / 2);
223
+ }
@@ -0,0 +1,141 @@
1
+ /* Base Sidebar Layout and Container Styles */
2
+
3
+ /* Sidebar Provider - handles positioning */
4
+ .rt-SidebarProvider {
5
+ /* Positioning based on side */
6
+ &:where([data-side="left"]) {
7
+ /* Left side is default - no additional positioning needed */
8
+ order: -1; /* Ensure it appears first in flex container */
9
+ }
10
+
11
+ &:where([data-side="right"]) {
12
+ /* Position on the right side */
13
+ order: 999; /* Push to end in flex container */
14
+ }
15
+ }
16
+
17
+ /* Sidebar Root Container */
18
+ .rt-SidebarRoot {
19
+ --sidebar-width: 16rem; /* Fixed width */
20
+ --sidebar-base-border-radius: 0; /* Default to no radius */
21
+
22
+ width: var(--sidebar-width);
23
+ height: 100%;
24
+ flex-shrink: 0;
25
+ display: flex;
26
+ flex-direction: column;
27
+
28
+ /* Make sure Theme wrapper also participates in flex layout */
29
+ & :where(.radix-themes) {
30
+ display: flex;
31
+ flex-direction: column;
32
+ flex: 1;
33
+ height: 100%;
34
+ }
35
+
36
+ /* Floating type - ONLY visual changes */
37
+ &:where([data-type="floating"]) {
38
+ border-radius: var(--sidebar-base-border-radius);
39
+ margin: var(--space-2);
40
+ height: calc(100% - var(--space-4));
41
+ overflow: visible; /* Ensure shadow is not clipped */
42
+ position: relative; /* Ensure proper stacking context for floating sidebars */
43
+
44
+ /* Ensure Theme wrapper has proper border radius in floating mode */
45
+ & :where(.radix-themes) {
46
+ border-radius: inherit;
47
+ }
48
+ }
49
+ }
50
+
51
+ /* Set border radius for floating sidebars based on size - set on the root where it's used */
52
+ .rt-SidebarRoot:where([data-type="floating"]) {
53
+ /* Default radius for floating sidebars */
54
+ --sidebar-base-border-radius: var(--radius-5);
55
+
56
+ &:where(.rt-r-size-1) {
57
+ --sidebar-base-border-radius: var(--radius-5);
58
+ }
59
+
60
+ &:where(.rt-r-size-2) {
61
+ --sidebar-base-border-radius: var(--radius-6);
62
+ }
63
+ }
64
+
65
+ /* Sidebar Container */
66
+ .rt-SidebarContainer {
67
+ --sidebar-base-border-radius: 0; /* Default to no radius */
68
+ display: flex;
69
+ flex-direction: column;
70
+ height: 100%;
71
+ width: 100%;
72
+ background-color: var(--color-panel);
73
+ backdrop-filter: var(--backdrop-filter-panel);
74
+ border-radius: inherit;
75
+ flex: 1;
76
+ }
77
+
78
+ /* Sidebar Header */
79
+ .rt-SidebarHeader {
80
+ display: flex;
81
+ flex-direction: column;
82
+ flex-shrink: 0;
83
+ border-radius: var(--sidebar-base-border-radius) var(--sidebar-base-border-radius) 0 0;
84
+ }
85
+
86
+ /* Sidebar Content - based on rt-BaseMenuContent */
87
+ .rt-SidebarContent {
88
+ --scrollarea-scrollbar-vertical-margin-top: var(--base-menu-content-padding);
89
+ --scrollarea-scrollbar-vertical-margin-bottom: var(--base-menu-content-padding);
90
+ --scrollarea-scrollbar-horizontal-margin-left: var(--base-menu-content-padding);
91
+ --scrollarea-scrollbar-horizontal-margin-right: var(--base-menu-content-padding);
92
+
93
+ display: flex;
94
+ flex-direction: column;
95
+ flex: 1;
96
+ box-sizing: border-box;
97
+ min-height: 0; /* Critical for flex children to shrink */
98
+
99
+ /* Override base menu styling that's not appropriate for sidebars */
100
+ background-color: transparent !important;
101
+ backdrop-filter: none !important;
102
+ box-shadow: none !important;
103
+ border-radius: 0 !important;
104
+
105
+ /* Ensure ScrollArea takes full height within SidebarContent */
106
+ & :where(.rt-ScrollAreaRoot) {
107
+ flex: 1;
108
+ display: flex;
109
+ flex-direction: column;
110
+ min-height: 0;
111
+ }
112
+
113
+ & :where(.rt-ScrollAreaViewport) {
114
+ flex: 1;
115
+ display: flex;
116
+ flex-direction: column;
117
+ min-height: 0;
118
+ }
119
+ }
120
+
121
+ /* Sidebar Footer */
122
+ .rt-SidebarFooter {
123
+ display: flex;
124
+ flex-direction: column;
125
+ flex-shrink: 0;
126
+ margin-top: auto;
127
+ border-radius: 0 0 var(--sidebar-base-border-radius) var(--sidebar-base-border-radius);
128
+ }
129
+
130
+ /* Sidebar Separator - ensure full width and proper spacing */
131
+ .rt-SidebarSeparator {
132
+ width: 100%;
133
+ margin: var(--space-2) 0;
134
+ }
135
+
136
+ /* Responsive behavior */
137
+ @media (max-width: 768px) {
138
+ .rt-SidebarRoot {
139
+ display: none;
140
+ }
141
+ }