@uselets/ui 1.1.0 → 1.2.0
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/README.md +13 -4
- package/dist/components/combobox.d.ts +4 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/dialog.d.ts +6 -12
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.d.ts +5 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/skeleton.spec.d.ts +1 -0
- package/dist/components/skeleton.spec.js +2 -0
- package/dist/components/skeleton.spec.js.map +1 -0
- package/dist/components/tooltip.d.ts +20 -4
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unstyled-button.d.ts +17 -0
- package/dist/components/unstyled-button.js +2 -0
- package/dist/components/unstyled-button.js.map +1 -0
- package/dist/hooks/use-breakpoint-value.spec.js +1 -1
- package/dist/hooks/use-breakpoint.spec.js +1 -1
- package/dist/hooks/use-disclosure.spec.js +1 -1
- package/dist/hooks/use-document-visibility.spec.js +1 -1
- package/dist/hooks/use-idle.spec.js +1 -1
- package/dist/hooks/use-interval.spec.js +1 -1
- package/dist/hooks/use-local-storage.spec.js +1 -1
- package/dist/hooks/use-mobile.spec.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/{react.esm-BuxkFT_p.js → react.esm-B3a5z6DL.js} +2 -2
- package/dist/{react.esm-BuxkFT_p.js.map → react.esm-B3a5z6DL.js.map} +1 -1
- package/dist/skills/uselets-ui/SKILL.md +3 -2
- package/dist/skills/uselets-ui/references/component-catalog.md +8 -2
- package/dist/skills/uselets-ui/references/package-guide.md +15 -2
- package/dist/styles/base.css +1 -1
- package/package.json +1 -1
- package/skills/uselets-ui/SKILL.md +3 -2
- package/skills/uselets-ui/references/component-catalog.md +8 -2
- package/skills/uselets-ui/references/package-guide.md +15 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.js","names":["Separator","Tooltip"],"sources":["../../src/components/sidebar.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconLayoutSidebar } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { useIsMobile } from '../hooks/use-mobile'\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport { Drawer, DrawerContent, DrawerDescription, DrawerHeader, DrawerTitle } from './drawer'\nimport { Input } from './input'\nimport { Separator } from './separator'\nimport { Skeleton } from './skeleton'\nimport { Tooltip, TooltipContent, TooltipTrigger } from './tooltip'\n\nconst SIDEBAR_COOKIE_NAME = 'sidebar_state'\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7\nconst SIDEBAR_WIDTH = '16rem'\nconst SIDEBAR_WIDTH_MOBILE = '18rem'\nconst SIDEBAR_WIDTH_ICON = '3rem'\nconst SIDEBAR_KEYBOARD_SHORTCUT = 'b'\n\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}\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null)\n\nexport type SidebarProviderProps = React.ComponentProps<'div'> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\nexport type SidebarProps = React.ComponentProps<'div'> & {\n side?: 'left' | 'right'\n variant?: 'sidebar' | 'floating' | 'inset'\n collapsible?: 'offcanvas' | 'icon' | 'none'\n}\n\nexport type SidebarTriggerProps = React.ComponentProps<typeof Button>\n\nexport type SidebarRailProps = React.ComponentProps<'button'>\n\nexport type SidebarInsetProps = React.ComponentProps<'main'>\n\nexport type SidebarInputProps = React.ComponentProps<typeof Input>\n\nexport type SidebarHeaderProps = React.ComponentProps<'div'>\n\nexport type SidebarFooterProps = React.ComponentProps<'div'>\n\nexport type SidebarSeparatorProps = React.ComponentProps<typeof Separator>\n\nexport type SidebarContentProps = React.ComponentProps<'div'>\n\nexport type SidebarGroupProps = React.ComponentProps<'div'>\n\nexport type SidebarGroupLabelProps = React.ComponentProps<'div'> & {\n asChild?: boolean\n}\n\nexport type SidebarGroupActionProps = React.ComponentProps<'button'> & {\n asChild?: boolean\n}\n\nexport type SidebarGroupContentProps = React.ComponentProps<'div'>\n\nexport type SidebarMenuProps = React.ComponentProps<'ul'>\n\nexport type SidebarMenuItemProps = React.ComponentProps<'li'>\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\n return context\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: SidebarProviderProps) {\n const isMobile = useIsMobile()\n const [openMobile, setOpenMobile] = React.useState(false)\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\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 _setOpen(openState)\n }\n\n // This sets the cookie to keep the sidebar state.\n // biome-ignore lint/suspicious/noDocumentCookie: This package persists a simple UI preference cookie without framework-specific APIs.\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\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])\n\n // Adds a keyboard shortcut to toggle the sidebar.\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n toggleSidebar()\n }\n }\n\n window.addEventListener('keydown', handleKeyDown)\n return () => window.removeEventListener('keydown', handleKeyDown)\n }, [toggleSidebar])\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? 'expanded' : 'collapsed'\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar\n }),\n [state, open, setOpen, isMobile, openMobile, toggleSidebar]\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n data-slot=\"sidebar-wrapper\"\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH,\n '--sidebar-width-icon': SIDEBAR_WIDTH_ICON,\n ...style\n } as React.CSSProperties\n }\n className={cn(\n 'group/sidebar-wrapper relative flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar',\n className\n )}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n )\n}\n\nfunction Sidebar({\n side = 'left',\n variant = 'sidebar',\n collapsible = 'offcanvas',\n className,\n children,\n dir,\n ...props\n}: SidebarProps) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n if (collapsible === 'none') {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn('flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground', className)}\n {...props}\n >\n {children}\n </div>\n )\n }\n\n if (isMobile) {\n return (\n <Drawer open={openMobile} onOpenChange={setOpenMobile} direction={side} size=\"sm\">\n <DrawerContent\n dir={dir}\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"h-full w-(--sidebar-width) rounded-none bg-sidebar p-0 text-sidebar-foreground\"\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH_MOBILE\n } as React.CSSProperties\n }\n {...props}\n >\n <DrawerHeader className=\"sr-only\">\n <DrawerTitle>Sidebar</DrawerTitle>\n <DrawerDescription>Displays the mobile sidebar.</DrawerDescription>\n </DrawerHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </DrawerContent>\n </Drawer>\n )\n }\n\n return (\n <div\n className=\"group peer hidden text-sidebar-foreground md:block\"\n data-state={state}\n data-collapsible={state === 'collapsed' ? collapsible : ''}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n 'relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n variant === 'floating' || variant === 'inset'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)'\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n data-side={side}\n className={cn(\n 'fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex',\n 'data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:-left-(--sidebar-width)',\n 'data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:-right-(--sidebar-width)',\n // Adjust the padding for floating and inset variants.\n variant === 'floating' || variant === 'inset'\n ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)',\n variant !== 'floating' &&\n variant !== 'inset' &&\n 'group-data-[side=left]:border-r group-data-[side=right]:border-l',\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className={cn(\n 'flex size-full flex-col bg-sidebar',\n 'group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm',\n 'group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border'\n )}\n >\n {children}\n </div>\n </div>\n </div>\n )\n}\n\nfunction SidebarTrigger({ className, onClick, ...props }: SidebarTriggerProps) {\n const { toggleSidebar } = useSidebar()\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n size=\"icon-sm\"\n color=\"zinc\"\n className={cn(className)}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n <IconLayoutSidebar />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n )\n}\n\nfunction SidebarRail({ className, ...props }: SidebarRailProps) {\n const { toggleSidebar } = useSidebar()\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n 'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',\n 'absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:s-1/2 after:w-0.5 hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2',\n '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',\n 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar',\n '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',\n '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarInset({ className, ...props }: SidebarInsetProps) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n 'relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarInput({ className, ...props }: SidebarInputProps) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn('h-8 w-full bg-background shadow-none', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarHeader({ className, ...props }: SidebarHeaderProps) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn('flex flex-col gap-2 p-2', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarFooter({ className, ...props }: SidebarFooterProps) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn('flex flex-col gap-2 p-2', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarSeparator({ className, ...props }: SidebarSeparatorProps) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn('w-auto bg-sidebar-border', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarContent({ className, ...props }: SidebarContentProps) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n 'no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarGroup({ className, ...props }: SidebarGroupProps) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn('relative flex w-full min-w-0 flex-col px-2', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarGroupLabel({ className, asChild = false, ...props }: SidebarGroupLabelProps) {\n const Comp = asChild ? Slot.Root : 'div'\n\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n data-sidebar=\"group-label\"\n className={cn(\n 'flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarGroupAction({ className, asChild = false, ...props }: SidebarGroupActionProps) {\n const Comp = asChild ? Slot.Root : 'button'\n\n return (\n <Comp\n data-slot=\"sidebar-group-action\"\n data-sidebar=\"group-action\"\n className={cn(\n 'absolute top-1.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarGroupContent({ className, ...props }: SidebarGroupContentProps) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn('w-full text-sm mt-2', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenu({ className, ...props }: SidebarMenuProps) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn('flex w-full min-w-0 flex-col gap-0', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuItem({ className, ...props }: SidebarMenuItemProps) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn('group/menu-item relative', className)}\n {...props}\n />\n )\n}\n\nconst sidebarMenuButtonVariants = cva(\n 'peer/menu-button group/menu-button font-medium flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:[&_svg]:text-sidebar-primary data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate',\n {\n variants: {\n variant: {\n default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',\n outline:\n '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))]'\n },\n size: {\n md: 'h-8 text-sm',\n sm: 'h-7 text-xs',\n lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!'\n }\n },\n defaultVariants: {\n variant: 'default',\n size: 'md'\n }\n }\n)\n\nexport type SidebarMenuButtonProps = React.ComponentProps<'button'> & {\n asChild?: boolean\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n} & VariantProps<typeof sidebarMenuButtonVariants>\n\nexport type SidebarMenuActionProps = React.ComponentProps<'button'> & {\n asChild?: boolean\n showOnHover?: boolean\n}\n\nexport type SidebarMenuBadgeProps = React.ComponentProps<'div'>\n\nexport type SidebarMenuSkeletonProps = React.ComponentProps<'div'> & {\n showIcon?: boolean\n}\n\nexport type SidebarMenuSubProps = React.ComponentProps<'ul'>\n\nexport type SidebarMenuSubItemProps = React.ComponentProps<'li'>\n\nexport type SidebarMenuSubButtonProps = React.ComponentProps<'a'> & {\n asChild?: boolean\n size?: 'sm' | 'md'\n isActive?: boolean\n}\n\nfunction SidebarMenuButton({\n asChild = false,\n isActive = false,\n variant = 'default',\n size = 'md',\n tooltip,\n className,\n ...props\n}: SidebarMenuButtonProps) {\n const Comp = asChild ? Slot.Root : 'button'\n const { isMobile, state } = useSidebar()\n\n const button = (\n <Comp\n data-slot=\"sidebar-menu-button\"\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n )\n\n if (!tooltip) {\n return button\n }\n\n if (typeof tooltip === 'string') {\n tooltip = {\n children: tooltip\n }\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent side=\"right\" align=\"center\" hidden={state !== 'collapsed' || isMobile} {...tooltip} />\n </Tooltip>\n )\n}\n\nfunction SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }: SidebarMenuActionProps) {\n const Comp = asChild ? Slot.Root : 'button'\n\n return (\n <Comp\n data-slot=\"sidebar-menu-action\"\n data-sidebar=\"menu-action\"\n className={cn(\n 'absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=md]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0',\n showOnHover &&\n 'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuBadge({ className, ...props }: SidebarMenuBadgeProps) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n 'pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=md]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSkeleton({ className, showIcon = false, ...props }: SidebarMenuSkeletonProps) {\n // Random width between 50 to 90%.\n const [width] = React.useState(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`\n })\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)}\n {...props}\n >\n {showIcon && <Skeleton className=\"size-4 rounded-md\" data-sidebar=\"menu-skeleton-icon\" />}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n '--skeleton-width': width\n } as React.CSSProperties\n }\n />\n </div>\n )\n}\n\nfunction SidebarMenuSub({ className, ...props }: SidebarMenuSubProps) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n 'mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSubItem({ className, ...props }: SidebarMenuSubItemProps) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn('group/menu-sub-item relative', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSubButton({\n asChild = false,\n size = 'md',\n isActive = false,\n className,\n ...props\n}: SidebarMenuSubButtonProps) {\n const Comp = asChild ? Slot.Root : 'a'\n\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n 'flex h-7 min-w-0 -translate-x-px items-center font-medium gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar\n}\n"],"mappings":"qqBAeA,MAiBM,EAAiB,EAAM,cAA0C,KAAK,CA8C5E,SAAS,YAAa,CACpB,IAAM,EAAU,EAAM,WAAW,EAAe,CAChD,GAAI,CAAC,EACH,MAAU,MAAM,oDAAoD,CAGtE,OAAO,EAGT,SAAS,gBAAgB,CACvB,cAAc,GACd,KAAM,EACN,aAAc,EACd,YACA,QACA,WACA,GAAG,GACoB,CACvB,IAAM,EAAW,GAAa,CACxB,CAAC,EAAY,GAAiB,EAAM,SAAS,GAAM,CAInD,CAAC,EAAO,GAAY,EAAM,SAAS,EAAY,CAC/C,EAAO,GAAY,EACnB,EAAU,EAAM,YACnB,GAAmD,CAClD,IAAM,EAAY,OAAO,GAAU,WAAa,EAAM,EAAK,CAAG,EAC1D,EACF,EAAY,EAAU,CAEtB,EAAS,EAAU,CAKrB,SAAS,OAAS,iBAA0B,EAAU,2BAExD,CAAC,EAAa,EAAK,CACpB,CA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CACD,GAAI,EACJ,CAAA"}
|
|
1
|
+
{"version":3,"file":"sidebar.js","names":["Separator","Tooltip"],"sources":["../../src/components/sidebar.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconLayoutSidebar } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { useIsMobile } from '../hooks/use-mobile'\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport { Drawer, DrawerContent, DrawerDescription, DrawerHeader, DrawerTitle } from './drawer'\nimport { Input } from './input'\nimport { Separator } from './separator'\nimport { Skeleton } from './skeleton'\nimport { Tooltip, type TooltipContent } from './tooltip'\n\nconst SIDEBAR_COOKIE_NAME = 'sidebar_state'\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7\nconst SIDEBAR_WIDTH = '16rem'\nconst SIDEBAR_WIDTH_MOBILE = '18rem'\nconst SIDEBAR_WIDTH_ICON = '3rem'\nconst SIDEBAR_KEYBOARD_SHORTCUT = 'b'\n\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}\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null)\n\nexport type SidebarProviderProps = React.ComponentProps<'div'> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\nexport type SidebarProps = React.ComponentProps<'div'> & {\n side?: 'left' | 'right'\n variant?: 'sidebar' | 'floating' | 'inset'\n collapsible?: 'offcanvas' | 'icon' | 'none'\n}\n\nexport type SidebarTriggerProps = React.ComponentProps<typeof Button>\n\nexport type SidebarRailProps = React.ComponentProps<'button'>\n\nexport type SidebarInsetProps = React.ComponentProps<'main'>\n\nexport type SidebarInputProps = React.ComponentProps<typeof Input>\n\nexport type SidebarHeaderProps = React.ComponentProps<'div'>\n\nexport type SidebarFooterProps = React.ComponentProps<'div'>\n\nexport type SidebarSeparatorProps = React.ComponentProps<typeof Separator>\n\nexport type SidebarContentProps = React.ComponentProps<'div'>\n\nexport type SidebarGroupProps = React.ComponentProps<'div'>\n\nexport type SidebarGroupLabelProps = React.ComponentProps<'div'> & {\n asChild?: boolean\n}\n\nexport type SidebarGroupActionProps = React.ComponentProps<'button'> & {\n asChild?: boolean\n}\n\nexport type SidebarGroupContentProps = React.ComponentProps<'div'>\n\nexport type SidebarMenuProps = React.ComponentProps<'ul'>\n\nexport type SidebarMenuItemProps = React.ComponentProps<'li'>\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\n return context\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: SidebarProviderProps) {\n const isMobile = useIsMobile()\n const [openMobile, setOpenMobile] = React.useState(false)\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\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 _setOpen(openState)\n }\n\n // This sets the cookie to keep the sidebar state.\n // biome-ignore lint/suspicious/noDocumentCookie: This package persists a simple UI preference cookie without framework-specific APIs.\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\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])\n\n // Adds a keyboard shortcut to toggle the sidebar.\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n toggleSidebar()\n }\n }\n\n window.addEventListener('keydown', handleKeyDown)\n return () => window.removeEventListener('keydown', handleKeyDown)\n }, [toggleSidebar])\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? 'expanded' : 'collapsed'\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar\n }),\n [state, open, setOpen, isMobile, openMobile, toggleSidebar]\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n data-slot=\"sidebar-wrapper\"\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH,\n '--sidebar-width-icon': SIDEBAR_WIDTH_ICON,\n ...style\n } as React.CSSProperties\n }\n className={cn(\n 'group/sidebar-wrapper relative flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar',\n className\n )}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n )\n}\n\nfunction Sidebar({\n side = 'left',\n variant = 'sidebar',\n collapsible = 'offcanvas',\n className,\n children,\n dir,\n ...props\n}: SidebarProps) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n if (collapsible === 'none') {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn('flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground', className)}\n {...props}\n >\n {children}\n </div>\n )\n }\n\n if (isMobile) {\n return (\n <Drawer open={openMobile} onOpenChange={setOpenMobile} direction={side} size=\"sm\">\n <DrawerContent\n dir={dir}\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"h-full w-(--sidebar-width) rounded-none bg-sidebar p-0 text-sidebar-foreground\"\n style={\n {\n '--sidebar-width': SIDEBAR_WIDTH_MOBILE\n } as React.CSSProperties\n }\n {...props}\n >\n <DrawerHeader className=\"sr-only\">\n <DrawerTitle>Sidebar</DrawerTitle>\n <DrawerDescription>Displays the mobile sidebar.</DrawerDescription>\n </DrawerHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </DrawerContent>\n </Drawer>\n )\n }\n\n return (\n <div\n className=\"group peer hidden text-sidebar-foreground md:block\"\n data-state={state}\n data-collapsible={state === 'collapsed' ? collapsible : ''}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n 'relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n variant === 'floating' || variant === 'inset'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)'\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n data-side={side}\n className={cn(\n 'fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex',\n 'data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:-left-(--sidebar-width)',\n 'data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:-right-(--sidebar-width)',\n // Adjust the padding for floating and inset variants.\n variant === 'floating' || variant === 'inset'\n ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)',\n variant !== 'floating' &&\n variant !== 'inset' &&\n 'group-data-[side=left]:border-r group-data-[side=right]:border-l',\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className={cn(\n 'flex size-full flex-col bg-sidebar',\n 'group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm',\n 'group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border'\n )}\n >\n {children}\n </div>\n </div>\n </div>\n )\n}\n\nfunction SidebarTrigger({ className, onClick, ...props }: SidebarTriggerProps) {\n const { toggleSidebar } = useSidebar()\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n size=\"icon-sm\"\n color=\"zinc\"\n className={cn(className)}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n <IconLayoutSidebar />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n )\n}\n\nfunction SidebarRail({ className, ...props }: SidebarRailProps) {\n const { toggleSidebar } = useSidebar()\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n 'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',\n 'absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:s-1/2 after:w-0.5 hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2',\n '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',\n 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar',\n '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',\n '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarInset({ className, ...props }: SidebarInsetProps) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n 'relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarInput({ className, ...props }: SidebarInputProps) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn('h-8 w-full bg-background shadow-none', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarHeader({ className, ...props }: SidebarHeaderProps) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn('flex flex-col gap-2 p-2', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarFooter({ className, ...props }: SidebarFooterProps) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn('flex flex-col gap-2 p-2', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarSeparator({ className, ...props }: SidebarSeparatorProps) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn('w-auto bg-sidebar-border', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarContent({ className, ...props }: SidebarContentProps) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n 'no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarGroup({ className, ...props }: SidebarGroupProps) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn('relative flex w-full min-w-0 flex-col px-2', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarGroupLabel({ className, asChild = false, ...props }: SidebarGroupLabelProps) {\n const Comp = asChild ? Slot.Root : 'div'\n\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n data-sidebar=\"group-label\"\n className={cn(\n 'flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarGroupAction({ className, asChild = false, ...props }: SidebarGroupActionProps) {\n const Comp = asChild ? Slot.Root : 'button'\n\n return (\n <Comp\n data-slot=\"sidebar-group-action\"\n data-sidebar=\"group-action\"\n className={cn(\n 'absolute top-1.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarGroupContent({ className, ...props }: SidebarGroupContentProps) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn('w-full text-sm mt-2', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenu({ className, ...props }: SidebarMenuProps) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn('flex w-full min-w-0 flex-col gap-0', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuItem({ className, ...props }: SidebarMenuItemProps) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn('group/menu-item relative', className)}\n {...props}\n />\n )\n}\n\nconst sidebarMenuButtonVariants = cva(\n 'peer/menu-button group/menu-button font-medium flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:[&_svg]:text-sidebar-primary data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate',\n {\n variants: {\n variant: {\n default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',\n outline:\n '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))]'\n },\n size: {\n md: 'h-8 text-sm',\n sm: 'h-7 text-xs',\n lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!'\n }\n },\n defaultVariants: {\n variant: 'default',\n size: 'md'\n }\n }\n)\n\nexport type SidebarMenuButtonProps = React.ComponentProps<'button'> & {\n asChild?: boolean\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n} & VariantProps<typeof sidebarMenuButtonVariants>\n\nexport type SidebarMenuActionProps = React.ComponentProps<'button'> & {\n asChild?: boolean\n showOnHover?: boolean\n}\n\nexport type SidebarMenuBadgeProps = React.ComponentProps<'div'>\n\nexport type SidebarMenuSkeletonProps = React.ComponentProps<'div'> & {\n showIcon?: boolean\n}\n\nexport type SidebarMenuSubProps = React.ComponentProps<'ul'>\n\nexport type SidebarMenuSubItemProps = React.ComponentProps<'li'>\n\nexport type SidebarMenuSubButtonProps = React.ComponentProps<'a'> & {\n asChild?: boolean\n size?: 'sm' | 'md'\n isActive?: boolean\n}\n\nfunction SidebarMenuButton({\n asChild = false,\n isActive = false,\n variant = 'default',\n size = 'md',\n tooltip,\n className,\n ...props\n}: SidebarMenuButtonProps) {\n const Comp = asChild ? Slot.Root : 'button'\n const { isMobile, state } = useSidebar()\n\n const button = (\n <Comp\n data-slot=\"sidebar-menu-button\"\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n )\n\n if (!tooltip) {\n return button\n }\n\n if (typeof tooltip === 'string') {\n tooltip = {\n children: tooltip\n }\n }\n\n return (\n <Tooltip\n label={tooltip.children}\n side=\"right\"\n align=\"center\"\n hidden={state !== 'collapsed' || isMobile}\n {...tooltip}\n >\n {button}\n </Tooltip>\n )\n}\n\nfunction SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }: SidebarMenuActionProps) {\n const Comp = asChild ? Slot.Root : 'button'\n\n return (\n <Comp\n data-slot=\"sidebar-menu-action\"\n data-sidebar=\"menu-action\"\n className={cn(\n 'absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=md]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0',\n showOnHover &&\n 'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuBadge({ className, ...props }: SidebarMenuBadgeProps) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n 'pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=md]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSkeleton({ className, showIcon = false, ...props }: SidebarMenuSkeletonProps) {\n // Random width between 50 to 90%.\n const [width] = React.useState(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`\n })\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)}\n {...props}\n >\n {showIcon && <Skeleton className=\"size-4 rounded-md\" data-sidebar=\"menu-skeleton-icon\" />}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n '--skeleton-width': width\n } as React.CSSProperties\n }\n />\n </div>\n )\n}\n\nfunction SidebarMenuSub({ className, ...props }: SidebarMenuSubProps) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n 'mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSubItem({ className, ...props }: SidebarMenuSubItemProps) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn('group/menu-sub-item relative', className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSubButton({\n asChild = false,\n size = 'md',\n isActive = false,\n className,\n ...props\n}: SidebarMenuSubButtonProps) {\n const Comp = asChild ? Slot.Root : 'a'\n\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n 'flex h-7 min-w-0 -translate-x-px items-center font-medium gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar\n}\n"],"mappings":"6nBAeA,MAiBM,EAAiB,EAAM,cAA0C,KAAK,CA8C5E,SAAS,YAAa,CACpB,IAAM,EAAU,EAAM,WAAW,EAAe,CAChD,GAAI,CAAC,EACH,MAAU,MAAM,oDAAoD,CAGtE,OAAO,EAGT,SAAS,gBAAgB,CACvB,cAAc,GACd,KAAM,EACN,aAAc,EACd,YACA,QACA,WACA,GAAG,GACoB,CACvB,IAAM,EAAW,GAAa,CACxB,CAAC,EAAY,GAAiB,EAAM,SAAS,GAAM,CAInD,CAAC,EAAO,GAAY,EAAM,SAAS,EAAY,CAC/C,EAAO,GAAY,EACnB,EAAU,EAAM,YACnB,GAAmD,CAClD,IAAM,EAAY,OAAO,GAAU,WAAa,EAAM,EAAK,CAAG,EAC1D,EACF,EAAY,EAAU,CAEtB,EAAS,EAAU,CAKrB,SAAS,OAAS,iBAA0B,EAAU,2BAExD,CAAC,EAAa,EAAK,CACpB,CAGK,EAAgB,EAAM,gBACnB,EAAW,EAAe,GAAS,CAAC,EAAK,CAAG,EAAS,GAAS,CAAC,EAAK,CAC1E,CAAC,EAAU,EAAQ,CAAC,CAGvB,EAAM,cAAgB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iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAAC,MAAD,CACE,YAAU,qBACV,eAAa,aACb,UAAW,EACT,sbACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,oBAAoB,CAAE,YAAW,WAAW,GAAO,GAAG,GAAmC,CAEhG,GAAM,CAAC,GAAS,EAAM,aACb,GAAG,KAAK,MAAM,KAAK,QAAQ,CAAG,GAAG,CAAG,GAAG,GAC9C,CAEF,OACE,EAAC,MAAD,CACE,YAAU,wBACV,eAAa,gBACb,UAAW,EAAG,8CAA+C,EAAU,CACvE,GAAI,WAJN,CAMG,GAAY,EAAC,EAAD,CAAU,UAAU,oBAAoB,eAAa,qBAAuB,CAAA,CACzF,EAAC,EAAD,CACE,UAAU,sCACV,eAAa,qBACb,MACE,CACE,mBAAoB,EACrB,CAEH,CAAA,CACE,GAIV,SAAS,eAAe,CAAE,YAAW,GAAG,GAA8B,CACpE,OACE,EAAC,KAAD,CACE,YAAU,mBACV,eAAa,WACb,UAAW,EACT,sIACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,mBAAmB,CAAE,YAAW,GAAG,GAAkC,CAC5E,OACE,EAAC,KAAD,CACE,YAAU,wBACV,eAAa,gBACb,UAAW,EAAG,+BAAgC,EAAU,CACxD,GAAI,EACJ,CAAA,CAIN,SAAS,qBAAqB,CAC5B,UAAU,GACV,OAAO,KACP,WAAW,GACX,YACA,GAAG,GACyB,CAG5B,OACE,EAHW,EAAU,EAAK,KAAO,IAGjC,CACE,YAAU,0BACV,eAAa,kBACb,YAAW,EACX,cAAa,EACb,UAAW,EACT,wpBACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -3,9 +3,13 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/skeleton.d.ts
|
|
6
|
-
type SkeletonProps = React.ComponentProps<'div'
|
|
6
|
+
type SkeletonProps = React.ComponentProps<'div'> & {
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
};
|
|
7
9
|
declare function Skeleton({
|
|
8
10
|
className,
|
|
11
|
+
children,
|
|
12
|
+
visible,
|
|
9
13
|
...props
|
|
10
14
|
}: SkeletonProps): _$react_jsx_runtime0.JSX.Element;
|
|
11
15
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";function Skeleton({className:
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";function Skeleton({className:r,children:i,visible:a=!0,...o}){return i==null?t(`div`,{"data-slot":`skeleton`,className:e(`bg-muted rounded-md animate-pulse`,r),...o}):n(`div`,{"data-slot":`skeleton`,"aria-busy":a||void 0,className:e(`relative overflow-hidden rounded-md`,r),...o,children:[t(`div`,{"data-slot":`skeleton-content`,className:e(a&&`invisible`),"aria-hidden":a||void 0,children:i}),a&&t(`div`,{"data-slot":`skeleton-overlay`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 rounded-[inherit] bg-muted animate-pulse`})]})}export{Skeleton};
|
|
2
2
|
//# sourceMappingURL=skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","names":[],"sources":["../../src/components/skeleton.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type SkeletonProps = React.ComponentProps<'div'
|
|
1
|
+
{"version":3,"file":"skeleton.js","names":[],"sources":["../../src/components/skeleton.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type SkeletonProps = React.ComponentProps<'div'> & {\n visible?: boolean\n}\n\nfunction Skeleton({ className, children, visible = true, ...props }: SkeletonProps) {\n if (children === undefined || children === null) {\n return <div data-slot=\"skeleton\" className={cn('bg-muted rounded-md animate-pulse', className)} {...props} />\n }\n\n return (\n <div\n data-slot=\"skeleton\"\n aria-busy={visible || undefined}\n className={cn('relative overflow-hidden rounded-md', className)}\n {...props}\n >\n <div data-slot=\"skeleton-content\" className={cn(visible && 'invisible')} aria-hidden={visible || undefined}>\n {children}\n </div>\n {visible && (\n <div\n data-slot=\"skeleton-overlay\"\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 rounded-[inherit] bg-muted animate-pulse\"\n />\n )}\n </div>\n )\n}\n\nexport { Skeleton }\n"],"mappings":"oHAQA,SAAS,SAAS,CAAE,YAAW,WAAU,UAAU,GAAM,GAAG,GAAwB,CAKlF,OAJI,GAAuC,KAClC,EAAC,MAAD,CAAK,YAAU,WAAW,UAAW,EAAG,oCAAqC,EAAU,CAAE,GAAI,EAAS,CAAA,CAI7G,EAAC,MAAD,CACE,YAAU,WACV,YAAW,GAAW,IAAA,GACtB,UAAW,EAAG,sCAAuC,EAAU,CAC/D,GAAI,WAJN,CAME,EAAC,MAAD,CAAK,YAAU,mBAAmB,UAAW,EAAG,GAAW,YAAY,CAAE,cAAa,GAAW,IAAA,GAC9F,WACG,CAAA,CACL,GACC,EAAC,MAAD,CACE,YAAU,mBACV,cAAY,OACZ,UAAU,gFACV,CAAA,CAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{Skeleton as e}from"./skeleton.js";import{i as t,n}from"../react.esm-B3a5z6DL.js";import{jsx as r}from"react/jsx-runtime";describe(`Skeleton`,()=>{it(`renders the legacy placeholder when children are not provided`,()=>{let{container:t}=n(r(e,{className:`h-4 w-48`})),i=t.querySelector(`[data-slot="skeleton"]`);expect(i).not.toBeNull(),expect(i?.className).toContain(`bg-muted`),expect(i?.className).toContain(`animate-pulse`),expect(i?.className).toContain(`h-4`),expect(t.querySelector(`[data-slot="skeleton-overlay"]`)).toBeNull()}),it(`keeps children in the DOM and renders an overlay when visible`,()=>{let{container:i}=n(r(e,{visible:!0,children:r(`button`,{type:`button`,children:`Save changes`})})),a=i.querySelector(`[data-slot="skeleton-content"]`),o=i.querySelector(`[data-slot="skeleton-overlay"]`);expect(t.getByRole(`button`,{hidden:!0,name:`Save changes`})).not.toBeNull(),expect(a?.className).toContain(`invisible`),expect(a?.getAttribute(`aria-hidden`)).toBe(`true`),expect(o).not.toBeNull(),expect(o?.className).toContain(`absolute`),expect(o?.className).toContain(`inset-0`)}),it(`shows children and does not render an overlay when hidden`,()=>{let{container:i}=n(r(e,{visible:!1,children:r(`button`,{type:`button`,children:`Save changes`})})),a=i.querySelector(`[data-slot="skeleton-content"]`);expect(t.getByRole(`button`,{name:`Save changes`})).not.toBeNull(),expect(a?.className).not.toContain(`invisible`),expect(a?.getAttribute(`aria-hidden`)).toBeNull(),expect(i.querySelector(`[data-slot="skeleton-overlay"]`)).toBeNull()})});
|
|
2
|
+
//# sourceMappingURL=skeleton.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.spec.js","names":[],"sources":["../../src/components/skeleton.spec.tsx"],"sourcesContent":["import { render, screen } from '@testing-library/react'\n\nimport { Skeleton } from './skeleton'\n\ndescribe('Skeleton', () => {\n it('renders the legacy placeholder when children are not provided', () => {\n const { container } = render(<Skeleton className=\"h-4 w-48\" />)\n\n const skeleton = container.querySelector('[data-slot=\"skeleton\"]')\n\n expect(skeleton).not.toBeNull()\n expect(skeleton?.className).toContain('bg-muted')\n expect(skeleton?.className).toContain('animate-pulse')\n expect(skeleton?.className).toContain('h-4')\n expect(container.querySelector('[data-slot=\"skeleton-overlay\"]')).toBeNull()\n })\n\n it('keeps children in the DOM and renders an overlay when visible', () => {\n const { container } = render(\n <Skeleton visible>\n <button type=\"button\">Save changes</button>\n </Skeleton>\n )\n\n const content = container.querySelector('[data-slot=\"skeleton-content\"]')\n const overlay = container.querySelector('[data-slot=\"skeleton-overlay\"]')\n\n expect(screen.getByRole('button', { hidden: true, name: 'Save changes' })).not.toBeNull()\n expect(content?.className).toContain('invisible')\n expect(content?.getAttribute('aria-hidden')).toBe('true')\n expect(overlay).not.toBeNull()\n expect(overlay?.className).toContain('absolute')\n expect(overlay?.className).toContain('inset-0')\n })\n\n it('shows children and does not render an overlay when hidden', () => {\n const { container } = render(\n <Skeleton visible={false}>\n <button type=\"button\">Save changes</button>\n </Skeleton>\n )\n\n const content = container.querySelector('[data-slot=\"skeleton-content\"]')\n\n expect(screen.getByRole('button', { name: 'Save changes' })).not.toBeNull()\n expect(content?.className).not.toContain('invisible')\n expect(content?.getAttribute('aria-hidden')).toBeNull()\n expect(container.querySelector('[data-slot=\"skeleton-overlay\"]')).toBeNull()\n })\n})\n"],"mappings":"6JAIA,SAAS,eAAkB,CACzB,GAAG,oEAAuE,CACxE,GAAM,CAAE,aAAc,EAAO,EAAC,EAAD,CAAU,UAAU,WAAa,CAAA,CAAC,CAEzD,EAAW,EAAU,cAAc,yBAAyB,CAElE,OAAO,EAAS,CAAC,IAAI,UAAU,CAC/B,OAAO,GAAU,UAAU,CAAC,UAAU,WAAW,CACjD,OAAO,GAAU,UAAU,CAAC,UAAU,gBAAgB,CACtD,OAAO,GAAU,UAAU,CAAC,UAAU,MAAM,CAC5C,OAAO,EAAU,cAAc,iCAAiC,CAAC,CAAC,UAAU,EAC5E,CAEF,GAAG,oEAAuE,CACxE,GAAM,CAAE,aAAc,EACpB,EAAC,EAAD,CAAU,QAAA,YACR,EAAC,SAAD,CAAQ,KAAK,kBAAS,eAAqB,CAAA,CAClC,CAAA,CACZ,CAEK,EAAU,EAAU,cAAc,iCAAiC,CACnE,EAAU,EAAU,cAAc,iCAAiC,CAEzE,OAAO,EAAO,UAAU,SAAU,CAAE,OAAQ,GAAM,KAAM,eAAgB,CAAC,CAAC,CAAC,IAAI,UAAU,CACzF,OAAO,GAAS,UAAU,CAAC,UAAU,YAAY,CACjD,OAAO,GAAS,aAAa,cAAc,CAAC,CAAC,KAAK,OAAO,CACzD,OAAO,EAAQ,CAAC,IAAI,UAAU,CAC9B,OAAO,GAAS,UAAU,CAAC,UAAU,WAAW,CAChD,OAAO,GAAS,UAAU,CAAC,UAAU,UAAU,EAC/C,CAEF,GAAG,gEAAmE,CACpE,GAAM,CAAE,aAAc,EACpB,EAAC,EAAD,CAAU,QAAS,YACjB,EAAC,SAAD,CAAQ,KAAK,kBAAS,eAAqB,CAAA,CAClC,CAAA,CACZ,CAEK,EAAU,EAAU,cAAc,iCAAiC,CAEzE,OAAO,EAAO,UAAU,SAAU,CAAE,KAAM,eAAgB,CAAC,CAAC,CAAC,IAAI,UAAU,CAC3E,OAAO,GAAS,UAAU,CAAC,IAAI,UAAU,YAAY,CACrD,OAAO,GAAS,aAAa,cAAc,CAAC,CAAC,UAAU,CACvD,OAAO,EAAU,cAAc,iCAAiC,CAAC,CAAC,UAAU,EAC5E,EACF"}
|
|
@@ -5,16 +5,32 @@ import * as React from "react";
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/tooltip.d.ts
|
|
7
7
|
type TooltipProviderProps = React.ComponentProps<typeof Tooltip$1.Provider>;
|
|
8
|
-
type
|
|
8
|
+
type TooltipRootProps = React.ComponentProps<typeof Tooltip$1.Root>;
|
|
9
9
|
type TooltipTriggerProps = React.ComponentProps<typeof Tooltip$1.Trigger>;
|
|
10
10
|
type TooltipContentProps = React.ComponentProps<typeof Tooltip$1.Content>;
|
|
11
|
+
type TooltipProps = Omit<TooltipRootProps, 'children'> & Omit<TooltipContentProps, 'children'> & {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
11
16
|
declare function TooltipProvider({
|
|
12
17
|
delayDuration,
|
|
13
18
|
...props
|
|
14
19
|
}: TooltipProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
-
declare function
|
|
20
|
+
declare function TooltipRoot({
|
|
16
21
|
...props
|
|
17
|
-
}:
|
|
22
|
+
}: TooltipRootProps): _$react_jsx_runtime0.JSX.Element;
|
|
23
|
+
declare function Tooltip({
|
|
24
|
+
label,
|
|
25
|
+
children,
|
|
26
|
+
disabled,
|
|
27
|
+
open,
|
|
28
|
+
defaultOpen,
|
|
29
|
+
onOpenChange,
|
|
30
|
+
delayDuration,
|
|
31
|
+
disableHoverableContent,
|
|
32
|
+
...contentProps
|
|
33
|
+
}: TooltipProps): string | number | bigint | boolean | _$react_jsx_runtime0.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
18
34
|
declare function TooltipTrigger({
|
|
19
35
|
...props
|
|
20
36
|
}: TooltipTriggerProps): _$react_jsx_runtime0.JSX.Element;
|
|
@@ -25,5 +41,5 @@ declare function TooltipContent({
|
|
|
25
41
|
...props
|
|
26
42
|
}: TooltipContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
27
43
|
//#endregion
|
|
28
|
-
export { Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipTrigger, TooltipTriggerProps };
|
|
44
|
+
export { Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipRoot, TooltipRootProps, TooltipTrigger, TooltipTriggerProps };
|
|
29
45
|
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Tooltip as t}from"radix-ui";import{jsx as n,jsxs as r}from"react/jsx-runtime";function TooltipProvider({delayDuration:e=0,...r}){return n(t.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...r})}function
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Tooltip as t}from"radix-ui";import{jsx as n,jsxs as r}from"react/jsx-runtime";function TooltipProvider({delayDuration:e=0,...r}){return n(t.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...r})}function TooltipRoot({...e}){return n(t.Root,{"data-slot":`tooltip-root`,...e})}function Tooltip({label:e,children:t,disabled:i=!1,open:a,defaultOpen:o,onOpenChange:s,delayDuration:c,disableHoverableContent:l,...u}){return i?t:r(TooltipRoot,{open:a,defaultOpen:o,onOpenChange:s,delayDuration:c,disableHoverableContent:l,children:[n(TooltipTrigger,{asChild:!0,children:t}),n(TooltipContent,{...u,children:e})]})}function TooltipTrigger({...e}){return n(t.Trigger,{"data-slot":`tooltip-trigger`,...e})}function TooltipContent({className:i,sideOffset:a=0,children:o,...s}){return n(t.Portal,{children:r(t.Content,{"data-slot":`tooltip-content`,sideOffset:a,className:e(`bg-foreground text-background z-50 w-fit max-w-xs rounded-md px-3 py-1.5 text-xs origin-(--radix-tooltip-content-transform-origin)`,`data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95`,`data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,i),...s,children:[o,n(t.Arrow,{className:`size-2.5 rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 translate-y-[calc(-50%-2px)]`})]})})}export{Tooltip,TooltipContent,TooltipProvider,TooltipRoot,TooltipTrigger};
|
|
2
2
|
//# sourceMappingURL=tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":["TooltipPrimitive"],"sources":["../../src/components/tooltip.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Tooltip as TooltipPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type TooltipProviderProps = React.ComponentProps<typeof TooltipPrimitive.Provider>\n\nexport type
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":["TooltipPrimitive"],"sources":["../../src/components/tooltip.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Tooltip as TooltipPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type TooltipProviderProps = React.ComponentProps<typeof TooltipPrimitive.Provider>\n\nexport type TooltipRootProps = React.ComponentProps<typeof TooltipPrimitive.Root>\n\nexport type TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger>\n\nexport type TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Content>\n\nexport type TooltipProps = Omit<TooltipRootProps, 'children'> &\n Omit<TooltipContentProps, 'children'> & {\n children?: React.ReactNode\n label?: React.ReactNode\n disabled?: boolean\n }\n\nfunction TooltipProvider({ delayDuration = 0, ...props }: TooltipProviderProps) {\n return <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delayDuration={delayDuration} {...props} />\n}\n\nfunction TooltipRoot({ ...props }: TooltipRootProps) {\n return <TooltipPrimitive.Root data-slot=\"tooltip-root\" {...props} />\n}\n\nfunction Tooltip({\n label,\n children,\n disabled = false,\n open,\n defaultOpen,\n onOpenChange,\n delayDuration,\n disableHoverableContent,\n ...contentProps\n}: TooltipProps) {\n if (disabled) {\n return children\n }\n\n return (\n <TooltipRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n delayDuration={delayDuration}\n disableHoverableContent={disableHoverableContent}\n >\n <TooltipTrigger asChild>{children}</TooltipTrigger>\n <TooltipContent {...contentProps}>{label}</TooltipContent>\n </TooltipRoot>\n )\n}\n\nfunction TooltipTrigger({ ...props }: TooltipTriggerProps) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({ className, sideOffset = 0, children, ...props }: TooltipContentProps) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-foreground text-background z-50 w-fit max-w-xs rounded-md px-3 py-1.5 text-xs origin-(--radix-tooltip-content-transform-origin)',\n 'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"size-2.5 rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 translate-y-[calc(-50%-2px)]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger }\n"],"mappings":"uJAqBA,SAAS,gBAAgB,CAAE,gBAAgB,EAAG,GAAG,GAA+B,CAC9E,OAAO,EAACA,EAAiB,SAAlB,CAA2B,YAAU,mBAAkC,gBAAe,GAAI,EAAS,CAAA,CAG5G,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAiB,KAAlB,CAAuB,YAAU,eAAe,GAAI,EAAS,CAAA,CAGtE,SAAS,QAAQ,CACf,QACA,WACA,WAAW,GACX,OACA,cACA,eACA,gBACA,0BACA,GAAG,GACY,CAKf,OAJI,EACK,EAIP,EAAC,YAAD,CACQ,OACO,cACC,eACC,gBACU,mCAL3B,CAOE,EAAC,eAAD,CAAgB,QAAA,GAAS,WAA0B,CAAA,CACnD,EAAC,eAAD,CAAgB,GAAI,WAAe,EAAuB,CAAA,CAC9C,GAIlB,SAAS,eAAe,CAAE,GAAG,GAA8B,CACzD,OAAO,EAACA,EAAiB,QAAlB,CAA0B,YAAU,kBAAkB,GAAI,EAAS,CAAA,CAG5E,SAAS,eAAe,CAAE,YAAW,aAAa,EAAG,WAAU,GAAG,GAA8B,CAC9F,OACE,EAACA,EAAiB,OAAlB,CAAA,SACE,EAACA,EAAiB,QAAlB,CACE,YAAU,kBACE,aACZ,UAAW,EACT,qIACA,8KACA,yEACA,8JACA,EACD,CACD,GAAI,WAVN,CAYG,EACD,EAACA,EAAiB,MAAlB,CAAwB,UAAU,mGAAqG,CAAA,CAC9G,GACH,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { n as __name } from "../chunk-CHh1Zzun.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/unstyled-button.d.ts
|
|
6
|
+
type UnstyledButtonProps = React.ComponentProps<'button'> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function UnstyledButton({
|
|
10
|
+
className,
|
|
11
|
+
type,
|
|
12
|
+
asChild,
|
|
13
|
+
...props
|
|
14
|
+
}: UnstyledButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { UnstyledButton, UnstyledButtonProps };
|
|
17
|
+
//# sourceMappingURL=unstyled-button.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function UnstyledButton({className:r,type:i=`button`,asChild:a=!1,...o}){return n(a?t.Root:`button`,{type:a?void 0:i,"data-slot":`unstyled-button`,className:e(`inline-flex appearance-none items-center justify-center border-0 bg-transparent p-0 [font:inherit] text-inherit outline-none`,`cursor-pointer select-none disabled:pointer-events-none disabled:opacity-50`,`focus-visible:ring-3 focus-visible:ring-ring/50`,r),...o})}export{UnstyledButton};
|
|
2
|
+
//# sourceMappingURL=unstyled-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unstyled-button.js","names":[],"sources":["../../src/components/unstyled-button.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type UnstyledButtonProps = React.ComponentProps<'button'> & {\n asChild?: boolean\n}\n\nfunction UnstyledButton({ className, type = 'button', asChild = false, ...props }: UnstyledButtonProps) {\n const Comp = asChild ? Slot.Root : 'button'\n\n return (\n <Comp\n type={!asChild ? type : undefined}\n data-slot=\"unstyled-button\"\n className={cn(\n 'inline-flex appearance-none items-center justify-center border-0 bg-transparent p-0 [font:inherit] text-inherit outline-none',\n 'cursor-pointer select-none disabled:pointer-events-none disabled:opacity-50',\n 'focus-visible:ring-3 focus-visible:ring-ring/50',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { UnstyledButton }\n"],"mappings":"0IAUA,SAAS,eAAe,CAAE,YAAW,OAAO,SAAU,UAAU,GAAO,GAAG,GAA8B,CAGtG,OACE,EAHW,EAAU,EAAK,KAAO,SAGjC,CACE,KAAO,EAAiB,IAAA,GAAP,EACjB,YAAU,kBACV,UAAW,EACT,+HACA,8EACA,kDACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"../chunk-CHh1Zzun.js";import{useBreakpointValue as r}from"./use-breakpoint-value.js";import{
|
|
1
|
+
import{n as e,t}from"../chunk-CHh1Zzun.js";import{useBreakpointValue as r}from"./use-breakpoint-value.js";import{r as o,t as s}from"../react.esm-B3a5z6DL.js";var c={reset:[0,0],bold:[1,22,`\x1B[22m\x1B[1m`],dim:[2,22,`\x1B[22m\x1B[2m`],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function i(e){return String(e)}i.open=``,i.close=``;function B(){let e=typeof process<`u`?process:void 0,t=e?.env||{},r=t.FORCE_TTY!==`false`,o=e?.argv||[];return!(`NO_COLOR`in t||o.includes(`--no-color`))&&(`FORCE_COLOR`in t||o.includes(`--color`)||e?.platform===`win32`||r&&t.TERM!==`dumb`||`CI`in t)||typeof window<`u`&&!!window.chrome}function C({force:e}={}){let t=e||B(),a=(e,t,r,o)=>{let s=``,c=0;do s+=e.substring(c,o)+r,c=o+t.length,o=e.indexOf(t,c);while(~o);return s+e.substring(c)},l=(e,t,r=e)=>{let n=o=>{let s=String(o),c=s.indexOf(t,e.length);return~c?e+a(s,t,r,c)+t:e+s+t};return n.open=e,n.close=t,n},r={isColorSupported:t},f=e=>`\x1B[${e}m`;for(let e in c){let o=c[e];r[e]=t?l(f(o[0]),f(o[1]),o[2]):i}return r}var u=C();function _mergeNamespaces(e,t){return t.forEach(function(t){t&&typeof t!=`string`&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if(r!==`default`&&!(r in e)){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}function getKeysOfEnumerableProperties(e,t){let r=Object.keys(e),o=t===null?r:r.sort(t);if(Object.getOwnPropertySymbols)for(let t of Object.getOwnPropertySymbols(e))Object.getOwnPropertyDescriptor(e,t).enumerable&&o.push(t);return o}function printIteratorEntries(e,t,r,o,s,c,u=`: `){let d=``,p=0,m=e.next();if(!m.done){d+=t.spacingOuter;let h=r+t.indent;for(;!m.done;){if(d+=h,p++===t.maxWidth){d+=`…`;break}let r=c(m.value[0],t,h,o,s),g=c(m.value[1],t,h,o,s);d+=r+u+g,m=e.next(),m.done?t.min||(d+=`,`):d+=`,${t.spacingInner}`}d+=t.spacingOuter+r}return d}function printIteratorValues(e,t,r,o,s,c){let u=``,d=0,p=e.next();if(!p.done){u+=t.spacingOuter;let m=r+t.indent;for(;!p.done;){if(u+=m,d++===t.maxWidth){u+=`…`;break}u+=c(p.value,t,m,o,s),p=e.next(),p.done?t.min||(u+=`,`):u+=`,${t.spacingInner}`}u+=t.spacingOuter+r}return u}function printListItems(e,t,r,o,s,c){let u=``;e=e instanceof ArrayBuffer?new DataView(e):e;let isDataView=e=>e instanceof DataView,d=isDataView(e)?e.byteLength:e.length;if(d>0){u+=t.spacingOuter;let p=r+t.indent;for(let r=0;r<d;r++){if(u+=p,r===t.maxWidth){u+=`…`;break}(isDataView(e)||r in e)&&(u+=c(isDataView(e)?e.getInt8(r):e[r],t,p,o,s)),r<d-1?u+=`,${t.spacingInner}`:t.min||(u+=`,`)}u+=t.spacingOuter+r}return u}function printObjectProperties(e,t,r,o,s,c){let u=``,d=getKeysOfEnumerableProperties(e,t.compareKeys);if(d.length>0){u+=t.spacingOuter;let p=r+t.indent;for(let r=0;r<d.length;r++){let m=d[r],h=c(m,t,p,o,s),g=c(e[m],t,p,o,s);u+=`${p+h}: ${g}`,r<d.length-1?u+=`,${t.spacingInner}`:t.min||(u+=`,`)}u+=t.spacingOuter+r}return u}const d=typeof Symbol==`function`&&Symbol.for?Symbol.for(`jest.asymmetricMatcher`):1267621,serialize$5=(e,t,r,o,s,c)=>{let u=e.toString();if(u===`ArrayContaining`||u===`ArrayNotContaining`)return++o>t.maxDepth?`[${u}]`:`${u+` `}[${printListItems(e.sample,t,r,o,s,c)}]`;if(u===`ObjectContaining`||u===`ObjectNotContaining`)return++o>t.maxDepth?`[${u}]`:`${u+` `}{${printObjectProperties(e.sample,t,r,o,s,c)}}`;if(u===`StringMatching`||u===`StringNotMatching`||u===`StringContaining`||u===`StringNotContaining`)return u+` `+c(e.sample,t,r,o,s);if(typeof e.toAsymmetricMatcher!=`function`)throw TypeError(`Asymmetric matcher ${e.constructor.name} does not implement toAsymmetricMatcher()`);return e.toAsymmetricMatcher()},test$5=e=>e&&e.$$typeof===d,p={serialize:serialize$5,test:test$5},m=new Set([`DOMStringMap`,`NamedNodeMap`]),h=/^(?:HTML\w*Collection|NodeList)$/;function testName(e){return m.has(e)||h.test(e)}const test$4=e=>e&&e.constructor&&!!e.constructor.name&&testName(e.constructor.name);function isNamedNodeMap(e){return e.constructor.name===`NamedNodeMap`}const serialize$4=(e,t,r,o,s,c)=>{let u=e.constructor.name;return++o>t.maxDepth?`[${u}]`:(t.min?``:u+` `)+(m.has(u)?`{${printObjectProperties(isNamedNodeMap(e)?[...e].reduce((e,t)=>(e[t.name]=t.value,e),{}):{...e},t,r,o,s,c)}}`:`[${printListItems([...e],t,r,o,s,c)}]`)},g={serialize:serialize$4,test:test$4};function escapeHTML(e){return e.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}function printProps(e,t,r,o,s,c,u){let d=o+r.indent,p=r.colors;return e.map(e=>{let m=t[e];if(typeof m==`string`&&m[0]===`_`&&m.startsWith(`__vitest_`)&&m.match(/__vitest_\d+__/))return``;let h=u(m,r,d,s,c);return typeof m!=`string`&&(h.includes(`
|
|
2
2
|
`)&&(h=r.spacingOuter+d+h+r.spacingOuter+o),h=`{${h}}`),`${r.spacingInner+o+p.prop.open+e+p.prop.close}=${p.value.open}${h}${p.value.close}`}).join(``)}function printChildren(e,t,r,o,s,c){return e.map(e=>t.spacingOuter+r+(typeof e==`string`?printText(e,t):c(e,t,r,o,s))).join(``)}function printShadowRoot(e,t,r,o,s,c){return t.printShadowRoot===!1?``:[`${t.spacingOuter+r}#shadow-root`,printChildren(e,t,r+t.indent,o,s,c)].join(``)}function printText(e,t){let r=t.colors.content;return r.open+escapeHTML(e)+r.close}function printComment(e,t){let r=t.colors.comment;return`${r.open}<!--${escapeHTML(e)}-->${r.close}`}function printElement(e,t,r,o,s){let c=o.colors.tag;return`${c.open}<${e}${t&&c.close+t+o.spacingOuter+s+c.open}${r?`>${c.close}${r}${o.spacingOuter}${s}${c.open}</${e}`:`${t&&!o.min?``:` `}/`}>${c.close}`}function printElementAsLeaf(e,t){let r=t.colors.tag;return`${r.open}<${e}${r.close} …${r.open} />${r.close}`}const _=/^(?:(?:HTML|SVG)\w*)?Element$/;function testHasAttribute(e){try{return typeof e.hasAttribute==`function`&&e.hasAttribute(`is`)}catch{return!1}}function testNode(e){let t=e.constructor.name,{nodeType:r,tagName:o}=e,s=typeof o==`string`&&o.includes(`-`)||testHasAttribute(e);return r===1&&(_.test(t)||s)||r===3&&t===`Text`||r===8&&t===`Comment`||r===11&&t===`DocumentFragment`}const test$3=e=>e?.constructor?.name&&testNode(e);function nodeIsText(e){return e.nodeType===3}function nodeIsComment(e){return e.nodeType===8}function nodeIsFragment(e){return e.nodeType===11}function filterChildren(e,t){let r=e.filter(e=>e.nodeType===3?(e.data||``).trim().length>0:!0);return t&&(r=r.filter(t)),r}function serializeDOM(e,t,r,o,s,c,u){if(nodeIsText(e))return printText(e.data,t);if(nodeIsComment(e))return printComment(e.data,t);let d=nodeIsFragment(e)?`DocumentFragment`:e.tagName.toLowerCase();if(++o>t.maxDepth)return printElementAsLeaf(d,t);let p=Array.prototype.slice.call(e.childNodes||e.children),m=nodeIsFragment(e)||!e.shadowRoot?[]:Array.prototype.slice.call(e.shadowRoot.children),h=u?filterChildren(p,u):p,g=u?filterChildren(m,u):m;return printElement(d,printProps(nodeIsFragment(e)?[]:Array.from(e.attributes,e=>e.name).sort(),nodeIsFragment(e)?{}:[...e.attributes].reduce((e,t)=>(e[t.name]=t.value,e),{}),t,r+t.indent,o,s,c),(g.length>0?printShadowRoot(g,t,r+t.indent,o,s,c):``)+printChildren(h,t,r+t.indent,o,s,c),t,r)}const serialize$3=(e,t,r,o,s,c)=>serializeDOM(e,t,r,o,s,c);function createDOMElementFilter(e){return{test:test$3,serialize:(t,r,o,s,c,u)=>serializeDOM(t,r,o,s,c,u,e)}}const y={serialize:serialize$3,test:test$3},b=`@@__IMMUTABLE_ORDERED__@@`,getImmutableName=e=>`Immutable.${e}`,printAsLeaf=e=>`[${e}]`;function printImmutableEntries(e,t,r,o,s,c,u){return++o>t.maxDepth?printAsLeaf(getImmutableName(u)):`${getImmutableName(u)+` `}{${printIteratorEntries(e.entries(),t,r,o,s,c)}}`}function getRecordEntries(e){let t=0;return{next(){if(t<e._keys.length){let r=e._keys[t++];return{done:!1,value:[r,e.get(r)]}}return{done:!0,value:void 0}}}}function printImmutableRecord(e,t,r,o,s,c){let u=getImmutableName(e._name||`Record`);return++o>t.maxDepth?printAsLeaf(u):`${u+` `}{${printIteratorEntries(getRecordEntries(e),t,r,o,s,c)}}`}function printImmutableSeq(e,t,r,o,s,c){let u=getImmutableName(`Seq`);return++o>t.maxDepth?printAsLeaf(u):e[`@@__IMMUTABLE_KEYED__@@`]?`${u+` `}{${e._iter||e._object?printIteratorEntries(e.entries(),t,r,o,s,c):`…`}}`:`${u+` `}[${e._iter||e._array||e._collection||e._iterable?printIteratorValues(e.values(),t,r,o,s,c):`…`}]`}function printImmutableValues(e,t,r,o,s,c,u){return++o>t.maxDepth?printAsLeaf(getImmutableName(u)):`${getImmutableName(u)+` `}[${printIteratorValues(e.values(),t,r,o,s,c)}]`}const serialize$2=(e,t,r,o,s,c)=>e[`@@__IMMUTABLE_MAP__@@`]?printImmutableEntries(e,t,r,o,s,c,e[b]?`OrderedMap`:`Map`):e[`@@__IMMUTABLE_LIST__@@`]?printImmutableValues(e,t,r,o,s,c,`List`):e[`@@__IMMUTABLE_SET__@@`]?printImmutableValues(e,t,r,o,s,c,e[b]?`OrderedSet`:`Set`):e[`@@__IMMUTABLE_STACK__@@`]?printImmutableValues(e,t,r,o,s,c,`Stack`):e[`@@__IMMUTABLE_SEQ__@@`]?printImmutableSeq(e,t,r,o,s,c):printImmutableRecord(e,t,r,o,s,c),test$2=e=>e&&(e[`@@__IMMUTABLE_ITERABLE__@@`]===!0||e[`@@__IMMUTABLE_RECORD__@@`]===!0),x={serialize:serialize$2,test:test$2};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var S={exports:{}},w={},T;function requireReactIs_production(){if(T)return w;T=1;var e=Symbol.for(`react.transitional.element`),t=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),o=Symbol.for(`react.strict_mode`),s=Symbol.for(`react.profiler`),c=Symbol.for(`react.consumer`),u=Symbol.for(`react.context`),d=Symbol.for(`react.forward_ref`),p=Symbol.for(`react.suspense`),m=Symbol.for(`react.suspense_list`),h=Symbol.for(`react.memo`),g=Symbol.for(`react.lazy`),_=Symbol.for(`react.view_transition`),y=Symbol.for(`react.client.reference`);function typeOf(y){if(typeof y==`object`&&y){var b=y.$$typeof;switch(b){case e:switch(y=y.type,y){case r:case s:case o:case p:case m:case _:return y;default:switch(y&&=y.$$typeof,y){case u:case d:case g:case h:return y;case c:return y;default:return b}}case t:return b}}}return w.ContextConsumer=c,w.ContextProvider=u,w.Element=e,w.ForwardRef=d,w.Fragment=r,w.Lazy=g,w.Memo=h,w.Portal=t,w.Profiler=s,w.StrictMode=o,w.Suspense=p,w.SuspenseList=m,w.isContextConsumer=function(e){return typeOf(e)===c},w.isContextProvider=function(e){return typeOf(e)===u},w.isElement=function(t){return typeof t==`object`&&!!t&&t.$$typeof===e},w.isForwardRef=function(e){return typeOf(e)===d},w.isFragment=function(e){return typeOf(e)===r},w.isLazy=function(e){return typeOf(e)===g},w.isMemo=function(e){return typeOf(e)===h},w.isPortal=function(e){return typeOf(e)===t},w.isProfiler=function(e){return typeOf(e)===s},w.isStrictMode=function(e){return typeOf(e)===o},w.isSuspense=function(e){return typeOf(e)===p},w.isSuspenseList=function(e){return typeOf(e)===m},w.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===r||e===s||e===o||e===p||e===m||typeof e==`object`&&e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===u||e.$$typeof===c||e.$$typeof===d||e.$$typeof===y||e.getModuleId!==void 0))},w.typeOf=typeOf,w}var ee;function requireReactIs$1(){return ee?S.exports:(ee=1,S.exports=requireReactIs_production(),S.exports)}var te=requireReactIs$1(),ne=_mergeNamespaces({__proto__:null,default:getDefaultExportFromCjs(te)},[te]),E={exports:{}},D={},re;function requireReactIs_production_min(){if(re)return D;re=1;var e=Symbol.for(`react.element`),t=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),o=Symbol.for(`react.strict_mode`),s=Symbol.for(`react.profiler`),c=Symbol.for(`react.provider`),u=Symbol.for(`react.context`),d=Symbol.for(`react.server_context`),p=Symbol.for(`react.forward_ref`),m=Symbol.for(`react.suspense`),h=Symbol.for(`react.suspense_list`),g=Symbol.for(`react.memo`),_=Symbol.for(`react.lazy`),y=Symbol.for(`react.offscreen`),b=Symbol.for(`react.module.reference`);function v(y){if(typeof y==`object`&&y){var b=y.$$typeof;switch(b){case e:switch(y=y.type,y){case r:case s:case o:case m:case h:return y;default:switch(y&&=y.$$typeof,y){case d:case u:case p:case _:case g:case c:return y;default:return b}}case t:return b}}}return D.ContextConsumer=u,D.ContextProvider=c,D.Element=e,D.ForwardRef=p,D.Fragment=r,D.Lazy=_,D.Memo=g,D.Portal=t,D.Profiler=s,D.StrictMode=o,D.Suspense=m,D.SuspenseList=h,D.isAsyncMode=function(){return!1},D.isConcurrentMode=function(){return!1},D.isContextConsumer=function(e){return v(e)===u},D.isContextProvider=function(e){return v(e)===c},D.isElement=function(t){return typeof t==`object`&&!!t&&t.$$typeof===e},D.isForwardRef=function(e){return v(e)===p},D.isFragment=function(e){return v(e)===r},D.isLazy=function(e){return v(e)===_},D.isMemo=function(e){return v(e)===g},D.isPortal=function(e){return v(e)===t},D.isProfiler=function(e){return v(e)===s},D.isStrictMode=function(e){return v(e)===o},D.isSuspense=function(e){return v(e)===m},D.isSuspenseList=function(e){return v(e)===h},D.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===r||e===s||e===o||e===m||e===h||e===y||typeof e==`object`&&e&&(e.$$typeof===_||e.$$typeof===g||e.$$typeof===c||e.$$typeof===u||e.$$typeof===p||e.$$typeof===b||e.getModuleId!==void 0))},D.typeOf=v,D}var ie;function requireReactIs(){return ie?E.exports:(ie=1,E.exports=requireReactIs_production_min(),E.exports)}var ae=requireReactIs(),oe=_mergeNamespaces({__proto__:null,default:getDefaultExportFromCjs(ae)},[ae]);const O=Object.fromEntries([`isAsyncMode`,`isConcurrentMode`,`isContextConsumer`,`isContextProvider`,`isElement`,`isForwardRef`,`isFragment`,`isLazy`,`isMemo`,`isPortal`,`isProfiler`,`isStrictMode`,`isSuspense`,`isSuspenseList`,`isValidElementType`].map(e=>[e,t=>oe[e](t)||ne[e](t)]));function getChildren(e,t=[]){if(Array.isArray(e))for(let r of e)getChildren(r,t);else e!=null&&e!==!1&&e!==``&&t.push(e);return t}function getType(e){let t=e.type;if(typeof t==`string`)return t;if(typeof t==`function`)return t.displayName||t.name||`Unknown`;if(O.isFragment(e))return`React.Fragment`;if(O.isSuspense(e))return`React.Suspense`;if(typeof t==`object`&&t){if(O.isContextProvider(e))return`Context.Provider`;if(O.isContextConsumer(e))return`Context.Consumer`;if(O.isForwardRef(e)){if(t.displayName)return t.displayName;let e=t.render.displayName||t.render.name||``;return e===``?`ForwardRef`:`ForwardRef(${e})`}if(O.isMemo(e)){let e=t.displayName||t.type.displayName||t.type.name||``;return e===``?`Memo`:`Memo(${e})`}}return`UNDEFINED`}function getPropKeys$1(e){let{props:t}=e;return Object.keys(t).filter(e=>e!==`children`&&t[e]!==void 0).sort()}const serialize$1=(e,t,r,o,s,c)=>++o>t.maxDepth?printElementAsLeaf(getType(e),t):printElement(getType(e),printProps(getPropKeys$1(e),e.props,t,r+t.indent,o,s,c),printChildren(getChildren(e.props.children),t,r+t.indent,o,s,c),t,r),test$1=e=>e!=null&&O.isElement(e),se={serialize:serialize$1,test:test$1},ce=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.test.json`):245830487;function getPropKeys(e){let{props:t}=e;return t?Object.keys(t).filter(e=>t[e]!==void 0).sort():[]}const serialize=(e,t,r,o,s,c)=>++o>t.maxDepth?printElementAsLeaf(e.type,t):printElement(e.type,e.props?printProps(getPropKeys(e),e.props,t,r+t.indent,o,s,c):``,e.children?printChildren(e.children,t,r+t.indent,o,s,c):``,t,r),le={serialize,test:e(e=>e&&e.$$typeof===ce,`test`)},ue=Object.prototype.toString,de=Date.prototype.toISOString,fe=Error.prototype.toString,pe=RegExp.prototype.toString;function getConstructorName(e){return typeof e.constructor==`function`&&e.constructor.name||`Object`}function isWindow(e){return typeof window<`u`&&e===window}const me=/^Symbol\((.*)\)(.*)$/,he=/\n/g;var PrettyFormatPluginError=class extends Error{constructor(e,t){super(e),this.stack=t,this.name=this.constructor.name}};function isToStringedArrayType(e){return e===`[object Array]`||e===`[object ArrayBuffer]`||e===`[object DataView]`||e===`[object Float32Array]`||e===`[object Float64Array]`||e===`[object Int8Array]`||e===`[object Int16Array]`||e===`[object Int32Array]`||e===`[object Uint8Array]`||e===`[object Uint8ClampedArray]`||e===`[object Uint16Array]`||e===`[object Uint32Array]`}function printNumber(e){return Object.is(e,-0)?`-0`:String(e)}function printBigInt(e){return String(`${e}n`)}function printFunction(e,t){return t?`[Function ${e.name||`anonymous`}]`:`[Function]`}function printSymbol(e){return String(e).replace(me,`Symbol($1)`)}function printError(e){return`[${fe.call(e)}]`}function printBasicValue(e,t,r,o){if(e===!0||e===!1)return`${e}`;if(e===void 0)return`undefined`;if(e===null)return`null`;let s=typeof e;if(s===`number`)return printNumber(e);if(s===`bigint`)return printBigInt(e);if(s===`string`)return o?`"${e.replaceAll(/"|\\/g,`\\$&`)}"`:`"${e}"`;if(s===`function`)return printFunction(e,t);if(s===`symbol`)return printSymbol(e);let c=ue.call(e);return c===`[object WeakMap]`?`WeakMap {}`:c===`[object WeakSet]`?`WeakSet {}`:c===`[object Function]`||c===`[object GeneratorFunction]`?printFunction(e,t):c===`[object Symbol]`?printSymbol(e):c===`[object Date]`?Number.isNaN(+e)?`Date { NaN }`:de.call(e):c===`[object Error]`?printError(e):c===`[object RegExp]`?r?pe.call(e).replaceAll(/[$()*+.?[\\\]^{|}]/g,`\\$&`):pe.call(e):e instanceof Error?printError(e):null}function printComplexValue(e,t,r,o,s,c){if(s.includes(e))return`[Circular]`;s=[...s],s.push(e);let u=++o>t.maxDepth,d=t.min;if(t.callToJSON&&!u&&e.toJSON&&typeof e.toJSON==`function`&&!c)return printer(e.toJSON(),t,r,o,s,!0);let p=ue.call(e);return p===`[object Arguments]`?u?`[Arguments]`:`${d?``:`Arguments `}[${printListItems(e,t,r,o,s,printer)}]`:isToStringedArrayType(p)?u?`[${e.constructor.name}]`:`${d||!t.printBasicPrototype&&e.constructor.name===`Array`?``:`${e.constructor.name} `}[${printListItems(e,t,r,o,s,printer)}]`:p===`[object Map]`?u?`[Map]`:`Map {${printIteratorEntries(e.entries(),t,r,o,s,printer,` => `)}}`:p===`[object Set]`?u?`[Set]`:`Set {${printIteratorValues(e.values(),t,r,o,s,printer)}}`:u||isWindow(e)?`[${getConstructorName(e)}]`:`${d||!t.printBasicPrototype&&getConstructorName(e)===`Object`?``:`${getConstructorName(e)} `}{${printObjectProperties(e,t,r,o,s,printer)}}`}const ge={test:e=>e&&e instanceof Error,serialize(e,t,r,o,s,c){if(s.includes(e))return`[Circular]`;s=[...s,e];let u=++o>t.maxDepth,{message:d,cause:p,...m}=e,h={message:d,...p===void 0?{}:{cause:p},...e instanceof AggregateError?{errors:e.errors}:{},...m},g=e.name===`Error`?getConstructorName(e):e.name;return u?`[${g}]`:`${g} {${printIteratorEntries(Object.entries(h).values(),t,r,o,s,c)}}`}};function isNewPlugin(e){return e.serialize!=null}function printPlugin(e,t,r,o,s,c){let u;try{u=isNewPlugin(e)?e.serialize(t,r,o,s,c,printer):e.print(t,e=>printer(e,r,o,s,c),e=>{let t=o+r.indent;return t+e.replaceAll(he,`\n${t}`)},{edgeSpacing:r.spacingOuter,min:r.min,spacing:r.spacingInner},r.colors)}catch(e){throw new PrettyFormatPluginError(e.message,e.stack)}if(typeof u!=`string`)throw TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof u}".`);return u}function findPlugin(e,t){for(let r of e)try{if(r.test(t))return r}catch(e){throw new PrettyFormatPluginError(e.message,e.stack)}return null}function printer(e,t,r,o,s,c){let u,d=findPlugin(t.plugins,e);if(d!==null)u=printPlugin(d,e,t,r,o,s);else{let d=printBasicValue(e,t.printFunctionName,t.escapeRegex,t.escapeString);u=d===null?printComplexValue(e,t,r,o,s,c):d}return t._outputLengthPerDepth[o]??=0,t._outputLengthPerDepth[o]+=u.length,t._outputLengthPerDepth[o]>t.maxOutputLength&&(t.maxDepth=0),u}const k={comment:`gray`,content:`reset`,prop:`yellow`,tag:`cyan`,value:`green`},A=Object.keys(k),j={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:1/0,maxOutputLength:1e6,maxWidth:1/0,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,printShadowRoot:!0,theme:k};function validateOptions(e){for(let t of Object.keys(e))if(!Object.hasOwn(j,t))throw Error(`pretty-format: Unknown option "${t}".`);if(e.min&&e.indent!==void 0&&e.indent!==0)throw Error(`pretty-format: Options "min" and "indent" cannot be used together.`)}function getColorsHighlight(){return A.reduce((e,t)=>{let r=k[t],o=r&&u[r];if(o&&typeof o.close==`string`&&typeof o.open==`string`)e[t]=o;else throw Error(`pretty-format: Option "theme" has a key "${t}" whose value "${r}" is undefined in ansi-styles.`);return e},Object.create(null))}function getColorsEmpty(){return A.reduce((e,t)=>(e[t]={close:``,open:``},e),Object.create(null))}function getPrintFunctionName(e){return e?.printFunctionName??j.printFunctionName}function getEscapeRegex(e){return e?.escapeRegex??j.escapeRegex}function getEscapeString(e){return e?.escapeString??j.escapeString}function getConfig(e){return{callToJSON:e?.callToJSON??j.callToJSON,colors:e?.highlight?getColorsHighlight():getColorsEmpty(),compareKeys:typeof e?.compareKeys==`function`||e?.compareKeys===null?e.compareKeys:j.compareKeys,escapeRegex:getEscapeRegex(e),escapeString:getEscapeString(e),indent:e?.min?``:createIndent(e?.indent??j.indent),maxDepth:e?.maxDepth??j.maxDepth,maxWidth:e?.maxWidth??j.maxWidth,min:e?.min??j.min,plugins:e?.plugins??j.plugins,printBasicPrototype:e?.printBasicPrototype??!0,printFunctionName:getPrintFunctionName(e),printShadowRoot:e?.printShadowRoot??!0,spacingInner:e?.min?` `:`
|
|
3
3
|
`,spacingOuter:e?.min?``:`
|
|
4
4
|
`,maxOutputLength:e?.maxOutputLength??j.maxOutputLength,_outputLengthPerDepth:[]}}function createIndent(e){return Array.from({length:e+1}).join(` `)}function format$1(e,t){if(t&&(validateOptions(t),t.plugins)){let r=findPlugin(t.plugins,e);if(r!==null)return printPlugin(r,e,getConfig(t),``,0,[])}let r=printBasicValue(e,getPrintFunctionName(t),getEscapeRegex(t),getEscapeString(t));return r===null?printComplexValue(e,getConfig(t),``,0,[]):r}e(format$1,`format`);const _e={AsymmetricMatcher:p,DOMCollection:g,DOMElement:y,Immutable:x,ReactElement:se,ReactTestComponent:le,Error:ge},M={bold:[`1`,`22`],dim:[`2`,`22`],italic:[`3`,`23`],underline:[`4`,`24`],inverse:[`7`,`27`],hidden:[`8`,`28`],strike:[`9`,`29`],black:[`30`,`39`],red:[`31`,`39`],green:[`32`,`39`],yellow:[`33`,`39`],blue:[`34`,`39`],magenta:[`35`,`39`],cyan:[`36`,`39`],white:[`37`,`39`],brightblack:[`30;1`,`39`],brightred:[`31;1`,`39`],brightgreen:[`32;1`,`39`],brightyellow:[`33;1`,`39`],brightblue:[`34;1`,`39`],brightmagenta:[`35;1`,`39`],brightcyan:[`36;1`,`39`],brightwhite:[`37;1`,`39`],grey:[`90`,`39`]},ve={special:`cyan`,number:`yellow`,bigint:`yellow`,boolean:`yellow`,undefined:`grey`,null:`bold`,string:`green`,symbol:`green`,date:`magenta`,regexp:`red`};function colorise(e,t){let r=M[ve[t]]||M[t]||``;return r?`\u001b[${r[0]}m${String(e)}\u001b[${r[1]}m`:String(e)}function normaliseOptions({showHidden:e=!1,depth:t=2,colors:r=!1,customInspect:o=!0,showProxy:s=!1,maxArrayLength:c=1/0,breakLength:u=1/0,seen:d=[],truncate:p=1/0,stylize:m=String}={},h){let g={showHidden:!!e,depth:Number(t),colors:!!r,customInspect:!!o,showProxy:!!s,maxArrayLength:Number(c),breakLength:Number(u),truncate:Number(p),seen:d,inspect:h,stylize:m};return g.colors&&(g.stylize=colorise),g}function isHighSurrogate(e){return e>=`\ud800`&&e<=`\udbff`}function truncate(e,t,r=`…`){e=String(e);let o=r.length,s=e.length;if(o>t&&s>o)return r;if(s>t&&s>o){let s=t-o;return s>0&&isHighSurrogate(e[s-1])&&--s,`${e.slice(0,s)}${r}`}return e}function inspectList(e,t,r,o=`, `){r||=t.inspect;let s=e.length;if(s===0)return``;let c=t.truncate,u=``,d=``,p=``;for(let m=0;m<s;m+=1){let s=m+1===e.length,h=m+2===e.length;p=`…(${e.length-m})`;let g=e[m];t.truncate=c-u.length-(s?0:o.length);let _=d||r(g,t)+(s?``:o),y=u.length+_.length,b=y+p.length;if(s&&y>c&&u.length+p.length<=c||!s&&!h&&b>c||(d=s?``:r(e[m+1],t)+(h?``:o),!s&&h&&b>c&&y+d.length>c))break;if(u+=_,!s&&!h&&y+d.length>=c){p=`…(${e.length-m-1})`;break}p=``}return`${u}${p}`}function quoteComplexKey(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,`\\'`).replace(/\\"/g,`"`).replace(/(^"|"$)/g,`'`)}function inspectProperty([e,t],r){return r.truncate-=2,typeof e==`string`?e=quoteComplexKey(e):typeof e!=`number`&&(e=`[${r.inspect(e,r)}]`),r.truncate-=e.length,t=r.inspect(t,r),`${e}: ${t}`}function inspectArray(e,t){let r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return`[]`;t.truncate-=4;let o=inspectList(e,t);t.truncate-=o.length;let s=``;return r.length&&(s=inspectList(r.map(t=>[t,e[t]]),t,inspectProperty)),`[ ${o}${s?`, ${s}`:``} ]`}const getArrayName=e=>typeof Buffer==`function`&&e instanceof Buffer?`Buffer`:e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name;function inspectTypedArray(e,t){let r=getArrayName(e);t.truncate-=r.length+4;let o=Object.keys(e).slice(e.length);if(!e.length&&!o.length)return`${r}[]`;let s=``;for(let r=0;r<e.length;r++){let o=`${t.stylize(truncate(e[r],t.truncate),`number`)}${r===e.length-1?``:`, `}`;if(t.truncate-=o.length,e[r]!==e.length&&t.truncate<=3){s+=`…(${e.length-e[r]+1})`;break}s+=o}let c=``;return o.length&&(c=inspectList(o.map(t=>[t,e[t]]),t,inspectProperty)),`${r}[ ${s}${c?`, ${c}`:``} ]`}function inspectDate(e,t){let r=e.toJSON();if(r===null)return`Invalid Date`;let o=r.split(`T`),s=o[0];return t.stylize(`${s}T${truncate(o[1],t.truncate-s.length-1)}`,`date`)}function inspectFunction(e,t){let r=e[Symbol.toStringTag]||`Function`,o=e.name;return o?t.stylize(`[${r} ${truncate(o,t.truncate-11)}]`,`special`):t.stylize(`[${r}]`,`special`)}function inspectMapEntry([e,t],r){return r.truncate-=4,e=r.inspect(e,r),r.truncate-=e.length,t=r.inspect(t,r),`${e} => ${t}`}function mapToEntries(e){let t=[];return e.forEach((e,r)=>{t.push([r,e])}),t}function inspectMap(e,t){return e.size===0?`Map{}`:(t.truncate-=7,`Map{ ${inspectList(mapToEntries(e),t,inspectMapEntry)} }`)}const ye=Number.isNaN||(e=>e!==e);function inspectNumber(e,t){return ye(e)?t.stylize(`NaN`,`number`):e===1/0?t.stylize(`Infinity`,`number`):e===-1/0?t.stylize(`-Infinity`,`number`):e===0?t.stylize(1/e==1/0?`+0`:`-0`,`number`):t.stylize(truncate(String(e),t.truncate),`number`)}function inspectBigInt(e,t){let r=truncate(e.toString(),t.truncate-1);return r!==`…`&&(r+=`n`),t.stylize(r,`bigint`)}function inspectRegExp(e,t){let r=e.toString().split(`/`)[2],o=t.truncate-(2+r.length),s=e.source;return t.stylize(`/${truncate(s,o)}/${r}`,`regexp`)}function arrayFromSet(e){let t=[];return e.forEach(e=>{t.push(e)}),t}function inspectSet(e,t){return e.size===0?`Set{}`:(t.truncate-=7,`Set{ ${inspectList(arrayFromSet(e),t)} }`)}const N=RegExp(`['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]`,`g`),be={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,"'":`\\'`,"\\":`\\\\`};function escape(e){return be[e]||`\\u${`0000${e.charCodeAt(0).toString(16)}`.slice(-4)}`}function inspectString(e,t){return N.test(e)&&(e=e.replace(N,escape)),t.stylize(`'${truncate(e,t.truncate-2)}'`,`string`)}function inspectSymbol(e){return`description`in Symbol.prototype?e.description?`Symbol(${e.description})`:`Symbol()`:e.toString()}const getPromiseValue=()=>`Promise{…}`;function inspectObject$1(e,t){let r=Object.getOwnPropertyNames(e),o=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(r.length===0&&o.length===0)return`{}`;if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return`[Circular]`;t.seen.push(e);let s=inspectList(r.map(t=>[t,e[t]]),t,inspectProperty),c=inspectList(o.map(t=>[t,e[t]]),t,inspectProperty);t.seen.pop();let u=``;return s&&c&&(u=`, `),`{ ${s}${u}${c} }`}const P=typeof Symbol<`u`&&Symbol.toStringTag?Symbol.toStringTag:!1;function inspectClass(e,t){let r=``;return P&&P in e&&(r=e[P]),r||=e.constructor.name,(!r||r===`_class`)&&(r=`<Anonymous Class>`),t.truncate-=r.length,`${r}${inspectObject$1(e,t)}`}function inspectArguments(e,t){return e.length===0?`Arguments[]`:(t.truncate-=13,`Arguments[ ${inspectList(e,t)} ]`)}const xe=[`stack`,`line`,`column`,`name`,`message`,`fileName`,`lineNumber`,`columnNumber`,`number`,`description`,`cause`];function inspectObject(e,t){let r=Object.getOwnPropertyNames(e).filter(e=>xe.indexOf(e)===-1),o=e.name;t.truncate-=o.length;let s=``;if(typeof e.message==`string`?s=truncate(e.message,t.truncate):r.unshift(`message`),s=s?`: ${s}`:``,t.truncate-=s.length+5,t.seen=t.seen||[],t.seen.includes(e))return`[Circular]`;t.seen.push(e);let c=inspectList(r.map(t=>[t,e[t]]),t,inspectProperty);return`${o}${s}${c?` { ${c} }`:``}`}function inspectAttribute([e,t],r){return r.truncate-=3,t?`${r.stylize(String(e),`yellow`)}=${r.stylize(`"${t}"`,`string`)}`:`${r.stylize(String(e),`yellow`)}`}function inspectNodeCollection(e,t){return inspectList(e,t,inspectNode,`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{useBreakpoint as e}from"./use-breakpoint.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{useBreakpoint as e}from"./use-breakpoint.js";import{r as t,t as n}from"../react.esm-B3a5z6DL.js";describe(`useBreakpoint`,()=>{it(`returns true for the base breakpoint`,()=>{globalThis.setTestViewportWidth(320);let{result:n}=t(()=>e(`base`));expect(n.current).toBe(!0)}),it(`returns false below the requested breakpoint`,()=>{globalThis.setTestViewportWidth(767);let{result:n}=t(()=>e(`md`));expect(n.current).toBe(!1)}),it(`returns true at the requested breakpoint`,()=>{globalThis.setTestViewportWidth(768);let{result:n}=t(()=>e(`md`));expect(n.current).toBe(!0)}),it(`returns true above the requested breakpoint`,()=>{globalThis.setTestViewportWidth(900);let{result:n}=t(()=>e(`md`));expect(n.current).toBe(!0)}),it(`updates when the media query changes`,()=>{globalThis.setTestViewportWidth(1024);let{result:r}=t(()=>e(`lg`));expect(r.current).toBe(!0),n(()=>{globalThis.setTestViewportWidth(900)}),expect(r.current).toBe(!1),n(()=>{globalThis.setTestViewportWidth(1200)}),expect(r.current).toBe(!0)}),it(`removes the media query listener on unmount`,()=>{let n=vi.fn();vi.spyOn(window,`matchMedia`).mockReturnValue({matches:!1,media:`(min-width: 768px)`,onchange:null,addEventListener:vi.fn(),removeEventListener:n,dispatchEvent:vi.fn(),addListener:vi.fn(),removeListener:vi.fn()});let{unmount:r}=t(()=>e(`md`));r(),expect(n).toHaveBeenCalledWith(`change`,expect.any(Function))})});
|
|
2
2
|
//# sourceMappingURL=use-breakpoint.spec.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{useDisclosure as e}from"./use-disclosure.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{useDisclosure as e}from"./use-disclosure.js";import{r as t,t as n}from"../react.esm-B3a5z6DL.js";describe(`useDisclosure`,()=>{it(`uses false as the default initial state`,()=>{let{result:n}=t(()=>e());expect(n.current[0]).toBe(!1)}),it(`uses the provided initial state`,()=>{let{result:n}=t(()=>e(!0));expect(n.current[0]).toBe(!0)}),it(`opens, closes, toggles, and sets the state`,()=>{let{result:r}=t(()=>e());n(()=>r.current[1].open()),expect(r.current[0]).toBe(!0),n(()=>r.current[1].close()),expect(r.current[0]).toBe(!1),n(()=>r.current[1].toggle()),expect(r.current[0]).toBe(!0),n(()=>r.current[1].set(!1)),expect(r.current[0]).toBe(!1)}),it(`calls callbacks only when state transitions happen`,()=>{let r=vi.fn(),i=vi.fn(),{result:a}=t(()=>e(!1,{onOpen:r,onClose:i}));n(()=>a.current[1].close()),expect(i).not.toHaveBeenCalled(),n(()=>a.current[1].open()),n(()=>a.current[1].open()),expect(r).toHaveBeenCalledTimes(1),n(()=>a.current[1].close()),n(()=>a.current[1].close()),expect(i).toHaveBeenCalledTimes(1)})});
|
|
2
2
|
//# sourceMappingURL=use-disclosure.spec.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{useDocumentVisibility as e}from"./use-document-visibility.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{useDocumentVisibility as e}from"./use-document-visibility.js";import{r as t,t as n}from"../react.esm-B3a5z6DL.js";function setDocumentVisibility(e){Object.defineProperty(document,`visibilityState`,{configurable:!0,get:()=>e})}describe(`useDocumentVisibility`,()=>{it(`uses the current document visibility on mount`,()=>{setDocumentVisibility(`hidden`);let{result:n}=t(()=>e());expect(n.current).toBe(`hidden`)}),it(`updates when the document visibility changes`,()=>{setDocumentVisibility(`visible`);let{result:r}=t(()=>e());n(()=>{setDocumentVisibility(`hidden`),document.dispatchEvent(new Event(`visibilitychange`))}),expect(r.current).toBe(`hidden`)}),it(`removes the visibility listener on unmount`,()=>{let n=vi.spyOn(document,`removeEventListener`),{unmount:r}=t(()=>e());r(),expect(n).toHaveBeenCalledWith(`visibilitychange`,expect.any(Function))})});
|
|
2
2
|
//# sourceMappingURL=use-document-visibility.spec.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{useIdle as e}from"./use-idle.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{useIdle as e}from"./use-idle.js";import{r as t,t as n}from"../react.esm-B3a5z6DL.js";describe(`useIdle`,()=>{it(`starts idle by default`,()=>{vi.useFakeTimers();let{result:n}=t(()=>e(1e3));expect(n.current).toBe(!0)}),it(`supports a custom initial state and becomes idle after the timeout`,()=>{vi.useFakeTimers();let{result:r}=t(()=>e(1e3,{initialState:!1}));expect(r.current).toBe(!1),n(()=>{vi.advanceTimersByTime(1e3)}),expect(r.current).toBe(!0)}),it(`becomes active on configured events and returns to idle after the timeout`,()=>{vi.useFakeTimers();let{result:r}=t(()=>e(1e3,{events:[`click`]}));n(()=>{document.dispatchEvent(new Event(`click`))}),expect(r.current).toBe(!1),n(()=>{vi.advanceTimersByTime(999)}),expect(r.current).toBe(!1),n(()=>{vi.advanceTimersByTime(1)}),expect(r.current).toBe(!0)}),it(`registers and removes only the configured event listeners`,()=>{vi.useFakeTimers();let n=vi.spyOn(document,`addEventListener`),r=vi.spyOn(document,`removeEventListener`),{unmount:i}=t(()=>e(1e3,{events:[`click`,`keydown`]}));expect(n).toHaveBeenCalledWith(`click`,expect.any(Function)),expect(n).toHaveBeenCalledWith(`keydown`,expect.any(Function)),expect(n).not.toHaveBeenCalledWith(`mousemove`,expect.any(Function)),i(),expect(r).toHaveBeenCalledWith(`click`,expect.any(Function)),expect(r).toHaveBeenCalledWith(`keydown`,expect.any(Function))}),it(`clears pending timers on unmount`,()=>{vi.useFakeTimers();let n=vi.spyOn(window,`clearTimeout`),{unmount:r}=t(()=>e(1e3));r(),expect(n).toHaveBeenCalled()})});
|
|
2
2
|
//# sourceMappingURL=use-idle.spec.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{useInterval as e}from"./use-interval.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{useInterval as e}from"./use-interval.js";import{r as t,t as n}from"../react.esm-B3a5z6DL.js";describe(`useInterval`,()=>{it(`does not start by default`,()=>{vi.useFakeTimers();let r=vi.fn(),{result:i}=t(()=>e(r,1e3));expect(i.current.active).toBe(!1),n(()=>{vi.advanceTimersByTime(1e3)}),expect(r).not.toHaveBeenCalled()}),it(`starts and stops the interval`,()=>{vi.useFakeTimers();let r=vi.fn(),{result:i}=t(()=>e(r,1e3));n(()=>i.current.start()),expect(i.current.active).toBe(!0),n(()=>{vi.advanceTimersByTime(3e3)}),expect(r).toHaveBeenCalledTimes(3),n(()=>i.current.stop()),expect(i.current.active).toBe(!1),n(()=>{vi.advanceTimersByTime(1e3)}),expect(r).toHaveBeenCalledTimes(3)}),it(`toggles the interval`,()=>{vi.useFakeTimers();let r=vi.fn(),{result:i}=t(()=>e(r,1e3));n(()=>i.current.toggle()),expect(i.current.active).toBe(!0),n(()=>{vi.advanceTimersByTime(1e3)}),expect(r).toHaveBeenCalledTimes(1),n(()=>i.current.toggle()),expect(i.current.active).toBe(!1),n(()=>{vi.advanceTimersByTime(1e3)}),expect(r).toHaveBeenCalledTimes(1)}),it(`starts automatically when autoInvoke is enabled`,()=>{vi.useFakeTimers();let r=vi.fn(),{result:i}=t(()=>e(r,1e3,{autoInvoke:!0}));expect(i.current.active).toBe(!0),n(()=>{vi.advanceTimersByTime(1e3)}),expect(r).toHaveBeenCalledTimes(1)}),it(`uses the latest callback after rerendering`,()=>{vi.useFakeTimers();let r=vi.fn(),i=vi.fn(),{result:a,rerender:o}=t(({callback:t})=>e(t,1e3),{initialProps:{callback:r}});n(()=>a.current.start()),n(()=>{vi.advanceTimersByTime(1e3)}),o({callback:i}),n(()=>{vi.advanceTimersByTime(1e3)}),expect(r).toHaveBeenCalledTimes(1),expect(i).toHaveBeenCalledTimes(1)}),it(`cleans the interval on unmount`,()=>{vi.useFakeTimers();let r=vi.fn(),{result:i,unmount:a}=t(()=>e(r,1e3));n(()=>i.current.start()),a(),n(()=>{vi.advanceTimersByTime(1e3)}),expect(r).not.toHaveBeenCalled()})});
|
|
2
2
|
//# sourceMappingURL=use-interval.spec.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{useLocalStorage as e}from"./use-local-storage.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{useLocalStorage as e}from"./use-local-storage.js";import{r as t,t as n}from"../react.esm-B3a5z6DL.js";describe(`useLocalStorage`,()=>{it(`returns the default value when storage is empty`,()=>{let{result:n}=t(()=>e(`settings`,{defaultValue:{compact:!1}}));expect(n.current[0]).toEqual({compact:!1})}),it(`reads an existing JSON value from localStorage`,()=>{window.localStorage.setItem(`settings`,JSON.stringify({compact:!0}));let{result:n}=t(()=>e(`settings`,{defaultValue:{compact:!1}}));expect(n.current[0]).toEqual({compact:!0})}),it(`writes serialized values to localStorage`,()=>{let{result:r}=t(()=>e(`settings`,{defaultValue:{compact:!1}}));n(()=>r.current[1]({compact:!0})),expect(r.current[0]).toEqual({compact:!0}),expect(window.localStorage.getItem(`settings`)).toBe(JSON.stringify({compact:!0}))}),it(`supports functional updates`,()=>{let{result:r}=t(()=>e(`count`,{defaultValue:1}));n(()=>r.current[1](e=>e+1)),expect(r.current[0]).toBe(2),expect(window.localStorage.getItem(`count`)).toBe(`2`)}),it(`syncs updates from storage events for the same key`,()=>{let{result:r}=t(()=>e(`settings`,{defaultValue:{compact:!1}}));n(()=>{window.dispatchEvent(new StorageEvent(`storage`,{key:`settings`,newValue:JSON.stringify({compact:!0}),storageArea:window.localStorage}))}),expect(r.current[0]).toEqual({compact:!0})}),it(`ignores storage events for other keys`,()=>{let{result:r}=t(()=>e(`settings`,{defaultValue:{compact:!1}}));n(()=>{window.dispatchEvent(new StorageEvent(`storage`,{key:`profile`,newValue:JSON.stringify({compact:!0}),storageArea:window.localStorage}))}),expect(r.current[0]).toEqual({compact:!1})}),it(`does not subscribe to storage events when sync is disabled`,()=>{let{result:r}=t(()=>e(`settings`,{defaultValue:{compact:!1},sync:!1}));n(()=>{window.dispatchEvent(new StorageEvent(`storage`,{key:`settings`,newValue:JSON.stringify({compact:!0}),storageArea:window.localStorage}))}),expect(r.current[0]).toEqual({compact:!1})})});
|
|
2
2
|
//# sourceMappingURL=use-local-storage.spec.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunk-CHh1Zzun.js";import{useIsMobile as e}from"./use-mobile.js";import{
|
|
1
|
+
import"../chunk-CHh1Zzun.js";import{useIsMobile as e}from"./use-mobile.js";import{r as t,t as n}from"../react.esm-B3a5z6DL.js";describe(`useIsMobile`,()=>{it(`returns true below the mobile breakpoint`,()=>{globalThis.setTestViewportWidth(767);let{result:n}=t(()=>e());expect(n.current).toBe(!0)}),it(`returns false at the mobile breakpoint`,()=>{globalThis.setTestViewportWidth(768);let{result:n}=t(()=>e());expect(n.current).toBe(!1)}),it(`updates when the media query changes`,()=>{globalThis.setTestViewportWidth(1024);let{result:r}=t(()=>e());expect(r.current).toBe(!1),n(()=>{globalThis.setTestViewportWidth(500)}),expect(r.current).toBe(!0),n(()=>{globalThis.setTestViewportWidth(900)}),expect(r.current).toBe(!1)}),it(`removes the media query listener on unmount`,()=>{let n=vi.fn();vi.spyOn(window,`matchMedia`).mockReturnValue({matches:!1,media:`(max-width: 767px)`,onchange:null,addEventListener:vi.fn(),removeEventListener:n,dispatchEvent:vi.fn(),addListener:vi.fn(),removeListener:vi.fn()});let{unmount:r}=t(()=>e());r(),expect(n).toHaveBeenCalledWith(`change`,expect.any(Function))})});
|
|
2
2
|
//# sourceMappingURL=use-mobile.spec.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ import { RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps } from
|
|
|
46
46
|
import { ResizableHandle, ResizableHandleProps, ResizablePanel, ResizablePanelGroup, ResizablePanelGroupProps, ResizablePanelProps } from "./components/resizable.js";
|
|
47
47
|
import { ScrollArea, ScrollAreaProps, ScrollBar, ScrollBarProps } from "./components/scroll-area.js";
|
|
48
48
|
import { Select, SelectContent, SelectContentProps, SelectGroup, SelectGroupProps, SelectItem, SelectItemProps, SelectLabel, SelectLabelProps, SelectProps, SelectScrollDownButton, SelectScrollDownButtonProps, SelectScrollUpButton, SelectScrollUpButtonProps, SelectSeparator, SelectSeparatorProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps } from "./components/select.js";
|
|
49
|
-
import { Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipTrigger, TooltipTriggerProps } from "./components/tooltip.js";
|
|
49
|
+
import { Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipRoot, TooltipRootProps, TooltipTrigger, TooltipTriggerProps } from "./components/tooltip.js";
|
|
50
50
|
import { Sidebar, SidebarContent, SidebarContentProps, SidebarFooter, SidebarFooterProps, SidebarGroup, SidebarGroupAction, SidebarGroupActionProps, SidebarGroupContent, SidebarGroupContentProps, SidebarGroupLabel, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeader, SidebarHeaderProps, SidebarInput, SidebarInputProps, SidebarInset, SidebarInsetProps, SidebarMenu, SidebarMenuAction, SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuBadgeProps, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeleton, SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailProps, SidebarSeparator, SidebarSeparatorProps, SidebarTrigger, SidebarTriggerProps, useSidebar } from "./components/sidebar.js";
|
|
51
51
|
import { SimpleGrid, SimpleGridProps } from "./components/simple-grid.js";
|
|
52
52
|
import { Skeleton, SkeletonProps } from "./components/skeleton.js";
|
|
@@ -63,6 +63,7 @@ import { ModeToggle, ModeToggleProps, Theme, ThemeProvider, ThemeProviderProps,
|
|
|
63
63
|
import { Timeline, TimelineConnector, TimelineConnectorColor, TimelineConnectorProps, TimelineContent, TimelineContentProps, TimelineDescription, TimelineDescriptionProps, TimelineEmpty, TimelineEmptyProps, TimelineHeader, TimelineHeaderProps, TimelineIcon, TimelineIconColor, TimelineIconProps, TimelineIconSize, TimelineItem, TimelineItemProps, TimelineProps, TimelineStatus, TimelineTime, TimelineTimeProps, TimelineTitle, TimelineTitleProps, timelineVariants } from "./components/timeline.js";
|
|
64
64
|
import { Toggle, ToggleProps, toggleVariants } from "./components/toggle.js";
|
|
65
65
|
import { ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps } from "./components/toggle-group.js";
|
|
66
|
+
import { UnstyledButton, UnstyledButtonProps } from "./components/unstyled-button.js";
|
|
66
67
|
import { Breakpoint, breakpointValues, useBreakpoint } from "./hooks/use-breakpoint.js";
|
|
67
68
|
import { HiddenFrom, HiddenFromProps, VisibleFrom, VisibleFromProps } from "./components/visibility.js";
|
|
68
69
|
import { ResponsiveValueMap, useBreakpointValue } from "./hooks/use-breakpoint-value.js";
|
|
@@ -74,4 +75,4 @@ import { UseLocalStorageOptions, useLocalStorage } from "./hooks/use-local-stora
|
|
|
74
75
|
import { useIsMobile } from "./hooks/use-mobile.js";
|
|
75
76
|
import { ButtonColor, buttonColorVariants } from "./lib/button.js";
|
|
76
77
|
import { cn, randomId } from "./lib/utils.js";
|
|
77
|
-
export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, Alert, AlertAction, AlertActionProps, AlertDescription, AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogActionProps, AlertDialogCancel, AlertDialogCancelProps, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogFooterProps, AlertDialogHeader, AlertDialogHeaderProps, AlertDialogMedia, AlertDialogMediaProps, AlertDialogOverlay, AlertDialogOverlayProps, AlertDialogPortal, AlertDialogPortalProps, AlertDialogProps, AlertDialogTitle, AlertDialogTitleProps, AlertDialogTrigger, AlertDialogTriggerProps, AlertProps, AlertTitle, AlertTitleProps, Anchor, AnchorProps, Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeProps, Bar, BarChart, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, Breakpoint, Button, ButtonColor, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, ButtonProps, Calendar, CalendarDayButton, CalendarDayButtonProps, CalendarProps, Card, CardAction, CardActionProps, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselApi, CarouselContent, CarouselContentProps, CarouselItem, CarouselItemProps, CarouselNext, CarouselNextProps, CarouselPrevious, CarouselPreviousProps, CarouselProps, CartesianGrid, Center, CenterProps, ChartConfig, ChartContainer, ChartContainerProps, ChartLegend, ChartLegendContent, ChartLegendContentProps, ChartLegendProps, ChartStyle, ChartStyleProps, ChartTooltip, ChartTooltipContent, ChartTooltipContentProps, ChartTooltipProps, Checkbox, CheckboxProps, Code, CodeProps, Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps, Combobox, ComboboxChip, ComboboxChipProps, ComboboxChips, ComboboxChipsInput, ComboboxChipsInputProps, ComboboxChipsProps, ComboboxClear, ComboboxClearProps, ComboboxCollection, ComboboxCollectionProps, ComboboxContent, ComboboxContentProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupProps, ComboboxInput, ComboboxInputProps, ComboboxItem, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxProps, ComboboxSeparator, ComboboxSeparatorProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps, Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandEmptyProps, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemProps, CommandList, CommandListProps, CommandProps, CommandSeparator, CommandSeparatorProps, CommandShortcut, CommandShortcutProps, Container, ContainerProps, DateRange, DateRangePicker, DateRangePickerActions, DateRangePickerActionsProps, DateRangePickerApply, DateRangePickerApplyProps, DateRangePickerCalendar, DateRangePickerCalendarProps, DateRangePickerContent, DateRangePickerContentProps, DateRangePickerDateFields, DateRangePickerDateFieldsProps, DateRangePickerPreset, DateRangePickerPresetOption, DateRangePickerPresetProps, DateRangePickerPresets, DateRangePickerPresetsProps, DateRangePickerProps, DateRangePickerReset, DateRangePickerResetProps, DateRangePickerTrigger, DateRangePickerTriggerProps, DateRangePickerValue, DateRangePickerValueProps, Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps, Drawer, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps, Dropzone, DropzoneArea, DropzoneAreaProps, DropzoneDescription, DropzoneDescriptionProps, DropzoneFileList, DropzoneFileListItem, DropzoneFileListItemProps, DropzoneFileListProps, DropzoneFileMessage, DropzoneFileMessageProps, DropzoneFileStatus, DropzoneMessage, DropzoneMessageProps, DropzoneProps, DropzoneRemoveFile, DropzoneRemoveFileProps, DropzoneRetryFile, DropzoneRetryFileProps, DropzoneTrigger, DropzoneTriggerProps, DropzoneUploadResult, DropzoneValidation, Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps, ErrorCode, Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, FileError, FileStatus, Grid, GridItem, GridItemProps, GridProps, Group, GroupProps, Heading, HeadingProps, HiddenFrom, HiddenFromProps, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, InfiniteProgress, InfiniteProgressProps, Input, InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupButton, InputGroupButtonProps, InputGroupInput, InputGroupInputProps, InputGroupProps, InputGroupText, InputGroupTextProps, InputGroupTextarea, InputGroupTextareaProps, InputOTP, InputOTPGroup, InputOTPGroupProps, InputOTPProps, InputOTPSeparator, InputOTPSeparatorProps, InputOTPSlot, InputOTPSlotProps, InputProps, Kbd, KbdGroup, KbdGroupProps, KbdProps, Label, LabelProps, List, ListIcon, ListIconProps, ListItem, ListItemProps, ListProps, ModeToggle, ModeToggleProps, NativeSelect, NativeSelectOptGroup, NativeSelectOptGroupProps, NativeSelectOption, NativeSelectOptionProps, NativeSelectProps, NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuIndicator, NavigationMenuIndicatorProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuList, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport, NavigationMenuViewportProps, Pagination, PaginationContent, PaginationContentProps, PaginationEllipsis, PaginationEllipsisProps, PaginationItem, PaginationItemProps, PaginationLink, PaginationLinkProps, PaginationNext, PaginationNextProps, PaginationPrevious, PaginationPreviousProps, PaginationProps, Popover, PopoverAnchor, PopoverAnchorProps, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTitle, PopoverTitleProps, PopoverTrigger, PopoverTriggerProps, Progress, ProgressProps, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps, ResizableHandle, ResizableHandleProps, ResizablePanel, ResizablePanelGroup, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveValueMap, ScrollArea, ScrollAreaProps, ScrollBar, ScrollBarProps, Select, SelectContent, SelectContentProps, SelectGroup, SelectGroupProps, SelectItem, SelectItemProps, SelectLabel, SelectLabelProps, SelectProps, SelectScrollDownButton, SelectScrollDownButtonProps, SelectScrollUpButton, SelectScrollUpButtonProps, SelectSeparator, SelectSeparatorProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps, Separator, SeparatorProps, Sidebar, SidebarContent, SidebarContentProps, SidebarFooter, SidebarFooterProps, SidebarGroup, SidebarGroupAction, SidebarGroupActionProps, SidebarGroupContent, SidebarGroupContentProps, SidebarGroupLabel, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeader, SidebarHeaderProps, SidebarInput, SidebarInputProps, SidebarInset, SidebarInsetProps, SidebarMenu, SidebarMenuAction, SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuBadgeProps, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeleton, SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailProps, SidebarSeparator, SidebarSeparatorProps, SidebarTrigger, SidebarTriggerProps, SimpleGrid, SimpleGridProps, Skeleton, SkeletonProps, Slider, SliderProps, Spinner, SpinnerProps, Stack, StackProps, Switch, SwitchProps, Table, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps, Text, TextProps, Textarea, TextareaProps, Theme, ThemeProvider, ThemeProviderProps, ThemeProviderState, Timeline, TimelineConnector, TimelineConnectorColor, TimelineConnectorProps, TimelineContent, TimelineContentProps, TimelineDescription, TimelineDescriptionProps, TimelineEmpty, TimelineEmptyProps, TimelineHeader, TimelineHeaderProps, TimelineIcon, TimelineIconColor, TimelineIconProps, TimelineIconSize, TimelineItem, TimelineItemProps, TimelineProps, TimelineStatus, TimelineTime, TimelineTimeProps, TimelineTitle, TimelineTitleProps, Toaster, ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleProps, Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipTrigger, TooltipTriggerProps, UIColor, UseDisclosureHandlers, UseDisclosureOptions, UseDisclosureReturnValue, UseDropzoneProps, UseDropzoneReturn, UseIdleOptions, UseIntervalOptions, UseIntervalReturnValue, UseLocalStorageOptions, VisibleFrom, VisibleFromProps, XAxis, anchorVariants, badgeVariants, breakpointValues, buttonColorVariants, buttonGroupVariants, buttonVariants, centerVariants, cn, containerVariants, groupVariants, headingVariants, listVariants, locale, navigationMenuTriggerStyle, randomId, selectionControlColorVariants, spinnerVariants, stackVariants, tabsListVariants, textVariants, timelineVariants, toast, toggleVariants, uiColors, useBreakpoint, useBreakpointValue, useCarousel, useComboboxAnchor, useDisclosure, useDocumentVisibility, useDropzone, useIdle, useInterval, useIsMobile, useLocalStorage, useSidebar, useTheme };
|
|
78
|
+
export { Accordion, AccordionContent, AccordionContentProps, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, AccordionTriggerProps, Alert, AlertAction, AlertActionProps, AlertDescription, AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogActionProps, AlertDialogCancel, AlertDialogCancelProps, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogFooterProps, AlertDialogHeader, AlertDialogHeaderProps, AlertDialogMedia, AlertDialogMediaProps, AlertDialogOverlay, AlertDialogOverlayProps, AlertDialogPortal, AlertDialogPortalProps, AlertDialogProps, AlertDialogTitle, AlertDialogTitleProps, AlertDialogTrigger, AlertDialogTriggerProps, AlertProps, AlertTitle, AlertTitleProps, Anchor, AnchorProps, Avatar, AvatarBadge, AvatarBadgeProps, AvatarFallback, AvatarFallbackProps, AvatarGroup, AvatarGroupCount, AvatarGroupCountProps, AvatarGroupProps, AvatarImage, AvatarImageProps, AvatarProps, Badge, BadgeProps, Bar, BarChart, Breadcrumb, BreadcrumbEllipsis, BreadcrumbEllipsisProps, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbListProps, BreadcrumbPage, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparator, BreadcrumbSeparatorProps, Breakpoint, Button, ButtonColor, ButtonGroup, ButtonGroupProps, ButtonGroupSeparator, ButtonGroupSeparatorProps, ButtonGroupText, ButtonGroupTextProps, ButtonProps, Calendar, CalendarDayButton, CalendarDayButtonProps, CalendarProps, Card, CardAction, CardActionProps, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselApi, CarouselContent, CarouselContentProps, CarouselItem, CarouselItemProps, CarouselNext, CarouselNextProps, CarouselPrevious, CarouselPreviousProps, CarouselProps, CartesianGrid, Center, CenterProps, ChartConfig, ChartContainer, ChartContainerProps, ChartLegend, ChartLegendContent, ChartLegendContentProps, ChartLegendProps, ChartStyle, ChartStyleProps, ChartTooltip, ChartTooltipContent, ChartTooltipContentProps, ChartTooltipProps, Checkbox, CheckboxProps, Code, CodeProps, Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps, Combobox, ComboboxChip, ComboboxChipProps, ComboboxChips, ComboboxChipsInput, ComboboxChipsInputProps, ComboboxChipsProps, ComboboxClear, ComboboxClearProps, ComboboxCollection, ComboboxCollectionProps, ComboboxContent, ComboboxContentProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupProps, ComboboxInput, ComboboxInputProps, ComboboxItem, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxProps, ComboboxSeparator, ComboboxSeparatorProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps, Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandEmptyProps, CommandGroup, CommandGroupProps, CommandInput, CommandInputProps, CommandItem, CommandItemProps, CommandList, CommandListProps, CommandProps, CommandSeparator, CommandSeparatorProps, CommandShortcut, CommandShortcutProps, Container, ContainerProps, DateRange, DateRangePicker, DateRangePickerActions, DateRangePickerActionsProps, DateRangePickerApply, DateRangePickerApplyProps, DateRangePickerCalendar, DateRangePickerCalendarProps, DateRangePickerContent, DateRangePickerContentProps, DateRangePickerDateFields, DateRangePickerDateFieldsProps, DateRangePickerPreset, DateRangePickerPresetOption, DateRangePickerPresetProps, DateRangePickerPresets, DateRangePickerPresetsProps, DateRangePickerProps, DateRangePickerReset, DateRangePickerResetProps, DateRangePickerTrigger, DateRangePickerTriggerProps, DateRangePickerValue, DateRangePickerValueProps, Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps, Drawer, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps, Dropzone, DropzoneArea, DropzoneAreaProps, DropzoneDescription, DropzoneDescriptionProps, DropzoneFileList, DropzoneFileListItem, DropzoneFileListItemProps, DropzoneFileListProps, DropzoneFileMessage, DropzoneFileMessageProps, DropzoneFileStatus, DropzoneMessage, DropzoneMessageProps, DropzoneProps, DropzoneRemoveFile, DropzoneRemoveFileProps, DropzoneRetryFile, DropzoneRetryFileProps, DropzoneTrigger, DropzoneTriggerProps, DropzoneUploadResult, DropzoneValidation, Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps, ErrorCode, Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, FileError, FileStatus, Grid, GridItem, GridItemProps, GridProps, Group, GroupProps, Heading, HeadingProps, HiddenFrom, HiddenFromProps, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, InfiniteProgress, InfiniteProgressProps, Input, InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupButton, InputGroupButtonProps, InputGroupInput, InputGroupInputProps, InputGroupProps, InputGroupText, InputGroupTextProps, InputGroupTextarea, InputGroupTextareaProps, InputOTP, InputOTPGroup, InputOTPGroupProps, InputOTPProps, InputOTPSeparator, InputOTPSeparatorProps, InputOTPSlot, InputOTPSlotProps, InputProps, Kbd, KbdGroup, KbdGroupProps, KbdProps, Label, LabelProps, List, ListIcon, ListIconProps, ListItem, ListItemProps, ListProps, ModeToggle, ModeToggleProps, NativeSelect, NativeSelectOptGroup, NativeSelectOptGroupProps, NativeSelectOption, NativeSelectOptionProps, NativeSelectProps, NavigationMenu, NavigationMenuContent, NavigationMenuContentProps, NavigationMenuIndicator, NavigationMenuIndicatorProps, NavigationMenuItem, NavigationMenuItemProps, NavigationMenuLink, NavigationMenuLinkProps, NavigationMenuList, NavigationMenuListProps, NavigationMenuProps, NavigationMenuTrigger, NavigationMenuTriggerProps, NavigationMenuViewport, NavigationMenuViewportProps, Pagination, PaginationContent, PaginationContentProps, PaginationEllipsis, PaginationEllipsisProps, PaginationItem, PaginationItemProps, PaginationLink, PaginationLinkProps, PaginationNext, PaginationNextProps, PaginationPrevious, PaginationPreviousProps, PaginationProps, Popover, PopoverAnchor, PopoverAnchorProps, PopoverContent, PopoverContentProps, PopoverDescription, PopoverDescriptionProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTitle, PopoverTitleProps, PopoverTrigger, PopoverTriggerProps, Progress, ProgressProps, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS, RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps, ResizableHandle, ResizableHandleProps, ResizablePanel, ResizablePanelGroup, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveValueMap, ScrollArea, ScrollAreaProps, ScrollBar, ScrollBarProps, Select, SelectContent, SelectContentProps, SelectGroup, SelectGroupProps, SelectItem, SelectItemProps, SelectLabel, SelectLabelProps, SelectProps, SelectScrollDownButton, SelectScrollDownButtonProps, SelectScrollUpButton, SelectScrollUpButtonProps, SelectSeparator, SelectSeparatorProps, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps, Separator, SeparatorProps, Sidebar, SidebarContent, SidebarContentProps, SidebarFooter, SidebarFooterProps, SidebarGroup, SidebarGroupAction, SidebarGroupActionProps, SidebarGroupContent, SidebarGroupContentProps, SidebarGroupLabel, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeader, SidebarHeaderProps, SidebarInput, SidebarInputProps, SidebarInset, SidebarInsetProps, SidebarMenu, SidebarMenuAction, SidebarMenuActionProps, SidebarMenuBadge, SidebarMenuBadgeProps, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuItem, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeleton, SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailProps, SidebarSeparator, SidebarSeparatorProps, SidebarTrigger, SidebarTriggerProps, SimpleGrid, SimpleGridProps, Skeleton, SkeletonProps, Slider, SliderProps, Spinner, SpinnerProps, Stack, StackProps, Switch, SwitchProps, Table, TableBody, TableBodyProps, TableCaption, TableCaptionProps, TableCell, TableCellProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TableHeader, TableHeaderProps, TableProps, TableRow, TableRowProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps, Text, TextProps, Textarea, TextareaProps, Theme, ThemeProvider, ThemeProviderProps, ThemeProviderState, Timeline, TimelineConnector, TimelineConnectorColor, TimelineConnectorProps, TimelineContent, TimelineContentProps, TimelineDescription, TimelineDescriptionProps, TimelineEmpty, TimelineEmptyProps, TimelineHeader, TimelineHeaderProps, TimelineIcon, TimelineIconColor, TimelineIconProps, TimelineIconSize, TimelineItem, TimelineItemProps, TimelineProps, TimelineStatus, TimelineTime, TimelineTimeProps, TimelineTitle, TimelineTitleProps, Toaster, ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupItemProps, ToggleGroupProps, ToggleProps, Tooltip, TooltipContent, TooltipContentProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipRoot, TooltipRootProps, TooltipTrigger, TooltipTriggerProps, UIColor, UnstyledButton, UnstyledButtonProps, UseDisclosureHandlers, UseDisclosureOptions, UseDisclosureReturnValue, UseDropzoneProps, UseDropzoneReturn, UseIdleOptions, UseIntervalOptions, UseIntervalReturnValue, UseLocalStorageOptions, VisibleFrom, VisibleFromProps, XAxis, anchorVariants, badgeVariants, breakpointValues, buttonColorVariants, buttonGroupVariants, buttonVariants, centerVariants, cn, containerVariants, groupVariants, headingVariants, listVariants, locale, navigationMenuTriggerStyle, randomId, selectionControlColorVariants, spinnerVariants, stackVariants, tabsListVariants, textVariants, timelineVariants, toast, toggleVariants, uiColors, useBreakpoint, useBreakpointValue, useCarousel, useComboboxAnchor, useDisclosure, useDocumentVisibility, useDropzone, useIdle, useInterval, useIsMobile, useLocalStorage, useSidebar, useTheme };
|