@versini/ui-button 11.0.0 → 11.1.0
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 +1 -13
- package/dist/components/Button/Button.js +1 -13
- package/dist/components/Button/ButtonCopy.js +1 -13
- package/dist/components/Button/ButtonIcon.js +7 -19
- package/dist/components/Button/ButtonLink.js +1 -13
- package/dist/components/Button/utilities.js +14 -25
- package/dist/components/index.js +2 -13
- package/dist/components/private/BaseButton.js +1 -13
- package/dist/components/private/ButtonSort.js +1 -13
- package/package.json +4 -4
package/dist/common/constants.js
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button v11.
|
|
2
|
+
@versini/ui-button v11.1.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
|
-
try {
|
|
6
|
-
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
|
-
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "11.0.0",
|
|
9
|
-
buildTime: "12/16/2025 06:21 PM EST",
|
|
10
|
-
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
|
-
license: "MIT",
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
// nothing to declare officer
|
|
16
|
-
}
|
|
17
5
|
|
|
18
6
|
|
|
19
7
|
;// CONCATENATED MODULE: ./src/common/constants.ts
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button v11.
|
|
2
|
+
@versini/ui-button v11.1.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
|
-
try {
|
|
6
|
-
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
|
-
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "11.0.0",
|
|
9
|
-
buildTime: "12/16/2025 06:21 PM EST",
|
|
10
|
-
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
|
-
license: "MIT",
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
// nothing to declare officer
|
|
16
|
-
}
|
|
17
5
|
|
|
18
6
|
import { jsx } from "react/jsx-runtime";
|
|
19
7
|
import react from "react";
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button v11.
|
|
2
|
+
@versini/ui-button v11.1.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
|
-
try {
|
|
6
|
-
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
|
-
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "11.0.0",
|
|
9
|
-
buildTime: "12/16/2025 06:21 PM EST",
|
|
10
|
-
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
|
-
license: "MIT",
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
// nothing to declare officer
|
|
16
|
-
}
|
|
17
5
|
|
|
18
6
|
import { jsx } from "react/jsx-runtime";
|
|
19
7
|
import { IconCopied, IconCopy } from "@versini/ui-icons";
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button v11.
|
|
2
|
+
@versini/ui-button v11.1.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
|
-
try {
|
|
6
|
-
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
|
-
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "11.0.0",
|
|
9
|
-
buildTime: "12/16/2025 06:21 PM EST",
|
|
10
|
-
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
|
-
license: "MIT",
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
// nothing to declare officer
|
|
16
|
-
}
|
|
17
5
|
|
|
18
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
7
|
import { useMergeRefs } from "@versini/ui-hooks/use-merge-refs";
|
|
@@ -97,14 +85,14 @@ const ButtonIcon = /*#__PURE__*/ react.forwardRef(({ children, disabled = false,
|
|
|
97
85
|
* Effect to calculate the buffer to add to the width of the button to
|
|
98
86
|
* account for the icon, paddings and borders.
|
|
99
87
|
*/ useLayoutEffect(()=>{
|
|
100
|
-
/* v8 ignore
|
|
88
|
+
/* v8 ignore start */ if (iconRef && iconRef.current && animated) {
|
|
101
89
|
bufferRef.current = rectIcon.width + PADDINGS[size] + (noBorder ? 0 : BORDERS);
|
|
102
90
|
// Set initial button width if it hasn't been set yet
|
|
103
91
|
if (buttonRef.current && !buttonRef.current.style.width) {
|
|
104
92
|
buttonRef.current.style.width = `${WIDTH[size]}px`;
|
|
105
93
|
}
|
|
106
94
|
}
|
|
107
|
-
}, [
|
|
95
|
+
/* v8 ignore stop */ }, [
|
|
108
96
|
rectIcon,
|
|
109
97
|
iconRef,
|
|
110
98
|
size,
|
|
@@ -115,7 +103,7 @@ const ButtonIcon = /*#__PURE__*/ react.forwardRef(({ children, disabled = false,
|
|
|
115
103
|
* Effect to update the width of the button based on the visibility of
|
|
116
104
|
* the right and left labels.
|
|
117
105
|
*/ useLayoutEffect(()=>{
|
|
118
|
-
/* v8 ignore
|
|
106
|
+
/* v8 ignore start */ if (buttonRef && buttonRef.current && animated) {
|
|
119
107
|
// Calculate the target width first
|
|
120
108
|
let newWidth = WIDTH[size];
|
|
121
109
|
if (labelRight && labelRightRef && rectR.width > 0) {
|
|
@@ -161,7 +149,7 @@ const ButtonIcon = /*#__PURE__*/ react.forwardRef(({ children, disabled = false,
|
|
|
161
149
|
}
|
|
162
150
|
}
|
|
163
151
|
}
|
|
164
|
-
}, [
|
|
152
|
+
/* v8 ignore stop */ }, [
|
|
165
153
|
rectR,
|
|
166
154
|
labelRight,
|
|
167
155
|
labelRightRef,
|
|
@@ -172,14 +160,14 @@ const ButtonIcon = /*#__PURE__*/ react.forwardRef(({ children, disabled = false,
|
|
|
172
160
|
animated
|
|
173
161
|
]);
|
|
174
162
|
// Clean up timeout on unmount
|
|
175
|
-
/* v8 ignore
|
|
163
|
+
/* v8 ignore start */ useEffect(()=>{
|
|
176
164
|
return ()=>{
|
|
177
165
|
if (timeoutRef.current) {
|
|
178
166
|
clearTimeout(timeoutRef.current);
|
|
179
167
|
}
|
|
180
168
|
};
|
|
181
169
|
}, []);
|
|
182
|
-
return /*#__PURE__*/ jsx(BaseButton_private, {
|
|
170
|
+
/* v8 ignore stop */ return /*#__PURE__*/ jsx(BaseButton_private, {
|
|
183
171
|
ref: mergedRef,
|
|
184
172
|
className: buttonClass,
|
|
185
173
|
disabled: disabled,
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button v11.
|
|
2
|
+
@versini/ui-button v11.1.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
|
-
try {
|
|
6
|
-
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
|
-
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "11.0.0",
|
|
9
|
-
buildTime: "12/16/2025 06:21 PM EST",
|
|
10
|
-
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
|
-
license: "MIT",
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
// nothing to declare officer
|
|
16
|
-
}
|
|
17
5
|
|
|
18
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
7
|
import clsx from "clsx";
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button v11.
|
|
2
|
+
@versini/ui-button v11.1.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
|
-
try {
|
|
6
|
-
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
|
-
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "11.0.0",
|
|
9
|
-
buildTime: "12/16/2025 06:21 PM EST",
|
|
10
|
-
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
|
-
license: "MIT",
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
// nothing to declare officer
|
|
16
|
-
}
|
|
17
5
|
|
|
18
6
|
import clsx from "clsx";
|
|
19
7
|
import { BUTTON_CLASSNAME } from "../../common/constants.js";
|
|
@@ -112,12 +100,12 @@ const getButtonTextCopyClasses = ({ mode, noBackground, truncate, variant })=>{
|
|
|
112
100
|
"dark:text-copy-light": mode === "alt-system"
|
|
113
101
|
});
|
|
114
102
|
}
|
|
115
|
-
if (variant === "selected") {
|
|
103
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
116
104
|
return clsx("not-prose text-copy-lighter", {
|
|
117
105
|
truncate: truncate
|
|
118
106
|
});
|
|
119
107
|
}
|
|
120
|
-
};
|
|
108
|
+
/* v8 ignore stop */ };
|
|
121
109
|
const getButtonBackgroundClasses = ({ mode, noBackground, variant })=>{
|
|
122
110
|
if (noBackground) {
|
|
123
111
|
return;
|
|
@@ -146,10 +134,10 @@ const getButtonBackgroundClasses = ({ mode, noBackground, variant })=>{
|
|
|
146
134
|
"bg-action-danger-light dark:bg-action-danger-dark": mode === "alt-system"
|
|
147
135
|
});
|
|
148
136
|
}
|
|
149
|
-
if (variant === "selected") {
|
|
137
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
150
138
|
return "bg-action-selected-dark";
|
|
151
139
|
}
|
|
152
|
-
};
|
|
140
|
+
/* v8 ignore stop */ };
|
|
153
141
|
const getButtonRadiusClasses = ({ radius })=>{
|
|
154
142
|
return clsx({
|
|
155
143
|
"rounded-full": radius === "large",
|
|
@@ -193,10 +181,10 @@ const getButtonHoverClasses = ({ mode, disabled, variant })=>{
|
|
|
193
181
|
"hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": mode === "alt-system"
|
|
194
182
|
});
|
|
195
183
|
}
|
|
196
|
-
if (variant === "selected") {
|
|
184
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
197
185
|
return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
|
|
198
186
|
}
|
|
199
|
-
};
|
|
187
|
+
/* v8 ignore stop */ };
|
|
200
188
|
const getButtonActiveClasses = ({ mode, disabled, variant })=>{
|
|
201
189
|
if (disabled) {
|
|
202
190
|
return "";
|
|
@@ -233,10 +221,10 @@ const getButtonActiveClasses = ({ mode, disabled, variant })=>{
|
|
|
233
221
|
"active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": mode === "alt-system"
|
|
234
222
|
});
|
|
235
223
|
}
|
|
236
|
-
if (variant === "selected") {
|
|
224
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
237
225
|
return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
|
|
238
226
|
}
|
|
239
|
-
};
|
|
227
|
+
/* v8 ignore stop */ };
|
|
240
228
|
const getButtonBorderClasses = ({ mode, noBorder, variant })=>{
|
|
241
229
|
if (noBorder) {
|
|
242
230
|
return "border border-transparent";
|
|
@@ -265,10 +253,10 @@ const getButtonBorderClasses = ({ mode, noBorder, variant })=>{
|
|
|
265
253
|
"border-border-danger-medium dark:border-border-danger-dark": mode === "alt-system"
|
|
266
254
|
});
|
|
267
255
|
}
|
|
268
|
-
if (variant === "selected") {
|
|
256
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
269
257
|
return "border border-border-selected-dark";
|
|
270
258
|
}
|
|
271
|
-
};
|
|
259
|
+
/* v8 ignore stop */ };
|
|
272
260
|
const getButtonFocusClasses = ({ focusMode })=>{
|
|
273
261
|
return clsx("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
274
262
|
"focus:outline-focus-dark": focusMode === "dark",
|
|
@@ -304,12 +292,13 @@ const getIconClasses = ({ mode, raw, iconClassName, variant = "primary" })=>{
|
|
|
304
292
|
"dark:text-copy-lighter": mode === "system",
|
|
305
293
|
"dark:text-copy-light": mode === "alt-system"
|
|
306
294
|
};
|
|
307
|
-
}
|
|
295
|
+
}
|
|
296
|
+
/* v8 ignore start - selected variant edge case */ if (variant === "selected") {
|
|
308
297
|
textColorClasses = {
|
|
309
298
|
"text-copy-lighter": true
|
|
310
299
|
};
|
|
311
300
|
}
|
|
312
|
-
return clsx(textColorClasses, iconClassName);
|
|
301
|
+
/* v8 ignore stop */ return clsx(textColorClasses, iconClassName);
|
|
313
302
|
};
|
|
314
303
|
const getButtonIconLabelClasses = ({ animated })=>{
|
|
315
304
|
return clsx({
|
package/dist/components/index.js
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button v11.
|
|
2
|
+
@versini/ui-button v11.1.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
|
-
try {
|
|
6
|
-
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
|
-
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "11.0.0",
|
|
9
|
-
buildTime: "12/16/2025 06:21 PM EST",
|
|
10
|
-
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
|
-
license: "MIT",
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
// nothing to declare officer
|
|
16
|
-
}
|
|
17
5
|
|
|
18
6
|
export * from "../common/constants.js";
|
|
19
7
|
export * from "./Button/Button.js";
|
|
@@ -23,6 +11,7 @@ export * from "./Button/ButtonLink.js";
|
|
|
23
11
|
export * from "./private/ButtonSort.js";
|
|
24
12
|
|
|
25
13
|
;// CONCATENATED MODULE: ./src/components/index.ts
|
|
14
|
+
// force new release
|
|
26
15
|
|
|
27
16
|
|
|
28
17
|
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button v11.
|
|
2
|
+
@versini/ui-button v11.1.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
|
-
try {
|
|
6
|
-
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
|
-
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "11.0.0",
|
|
9
|
-
buildTime: "12/16/2025 06:21 PM EST",
|
|
10
|
-
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
|
-
license: "MIT",
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
// nothing to declare officer
|
|
16
|
-
}
|
|
17
5
|
|
|
18
6
|
import { jsx } from "react/jsx-runtime";
|
|
19
7
|
import react from "react";
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-button v11.
|
|
2
|
+
@versini/ui-button v11.1.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
|
-
try {
|
|
6
|
-
if (!window.__VERSINI_UI_BUTTON__) {
|
|
7
|
-
window.__VERSINI_UI_BUTTON__ = {
|
|
8
|
-
version: "11.0.0",
|
|
9
|
-
buildTime: "12/16/2025 06:21 PM EST",
|
|
10
|
-
homepage: "https://www.npmjs.com/package/@versini/ui-button",
|
|
11
|
-
license: "MIT",
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
// nothing to declare officer
|
|
16
|
-
}
|
|
17
5
|
|
|
18
6
|
import { jsx } from "react/jsx-runtime";
|
|
19
7
|
import clsx from "clsx";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-button",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@testing-library/jest-dom": "6.9.1",
|
|
66
|
-
"@versini/ui-types": "8.
|
|
66
|
+
"@versini/ui-types": "8.1.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@tailwindcss/typography": "0.5.19",
|
|
70
|
-
"@versini/ui-hooks": "6.
|
|
70
|
+
"@versini/ui-hooks": "6.1.0",
|
|
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": "b2ee2e328ecadfbedcb26d14afa896a30f0ab54b"
|
|
79
79
|
}
|