@versini/ui-button 2.1.0 → 2.2.1
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/components/Button/ButtonCopy.js +38 -38
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/package.json +5 -5
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsxs as r, Fragment as u, jsx as
|
|
2
|
-
import w, { useState as
|
|
3
|
-
import { ButtonIcon as
|
|
1
|
+
import { jsxs as r, Fragment as u, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import w, { useState as f, useEffect as _ } from "react";
|
|
3
|
+
import { ButtonIcon as h } from "./ButtonIcon.js";
|
|
4
4
|
import N from "clsx";
|
|
5
5
|
const m = ({
|
|
6
|
-
children:
|
|
6
|
+
children: e,
|
|
7
7
|
fill: c,
|
|
8
8
|
viewBox: s,
|
|
9
|
-
className:
|
|
9
|
+
className: t,
|
|
10
10
|
defaultViewBox: i,
|
|
11
11
|
defaultClassName: l,
|
|
12
12
|
title: a,
|
|
13
13
|
semantic: n = !1,
|
|
14
14
|
...d
|
|
15
15
|
}) => {
|
|
16
|
-
const p = N(
|
|
16
|
+
const p = N(l, t);
|
|
17
17
|
return /* @__PURE__ */ r(u, { children: [
|
|
18
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ o(
|
|
19
19
|
"svg",
|
|
20
20
|
{
|
|
21
21
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -26,30 +26,30 @@ const m = ({
|
|
|
26
26
|
"aria-hidden": !n,
|
|
27
27
|
focusable: !1,
|
|
28
28
|
...d,
|
|
29
|
-
children:
|
|
29
|
+
children: e
|
|
30
30
|
}
|
|
31
31
|
),
|
|
32
|
-
a && n && /* @__PURE__ */
|
|
32
|
+
a && n && /* @__PURE__ */ o("span", { className: "sr-only", children: a })
|
|
33
33
|
] });
|
|
34
34
|
};
|
|
35
35
|
/*!
|
|
36
|
-
@versini/ui-svgicon v2.0.
|
|
36
|
+
@versini/ui-svgicon v2.0.3
|
|
37
37
|
© 2024 gizmette.com
|
|
38
38
|
*/
|
|
39
39
|
try {
|
|
40
40
|
window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
|
|
41
|
-
version: "2.0.
|
|
42
|
-
buildTime: "12/30/2024
|
|
41
|
+
version: "2.0.3",
|
|
42
|
+
buildTime: "12/30/2024 02:25 PM EST",
|
|
43
43
|
homepage: "https://github.com/aversini/ui-components",
|
|
44
44
|
license: "MIT"
|
|
45
45
|
});
|
|
46
46
|
} catch {
|
|
47
47
|
}
|
|
48
48
|
const I = ({
|
|
49
|
-
className:
|
|
49
|
+
className: e,
|
|
50
50
|
viewBox: c,
|
|
51
51
|
title: s,
|
|
52
|
-
monotone:
|
|
52
|
+
monotone: t,
|
|
53
53
|
...i
|
|
54
54
|
}) => /* @__PURE__ */ r(
|
|
55
55
|
m,
|
|
@@ -57,76 +57,76 @@ const I = ({
|
|
|
57
57
|
defaultViewBox: "0 0 448 512",
|
|
58
58
|
defaultClassName: "size-5",
|
|
59
59
|
viewBox: c,
|
|
60
|
-
className:
|
|
60
|
+
className: e,
|
|
61
61
|
title: s || "Copied",
|
|
62
62
|
...i,
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ o(
|
|
65
65
|
"path",
|
|
66
66
|
{
|
|
67
67
|
opacity: "0.4",
|
|
68
68
|
d: "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ o("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
|
-
),
|
|
75
|
-
className:
|
|
74
|
+
), V = ({
|
|
75
|
+
className: e,
|
|
76
76
|
viewBox: c,
|
|
77
77
|
title: s,
|
|
78
|
-
monotone:
|
|
78
|
+
monotone: t,
|
|
79
79
|
...i
|
|
80
|
-
}) => /* @__PURE__ */
|
|
80
|
+
}) => /* @__PURE__ */ o(
|
|
81
81
|
m,
|
|
82
82
|
{
|
|
83
83
|
defaultViewBox: "0 0 512 512",
|
|
84
84
|
defaultClassName: "size-5",
|
|
85
85
|
viewBox: c,
|
|
86
|
-
className:
|
|
86
|
+
className: e,
|
|
87
87
|
title: s || "Copy",
|
|
88
88
|
...i,
|
|
89
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ o("path", { d: "M64 464H288c8.8 0 16-7.2 16-16V384h48v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h64v48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16zM224 304H448c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16V288c0 8.8 7.2 16 16 16zm-64-16V64c0-35.3 28.7-64 64-64H448c35.3 0 64 28.7 64 64V288c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64z" })
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
/*!
|
|
93
|
-
@versini/ui-icons v2.0.
|
|
93
|
+
@versini/ui-icons v2.0.3
|
|
94
94
|
© 2024 gizmette.com
|
|
95
95
|
*/
|
|
96
96
|
try {
|
|
97
97
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
98
|
-
version: "2.0.
|
|
99
|
-
buildTime: "12/30/2024
|
|
98
|
+
version: "2.0.3",
|
|
99
|
+
buildTime: "12/30/2024 02:25 PM EST",
|
|
100
100
|
homepage: "https://github.com/aversini/ui-components",
|
|
101
101
|
license: "MIT"
|
|
102
102
|
});
|
|
103
103
|
} catch {
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
const [
|
|
107
|
-
i(!0), typeof
|
|
105
|
+
const v = w.forwardRef(({ copyToClipboard: e, ...c }, s) => {
|
|
106
|
+
const [t, i] = f(!1), l = () => {
|
|
107
|
+
typeof e == "string" && (navigator.clipboard.writeText(e), i(!0)), typeof e == "function" && (navigator.clipboard.writeText(e()), i(!0));
|
|
108
108
|
};
|
|
109
|
-
return
|
|
109
|
+
return _(() => {
|
|
110
110
|
let a;
|
|
111
|
-
return
|
|
111
|
+
return t && (a = window.setTimeout(() => {
|
|
112
112
|
i(!1);
|
|
113
113
|
}, 3e3)), () => {
|
|
114
114
|
clearTimeout(a);
|
|
115
115
|
};
|
|
116
|
-
}, [
|
|
117
|
-
|
|
116
|
+
}, [t]), /* @__PURE__ */ o(
|
|
117
|
+
h,
|
|
118
118
|
{
|
|
119
119
|
...c,
|
|
120
120
|
size: "small",
|
|
121
121
|
ref: s,
|
|
122
|
-
label:
|
|
122
|
+
label: t ? "Copied to clipboard" : "Copy to clipboard",
|
|
123
123
|
onClick: l,
|
|
124
|
-
disabled:
|
|
125
|
-
children:
|
|
124
|
+
disabled: t,
|
|
125
|
+
children: t ? /* @__PURE__ */ o(I, { className: "size-3" }) : /* @__PURE__ */ o(V, { className: "size-3" })
|
|
126
126
|
}
|
|
127
127
|
);
|
|
128
128
|
});
|
|
129
|
-
|
|
129
|
+
v.displayName = "ButtonCopy";
|
|
130
130
|
export {
|
|
131
|
-
|
|
131
|
+
v as ButtonCopy
|
|
132
132
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare const Button: React.ForwardRefExoticComponent<{
|
|
|
22
22
|
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
23
23
|
|
|
24
24
|
declare const ButtonCopy: React.ForwardRefExoticComponent<{
|
|
25
|
-
copyToClipboard: string;
|
|
25
|
+
copyToClipboard: string | (() => string);
|
|
26
26
|
} & Omit<_versini_ui_types.ButtonIconTypes.Props, "children" | "fullWidth" | "size" | "align" | "label" | "labelLeft" | "labelRight"> & React.RefAttributes<HTMLButtonElement>>;
|
|
27
27
|
|
|
28
28
|
declare const ButtonIcon: React.ForwardRefExoticComponent<{
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getButtonClasses as I, TYPE_ICON as v } from "./chunks/utilities.BWGZmbN4.js";
|
|
2
|
-
import { BUTTON_CLASSNAME as
|
|
2
|
+
import { BUTTON_CLASSNAME as V } from "./chunks/utilities.BWGZmbN4.js";
|
|
3
3
|
import { Button as q } from "./components/Button/Button.js";
|
|
4
4
|
import { ButtonCopy as D } from "./components/Button/ButtonCopy.js";
|
|
5
5
|
import { ButtonIcon as G } from "./components/Button/ButtonIcon.js";
|
|
@@ -9,13 +9,13 @@ import n from "clsx";
|
|
|
9
9
|
import S from "react";
|
|
10
10
|
import { BaseButton_private as E } from "./chunks/BaseButton.BFKIL4GO.js";
|
|
11
11
|
/*!
|
|
12
|
-
@versini/ui-button v2.1
|
|
12
|
+
@versini/ui-button v2.2.1
|
|
13
13
|
© 2024 gizmette.com
|
|
14
14
|
*/
|
|
15
15
|
try {
|
|
16
16
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
17
|
-
version: "2.1
|
|
18
|
-
buildTime: "12/30/2024
|
|
17
|
+
version: "2.2.1",
|
|
18
|
+
buildTime: "12/30/2024 02:25 PM EST",
|
|
19
19
|
homepage: "https://github.com/aversini/ui-components",
|
|
20
20
|
license: "MIT"
|
|
21
21
|
});
|
|
@@ -100,7 +100,7 @@ const U = S.forwardRef(
|
|
|
100
100
|
);
|
|
101
101
|
U.displayName = "ButtonSort";
|
|
102
102
|
export {
|
|
103
|
-
|
|
103
|
+
V as BUTTON_CLASSNAME,
|
|
104
104
|
q as Button,
|
|
105
105
|
D as ButtonCopy,
|
|
106
106
|
G as ButtonIcon,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-button",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
"react-dom": "^18.3.1 || ^19.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@versini/ui-svgicon": "2.0.
|
|
41
|
+
"@versini/ui-svgicon": "2.0.3"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@tailwindcss/typography": "0.5.15",
|
|
45
|
-
"@versini/ui-icons": "2.0.
|
|
46
|
-
"@versini/ui-types": "2.
|
|
45
|
+
"@versini/ui-icons": "2.0.3",
|
|
46
|
+
"@versini/ui-types": "2.2.0",
|
|
47
47
|
"clsx": "2.1.1",
|
|
48
48
|
"tailwindcss": "3.4.17"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": [
|
|
51
51
|
"**/*.css"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "2a29d0fa51876f41fb9acab344a9c8e87fc6a0a2"
|
|
54
54
|
}
|