feat(ui,dashboard): Move Divider component to UI package (#11357)

This commit is contained in:
Kasper Fabricius Kristensen
2025-02-09 11:46:30 +01:00
committed by GitHub
parent acefcd7d80
commit d00825485f
22 changed files with 88 additions and 41 deletions

View File

@@ -1,37 +0,0 @@
import { clx } from "@medusajs/ui"
import { ComponentPropsWithoutRef } from "react"
interface DividerProps
extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
orientation?: "horizontal" | "vertical"
variant?: "dashed" | "solid"
}
export const Divider = ({
orientation = "horizontal",
variant = "solid",
className,
...props
}: DividerProps) => {
return (
<div
aria-orientation={orientation}
role="separator"
className={clx(
"border-ui-border-base",
{
"w-full border-t":
orientation === "horizontal" && variant === "solid",
"h-full border-l": orientation === "vertical" && variant === "solid",
"bg-transparent": variant === "dashed",
"h-px w-full bg-[linear-gradient(90deg,var(--border-strong)_1px,transparent_1px)] bg-[length:4px_1px]":
variant === "dashed" && orientation === "horizontal",
"h-full w-px bg-[linear-gradient(0deg,var(--border-strong)_1px,transparent_1px)] bg-[length:1px_4px]":
variant === "dashed" && orientation === "vertical",
},
className
)}
{...props}
/>
)
}

View File

@@ -1 +0,0 @@
export * from "./divider"