Skip to content

Commit

Permalink
fix(pixels): small fixes for Drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
toxsick committed Jan 7, 2025
1 parent 10e3cc9 commit 34c6886
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
25 changes: 5 additions & 20 deletions packages/pixels/src/Drawer/Drawer.stories.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -28,15 +22,6 @@ const meta: Meta<typeof Drawer> = {
export default meta;
type Story = StoryObj<DrawerProps>;

// 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);

Expand Down Expand Up @@ -114,7 +99,7 @@ export const CustomWidth: Story = {

const SizeTemplate: Story['render'] = (args) => {
const [{ openDrawers }, updateArgs] = useArgs<{
openDrawers: OpenDrawersState;
openDrawers: Record<string, boolean>;
}>();

return (
Expand Down Expand Up @@ -178,7 +163,7 @@ export const AllSizes: Story = {

const RadiiTemplate: Story['render'] = (args) => {
const [{ openDrawers }, updateArgs] = useArgs<{
openDrawers: OpenDrawersState;
openDrawers: Record<string, boolean>;
}>();

return (
Expand Down Expand Up @@ -242,7 +227,7 @@ export const AllRadii: Story = {

const PlacementTemplate: Story['render'] = (args) => {
const [{ openDrawers }, updateArgs] = useArgs<{
openDrawers: OpenDrawersState;
openDrawers: Record<string, boolean>;
}>();

return (
Expand Down Expand Up @@ -306,7 +291,7 @@ export const AllPlacements: Story = {

const BackdropTemplate: Story['render'] = (args) => {
const [{ openDrawers }, updateArgs] = useArgs<{
openDrawers: OpenDrawersState;
openDrawers: Record<string, boolean>;
}>();

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/pixels/src/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Drawer = ({
onOpenChange = undefined,
placement = 'right',
portalContainer = undefined,
radius = 'none',
radius = 'lg',
size = 'md',
testId = undefined,
}: DrawerProps) => {
Expand Down

0 comments on commit 34c6886

Please sign in to comment.