@versini/ui-button 6.0.5 → 6.0.7

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.
@@ -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-out": t === l && b
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.B6tGQPoK.js";
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: "04/05/2025 07:49 PM EDT",
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.9.0
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.9.0",
99
- buildTime: "04/05/2025 07:49 PM EDT",
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 { jsxs as G, jsx as i } from "react/jsx-runtime";
2
- import H, { useRef as m, useCallback as M, useEffect as E, useMemo as A, useState as W, useLayoutEffect as B } from "react";
3
- import { BaseButton_private as Y } from "../../chunks/BaseButton.BFKIL4GO.js";
4
- import { getButtonClasses as J, TYPE_ICON as K, getIconClasses as Q, getButtonIconLabelClasses as U } from "../../chunks/utilities.B6tGQPoK.js";
5
- function V() {
6
- const t = m(!1);
7
- return E(() => (t.current = !0, () => {
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
- }), []), M(() => t.current, []);
9
+ }), []), J(() => t.current, []);
10
10
  }
11
- function X(t) {
12
- return A(() => t.every((r) => r == null) ? () => {
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
- }, t);
17
+ }, [...t]);
18
18
  }
19
- const Z = {
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 g(t) {
30
- const r = V(), e = m(0), n = m(null), [h, w] = W(Z), s = A(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((p) => {
31
- const l = p[0];
32
- l && (cancelAnimationFrame(e.current), e.current = requestAnimationFrame(() => {
33
- n.current && r() && w(l.contentRect);
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 E(() => (n.current && (s == null || s.observe(n.current, t)), () => {
37
- s == null || s.disconnect(), e.current && cancelAnimationFrame(e.current);
38
- }), [s, t]), [n, h];
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 z = {
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
- }, ee = {
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
- }, te = 2, re = H.forwardRef(
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: n = "system",
60
- fullWidth: h = !1,
61
- className: w,
62
- type: s = "button",
63
- raw: p = !1,
64
- noBorder: l = !1,
65
- "aria-label": D,
66
- label: O,
67
- size: f = "medium",
68
- labelRight: y,
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: $ = !1,
71
- align: F = "center",
72
- radius: S = "large",
73
- variant: j = "primary",
74
- iconClassName: L,
70
+ noBackground: H = !1,
71
+ align: S = "center",
72
+ radius: W = "large",
73
+ variant: _ = "primary",
74
+ iconClassName: $,
75
75
  animated: u = !1,
76
- ...P
77
- }, T) => {
78
- const _ = J({
79
- type: K,
76
+ ...M
77
+ }, P) => {
78
+ const k = V({
79
+ type: X,
80
80
  mode: e,
81
- focusMode: n,
82
- fullWidth: h,
81
+ focusMode: s,
82
+ fullWidth: d,
83
83
  disabled: r,
84
- raw: p,
85
- className: w,
86
- noBorder: l,
87
- size: f,
88
- labelRight: y,
84
+ raw: w,
85
+ className: C,
86
+ noBorder: a,
87
+ size: l,
88
+ labelRight: h,
89
89
  labelLeft: R,
90
- noBackground: $,
91
- align: F,
92
- radius: S,
93
- variant: j,
90
+ noBackground: H,
91
+ align: S,
92
+ radius: W,
93
+ variant: _,
94
94
  animated: u
95
- }), k = Q({ mode: e, raw: p, iconClassName: L }), x = U({ animated: u }), [c, C] = g(), [o, I] = g(), [b, N] = g(), d = m(0), a = m(null), q = X([T, a]);
96
- return B(() => {
97
- b && b.current && u && (d.current = N.width + ee[f] + (l ? 0 : te));
98
- }, [N, b, f, l, u]), B(() => {
99
- a && a.current && u && (y && c && C.width > 0 ? (c.current && (c.current.style.opacity = "100"), a.current.style.width = `${C.width + d.current}px`) : R && I.width > 0 ? (o.current && (o.current.style.opacity = "100"), a.current.style.width = `${I.width + d.current}px`) : (c.current && (c.current.style.opacity = "0"), o.current && (o.current.style.opacity = "0"), a.current.style.width = `${z[f]}px`));
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
- C,
102
- y,
103
- c,
104
- I,
106
+ N,
107
+ h,
108
+ n,
109
+ v,
105
110
  R,
106
- o,
107
- f,
111
+ c,
112
+ l,
108
113
  u
109
- ]), /* @__PURE__ */ G(
110
- Y,
114
+ ]), T(() => () => {
115
+ f.current && clearTimeout(f.current);
116
+ }, []), /* @__PURE__ */ m(
117
+ Q,
111
118
  {
112
- ref: q,
113
- className: _,
119
+ ref: L,
120
+ className: k,
114
121
  disabled: r,
115
- type: s,
116
- "aria-label": D || O,
117
- ...P,
118
- children: [
119
- /* @__PURE__ */ i(
120
- v,
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: o,
124
- labelClass: x,
125
- labelInnerClass: "pr-2"
130
+ labelRef: c,
131
+ labelClass: g,
132
+ labelInnerClass: "pr-2",
133
+ initiallyHidden: u
126
134
  }
127
135
  ),
128
- /* @__PURE__ */ i("span", { ref: b, className: k, children: t }),
129
- /* @__PURE__ */ i(
130
- v,
136
+ /* @__PURE__ */ m("span", { ref: I, className: q, children: t }),
137
+ /* @__PURE__ */ m(
138
+ D,
131
139
  {
132
- label: y,
133
- labelRef: c,
134
- labelClass: x,
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
- ), v = ({
151
+ ), D = ({
143
152
  labelRef: t,
144
153
  labelClass: r,
145
154
  label: e,
146
- labelInnerClass: n
147
- }) => /* @__PURE__ */ i("span", { ref: t, className: r, children: e && /* @__PURE__ */ i("span", { className: n, children: e }) });
148
- re.displayName = "ButtonIcon";
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
- re as ButtonIcon
168
+ le as ButtonIcon
151
169
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, jsxs as o } from "react/jsx-runtime";
2
2
  import r from "clsx";
3
3
  import v from "react";
4
- import { getButtonClasses as V, TYPE_LINK as C } from "../../chunks/utilities.B6tGQPoK.js";
4
+ import { getButtonClasses as V, TYPE_LINK as C } from "../../chunks/utilities.B84qY3__.js";
5
5
  const L = v.forwardRef(
6
6
  ({
7
7
  children: t,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BUTTON_CLASSNAME as B } from "./chunks/utilities.B6tGQPoK.js";
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.5
10
+ @versini/ui-button v6.0.7
11
11
  © 2025 gizmette.com
12
12
  */
13
13
  try {
14
14
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
15
- version: "6.0.5",
16
- buildTime: "04/12/2025 09:18 AM EDT",
15
+ version: "6.0.7",
16
+ buildTime: "06/20/2025 05:21 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.5",
3
+ "version": "6.0.7",
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.2"
42
+ "@versini/ui-types": "5.0.4"
43
43
  },
44
44
  "dependencies": {
45
45
  "@tailwindcss/typography": "0.5.16",
46
- "@versini/ui-hooks": "4.7.3",
47
- "@versini/ui-icons": "4.9.0",
46
+ "@versini/ui-hooks": "4.7.4",
47
+ "@versini/ui-icons": "4.10.0",
48
48
  "clsx": "2.1.1",
49
- "tailwindcss": "4.1.3"
49
+ "tailwindcss": "4.1.10"
50
50
  },
51
51
  "sideEffects": [
52
52
  "**/*.css"
53
53
  ],
54
- "gitHead": "1bc09c4f0904bd8c01a22b1a32299fdd7598ae32"
54
+ "gitHead": "2fffae99315244f0662bdecbe45a89bc770f0f15"
55
55
  }