@paciu/ui 0.0.38 → 0.0.39
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.
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-skip-first-effect.d.ts +5 -0
- package/dist/index.es.js +39 -33
- package/dist/index.umd.js +2 -2
- package/package.json +6 -5
package/dist/hooks/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,56 +1,62 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import './index.css';const
|
|
4
|
-
button:
|
|
5
|
-
small:
|
|
6
|
-
text:
|
|
2
|
+
import { useEffect as u, useRef as p } from "react";
|
|
3
|
+
import './index.css';const _ = "_button_1cbbb_2", d = "_small_1cbbb_17", y = "_text_1cbbb_26", s = {
|
|
4
|
+
button: _,
|
|
5
|
+
small: d,
|
|
6
|
+
text: y,
|
|
7
7
|
"button--error": "_button--error_1cbbb_39"
|
|
8
8
|
};
|
|
9
|
-
function
|
|
10
|
-
var
|
|
11
|
-
if (typeof t == "string" || typeof t == "number")
|
|
9
|
+
function i(t) {
|
|
10
|
+
var r, o, e = "";
|
|
11
|
+
if (typeof t == "string" || typeof t == "number") e += t;
|
|
12
12
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
13
|
-
var
|
|
14
|
-
for (
|
|
15
|
-
} else for (o in t) t[o] && (
|
|
16
|
-
return
|
|
13
|
+
var n = t.length;
|
|
14
|
+
for (r = 0; r < n; r++) t[r] && (o = i(t[r])) && (e && (e += " "), e += o);
|
|
15
|
+
} else for (o in t) t[o] && (e && (e += " "), e += o);
|
|
16
|
+
return e;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
for (var t,
|
|
20
|
-
return
|
|
18
|
+
function a() {
|
|
19
|
+
for (var t, r, o = 0, e = "", n = arguments.length; o < n; o++) (t = arguments[o]) && (r = i(t)) && (e && (e += " "), e += r);
|
|
20
|
+
return e;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
const { children:
|
|
22
|
+
const E = (t) => {
|
|
23
|
+
const { children: r, className: o, color: e, text: n, icon: l, loading: b, small: f, ...m } = t;
|
|
24
24
|
return /* @__PURE__ */ c(
|
|
25
25
|
"button",
|
|
26
26
|
{
|
|
27
|
-
className:
|
|
27
|
+
className: a(
|
|
28
28
|
s.button,
|
|
29
29
|
{
|
|
30
|
-
[s.text]:
|
|
31
|
-
[s.small]:
|
|
32
|
-
[s.icon]:
|
|
33
|
-
[s.loading]:
|
|
34
|
-
...
|
|
30
|
+
[s.text]: n,
|
|
31
|
+
[s.small]: f,
|
|
32
|
+
[s.icon]: l,
|
|
33
|
+
[s.loading]: b,
|
|
34
|
+
...e && { [s[`paciu-ui-button--${e}`]]: e }
|
|
35
35
|
},
|
|
36
36
|
o
|
|
37
37
|
),
|
|
38
38
|
...m,
|
|
39
|
-
children:
|
|
39
|
+
children: r
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
|
-
},
|
|
43
|
-
row:
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
const
|
|
42
|
+
}, g = "_row_1ojv4_2", x = {
|
|
43
|
+
row: g
|
|
44
|
+
}, h = ({ children: t, className: r, ...o }) => /* @__PURE__ */ c("div", { className: a(x.row, r), ...o, children: t }), j = (t) => {
|
|
45
|
+
u(() => {
|
|
46
|
+
const r = (o) => {
|
|
47
47
|
o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), o.stopImmediatePropagation(), t());
|
|
48
48
|
};
|
|
49
|
-
return document.addEventListener("keydown",
|
|
49
|
+
return document.addEventListener("keydown", r, !0), () => document.removeEventListener("keydown", r, !0);
|
|
50
50
|
}, [t]);
|
|
51
|
+
}, k = (t, r) => {
|
|
52
|
+
const o = p(!0);
|
|
53
|
+
u(() => {
|
|
54
|
+
o.current ? o.current = !1 : t();
|
|
55
|
+
}, r);
|
|
51
56
|
};
|
|
52
57
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
E as Button,
|
|
59
|
+
h as Row,
|
|
60
|
+
j as useEscape,
|
|
61
|
+
k as useSkipFirstEffect
|
|
56
62
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(n,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],b):(n=typeof globalThis<"u"?globalThis:n||self,b(n["paciu-ui"]={},n["react/jsx-runtime"],n.react))})(this,(function(n,b,
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(
|
|
1
|
+
(function(n,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],b):(n=typeof globalThis<"u"?globalThis:n||self,b(n["paciu-ui"]={},n["react/jsx-runtime"],n.react))})(this,(function(n,b,c){"use strict";var u=document.createElement("style");u.textContent=`._button_1cbbb_2{position:relative;overflow:hidden;font:inherit;font-weight:600;border:none;cursor:pointer;background:#333;color:#fff;font-size:16px;border-radius:16px;padding:0 16px;min-height:40px;transition:.2s}._button_1cbbb_2._small_1cbbb_17{min-height:32px;border-radius:12px;font-size:12px;padding:0 12px}._button_1cbbb_2:hover{background:#242424}._button_1cbbb_2._text_1cbbb_26{color:#333;background:#3333330d}._button_1cbbb_2._text_1cbbb_26:hover{background:#3333331a}._button_1cbbb_2:disabled{background:#f0f0f0;color:#a0a0a0;cursor:default;pointer-events:none}._button--error_1cbbb_39{position:relative;overflow:hidden;font:inherit;font-weight:600;border:none;cursor:pointer;background:#ea2027;color:#fff;font-size:16px;border-radius:16px;padding:0 16px;min-height:40px;transition:.2s}._button--error_1cbbb_39._small_1cbbb_17{min-height:32px;border-radius:12px;font-size:12px;padding:0 12px}._button--error_1cbbb_39:hover{background:#db1118}._button--error_1cbbb_39._text_1cbbb_26{color:#ea2027;background:#ea20270d}._button--error_1cbbb_39._text_1cbbb_26:hover{background:#ea20271a}._button--error_1cbbb_39:disabled{background:#f0f0f0;color:#a0a0a0;cursor:default;pointer-events:none}._row_1ojv4_2{padding:12px}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(u);const i={button:"_button_1cbbb_2",small:"_small_1cbbb_17",text:"_text_1cbbb_26","button--error":"_button--error_1cbbb_39"};function a(t){var o,e,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(o=0;o<s;o++)t[o]&&(e=a(t[o]))&&(r&&(r+=" "),r+=e)}else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function _(){for(var t,o,e=0,r="",s=arguments.length;e<s;e++)(t=arguments[e])&&(o=a(t))&&(r&&(r+=" "),r+=o);return r}const d=t=>{const{children:o,className:e,color:r,text:s,icon:m,loading:g,small:h,...v}=t;return b.jsx("button",{className:_(i.button,{[i.text]:s,[i.small]:h,[i.icon]:m,[i.loading]:g,...r&&{[i[`paciu-ui-button--${r}`]]:r}},e),...v,children:o})},f={row:"_row_1ojv4_2"},l=({children:t,className:o,...e})=>b.jsx("div",{className:_(f.row,o),...e,children:t}),p=t=>{c.useEffect(()=>{const o=e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t())};return document.addEventListener("keydown",o,!0),()=>document.removeEventListener("keydown",o,!0)},[t])},x=(t,o)=>{const e=c.useRef(!0);c.useEffect(()=>{e.current?e.current=!1:t()},o)};n.Button=d,n.Row=l,n.useEscape=p,n.useSkipFirstEffect=x,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paciu/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"
|
|
20
|
-
"build": "rimraf dist && npm run
|
|
21
|
-
"prod": "npm run build && npm version patch && npm publish --access public"
|
|
19
|
+
"dev": "",
|
|
20
|
+
"build": "rimraf dist && npm run code-style && npx tsc -b && vite build",
|
|
21
|
+
"prod": "npm run build && npm version patch && npm publish --access public",
|
|
22
|
+
"code-style": "npx prettier ./src --write && npx eslint ./src --fix"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
24
25
|
"clsx": "^2.1.1",
|
|
@@ -38,6 +39,6 @@
|
|
|
38
39
|
"vite": "^7.1.9",
|
|
39
40
|
"vite-plugin-dts": "^4.5.4",
|
|
40
41
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
41
|
-
"@paciu/code-quality": "^0.0.
|
|
42
|
+
"@paciu/code-quality": "^0.0.4"
|
|
42
43
|
}
|
|
43
44
|
}
|