@paciu/ui 0.0.37 → 0.0.38

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.
@@ -0,0 +1,56 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { useEffect as f } from "react";
3
+ import './index.css';const p = "_button_1cbbb_2", _ = "_small_1cbbb_17", d = "_text_1cbbb_26", s = {
4
+ button: p,
5
+ small: _,
6
+ text: d,
7
+ "button--error": "_button--error_1cbbb_39"
8
+ };
9
+ function a(t) {
10
+ var n, o, r = "";
11
+ if (typeof t == "string" || typeof t == "number") r += t;
12
+ else if (typeof t == "object") if (Array.isArray(t)) {
13
+ var e = t.length;
14
+ for (n = 0; n < e; n++) t[n] && (o = a(t[n])) && (r && (r += " "), r += o);
15
+ } else for (o in t) t[o] && (r && (r += " "), r += o);
16
+ return r;
17
+ }
18
+ function u() {
19
+ for (var t, n, o = 0, r = "", e = arguments.length; o < e; o++) (t = arguments[o]) && (n = a(t)) && (r && (r += " "), r += n);
20
+ return r;
21
+ }
22
+ const v = (t) => {
23
+ const { children: n, className: o, color: r, text: e, icon: i, loading: l, small: b, ...m } = t;
24
+ return /* @__PURE__ */ c(
25
+ "button",
26
+ {
27
+ className: u(
28
+ s.button,
29
+ {
30
+ [s.text]: e,
31
+ [s.small]: b,
32
+ [s.icon]: i,
33
+ [s.loading]: l,
34
+ ...r && { [s[`paciu-ui-button--${r}`]]: r }
35
+ },
36
+ o
37
+ ),
38
+ ...m,
39
+ children: n
40
+ }
41
+ );
42
+ }, y = "_row_1ojv4_2", g = {
43
+ row: y
44
+ }, E = ({ children: t, className: n, ...o }) => /* @__PURE__ */ c("div", { className: u(g.row, n), ...o, children: t }), h = (t) => {
45
+ f(() => {
46
+ const n = (o) => {
47
+ o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), o.stopImmediatePropagation(), t());
48
+ };
49
+ return document.addEventListener("keydown", n, !0), () => document.removeEventListener("keydown", n, !0);
50
+ }, [t]);
51
+ };
52
+ export {
53
+ v as Button,
54
+ E as Row,
55
+ h as useEscape
56
+ };
package/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "@paciu/ui",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "type": "module",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
5
+ "main": "./dist/index.umd.js",
6
+ "module": "./dist/index.es.js",
7
7
  "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.es.js",
12
+ "require": "./dist/index.umd.js"
13
+ }
14
+ },
8
15
  "files": [
9
16
  "dist"
10
17
  ],
11
- "exports": "./dist/index.js",
12
18
  "scripts": {
13
19
  "lint:format": "npx prettier ./src --write && npx eslint ./src --fix",
14
20
  "build": "rimraf dist && npm run lint:format && npx tsc -b && vite build",
File without changes
File without changes