@arolariu/components 1.0.0 → 1.1.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.
Files changed (218) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/EXAMPLES.md +2510 -0
  3. package/dist/components/ui/alert-dialog.d.ts +4 -16
  4. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  5. package/dist/components/ui/alert-dialog.js +18 -14
  6. package/dist/components/ui/alert-dialog.js.map +1 -1
  7. package/dist/components/ui/avatar.d.ts +3 -12
  8. package/dist/components/ui/avatar.d.ts.map +1 -1
  9. package/dist/components/ui/avatar.js +18 -15
  10. package/dist/components/ui/avatar.js.map +1 -1
  11. package/dist/components/ui/button-group.d.ts +1 -1
  12. package/dist/components/ui/button-group.d.ts.map +1 -1
  13. package/dist/components/ui/calendar.d.ts +1 -4
  14. package/dist/components/ui/calendar.d.ts.map +1 -1
  15. package/dist/components/ui/calendar.js +7 -7
  16. package/dist/components/ui/calendar.js.map +1 -1
  17. package/dist/components/ui/carousel.d.ts.map +1 -1
  18. package/dist/components/ui/carousel.js.map +1 -1
  19. package/dist/components/ui/chart.d.ts.map +1 -1
  20. package/dist/components/ui/chart.js +125 -59
  21. package/dist/components/ui/chart.js.map +1 -1
  22. package/dist/components/ui/checkbox-group.d.ts +2 -6
  23. package/dist/components/ui/checkbox-group.d.ts.map +1 -1
  24. package/dist/components/ui/checkbox-group.js +8 -7
  25. package/dist/components/ui/checkbox-group.js.map +1 -1
  26. package/dist/components/ui/checkbox.d.ts +3 -1
  27. package/dist/components/ui/checkbox.d.ts.map +1 -1
  28. package/dist/components/ui/checkbox.js +4 -1
  29. package/dist/components/ui/checkbox.js.map +1 -1
  30. package/dist/components/ui/collapsible.d.ts.map +1 -1
  31. package/dist/components/ui/collapsible.js.map +1 -1
  32. package/dist/components/ui/combobox.d.ts +335 -0
  33. package/dist/components/ui/combobox.d.ts.map +1 -0
  34. package/dist/components/ui/combobox.js +206 -0
  35. package/dist/components/ui/combobox.js.map +1 -0
  36. package/dist/components/ui/combobox.module.js +23 -0
  37. package/dist/components/ui/combobox.module.js.map +1 -0
  38. package/dist/components/ui/combobox_module.css +142 -0
  39. package/dist/components/ui/combobox_module.css.map +1 -0
  40. package/dist/components/ui/command.d.ts.map +1 -1
  41. package/dist/components/ui/command.js +25 -16
  42. package/dist/components/ui/command.js.map +1 -1
  43. package/dist/components/ui/context-menu.d.ts.map +1 -1
  44. package/dist/components/ui/context-menu.js.map +1 -1
  45. package/dist/components/ui/drawer.d.ts.map +1 -1
  46. package/dist/components/ui/drawer.js.map +1 -1
  47. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  48. package/dist/components/ui/dropdown-menu.js.map +1 -1
  49. package/dist/components/ui/dropdrawer.d.ts +10 -16
  50. package/dist/components/ui/dropdrawer.d.ts.map +1 -1
  51. package/dist/components/ui/dropdrawer.js +28 -20
  52. package/dist/components/ui/dropdrawer.js.map +1 -1
  53. package/dist/components/ui/item.d.ts +1 -1
  54. package/dist/components/ui/item.d.ts.map +1 -1
  55. package/dist/components/ui/menubar.d.ts +11 -13
  56. package/dist/components/ui/menubar.d.ts.map +1 -1
  57. package/dist/components/ui/menubar.js.map +1 -1
  58. package/dist/components/ui/meter.d.ts +8 -24
  59. package/dist/components/ui/meter.d.ts.map +1 -1
  60. package/dist/components/ui/meter.js +23 -19
  61. package/dist/components/ui/meter.js.map +1 -1
  62. package/dist/components/ui/navigation-menu.d.ts +3 -12
  63. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  64. package/dist/components/ui/navigation-menu.js +14 -11
  65. package/dist/components/ui/navigation-menu.js.map +1 -1
  66. package/dist/components/ui/number-field.d.ts +6 -12
  67. package/dist/components/ui/number-field.d.ts.map +1 -1
  68. package/dist/components/ui/number-field.js.map +1 -1
  69. package/dist/components/ui/progress.d.ts +1 -4
  70. package/dist/components/ui/progress.d.ts.map +1 -1
  71. package/dist/components/ui/progress.js +10 -9
  72. package/dist/components/ui/progress.js.map +1 -1
  73. package/dist/components/ui/radio-group.d.ts +2 -4
  74. package/dist/components/ui/radio-group.d.ts.map +1 -1
  75. package/dist/components/ui/radio-group.js.map +1 -1
  76. package/dist/components/ui/resizable.d.ts +3 -3
  77. package/dist/components/ui/resizable.d.ts.map +1 -1
  78. package/dist/components/ui/resizable.js.map +1 -1
  79. package/dist/components/ui/scratcher.d.ts +1 -1
  80. package/dist/components/ui/scratcher.d.ts.map +1 -1
  81. package/dist/components/ui/scratcher.js +5 -4
  82. package/dist/components/ui/scratcher.js.map +1 -1
  83. package/dist/components/ui/scroll-area.d.ts +2 -4
  84. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  85. package/dist/components/ui/scroll-area.js.map +1 -1
  86. package/dist/components/ui/separator.d.ts +1 -4
  87. package/dist/components/ui/separator.d.ts.map +1 -1
  88. package/dist/components/ui/separator.js +9 -8
  89. package/dist/components/ui/separator.js.map +1 -1
  90. package/dist/components/ui/sheet.d.ts.map +1 -1
  91. package/dist/components/ui/sheet.js.map +1 -1
  92. package/dist/components/ui/sidebar.d.ts +1 -1
  93. package/dist/components/ui/sidebar.d.ts.map +1 -1
  94. package/dist/components/ui/sidebar.js.map +1 -1
  95. package/dist/components/ui/sonner.d.ts +5 -4
  96. package/dist/components/ui/sonner.d.ts.map +1 -1
  97. package/dist/components/ui/sonner.js +7 -6
  98. package/dist/components/ui/sonner.js.map +1 -1
  99. package/dist/components/ui/toggle-group.d.ts +2 -8
  100. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  101. package/dist/components/ui/toggle-group.js +12 -10
  102. package/dist/components/ui/toggle-group.js.map +1 -1
  103. package/dist/components/ui/toolbar.d.ts +10 -30
  104. package/dist/components/ui/toolbar.d.ts.map +1 -1
  105. package/dist/components/ui/toolbar.js +28 -23
  106. package/dist/components/ui/toolbar.js.map +1 -1
  107. package/dist/hooks/useClipboard.d.ts +77 -0
  108. package/dist/hooks/useClipboard.d.ts.map +1 -0
  109. package/dist/hooks/useClipboard.js +42 -0
  110. package/dist/hooks/useClipboard.js.map +1 -0
  111. package/dist/hooks/useControllableState.d.ts +54 -0
  112. package/dist/hooks/useControllableState.d.ts.map +1 -0
  113. package/dist/hooks/useControllableState.js +29 -0
  114. package/dist/hooks/useControllableState.js.map +1 -0
  115. package/dist/hooks/useDebounce.d.ts +33 -0
  116. package/dist/hooks/useDebounce.d.ts.map +1 -0
  117. package/dist/hooks/useDebounce.js +20 -0
  118. package/dist/hooks/useDebounce.js.map +1 -0
  119. package/dist/hooks/useEventCallback.d.ts +34 -0
  120. package/dist/hooks/useEventCallback.d.ts.map +1 -0
  121. package/dist/hooks/useEventCallback.js +12 -0
  122. package/dist/hooks/useEventCallback.js.map +1 -0
  123. package/dist/hooks/useId.d.ts +30 -0
  124. package/dist/hooks/useId.d.ts.map +1 -0
  125. package/dist/hooks/useId.js +9 -0
  126. package/dist/hooks/useId.js.map +1 -0
  127. package/dist/hooks/useIntersectionObserver.d.ts +51 -0
  128. package/dist/hooks/useIntersectionObserver.d.ts.map +1 -0
  129. package/dist/hooks/useIntersectionObserver.js +25 -0
  130. package/dist/hooks/useIntersectionObserver.js.map +1 -0
  131. package/dist/hooks/useInterval.d.ts +55 -0
  132. package/dist/hooks/useInterval.d.ts.map +1 -0
  133. package/dist/hooks/useInterval.js +24 -0
  134. package/dist/hooks/useInterval.js.map +1 -0
  135. package/dist/hooks/useLocalStorage.d.ts +43 -0
  136. package/dist/hooks/useLocalStorage.d.ts.map +1 -0
  137. package/dist/hooks/useLocalStorage.js +53 -0
  138. package/dist/hooks/useLocalStorage.js.map +1 -0
  139. package/dist/hooks/useMergedRefs.d.ts +27 -0
  140. package/dist/hooks/useMergedRefs.d.ts.map +1 -0
  141. package/dist/hooks/useMergedRefs.js +11 -0
  142. package/dist/hooks/useMergedRefs.js.map +1 -0
  143. package/dist/hooks/useOnClickOutside.d.ts +32 -0
  144. package/dist/hooks/useOnClickOutside.d.ts.map +1 -0
  145. package/dist/hooks/useOnClickOutside.js +23 -0
  146. package/dist/hooks/useOnClickOutside.js.map +1 -0
  147. package/dist/hooks/usePrevious.d.ts +33 -0
  148. package/dist/hooks/usePrevious.d.ts.map +1 -0
  149. package/dist/hooks/usePrevious.js +14 -0
  150. package/dist/hooks/usePrevious.js.map +1 -0
  151. package/dist/hooks/useThrottle.d.ts +37 -0
  152. package/dist/hooks/useThrottle.d.ts.map +1 -0
  153. package/dist/hooks/useThrottle.js +34 -0
  154. package/dist/hooks/useThrottle.js.map +1 -0
  155. package/dist/hooks/useTimeout.d.ts +28 -0
  156. package/dist/hooks/useTimeout.d.ts.map +1 -0
  157. package/dist/hooks/useTimeout.js +24 -0
  158. package/dist/hooks/useTimeout.js.map +1 -0
  159. package/dist/index.d.ts +14 -0
  160. package/dist/index.d.ts.map +1 -1
  161. package/dist/index.js +14 -0
  162. package/dist/lib/utilities.d.ts +2 -3
  163. package/dist/lib/utilities.d.ts.map +1 -1
  164. package/dist/lib/utilities.js.map +1 -1
  165. package/dist/motion/tokens.js +5 -5
  166. package/dist/motion/tokens.js.map +1 -1
  167. package/dist/rslib-runtime.js +39 -0
  168. package/dist/rslib-runtime.js.map +1 -0
  169. package/package.json +82 -3
  170. package/src/components/ui/alert-dialog.tsx +15 -8
  171. package/src/components/ui/avatar.tsx +9 -6
  172. package/src/components/ui/calendar.tsx +7 -13
  173. package/src/components/ui/carousel.tsx +2 -0
  174. package/src/components/ui/chart.tsx +63 -60
  175. package/src/components/ui/checkbox-group.tsx +4 -5
  176. package/src/components/ui/checkbox.tsx +10 -2
  177. package/src/components/ui/collapsible.tsx +1 -0
  178. package/src/components/ui/combobox.module.css +158 -0
  179. package/src/components/ui/combobox.tsx +569 -0
  180. package/src/components/ui/command.tsx +31 -15
  181. package/src/components/ui/context-menu.tsx +3 -0
  182. package/src/components/ui/drawer.tsx +2 -0
  183. package/src/components/ui/dropdown-menu.tsx +3 -0
  184. package/src/components/ui/dropdrawer.tsx +80 -62
  185. package/src/components/ui/menubar.tsx +9 -10
  186. package/src/components/ui/meter.tsx +16 -17
  187. package/src/components/ui/navigation-menu.tsx +41 -33
  188. package/src/components/ui/number-field.tsx +6 -13
  189. package/src/components/ui/progress.tsx +3 -2
  190. package/src/components/ui/radio-group.tsx +2 -5
  191. package/src/components/ui/resizable.tsx +2 -2
  192. package/src/components/ui/scratcher.tsx +6 -10
  193. package/src/components/ui/scroll-area.tsx +2 -5
  194. package/src/components/ui/separator.tsx +4 -3
  195. package/src/components/ui/sheet.tsx +3 -0
  196. package/src/components/ui/sidebar.tsx +1 -0
  197. package/src/components/ui/sonner.tsx +20 -12
  198. package/src/components/ui/toggle-group.tsx +6 -4
  199. package/src/components/ui/toolbar.tsx +20 -21
  200. package/src/hooks/useClipboard.tsx +137 -0
  201. package/src/hooks/useControllableState.tsx +81 -0
  202. package/src/hooks/useDebounce.tsx +50 -0
  203. package/src/hooks/useEventCallback.tsx +47 -0
  204. package/src/hooks/useId.tsx +36 -0
  205. package/src/hooks/useIntersectionObserver.tsx +81 -0
  206. package/src/hooks/useInterval.tsx +80 -0
  207. package/src/hooks/useLocalStorage.tsx +111 -0
  208. package/src/hooks/useMergedRefs.tsx +48 -0
  209. package/src/hooks/useOnClickOutside.tsx +55 -0
  210. package/src/hooks/usePrevious.tsx +44 -0
  211. package/src/hooks/useThrottle.tsx +78 -0
  212. package/src/hooks/useTimeout.tsx +51 -0
  213. package/src/index.ts +23 -0
  214. package/src/lib/utilities.ts +4 -4
  215. package/src/motion/tokens.ts +4 -4
  216. package/src/stories/DesignPrinciples.mdx +48 -0
  217. package/src/stories/GettingStarted.mdx +92 -0
  218. package/src/stories/Welcome.mdx +44 -0
