@versini/ui-button 6.0.4 → 6.0.6
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/chunks/{utilities.B6tGQPoK.js → utilities.B84qY3__.js} +2 -2
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/ButtonCopy.js +4 -4
- package/dist/components/Button/ButtonIcon.js +107 -89
- package/dist/components/Button/ButtonLink.js +15 -15
- package/dist/index.js +4 -4
- package/package.json +5 -5
|
@@ -242,7 +242,7 @@ const v = "av-button", l = "icon", p = "button", h = "link", m = ({
|
|
|
242
242
|
), P = ({
|
|
243
243
|
animated: t
|
|
244
244
|
}) => c({
|
|
245
|
-
"transition-opacity duration-300 ease-in": t
|
|
245
|
+
"transition-opacity duration-300 ease-in-out": t
|
|
246
246
|
}), S = ({
|
|
247
247
|
type: t,
|
|
248
248
|
className: e,
|
|
@@ -289,7 +289,7 @@ const v = "av-button", l = "icon", p = "button", h = "link", m = ({
|
|
|
289
289
|
"disabled:cursor-not-allowed disabled:opacity-50": s
|
|
290
290
|
},
|
|
291
291
|
c({
|
|
292
|
-
"transition-[width] duration-300 ease-in
|
|
292
|
+
"transition-[width] duration-300 ease-in": t === l && b
|
|
293
293
|
}),
|
|
294
294
|
e
|
|
295
295
|
));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import N from "react";
|
|
3
3
|
import { BaseButton_private as T } from "../../chunks/BaseButton.BFKIL4GO.js";
|
|
4
|
-
import { getButtonClasses as g, TYPE_BUTTON as x } from "../../chunks/utilities.
|
|
4
|
+
import { getButtonClasses as g, TYPE_BUTTON as x } from "../../chunks/utilities.B84qY3__.js";
|
|
5
5
|
const C = N.forwardRef(
|
|
6
6
|
({
|
|
7
7
|
children: s,
|
|
@@ -39,7 +39,7 @@ const m = ({
|
|
|
39
39
|
try {
|
|
40
40
|
window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
|
|
41
41
|
version: "4.2.0",
|
|
42
|
-
buildTime: "
|
|
42
|
+
buildTime: "05/17/2025 06:18 PM EDT",
|
|
43
43
|
homepage: "https://github.com/aversini/ui-components",
|
|
44
44
|
license: "MIT"
|
|
45
45
|
});
|
|
@@ -90,13 +90,13 @@ const I = ({
|
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
/*!
|
|
93
|
-
@versini/ui-icons v4.
|
|
93
|
+
@versini/ui-icons v4.10.0
|
|
94
94
|
© 2025 gizmette.com
|
|
95
95
|
*/
|
|
96
96
|
try {
|
|
97
97
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
98
|
-
version: "4.
|
|
99
|
-
buildTime: "
|
|
98
|
+
version: "4.10.0",
|
|
99
|
+
buildTime: "05/17/2025 06:18 PM EDT",
|
|
100
100
|
homepage: "https://github.com/aversini/ui-components",
|
|
101
101
|
license: "MIT"
|
|
102
102
|
});
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { BaseButton_private as
|
|
4
|
-
import { getButtonClasses as
|
|
5
|
-
function
|
|
6
|
-
const t =
|
|
7
|
-
return
|
|
1
|
+
import { jsx as m, jsxs as U } from "react/jsx-runtime";
|
|
2
|
+
import Y, { useRef as p, useCallback as J, useEffect as T, useMemo as E, useState as K, useLayoutEffect as O } from "react";
|
|
3
|
+
import { BaseButton_private as Q } from "../../chunks/BaseButton.BFKIL4GO.js";
|
|
4
|
+
import { getButtonClasses as V, TYPE_ICON as X, getIconClasses as Z, getButtonIconLabelClasses as z } from "../../chunks/utilities.B84qY3__.js";
|
|
5
|
+
function ee() {
|
|
6
|
+
const t = p(!1);
|
|
7
|
+
return T(() => (t.current = !0, () => {
|
|
8
8
|
t.current = !1;
|
|
9
|
-
}), []),
|
|
9
|
+
}), []), J(() => t.current, []);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function te(t) {
|
|
12
|
+
return E(() => t.every((r) => r == null) ? () => {
|
|
13
13
|
} : (r) => {
|
|
14
14
|
t.forEach((e) => {
|
|
15
15
|
typeof e == "function" ? e(r) : e != null && (e.current = r);
|
|
16
16
|
});
|
|
17
17
|
}, t);
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const re = {
|
|
20
20
|
x: 0,
|
|
21
21
|
y: 0,
|
|
22
22
|
width: 0,
|
|
@@ -26,126 +26,144 @@ const Z = {
|
|
|
26
26
|
bottom: 0,
|
|
27
27
|
right: 0
|
|
28
28
|
};
|
|
29
|
-
function
|
|
30
|
-
const r =
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
function A(t) {
|
|
30
|
+
const r = ee(), e = p(0), s = p(null), [d, C] = K(re), i = E(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((w) => {
|
|
31
|
+
const a = w[0];
|
|
32
|
+
a && (cancelAnimationFrame(e.current), e.current = requestAnimationFrame(() => {
|
|
33
|
+
s.current && r() && C(a.contentRect);
|
|
34
34
|
}));
|
|
35
35
|
}), [r]);
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
}), [
|
|
36
|
+
return T(() => (s.current && (i == null || i.observe(s.current, t)), () => {
|
|
37
|
+
i == null || i.disconnect(), e.current && cancelAnimationFrame(e.current);
|
|
38
|
+
}), [i, t]), [s, d];
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const b = {
|
|
41
41
|
small: 24,
|
|
42
42
|
// w-6
|
|
43
43
|
medium: 32,
|
|
44
44
|
// w-8
|
|
45
45
|
large: 48
|
|
46
46
|
// w-12
|
|
47
|
-
},
|
|
47
|
+
}, ne = {
|
|
48
48
|
small: 8 * 2,
|
|
49
49
|
// px-2 x 2
|
|
50
50
|
medium: 12 * 2,
|
|
51
51
|
// px-3 x 2
|
|
52
52
|
large: 16 * 2
|
|
53
53
|
// px-4 x 2
|
|
54
|
-
},
|
|
54
|
+
}, ce = 2, se = 300, le = Y.forwardRef(
|
|
55
55
|
({
|
|
56
56
|
children: t,
|
|
57
57
|
disabled: r = !1,
|
|
58
58
|
mode: e = "system",
|
|
59
|
-
focusMode:
|
|
60
|
-
fullWidth:
|
|
61
|
-
className:
|
|
62
|
-
type:
|
|
63
|
-
raw:
|
|
64
|
-
noBorder:
|
|
65
|
-
"aria-label":
|
|
66
|
-
label:
|
|
67
|
-
size:
|
|
68
|
-
labelRight:
|
|
59
|
+
focusMode: s = "system",
|
|
60
|
+
fullWidth: d = !1,
|
|
61
|
+
className: C,
|
|
62
|
+
type: i = "button",
|
|
63
|
+
raw: w = !1,
|
|
64
|
+
noBorder: a = !1,
|
|
65
|
+
"aria-label": j,
|
|
66
|
+
label: F,
|
|
67
|
+
size: l = "medium",
|
|
68
|
+
labelRight: h,
|
|
69
69
|
labelLeft: R,
|
|
70
|
-
noBackground:
|
|
71
|
-
align:
|
|
72
|
-
radius:
|
|
73
|
-
variant:
|
|
74
|
-
iconClassName:
|
|
70
|
+
noBackground: H = !1,
|
|
71
|
+
align: S = "center",
|
|
72
|
+
radius: W = "large",
|
|
73
|
+
variant: _ = "primary",
|
|
74
|
+
iconClassName: $,
|
|
75
75
|
animated: u = !1,
|
|
76
|
-
...
|
|
77
|
-
},
|
|
78
|
-
const
|
|
79
|
-
type:
|
|
76
|
+
...M
|
|
77
|
+
}, P) => {
|
|
78
|
+
const k = V({
|
|
79
|
+
type: X,
|
|
80
80
|
mode: e,
|
|
81
|
-
focusMode:
|
|
82
|
-
fullWidth:
|
|
81
|
+
focusMode: s,
|
|
82
|
+
fullWidth: d,
|
|
83
83
|
disabled: r,
|
|
84
|
-
raw:
|
|
85
|
-
className:
|
|
86
|
-
noBorder:
|
|
87
|
-
size:
|
|
88
|
-
labelRight:
|
|
84
|
+
raw: w,
|
|
85
|
+
className: C,
|
|
86
|
+
noBorder: a,
|
|
87
|
+
size: l,
|
|
88
|
+
labelRight: h,
|
|
89
89
|
labelLeft: R,
|
|
90
|
-
noBackground:
|
|
91
|
-
align:
|
|
92
|
-
radius:
|
|
93
|
-
variant:
|
|
90
|
+
noBackground: H,
|
|
91
|
+
align: S,
|
|
92
|
+
radius: W,
|
|
93
|
+
variant: _,
|
|
94
94
|
animated: u
|
|
95
|
-
}),
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
|
|
95
|
+
}), q = Z({ mode: e, raw: w, iconClassName: $ }), g = z({ animated: u }), G = "flex items-center justify-center relative w-full h-full overflow-hidden", [n, N] = A(), [c, v] = A(), [I, B] = A(), x = p(0), o = p(null), f = p(null), L = te([P, o]);
|
|
96
|
+
return O(() => {
|
|
97
|
+
I && I.current && u && (x.current = B.width + ne[l] + (a ? 0 : ce), o.current && !o.current.style.width && (o.current.style.width = `${b[l]}px`));
|
|
98
|
+
}, [B, I, l, a, u]), O(() => {
|
|
99
|
+
if (o && o.current && u) {
|
|
100
|
+
let y = b[l];
|
|
101
|
+
h && n && N.width > 0 ? y = N.width + x.current : R && c && v.width > 0 && (y = v.width + x.current), f.current && clearTimeout(f.current), y !== parseInt(o.current.style.width || "0", 10) && (n.current && (n.current.style.opacity = "0"), c.current && (c.current.style.opacity = "0"), o.current.style.width = `${y}px`, y > b[l] && (f.current = setTimeout(() => {
|
|
102
|
+
n.current && h && (n.current.style.opacity = "1"), c.current && R && (c.current.style.opacity = "1"), f.current = null;
|
|
103
|
+
}, se * 0.8))), y === b[l] && (n.current && (n.current.style.opacity = "0"), c.current && (c.current.style.opacity = "0"));
|
|
104
|
+
}
|
|
100
105
|
}, [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
N,
|
|
107
|
+
h,
|
|
108
|
+
n,
|
|
109
|
+
v,
|
|
105
110
|
R,
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
c,
|
|
112
|
+
l,
|
|
108
113
|
u
|
|
109
|
-
]),
|
|
110
|
-
|
|
114
|
+
]), T(() => () => {
|
|
115
|
+
f.current && clearTimeout(f.current);
|
|
116
|
+
}, []), /* @__PURE__ */ m(
|
|
117
|
+
Q,
|
|
111
118
|
{
|
|
112
|
-
ref:
|
|
113
|
-
className:
|
|
119
|
+
ref: L,
|
|
120
|
+
className: k,
|
|
114
121
|
disabled: r,
|
|
115
|
-
type:
|
|
116
|
-
"aria-label":
|
|
117
|
-
...
|
|
118
|
-
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
122
|
+
type: i,
|
|
123
|
+
"aria-label": j || F,
|
|
124
|
+
...M,
|
|
125
|
+
children: /* @__PURE__ */ U("div", { className: G, children: [
|
|
126
|
+
/* @__PURE__ */ m(
|
|
127
|
+
D,
|
|
121
128
|
{
|
|
122
129
|
label: R,
|
|
123
|
-
labelRef:
|
|
124
|
-
labelClass:
|
|
125
|
-
labelInnerClass: "pr-2"
|
|
130
|
+
labelRef: c,
|
|
131
|
+
labelClass: g,
|
|
132
|
+
labelInnerClass: "pr-2",
|
|
133
|
+
initiallyHidden: u
|
|
126
134
|
}
|
|
127
135
|
),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
|
|
136
|
+
/* @__PURE__ */ m("span", { ref: I, className: q, children: t }),
|
|
137
|
+
/* @__PURE__ */ m(
|
|
138
|
+
D,
|
|
131
139
|
{
|
|
132
|
-
label:
|
|
133
|
-
labelRef:
|
|
134
|
-
labelClass:
|
|
135
|
-
labelInnerClass: "pl-2"
|
|
140
|
+
label: h,
|
|
141
|
+
labelRef: n,
|
|
142
|
+
labelClass: g,
|
|
143
|
+
labelInnerClass: "pl-2",
|
|
144
|
+
initiallyHidden: u
|
|
136
145
|
}
|
|
137
146
|
)
|
|
138
|
-
]
|
|
147
|
+
] })
|
|
139
148
|
}
|
|
140
149
|
);
|
|
141
150
|
}
|
|
142
|
-
),
|
|
151
|
+
), D = ({
|
|
143
152
|
labelRef: t,
|
|
144
153
|
labelClass: r,
|
|
145
154
|
label: e,
|
|
146
|
-
labelInnerClass:
|
|
147
|
-
|
|
148
|
-
|
|
155
|
+
labelInnerClass: s,
|
|
156
|
+
initiallyHidden: d = !1
|
|
157
|
+
}) => /* @__PURE__ */ m(
|
|
158
|
+
"span",
|
|
159
|
+
{
|
|
160
|
+
ref: t,
|
|
161
|
+
className: r,
|
|
162
|
+
style: d ? { opacity: 0 } : void 0,
|
|
163
|
+
children: e && /* @__PURE__ */ m("span", { className: s, children: e })
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
le.displayName = "ButtonIcon";
|
|
149
167
|
export {
|
|
150
|
-
|
|
168
|
+
le as ButtonIcon
|
|
151
169
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { getButtonClasses as
|
|
5
|
-
const L =
|
|
1
|
+
import { jsx as s, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import r from "clsx";
|
|
3
|
+
import v from "react";
|
|
4
|
+
import { getButtonClasses as V, TYPE_LINK as C } from "../../chunks/utilities.B84qY3__.js";
|
|
5
|
+
const L = v.forwardRef(
|
|
6
6
|
({
|
|
7
|
-
children:
|
|
8
|
-
mode:
|
|
7
|
+
children: t,
|
|
8
|
+
mode: n = "system",
|
|
9
9
|
focusMode: c = "system",
|
|
10
10
|
fullWidth: i = !1,
|
|
11
11
|
className: m,
|
|
@@ -17,10 +17,10 @@ const L = V.forwardRef(
|
|
|
17
17
|
noNewWindowIcon: w = !1,
|
|
18
18
|
radius: h = "large",
|
|
19
19
|
...x
|
|
20
|
-
},
|
|
21
|
-
const
|
|
20
|
+
}, y) => {
|
|
21
|
+
const N = V({
|
|
22
22
|
type: C,
|
|
23
|
-
mode:
|
|
23
|
+
mode: n,
|
|
24
24
|
focusMode: c,
|
|
25
25
|
fullWidth: i,
|
|
26
26
|
disabled: !1,
|
|
@@ -30,18 +30,18 @@ const L = V.forwardRef(
|
|
|
30
30
|
noBorder: p,
|
|
31
31
|
truncate: l,
|
|
32
32
|
radius: h
|
|
33
|
-
}), e = a === "_blank",
|
|
33
|
+
}), e = a === "_blank", b = {
|
|
34
34
|
target: a,
|
|
35
35
|
rel: e ? "noopener noreferrer" : void 0,
|
|
36
36
|
...x
|
|
37
|
-
},
|
|
37
|
+
}, u = r({
|
|
38
38
|
truncate: l,
|
|
39
39
|
"basis-11/12": l && e
|
|
40
40
|
});
|
|
41
|
-
return /* @__PURE__ */ s("a", { ref:
|
|
42
|
-
/* @__PURE__ */ s("div", { className:
|
|
41
|
+
return /* @__PURE__ */ s("a", { ref: y, className: N, ...b, children: /* @__PURE__ */ o("div", { role: "text", className: r("flex items-center justify-center"), children: [
|
|
42
|
+
/* @__PURE__ */ s("div", { className: u, children: t }),
|
|
43
43
|
e && /* @__PURE__ */ s("span", { className: "sr-only", children: ", opens in a new window" }),
|
|
44
|
-
e && !w && /* @__PURE__ */
|
|
44
|
+
e && !w && /* @__PURE__ */ o(
|
|
45
45
|
"svg",
|
|
46
46
|
{
|
|
47
47
|
xmlns: "http://www.w3.org/2000/svg",
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BUTTON_CLASSNAME as B } from "./chunks/utilities.
|
|
1
|
+
import { BUTTON_CLASSNAME as B } from "./chunks/utilities.B84qY3__.js";
|
|
2
2
|
import { Button as T } from "./components/Button/Button.js";
|
|
3
3
|
import { ButtonCopy as I } from "./components/Button/ButtonCopy.js";
|
|
4
4
|
import { ButtonIcon as l } from "./components/Button/ButtonIcon.js";
|
|
@@ -7,13 +7,13 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
7
7
|
import a from "clsx";
|
|
8
8
|
import m from "react";
|
|
9
9
|
/*!
|
|
10
|
-
@versini/ui-button v6.0.
|
|
10
|
+
@versini/ui-button v6.0.6
|
|
11
11
|
© 2025 gizmette.com
|
|
12
12
|
*/
|
|
13
13
|
try {
|
|
14
14
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
15
|
-
version: "6.0.
|
|
16
|
-
buildTime: "
|
|
15
|
+
version: "6.0.6",
|
|
16
|
+
buildTime: "05/26/2025 03:48 PM EDT",
|
|
17
17
|
homepage: "https://github.com/aversini/ui-components",
|
|
18
18
|
license: "MIT"
|
|
19
19
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-button",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
"react-dom": "^18.3.1 || ^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@versini/ui-types": "5.0.
|
|
42
|
+
"@versini/ui-types": "5.0.3"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@tailwindcss/typography": "0.5.16",
|
|
46
46
|
"@versini/ui-hooks": "4.7.3",
|
|
47
|
-
"@versini/ui-icons": "4.
|
|
47
|
+
"@versini/ui-icons": "4.10.0",
|
|
48
48
|
"clsx": "2.1.1",
|
|
49
|
-
"tailwindcss": "4.1.
|
|
49
|
+
"tailwindcss": "4.1.7"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": [
|
|
52
52
|
"**/*.css"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "863a399128080a19f2668e458d495110aa0f68f8"
|
|
55
55
|
}
|