@bbki.ng/components 5.2.0 → 5.2.2

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