@mbao01/common 0.0.24 → 0.0.26
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/dist/types/components/Form/Input/Input.d.ts +1 -1
- package/dist/types/components/Form/Input/constants.d.ts +1 -1
- package/dist/types/components/Form/TextField/TextField.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Badge/Badge.tsx +5 -1
- package/src/components/Badge/constants.ts +21 -0
- package/src/components/Button/constants.ts +5 -0
- package/src/components/Form/Input/constants.ts +11 -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare const Input: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> & {
|
|
3
|
-
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
3
|
+
variant?: "accent" | "default" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
4
|
outline?: boolean | undefined;
|
|
5
5
|
wide?: boolean | undefined;
|
|
6
6
|
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const getInputClasses: (props?: ({
|
|
2
|
-
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
2
|
+
variant?: "accent" | "default" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
3
3
|
outline?: boolean | null | undefined;
|
|
4
4
|
wide?: boolean | null | undefined;
|
|
5
5
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare const TextField: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> & {
|
|
3
|
-
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
3
|
+
variant?: "accent" | "default" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
4
|
outline?: boolean | undefined;
|
|
5
5
|
wide?: boolean | undefined;
|
|
6
6
|
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
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.26",
|
|
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": "ae57ca0c314f2fb4aeb6b3c87d11f96cc7b8d5f0"
|
|
146
146
|
}
|
|
@@ -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
|
},
|
|
@@ -5,6 +5,7 @@ export const getInputClasses = cva(
|
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
|
+
default: "bg-transparent",
|
|
8
9
|
accent: "input-accent",
|
|
9
10
|
error: "input-error",
|
|
10
11
|
ghost: "input-ghost",
|
|
@@ -32,6 +33,16 @@ export const getInputClasses = cva(
|
|
|
32
33
|
size: undefined,
|
|
33
34
|
className: "min-h-fit h-10",
|
|
34
35
|
},
|
|
36
|
+
{
|
|
37
|
+
variant: undefined,
|
|
38
|
+
outline: true,
|
|
39
|
+
className: "border-neutral-content",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
variant: "default",
|
|
43
|
+
outline: true,
|
|
44
|
+
className: "border-base-content",
|
|
45
|
+
},
|
|
35
46
|
],
|
|
36
47
|
}
|
|
37
48
|
);
|
|
@@ -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"
|