@meta-1/design 0.0.163 → 0.0.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,20 +3,26 @@ import type { PropsWithChildren } from "react";
|
|
|
3
3
|
import { cn } from "@meta-1/design/lib/utils";
|
|
4
4
|
|
|
5
5
|
export interface DividerProps extends PropsWithChildren {
|
|
6
|
-
orientation
|
|
6
|
+
orientation?: "left" | "center" | "right";
|
|
7
7
|
className?: string;
|
|
8
8
|
labelClassName?: string;
|
|
9
9
|
borderClassName?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const Divider = (props: DividerProps) => {
|
|
13
|
+
const { orientation = "center" } = props;
|
|
14
|
+
const orientationClass =
|
|
15
|
+
orientation === "left" ? "justify-start" : orientation === "right" ? "justify-end" : "justify-center";
|
|
16
|
+
|
|
13
17
|
return (
|
|
14
|
-
<div className={cn("relative
|
|
18
|
+
<div className={cn("relative", props.className)}>
|
|
15
19
|
<div className="absolute inset-0 flex items-center">
|
|
16
20
|
<span className={cn("w-full border-t", props.borderClassName)} />
|
|
17
21
|
</div>
|
|
18
|
-
<div className="relative flex
|
|
19
|
-
<span className={cn("bg-background px-2 text-muted-foreground", props.labelClassName)}>
|
|
22
|
+
<div className={cn("relative flex text-xs uppercase", orientationClass)}>
|
|
23
|
+
<span className={cn("mx-2 bg-background px-2 text-muted-foreground", props.labelClassName)}>
|
|
24
|
+
{props.children}
|
|
25
|
+
</span>
|
|
20
26
|
</div>
|
|
21
27
|
</div>
|
|
22
28
|
);
|