@paciu/ui 0.0.36 → 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.
- package/dist/index.es.js +56 -0
- package/dist/index.umd.js +2 -0
- package/package.json +24 -33
- package/dist/index.js +0 -1
- /package/dist/{styles/index.css → index.css} +0 -0
package/dist/index.es.js
ADDED
|
@@ -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
|
+
};
|
|
@@ -0,0 +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,_){"use strict";var s=document.createElement("style");s.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(s);const i={button:"_button_1cbbb_2",small:"_small_1cbbb_17",text:"_text_1cbbb_26","button--error":"_button--error_1cbbb_39"};function a(t){var r,e,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var c=t.length;for(r=0;r<c;r++)t[r]&&(e=a(t[r]))&&(o&&(o+=" "),o+=e)}else for(e in t)t[e]&&(o&&(o+=" "),o+=e);return o}function u(){for(var t,r,e=0,o="",c=arguments.length;e<c;e++)(t=arguments[e])&&(r=a(t))&&(o&&(o+=" "),o+=r);return o}const d=t=>{const{children:r,className:e,color:o,text:c,icon:x,loading:m,small:g,...h}=t;return b.jsx("button",{className:u(i.button,{[i.text]:c,[i.small]:g,[i.icon]:x,[i.loading]:m,...o&&{[i[`paciu-ui-button--${o}`]]:o}},e),...h,children:r})},f={row:"_row_1ojv4_2"},l=({children:t,className:r,...e})=>b.jsx("div",{className:u(f.row,r),...e,children:t}),p=t=>{_.useEffect(()=>{const r=e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[t])};n.Button=d,n.Row=l,n.useEscape=p,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,52 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paciu/ui",
|
|
3
|
-
"version": "0.0.
|
|
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
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
11
8
|
"exports": {
|
|
12
9
|
".": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.es.js",
|
|
12
|
+
"require": "./dist/index.umd.js"
|
|
13
|
+
}
|
|
17
14
|
},
|
|
18
|
-
"
|
|
19
|
-
"
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
20
17
|
],
|
|
21
|
-
"author": "Paciu Stanislav",
|
|
22
|
-
"license": "ISC",
|
|
23
|
-
"description": "paciustas.ru",
|
|
24
18
|
"scripts": {
|
|
25
19
|
"lint:format": "npx prettier ./src --write && npx eslint ./src --fix",
|
|
26
|
-
"build": "rimraf
|
|
20
|
+
"build": "rimraf dist && npm run lint:format && npx tsc -b && vite build",
|
|
27
21
|
"prod": "npm run build && npm version patch && npm publish --access public"
|
|
28
22
|
},
|
|
29
23
|
"peerDependencies": {
|
|
24
|
+
"clsx": "^2.1.1",
|
|
30
25
|
"react": "^19.0.0",
|
|
31
|
-
"react-dom": "^19.0.0"
|
|
32
|
-
"clsx": "^2.1.1"
|
|
26
|
+
"react-dom": "^19.0.0"
|
|
33
27
|
},
|
|
34
28
|
"devDependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@types/
|
|
37
|
-
"@types/react": "^19.
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
42
|
-
"eslint-plugin-react-refresh": "^0.4.19",
|
|
43
|
-
"globals": "^16.0.0",
|
|
44
|
-
"prettier": "^3.5.3",
|
|
29
|
+
"@types/node": "^24.7.0",
|
|
30
|
+
"@types/react": "^19.2.2",
|
|
31
|
+
"@types/react-dom": "^19.2.1",
|
|
32
|
+
"@vitejs/plugin-react-swc": "^4.1.0",
|
|
33
|
+
"eslint": "^9.37.0",
|
|
34
|
+
"prettier": "^3.6.2",
|
|
45
35
|
"rimraf": "^6.0.1",
|
|
46
|
-
"sass": "^1.
|
|
47
|
-
"typescript": "
|
|
48
|
-
"
|
|
49
|
-
"vite": "^
|
|
50
|
-
"vite-plugin-
|
|
36
|
+
"sass": "^1.93.2",
|
|
37
|
+
"typescript": "^5.9.3",
|
|
38
|
+
"vite": "^7.1.9",
|
|
39
|
+
"vite-plugin-dts": "^4.5.4",
|
|
40
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
41
|
+
"@paciu/code-quality": "^0.0.3"
|
|
51
42
|
}
|
|
52
43
|
}
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(r,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],s):(r=typeof globalThis<"u"?globalThis:r||self,s(r["paciu-ui"]={},r["react/jsx-runtime"],r.react))})(this,function(r,s,l){"use strict";const u={button:"_button_1cbbb_2",small:"_small_1cbbb_17",text:"_text_1cbbb_26","button--error":"_button--error_1cbbb_39"};function c(t){var n,e,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(n=0;n<i;n++)t[n]&&(e=c(t[n]))&&(o&&(o+=" "),o+=e)}else for(e in t)t[e]&&(o&&(o+=" "),o+=e);return o}function a(){for(var t,n,e=0,o="",i=arguments.length;e<i;e++)(t=arguments[e])&&(n=c(t))&&(o&&(o+=" "),o+=n);return o}const f=t=>{const{children:n,className:e,color:o,text:i,icon:p,loading:_,small:y,...x}=t;return s.jsx("button",{className:a(u.button,{[u.text]:i,[u.small]:y,[u.icon]:p,[u.loading]:_,...o&&{[u[`paciu-ui-button--${o}`]]:o}},e),...x,children:n})},b={row:"_row_1ojv4_2"},d=({children:t,className:n,...e})=>s.jsx("div",{className:a(b.row,n),...e,children:t}),m=t=>{l.useEffect(()=>{const n=e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t())};return document.addEventListener("keydown",n,!0),()=>document.removeEventListener("keydown",n,!0)},[t])};r.Button=f,r.Row=d,r.useEscape=m,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
|
File without changes
|