@bbki.ng/components 5.1.3 → 5.2.1
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/button/Button.d.ts +3 -1
- package/dist/button/Button.mjs +29 -24
- package/package.json +2 -2
package/dist/button/Button.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export declare enum ButtonType {
|
|
|
3
3
|
DANGER = "danger",
|
|
4
4
|
PRIMARY = "primary",
|
|
5
5
|
NORMAL = "normal",
|
|
6
|
-
DISABLED = "disabled"
|
|
6
|
+
DISABLED = "disabled",
|
|
7
|
+
GHOST = "ghost"
|
|
7
8
|
}
|
|
8
9
|
export interface ButtonProps {
|
|
9
10
|
className?: string;
|
|
@@ -11,6 +12,7 @@ export interface ButtonProps {
|
|
|
11
12
|
type?: ButtonType;
|
|
12
13
|
onClick: EventHandler<React.MouseEvent<HTMLButtonElement>>;
|
|
13
14
|
btnType?: "submit" | "reset" | "button";
|
|
15
|
+
size?: "small" | "medium" | "large";
|
|
14
16
|
}
|
|
15
17
|
export declare function Button(props: ButtonProps): JSX.Element;
|
|
16
18
|
export declare namespace Button {
|
package/dist/button/Button.mjs
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { jsx as
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
const
|
|
1
|
+
import h from "react";
|
|
2
|
+
import o from "../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs";
|
|
3
|
+
import { jsx as b } from "../_virtual/jsx-runtime.mjs";
|
|
4
|
+
var g = /* @__PURE__ */ ((t) => (t.DANGER = "danger", t.PRIMARY = "primary", t.NORMAL = "normal", t.DISABLED = "disabled", t.GHOST = "ghost", t))(g || {});
|
|
5
|
+
function x(t) {
|
|
6
|
+
const n = {
|
|
7
7
|
danger: "text-red-500",
|
|
8
8
|
primary: "text-blue-600",
|
|
9
9
|
disabled: "text-gray-400 cursor-not-allowed",
|
|
10
|
-
normal: "text-black"
|
|
11
|
-
|
|
10
|
+
normal: "text-black",
|
|
11
|
+
ghost: "text-black bg-transparent"
|
|
12
|
+
}, [s, r] = h.useState(!1), {
|
|
12
13
|
type: e = "normal",
|
|
13
|
-
className:
|
|
14
|
-
onClick:
|
|
15
|
-
btnType:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
14
|
+
className: l = "",
|
|
15
|
+
onClick: i,
|
|
16
|
+
btnType: d,
|
|
17
|
+
size: a = "medium"
|
|
18
|
+
} = t, m = e === "disabled" || e === "ghost" ? "" : o("transition-all duration-200 ease-in-out shadow-button active:shadow-empty", {
|
|
19
|
+
"shadow-empty": s,
|
|
20
|
+
"hover:shadow-button-hover": !s
|
|
21
|
+
}), c = (p) => {
|
|
20
22
|
e !== "disabled" && (r(!0), setTimeout(() => {
|
|
21
|
-
r(!1),
|
|
23
|
+
r(!1), i(p);
|
|
22
24
|
}, 280));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
}, u = o({
|
|
26
|
+
"py-8 px-8": a === "small",
|
|
27
|
+
"py-8 px-16": a === "medium" || a === "large"
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ b("button", {
|
|
30
|
+
className: `${n[e]} ${l} ${m} ${u} transition-all duration-200 ease-in-out`,
|
|
31
|
+
onClick: c,
|
|
32
|
+
type: d,
|
|
28
33
|
children: t.children
|
|
29
34
|
});
|
|
30
35
|
}
|
|
31
|
-
|
|
36
|
+
x.displayName = "Button";
|
|
32
37
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
x as Button,
|
|
39
|
+
g as ButtonType
|
|
35
40
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbki.ng/components",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"classnames": "2.3.1",
|
|
36
36
|
"phenomenon": "^1.6.0",
|
|
37
37
|
"react-hook-form": "7.54.2",
|
|
38
|
-
"@bbki.ng/stylebase": "3.0
|
|
38
|
+
"@bbki.ng/stylebase": "3.1.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/core": "^7.18.9",
|