@cfx-dev/ui-components 0.0.10 → 0.0.11

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.
@@ -5,6 +5,7 @@ export type ButtonSize = 'normal' | 'small' | 'large';
5
5
  export interface ButtonProps {
6
6
  text?: React.ReactNode;
7
7
  title?: string;
8
+ type?: 'button' | 'submit' | 'reset';
8
9
  icon?: React.ReactNode;
9
10
  theme?: ButtonTheme;
10
11
  size?: ButtonSize;
@@ -1,48 +1,49 @@
1
- import { jsxs as g, jsx as i } from "react/jsx-runtime";
2
- import j from "react";
3
- import { clsx as w } from "../../utils/clsx.js";
1
+ import { jsxs as j, jsx as i } from "react/jsx-runtime";
2
+ import w from "react";
3
+ import { clsx as B } from "../../utils/clsx.js";
4
4
  import { n as l } from "../../functional-C0pE183N.js";
5
5
  import { s as o } from "../../Button.module-Z6njvP9Z.js";
6
- const D = j.forwardRef(function(c, u) {
6
+ const F = w.forwardRef(function(c, u) {
7
7
  const {
8
8
  text: t = null,
9
9
  icon: e = null,
10
10
  title: d = "",
11
- className: f = "",
12
- theme: m = "default",
13
- size: p = "normal",
11
+ type: f = "button",
12
+ className: m = "",
13
+ theme: p = "default",
14
+ size: h = "normal",
14
15
  disabled: n = !1,
15
- straightCorners: h = !1,
16
- onClick: x = l,
17
- onMouseDown: b = l,
18
- onMouseUp: C = l,
16
+ straightCorners: x = !1,
17
+ onClick: b = l,
18
+ onMouseDown: C = l,
19
+ onMouseUp: N = l,
19
20
  autofocus: s = !1,
20
- fullWidth: N = !1,
21
+ fullWidth: k = !1,
21
22
  tabIndex: a,
22
23
  decorator: r = null
23
- } = c, k = w(o.root, o[m], o[p], f, {
24
+ } = c, y = B(o.root, o[p], o[h], m, {
24
25
  [o.disabled]: n,
25
26
  [o.icon]: !!e && (t === null || typeof t > "u"),
26
27
  [o.text]: !!t,
27
28
  [o.autofocus]: s || typeof a < "u",
28
- [o["straight-borders"]]: h,
29
- [o.fullWidth]: N
29
+ [o["straight-borders"]]: x,
30
+ [o.fullWidth]: k
30
31
  });
31
- return /* @__PURE__ */ g(
32
+ return /* @__PURE__ */ j(
32
33
  "button",
33
34
  {
34
35
  ref: u,
35
36
  disabled: n,
36
- className: k,
37
- onClick: (y) => {
38
- n || x(y);
37
+ className: y,
38
+ onClick: (g) => {
39
+ n || b(g);
39
40
  },
40
- onMouseDown: b,
41
- onMouseUp: C,
41
+ onMouseDown: C,
42
+ onMouseUp: N,
42
43
  autoFocus: s,
43
44
  tabIndex: a,
44
45
  title: d,
45
- type: "button",
46
+ type: f,
46
47
  children: [
47
48
  !!e && /* @__PURE__ */ i("span", { className: o["icon-node"], children: e }),
48
49
  t,
@@ -52,5 +53,5 @@ const D = j.forwardRef(function(c, u) {
52
53
  );
53
54
  });
54
55
  export {
55
- D as Button
56
+ F as Button
56
57
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",