# All files / js/components/ui/sidebar index.ts

0% Statements 0/1
100% Branches 0/0
100% Functions 0/0
0% Lines 0/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61

     import type { VariantProps } from 'class-variance-authority'
    import type { HTMLAttributes } from 'vue'
    import { cva } from 'class-variance-authority'

    export interface SidebarProps {
      side?: 'left' | 'right'
      variant?: 'sidebar' | 'floating' | 'inset'
      collapsible?: 'offcanvas' | 'icon' | 'none'
      class?: HTMLAttributes['class']
    }

    export { default as Sidebar } from './Sidebar.vue'
    export { default as SidebarContent } from './SidebarContent.vue'
    export { default as SidebarFooter } from './SidebarFooter.vue'
    export { default as SidebarGroup } from './SidebarGroup.vue'
    export { default as SidebarGroupAction } from './SidebarGroupAction.vue'
    export { default as SidebarGroupContent } from './SidebarGroupContent.vue'
    export { default as SidebarGroupLabel } from './SidebarGroupLabel.vue'
    export { default as SidebarHeader } from './SidebarHeader.vue'
    export { default as SidebarInput } from './SidebarInput.vue'
    export { default as SidebarInset } from './SidebarInset.vue'
    export { default as SidebarMenu } from './SidebarMenu.vue'
    export { default as SidebarMenuAction } from './SidebarMenuAction.vue'
    export { default as SidebarMenuBadge } from './SidebarMenuBadge.vue'
    export { default as SidebarMenuButton } from './SidebarMenuButton.vue'
    export { default as SidebarMenuItem } from './SidebarMenuItem.vue'
    export { default as SidebarMenuSkeleton } from './SidebarMenuSkeleton.vue'
    export { default as SidebarMenuSub } from './SidebarMenuSub.vue'
    export { default as SidebarMenuSubButton } from './SidebarMenuSubButton.vue'
    export { default as SidebarMenuSubItem } from './SidebarMenuSubItem.vue'
    export { default as SidebarProvider } from './SidebarProvider.vue'
    export { default as SidebarRail } from './SidebarRail.vue'
    export { default as SidebarSeparator } from './SidebarSeparator.vue'
    export { default as SidebarTrigger } from './SidebarTrigger.vue'

    export { useSidebar } from './utils'

    export const sidebarMenuButtonVariants = cva(
      'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:pr-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
      {
        variants: {
          variant: {
            default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
            outline:
              'bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]',
          },
          size: {
            default: 'h-8 text-sm',
            sm: 'h-7 text-xs',
            lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!',
          },
        },
        defaultVariants: {
          variant: 'default',
          size: 'default',
        },
      },
    )

    export type SidebarMenuButtonVariants = VariantProps<typeof sidebarMenuButtonVariants>