@mbao01/common 0.6.2 → 0.6.3

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.
@@ -1,2 +1,2 @@
1
1
  import { SeparatorProps } from './types';
2
- export declare const Separator: ({ className, orientation, decorative, ...props }: SeparatorProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Separator: ({ size, className, variant, orientation, decorative, ...props }: SeparatorProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,5 @@
1
1
  export declare const getSeparatorClasses: (props?: ({
2
2
  orientation?: "horizontal" | "vertical" | null | undefined;
3
+ variant?: "accent" | "default" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
4
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
3
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -1,2 +1,4 @@
1
+ import { VariantProps } from '../../libs';
2
+ import { getSeparatorClasses } from './constants';
1
3
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
2
- export type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>;
4
+ export type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> & VariantProps<typeof getSeparatorClasses>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mbao01/common",
3
3
  "private": false,
4
- "version": "0.6.2",
4
+ "version": "0.6.3",
5
5
  "type": "module",
6
6
  "author": "Ayomide Bakare",
7
7
  "license": "MIT",
@@ -168,5 +168,5 @@
168
168
  "recharts": "2",
169
169
  "typescript": "5"
170
170
  },
171
- "gitHead": "f6e5dc7d7249a0933b04f26b068cde86e67b9c6e"
171
+ "gitHead": "de45dbee958479f770fa71c2656a1b230fe86cdb"
172
172
  }
@@ -6,7 +6,9 @@ import { getSeparatorClasses } from "./constants";
6
6
  import { type SeparatorProps } from "./types";
7
7
 
8
8
  export const Separator = ({
9
+ size,
9
10
  className,
11
+ variant = "default",
10
12
  orientation = "horizontal",
11
13
  decorative = true,
12
14
  ...props
@@ -14,7 +16,7 @@ export const Separator = ({
14
16
  <SeparatorPrimitive.Root
15
17
  decorative={decorative}
16
18
  orientation={orientation}
17
- className={cn(getSeparatorClasses({ orientation }), className)}
19
+ className={cn(getSeparatorClasses({ orientation, variant, size }), className)}
18
20
  {...props}
19
21
  />
20
22
  );
@@ -7,5 +7,23 @@ export const getSeparatorClasses = cva("shrink-0 bg-base-300", {
7
7
  horizontal: "h-[1px] w-full",
8
8
  vertical: "h-full w-[1px]",
9
9
  },
10
+ variant: {
11
+ accent: "bg-accent/20",
12
+ default: "bg-base-content/10",
13
+ error: "bg-error/20",
14
+ ghost: "bg-ghost",
15
+ info: "bg-info/20",
16
+ neutral: "bg-neutral/20",
17
+ primary: "bg-primary/20",
18
+ secondary: "bg-secondary/20",
19
+ success: "bg-success/20",
20
+ warning: "bg-warning/20",
21
+ },
22
+ size: {
23
+ xs: "h-[1px]",
24
+ sm: "h-[2px]",
25
+ md: "h-[3px]",
26
+ lg: "h-[4px]",
27
+ },
10
28
  }),
11
29
  });
@@ -1,3 +1,6 @@
1
1
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
2
+ import { type VariantProps } from "../../libs";
3
+ import { getSeparatorClasses } from "./constants";
2
4
 
3
- export type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>;
5
+ export type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> &
6
+ VariantProps<typeof getSeparatorClasses>;