@@ -1 +1 @@
1
- {"version":3,"file":"components/ui/sheet.js","sources":["../../../src/components/ui/sheet.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {Dialog as BaseDialog} from \"@base-ui/react/dialog\";\r\nimport {mergeProps} from \"@base-ui/react/merge-props\";\r\nimport {useRender} from \"@base-ui/react/use-render\";\r\nimport {X} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\nimport styles from \"./sheet.module.css\";\r\n\r\nexport type SheetSide = \"top\" | \"right\" | \"bottom\" | \"left\";\r\n\r\ninterface SheetProps extends React.ComponentPropsWithRef<typeof BaseDialog.Root> {}\r\n\r\ninterface SheetTriggerProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Trigger>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Enables child element composition instead of rendering the default wrapper.\r\n * @default false\r\n * @deprecated Prefer Base UI's `render` prop.\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\ninterface SheetOverlayProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Backdrop>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n}\r\n\r\nexport interface SheetContentProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Popup>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Controls which side of the viewport the sheet enters from.\r\n * @default \"right\"\r\n */\r\n side?: SheetSide;\r\n}\r\n\r\ninterface SheetHeaderProps extends React.ComponentPropsWithRef<\"div\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Overrides the default rendered element while preserving component behavior.\r\n * @default undefined\r\n */\r\n render?: useRender.RenderProp<Record<string, never>>;\r\n /**\r\n * Enables child element composition instead of rendering the default wrapper.\r\n * @default false\r\n * @deprecated Prefer Base UI's `render` prop.\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\ninterface SheetFooterProps extends React.ComponentPropsWithRef<\"div\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Overrides the default rendered element while preserving component behavior.\r\n * @default undefined\r\n */\r\n render?: useRender.RenderProp<Record<string, never>>;\r\n /**\r\n * Enables child element composition instead of rendering the default wrapper.\r\n * @default false\r\n * @deprecated Prefer Base UI's `render` prop.\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\ninterface SheetTitleProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Title>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n}\r\n\r\ninterface SheetDescriptionProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Description>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Coordinates sheet state and accessibility behavior.\r\n *\r\n * @remarks\r\n * - Delegates structure and state to the underlying Base UI primitive\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Preserves the underlying primitive API for advanced composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <Sheet>Content</Sheet>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction Sheet(props: Readonly<Sheet.Props>): React.ReactElement {\r\n return <BaseDialog.Root {...props} />;\r\n}\r\n\r\n/**\r\n * Provides the sheet portal container.\r\n *\r\n * @remarks\r\n * - Delegates structure and state to the underlying Base UI primitive\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Preserves the underlying primitive API for advanced composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetPortal>Content</SheetPortal>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nconst SheetPortal = BaseDialog.Portal;\r\n/**\r\n * Renders the sheet close.\r\n *\r\n * @remarks\r\n * - Delegates structure and state to the underlying Base UI primitive\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Preserves the underlying primitive API for advanced composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetClose>Content</SheetClose>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nconst SheetClose = BaseDialog.Close;\r\n\r\n/**\r\n * Renders the sheet trigger.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetTrigger>Content</SheetTrigger>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nconst SheetTrigger = React.forwardRef<HTMLButtonElement, SheetTrigger.Props>(\r\n (props: Readonly<SheetTrigger.Props>, ref): React.ReactElement => {\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return (\r\n <BaseDialog.Trigger\r\n ref={ref}\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"button\",\r\n render: renderProp as never,\r\n props: mergeProps({className}, {}),\r\n })}>\r\n {renderProp ? undefined : children}\r\n </BaseDialog.Trigger>\r\n );\r\n },\r\n);\r\n\r\n/**\r\n * Renders the sheet overlay.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetOverlay>Content</SheetOverlay>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetOverlay(props: Readonly<SheetOverlay.Props>): React.ReactElement {\r\n const {className, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDialog.Backdrop\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.backdrop, className)}, {}),\r\n })}\r\n />\r\n );\r\n}\r\n\r\n/**\r\n * Renders the sheet content.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetContent>Content</SheetContent>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nconst SheetContent = React.forwardRef<React.ComponentRef<typeof BaseDialog.Popup>, SheetContent.Props>(\r\n (props: Readonly<SheetContent.Props>, ref): React.ReactElement => {\r\n const {className, children, render, side = \"right\", ...otherProps} = props;\r\n\r\n return (\r\n <SheetPortal>\r\n <SheetOverlay />\r\n <BaseDialog.Popup\r\n ref={ref}\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.popup, styles[side], className)}, {}),\r\n })}>\r\n <BaseDialog.Close\r\n aria-label='Close'\r\n className={styles.close}>\r\n <X className={styles.closeIcon} />\r\n </BaseDialog.Close>\r\n {children}\r\n </BaseDialog.Popup>\r\n </SheetPortal>\r\n );\r\n },\r\n);\r\n\r\n/**\r\n * Renders the sheet header.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetHeader>Content</SheetHeader>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetHeader(props: Readonly<SheetHeader.Props>): React.ReactElement {\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return useRender({\r\n defaultTagName: \"div\",\r\n render: renderProp as never,\r\n props: mergeProps({className: cn(styles.header, className)}, otherProps, {\r\n children: renderProp ? undefined : children,\r\n }),\r\n });\r\n}\r\n\r\n/**\r\n * Renders the sheet footer.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetFooter>Content</SheetFooter>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetFooter(props: Readonly<SheetFooter.Props>): React.ReactElement {\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return useRender({\r\n defaultTagName: \"div\",\r\n render: renderProp as never,\r\n props: mergeProps({className: cn(styles.footer, className)}, otherProps, {\r\n children: renderProp ? undefined : children,\r\n }),\r\n });\r\n}\r\n\r\n/**\r\n * Renders the sheet title.\r\n *\r\n * @remarks\r\n * - Renders a `<h2>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetTitle>Content</SheetTitle>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetTitle(props: Readonly<SheetTitle.Props>): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDialog.Title\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"h2\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.title, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseDialog.Title>\r\n );\r\n}\r\n\r\n/**\r\n * Renders the sheet description.\r\n *\r\n * @remarks\r\n * - Renders a `<p>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetDescription>Content</SheetDescription>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetDescription(props: Readonly<SheetDescription.Props>): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDialog.Description\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"p\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.description, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseDialog.Description>\r\n );\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace Sheet {\r\n export type Props = SheetProps;\r\n export type State = BaseDialog.Root.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetTrigger {\r\n export type Props = SheetTriggerProps;\r\n export type State = BaseDialog.Trigger.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetOverlay {\r\n export type Props = SheetOverlayProps;\r\n export type State = BaseDialog.Backdrop.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetContent {\r\n export type Props = SheetContentProps;\r\n export type State = BaseDialog.Popup.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetHeader {\r\n export type Props = SheetHeaderProps;\r\n export type State = Record<string, never>;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetFooter {\r\n export type Props = SheetFooterProps;\r\n export type State = Record<string, never>;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetTitle {\r\n export type Props = SheetTitleProps;\r\n export type State = BaseDialog.Title.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetDescription {\r\n export type Props = SheetDescriptionProps;\r\n export type State = BaseDialog.Description.State;\r\n}\r\n\r\nSheet.displayName = \"Sheet\";\r\nSheetPortal.displayName = \"SheetPortal\";\r\nSheetClose.displayName = \"SheetClose\";\r\nSheetTrigger.displayName = \"SheetTrigger\";\r\nSheetOverlay.displayName = \"SheetOverlay\";\r\nSheetContent.displayName = \"SheetContent\";\r\nSheetHeader.displayName = \"SheetHeader\";\r\nSheetFooter.displayName = \"SheetFooter\";\r\nSheetTitle.displayName = \"SheetTitle\";\r\nSheetDescription.displayName = \"SheetDescription\";\r\n\r\nexport {Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger};\r\n"],"names":["Sheet","props","BaseDialog","SheetPortal","SheetClose","SheetTrigger","React","ref","asChild","children","className","render","otherProps","renderProp","useRender","mergeProps","undefined","SheetOverlay","cn","styles","SheetContent","side","X","SheetHeader","SheetFooter","SheetTitle","SheetDescription"],"mappings":";;;;;;;;;AAuHA,SAASA,MAAMC,KAA4B;IACzC,OAAO,WAAP,GAAO,IAACC,OAAAA,IAAe;QAAE,GAAGD,KAAK;;AACnC;AAiBA,MAAME,cAAcD,OAAAA,MAAiB;AAgBrC,MAAME,aAAaF,OAAAA,KAAgB;AAiBnC,MAAMG,eAAe,WAAHA,GAAGC,WACnB,CAACL,OAAqCM;IACpC,MAAM,EAACC,UAAU,KAAK,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAE,GAAGC,YAAW,GAAGX;IACtE,MAAMY,aAAaL,WAAW,WAAXA,GAAWF,eAAqBG,YAAYA,WAAWE;IAE1E,OAAO,WAAP,GACE,IAACT,OAAAA,OAAkB;QACjB,KAAKK;QACJ,GAAGK,UAAU;QACd,QAAQE,UAAU;YAChB,gBAAgB;YAChB,QAAQD;YACR,OAAOE,WAAW;gBAACL;YAAS,GAAG,CAAC;QAClC;kBACCG,aAAaG,SAAYP;;AAGhC;AAkBF,SAASQ,aAAahB,KAAmC;IACvD,MAAM,EAACS,SAAS,EAAEC,MAAM,EAAE,GAAGC,YAAW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":["\"use client\";\r\n\r\nimport {Dialog as BaseDialog} from \"@base-ui/react/dialog\";\r\nimport {mergeProps} from \"@base-ui/react/merge-props\";\r\nimport {useRender} from \"@base-ui/react/use-render\";\r\nimport {X} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\nimport styles from \"./sheet.module.css\";\r\n\r\nexport type SheetSide = \"top\" | \"right\" | \"bottom\" | \"left\";\r\n\r\ninterface SheetProps extends React.ComponentPropsWithRef<typeof BaseDialog.Root> {}\r\n\r\ninterface SheetTriggerProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Trigger>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Enables child element composition instead of rendering the default wrapper.\r\n * @default false\r\n * @deprecated Prefer Base UI's `render` prop.\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\ninterface SheetOverlayProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Backdrop>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n}\r\n\r\nexport interface SheetContentProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Popup>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Controls which side of the viewport the sheet enters from.\r\n * @default \"right\"\r\n */\r\n side?: SheetSide;\r\n}\r\n\r\ninterface SheetHeaderProps extends React.ComponentPropsWithRef<\"div\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Overrides the default rendered element while preserving component behavior.\r\n * @default undefined\r\n */\r\n render?: useRender.RenderProp<Record<string, never>>;\r\n /**\r\n * Enables child element composition instead of rendering the default wrapper.\r\n * @default false\r\n * @deprecated Prefer Base UI's `render` prop.\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\ninterface SheetFooterProps extends React.ComponentPropsWithRef<\"div\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n /**\r\n * Overrides the default rendered element while preserving component behavior.\r\n * @default undefined\r\n */\r\n render?: useRender.RenderProp<Record<string, never>>;\r\n /**\r\n * Enables child element composition instead of rendering the default wrapper.\r\n * @default false\r\n * @deprecated Prefer Base UI's `render` prop.\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\ninterface SheetTitleProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Title>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n}\r\n\r\ninterface SheetDescriptionProps extends Omit<React.ComponentPropsWithRef<typeof BaseDialog.Description>, \"className\"> {\r\n /**\r\n * Applies additional CSS classes to the component root element.\r\n * @default undefined\r\n */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Coordinates sheet state and accessibility behavior.\r\n *\r\n * @remarks\r\n * - Delegates structure and state to the underlying Base UI primitive\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Preserves the underlying primitive API for advanced composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <Sheet>Content</Sheet>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction Sheet(props: Readonly<Sheet.Props>): React.ReactElement {\r\n return <BaseDialog.Root {...props} />;\r\n}\r\n\r\n/**\r\n * Provides the sheet portal container.\r\n *\r\n * @remarks\r\n * - Delegates structure and state to the underlying Base UI primitive\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Preserves the underlying primitive API for advanced composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetPortal>Content</SheetPortal>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nconst SheetPortal = BaseDialog.Portal;\r\n/**\r\n * Renders the sheet close.\r\n *\r\n * @remarks\r\n * - Delegates structure and state to the underlying Base UI primitive\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Preserves the underlying primitive API for advanced composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetClose>Content</SheetClose>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nconst SheetClose = BaseDialog.Close;\r\n\r\n/**\r\n * Renders the sheet trigger.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetTrigger>Content</SheetTrigger>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nconst SheetTrigger = React.forwardRef<HTMLButtonElement, SheetTrigger.Props>(\r\n (props: Readonly<SheetTrigger.Props>, ref): React.ReactElement => {\r\n // eslint-disable-next-line sonarjs/deprecation -- backward-compatible asChild API\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return (\r\n <BaseDialog.Trigger\r\n ref={ref}\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"button\",\r\n render: renderProp as never,\r\n props: mergeProps({className}, {}),\r\n })}>\r\n {renderProp ? undefined : children}\r\n </BaseDialog.Trigger>\r\n );\r\n },\r\n);\r\n\r\n/**\r\n * Renders the sheet overlay.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetOverlay>Content</SheetOverlay>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetOverlay(props: Readonly<SheetOverlay.Props>): React.ReactElement {\r\n const {className, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDialog.Backdrop\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.backdrop, className)}, {}),\r\n })}\r\n />\r\n );\r\n}\r\n\r\n/**\r\n * Renders the sheet content.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetContent>Content</SheetContent>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nconst SheetContent = React.forwardRef<React.ComponentRef<typeof BaseDialog.Popup>, SheetContent.Props>(\r\n (props: Readonly<SheetContent.Props>, ref): React.ReactElement => {\r\n const {className, children, render, side = \"right\", ...otherProps} = props;\r\n\r\n return (\r\n <SheetPortal>\r\n <SheetOverlay />\r\n <BaseDialog.Popup\r\n ref={ref}\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"div\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.popup, styles[side], className)}, {}),\r\n })}>\r\n <BaseDialog.Close\r\n aria-label='Close'\r\n className={styles.close}>\r\n <X className={styles.closeIcon} />\r\n </BaseDialog.Close>\r\n {children}\r\n </BaseDialog.Popup>\r\n </SheetPortal>\r\n );\r\n },\r\n);\r\n\r\n/**\r\n * Renders the sheet header.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetHeader>Content</SheetHeader>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetHeader(props: Readonly<SheetHeader.Props>): React.ReactElement {\r\n // eslint-disable-next-line sonarjs/deprecation -- backward-compatible asChild API\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return useRender({\r\n defaultTagName: \"div\",\r\n render: renderProp as never,\r\n props: mergeProps({className: cn(styles.header, className)}, otherProps, {\r\n children: renderProp ? undefined : children,\r\n }),\r\n });\r\n}\r\n\r\n/**\r\n * Renders the sheet footer.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetFooter>Content</SheetFooter>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetFooter(props: Readonly<SheetFooter.Props>): React.ReactElement {\r\n // eslint-disable-next-line sonarjs/deprecation -- backward-compatible asChild API\r\n const {asChild = false, children, className, render, ...otherProps} = props;\r\n const renderProp = asChild && React.isValidElement(children) ? children : render;\r\n\r\n return useRender({\r\n defaultTagName: \"div\",\r\n render: renderProp as never,\r\n props: mergeProps({className: cn(styles.footer, className)}, otherProps, {\r\n children: renderProp ? undefined : children,\r\n }),\r\n });\r\n}\r\n\r\n/**\r\n * Renders the sheet title.\r\n *\r\n * @remarks\r\n * - Renders a `<h2>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetTitle>Content</SheetTitle>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetTitle(props: Readonly<SheetTitle.Props>): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDialog.Title\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"h2\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.title, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseDialog.Title>\r\n );\r\n}\r\n\r\n/**\r\n * Renders the sheet description.\r\n *\r\n * @remarks\r\n * - Renders a `<p>` element by default\r\n * - Built on {@link https://base-ui.com/react/components/dialog | Base UI Dialog}\r\n * - Supports the `render` prop for element composition\r\n *\r\n * @example\r\n * ```tsx\r\n * <SheetDescription>Content</SheetDescription>\r\n * ```\r\n *\r\n * @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}\r\n */\r\nfunction SheetDescription(props: Readonly<SheetDescription.Props>): React.ReactElement {\r\n const {className, children, render, ...otherProps} = props;\r\n\r\n return (\r\n <BaseDialog.Description\r\n {...otherProps}\r\n render={useRender({\r\n defaultTagName: \"p\",\r\n render: render as never,\r\n props: mergeProps({className: cn(styles.description, className)}, {}),\r\n })}>\r\n {children}\r\n </BaseDialog.Description>\r\n );\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace Sheet {\r\n export type Props = SheetProps;\r\n export type State = BaseDialog.Root.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetTrigger {\r\n export type Props = SheetTriggerProps;\r\n export type State = BaseDialog.Trigger.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetOverlay {\r\n export type Props = SheetOverlayProps;\r\n export type State = BaseDialog.Backdrop.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetContent {\r\n export type Props = SheetContentProps;\r\n export type State = BaseDialog.Popup.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetHeader {\r\n export type Props = SheetHeaderProps;\r\n export type State = Record<string, never>;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetFooter {\r\n export type Props = SheetFooterProps;\r\n export type State = Record<string, never>;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetTitle {\r\n export type Props = SheetTitleProps;\r\n export type State = BaseDialog.Title.State;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API\r\nnamespace SheetDescription {\r\n export type Props = SheetDescriptionProps;\r\n export type State = BaseDialog.Description.State;\r\n}\r\n\r\nSheet.displayName = \"Sheet\";\r\nSheetPortal.displayName = \"SheetPortal\";\r\nSheetClose.displayName = \"SheetClose\";\r\nSheetTrigger.displayName = \"SheetTrigger\";\r\nSheetOverlay.displayName = \"SheetOverlay\";\r\nSheetContent.displayName = \"SheetContent\";\r\nSheetHeader.displayName = \"SheetHeader\";\r\nSheetFooter.displayName = \"SheetFooter\";\r\nSheetTitle.displayName = \"SheetTitle\";\r\nSheetDescription.displayName = \"SheetDescription\";\r\n\r\nexport {Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger};\r\n"],"names":["Sheet","props","BaseDialog","SheetPortal","SheetClose","SheetTrigger","React","ref","asChild","children","className","render","otherProps","renderProp","useRender","mergeProps","undefined","SheetOverlay","cn","styles","SheetContent","side","X","SheetHeader","SheetFooter","SheetTitle","SheetDescription"],"mappings":";;;;;;;;;AAuHA,SAASA,MAAMC,KAA4B;IACzC,OAAO,WAAP,GAAO,IAACC,OAAAA,IAAe;QAAE,GAAGD,KAAK;;AACnC;AAiBA,MAAME,cAAcD,OAAAA,MAAiB;AAgBrC,MAAME,aAAaF,OAAAA,KAAgB;AAiBnC,MAAMG,eAAe,WAAHA,GAAGC,WACnB,CAACL,OAAqCM;IAEpC,MAAM,EAACC,UAAU,KAAK,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,MAAM,EAAE,GAAGC,YAAW,GAAGX;IACtE,MAAMY,aAAaL,WAAW,WAAXA,GAAWF,eAAqBG,YAAYA,WAAWE;IAE1E,OAA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BC,WAAW,WAAW,GAAG;AACzBC,aAAa,WAAW,GAAG;AAC3BY,aAAa,WAAW,GAAG;AAC3BG,aAAa,WAAW,GAAG;AAC3BG,YAAY,WAAW,GAAG;AAC1BC,YAAY,WAAW,GAAG;AAC1BC,WAAW,WAAW,GAAG;AACzBC,iBAAiB,WAAW,GAAG"}
@@ -203,7 +203,7 @@ declare const SidebarFooter: React.ForwardRefExoticComponent<Omit<React.Detailed
203
203
  *
204
204
  * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/hr | HTML thematic break}
205
205
  */
206
- declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<Readonly<import("./separator").SeparatorProps>, "ref"> & React.RefAttributes<HTMLDivElement>>;
206
+ declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<Omit<import("./separator").SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
207
207
  /**
208
208
  * Renders the scrollable content region of the sidebar.
209
209
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAU,cAAc,EAAkC,MAAM,yBAAyB,CAAC;AAkBjG,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,UAAU,GAAG,WAAW,CAAC;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAIF;;;;;;;;;;;;;GAaG;AACH,iBAAS,UAAU,IAAI,mBAAmB,CAQzC;AAED;;GAEG;AACH,UAAU,oBA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c,CAAC,GAAG,CAAC;IACnE;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,oBAAoB,kHAsBzB,CAAC;AAGF,OAAO,EACL,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"components/ui/sidebar.js","sources":["../../../src/components/ui/sidebar.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {PanelLeft} from \"lucide-react\";\r\nimport * as React from \"react\";\r\nimport {createPortal} from \"react-dom\";\r\n\r\nimport {Button} from \"@/components/ui/button\";\r\nimport {Input} from \"@/components/ui/input\";\r\nimport {Separator} from \"@/components/ui/separator\";\r\nimport {Skeleton} from \"@/components/ui/skeleton\";\r\nimport {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from \"@/components/ui/tooltip\";\r\nimport {useIsMobile} from \"@/hooks/useIsMobile\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nimport styles from \"./sidebar.module.css\";\r\n\r\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\";\r\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\r\nconst SIDEBAR_WIDTH = \"16rem\";\r\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\r\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\r\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\r\n\r\ntype SidebarDataAttributes = Record<`data-${string}`, string | boolean | undefined>;\r\ntype SidebarCloneableDivProps = React.ComponentProps<\"div\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLDivElement>};\r\ntype SidebarCloneableButtonProps = React.ComponentProps<\"button\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLButtonElement>};\r\ntype SidebarCloneableAnchorProps = React.ComponentProps<\"a\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLAnchorElement>};\r\n\r\ntype SidebarContextProps = {\r\n state: \"expanded\" | \"collapsed\";\r\n open: boolean;\r\n setOpen: (open: boolean) => void;\r\n openMobile: boolean;\r\n setOpenMobile: (open: boolean) => void;\r\n isMobile: boolean;\r\n toggleSidebar: () => void;\r\n};\r\n\r\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\r\n\r\n/**\r\n * Returns the active sidebar context and enforces provider usage.\r\n *\r\n * @remarks\r\n * Must be called from within {@link SidebarProvider}. Exposes desktop and mobile\r\n * open state along with the shared toggle helper used by sidebar primitives.\r\n *\r\n * @example\r\n * ```tsx\r\n * const {open, toggleSidebar} = useSidebar();\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useContext | React useContext Docs}\r\n */\r\nfunction useSidebar(): SidebarContextProps {\r\n const context = React.useContext(SidebarContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\r\n }\r\n\r\n return context;\r\n}\r\n\r\n/**\r\n * Props for the sidebar provider.\r\n */\r\ninterface SidebarProviderProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Initial uncontrolled open state for desktop layouts.\r\n * @default true\r\n */\r\n defaultOpen?: boolean;\r\n /**\r\n * Controlled open state for desktop layouts.\r\n * @default undefined\r\n */\r\n open?: boolean;\r\n /**\r\n * Callback invoked when the desktop open state changes.\r\n * @default undefined\r\n */\r\n onOpenChange?: (open: boolean) => void;\r\n}\r\n\r\n/**\r\n * Provides shared sidebar state, keyboard shortcuts, and responsive behavior.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built on shared React context and tooltip primitives\r\n * - Persists desktop collapse state to a cookie for cross-page continuity\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarProvider>\r\n * <Sidebar />\r\n * </SidebarProvider>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useContext | React Context Docs}\r\n */\r\nconst SidebarProvider = React.forwardRef<HTMLDivElement, SidebarProviderProps>(\r\n ({defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props}, ref) => {\r\n const isMobile = useIsMobile();\r\n const [openMobile, setOpenMobile] = React.useState(false);\r\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\r\n const open = openProp ?? internalOpen;\r\n\r\n const setOpen = React.useCallback(\r\n (value: boolean | ((value: boolean) => boolean)) => {\r\n const nextValue = typeof value === \"function\" ? value(open) : value;\r\n\r\n if (setOpenProp) {\r\n setOpenProp(nextValue);\r\n } else {\r\n setInternalOpen(nextValue);\r\n }\r\n\r\n // eslint-disable-next-line unicorn/no-document-cookie -- persistent sidebar state matches V1 behavior\r\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${nextValue}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\r\n },\r\n [open, setOpenProp],\r\n );\r\n\r\n const toggleSidebar = React.useCallback(() => {\r\n if (isMobile) {\r\n setOpenMobile((currentOpen) => !currentOpen);\r\n return;\r\n }\r\n\r\n setOpen((currentOpen) => !currentOpen);\r\n }, [isMobile, setOpen]);\r\n\r\n React.useEffect(() => {\r\n const handleKeyDown = (event: KeyboardEvent) => {\r\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\r\n event.preventDefault();\r\n toggleSidebar();\r\n }\r\n };\r\n\r\n globalThis.window.addEventListener(\"keydown\", handleKeyDown);\r\n\r\n return () => {\r\n globalThis.window.removeEventListener(\"keydown\", handleKeyDown);\r\n };\r\n }, [toggleSidebar]);\r\n\r\n const state = open ? \"expanded\" : \"collapsed\";\r\n\r\n const contextValue = React.useMemo<SidebarContextProps>(\r\n () => ({\r\n isMobile,\r\n open,\r\n openMobile,\r\n setOpen,\r\n setOpenMobile,\r\n state,\r\n toggleSidebar,\r\n }),\r\n [isMobile, open, openMobile, setOpen, state, toggleSidebar],\r\n );\r\n\r\n return (\r\n <SidebarContext.Provider value={contextValue}>\r\n <TooltipProvider>\r\n <div\r\n ref={ref}\r\n style={\r\n {\r\n \"--ac-sidebar-width\": SIDEBAR_WIDTH,\r\n \"--ac-sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\r\n ...style,\r\n } as React.CSSProperties\r\n }\r\n className={cn(styles.wrapper, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n </TooltipProvider>\r\n </SidebarContext.Provider>\r\n );\r\n },\r\n);\r\nSidebarProvider.displayName = \"SidebarProvider\";\r\n\r\n/**\r\n * Props for the root sidebar panel.\r\n */\r\ntype SidebarProps = React.ComponentProps<\"div\"> & {\r\n /**\r\n * Edge of the screen where the sidebar is rendered.\r\n * @default \"left\"\r\n */\r\n side?: \"left\" | \"right\";\r\n /**\r\n * Visual presentation style used for desktop rendering.\r\n * @default \"sidebar\"\r\n */\r\n variant?: \"sidebar\" | \"floating\" | \"inset\";\r\n /**\r\n * Desktop collapse behavior for the sidebar.\r\n * @default \"offcanvas\"\r\n */\r\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\r\n};\r\n\r\n/**\r\n * Renders the responsive sidebar panel for desktop and mobile layouts.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element on desktop and a dialog portal on mobile\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <Sidebar>\r\n * <SidebarContent />\r\n * </Sidebar>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/Accessibility/ARIA/Roles/dialog_role | ARIA Dialog Role}\r\n */\r\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\r\n ({side = \"left\", variant = \"sidebar\", collapsible = \"offcanvas\", className, children, ...props}, ref) => {\r\n const {isMobile, openMobile, setOpenMobile, state} = useSidebar();\r\n\r\n if (collapsible === \"none\") {\r\n return (\r\n <div\r\n ref={ref}\r\n className={cn(styles.staticSidebar, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n }\r\n\r\n if (isMobile) {\r\n return (\r\n <MobileSidebarPortal\r\n className={className}\r\n open={openMobile}\r\n side={side}\r\n onOpenChange={setOpenMobile}\r\n {...props}>\r\n {children}\r\n </MobileSidebarPortal>\r\n );\r\n }\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n className={styles.desktopRoot}\r\n data-state={state}\r\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\r\n data-variant={variant}\r\n data-side={side}>\r\n <div className={styles.gap} />\r\n <div\r\n className={cn(styles.panelWrap, className)}\r\n {...props}>\r\n <div\r\n data-sidebar='sidebar'\r\n className={styles.panel}>\r\n {children}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n },\r\n);\r\nSidebar.displayName = \"Sidebar\";\r\n\r\ntype MobileSidebarPortalProps = React.ComponentProps<\"div\"> & {\r\n open: boolean;\r\n side: \"left\" | \"right\";\r\n onOpenChange: (open: boolean) => void;\r\n};\r\n\r\nfunction MobileSidebarPortal({\r\n open,\r\n side,\r\n onOpenChange,\r\n className,\r\n children,\r\n ...props\r\n}: Readonly<MobileSidebarPortalProps>): React.ReactPortal | null {\r\n React.useEffect(() => {\r\n if (!open) {\r\n return;\r\n }\r\n\r\n const previousOverflow = document.body.style.overflow;\r\n const handleKeyDown = (event: KeyboardEvent) => {\r\n if (event.key === \"Escape\") {\r\n onOpenChange(false);\r\n }\r\n };\r\n\r\n document.body.style.overflow = \"hidden\";\r\n globalThis.window.addEventListener(\"keydown\", handleKeyDown);\r\n\r\n return () => {\r\n document.body.style.overflow = previousOverflow;\r\n globalThis.window.removeEventListener(\"keydown\", handleKeyDown);\r\n };\r\n }, [onOpenChange, open]);\r\n\r\n if (!open || typeof document === \"undefined\") {\r\n return null;\r\n }\r\n\r\n return createPortal(\r\n <div className={styles.mobilePortal}>\r\n <button\r\n type='button'\r\n aria-label='Close sidebar'\r\n className={styles.mobileOverlay}\r\n onClick={() => onOpenChange(false)}\r\n />\r\n <div\r\n role='dialog'\r\n aria-modal='true'\r\n aria-label='Sidebar'\r\n data-sidebar='sidebar'\r\n className={cn(styles.mobilePanel, side === \"right\" ? styles.mobilePanelRight : styles.mobilePanelLeft, className)}\r\n style={{\"--ac-sidebar-width\": SIDEBAR_WIDTH_MOBILE} as React.CSSProperties}\r\n {...props}>\r\n <div className={styles.srOnly}>\r\n <h2>Sidebar</h2>\r\n <p>Displays the mobile sidebar.</p>\r\n </div>\r\n <div className={styles.mobileContent}>{children}</div>\r\n </div>\r\n </div>,\r\n document.body,\r\n );\r\n}\r\n\r\n/**\r\n * Renders the primary button used to toggle the sidebar.\r\n *\r\n * @remarks\r\n * - Renders the shared `Button` component\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarTrigger />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/button | HTML button element}\r\n */\r\nconst SidebarTrigger = React.forwardRef<React.ComponentRef<typeof Button>, React.ComponentProps<typeof Button>>(\r\n ({className, onClick, ...props}, ref) => {\r\n const {toggleSidebar} = useSidebar();\r\n\r\n return (\r\n <Button\r\n ref={ref}\r\n data-sidebar='trigger'\r\n variant='ghost'\r\n size='icon'\r\n className={cn(styles.trigger, className)}\r\n onClick={(event) => {\r\n onClick?.(event);\r\n toggleSidebar();\r\n }}\r\n {...props}>\r\n <PanelLeft className={styles.triggerIcon} />\r\n <span className={styles.srOnly}>Toggle Sidebar</span>\r\n </Button>\r\n );\r\n },\r\n);\r\nSidebarTrigger.displayName = \"SidebarTrigger\";\r\n\r\n/**\r\n * Renders a slim rail button used to toggle the sidebar collapsed state.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarRail />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/button | HTML button element}\r\n */\r\nconst SidebarRail = React.forwardRef<HTMLButtonElement, React.ComponentProps<\"button\">>(({className, ...props}, ref) => {\r\n const {toggleSidebar} = useSidebar();\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n data-sidebar='rail'\r\n aria-label='Toggle Sidebar'\r\n tabIndex={-1}\r\n title='Toggle Sidebar'\r\n type='button'\r\n className={cn(styles.rail, className)}\r\n onClick={toggleSidebar}\r\n {...props}\r\n />\r\n );\r\n});\r\nSidebarRail.displayName = \"SidebarRail\";\r\n\r\n/**\r\n * Renders the inset main content region adjacent to the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<main>` element\r\n * - Built as a layout helper for inset sidebar variants\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarInset>Main content</SidebarInset>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/main | HTML main element}\r\n */\r\nconst SidebarInset = React.forwardRef<HTMLDivElement, React.ComponentProps<\"main\">>(({className, ...props}, ref) => (\r\n <main\r\n ref={ref}\r\n className={cn(styles.inset, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarInset.displayName = \"SidebarInset\";\r\n\r\n/**\r\n * Renders a styled input inside sidebar layouts.\r\n *\r\n * @remarks\r\n * - Renders the shared `Input` component\r\n * - Built for sidebar search and filtering affordances\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarInput placeholder='Search...' />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/input | HTML input element}\r\n */\r\nconst SidebarInput = React.forwardRef<React.ComponentRef<typeof Input>, React.ComponentProps<typeof Input>>(\r\n ({className, ...props}, ref) => (\r\n <Input\r\n ref={ref}\r\n data-sidebar='input'\r\n className={cn(styles.input, className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nSidebarInput.displayName = \"SidebarInput\";\r\n\r\n/**\r\n * Renders the header region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for branding or primary controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarHeader>Workspace</SidebarHeader>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarHeader = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='header'\r\n className={cn(styles.header, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarHeader.displayName = \"SidebarHeader\";\r\n\r\n/**\r\n * Renders the footer region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for actions or account controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarFooter>Footer content</SidebarFooter>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarFooter = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='footer'\r\n className={cn(styles.footer, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarFooter.displayName = \"SidebarFooter\";\r\n\r\n/**\r\n * Renders a separator between sidebar regions or menu groups.\r\n *\r\n * @remarks\r\n * - Renders the shared `Separator` component\r\n * - Built as a lightweight structural divider\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarSeparator />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/hr | HTML thematic break}\r\n */\r\nconst SidebarSeparator = React.forwardRef<React.ComponentRef<typeof Separator>, React.ComponentProps<typeof Separator>>(\r\n ({className, ...props}, ref) => (\r\n <Separator\r\n ref={ref}\r\n data-sidebar='separator'\r\n className={cn(styles.separator, className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nSidebarSeparator.displayName = \"SidebarSeparator\";\r\n\r\n/**\r\n * Renders the scrollable content region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for menu groups and custom content\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarContent>\r\n * <SidebarMenu />\r\n * </SidebarContent>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarContent = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='content'\r\n className={cn(styles.content, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarContent.displayName = \"SidebarContent\";\r\n\r\n/**\r\n * Renders a logical grouping container inside the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for related navigation sections\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroup>\r\n * <SidebarGroupLabel>Projects</SidebarGroupLabel>\r\n * </SidebarGroup>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='group'\r\n className={cn(styles.group, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarGroup.displayName = \"SidebarGroup\";\r\n\r\nfunction cloneSidebarChild<TProps extends {className?: string}>(children: React.ReactNode, mergedProps: TProps): React.JSX.Element | null {\r\n if (!React.isValidElement(children)) {\r\n return null;\r\n }\r\n\r\n const child = children as React.ReactElement<TProps>;\r\n\r\n // eslint-disable-next-line react-x/no-clone-element -- replaces Radix Slot while preserving asChild prop merging\r\n return React.cloneElement(child, {\r\n ...mergedProps,\r\n className: cn(mergedProps.className, child.props.className),\r\n });\r\n}\r\n\r\n/**\r\n * Props for the sidebar group label.\r\n */\r\ninterface SidebarGroupLabelProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<div>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\n/**\r\n * Renders the heading label for a sidebar group.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Supports `asChild` composition for custom markup\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupLabel>Projects</SidebarGroupLabel>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(\r\n ({className, asChild = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableDivProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.groupLabel, className),\r\n \"data-sidebar\": \"group-label\",\r\n ref,\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return <div {...mergedProps} />;\r\n },\r\n);\r\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\";\r\n\r\n/**\r\n * Props for the sidebar group action button.\r\n */\r\ninterface SidebarGroupActionProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a secondary action aligned with a sidebar group heading.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition for custom controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupAction aria-label='Add project'>+</SidebarGroupAction>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarGroupAction = React.forwardRef<HTMLButtonElement, SidebarGroupActionProps>(\r\n ({className, asChild = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.groupAction, className),\r\n \"data-sidebar\": \"group-action\",\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n },\r\n);\r\nSidebarGroupAction.displayName = \"SidebarGroupAction\";\r\n\r\n/**\r\n * Renders the content container for a sidebar group.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a structural wrapper for nested menu items or custom content\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupContent>\r\n * <SidebarMenu />\r\n * </SidebarGroupContent>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='group-content'\r\n className={cn(styles.groupContent, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarGroupContent.displayName = \"SidebarGroupContent\";\r\n\r\n/**\r\n * Renders the root sidebar navigation list.\r\n *\r\n * @remarks\r\n * - Renders a `<ul>` element\r\n * - Built as the primary menu container for sidebar navigation\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenu>\r\n * <SidebarMenuItem />\r\n * </SidebarMenu>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/ul | HTML ul element}\r\n */\r\nconst SidebarMenu = React.forwardRef<HTMLUListElement, React.ComponentProps<\"ul\">>(({className, ...props}, ref) => (\r\n <ul\r\n ref={ref}\r\n data-sidebar='menu'\r\n className={cn(styles.menu, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenu.displayName = \"SidebarMenu\";\r\n\r\n/**\r\n * Renders a single list item within the sidebar menu.\r\n *\r\n * @remarks\r\n * - Renders an `<li>` element\r\n * - Built as a structural wrapper for menu buttons and actions\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuItem>\r\n * <SidebarMenuButton>Dashboard</SidebarMenuButton>\r\n * </SidebarMenuItem>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/li | HTML li element}\r\n */\r\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, React.ComponentProps<\"li\">>(({className, ...props}, ref) => (\r\n <li\r\n ref={ref}\r\n data-sidebar='menu-item'\r\n className={cn(styles.menuItem, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuItem.displayName = \"SidebarMenuItem\";\r\n\r\nconst sidebarMenuButtonVariantStyles = {\r\n default: styles.menuButtonDefault,\r\n outline: styles.menuButtonOutline,\r\n} as const;\r\n\r\nconst sidebarMenuButtonSizeStyles = {\r\n default: styles.menuButtonSizeDefault,\r\n sm: styles.menuButtonSizeSm,\r\n lg: styles.menuButtonSizeLg,\r\n} as const;\r\n\r\n/**\r\n * Props for the sidebar menu button.\r\n */\r\ninterface SidebarMenuButtonProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Whether the menu item should be styled as active.\r\n * @default false\r\n */\r\n isActive?: boolean;\r\n /**\r\n * Tooltip content displayed when the sidebar is collapsed on desktop.\r\n * @default undefined\r\n */\r\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\r\n /**\r\n * Visual style variant for the menu button.\r\n * @default \"default\"\r\n */\r\n variant?: keyof typeof sidebarMenuButtonVariantStyles;\r\n /**\r\n * Size preset for the menu button.\r\n * @default \"default\"\r\n */\r\n size?: keyof typeof sidebarMenuButtonSizeStyles;\r\n}\r\n\r\n/**\r\n * Renders the primary interactive element for a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition and contextual tooltips when collapsed\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuButton isActive>Dashboard</SidebarMenuButton>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\r\n ({asChild = false, isActive = false, variant = \"default\", size = \"default\", tooltip, className, children, ...props}, ref) => {\r\n const {isMobile, state} = useSidebar();\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuButton, sidebarMenuButtonVariantStyles[variant], sidebarMenuButtonSizeStyles[size], className),\r\n \"data-active\": isActive,\r\n \"data-sidebar\": \"menu-button\",\r\n \"data-size\": size,\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n const clonedChild = asChild ? cloneSidebarChild(children, mergedProps) : null;\r\n\r\n const button = clonedChild ?? (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n\r\n if (!tooltip) {\r\n return button;\r\n }\r\n\r\n const resolvedTooltip = typeof tooltip === \"string\" ? {children: tooltip} : tooltip;\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger render={button as React.ReactElement} />\r\n <TooltipContent\r\n hidden={state !== \"collapsed\" || isMobile}\r\n {...resolvedTooltip}\r\n />\r\n </Tooltip>\r\n );\r\n },\r\n);\r\nSidebarMenuButton.displayName = \"SidebarMenuButton\";\r\n\r\n/**\r\n * Props for the sidebar menu action button.\r\n */\r\ninterface SidebarMenuActionProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Whether the action should remain hidden until its parent item is hovered.\r\n * @default false\r\n */\r\n showOnHover?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a secondary action button aligned within a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition for custom controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuAction showOnHover>⋯</SidebarMenuAction>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuAction = React.forwardRef<HTMLButtonElement, SidebarMenuActionProps>(\r\n ({className, asChild = false, showOnHover = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuAction, showOnHover && styles.menuActionShowOnHover, className),\r\n \"data-sidebar\": \"menu-action\",\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n },\r\n);\r\nSidebarMenuAction.displayName = \"SidebarMenuAction\";\r\n\r\n/**\r\n * Renders a badge alongside a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a lightweight presentational helper for counts and statuses\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuBadge>3</SidebarMenuBadge>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarMenuBadge = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='menu-badge'\r\n className={cn(styles.menuBadge, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\";\r\n\r\n/**\r\n * Props for the sidebar menu skeleton.\r\n */\r\ninterface SidebarMenuSkeletonProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Whether to render a leading skeleton icon placeholder.\r\n * @default false\r\n */\r\n showIcon?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a loading placeholder for sidebar menu items.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built from shared `Skeleton` primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSkeleton showIcon />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarMenuSkeleton = React.forwardRef<HTMLDivElement, SidebarMenuSkeletonProps>(({className, showIcon = false, ...props}, ref) => {\r\n const width = React.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n data-sidebar='menu-skeleton'\r\n className={cn(styles.menuSkeleton, className)}\r\n {...props}>\r\n {Boolean(showIcon) && (\r\n <Skeleton\r\n className={styles.menuSkeletonIcon}\r\n data-sidebar='menu-skeleton-icon'\r\n />\r\n )}\r\n <Skeleton\r\n className={styles.menuSkeletonText}\r\n data-sidebar='menu-skeleton-text'\r\n style={{\"--ac-skeleton-width\": width} as React.CSSProperties}\r\n />\r\n </div>\r\n );\r\n});\r\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\";\r\n\r\n/**\r\n * Renders a nested menu list within the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<ul>` element\r\n * - Built for multi-level navigation structures\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSub>\r\n * <SidebarMenuSubItem />\r\n * </SidebarMenuSub>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/ul | HTML ul element}\r\n */\r\nconst SidebarMenuSub = React.forwardRef<HTMLUListElement, React.ComponentProps<\"ul\">>(({className, ...props}, ref) => (\r\n <ul\r\n ref={ref}\r\n data-sidebar='menu-sub'\r\n className={cn(styles.menuSub, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuSub.displayName = \"SidebarMenuSub\";\r\n\r\n/**\r\n * Renders a single nested sidebar menu list item.\r\n *\r\n * @remarks\r\n * - Renders an `<li>` element\r\n * - Built as a structural wrapper for nested menu links\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSubItem />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/li | HTML li element}\r\n */\r\nconst SidebarMenuSubItem = React.forwardRef<HTMLLIElement, React.ComponentProps<\"li\">>((props, ref) => (\r\n <li\r\n ref={ref}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\";\r\n\r\n/**\r\n * Props for the sidebar nested menu button.\r\n */\r\ninterface SidebarMenuSubButtonProps extends React.ComponentProps<\"a\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<a>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Size preset for the nested menu link.\r\n * @default \"md\"\r\n */\r\n size?: \"sm\" | \"md\";\r\n /**\r\n * Whether the nested menu item should be styled as active.\r\n * @default undefined\r\n */\r\n isActive?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a nested sidebar menu link.\r\n *\r\n * @remarks\r\n * - Renders an `<a>` element by default\r\n * - Supports `asChild` composition for custom link components\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSubButton href='/settings/profile'>Profile</SidebarMenuSubButton>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuSubButton = React.forwardRef<HTMLAnchorElement, SidebarMenuSubButtonProps>(\r\n ({asChild = false, size = \"md\", isActive, className, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableAnchorProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuSubButton, size === \"sm\" ? styles.menuSubButtonSm : styles.menuSubButtonMd, className),\r\n \"data-active\": isActive,\r\n \"data-sidebar\": \"menu-sub-button\",\r\n \"data-size\": size,\r\n ref,\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return <a {...mergedProps}>{children}</a>;\r\n },\r\n);\r\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\";\r\n\r\nexport {\r\n Sidebar,\r\n SidebarContent,\r\n SidebarFooter,\r\n SidebarGroup,\r\n SidebarGroupAction,\r\n SidebarGroupContent,\r\n SidebarGroupLabel,\r\n SidebarHeader,\r\n SidebarInput,\r\n SidebarInset,\r\n SidebarMenu,\r\n SidebarMenuAction,\r\n SidebarMenuBadge,\r\n SidebarMenuButton,\r\n SidebarMenuItem,\r\n SidebarMenuSkeleton,\r\n SidebarMenuSub,\r\n SidebarMenuSubButton,\r\n SidebarMenuSubItem,\r\n SidebarProvider,\r\n SidebarRail,\r\n SidebarSeparator,\r\n SidebarTrigger,\r\n useSidebar,\r\n};\r\n"],"names":["SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","React","useSidebar","context","Error","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","ref","isMobile","useIsMobile","openMobile","setOpenMobile","internalOpen","setInternalOpen","open","setOpen","value","nextValue","document","toggleSidebar","currentOpen","handleKeyDown","event","globalThis","state","contextValue","TooltipProvider","cn","styles","Sidebar","side","variant","collapsible","MobileSidebarPortal","onOpenChange","previousOverflow","createPortal","SidebarTrigger","onClick","Button","PanelLeft","SidebarRail","SidebarInset","SidebarInput","Input","SidebarHeader","SidebarFooter","SidebarSeparator","Separator","SidebarContent","SidebarGroup","cloneSidebarChild","mergedProps","child","SidebarGroupLabel","asChild","clonedChild","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","sidebarMenuButtonVariantStyles","sidebarMenuButtonSizeStyles","SidebarMenuButton","isActive","size","tooltip","button","resolvedTooltip","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Math","Boolean","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,sBAAsB;AAC5B,MAAMC,yBAAyB;AAC/B,MAAMC,gBAAgB;AACtB,MAAMC,uBAAuB;AAC7B,MAAMC,qBAAqB;AAC3B,MAAMC,4BAA4B;AAiBlC,MAAMC,iBAAiB,WAAHA,GAAGC,cAAgD;AAgBvE,SAASC;IACP,MAAMC,UAAUF,WAAiBD;IAEjC,IAAI,CAACG,SACH,MAAM,IAAIC,MAAM;IAGlB,OAAOD;AACT;AAwCA,MAAME,kBAAkB,WAAHA,GAAGJ,WACtB,CAAC,EAACK,cAAc,IAAI,EAAE,MAAMC,QAAQ,EAAE,cAAcC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,OAAM,EAAEC;IACtG,MAAMC,WAAWC;IACjB,MAAM,CAACC,YAAYC,cAAc,GAAGhB,SAAe;IACnD,MAAM,CAACiB,cAAcC,gBAAgB,GAAGlB,SAAeK;IACvD,MAAMc,OAAOb,YAAYW;IAEzB,MAAMG,UAAUpB,YACd,CAACqB;QACC,MAAMC,YAAY,AAAiB,cAAjB,OAAOD,QAAuBA,MAAMF,QAAQE;QAE9D,IAAId,aACFA,YAAYe;aAEZJ,gBAAgBI;QAIlBC,SAAS,MAAM,GAAG,GAAG9B,oBAAoB,CAAC,EAAE6B,UA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],"sourcesContent":["/* eslint-disable max-lines */\r\n\"use client\";\r\n\r\nimport {PanelLeft} from \"lucide-react\";\r\nimport * as React from \"react\";\r\nimport {createPortal} from \"react-dom\";\r\n\r\nimport {Button} from \"@/components/ui/button\";\r\nimport {Input} from \"@/components/ui/input\";\r\nimport {Separator} from \"@/components/ui/separator\";\r\nimport {Skeleton} from \"@/components/ui/skeleton\";\r\nimport {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from \"@/components/ui/tooltip\";\r\nimport {useIsMobile} from \"@/hooks/useIsMobile\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nimport styles from \"./sidebar.module.css\";\r\n\r\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\";\r\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\r\nconst SIDEBAR_WIDTH = \"16rem\";\r\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\r\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\r\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\r\n\r\ntype SidebarDataAttributes = Record<`data-${string}`, string | boolean | undefined>;\r\ntype SidebarCloneableDivProps = React.ComponentProps<\"div\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLDivElement>};\r\ntype SidebarCloneableButtonProps = React.ComponentProps<\"button\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLButtonElement>};\r\ntype SidebarCloneableAnchorProps = React.ComponentProps<\"a\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLAnchorElement>};\r\n\r\ntype SidebarContextProps = {\r\n state: \"expanded\" | \"collapsed\";\r\n open: boolean;\r\n setOpen: (open: boolean) => void;\r\n openMobile: boolean;\r\n setOpenMobile: (open: boolean) => void;\r\n isMobile: boolean;\r\n toggleSidebar: () => void;\r\n};\r\n\r\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\r\n\r\n/**\r\n * Returns the active sidebar context and enforces provider usage.\r\n *\r\n * @remarks\r\n * Must be called from within {@link SidebarProvider}. Exposes desktop and mobile\r\n * open state along with the shared toggle helper used by sidebar primitives.\r\n *\r\n * @example\r\n * ```tsx\r\n * const {open, toggleSidebar} = useSidebar();\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useContext | React useContext Docs}\r\n */\r\nfunction useSidebar(): SidebarContextProps {\r\n const context = React.useContext(SidebarContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\r\n }\r\n\r\n return context;\r\n}\r\n\r\n/**\r\n * Props for the sidebar provider.\r\n */\r\ninterface SidebarProviderProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Initial uncontrolled open state for desktop layouts.\r\n * @default true\r\n */\r\n defaultOpen?: boolean;\r\n /**\r\n * Controlled open state for desktop layouts.\r\n * @default undefined\r\n */\r\n open?: boolean;\r\n /**\r\n * Callback invoked when the desktop open state changes.\r\n * @default undefined\r\n */\r\n onOpenChange?: (open: boolean) => void;\r\n}\r\n\r\n/**\r\n * Provides shared sidebar state, keyboard shortcuts, and responsive behavior.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built on shared React context and tooltip primitives\r\n * - Persists desktop collapse state to a cookie for cross-page continuity\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarProvider>\r\n * <Sidebar />\r\n * </SidebarProvider>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useContext | React Context Docs}\r\n */\r\nconst SidebarProvider = React.forwardRef<HTMLDivElement, SidebarProviderProps>(\r\n ({defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props}, ref) => {\r\n const isMobile = useIsMobile();\r\n const [openMobile, setOpenMobile] = React.useState(false);\r\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\r\n const open = openProp ?? internalOpen;\r\n\r\n const setOpen = React.useCallback(\r\n (value: boolean | ((value: boolean) => boolean)) => {\r\n const nextValue = typeof value === \"function\" ? value(open) : value;\r\n\r\n if (setOpenProp) {\r\n setOpenProp(nextValue);\r\n } else {\r\n setInternalOpen(nextValue);\r\n }\r\n\r\n // eslint-disable-next-line unicorn/no-document-cookie -- persistent sidebar state matches V1 behavior\r\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${nextValue}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\r\n },\r\n [open, setOpenProp],\r\n );\r\n\r\n const toggleSidebar = React.useCallback(() => {\r\n if (isMobile) {\r\n setOpenMobile((currentOpen) => !currentOpen);\r\n return;\r\n }\r\n\r\n setOpen((currentOpen) => !currentOpen);\r\n }, [isMobile, setOpen]);\r\n\r\n React.useEffect(() => {\r\n const handleKeyDown = (event: KeyboardEvent) => {\r\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\r\n event.preventDefault();\r\n toggleSidebar();\r\n }\r\n };\r\n\r\n globalThis.window.addEventListener(\"keydown\", handleKeyDown);\r\n\r\n return () => {\r\n globalThis.window.removeEventListener(\"keydown\", handleKeyDown);\r\n };\r\n }, [toggleSidebar]);\r\n\r\n const state = open ? \"expanded\" : \"collapsed\";\r\n\r\n const contextValue = React.useMemo<SidebarContextProps>(\r\n () => ({\r\n isMobile,\r\n open,\r\n openMobile,\r\n setOpen,\r\n setOpenMobile,\r\n state,\r\n toggleSidebar,\r\n }),\r\n [isMobile, open, openMobile, setOpen, state, toggleSidebar],\r\n );\r\n\r\n return (\r\n <SidebarContext.Provider value={contextValue}>\r\n <TooltipProvider>\r\n <div\r\n ref={ref}\r\n style={\r\n {\r\n \"--ac-sidebar-width\": SIDEBAR_WIDTH,\r\n \"--ac-sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\r\n ...style,\r\n } as React.CSSProperties\r\n }\r\n className={cn(styles.wrapper, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n </TooltipProvider>\r\n </SidebarContext.Provider>\r\n );\r\n },\r\n);\r\nSidebarProvider.displayName = \"SidebarProvider\";\r\n\r\n/**\r\n * Props for the root sidebar panel.\r\n */\r\ntype SidebarProps = React.ComponentProps<\"div\"> & {\r\n /**\r\n * Edge of the screen where the sidebar is rendered.\r\n * @default \"left\"\r\n */\r\n side?: \"left\" | \"right\";\r\n /**\r\n * Visual presentation style used for desktop rendering.\r\n * @default \"sidebar\"\r\n */\r\n variant?: \"sidebar\" | \"floating\" | \"inset\";\r\n /**\r\n * Desktop collapse behavior for the sidebar.\r\n * @default \"offcanvas\"\r\n */\r\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\r\n};\r\n\r\n/**\r\n * Renders the responsive sidebar panel for desktop and mobile layouts.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element on desktop and a dialog portal on mobile\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <Sidebar>\r\n * <SidebarContent />\r\n * </Sidebar>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/Accessibility/ARIA/Roles/dialog_role | ARIA Dialog Role}\r\n */\r\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\r\n ({side = \"left\", variant = \"sidebar\", collapsible = \"offcanvas\", className, children, ...props}, ref) => {\r\n const {isMobile, openMobile, setOpenMobile, state} = useSidebar();\r\n\r\n if (collapsible === \"none\") {\r\n return (\r\n <div\r\n ref={ref}\r\n className={cn(styles.staticSidebar, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n }\r\n\r\n if (isMobile) {\r\n return (\r\n <MobileSidebarPortal\r\n className={className}\r\n open={openMobile}\r\n side={side}\r\n onOpenChange={setOpenMobile}\r\n {...props}>\r\n {children}\r\n </MobileSidebarPortal>\r\n );\r\n }\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n className={styles.desktopRoot}\r\n data-state={state}\r\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\r\n data-variant={variant}\r\n data-side={side}>\r\n <div className={styles.gap} />\r\n <div\r\n className={cn(styles.panelWrap, className)}\r\n {...props}>\r\n <div\r\n data-sidebar='sidebar'\r\n className={styles.panel}>\r\n {children}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n },\r\n);\r\nSidebar.displayName = \"Sidebar\";\r\n\r\ntype MobileSidebarPortalProps = React.ComponentProps<\"div\"> & {\r\n open: boolean;\r\n side: \"left\" | \"right\";\r\n onOpenChange: (open: boolean) => void;\r\n};\r\n\r\nfunction MobileSidebarPortal({\r\n open,\r\n side,\r\n onOpenChange,\r\n className,\r\n children,\r\n ...props\r\n}: Readonly<MobileSidebarPortalProps>): React.ReactPortal | null {\r\n React.useEffect(() => {\r\n if (!open) {\r\n return;\r\n }\r\n\r\n const previousOverflow = document.body.style.overflow;\r\n const handleKeyDown = (event: KeyboardEvent) => {\r\n if (event.key === \"Escape\") {\r\n onOpenChange(false);\r\n }\r\n };\r\n\r\n document.body.style.overflow = \"hidden\";\r\n globalThis.window.addEventListener(\"keydown\", handleKeyDown);\r\n\r\n return () => {\r\n document.body.style.overflow = previousOverflow;\r\n globalThis.window.removeEventListener(\"keydown\", handleKeyDown);\r\n };\r\n }, [onOpenChange, open]);\r\n\r\n if (!open || typeof document === \"undefined\") {\r\n return null;\r\n }\r\n\r\n return createPortal(\r\n <div className={styles.mobilePortal}>\r\n <button\r\n type='button'\r\n aria-label='Close sidebar'\r\n className={styles.mobileOverlay}\r\n onClick={() => onOpenChange(false)}\r\n />\r\n <div\r\n role='dialog'\r\n aria-modal='true'\r\n aria-label='Sidebar'\r\n data-sidebar='sidebar'\r\n className={cn(styles.mobilePanel, side === \"right\" ? styles.mobilePanelRight : styles.mobilePanelLeft, className)}\r\n style={{\"--ac-sidebar-width\": SIDEBAR_WIDTH_MOBILE} as React.CSSProperties}\r\n {...props}>\r\n <div className={styles.srOnly}>\r\n <h2>Sidebar</h2>\r\n <p>Displays the mobile sidebar.</p>\r\n </div>\r\n <div className={styles.mobileContent}>{children}</div>\r\n </div>\r\n </div>,\r\n document.body,\r\n );\r\n}\r\n\r\n/**\r\n * Renders the primary button used to toggle the sidebar.\r\n *\r\n * @remarks\r\n * - Renders the shared `Button` component\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarTrigger />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/button | HTML button element}\r\n */\r\nconst SidebarTrigger = React.forwardRef<React.ComponentRef<typeof Button>, React.ComponentProps<typeof Button>>(\r\n ({className, onClick, ...props}, ref) => {\r\n const {toggleSidebar} = useSidebar();\r\n\r\n return (\r\n <Button\r\n ref={ref}\r\n data-sidebar='trigger'\r\n variant='ghost'\r\n size='icon'\r\n className={cn(styles.trigger, className)}\r\n onClick={(event) => {\r\n onClick?.(event);\r\n toggleSidebar();\r\n }}\r\n {...props}>\r\n <PanelLeft className={styles.triggerIcon} />\r\n <span className={styles.srOnly}>Toggle Sidebar</span>\r\n </Button>\r\n );\r\n },\r\n);\r\nSidebarTrigger.displayName = \"SidebarTrigger\";\r\n\r\n/**\r\n * Renders a slim rail button used to toggle the sidebar collapsed state.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarRail />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/button | HTML button element}\r\n */\r\nconst SidebarRail = React.forwardRef<HTMLButtonElement, React.ComponentProps<\"button\">>(({className, ...props}, ref) => {\r\n const {toggleSidebar} = useSidebar();\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n data-sidebar='rail'\r\n aria-label='Toggle Sidebar'\r\n tabIndex={-1}\r\n title='Toggle Sidebar'\r\n type='button'\r\n className={cn(styles.rail, className)}\r\n onClick={toggleSidebar}\r\n {...props}\r\n />\r\n );\r\n});\r\nSidebarRail.displayName = \"SidebarRail\";\r\n\r\n/**\r\n * Renders the inset main content region adjacent to the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<main>` element\r\n * - Built as a layout helper for inset sidebar variants\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarInset>Main content</SidebarInset>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/main | HTML main element}\r\n */\r\nconst SidebarInset = React.forwardRef<HTMLDivElement, React.ComponentProps<\"main\">>(({className, ...props}, ref) => (\r\n <main\r\n ref={ref}\r\n className={cn(styles.inset, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarInset.displayName = \"SidebarInset\";\r\n\r\n/**\r\n * Renders a styled input inside sidebar layouts.\r\n *\r\n * @remarks\r\n * - Renders the shared `Input` component\r\n * - Built for sidebar search and filtering affordances\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarInput placeholder='Search...' />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/input | HTML input element}\r\n */\r\nconst SidebarInput = React.forwardRef<React.ComponentRef<typeof Input>, React.ComponentProps<typeof Input>>(\r\n ({className, ...props}, ref) => (\r\n <Input\r\n ref={ref}\r\n data-sidebar='input'\r\n className={cn(styles.input, className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nSidebarInput.displayName = \"SidebarInput\";\r\n\r\n/**\r\n * Renders the header region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for branding or primary controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarHeader>Workspace</SidebarHeader>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarHeader = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='header'\r\n className={cn(styles.header, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarHeader.displayName = \"SidebarHeader\";\r\n\r\n/**\r\n * Renders the footer region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for actions or account controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarFooter>Footer content</SidebarFooter>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarFooter = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='footer'\r\n className={cn(styles.footer, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarFooter.displayName = \"SidebarFooter\";\r\n\r\n/**\r\n * Renders a separator between sidebar regions or menu groups.\r\n *\r\n * @remarks\r\n * - Renders the shared `Separator` component\r\n * - Built as a lightweight structural divider\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarSeparator />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/hr | HTML thematic break}\r\n */\r\nconst SidebarSeparator = React.forwardRef<React.ComponentRef<typeof Separator>, React.ComponentProps<typeof Separator>>(\r\n ({className, ...props}, ref) => (\r\n <Separator\r\n ref={ref}\r\n data-sidebar='separator'\r\n className={cn(styles.separator, className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nSidebarSeparator.displayName = \"SidebarSeparator\";\r\n\r\n/**\r\n * Renders the scrollable content region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for menu groups and custom content\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarContent>\r\n * <SidebarMenu />\r\n * </SidebarContent>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarContent = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='content'\r\n className={cn(styles.content, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarContent.displayName = \"SidebarContent\";\r\n\r\n/**\r\n * Renders a logical grouping container inside the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for related navigation sections\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroup>\r\n * <SidebarGroupLabel>Projects</SidebarGroupLabel>\r\n * </SidebarGroup>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='group'\r\n className={cn(styles.group, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarGroup.displayName = \"SidebarGroup\";\r\n\r\nfunction cloneSidebarChild<TProps extends {className?: string}>(children: React.ReactNode, mergedProps: TProps): React.JSX.Element | null {\r\n if (!React.isValidElement(children)) {\r\n return null;\r\n }\r\n\r\n const child = children as React.ReactElement<TProps>;\r\n\r\n // eslint-disable-next-line react-x/no-clone-element -- replaces Radix Slot while preserving asChild prop merging\r\n return React.cloneElement(child, {\r\n ...mergedProps,\r\n className: cn(mergedProps.className, child.props.className),\r\n });\r\n}\r\n\r\n/**\r\n * Props for the sidebar group label.\r\n */\r\ninterface SidebarGroupLabelProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<div>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\n/**\r\n * Renders the heading label for a sidebar group.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Supports `asChild` composition for custom markup\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupLabel>Projects</SidebarGroupLabel>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(\r\n ({className, asChild = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableDivProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.groupLabel, className),\r\n \"data-sidebar\": \"group-label\",\r\n ref,\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return <div {...mergedProps} />;\r\n },\r\n);\r\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\";\r\n\r\n/**\r\n * Props for the sidebar group action button.\r\n */\r\ninterface SidebarGroupActionProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a secondary action aligned with a sidebar group heading.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition for custom controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupAction aria-label='Add project'>+</SidebarGroupAction>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarGroupAction = React.forwardRef<HTMLButtonElement, SidebarGroupActionProps>(\r\n ({className, asChild = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.groupAction, className),\r\n \"data-sidebar\": \"group-action\",\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n },\r\n);\r\nSidebarGroupAction.displayName = \"SidebarGroupAction\";\r\n\r\n/**\r\n * Renders the content container for a sidebar group.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a structural wrapper for nested menu items or custom content\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupContent>\r\n * <SidebarMenu />\r\n * </SidebarGroupContent>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='group-content'\r\n className={cn(styles.groupContent, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarGroupContent.displayName = \"SidebarGroupContent\";\r\n\r\n/**\r\n * Renders the root sidebar navigation list.\r\n *\r\n * @remarks\r\n * - Renders a `<ul>` element\r\n * - Built as the primary menu container for sidebar navigation\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenu>\r\n * <SidebarMenuItem />\r\n * </SidebarMenu>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/ul | HTML ul element}\r\n */\r\nconst SidebarMenu = React.forwardRef<HTMLUListElement, React.ComponentProps<\"ul\">>(({className, ...props}, ref) => (\r\n <ul\r\n ref={ref}\r\n data-sidebar='menu'\r\n className={cn(styles.menu, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenu.displayName = \"SidebarMenu\";\r\n\r\n/**\r\n * Renders a single list item within the sidebar menu.\r\n *\r\n * @remarks\r\n * - Renders an `<li>` element\r\n * - Built as a structural wrapper for menu buttons and actions\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuItem>\r\n * <SidebarMenuButton>Dashboard</SidebarMenuButton>\r\n * </SidebarMenuItem>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/li | HTML li element}\r\n */\r\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, React.ComponentProps<\"li\">>(({className, ...props}, ref) => (\r\n <li\r\n ref={ref}\r\n data-sidebar='menu-item'\r\n className={cn(styles.menuItem, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuItem.displayName = \"SidebarMenuItem\";\r\n\r\nconst sidebarMenuButtonVariantStyles = {\r\n default: styles.menuButtonDefault,\r\n outline: styles.menuButtonOutline,\r\n} as const;\r\n\r\nconst sidebarMenuButtonSizeStyles = {\r\n default: styles.menuButtonSizeDefault,\r\n sm: styles.menuButtonSizeSm,\r\n lg: styles.menuButtonSizeLg,\r\n} as const;\r\n\r\n/**\r\n * Props for the sidebar menu button.\r\n */\r\ninterface SidebarMenuButtonProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Whether the menu item should be styled as active.\r\n * @default false\r\n */\r\n isActive?: boolean;\r\n /**\r\n * Tooltip content displayed when the sidebar is collapsed on desktop.\r\n * @default undefined\r\n */\r\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\r\n /**\r\n * Visual style variant for the menu button.\r\n * @default \"default\"\r\n */\r\n variant?: keyof typeof sidebarMenuButtonVariantStyles;\r\n /**\r\n * Size preset for the menu button.\r\n * @default \"default\"\r\n */\r\n size?: keyof typeof sidebarMenuButtonSizeStyles;\r\n}\r\n\r\n/**\r\n * Renders the primary interactive element for a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition and contextual tooltips when collapsed\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuButton isActive>Dashboard</SidebarMenuButton>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\r\n ({asChild = false, isActive = false, variant = \"default\", size = \"default\", tooltip, className, children, ...props}, ref) => {\r\n const {isMobile, state} = useSidebar();\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuButton, sidebarMenuButtonVariantStyles[variant], sidebarMenuButtonSizeStyles[size], className),\r\n \"data-active\": isActive,\r\n \"data-sidebar\": \"menu-button\",\r\n \"data-size\": size,\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n const clonedChild = asChild ? cloneSidebarChild(children, mergedProps) : null;\r\n\r\n const button = clonedChild ?? (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n\r\n if (!tooltip) {\r\n return button;\r\n }\r\n\r\n const resolvedTooltip = typeof tooltip === \"string\" ? {children: tooltip} : tooltip;\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger render={button as React.ReactElement} />\r\n <TooltipContent\r\n hidden={state !== \"collapsed\" || isMobile}\r\n {...resolvedTooltip}\r\n />\r\n </Tooltip>\r\n );\r\n },\r\n);\r\nSidebarMenuButton.displayName = \"SidebarMenuButton\";\r\n\r\n/**\r\n * Props for the sidebar menu action button.\r\n */\r\ninterface SidebarMenuActionProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Whether the action should remain hidden until its parent item is hovered.\r\n * @default false\r\n */\r\n showOnHover?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a secondary action button aligned within a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition for custom controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuAction showOnHover>⋯</SidebarMenuAction>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuAction = React.forwardRef<HTMLButtonElement, SidebarMenuActionProps>(\r\n ({className, asChild = false, showOnHover = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuAction, showOnHover && styles.menuActionShowOnHover, className),\r\n \"data-sidebar\": \"menu-action\",\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n },\r\n);\r\nSidebarMenuAction.displayName = \"SidebarMenuAction\";\r\n\r\n/**\r\n * Renders a badge alongside a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a lightweight presentational helper for counts and statuses\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuBadge>3</SidebarMenuBadge>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarMenuBadge = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='menu-badge'\r\n className={cn(styles.menuBadge, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\";\r\n\r\n/**\r\n * Props for the sidebar menu skeleton.\r\n */\r\ninterface SidebarMenuSkeletonProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Whether to render a leading skeleton icon placeholder.\r\n * @default false\r\n */\r\n showIcon?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a loading placeholder for sidebar menu items.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built from shared `Skeleton` primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSkeleton showIcon />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarMenuSkeleton = React.forwardRef<HTMLDivElement, SidebarMenuSkeletonProps>(({className, showIcon = false, ...props}, ref) => {\r\n const width = React.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n data-sidebar='menu-skeleton'\r\n className={cn(styles.menuSkeleton, className)}\r\n {...props}>\r\n {Boolean(showIcon) && (\r\n <Skeleton\r\n className={styles.menuSkeletonIcon}\r\n data-sidebar='menu-skeleton-icon'\r\n />\r\n )}\r\n <Skeleton\r\n className={styles.menuSkeletonText}\r\n data-sidebar='menu-skeleton-text'\r\n style={{\"--ac-skeleton-width\": width} as React.CSSProperties}\r\n />\r\n </div>\r\n );\r\n});\r\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\";\r\n\r\n/**\r\n * Renders a nested menu list within the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<ul>` element\r\n * - Built for multi-level navigation structures\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSub>\r\n * <SidebarMenuSubItem />\r\n * </SidebarMenuSub>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/ul | HTML ul element}\r\n */\r\nconst SidebarMenuSub = React.forwardRef<HTMLUListElement, React.ComponentProps<\"ul\">>(({className, ...props}, ref) => (\r\n <ul\r\n ref={ref}\r\n data-sidebar='menu-sub'\r\n className={cn(styles.menuSub, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuSub.displayName = \"SidebarMenuSub\";\r\n\r\n/**\r\n * Renders a single nested sidebar menu list item.\r\n *\r\n * @remarks\r\n * - Renders an `<li>` element\r\n * - Built as a structural wrapper for nested menu links\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSubItem />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/li | HTML li element}\r\n */\r\nconst SidebarMenuSubItem = React.forwardRef<HTMLLIElement, React.ComponentProps<\"li\">>((props, ref) => (\r\n <li\r\n ref={ref}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\";\r\n\r\n/**\r\n * Props for the sidebar nested menu button.\r\n */\r\ninterface SidebarMenuSubButtonProps extends React.ComponentProps<\"a\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<a>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Size preset for the nested menu link.\r\n * @default \"md\"\r\n */\r\n size?: \"sm\" | \"md\";\r\n /**\r\n * Whether the nested menu item should be styled as active.\r\n * @default undefined\r\n */\r\n isActive?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a nested sidebar menu link.\r\n *\r\n * @remarks\r\n * - Renders an `<a>` element by default\r\n * - Supports `asChild` composition for custom link components\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSubButton href='/settings/profile'>Profile</SidebarMenuSubButton>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuSubButton = React.forwardRef<HTMLAnchorElement, SidebarMenuSubButtonProps>(\r\n ({asChild = false, size = \"md\", isActive, className, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableAnchorProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuSubButton, size === \"sm\" ? styles.menuSubButtonSm : styles.menuSubButtonMd, className),\r\n \"data-active\": isActive,\r\n \"data-sidebar\": \"menu-sub-button\",\r\n \"data-size\": size,\r\n ref,\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return <a {...mergedProps}>{children}</a>;\r\n },\r\n);\r\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\";\r\n\r\nexport {\r\n Sidebar,\r\n SidebarContent,\r\n SidebarFooter,\r\n SidebarGroup,\r\n SidebarGroupAction,\r\n SidebarGroupContent,\r\n SidebarGroupLabel,\r\n SidebarHeader,\r\n SidebarInput,\r\n SidebarInset,\r\n SidebarMenu,\r\n SidebarMenuAction,\r\n SidebarMenuBadge,\r\n SidebarMenuButton,\r\n SidebarMenuItem,\r\n SidebarMenuSkeleton,\r\n SidebarMenuSub,\r\n SidebarMenuSubButton,\r\n SidebarMenuSubItem,\r\n SidebarProvider,\r\n SidebarRail,\r\n SidebarSeparator,\r\n SidebarTrigger,\r\n useSidebar,\r\n};\r\n"],"names":["SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","React","useSidebar","context","Error","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","ref","isMobile","useIsMobile","openMobile","setOpenMobile","internalOpen","setInternalOpen","open","setOpen","value","nextValue","document","toggleSidebar","currentOpen","handleKeyDown","event","globalThis","state","contextValue","TooltipProvider","cn","styles","Sidebar","side","variant","collapsible","MobileSidebarPortal","onOpenChange","previousOverflow","createPortal","SidebarTrigger","onClick","Button","PanelLeft","SidebarRail","SidebarInset","SidebarInput","Input","SidebarHeader","SidebarFooter","SidebarSeparator","Separator","SidebarContent","SidebarGroup","cloneSidebarChild","mergedProps","child","SidebarGroupLabel","asChild","clonedChild","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","sidebarMenuButtonVariantStyles","sidebarMenuButtonSizeStyles","SidebarMenuButton","isActive","size","tooltip","button","resolvedTooltip","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Math","Boolean","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,sBAAsB;AAC5B,MAAMC,yBAAyB;AAC/B,MAAMC,gBAAgB;AACtB,MAAMC,uBAAuB;AAC7B,MAAMC,qBAAqB;AAC3B,MAAMC,4BAA4B;AAiBlC,MAAMC,iBAAiB,WAAHA,GAAGC,cAAgD;AAgBvE,SAASC;IACP,MAAM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uB,WAAHA,GAAGxF,WAC3B,CAAC,EAAC4D,UAAU,KAAK,EAAEU,OAAO,IAAI,EAAED,QAAQ,EAAE7D,SAAS,EAAEE,QAAQ,EAAE,GAAGC,OAAM,EAAEC;IACxE,MAAM6C,cAA2C;QAC/C,GAAG9C,KAAK;QACRD;QACA,WAAWsB,GAAGC,eAAAA,aAAoB,EAAEqC,AAAS,SAATA,OAAgBrC,eAAAA,eAAsB,GAAGA,eAAAA,eAAsB,EAAEzB;QACrG,eAAe6D;QACf,gBAAgB;QAChB,aAAaC;QACb1D;IACF;IAEA,IAAIgD,SAAS;QACX,MAAMC,cAAcL,kBAAkB9C,UAAU+C;QAEhD,IAAII,aACF,OAAOA;IAEX;IAEA,OAAO,WAAP,GAAO,IAAC;QAAG,GAAGJ,WAAW;kBAAG/C;;AAC9B;AAEF8E,qBAAqB,WAAW,GAAG"}
@@ -115,10 +115,11 @@ interface ToastApi {
115
115
  *
116
116
  * @see {@link https://base-ui.com/react/components/toast | Base UI Toast Docs}
117
117
  */
118
- declare function Toaster({ className, closeButton, containerAriaLabel, duration, position, style, toastOptions, visibleToasts, }: Readonly<ToasterProps>): React.JSX.Element;
119
- declare namespace Toaster {
120
- var displayName: string;
121
- }
118
+ /**
119
+ * Toaster is the root viewport container for displaying toast notifications.
120
+ * It should be rendered once at the app root level.
121
+ */
122
+ declare const Toaster: React.ForwardRefExoticComponent<ToasterProps & React.RefAttributes<HTMLDivElement>>;
122
123
  /**
123
124
  * Imperative toast API for creating transient notifications outside React render flows.
124
125
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sonner.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,KAAK,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,GAAG,YAAY,GAAG,eAAe,CAAC;AAChH,KAAK,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,O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,OAAO,EAAE,kBAAkB,KAAK,MAAM,CAAC;IAC1E,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,eAAe,KAAK,MAAM,GAAG,SAAS,CAAC;IAC3D,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;IACvG,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;IAC9F,SAAS,EAAE,MAAM,aAAa,CAAC,aAAa,CAAC,CAAC;IAC9C,UAAU,EAAE,MAAM,aAAa,CAAC,aAAa,CAAC,CAAC;CAChD;AAsaD;;;;;;;;;;;;;GAaG;AACH;;;GAGG;AACH,QAAA,MAAM,OAAO,qFA0CX,CAAC;AAIH;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,KAAK,EAA6G,QAAQ,CAAC;AA8HjI,YAAY,EAAC,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Toast } from "@base-ui/react/toast";
4
4
  import { AlertCircle, BellRing, CheckCircle2, Info, LoaderCircle, TriangleAlert, X } from "lucide-react";
5
- import { isValidElement, useEffect, useId } from "react";
5
+ import { forwardRef, isValidElement, useEffect, useId } from "react";
6
6
  import { cn } from "../../lib/utilities.js";
7
7
  import sonner_module from "./sonner.module.js";
8
8
  const DEFAULT_TOAST_DURATION = 5000;
@@ -180,7 +180,7 @@ function updateToast(toastId, options) {
180
180
  const normalizedToastId = String(toastId);
181
181
  const existingRecord = toastRecords.get(normalizedToastId);
182
182
  const mergedOptions = {
183
- ...existingRecord?.options ?? {},
183
+ ...existingRecord?.options,
184
184
  ...options
185
185
  };
186
186
  const variant = options.variant ?? existingRecord?.snapshot.variant ?? "default";
@@ -322,7 +322,7 @@ function ToastViewportContent() {
322
322
  })
323
323
  });
324
324
  }
325
- function Toaster({ className, closeButton = true, containerAriaLabel = DEFAULT_VIEWPORT_ARIA_LABEL, duration = DEFAULT_TOAST_DURATION, position = "bottom-right", style, toastOptions, visibleToasts = DEFAULT_TOAST_LIMIT }) {
325
+ const sonner_Toaster = /*#__PURE__*/ forwardRef(function({ className, closeButton = true, containerAriaLabel = DEFAULT_VIEWPORT_ARIA_LABEL, duration = DEFAULT_TOAST_DURATION, position = "bottom-right", style, toastOptions, visibleToasts = DEFAULT_TOAST_LIMIT }, forwardedRef) {
326
326
  const toasterId = useId();
327
327
  useEffect(()=>{
328
328
  toasterRegistrations.set(toasterId, {
@@ -343,6 +343,7 @@ function Toaster({ className, closeButton = true, containerAriaLabel = DEFAULT_V
343
343
  toastManager: toastManager,
344
344
  children: /*#__PURE__*/ jsx(Toast.Portal, {
345
345
  children: /*#__PURE__*/ jsx(Toast.Viewport, {
346
+ ref: forwardedRef,
346
347
  "aria-label": containerAriaLabel,
347
348
  className: cn(sonner_module.viewport, positionStyles[position], className),
348
349
  style: style,
@@ -350,8 +351,8 @@ function Toaster({ className, closeButton = true, containerAriaLabel = DEFAULT_V
350
351
  })
351
352
  })
352
353
  });
353
- }
354
- Toaster.displayName = "Toaster";
354
+ });
355
+ sonner_Toaster.displayName = "Toaster";
355
356
  const toast = (message, options)=>showToast(message, "default", options);
356
357
  toast.success = (message, options)=>showToast(message, "success", options);
357
358
  toast.error = (message, options)=>showToast(message, "error", options);
@@ -451,6 +452,6 @@ toast.getToasts = ()=>[
451
452
  toast.getHistory = ()=>[
452
453
  ...toastHistory
453
454
  ];
454
- export { Toaster, toast };
455
+ export { sonner_Toaster as Toaster, toast };
455
456
 
456
457
  //# sourceMappingURL=sonner.js.map