@versini/ui-button 10.0.8 → 11.0.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/common/constants.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/ButtonCopy.js +3 -3
- package/dist/components/Button/ButtonIcon.js +15 -11
- package/dist/components/Button/ButtonLink.js +3 -3
- package/dist/components/Button/utilities.js +16 -15
- package/dist/components/index.js +3 -3
- package/dist/components/private/BaseButton.js +3 -3
- package/dist/components/private/ButtonSort.js +3 -3
- package/package.json +3 -3
package/dist/common/constants.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button
|
|
2
|
+
@versini/ui-button v11.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
7
|
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "11.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:19 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button
|
|
2
|
+
@versini/ui-button v11.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
7
|
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "11.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:19 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button
|
|
2
|
+
@versini/ui-button v11.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
7
|
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "11.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:19 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button
|
|
2
|
+
@versini/ui-button v11.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
7
|
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "11.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:19 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -16,14 +16,17 @@ try {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
import { useMergeRefs
|
|
19
|
+
import { useMergeRefs } from "@versini/ui-hooks/use-merge-refs";
|
|
20
|
+
import { useResizeObserver } from "@versini/ui-hooks/use-resize-observer";
|
|
20
21
|
import react, { useEffect, useLayoutEffect, useRef } from "react";
|
|
21
22
|
import { BaseButton_private } from "../private/BaseButton.js";
|
|
22
23
|
import { TYPE_ICON, getButtonClasses, getButtonIconLabelClasses, getIconClasses } from "./utilities.js";
|
|
23
24
|
|
|
24
25
|
;// CONCATENATED MODULE: external "react/jsx-runtime"
|
|
25
26
|
|
|
26
|
-
;// CONCATENATED MODULE: external "@versini/ui-hooks"
|
|
27
|
+
;// CONCATENATED MODULE: external "@versini/ui-hooks/use-merge-refs"
|
|
28
|
+
|
|
29
|
+
;// CONCATENATED MODULE: external "@versini/ui-hooks/use-resize-observer"
|
|
27
30
|
|
|
28
31
|
;// CONCATENATED MODULE: external "react"
|
|
29
32
|
|
|
@@ -37,6 +40,7 @@ import { TYPE_ICON, getButtonClasses, getButtonIconLabelClasses, getIconClasses
|
|
|
37
40
|
|
|
38
41
|
|
|
39
42
|
|
|
43
|
+
|
|
40
44
|
const WIDTH = {
|
|
41
45
|
small: 24,
|
|
42
46
|
medium: 32,
|
|
@@ -93,14 +97,14 @@ const ButtonIcon = /*#__PURE__*/ react.forwardRef(({ children, disabled = false,
|
|
|
93
97
|
* Effect to calculate the buffer to add to the width of the button to
|
|
94
98
|
* account for the icon, paddings and borders.
|
|
95
99
|
*/ useLayoutEffect(()=>{
|
|
96
|
-
/* v8 ignore
|
|
100
|
+
/* v8 ignore start */ if (iconRef && iconRef.current && animated) {
|
|
97
101
|
bufferRef.current = rectIcon.width + PADDINGS[size] + (noBorder ? 0 : BORDERS);
|
|
98
102
|
// Set initial button width if it hasn't been set yet
|
|
99
103
|
if (buttonRef.current && !buttonRef.current.style.width) {
|
|
100
104
|
buttonRef.current.style.width = `${WIDTH[size]}px`;
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
|
-
}, [
|
|
107
|
+
/* v8 ignore stop */ }, [
|
|
104
108
|
rectIcon,
|
|
105
109
|
iconRef,
|
|
106
110
|
size,
|
|
@@ -111,7 +115,7 @@ const ButtonIcon = /*#__PURE__*/ react.forwardRef(({ children, disabled = false,
|
|
|
111
115
|
* Effect to update the width of the button based on the visibility of
|
|
112
116
|
* the right and left labels.
|
|
113
117
|
*/ useLayoutEffect(()=>{
|
|
114
|
-
/* v8 ignore
|
|
118
|
+
/* v8 ignore start */ if (buttonRef && buttonRef.current && animated) {
|
|
115
119
|
// Calculate the target width first
|
|
116
120
|
let newWidth = WIDTH[size];
|
|
117
121
|
if (labelRight && labelRightRef && rectR.width > 0) {
|
|
@@ -157,7 +161,7 @@ const ButtonIcon = /*#__PURE__*/ react.forwardRef(({ children, disabled = false,
|
|
|
157
161
|
}
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
|
-
}, [
|
|
164
|
+
/* v8 ignore stop */ }, [
|
|
161
165
|
rectR,
|
|
162
166
|
labelRight,
|
|
163
167
|
labelRightRef,
|
|
@@ -168,14 +172,14 @@ const ButtonIcon = /*#__PURE__*/ react.forwardRef(({ children, disabled = false,
|
|
|
168
172
|
animated
|
|
169
173
|
]);
|
|
170
174
|
// Clean up timeout on unmount
|
|
171
|
-
/* v8 ignore
|
|
175
|
+
/* v8 ignore start */ useEffect(()=>{
|
|
172
176
|
return ()=>{
|
|
173
177
|
if (timeoutRef.current) {
|
|
174
178
|
clearTimeout(timeoutRef.current);
|
|
175
179
|
}
|
|
176
180
|
};
|
|
177
181
|
}, []);
|
|
178
|
-
return /*#__PURE__*/ jsx(BaseButton_private, {
|
|
182
|
+
/* v8 ignore stop */ return /*#__PURE__*/ jsx(BaseButton_private, {
|
|
179
183
|
ref: mergedRef,
|
|
180
184
|
className: buttonClass,
|
|
181
185
|
disabled: disabled,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button
|
|
2
|
+
@versini/ui-button v11.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
7
|
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "11.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:19 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button
|
|
2
|
+
@versini/ui-button v11.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
7
|
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "11.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:19 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -112,12 +112,12 @@ const getButtonTextCopyClasses = ({ mode, noBackground, truncate, variant })=>{
|
|
|
112
112
|
"dark:text-copy-light": mode === "alt-system"
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
if (variant === "selected") {
|
|
115
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
116
116
|
return clsx("not-prose text-copy-lighter", {
|
|
117
117
|
truncate: truncate
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
};
|
|
120
|
+
/* v8 ignore stop */ };
|
|
121
121
|
const getButtonBackgroundClasses = ({ mode, noBackground, variant })=>{
|
|
122
122
|
if (noBackground) {
|
|
123
123
|
return;
|
|
@@ -146,10 +146,10 @@ const getButtonBackgroundClasses = ({ mode, noBackground, variant })=>{
|
|
|
146
146
|
"bg-action-danger-light dark:bg-action-danger-dark": mode === "alt-system"
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
if (variant === "selected") {
|
|
149
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
150
150
|
return "bg-action-selected-dark";
|
|
151
151
|
}
|
|
152
|
-
};
|
|
152
|
+
/* v8 ignore stop */ };
|
|
153
153
|
const getButtonRadiusClasses = ({ radius })=>{
|
|
154
154
|
return clsx({
|
|
155
155
|
"rounded-full": radius === "large",
|
|
@@ -193,10 +193,10 @@ const getButtonHoverClasses = ({ mode, disabled, variant })=>{
|
|
|
193
193
|
"hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": mode === "alt-system"
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
if (variant === "selected") {
|
|
196
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
197
197
|
return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
|
|
198
198
|
}
|
|
199
|
-
};
|
|
199
|
+
/* v8 ignore stop */ };
|
|
200
200
|
const getButtonActiveClasses = ({ mode, disabled, variant })=>{
|
|
201
201
|
if (disabled) {
|
|
202
202
|
return "";
|
|
@@ -233,10 +233,10 @@ const getButtonActiveClasses = ({ mode, disabled, variant })=>{
|
|
|
233
233
|
"active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": mode === "alt-system"
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
-
if (variant === "selected") {
|
|
236
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
237
237
|
return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
|
|
238
238
|
}
|
|
239
|
-
};
|
|
239
|
+
/* v8 ignore stop */ };
|
|
240
240
|
const getButtonBorderClasses = ({ mode, noBorder, variant })=>{
|
|
241
241
|
if (noBorder) {
|
|
242
242
|
return "border border-transparent";
|
|
@@ -265,10 +265,10 @@ const getButtonBorderClasses = ({ mode, noBorder, variant })=>{
|
|
|
265
265
|
"border-border-danger-medium dark:border-border-danger-dark": mode === "alt-system"
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
|
-
if (variant === "selected") {
|
|
268
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
269
269
|
return "border border-border-selected-dark";
|
|
270
270
|
}
|
|
271
|
-
};
|
|
271
|
+
/* v8 ignore stop */ };
|
|
272
272
|
const getButtonFocusClasses = ({ focusMode })=>{
|
|
273
273
|
return clsx("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
274
274
|
"focus:outline-focus-dark": focusMode === "dark",
|
|
@@ -304,12 +304,13 @@ const getIconClasses = ({ mode, raw, iconClassName, variant = "primary" })=>{
|
|
|
304
304
|
"dark:text-copy-lighter": mode === "system",
|
|
305
305
|
"dark:text-copy-light": mode === "alt-system"
|
|
306
306
|
};
|
|
307
|
-
}
|
|
307
|
+
}
|
|
308
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
308
309
|
textColorClasses = {
|
|
309
310
|
"text-copy-lighter": true
|
|
310
311
|
};
|
|
311
312
|
}
|
|
312
|
-
return clsx(textColorClasses, iconClassName);
|
|
313
|
+
/* v8 ignore stop */ return clsx(textColorClasses, iconClassName);
|
|
313
314
|
};
|
|
314
315
|
const getButtonIconLabelClasses = ({ animated })=>{
|
|
315
316
|
return clsx({
|
package/dist/components/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button
|
|
2
|
+
@versini/ui-button v11.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
7
|
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "11.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:19 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button
|
|
2
|
+
@versini/ui-button v11.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
7
|
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "11.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:19 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button
|
|
2
|
+
@versini/ui-button v11.0.1
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
7
|
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "
|
|
9
|
-
buildTime: "12/
|
|
8
|
+
version: "11.0.1",
|
|
9
|
+
buildTime: "12/24/2025 09:19 AM EST",
|
|
10
10
|
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-button",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@tailwindcss/typography": "0.5.19",
|
|
70
|
-
"@versini/ui-hooks": "
|
|
70
|
+
"@versini/ui-hooks": "6.0.1",
|
|
71
71
|
"@versini/ui-icons": "4.15.1",
|
|
72
72
|
"clsx": "2.1.1",
|
|
73
73
|
"tailwindcss": "4.1.18"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"sideEffects": [
|
|
76
76
|
"**/*.css"
|
|
77
77
|
],
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "7b2640a0650a4c3aa6ca078888f765cb400f9f13"
|
|
79
79
|
}
|