{"version":3,"file":"index.cjs","sources":["../../../../src/components/SidebarNavigationTitle/SidebarNavigationTitle.tsx"],"sourcesContent":["import {\n  ComponentProps,\n  ComponentPropsWithRef,\n  ElementType,\n  ReactNode,\n  forwardRef,\n} from 'react';\nimport { cn, cva } from '@/lib/cva';\nimport { IconWrapper } from '@/components/Collapsible/IconWrapper';\nimport { SidebarNavigationTitleProps } from './SidebarNavigationTitle.types';\nimport styles from './SidebarNavigationTitle.module.css';\n\nconst wrapperVariants = cva(styles.wrapper, {\n  variants: {\n    type: {\n      main: styles.wrapper_type_main,\n      sqlSidebar: styles['wrapper_type_sql-sidebar'],\n    },\n    collapsible: { true: styles.wrapper_collapsible_true, false: '' },\n  },\n  defaultVariants: { type: 'main', collapsible: false },\n});\n\n// Polymorphic wrapper: SidebarCollapsibleTitle renders it `as={Collapsible.Trigger}`.\n// Same shape as the Container polymorphic component (src/components/Container).\nexport interface SidebarTitleWrapperProps<T extends ElementType = 'button'> {\n  as?: T;\n  $collapsible?: boolean;\n  $type?: 'main' | 'sqlSidebar';\n}\n\ntype SidebarTitleWrapperComponent = <T extends ElementType = 'button'>(\n  props: Omit<ComponentProps<T>, keyof SidebarTitleWrapperProps<T>> &\n    SidebarTitleWrapperProps<T>\n) => ReactNode;\n\nconst _SidebarTitleWrapper = <T extends ElementType = 'button'>(\n  {\n    as,\n    $collapsible = false,\n    $type = 'main',\n    className,\n    ...props\n  }: Omit<ComponentProps<T>, keyof SidebarTitleWrapperProps<T>> &\n    SidebarTitleWrapperProps<T>,\n  ref: ComponentPropsWithRef<T>['ref']\n) => {\n  const Component = as ?? 'button';\n  return (\n    <Component\n      ref={ref}\n      {...props}\n      className={cn(\n        wrapperVariants({ type: $type, collapsible: $collapsible }),\n        className\n      )}\n    />\n  );\n};\n\nexport const SidebarTitleWrapper: SidebarTitleWrapperComponent =\n  forwardRef(_SidebarTitleWrapper);\n\nexport const SidebarNavigationTitle = ({\n  label,\n  icon,\n  iconDir,\n  selected,\n  type = 'main',\n  ...props\n}: SidebarNavigationTitleProps) => {\n  return (\n    <SidebarTitleWrapper\n      data-selected={selected}\n      $type={type}\n      {...props}\n    >\n      <IconWrapper\n        icon={icon}\n        iconDir={iconDir}\n      >\n        {label}\n      </IconWrapper>\n    </SidebarTitleWrapper>\n  );\n};\n"],"names":["cva","styles","jsx","cn","forwardRef","IconWrapper"],"mappings":";;;;;;;;;;;AAYA,MAAM,eAAA,GAAkBA,0BAAA,CAAIC,qCAAA,CAAO,OAAA,EAAS;AAAA,EAC1C,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,MAAMA,qCAAA,CAAO,iBAAA;AAAA,MACb,UAAA,EAAYA,sCAAO,0BAA0B;AAAA,KAC/C;AAAA,IACA,aAAa,EAAE,IAAA,EAAMA,qCAAA,CAAO,wBAAA,EAA0B,OAAO,EAAA;AAAG,GAClE;AAAA,EACA,eAAA,EAAiB,EAAE,IAAA,EAAM,MAAA,EAAQ,aAAa,KAAA;AAChD,CAAC,CAAA;AAeD,MAAM,uBAAuB,CAC3B;AAAA,EACE,EAAA;AAAA,EACA,YAAA,GAAe,KAAA;AAAA,EACf,KAAA,GAAQ,MAAA;AAAA,EACR,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAEA,GAAA,KACG;AACH,EAAA,MAAM,YAAY,EAAA,IAAM,QAAA;AACxB,EAAA,uBACEC,cAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACC,GAAG,KAAA;AAAA,MACJ,SAAA,EAAWC,MAAA;AAAA,QACT,gBAAgB,EAAE,IAAA,EAAM,KAAA,EAAO,WAAA,EAAa,cAAc,CAAA;AAAA,QAC1D;AAAA;AACF;AAAA,GACF;AAEJ,CAAA;AAEO,MAAM,mBAAA,GACXC,iBAAW,oBAAoB;AAE1B,MAAM,yBAAyB,CAAC;AAAA,EACrC,KAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA,G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