@mbao01/common 0.0.25 → 0.0.27
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/dist/types/components/Badge/Badge.d.ts +1 -1
- package/dist/types/components/Badge/constants.d.ts +1 -0
- package/package.json +2 -2
- package/src/components/Alert/constants.ts +1 -1
- package/src/components/Avatar/constants.ts +1 -1
- package/src/components/Badge/Badge.tsx +5 -1
- package/src/components/Badge/constants.ts +21 -0
- package/src/components/Pagination/constants.ts +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type BadgeProps } from "./types";
|
|
2
|
-
export declare const Badge: ({ size, outline, variant, className, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const Badge: ({ size, outline, rounded, variant, className, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,4 +2,5 @@ export declare const getBadgeClasses: (props?: ({
|
|
|
2
2
|
variant?: "accent" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
3
3
|
outline?: boolean | null | undefined;
|
|
4
4
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
5
|
+
rounded?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
5
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mbao01/common",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.27",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Ayomide Bakare",
|
|
7
7
|
"license": "MIT",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"react-dom": "^18.2.0",
|
|
143
143
|
"typescript": "^5.2.2"
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "011f80eb4c8b456df0a2af179f46f57000a603b5"
|
|
146
146
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva } from "../../libs";
|
|
2
2
|
|
|
3
3
|
export const getAlertClasses = cva(
|
|
4
|
-
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg
|
|
4
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-inherit",
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
@@ -23,7 +23,7 @@ const classesConfig = {
|
|
|
23
23
|
variants: {
|
|
24
24
|
variant: {
|
|
25
25
|
accent: "bg-accent text-accent-content ring-accent",
|
|
26
|
-
default: "bg-
|
|
26
|
+
default: "bg-base-200 text-base-content ring-default",
|
|
27
27
|
error: "bg-error text-error-content ring-error",
|
|
28
28
|
ghost: "bg-ghost text-ghost-content ring-ghost",
|
|
29
29
|
info: "bg-info text-info-content ring-info",
|
|
@@ -5,13 +5,17 @@ import { type BadgeProps } from "./types";
|
|
|
5
5
|
export const Badge = ({
|
|
6
6
|
size,
|
|
7
7
|
outline,
|
|
8
|
+
rounded,
|
|
8
9
|
variant,
|
|
9
10
|
className,
|
|
10
11
|
...props
|
|
11
12
|
}: BadgeProps) => {
|
|
12
13
|
return (
|
|
13
14
|
<span
|
|
14
|
-
className={cn(
|
|
15
|
+
className={cn(
|
|
16
|
+
getBadgeClasses({ size, variant, outline, rounded }),
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
15
19
|
{...props}
|
|
16
20
|
/>
|
|
17
21
|
);
|
|
@@ -22,7 +22,28 @@ export const getBadgeClasses = cva("badge", {
|
|
|
22
22
|
md: "badge-md",
|
|
23
23
|
lg: "badge-lg",
|
|
24
24
|
},
|
|
25
|
+
rounded: {
|
|
26
|
+
xs: "rounded-xs",
|
|
27
|
+
sm: "rounded-sm",
|
|
28
|
+
md: "rounded-md",
|
|
29
|
+
lg: "rounded-lg",
|
|
30
|
+
},
|
|
25
31
|
},
|
|
32
|
+
compoundVariants: [
|
|
33
|
+
{
|
|
34
|
+
size: undefined,
|
|
35
|
+
className: "text-xs",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
rounded: undefined,
|
|
39
|
+
className: "rounded-md",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
outline: true,
|
|
44
|
+
className: "border-base-300",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
26
47
|
defaultVariants: {
|
|
27
48
|
variant: "ghost",
|
|
28
49
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cva } from "../../libs";
|
|
2
2
|
|
|
3
|
-
export const getPaginationClasses = cva("
|
|
3
|
+
export const getPaginationClasses = cva("flex justify-center");
|
|
4
4
|
|
|
5
5
|
export const getPaginationContentClasses = cva(
|
|
6
6
|
"flex flex-row items-center gap-1"
|