From 34c6886f2f463f3699ea97ced33ba464a1b86499 Mon Sep 17 00:00:00 2001 From: Hannes Tiede <951466+toxsick@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:48:25 +0100 Subject: [PATCH] fix(pixels): small fixes for Drawer #667 --- packages/pixels/src/Drawer/Drawer.stories.tsx | 25 ++++--------------- packages/pixels/src/Drawer/Drawer.tsx | 2 +- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/packages/pixels/src/Drawer/Drawer.stories.tsx b/packages/pixels/src/Drawer/Drawer.stories.tsx index 6633673a..59b9ad40 100644 --- a/packages/pixels/src/Drawer/Drawer.stories.tsx +++ b/packages/pixels/src/Drawer/Drawer.stories.tsx @@ -1,11 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react'; -import type { - DrawerBackdrop, - DrawerPlacement, - DrawerProps, - DrawerRadius, - DrawerSizes, -} from './Drawer'; +import type { DrawerProps } from './Drawer'; import { Fragment, useState } from 'react'; @@ -28,15 +22,6 @@ const meta: Meta = { export default meta; type Story = StoryObj; -// Helper type for drawer sizes -type OpenDrawersState = { - [K in - | DrawerSizes - | DrawerRadius - | DrawerPlacement - | DrawerBackdrop]?: boolean; -}; - const Template: Story['render'] = (args, { canvasElement }) => { const [isOpen, setIsOpen] = useState(false); @@ -114,7 +99,7 @@ export const CustomWidth: Story = { const SizeTemplate: Story['render'] = (args) => { const [{ openDrawers }, updateArgs] = useArgs<{ - openDrawers: OpenDrawersState; + openDrawers: Record; }>(); return ( @@ -178,7 +163,7 @@ export const AllSizes: Story = { const RadiiTemplate: Story['render'] = (args) => { const [{ openDrawers }, updateArgs] = useArgs<{ - openDrawers: OpenDrawersState; + openDrawers: Record; }>(); return ( @@ -242,7 +227,7 @@ export const AllRadii: Story = { const PlacementTemplate: Story['render'] = (args) => { const [{ openDrawers }, updateArgs] = useArgs<{ - openDrawers: OpenDrawersState; + openDrawers: Record; }>(); return ( @@ -306,7 +291,7 @@ export const AllPlacements: Story = { const BackdropTemplate: Story['render'] = (args) => { const [{ openDrawers }, updateArgs] = useArgs<{ - openDrawers: OpenDrawersState; + openDrawers: Record; }>(); return ( diff --git a/packages/pixels/src/Drawer/Drawer.tsx b/packages/pixels/src/Drawer/Drawer.tsx index f80f2f80..a8643a49 100644 --- a/packages/pixels/src/Drawer/Drawer.tsx +++ b/packages/pixels/src/Drawer/Drawer.tsx @@ -103,7 +103,7 @@ const Drawer = ({ onOpenChange = undefined, placement = 'right', portalContainer = undefined, - radius = 'none', + radius = 'lg', size = 'md', testId = undefined, }: DrawerProps) => {