{"version":3,"file":"drawer-content.cjs","sources":["../../../components/drawer/drawer-content.tsx"],"sourcesContent":["'use client';\n\nimport { Drawer as DrawerPrimitive } from '@base-ui/react/drawer';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport { ReactNode } from 'react';\nimport { XIcon } from '~/icons';\nimport { IconButton } from '../icon-button';\nimport styles from './drawer.module.css';\n\nconst drawerPopup = cva(styles.drawerPopup, {\n  variants: {\n    side: {\n      top: styles['drawerPopup-top'],\n      bottom: styles['drawerPopup-bottom'],\n      left: styles['drawerPopup-left'],\n      right: styles['drawerPopup-right']\n    }\n  },\n  defaultVariants: {\n    side: 'right'\n  }\n});\n\nexport interface DrawerContentProps\n  extends Omit<DrawerPrimitive.Popup.Props, 'children'>,\n    VariantProps<typeof drawerPopup> {\n  showCloseButton?: boolean;\n  overlayProps?: DrawerPrimitive.Backdrop.Props;\n  children?: ReactNode;\n}\n\nexport function DrawerContent({\n  className,\n  children,\n  side = 'right',\n  showCloseButton = true,\n  overlayProps,\n  'aria-label': ariaLabel,\n  'aria-labelledby': ariaLabelledBy,\n  closeLabel = 'Close',\n  ...props\n}: DrawerContentProps & { closeLabel?: string }) {\n  const resolvedAriaLabel =\n    ariaLabel ?? (ariaLabelledBy ? undefined : 'Drawer');\n  return (\n    <DrawerPrimitive.Portal>\n      <DrawerPrimitive.Backdrop\n        data-slot='drawer-backdrop'\n        {...overlayProps}\n        className={cx(styles.backdrop, overlayProps?.className)}\n      />\n      <DrawerPrimitive.Viewport\n        className={styles.viewport}\n        data-slot='drawer-viewport'\n      >\n        <DrawerPrimitive.Popup\n          className={drawerPopup({ side, className })}\n          aria-label={resolvedAriaLabel}\n          aria-labelledby={ariaLabelledBy}\n          data-slot='drawer-content'\n          {...props}\n        >\n          <DrawerPrimitive.Content\n            className={styles.content}\n            data-slot='drawer-content-body'\n          >\n            {children}\n            {showCloseButton && (\n              <DrawerPrimitive.Close\n                className={styles.close}\n                aria-label={closeLabel}\n                render={<IconButton size={3} />}\n                data-slot='drawer-close'\n              >\n                <XIcon aria-hidden='true' />\n              </DrawerPrimitive.Close>\n            )}\n          </DrawerPrimitive.Content>\n        </DrawerPrimitive.Popup>\n      </DrawerPrimitive.Viewport>\n    </DrawerPrimitive.Portal>\n  );\n}\nDrawerContent.displayName = 'Drawer.Content';\n"],"names":[],"mappings":";;;;;;;;;;;AASA;AACE;AACE;AACE;AACA;AACA;AACA;AACD;AACF;AACD;AACE;AACD;AACF;AAUe;AAWd;;AAwCF;AACA;;"}