-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
packages/storybook/src/components/separator/index.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Separator } from "@spear-ai/ui/components/separator"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
const PreviewSeparator = () => ( | ||
<div className="w-full max-w-xs"> | ||
<Separator /> | ||
</div> | ||
); | ||
|
||
const meta = { | ||
component: PreviewSeparator, | ||
} satisfies Meta<typeof PreviewSeparator>; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Standard: Story = { | ||
parameters: { | ||
layout: "centered", | ||
}, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { forwardRef, HTMLAttributes } from "react"; | ||
import { cx } from "@/helpers/cx"; | ||
|
||
export const Separator = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>( | ||
({ className, ...properties }, reference) => { | ||
const mergedClassName = cx( | ||
"before:bg-neutral-a-6 h-px w-full before:-mt-px before:block before:h-px before:w-full before:content-['']", | ||
className, | ||
); | ||
return <div className={mergedClassName} {...properties} ref={reference} />; | ||
}, | ||
); | ||
|
||
Separator.displayName = "Separator"; |