@versini/ui-button 1.0.1 → 1.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.
- package/dist/chunks/BaseButton.BFKIL4GO.js +22 -0
- package/dist/chunks/{utilities.CSwQTOog.js → utilities.u8fHoETw.js} +3 -2
- package/dist/components/Button/Button.js +18 -18
- package/dist/components/Button/ButtonIcon.js +17 -17
- package/dist/components/Button/ButtonLink.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +34 -32
- package/package.json +2 -2
- package/dist/chunks/BaseButton.D-AA7SPL.js +0 -24
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import i from "react";
|
|
3
|
+
const u = (t, r, n) => {
|
|
4
|
+
var o;
|
|
5
|
+
!r && (!document.activeElement || document.activeElement !== t.currentTarget) && typeof ((o = t == null ? void 0 : t.currentTarget) == null ? void 0 : o.focus) == "function" && t.currentTarget.focus(), typeof n == "function" && n(t);
|
|
6
|
+
}, f = i.forwardRef((t, r) => {
|
|
7
|
+
const { onClick: n, noInternalClick: o = !1, ...e } = t;
|
|
8
|
+
return /* @__PURE__ */ a(
|
|
9
|
+
"button",
|
|
10
|
+
{
|
|
11
|
+
ref: r,
|
|
12
|
+
onClick: (c) => {
|
|
13
|
+
u(c, o, n);
|
|
14
|
+
},
|
|
15
|
+
...e
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
f.displayName = "BaseButton";
|
|
20
|
+
export {
|
|
21
|
+
f as BaseButton_private
|
|
22
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import a from "clsx";
|
|
2
|
-
const p = (t) => {
|
|
2
|
+
const s = "av-button", p = (t) => {
|
|
3
3
|
let e = "";
|
|
4
4
|
if (typeof t == "number" || typeof t == "string")
|
|
5
5
|
e = "m-" + t;
|
|
@@ -8,7 +8,7 @@ const p = (t) => {
|
|
|
8
8
|
(t == null ? void 0 : t.t) !== void 0 && r.push(`mt-${t.t}`), (t == null ? void 0 : t.r) !== void 0 && r.push(`mr-${t.r}`), (t == null ? void 0 : t.b) !== void 0 && r.push(`mb-${t.b}`), (t == null ? void 0 : t.l) !== void 0 && r.push(`ml-${t.l}`), e = r.join(" ");
|
|
9
9
|
}
|
|
10
10
|
return e;
|
|
11
|
-
},
|
|
11
|
+
}, f = "icon", x = "button", m = "link", C = ({
|
|
12
12
|
type: t,
|
|
13
13
|
size: e,
|
|
14
14
|
labelRight: r,
|
|
@@ -196,6 +196,7 @@ const p = (t) => {
|
|
|
196
196
|
}
|
|
197
197
|
));
|
|
198
198
|
export {
|
|
199
|
+
s as BUTTON_CLASSNAME,
|
|
199
200
|
x as TYPE_BUTTON,
|
|
200
201
|
f as TYPE_ICON,
|
|
201
202
|
m as TYPE_LINK,
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import N from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { getButtonClasses as x, TYPE_BUTTON as C } from "../../chunks/utilities.
|
|
3
|
+
import { BaseButton_private as T } from "../../chunks/BaseButton.BFKIL4GO.js";
|
|
4
|
+
import { getButtonClasses as x, TYPE_BUTTON as C } from "../../chunks/utilities.u8fHoETw.js";
|
|
5
5
|
const R = N.forwardRef(
|
|
6
6
|
({
|
|
7
7
|
children: s,
|
|
8
8
|
disabled: t = !1,
|
|
9
9
|
mode: e = "system",
|
|
10
10
|
focusMode: o = "system",
|
|
11
|
-
fullWidth:
|
|
12
|
-
className:
|
|
13
|
-
size:
|
|
11
|
+
fullWidth: r = !1,
|
|
12
|
+
className: a,
|
|
13
|
+
size: m = "medium",
|
|
14
14
|
raw: f = !1,
|
|
15
|
-
noBorder:
|
|
16
|
-
spacing:
|
|
17
|
-
variant:
|
|
18
|
-
noTruncate:
|
|
19
|
-
...
|
|
15
|
+
noBorder: p = !1,
|
|
16
|
+
spacing: l,
|
|
17
|
+
variant: n = "primary",
|
|
18
|
+
noTruncate: i = !1,
|
|
19
|
+
...u
|
|
20
20
|
}, B) => {
|
|
21
21
|
const y = x({
|
|
22
22
|
type: C,
|
|
23
23
|
mode: e,
|
|
24
24
|
focusMode: o,
|
|
25
|
-
fullWidth:
|
|
25
|
+
fullWidth: r,
|
|
26
26
|
disabled: t,
|
|
27
27
|
raw: f,
|
|
28
|
-
className:
|
|
29
|
-
size:
|
|
30
|
-
noBorder:
|
|
31
|
-
spacing:
|
|
32
|
-
variant:
|
|
33
|
-
noTruncate:
|
|
28
|
+
className: a,
|
|
29
|
+
size: m,
|
|
30
|
+
noBorder: p,
|
|
31
|
+
spacing: l,
|
|
32
|
+
variant: n,
|
|
33
|
+
noTruncate: i
|
|
34
34
|
});
|
|
35
35
|
return /* @__PURE__ */ c(
|
|
36
36
|
T,
|
|
@@ -38,7 +38,7 @@ const R = N.forwardRef(
|
|
|
38
38
|
ref: B,
|
|
39
39
|
className: y,
|
|
40
40
|
disabled: t,
|
|
41
|
-
...
|
|
41
|
+
...u,
|
|
42
42
|
children: s
|
|
43
43
|
}
|
|
44
44
|
);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as g, jsx as
|
|
1
|
+
import { jsxs as g, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import I from "clsx";
|
|
3
3
|
import j from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { getButtonClasses as
|
|
6
|
-
const
|
|
4
|
+
import { BaseButton_private as v } from "../../chunks/BaseButton.BFKIL4GO.js";
|
|
5
|
+
import { getButtonClasses as _, TYPE_ICON as E } from "../../chunks/utilities.u8fHoETw.js";
|
|
6
|
+
const O = j.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
children: r,
|
|
9
9
|
disabled: o = !1,
|
|
10
10
|
mode: t = "system",
|
|
11
11
|
focusMode: n = "system",
|
|
12
|
-
fullWidth:
|
|
13
|
-
className:
|
|
12
|
+
fullWidth: p = !1,
|
|
13
|
+
className: l,
|
|
14
14
|
type: m = "button",
|
|
15
15
|
raw: s = !1,
|
|
16
16
|
noBorder: i = !1,
|
|
@@ -18,24 +18,24 @@ const P = j.forwardRef(
|
|
|
18
18
|
label: f,
|
|
19
19
|
size: x = "medium",
|
|
20
20
|
labelRight: a,
|
|
21
|
-
labelLeft:
|
|
21
|
+
labelLeft: e,
|
|
22
22
|
spacing: u,
|
|
23
23
|
noBackground: d = !1,
|
|
24
24
|
align: k = "center",
|
|
25
25
|
...N
|
|
26
26
|
}, h) => {
|
|
27
|
-
const B =
|
|
28
|
-
type:
|
|
27
|
+
const B = _({
|
|
28
|
+
type: E,
|
|
29
29
|
mode: t,
|
|
30
30
|
focusMode: n,
|
|
31
|
-
fullWidth:
|
|
31
|
+
fullWidth: p,
|
|
32
32
|
disabled: o,
|
|
33
33
|
raw: s,
|
|
34
|
-
className:
|
|
34
|
+
className: l,
|
|
35
35
|
noBorder: i,
|
|
36
36
|
size: x,
|
|
37
37
|
labelRight: a,
|
|
38
|
-
labelLeft:
|
|
38
|
+
labelLeft: e,
|
|
39
39
|
spacing: u,
|
|
40
40
|
noBackground: d,
|
|
41
41
|
align: k
|
|
@@ -55,15 +55,15 @@ const P = j.forwardRef(
|
|
|
55
55
|
"aria-label": y || f,
|
|
56
56
|
...N,
|
|
57
57
|
children: [
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
a && /* @__PURE__ */
|
|
58
|
+
e && /* @__PURE__ */ c("span", { className: "pr-2", children: e }),
|
|
59
|
+
/* @__PURE__ */ c("div", { className: C, children: r }),
|
|
60
|
+
a && /* @__PURE__ */ c("span", { className: "pl-2", children: a })
|
|
61
61
|
]
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
65
|
);
|
|
66
|
-
|
|
66
|
+
O.displayName = "ButtonIcon";
|
|
67
67
|
export {
|
|
68
|
-
|
|
68
|
+
O as ButtonIcon
|
|
69
69
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import b from "clsx";
|
|
3
3
|
import v from "react";
|
|
4
|
-
import { getButtonClasses as V, TYPE_LINK as C } from "../../chunks/utilities.
|
|
4
|
+
import { getButtonClasses as V, TYPE_LINK as C } from "../../chunks/utilities.u8fHoETw.js";
|
|
5
5
|
const L = v.forwardRef(
|
|
6
6
|
({
|
|
7
7
|
children: r,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as _versini_ui_private_dist_utilities from '@versini/ui-private/dist/utilities';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
+
declare const BUTTON_CLASSNAME = "av-button";
|
|
5
|
+
|
|
4
6
|
declare const Button: React.ForwardRefExoticComponent<{
|
|
5
7
|
children: React.ReactNode;
|
|
6
8
|
disabled?: boolean;
|
|
@@ -55,7 +57,7 @@ declare const ButtonLink: React.ForwardRefExoticComponent<{
|
|
|
55
57
|
size?: "small" | "medium" | "large";
|
|
56
58
|
} & _versini_ui_private_dist_utilities.SpacingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLAnchorElement>>;
|
|
57
59
|
|
|
58
|
-
declare const
|
|
60
|
+
declare const ButtonSort_private: React.ForwardRefExoticComponent<{
|
|
59
61
|
active?: boolean;
|
|
60
62
|
} & {
|
|
61
63
|
children: React.ReactNode;
|
|
@@ -75,4 +77,4 @@ declare const ButtonSort: React.ForwardRefExoticComponent<{
|
|
|
75
77
|
size?: "small" | "medium" | "large";
|
|
76
78
|
} & _versini_ui_private_dist_utilities.SpacingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
77
79
|
|
|
78
|
-
export { Button, ButtonIcon, ButtonLink,
|
|
80
|
+
export { BUTTON_CLASSNAME, Button, ButtonIcon, ButtonLink, ButtonSort_private };
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { getButtonClasses as I, TYPE_ICON as v } from "./chunks/utilities.u8fHoETw.js";
|
|
2
|
+
import { BUTTON_CLASSNAME as V } from "./chunks/utilities.u8fHoETw.js";
|
|
3
|
+
import { Button as Y } from "./components/Button/Button.js";
|
|
4
|
+
import { ButtonIcon as z } from "./components/Button/ButtonIcon.js";
|
|
5
|
+
import { ButtonLink as G } from "./components/Button/ButtonLink.js";
|
|
6
|
+
import { jsx as e, jsxs as C } from "react/jsx-runtime";
|
|
7
|
+
import c from "clsx";
|
|
8
|
+
import S from "react";
|
|
9
|
+
import { BaseButton_private as E } from "./chunks/BaseButton.BFKIL4GO.js";
|
|
9
10
|
/*!
|
|
10
|
-
@versini/ui-button v1.0.
|
|
11
|
+
@versini/ui-button v1.0.2
|
|
11
12
|
© 2024 gizmette.com
|
|
12
13
|
*/
|
|
13
14
|
try {
|
|
14
15
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
15
|
-
version: "1.0.
|
|
16
|
-
buildTime: "09/
|
|
16
|
+
version: "1.0.2",
|
|
17
|
+
buildTime: "09/16/2024 06:30 PM EDT",
|
|
17
18
|
homepage: "https://github.com/aversini/ui-components",
|
|
18
19
|
license: "MIT"
|
|
19
20
|
});
|
|
20
21
|
} catch {
|
|
21
22
|
}
|
|
22
|
-
const U =
|
|
23
|
+
const U = S.forwardRef(
|
|
23
24
|
({
|
|
24
25
|
children: o,
|
|
25
26
|
disabled: i = !1,
|
|
26
27
|
mode: t = "system",
|
|
27
|
-
focusMode:
|
|
28
|
+
focusMode: n = "system",
|
|
28
29
|
fullWidth: l = !1,
|
|
29
30
|
className: f,
|
|
30
31
|
type: p = "button",
|
|
@@ -32,36 +33,36 @@ const U = v.forwardRef(
|
|
|
32
33
|
noBorder: m = !1,
|
|
33
34
|
"aria-label": d,
|
|
34
35
|
label: b,
|
|
35
|
-
size:
|
|
36
|
+
size: h = "medium",
|
|
36
37
|
labelRight: a,
|
|
37
38
|
labelLeft: s,
|
|
38
|
-
spacing:
|
|
39
|
-
noBackground:
|
|
39
|
+
spacing: u,
|
|
40
|
+
noBackground: _ = !1,
|
|
40
41
|
align: x = "center",
|
|
41
|
-
active:
|
|
42
|
+
active: y = !1,
|
|
42
43
|
...k
|
|
43
|
-
},
|
|
44
|
-
const
|
|
45
|
-
type:
|
|
44
|
+
}, N) => {
|
|
45
|
+
const B = I({
|
|
46
|
+
type: v,
|
|
46
47
|
mode: t,
|
|
47
|
-
focusMode:
|
|
48
|
+
focusMode: n,
|
|
48
49
|
fullWidth: l,
|
|
49
50
|
disabled: i,
|
|
50
51
|
raw: r,
|
|
51
52
|
className: f,
|
|
52
53
|
noBorder: m,
|
|
53
|
-
size:
|
|
54
|
+
size: h,
|
|
54
55
|
labelRight: a,
|
|
55
56
|
labelLeft: s,
|
|
56
|
-
spacing:
|
|
57
|
-
noBackground:
|
|
57
|
+
spacing: u,
|
|
58
|
+
noBackground: _,
|
|
58
59
|
align: x
|
|
59
|
-
}), g =
|
|
60
|
+
}), g = c({
|
|
60
61
|
"text-copy-accent-dark": t === "light" && !r,
|
|
61
62
|
"text-copy-light": t === "dark" && !r,
|
|
62
63
|
"text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !r,
|
|
63
64
|
"text-copy-light dark:text-copy-accent-dark": t === "system" && !r
|
|
64
|
-
}),
|
|
65
|
+
}), T = y ? c(
|
|
65
66
|
"relative",
|
|
66
67
|
"focus-within:static",
|
|
67
68
|
"focus-within:after:border-transparent",
|
|
@@ -78,11 +79,11 @@ const U = v.forwardRef(
|
|
|
78
79
|
"after:border-table-light dark:after:border-table-dark": t === "alt-system"
|
|
79
80
|
}
|
|
80
81
|
) : "";
|
|
81
|
-
return /* @__PURE__ */ e("div", { className:
|
|
82
|
+
return /* @__PURE__ */ e("div", { className: T, children: /* @__PURE__ */ C(
|
|
82
83
|
E,
|
|
83
84
|
{
|
|
84
|
-
ref:
|
|
85
|
-
className:
|
|
85
|
+
ref: N,
|
|
86
|
+
className: B,
|
|
86
87
|
disabled: i,
|
|
87
88
|
type: p,
|
|
88
89
|
"aria-label": d || b,
|
|
@@ -98,8 +99,9 @@ const U = v.forwardRef(
|
|
|
98
99
|
);
|
|
99
100
|
U.displayName = "ButtonSort";
|
|
100
101
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
V as BUTTON_CLASSNAME,
|
|
103
|
+
Y as Button,
|
|
104
|
+
z as ButtonIcon,
|
|
105
|
+
G as ButtonLink,
|
|
104
106
|
U as ButtonSort_private
|
|
105
107
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-button",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"sideEffects": [
|
|
51
51
|
"**/*.css"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "cdc7c10fb6b8a5bbef5087c0a82a790476d424db"
|
|
54
54
|
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import u from "react";
|
|
3
|
-
const f = (t, r, n) => {
|
|
4
|
-
var o;
|
|
5
|
-
!r && (!document.activeElement || document.activeElement !== t.currentTarget) && typeof ((o = t == null ? void 0 : t.currentTarget) == null ? void 0 : o.focus) == "function" && t.currentTarget.focus(), typeof n == "function" && n(t);
|
|
6
|
-
}, i = u.forwardRef(
|
|
7
|
-
(t, r) => {
|
|
8
|
-
const { onClick: n, noInternalClick: o = !1, ...e } = t;
|
|
9
|
-
return /* @__PURE__ */ a(
|
|
10
|
-
"button",
|
|
11
|
-
{
|
|
12
|
-
ref: r,
|
|
13
|
-
onClick: (c) => {
|
|
14
|
-
f(c, o, n);
|
|
15
|
-
},
|
|
16
|
-
...e
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
i.displayName = "BaseButton";
|
|
22
|
-
export {
|
|
23
|
-
i as BaseButton
|
|
24
|
-
};
|