Skip to content

Commit e3de6a5

Browse files
committed
Parametrize drawer direction
1 parent e7b13c2 commit e3de6a5

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
- [2025-12-13] [Parametrize drawer direction](https://github.com/RubricLab/ui/commit/c651f7db69dbf26463c3c3d84d8ef90197ec7a08)
12
- [2025-12-13] [Support ref prop on interactive components](https://github.com/RubricLab/ui/commit/12d61d1abe2a73b45aa1d9bb04e2a43f1bd186b6)
23
- [2025-12-13] [Add missing package repo field](https://github.com/RubricLab/ui/commit/1455da66d5986829514e65ee905bff45d50ee1c4)
34
- [2025-12-13] [Standardize publish file name](https://github.com/RubricLab/ui/commit/1b256d2160f52441a43fe45f9280d20dec684a5d)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@
5757
"post-commit": "bun x @rubriclab/package post-commit"
5858
},
5959
"types": "./src/index.ts",
60-
"version": "5.1.53"
60+
"version": "5.1.54"
6161
}

src/components/drawer.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type * as React from 'react'
2-
import { Drawer as DrawerPrimitive } from 'vaul'
2+
import { type DialogProps, Drawer as DrawerPrimitive } from 'vaul'
33
import { headingLevelClasses, textSizeClasses, textVariantClasses } from '../styles/classes'
44
import type {
55
DrawerBodyProps,
@@ -15,9 +15,13 @@ import { cn } from '../utils'
1515
import { Button } from './button'
1616
import { Container } from './container'
1717

18-
const Drawer: React.FC<DrawerProps> = ({ children }) => {
18+
const Drawer: React.FC<DrawerProps & DialogProps> = ({
19+
children,
20+
direction = 'right',
21+
...props
22+
}) => {
1923
return (
20-
<DrawerPrimitive.Root data-slot="drawer" direction="right">
24+
<DrawerPrimitive.Root data-slot="drawer" direction={direction} {...props}>
2125
{children}
2226
</DrawerPrimitive.Root>
2327
)

0 commit comments

Comments
 (0)