@versini/ui-button 8.0.0 → 8.0.2
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.
|
@@ -33,13 +33,13 @@ const m = ({
|
|
|
33
33
|
);
|
|
34
34
|
};
|
|
35
35
|
/*!
|
|
36
|
-
@versini/ui-svgicon v4.2.
|
|
36
|
+
@versini/ui-svgicon v4.2.2
|
|
37
37
|
© 2025 gizmette.com
|
|
38
38
|
*/
|
|
39
39
|
try {
|
|
40
40
|
window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
|
|
41
|
-
version: "4.2.
|
|
42
|
-
buildTime: "
|
|
41
|
+
version: "4.2.2",
|
|
42
|
+
buildTime: "10/17/2025 12:12 PM EDT",
|
|
43
43
|
homepage: "https://github.com/aversini/ui-components",
|
|
44
44
|
license: "MIT"
|
|
45
45
|
});
|
|
@@ -90,13 +90,13 @@ const v = ({
|
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
/*!
|
|
93
|
-
@versini/ui-icons v4.
|
|
93
|
+
@versini/ui-icons v4.12.3
|
|
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.12.3",
|
|
99
|
+
buildTime: "10/17/2025 12:12 PM EDT",
|
|
100
100
|
homepage: "https://github.com/aversini/ui-components",
|
|
101
101
|
license: "MIT"
|
|
102
102
|
});
|
|
@@ -1,169 +1,135 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return T(() => (t.current = !0, () => {
|
|
8
|
-
t.current = !1;
|
|
9
|
-
}), []), J(() => t.current, []);
|
|
10
|
-
}
|
|
11
|
-
function te(t) {
|
|
12
|
-
return j(() => t.every((r) => r == null) ? () => {
|
|
13
|
-
} : (r) => {
|
|
14
|
-
t.forEach((e) => {
|
|
15
|
-
typeof e == "function" ? e(r) : e != null && (e.current = r);
|
|
16
|
-
});
|
|
17
|
-
}, [...t]);
|
|
18
|
-
}
|
|
19
|
-
const re = {
|
|
20
|
-
x: 0,
|
|
21
|
-
y: 0,
|
|
22
|
-
width: 0,
|
|
23
|
-
height: 0,
|
|
24
|
-
top: 0,
|
|
25
|
-
left: 0,
|
|
26
|
-
bottom: 0,
|
|
27
|
-
right: 0
|
|
28
|
-
};
|
|
29
|
-
function A(t) {
|
|
30
|
-
const r = ee(), e = m(0), s = m(null), [p, C] = K(re), d = j(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((w) => {
|
|
31
|
-
const i = w[0];
|
|
32
|
-
i && (cancelAnimationFrame(e.current), e.current = requestAnimationFrame(() => {
|
|
33
|
-
s.current && r() && C(i.contentRect);
|
|
34
|
-
}));
|
|
35
|
-
}), [r]);
|
|
36
|
-
return T(() => (s.current && d?.observe(s.current, t), () => {
|
|
37
|
-
d?.disconnect(), e.current && cancelAnimationFrame(e.current);
|
|
38
|
-
}), [d, t]), [s, p];
|
|
39
|
-
}
|
|
40
|
-
const b = {
|
|
1
|
+
import { jsx as u, jsxs as Y } from "react/jsx-runtime";
|
|
2
|
+
import { useResizeObserver as C, useMergeRefs as k } from "@versini/ui-hooks";
|
|
3
|
+
import q, { useRef as b, useLayoutEffect as v, useEffect as F } from "react";
|
|
4
|
+
import { BaseButton_private as J } from "../../chunks/BaseButton.BpaKdSwW.js";
|
|
5
|
+
import { getButtonClasses as K, TYPE_ICON as Q, getIconClasses as V, getButtonIconLabelClasses as X } from "../../chunks/utilities.CGmHp-Rn.js";
|
|
6
|
+
const p = {
|
|
41
7
|
small: 24,
|
|
42
8
|
// w-6
|
|
43
9
|
medium: 32,
|
|
44
10
|
// w-8
|
|
45
11
|
large: 48
|
|
46
12
|
// w-12
|
|
47
|
-
},
|
|
13
|
+
}, Z = {
|
|
48
14
|
small: 16,
|
|
49
15
|
// px-2 x 2
|
|
50
16
|
medium: 24,
|
|
51
17
|
// px-3 x 2
|
|
52
18
|
large: 32
|
|
53
19
|
// px-4 x 2
|
|
54
|
-
},
|
|
20
|
+
}, z = 2, ee = 300, te = q.forwardRef(
|
|
55
21
|
({
|
|
56
|
-
children:
|
|
57
|
-
disabled:
|
|
58
|
-
mode:
|
|
59
|
-
focusMode:
|
|
60
|
-
fullWidth:
|
|
61
|
-
className:
|
|
62
|
-
type:
|
|
63
|
-
raw:
|
|
64
|
-
noBorder:
|
|
65
|
-
"aria-label":
|
|
66
|
-
label:
|
|
67
|
-
size:
|
|
68
|
-
labelRight:
|
|
69
|
-
labelLeft:
|
|
70
|
-
noBackground:
|
|
22
|
+
children: m,
|
|
23
|
+
disabled: a = !1,
|
|
24
|
+
mode: o = "system",
|
|
25
|
+
focusMode: d = "system",
|
|
26
|
+
fullWidth: R = !1,
|
|
27
|
+
className: O,
|
|
28
|
+
type: A = "button",
|
|
29
|
+
raw: T = !1,
|
|
30
|
+
noBorder: I = !1,
|
|
31
|
+
"aria-label": E,
|
|
32
|
+
label: j,
|
|
33
|
+
size: r = "medium",
|
|
34
|
+
labelRight: f,
|
|
35
|
+
labelLeft: i,
|
|
36
|
+
noBackground: H = !1,
|
|
71
37
|
align: W = "center",
|
|
72
38
|
radius: _ = "large",
|
|
73
|
-
variant:
|
|
39
|
+
variant: x = "secondary",
|
|
74
40
|
iconClassName: M,
|
|
75
|
-
animated:
|
|
41
|
+
animated: s = !1,
|
|
76
42
|
...P
|
|
77
|
-
},
|
|
78
|
-
const
|
|
79
|
-
type:
|
|
80
|
-
mode:
|
|
81
|
-
focusMode:
|
|
82
|
-
fullWidth:
|
|
83
|
-
disabled:
|
|
84
|
-
raw:
|
|
85
|
-
className:
|
|
86
|
-
noBorder:
|
|
87
|
-
size:
|
|
88
|
-
labelRight:
|
|
89
|
-
labelLeft:
|
|
90
|
-
noBackground:
|
|
43
|
+
}, S) => {
|
|
44
|
+
const $ = K({
|
|
45
|
+
type: Q,
|
|
46
|
+
mode: o,
|
|
47
|
+
focusMode: d,
|
|
48
|
+
fullWidth: R,
|
|
49
|
+
disabled: a,
|
|
50
|
+
raw: T,
|
|
51
|
+
className: O,
|
|
52
|
+
noBorder: I,
|
|
53
|
+
size: r,
|
|
54
|
+
labelRight: f,
|
|
55
|
+
labelLeft: i,
|
|
56
|
+
noBackground: H,
|
|
91
57
|
align: W,
|
|
92
58
|
radius: _,
|
|
93
|
-
variant:
|
|
94
|
-
animated:
|
|
95
|
-
}),
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
if (
|
|
100
|
-
let
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
59
|
+
variant: x,
|
|
60
|
+
animated: s
|
|
61
|
+
}), G = V({ mode: o, raw: T, iconClassName: M, variant: x }), B = X({ animated: s }), L = "flex items-center justify-center relative w-full h-full overflow-hidden", [e, h] = C(), [t, w] = C(), [y, g] = C(), N = b(0), c = b(null), n = b(null), U = k([S, c]);
|
|
62
|
+
return v(() => {
|
|
63
|
+
y && y.current && s && (N.current = g.width + Z[r] + (I ? 0 : z), c.current && !c.current.style.width && (c.current.style.width = `${p[r]}px`));
|
|
64
|
+
}, [g, y, r, I, s]), v(() => {
|
|
65
|
+
if (c && c.current && s) {
|
|
66
|
+
let l = p[r];
|
|
67
|
+
f && e && h.width > 0 ? l = h.width + N.current : i && t && w.width > 0 && (l = w.width + N.current), n.current && clearTimeout(n.current), l !== parseInt(c.current.style.width || "0", 10) && (e.current && (e.current.style.opacity = "0"), t.current && (t.current.style.opacity = "0"), c.current.style.width = `${l}px`, l > p[r] && (n.current = setTimeout(() => {
|
|
68
|
+
e.current && f && (e.current.style.opacity = "1"), t.current && i && (t.current.style.opacity = "1"), n.current = null;
|
|
69
|
+
}, ee * 0.8))), l === p[r] && (e.current && (e.current.style.opacity = "0"), t.current && (t.current.style.opacity = "0"));
|
|
104
70
|
}
|
|
105
71
|
}, [
|
|
106
|
-
N,
|
|
107
72
|
h,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
73
|
+
f,
|
|
74
|
+
e,
|
|
75
|
+
w,
|
|
76
|
+
i,
|
|
77
|
+
t,
|
|
78
|
+
r,
|
|
79
|
+
s
|
|
80
|
+
]), F(() => () => {
|
|
81
|
+
n.current && clearTimeout(n.current);
|
|
82
|
+
}, []), /* @__PURE__ */ u(
|
|
83
|
+
J,
|
|
118
84
|
{
|
|
119
|
-
ref:
|
|
120
|
-
className:
|
|
121
|
-
disabled:
|
|
122
|
-
type:
|
|
123
|
-
"aria-label":
|
|
85
|
+
ref: U,
|
|
86
|
+
className: $,
|
|
87
|
+
disabled: a,
|
|
88
|
+
type: A,
|
|
89
|
+
"aria-label": E || j,
|
|
124
90
|
...P,
|
|
125
|
-
children: /* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
91
|
+
children: /* @__PURE__ */ Y("div", { className: L, children: [
|
|
92
|
+
/* @__PURE__ */ u(
|
|
93
|
+
D,
|
|
128
94
|
{
|
|
129
|
-
label:
|
|
130
|
-
labelRef:
|
|
95
|
+
label: i,
|
|
96
|
+
labelRef: t,
|
|
131
97
|
labelClass: B,
|
|
132
98
|
labelInnerClass: "pr-2",
|
|
133
|
-
initiallyHidden:
|
|
99
|
+
initiallyHidden: s
|
|
134
100
|
}
|
|
135
101
|
),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
|
|
102
|
+
/* @__PURE__ */ u("span", { ref: y, className: G, children: m }),
|
|
103
|
+
/* @__PURE__ */ u(
|
|
104
|
+
D,
|
|
139
105
|
{
|
|
140
|
-
label:
|
|
141
|
-
labelRef:
|
|
106
|
+
label: f,
|
|
107
|
+
labelRef: e,
|
|
142
108
|
labelClass: B,
|
|
143
109
|
labelInnerClass: "pl-2",
|
|
144
|
-
initiallyHidden:
|
|
110
|
+
initiallyHidden: s
|
|
145
111
|
}
|
|
146
112
|
)
|
|
147
113
|
] })
|
|
148
114
|
}
|
|
149
115
|
);
|
|
150
116
|
}
|
|
151
|
-
),
|
|
152
|
-
labelRef:
|
|
153
|
-
labelClass:
|
|
154
|
-
label:
|
|
155
|
-
labelInnerClass:
|
|
156
|
-
initiallyHidden:
|
|
157
|
-
}) => /* @__PURE__ */
|
|
117
|
+
), D = ({
|
|
118
|
+
labelRef: m,
|
|
119
|
+
labelClass: a,
|
|
120
|
+
label: o,
|
|
121
|
+
labelInnerClass: d,
|
|
122
|
+
initiallyHidden: R = !1
|
|
123
|
+
}) => /* @__PURE__ */ u(
|
|
158
124
|
"span",
|
|
159
125
|
{
|
|
160
|
-
ref:
|
|
161
|
-
className:
|
|
162
|
-
style:
|
|
163
|
-
children:
|
|
126
|
+
ref: m,
|
|
127
|
+
className: a,
|
|
128
|
+
style: R ? { opacity: 0 } : void 0,
|
|
129
|
+
children: o && /* @__PURE__ */ u("span", { className: d, children: o })
|
|
164
130
|
}
|
|
165
131
|
);
|
|
166
|
-
|
|
132
|
+
te.displayName = "ButtonIcon";
|
|
167
133
|
export {
|
|
168
|
-
|
|
134
|
+
te as ButtonIcon
|
|
169
135
|
};
|
package/dist/index.js
CHANGED
|
@@ -7,13 +7,13 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
7
7
|
import n from "clsx";
|
|
8
8
|
import m from "react";
|
|
9
9
|
/*!
|
|
10
|
-
@versini/ui-button v8.0.
|
|
10
|
+
@versini/ui-button v8.0.2
|
|
11
11
|
© 2025 gizmette.com
|
|
12
12
|
*/
|
|
13
13
|
try {
|
|
14
14
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
15
|
-
version: "8.0.
|
|
16
|
-
buildTime: "
|
|
15
|
+
version: "8.0.2",
|
|
16
|
+
buildTime: "10/17/2025 12:52 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": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -36,23 +36,19 @@
|
|
|
36
36
|
"test:watch": "vitest",
|
|
37
37
|
"test": "vitest run"
|
|
38
38
|
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"react": "^19.0.0",
|
|
41
|
-
"react-dom": "^19.0.0"
|
|
42
|
-
},
|
|
43
39
|
"devDependencies": {
|
|
44
|
-
"@testing-library/jest-dom": "6.
|
|
45
|
-
"@versini/ui-types": "6.0.
|
|
40
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
41
|
+
"@versini/ui-types": "6.0.2"
|
|
46
42
|
},
|
|
47
43
|
"dependencies": {
|
|
48
|
-
"@tailwindcss/typography": "0.5.
|
|
49
|
-
"@versini/ui-hooks": "5.0.
|
|
50
|
-
"@versini/ui-icons": "4.
|
|
44
|
+
"@tailwindcss/typography": "0.5.19",
|
|
45
|
+
"@versini/ui-hooks": "5.0.2",
|
|
46
|
+
"@versini/ui-icons": "4.12.3",
|
|
51
47
|
"clsx": "2.1.1",
|
|
52
|
-
"tailwindcss": "4.1.
|
|
48
|
+
"tailwindcss": "4.1.14"
|
|
53
49
|
},
|
|
54
50
|
"sideEffects": [
|
|
55
51
|
"**/*.css"
|
|
56
52
|
],
|
|
57
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "67e049c9b2e46e8f52509bf6198ca0cdaf5d970a"
|
|
58
54
|
}
|