Skip to content

Commit

Permalink
fix(components): Sheet orientation in stories
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenComp committed Nov 3, 2024
1 parent 4f136a3 commit ca36750
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
4 changes: 3 additions & 1 deletion front/src/components/ui/label.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ type Story = StoryObj<LabelProps>;
const Render = (args: LabelProps) => (
<div className="flex items-center space-x-2">
<Checkbox id="example" />
<Label htmlFor="example" {...args}>Click me!</Label>
<Label htmlFor="example" {...args}>
Click me!
</Label>
</div>
);

Expand Down
27 changes: 15 additions & 12 deletions front/src/components/ui/label.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
"use client"
"use client";

import { Root } from "@radix-ui/react-label";
import React from "react"
import React from "react";

import { cn } from "@/lib/utils"
import { cn } from "@/lib/utils";

export type LabelProps = React.ComponentPropsWithoutRef<typeof Root>
export type LabelProps = React.ComponentPropsWithoutRef<typeof Root>;

const Label = React.forwardRef<React.ElementRef<typeof Root>, LabelProps>(({ className, ...props }, ref) => (
<Root
ref={ref}
className={cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-primary", className)}
{...props}
/>
))
Label.displayName = Root.displayName
<Root
ref={ref}
className={cn(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-primary",
className,
)}
{...props}
/>
));
Label.displayName = Root.displayName;

export { Label }
export { Label };
6 changes: 6 additions & 0 deletions front/src/components/ui/sheet.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ const meta: Meta<SheetContentProps> = {
component: Sheet,
title: "Sheet",
args: {
side: "right",
className: "",
},
argTypes: {
side: {
type: "string",
control: "select",
options: ["top", "right", "bottom", "left"],
},
className: {
type: "string",
control: "text",
Expand Down

0 comments on commit ca36750

Please sign in to comment.