@cfx-dev/ui-components 0.0.10 → 0.0.12
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.
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { clsx as
|
|
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
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
type: f = "button",
|
|
12
|
+
className: m = "",
|
|
13
|
+
theme: p = "default",
|
|
14
|
+
size: h = "normal",
|
|
14
15
|
disabled: n = !1,
|
|
15
|
-
straightCorners:
|
|
16
|
-
onClick:
|
|
17
|
-
onMouseDown:
|
|
18
|
-
onMouseUp:
|
|
16
|
+
straightCorners: x = !1,
|
|
17
|
+
onClick: b = l,
|
|
18
|
+
onMouseDown: C = l,
|
|
19
|
+
onMouseUp: N = l,
|
|
19
20
|
autofocus: s = !1,
|
|
20
|
-
fullWidth:
|
|
21
|
+
fullWidth: k = !1,
|
|
21
22
|
tabIndex: a,
|
|
22
23
|
decorator: r = null
|
|
23
|
-
} = c,
|
|
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"]]:
|
|
29
|
-
[o.fullWidth]:
|
|
29
|
+
[o["straight-borders"]]: x,
|
|
30
|
+
[o.fullWidth]: k
|
|
30
31
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ j(
|
|
32
33
|
"button",
|
|
33
34
|
{
|
|
34
35
|
ref: u,
|
|
35
36
|
disabled: n,
|
|
36
|
-
className:
|
|
37
|
-
onClick: (
|
|
38
|
-
n ||
|
|
37
|
+
className: y,
|
|
38
|
+
onClick: (g) => {
|
|
39
|
+
n || b(g);
|
|
39
40
|
},
|
|
40
|
-
onMouseDown:
|
|
41
|
-
onMouseUp:
|
|
41
|
+
onMouseDown: C,
|
|
42
|
+
onMouseUp: N,
|
|
42
43
|
autoFocus: s,
|
|
43
44
|
tabIndex: a,
|
|
44
45
|
title: d,
|
|
45
|
-
type:
|
|
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
|
-
|
|
56
|
+
F as Button
|
|
56
57
|
};
|
package/dist/utils/clsx.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
function n(t) {
|
|
2
|
+
let l, e = "";
|
|
3
|
+
if (typeof t == "string" || typeof t == "number")
|
|
4
|
+
e += t;
|
|
5
|
+
else if (typeof t == "object")
|
|
6
|
+
if (Array.isArray(t))
|
|
7
|
+
for (let f = 0; f < t.length; f++)
|
|
8
|
+
t[f] && (l = n(t[f])) && (e && (e += " "), e += l);
|
|
9
|
+
else
|
|
10
|
+
for (const f in t)
|
|
11
|
+
t[f] && (e && (e += " "), e += f);
|
|
12
|
+
return e;
|
|
8
13
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
14
|
+
function o(...t) {
|
|
15
|
+
let l = 0, e, f, r = "";
|
|
16
|
+
for (; l < t.length; )
|
|
17
|
+
(f = t[l++]) && (e = n(f)) && (r && (r += " "), r += e);
|
|
18
|
+
return r;
|
|
11
19
|
}
|
|
12
20
|
export {
|
|
13
|
-
|
|
21
|
+
o as clsx
|
|
14
22
|
};
|
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.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/main.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
18
18
|
"lint": "eslint --quiet \"src/**/*{ts,tsx}\" \"lib/**/*{ts,tsx}\"",
|
|
19
19
|
"lint:fix": "eslint --fix --quiet \"src/**/*{ts,tsx}\" \"lib/**/*{ts,tsx}\"",
|
|
20
|
+
"test": "vitest run",
|
|
20
21
|
"preview": "vite preview",
|
|
21
22
|
"prepublishOnly": "yarn build",
|
|
22
23
|
"storybook": "storybook dev -p 6006",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"vite": "^5.2.0",
|
|
72
73
|
"vite-plugin-dts": "^3.9.1",
|
|
73
74
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
74
|
-
"vite-plugin-static-copy": "^1.0.5"
|
|
75
|
+
"vite-plugin-static-copy": "^1.0.5",
|
|
76
|
+
"vitest": "^1.6.0"
|
|
75
77
|
}
|
|
76
78
|
}
|