From 64b95daff4adab80b23f4a261da3226b4f60f259 Mon Sep 17 00:00:00 2001 From: Jayash Tripathy <76092296+JayashTripathy@users.noreply.github.com> Date: Mon, 1 Sep 2025 19:40:01 +0530 Subject: [PATCH] [WEB-4740] feat: add propel seperator (#7637) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: global css file added to tailwind config package * chore: tailwind config updated * chore: cn utility function added to propel package * chore: storybook init * fix: format error * chore: code refactor * chore: code refactor * fix: format error * feat: add propel seperator component * :lock: chore: updated lock file * ✏️ fix: typo in separator filename and some linting issues * ♻️ refactor: replace clsx with cn utility in Separator component for class name management * 🐛 fix: re-added twMerge * 🧹 cleanup: remove unnecessary blank line in Separator component --------- Co-authored-by: Anmol Singh Bhatia --- .../src/separator/separator.stories.tsx | 50 +++++++++++++++++++ packages/propel/src/separator/separator.tsx | 29 +++++++++++ 2 files changed, 79 insertions(+) create mode 100644 packages/propel/src/separator/separator.stories.tsx create mode 100644 packages/propel/src/separator/separator.tsx diff --git a/packages/propel/src/separator/separator.stories.tsx b/packages/propel/src/separator/separator.stories.tsx new file mode 100644 index 000000000..61beae48d --- /dev/null +++ b/packages/propel/src/separator/separator.stories.tsx @@ -0,0 +1,50 @@ +import type { Meta, StoryObj } from "@storybook/react-vite"; +import { Separator } from "./separator"; + +const meta: Meta = { + title: "Components/Separator", + component: Separator, + parameters: { + layout: "centered", + }, + tags: ["autodocs"], +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + render: () => ( +
+
Content Above
+ +
Content Below
+
+ ), +}; + +export const Vertical: Story = { + render: () => ( +
+
Left Content
+ +
Right Content
+
+ ), +}; + +export const WithinContainer: Story = { + render: () => ( +
+
+

Section 1

+

Description for section 1

+
+ +
+

Section 2

+

Description for section 2

+
+
+ ), +}; diff --git a/packages/propel/src/separator/separator.tsx b/packages/propel/src/separator/separator.tsx new file mode 100644 index 000000000..5e02309dc --- /dev/null +++ b/packages/propel/src/separator/separator.tsx @@ -0,0 +1,29 @@ +import * as React from "react"; +import { Separator as SeparatorPrimitive } from "@base-ui-components/react/separator"; +import { cn } from "../utils"; + +interface SeparatorProps extends React.ComponentProps { + /** + * The orientation of the separator + * @default "horizontal" + */ + orientation?: "horizontal" | "vertical"; +} + +const Separator = React.forwardRef, SeparatorProps>( + ({ orientation = "horizontal", ...props }, ref) => ( + + ) +); + +Separator.displayName = "Separator"; + +export { Separator }; +export type { SeparatorProps };