@cfx-dev/ui-components 0.0.11 → 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.
Files changed (2) hide show
  1. package/dist/utils/clsx.js +18 -10
  2. package/package.json +4 -2
@@ -1,14 +1,22 @@
1
- function o(r) {
2
- if (!r)
3
- return "";
4
- if (typeof r == "string" || typeof r == "number")
5
- return r.toString();
6
- const t = [];
7
- return typeof r == "object" && (Array.isArray(r) ? r.forEach((e) => t.push(o(e))) : Object.values(r).forEach((e) => t.push(o(e)))), t.filter(Boolean).join(" ");
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 n(...r) {
10
- return [...r].map((t) => o(t)).filter(Boolean).join(" ");
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
- n as clsx
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.11",
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
  }