@versini/ui-button 0.0.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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/chunks/BaseButton.D-AA7SPL.js +24 -0
- package/dist/chunks/utilities.CSwQTOog.js +203 -0
- package/dist/components/Button/Button.js +50 -0
- package/dist/components/Button/ButtonIcon.js +69 -0
- package/dist/components/Button/ButtonLink.js +72 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +105 -0
- package/dist/style.css +1 -0
- package/dist/style.js +0 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Arno Versini
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import a from "clsx";
|
|
2
|
+
const p = (t) => {
|
|
3
|
+
let e = "";
|
|
4
|
+
if (typeof t == "number" || typeof t == "string")
|
|
5
|
+
e = "m-" + t;
|
|
6
|
+
else {
|
|
7
|
+
const r = [];
|
|
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
|
+
}
|
|
10
|
+
return e;
|
|
11
|
+
}, s = "av-button", f = "icon", x = "button", m = "link", C = ({
|
|
12
|
+
type: t,
|
|
13
|
+
size: e,
|
|
14
|
+
labelRight: r,
|
|
15
|
+
labelLeft: i,
|
|
16
|
+
align: n
|
|
17
|
+
}) => {
|
|
18
|
+
const o = "text-sm font-medium max-h-8 py-0", g = "text-base font-medium max-h-9 py-1", d = "text-lg font-medium max-h-12 py-2";
|
|
19
|
+
switch (t) {
|
|
20
|
+
case x:
|
|
21
|
+
return a("px-4", {
|
|
22
|
+
[o]: e === "small",
|
|
23
|
+
[g]: e === "medium",
|
|
24
|
+
[d]: e === "large"
|
|
25
|
+
});
|
|
26
|
+
case m:
|
|
27
|
+
return a("px-4 text-center", {
|
|
28
|
+
[o]: e === "small",
|
|
29
|
+
[g]: e === "medium",
|
|
30
|
+
[d]: e === "large"
|
|
31
|
+
});
|
|
32
|
+
case f:
|
|
33
|
+
return a("inline-flex items-center", {
|
|
34
|
+
"justify-center": n === "center",
|
|
35
|
+
"justify-start": n === "left",
|
|
36
|
+
"justify-end": n === "right",
|
|
37
|
+
"h-6 w-6 p-0": e === "small" && !(r || i),
|
|
38
|
+
"h-6 px-4 text-sm font-medium": e === "small" && (r || i),
|
|
39
|
+
"h-8 w-8 p-1": e === "medium" && !(r || i),
|
|
40
|
+
"h-8 px-4 text-base font-medium": e === "medium" && (r || i),
|
|
41
|
+
"h-12 w-12 p-2": e === "large" && !(r || i),
|
|
42
|
+
"h-12 px-4 text-lg font-medium": e === "large" && (r || i)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}, B = ({
|
|
46
|
+
mode: t,
|
|
47
|
+
noBackground: e,
|
|
48
|
+
noTruncate: r,
|
|
49
|
+
variant: i
|
|
50
|
+
}) => {
|
|
51
|
+
if (e)
|
|
52
|
+
return "not-prose rounded-full";
|
|
53
|
+
if (i === "primary")
|
|
54
|
+
return a("not-prose rounded-full", {
|
|
55
|
+
truncate: !r,
|
|
56
|
+
"bg-action-dark text-copy-light": t === "dark",
|
|
57
|
+
"bg-action-light text-copy-lighter": t === "light",
|
|
58
|
+
"bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": t === "system",
|
|
59
|
+
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": t === "alt-system"
|
|
60
|
+
});
|
|
61
|
+
if (i === "secondary")
|
|
62
|
+
return a("not-prose rounded-full", {
|
|
63
|
+
truncate: !r,
|
|
64
|
+
"bg-action-dark text-copy-light": t === "light",
|
|
65
|
+
"bg-action-light text-copy-lighter": t === "dark",
|
|
66
|
+
"bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": t === "alt-system",
|
|
67
|
+
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": t === "system"
|
|
68
|
+
});
|
|
69
|
+
if (i === "danger")
|
|
70
|
+
return a("not-prose rounded-full", {
|
|
71
|
+
truncate: !r,
|
|
72
|
+
"bg-action-danger-dark text-copy-light": t === "dark",
|
|
73
|
+
"bg-action-danger-light text-copy-lighter": t === "light",
|
|
74
|
+
"bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": t === "system",
|
|
75
|
+
"bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": t === "alt-system"
|
|
76
|
+
});
|
|
77
|
+
}, w = ({
|
|
78
|
+
mode: t,
|
|
79
|
+
disabled: e,
|
|
80
|
+
variant: r
|
|
81
|
+
}) => {
|
|
82
|
+
if (e)
|
|
83
|
+
return "";
|
|
84
|
+
if (r === "primary")
|
|
85
|
+
return a("hover:text-copy-light-hover", {
|
|
86
|
+
"hover:bg-action-dark-hover": t === "dark",
|
|
87
|
+
"hover:bg-action-light-hover": t === "light",
|
|
88
|
+
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": t === "system",
|
|
89
|
+
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": t === "alt-system"
|
|
90
|
+
});
|
|
91
|
+
if (r === "secondary")
|
|
92
|
+
return a("hover:text-copy-light-hover", {
|
|
93
|
+
"hover:bg-action-dark-hover": t === "light",
|
|
94
|
+
"hover:bg-action-light-hover": t === "dark",
|
|
95
|
+
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": t === "alt-system",
|
|
96
|
+
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": t === "system"
|
|
97
|
+
});
|
|
98
|
+
if (r === "danger")
|
|
99
|
+
return a("hover:text-copy-light-hover", {
|
|
100
|
+
"hover:bg-action-danger-dark-hover": t === "dark",
|
|
101
|
+
"hover:bg-action-danger-light-hover": t === "light",
|
|
102
|
+
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": t === "system",
|
|
103
|
+
"hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": t === "alt-system"
|
|
104
|
+
});
|
|
105
|
+
}, T = ({
|
|
106
|
+
mode: t,
|
|
107
|
+
disabled: e,
|
|
108
|
+
variant: r
|
|
109
|
+
}) => {
|
|
110
|
+
if (e)
|
|
111
|
+
return "";
|
|
112
|
+
if (r === "primary")
|
|
113
|
+
return a("active:text-copy-light-active", {
|
|
114
|
+
"active:bg-action-dark-active": t === "dark",
|
|
115
|
+
"active:bg-action-light-active": t === "light",
|
|
116
|
+
"active:bg-action-dark-active dark:active:bg-action-light-active": t === "system",
|
|
117
|
+
"active:bg-action-light-active dark:active:bg-action-dark-active": t === "alt-system"
|
|
118
|
+
});
|
|
119
|
+
if (r === "secondary")
|
|
120
|
+
return a("active:text-copy-light-active", {
|
|
121
|
+
"active:bg-action-dark-active": t === "light",
|
|
122
|
+
"active:bg-action-light-active": t === "dark",
|
|
123
|
+
"active:bg-action-dark-active dark:active:bg-action-light-active": t === "alt-system",
|
|
124
|
+
"active:bg-action-light-active dark:active:bg-action-dark-active": t === "system"
|
|
125
|
+
});
|
|
126
|
+
if (r === "danger")
|
|
127
|
+
return a("active:text-copy-lighter-active", {
|
|
128
|
+
"active:bg-action-danger-dark-active": t === "dark",
|
|
129
|
+
"active:bg-action-danger-light-active": t === "light",
|
|
130
|
+
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": t === "system",
|
|
131
|
+
"active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": t === "alt-system"
|
|
132
|
+
});
|
|
133
|
+
}, j = ({
|
|
134
|
+
mode: t,
|
|
135
|
+
noBorder: e,
|
|
136
|
+
variant: r
|
|
137
|
+
}) => {
|
|
138
|
+
if (e)
|
|
139
|
+
return "border border-transparent";
|
|
140
|
+
if (r === "primary")
|
|
141
|
+
return a("border", {
|
|
142
|
+
"border-border-dark": t === "dark",
|
|
143
|
+
"border-border-accent": t === "light",
|
|
144
|
+
"border-border-dark dark:border-border-accent": t === "system",
|
|
145
|
+
"border-border-accent dark:border-border-dark": t === "alt-system"
|
|
146
|
+
});
|
|
147
|
+
if (r === "secondary")
|
|
148
|
+
return a("border", {
|
|
149
|
+
"border-border-dark": t === "light",
|
|
150
|
+
"border-border-accent": t === "dark",
|
|
151
|
+
"border-border-dark dark:border-border-accent": t === "alt-system",
|
|
152
|
+
"border-border-accent dark:border-border-dark": t === "system"
|
|
153
|
+
});
|
|
154
|
+
if (r === "danger")
|
|
155
|
+
return a("border", {
|
|
156
|
+
"border-border-danger-dark": t === "dark",
|
|
157
|
+
"border-border-danger-medium": t === "light",
|
|
158
|
+
"border-border-danger-dark dark:border-border-danger-medium": t === "system",
|
|
159
|
+
"border-border-danger-medium dark:border-border-danger-dark": t === "alt-system"
|
|
160
|
+
});
|
|
161
|
+
}, E = ({ focusMode: t }) => a("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
162
|
+
"focus:outline-focus-dark": t === "dark",
|
|
163
|
+
"focus:outline-focus-light": t === "light",
|
|
164
|
+
"focus:outline-focus-light dark:focus:outline-focus-dark": t === "alt-system",
|
|
165
|
+
"focus:outline-focus-dark dark:focus:outline-focus-light": t === "system"
|
|
166
|
+
}), _ = ({
|
|
167
|
+
type: t,
|
|
168
|
+
className: e,
|
|
169
|
+
raw: r,
|
|
170
|
+
mode: i,
|
|
171
|
+
focusMode: n,
|
|
172
|
+
disabled: o,
|
|
173
|
+
fullWidth: g,
|
|
174
|
+
size: d,
|
|
175
|
+
noBorder: l,
|
|
176
|
+
labelRight: h,
|
|
177
|
+
labelLeft: b,
|
|
178
|
+
spacing: u,
|
|
179
|
+
noBackground: k,
|
|
180
|
+
variant: c,
|
|
181
|
+
noTruncate: v,
|
|
182
|
+
align: y
|
|
183
|
+
}) => (c || (c = "primary"), r ? a(s, e) : a(
|
|
184
|
+
s,
|
|
185
|
+
e,
|
|
186
|
+
p(u),
|
|
187
|
+
B({ mode: i, variant: c, noBackground: k, noTruncate: v }),
|
|
188
|
+
C({ type: t, size: d, labelRight: h, labelLeft: b, align: y }),
|
|
189
|
+
j({ mode: i, variant: c, noBorder: l }),
|
|
190
|
+
E({ focusMode: n }),
|
|
191
|
+
w({ mode: i, variant: c, disabled: o }),
|
|
192
|
+
T({ mode: i, variant: c, disabled: o }),
|
|
193
|
+
{
|
|
194
|
+
"w-full": g,
|
|
195
|
+
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
196
|
+
}
|
|
197
|
+
));
|
|
198
|
+
export {
|
|
199
|
+
x as TYPE_BUTTON,
|
|
200
|
+
f as TYPE_ICON,
|
|
201
|
+
m as TYPE_LINK,
|
|
202
|
+
_ as getButtonClasses
|
|
203
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import N from "react";
|
|
3
|
+
import { BaseButton as T } from "../../chunks/BaseButton.D-AA7SPL.js";
|
|
4
|
+
import { getButtonClasses as x, TYPE_BUTTON as C } from "../../chunks/utilities.CSwQTOog.js";
|
|
5
|
+
const R = N.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
children: s,
|
|
8
|
+
disabled: t = !1,
|
|
9
|
+
mode: e = "system",
|
|
10
|
+
focusMode: o = "system",
|
|
11
|
+
fullWidth: m = !1,
|
|
12
|
+
className: r,
|
|
13
|
+
size: a = "medium",
|
|
14
|
+
raw: f = !1,
|
|
15
|
+
noBorder: l = !1,
|
|
16
|
+
spacing: n,
|
|
17
|
+
variant: p = "primary",
|
|
18
|
+
noTruncate: u = !1,
|
|
19
|
+
...i
|
|
20
|
+
}, B) => {
|
|
21
|
+
const y = x({
|
|
22
|
+
type: C,
|
|
23
|
+
mode: e,
|
|
24
|
+
focusMode: o,
|
|
25
|
+
fullWidth: m,
|
|
26
|
+
disabled: t,
|
|
27
|
+
raw: f,
|
|
28
|
+
className: r,
|
|
29
|
+
size: a,
|
|
30
|
+
noBorder: l,
|
|
31
|
+
spacing: n,
|
|
32
|
+
variant: p,
|
|
33
|
+
noTruncate: u
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ c(
|
|
36
|
+
T,
|
|
37
|
+
{
|
|
38
|
+
ref: B,
|
|
39
|
+
className: y,
|
|
40
|
+
disabled: t,
|
|
41
|
+
...i,
|
|
42
|
+
children: s
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
R.displayName = "Button";
|
|
48
|
+
export {
|
|
49
|
+
R as Button
|
|
50
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsxs as g, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import I from "clsx";
|
|
3
|
+
import j from "react";
|
|
4
|
+
import { BaseButton as v } from "../../chunks/BaseButton.D-AA7SPL.js";
|
|
5
|
+
import { getButtonClasses as E, TYPE_ICON as O } from "../../chunks/utilities.CSwQTOog.js";
|
|
6
|
+
const P = j.forwardRef(
|
|
7
|
+
({
|
|
8
|
+
children: r,
|
|
9
|
+
disabled: o = !1,
|
|
10
|
+
mode: t = "system",
|
|
11
|
+
focusMode: n = "system",
|
|
12
|
+
fullWidth: l = !1,
|
|
13
|
+
className: p,
|
|
14
|
+
type: m = "button",
|
|
15
|
+
raw: s = !1,
|
|
16
|
+
noBorder: i = !1,
|
|
17
|
+
"aria-label": y,
|
|
18
|
+
label: f,
|
|
19
|
+
size: x = "medium",
|
|
20
|
+
labelRight: a,
|
|
21
|
+
labelLeft: c,
|
|
22
|
+
spacing: u,
|
|
23
|
+
noBackground: d = !1,
|
|
24
|
+
align: k = "center",
|
|
25
|
+
...N
|
|
26
|
+
}, h) => {
|
|
27
|
+
const B = E({
|
|
28
|
+
type: O,
|
|
29
|
+
mode: t,
|
|
30
|
+
focusMode: n,
|
|
31
|
+
fullWidth: l,
|
|
32
|
+
disabled: o,
|
|
33
|
+
raw: s,
|
|
34
|
+
className: p,
|
|
35
|
+
noBorder: i,
|
|
36
|
+
size: x,
|
|
37
|
+
labelRight: a,
|
|
38
|
+
labelLeft: c,
|
|
39
|
+
spacing: u,
|
|
40
|
+
noBackground: d,
|
|
41
|
+
align: k
|
|
42
|
+
}), C = I({
|
|
43
|
+
"text-copy-accent-dark": t === "light" && !s,
|
|
44
|
+
"text-copy-light": t === "dark" && !s,
|
|
45
|
+
"text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !s,
|
|
46
|
+
"text-copy-light dark:text-copy-accent-dark": t === "system" && !s
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ g(
|
|
49
|
+
v,
|
|
50
|
+
{
|
|
51
|
+
ref: h,
|
|
52
|
+
className: B,
|
|
53
|
+
disabled: o,
|
|
54
|
+
type: m,
|
|
55
|
+
"aria-label": y || f,
|
|
56
|
+
...N,
|
|
57
|
+
children: [
|
|
58
|
+
c && /* @__PURE__ */ e("span", { className: "pr-2", children: c }),
|
|
59
|
+
/* @__PURE__ */ e("div", { className: C, children: r }),
|
|
60
|
+
a && /* @__PURE__ */ e("span", { className: "pl-2", children: a })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
P.displayName = "ButtonIcon";
|
|
67
|
+
export {
|
|
68
|
+
P as ButtonIcon
|
|
69
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import b from "clsx";
|
|
3
|
+
import v from "react";
|
|
4
|
+
import { getButtonClasses as V, TYPE_LINK as C } from "../../chunks/utilities.CSwQTOog.js";
|
|
5
|
+
const L = v.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
children: r,
|
|
8
|
+
mode: o = "system",
|
|
9
|
+
focusMode: c = "system",
|
|
10
|
+
fullWidth: n = !1,
|
|
11
|
+
className: i,
|
|
12
|
+
size: m = "small",
|
|
13
|
+
raw: d = !1,
|
|
14
|
+
noBorder: f = !1,
|
|
15
|
+
target: t,
|
|
16
|
+
noTruncate: l = !1,
|
|
17
|
+
noNewWindowIcon: p = !1,
|
|
18
|
+
spacing: h,
|
|
19
|
+
...w
|
|
20
|
+
}, x) => {
|
|
21
|
+
const u = V({
|
|
22
|
+
type: C,
|
|
23
|
+
mode: o,
|
|
24
|
+
focusMode: c,
|
|
25
|
+
fullWidth: n,
|
|
26
|
+
disabled: !1,
|
|
27
|
+
raw: d,
|
|
28
|
+
className: i,
|
|
29
|
+
size: m,
|
|
30
|
+
noBorder: f,
|
|
31
|
+
spacing: h,
|
|
32
|
+
noTruncate: l
|
|
33
|
+
}), s = t === "_blank", y = {
|
|
34
|
+
target: t,
|
|
35
|
+
rel: s ? "noopener noreferrer" : void 0,
|
|
36
|
+
...w
|
|
37
|
+
}, N = b({
|
|
38
|
+
truncate: !l,
|
|
39
|
+
"basis-11/12": !l && s
|
|
40
|
+
});
|
|
41
|
+
return /* @__PURE__ */ e("a", { ref: x, className: u, ...y, children: /* @__PURE__ */ a("div", { role: "text", className: "flex items-center justify-center", children: [
|
|
42
|
+
/* @__PURE__ */ a("div", { className: N, children: [
|
|
43
|
+
r,
|
|
44
|
+
s && /* @__PURE__ */ e("span", { className: "sr-only", children: ", opens in a new window" })
|
|
45
|
+
] }),
|
|
46
|
+
s && !p && /* @__PURE__ */ a(
|
|
47
|
+
"svg",
|
|
48
|
+
{
|
|
49
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
50
|
+
viewBox: "0 0 448 512",
|
|
51
|
+
className: "ml-1 size-4 basis-4",
|
|
52
|
+
fill: "currentColor",
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ e(
|
|
56
|
+
"path",
|
|
57
|
+
{
|
|
58
|
+
opacity: ".4",
|
|
59
|
+
d: "M384 32c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96C0 60.7 28.7 32 64 32H384zM160 144c-13.3 0-24 10.7-24 24s10.7 24 24 24h94.1L119 327c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135V328c0 13.3 10.7 24 24 24s24-10.7 24-24V168c0-13.3-10.7-24-24-24H160z"
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ e("path", { d: "M312 144H160c-13.3 0-24 10.7-24 24s10.7 24 24 24h94.1L119 327c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135V328c0 13.3 10.7 24 24 24s24-10.7 24-24V168c0-13.3-10.7-24-24-24z" })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] }) });
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
L.displayName = "ButtonLink";
|
|
70
|
+
export {
|
|
71
|
+
L as ButtonLink
|
|
72
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as _versini_ui_private_dist_utilities from '@versini/ui-private/dist/utilities';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
declare const Button: React.ForwardRefExoticComponent<{
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
noTruncate?: boolean;
|
|
8
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
variant?: "primary" | "secondary" | "danger";
|
|
10
|
+
} & {
|
|
11
|
+
className?: string;
|
|
12
|
+
focusMode?: "dark" | "light" | "system" | "alt-system";
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
mode?: "dark" | "light" | "system" | "alt-system";
|
|
15
|
+
noBorder?: boolean;
|
|
16
|
+
noInternalClick?: boolean;
|
|
17
|
+
raw?: boolean;
|
|
18
|
+
size?: "small" | "medium" | "large";
|
|
19
|
+
} & _versini_ui_private_dist_utilities.SpacingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
|
|
21
|
+
declare const ButtonIcon: React.ForwardRefExoticComponent<{
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
align?: "left" | "right" | "center";
|
|
24
|
+
label?: string;
|
|
25
|
+
labelLeft?: string;
|
|
26
|
+
labelRight?: string;
|
|
27
|
+
noBackground?: boolean;
|
|
28
|
+
} & {
|
|
29
|
+
className?: string;
|
|
30
|
+
focusMode?: "dark" | "light" | "system" | "alt-system";
|
|
31
|
+
fullWidth?: boolean;
|
|
32
|
+
mode?: "dark" | "light" | "system" | "alt-system";
|
|
33
|
+
noBorder?: boolean;
|
|
34
|
+
noInternalClick?: boolean;
|
|
35
|
+
raw?: boolean;
|
|
36
|
+
size?: "small" | "medium" | "large";
|
|
37
|
+
} & _versini_ui_private_dist_utilities.SpacingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
|
|
39
|
+
declare const ButtonLink: React.ForwardRefExoticComponent<{
|
|
40
|
+
noNewWindowIcon?: boolean;
|
|
41
|
+
} & {
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
noTruncate?: boolean;
|
|
45
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
46
|
+
variant?: "primary" | "secondary" | "danger";
|
|
47
|
+
} & {
|
|
48
|
+
className?: string;
|
|
49
|
+
focusMode?: "dark" | "light" | "system" | "alt-system";
|
|
50
|
+
fullWidth?: boolean;
|
|
51
|
+
mode?: "dark" | "light" | "system" | "alt-system";
|
|
52
|
+
noBorder?: boolean;
|
|
53
|
+
noInternalClick?: boolean;
|
|
54
|
+
raw?: boolean;
|
|
55
|
+
size?: "small" | "medium" | "large";
|
|
56
|
+
} & _versini_ui_private_dist_utilities.SpacingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLAnchorElement>>;
|
|
57
|
+
|
|
58
|
+
declare const ButtonSort: React.ForwardRefExoticComponent<{
|
|
59
|
+
active?: boolean;
|
|
60
|
+
} & {
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
align?: "left" | "right" | "center";
|
|
63
|
+
label?: string;
|
|
64
|
+
labelLeft?: string;
|
|
65
|
+
labelRight?: string;
|
|
66
|
+
noBackground?: boolean;
|
|
67
|
+
} & {
|
|
68
|
+
className?: string;
|
|
69
|
+
focusMode?: "dark" | "light" | "system" | "alt-system";
|
|
70
|
+
fullWidth?: boolean;
|
|
71
|
+
mode?: "dark" | "light" | "system" | "alt-system";
|
|
72
|
+
noBorder?: boolean;
|
|
73
|
+
noInternalClick?: boolean;
|
|
74
|
+
raw?: boolean;
|
|
75
|
+
size?: "small" | "medium" | "large";
|
|
76
|
+
} & _versini_ui_private_dist_utilities.SpacingProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
77
|
+
|
|
78
|
+
export { Button, ButtonIcon, ButtonLink, ButtonSort as ButtonSort_private };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Button as D } from "./components/Button/Button.js";
|
|
2
|
+
import { ButtonIcon as q } from "./components/Button/ButtonIcon.js";
|
|
3
|
+
import { ButtonLink as A } from "./components/Button/ButtonLink.js";
|
|
4
|
+
import { jsx as e, jsxs as T } from "react/jsx-runtime";
|
|
5
|
+
import n from "clsx";
|
|
6
|
+
import v from "react";
|
|
7
|
+
import { getButtonClasses as C, TYPE_ICON as S } from "./chunks/utilities.CSwQTOog.js";
|
|
8
|
+
import { BaseButton as E } from "./chunks/BaseButton.D-AA7SPL.js";
|
|
9
|
+
/*!
|
|
10
|
+
@versini/ui-button v0.0.0
|
|
11
|
+
© 2024 gizmette.com
|
|
12
|
+
*/
|
|
13
|
+
try {
|
|
14
|
+
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
15
|
+
version: "0.0.0",
|
|
16
|
+
buildTime: "09/15/2024 06:55 PM EDT",
|
|
17
|
+
homepage: "https://github.com/aversini/ui-components",
|
|
18
|
+
license: "MIT"
|
|
19
|
+
});
|
|
20
|
+
} catch {
|
|
21
|
+
}
|
|
22
|
+
const U = v.forwardRef(
|
|
23
|
+
({
|
|
24
|
+
children: o,
|
|
25
|
+
disabled: i = !1,
|
|
26
|
+
mode: t = "system",
|
|
27
|
+
focusMode: c = "system",
|
|
28
|
+
fullWidth: l = !1,
|
|
29
|
+
className: f,
|
|
30
|
+
type: p = "button",
|
|
31
|
+
raw: r = !1,
|
|
32
|
+
noBorder: m = !1,
|
|
33
|
+
"aria-label": d,
|
|
34
|
+
label: b,
|
|
35
|
+
size: u = "medium",
|
|
36
|
+
labelRight: a,
|
|
37
|
+
labelLeft: s,
|
|
38
|
+
spacing: h,
|
|
39
|
+
noBackground: y = !1,
|
|
40
|
+
align: x = "center",
|
|
41
|
+
active: _ = !1,
|
|
42
|
+
...k
|
|
43
|
+
}, B) => {
|
|
44
|
+
const N = C({
|
|
45
|
+
type: S,
|
|
46
|
+
mode: t,
|
|
47
|
+
focusMode: c,
|
|
48
|
+
fullWidth: l,
|
|
49
|
+
disabled: i,
|
|
50
|
+
raw: r,
|
|
51
|
+
className: f,
|
|
52
|
+
noBorder: m,
|
|
53
|
+
size: u,
|
|
54
|
+
labelRight: a,
|
|
55
|
+
labelLeft: s,
|
|
56
|
+
spacing: h,
|
|
57
|
+
noBackground: y,
|
|
58
|
+
align: x
|
|
59
|
+
}), g = n({
|
|
60
|
+
"text-copy-accent-dark": t === "light" && !r,
|
|
61
|
+
"text-copy-light": t === "dark" && !r,
|
|
62
|
+
"text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !r,
|
|
63
|
+
"text-copy-light dark:text-copy-accent-dark": t === "system" && !r
|
|
64
|
+
}), I = _ ? n(
|
|
65
|
+
"relative",
|
|
66
|
+
"focus-within:static",
|
|
67
|
+
"focus-within:after:border-transparent",
|
|
68
|
+
"after:absolute",
|
|
69
|
+
"after:content-['']",
|
|
70
|
+
"after:border-b-2",
|
|
71
|
+
"after:bottom-[-4px]",
|
|
72
|
+
"after:left-0",
|
|
73
|
+
"after:right-0",
|
|
74
|
+
{
|
|
75
|
+
"after:border-table-dark": t === "dark",
|
|
76
|
+
"after:border-table-light": t === "light",
|
|
77
|
+
"after:border-table-dark dark:after:border-table-light": t === "system",
|
|
78
|
+
"after:border-table-light dark:after:border-table-dark": t === "alt-system"
|
|
79
|
+
}
|
|
80
|
+
) : "";
|
|
81
|
+
return /* @__PURE__ */ e("div", { className: I, children: /* @__PURE__ */ T(
|
|
82
|
+
E,
|
|
83
|
+
{
|
|
84
|
+
ref: B,
|
|
85
|
+
className: N,
|
|
86
|
+
disabled: i,
|
|
87
|
+
type: p,
|
|
88
|
+
"aria-label": d || b,
|
|
89
|
+
...k,
|
|
90
|
+
children: [
|
|
91
|
+
s && /* @__PURE__ */ e("span", { className: "pr-2", children: s }),
|
|
92
|
+
/* @__PURE__ */ e("div", { className: g, children: o }),
|
|
93
|
+
a && /* @__PURE__ */ e("span", { className: "pl-2", children: a })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
) });
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
U.displayName = "ButtonSort";
|
|
100
|
+
export {
|
|
101
|
+
D as Button,
|
|
102
|
+
q as ButtonIcon,
|
|
103
|
+
A as ButtonLink,
|
|
104
|
+
U as ButtonSort_private
|
|
105
|
+
};
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-ms-input-placeholder,textarea::-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::-ms-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }@keyframes blink{50%{fill:transparent}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fixed{position:fixed}.relative{position:relative}.m-0{margin:0}.m-1{margin:.25rem}.m-10{margin:2.5rem}.m-11{margin:2.75rem}.m-12{margin:3rem}.m-14{margin:3.5rem}.m-16{margin:4rem}.m-2{margin:.5rem}.m-20{margin:5rem}.m-24{margin:6rem}.m-28{margin:7rem}.m-3{margin:.75rem}.m-32{margin:8rem}.m-36{margin:9rem}.m-4{margin:1rem}.m-44{margin:11rem}.m-48{margin:12rem}.m-5{margin:1.25rem}.m-52{margin:13rem}.m-56{margin:14rem}.m-6{margin:1.5rem}.m-60{margin:15rem}.m-64{margin:16rem}.m-7{margin:1.75rem}.m-72{margin:18rem}.m-8{margin:2rem}.m-80{margin:20rem}.m-9{margin:2.25rem}.m-96{margin:24rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-11{margin-bottom:2.75rem}.mb-12{margin-bottom:3rem}.mb-14{margin-bottom:3.5rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-28{margin-bottom:7rem}.mb-3{margin-bottom:.75rem}.mb-32{margin-bottom:8rem}.mb-36{margin-bottom:9rem}.mb-4{margin-bottom:1rem}.mb-44{margin-bottom:11rem}.mb-48{margin-bottom:12rem}.mb-5{margin-bottom:1.25rem}.mb-52{margin-bottom:13rem}.mb-56{margin-bottom:14rem}.mb-6{margin-bottom:1.5rem}.mb-60{margin-bottom:15rem}.mb-64{margin-bottom:16rem}.mb-7{margin-bottom:1.75rem}.mb-72{margin-bottom:18rem}.mb-8{margin-bottom:2rem}.mb-80{margin-bottom:20rem}.mb-9{margin-bottom:2.25rem}.mb-96{margin-bottom:24rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-10{margin-left:2.5rem}.ml-11{margin-left:2.75rem}.ml-12{margin-left:3rem}.ml-14{margin-left:3.5rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.ml-24{margin-left:6rem}.ml-28{margin-left:7rem}.ml-3{margin-left:.75rem}.ml-32{margin-left:8rem}.ml-36{margin-left:9rem}.ml-4{margin-left:1rem}.ml-44{margin-left:11rem}.ml-48{margin-left:12rem}.ml-5{margin-left:1.25rem}.ml-52{margin-left:13rem}.ml-56{margin-left:14rem}.ml-6{margin-left:1.5rem}.ml-60{margin-left:15rem}.ml-64{margin-left:16rem}.ml-7{margin-left:1.75rem}.ml-72{margin-left:18rem}.ml-8{margin-left:2rem}.ml-80{margin-left:20rem}.ml-9{margin-left:2.25rem}.ml-96{margin-left:24rem}.mr-0{margin-right:0}.mr-1{margin-right:.25rem}.mr-10{margin-right:2.5rem}.mr-11{margin-right:2.75rem}.mr-12{margin-right:3rem}.mr-14{margin-right:3.5rem}.mr-16{margin-right:4rem}.mr-2{margin-right:.5rem}.mr-20{margin-right:5rem}.mr-24{margin-right:6rem}.mr-28{margin-right:7rem}.mr-3{margin-right:.75rem}.mr-32{margin-right:8rem}.mr-36{margin-right:9rem}.mr-4{margin-right:1rem}.mr-44{margin-right:11rem}.mr-48{margin-right:12rem}.mr-5{margin-right:1.25rem}.mr-52{margin-right:13rem}.mr-56{margin-right:14rem}.mr-6{margin-right:1.5rem}.mr-60{margin-right:15rem}.mr-64{margin-right:16rem}.mr-7{margin-right:1.75rem}.mr-72{margin-right:18rem}.mr-8{margin-right:2rem}.mr-80{margin-right:20rem}.mr-9{margin-right:2.25rem}.mr-96{margin-right:24rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-11{margin-top:2.75rem}.mt-12{margin-top:3rem}.mt-14{margin-top:3.5rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-24{margin-top:6rem}.mt-28{margin-top:7rem}.mt-3{margin-top:.75rem}.mt-32{margin-top:8rem}.mt-36{margin-top:9rem}.mt-4{margin-top:1rem}.mt-44{margin-top:11rem}.mt-48{margin-top:12rem}.mt-5{margin-top:1.25rem}.mt-52{margin-top:13rem}.mt-56{margin-top:14rem}.mt-6{margin-top:1.5rem}.mt-60{margin-top:15rem}.mt-64{margin-top:16rem}.mt-7{margin-top:1.75rem}.mt-72{margin-top:18rem}.mt-8{margin-top:2rem}.mt-80{margin-top:20rem}.mt-9{margin-top:2.25rem}.mt-96{margin-top:24rem}.flex{display:flex}.inline-flex{display:inline-flex}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.h-12{height:3rem}.h-6{height:1.5rem}.h-8{height:2rem}.max-h-12{max-height:3rem}.max-h-8{max-height:2rem}.max-h-9{max-height:2.25rem}.w-12{width:3rem}.w-44{width:11rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.basis-11\/12{flex-basis:91.666667%}.basis-4{flex-basis:1rem}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-border-accent{--tw-border-opacity: 1;border-color:var(--av-border-accent, rgb(169 185 173 / var(--tw-border-opacity)))}.border-border-danger-dark{--tw-border-opacity: 1;border-color:var(--av-border-danger-dark, rgb(127 29 29 / var(--tw-border-opacity)))}.border-border-danger-medium{--tw-border-opacity: 1;border-color:var(--av-border-danger-medium, rgb(248 113 113 / var(--tw-border-opacity)))}.border-border-dark{--tw-border-opacity: 1;border-color:var(--av-border-dark, rgb(15 23 42 / var(--tw-border-opacity)))}.border-table-dark{--tw-border-opacity: 1;border-color:var(--av-table-dark, rgb(55 65 81 / var(--tw-border-opacity)))}.border-table-light{--tw-border-opacity: 1;border-color:var(--av-table-light, rgb(243 244 246 / var(--tw-border-opacity)))}.border-transparent{border-color:transparent}.bg-action-danger-dark{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark, rgb(127 29 29 / var(--tw-bg-opacity)))}.bg-action-danger-dark-active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-active, rgb(220 38 38 / var(--tw-bg-opacity)))}.bg-action-danger-dark-hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.bg-action-danger-light{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light, rgb(220 38 38 / var(--tw-bg-opacity)))}.bg-action-danger-light-active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-active, rgb(153 27 27 / var(--tw-bg-opacity)))}.bg-action-danger-light-hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.bg-action-dark{--tw-bg-opacity: 1;background-color:var(--av-action-dark, rgb(15 23 42 / var(--tw-bg-opacity)))}.bg-action-dark-active{--tw-bg-opacity: 1;background-color:var(--av-action-dark-active, rgb(71 85 105 / var(--tw-bg-opacity)))}.bg-action-dark-hover{--tw-bg-opacity: 1;background-color:var(--av-action-dark-hover, rgb(51 65 85 / var(--tw-bg-opacity)))}.bg-action-light{--tw-bg-opacity: 1;background-color:var(--av-action-light, rgb(100 116 139 / var(--tw-bg-opacity)))}.bg-action-light-active{--tw-bg-opacity: 1;background-color:var(--av-action-light-active, rgb(51 65 85 / var(--tw-bg-opacity)))}.bg-action-light-hover{--tw-bg-opacity: 1;background-color:var(--av-action-light-hover, rgb(71 85 105 / var(--tw-bg-opacity)))}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.text-copy-accent-dark{--tw-text-opacity: 1;color:var(--av-copy-accent-dark, rgb(205 232 212 / var(--tw-text-opacity)))}.text-copy-light{--tw-text-opacity: 1;color:var(--av-copy-light, rgb(226 232 240 / var(--tw-text-opacity)))}.text-copy-lighter{--tw-text-opacity: 1;color:var(--av-copy-lighter, rgb(255 255 255 / var(--tw-text-opacity)))}.opacity-50{opacity:.5}.outline-focus-dark{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.outline-focus-light{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bottom-\[-4px\]:after{content:var(--tw-content);bottom:-4px}.after\:left-0:after{content:var(--tw-content);left:0}.after\:right-0:after{content:var(--tw-content);right:0}.after\:border-b-2:after{content:var(--tw-content);border-bottom-width:2px}.after\:border-table-dark:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:var(--av-table-dark, rgb(55 65 81 / var(--tw-border-opacity)))}.after\:border-table-light:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:var(--av-table-light, rgb(243 244 246 / var(--tw-border-opacity)))}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.focus-within\:static:focus-within{position:static}.focus-within\:after\:border-transparent:focus-within:after{content:var(--tw-content);border-color:transparent}.hover\:bg-action-danger-dark-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.hover\:bg-action-danger-light-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.hover\:bg-action-dark-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-dark-hover, rgb(51 65 85 / var(--tw-bg-opacity)))}.hover\:bg-action-light-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-light-hover, rgb(71 85 105 / var(--tw-bg-opacity)))}.hover\:text-copy-light-hover:hover{--tw-text-opacity: 1;color:var(--av-copy-light-hover, rgb(226 232 240 / var(--tw-text-opacity)))}.focus\:outline:focus{outline-style:solid}.focus\:outline-2:focus{outline-width:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:outline-focus-dark:focus{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.focus\:outline-focus-light:focus{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.active\:bg-action-danger-dark-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-active, rgb(220 38 38 / var(--tw-bg-opacity)))}.active\:bg-action-danger-light-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-active, rgb(153 27 27 / var(--tw-bg-opacity)))}.active\:bg-action-dark-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-dark-active, rgb(71 85 105 / var(--tw-bg-opacity)))}.active\:bg-action-light-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-light-active, rgb(51 65 85 / var(--tw-bg-opacity)))}.active\:text-copy-light-active:active{--tw-text-opacity: 1;color:var(--av-copy-light-active, rgb(148 163 184 / var(--tw-text-opacity)))}.active\:text-copy-lighter-active:active{--tw-text-opacity: 1;color:var(--av-copy-lighter-active, rgb(255 255 255 / var(--tw-text-opacity)))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (prefers-color-scheme: dark){.dark\:border-border-accent{--tw-border-opacity: 1;border-color:var(--av-border-accent, rgb(169 185 173 / var(--tw-border-opacity)))}.dark\:border-border-danger-dark{--tw-border-opacity: 1;border-color:var(--av-border-danger-dark, rgb(127 29 29 / var(--tw-border-opacity)))}.dark\:border-border-danger-medium{--tw-border-opacity: 1;border-color:var(--av-border-danger-medium, rgb(248 113 113 / var(--tw-border-opacity)))}.dark\:border-border-dark{--tw-border-opacity: 1;border-color:var(--av-border-dark, rgb(15 23 42 / var(--tw-border-opacity)))}.dark\:bg-action-danger-dark{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark, rgb(127 29 29 / var(--tw-bg-opacity)))}.dark\:bg-action-danger-light{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light, rgb(220 38 38 / var(--tw-bg-opacity)))}.dark\:bg-action-dark{--tw-bg-opacity: 1;background-color:var(--av-action-dark, rgb(15 23 42 / var(--tw-bg-opacity)))}.dark\:bg-action-light{--tw-bg-opacity: 1;background-color:var(--av-action-light, rgb(100 116 139 / var(--tw-bg-opacity)))}.dark\:text-copy-accent-dark{--tw-text-opacity: 1;color:var(--av-copy-accent-dark, rgb(205 232 212 / var(--tw-text-opacity)))}.dark\:text-copy-light{--tw-text-opacity: 1;color:var(--av-copy-light, rgb(226 232 240 / var(--tw-text-opacity)))}.dark\:text-copy-lighter{--tw-text-opacity: 1;color:var(--av-copy-lighter, rgb(255 255 255 / var(--tw-text-opacity)))}.dark\:after\:border-table-dark:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:var(--av-table-dark, rgb(55 65 81 / var(--tw-border-opacity)))}.dark\:after\:border-table-light:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:var(--av-table-light, rgb(243 244 246 / var(--tw-border-opacity)))}.dark\:hover\:bg-action-danger-dark-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.dark\:hover\:bg-action-danger-light-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.dark\:hover\:bg-action-dark-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-dark-hover, rgb(51 65 85 / var(--tw-bg-opacity)))}.dark\:hover\:bg-action-light-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-light-hover, rgb(71 85 105 / var(--tw-bg-opacity)))}.dark\:focus\:outline-focus-dark:focus{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.dark\:focus\:outline-focus-light:focus{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.dark\:active\:bg-action-danger-dark-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-active, rgb(220 38 38 / var(--tw-bg-opacity)))}.dark\:active\:bg-action-danger-light-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-active, rgb(153 27 27 / var(--tw-bg-opacity)))}.dark\:active\:bg-action-dark-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-dark-active, rgb(71 85 105 / var(--tw-bg-opacity)))}.dark\:active\:bg-action-light-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-light-active, rgb(51 65 85 / var(--tw-bg-opacity)))}}
|
package/dist/style.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@versini/ui-button",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Arno Versini",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/aversini/ui-components",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git@github.com:aversini/ui-components.git"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"types": "dist/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build:check": "tsc",
|
|
22
|
+
"build:js": "vite build",
|
|
23
|
+
"build:types": "tsup",
|
|
24
|
+
"build": "npm-run-all --serial clean build:check build:js build:types",
|
|
25
|
+
"clean": "rimraf dist tmp",
|
|
26
|
+
"dev:js": "vite build --watch --mode development",
|
|
27
|
+
"dev:types": "tsup --watch src",
|
|
28
|
+
"dev": "npm-run-all clean --parallel dev:js dev:types",
|
|
29
|
+
"lint": "biome lint src",
|
|
30
|
+
"start": "static-server dist --port 5173",
|
|
31
|
+
"test:coverage:ui": "vitest --coverage --ui",
|
|
32
|
+
"test:coverage": "vitest run --coverage",
|
|
33
|
+
"test:watch": "vitest",
|
|
34
|
+
"test": "vitest run"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": "^18.3.1",
|
|
38
|
+
"react-dom": "^18.3.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@versini/ui-icons": "1.12.0",
|
|
42
|
+
"@versini/ui-styles": "1.9.6"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@tailwindcss/typography": "0.5.15",
|
|
46
|
+
"@versini/ui-private": "1.4.8",
|
|
47
|
+
"clsx": "2.1.1",
|
|
48
|
+
"tailwindcss": "3.4.11"
|
|
49
|
+
},
|
|
50
|
+
"sideEffects": [
|
|
51
|
+
"**/*.css"
|
|
52
|
+
],
|
|
53
|
+
"gitHead": "651f85739ba644cfa6d208e9779c8ded178f157b"
|
|
54
|
+
}
|