@brosco/ui 0.0.51 → 0.0.53
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/index.css +323 -1
- package/dist/index.js +89 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1,2 +1,324 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties
|
|
2
|
+
@layer properties {
|
|
3
|
+
@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or
|
|
4
|
+
((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
|
|
5
|
+
*,
|
|
6
|
+
:before,
|
|
7
|
+
:after,
|
|
8
|
+
::backdrop {
|
|
9
|
+
--tw-font-weight: initial;
|
|
10
|
+
--tw-scale-x: 1;
|
|
11
|
+
--tw-scale-y: 1;
|
|
12
|
+
--tw-scale-z: 1;
|
|
13
|
+
--tw-border-style: solid;
|
|
14
|
+
--tw-shadow: 0 0 #0000;
|
|
15
|
+
--tw-shadow-color: initial;
|
|
16
|
+
--tw-shadow-alpha: 100%;
|
|
17
|
+
--tw-inset-shadow: 0 0 #0000;
|
|
18
|
+
--tw-inset-shadow-color: initial;
|
|
19
|
+
--tw-inset-shadow-alpha: 100%;
|
|
20
|
+
--tw-ring-color: initial;
|
|
21
|
+
--tw-ring-shadow: 0 0 #0000;
|
|
22
|
+
--tw-inset-ring-color: initial;
|
|
23
|
+
--tw-inset-ring-shadow: 0 0 #0000;
|
|
24
|
+
--tw-ring-inset: initial;
|
|
25
|
+
--tw-ring-offset-width: 0px;
|
|
26
|
+
--tw-ring-offset-color: #fff;
|
|
27
|
+
--tw-ring-offset-shadow: 0 0 #0000;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
@layer theme {
|
|
32
|
+
:root {
|
|
33
|
+
--eclipse: var(--color-zinc-900);
|
|
34
|
+
--background: var(--color-white);
|
|
35
|
+
--foreground: var(--eclipse);
|
|
36
|
+
--muted: var(--color-zinc-500);
|
|
37
|
+
--primary: var(--color-blue-500);
|
|
38
|
+
--secondary: var(--eclipse);
|
|
39
|
+
--success: var(--color-green-600);
|
|
40
|
+
--danger: var(--color-red-500);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
@layer components {
|
|
44
|
+
.button {
|
|
45
|
+
--color: transparent;
|
|
46
|
+
--bg: transparent;
|
|
47
|
+
--bg-hover: var(--bg);
|
|
48
|
+
--bg-active: var(--bg-hover);
|
|
49
|
+
--fg: currentColor;
|
|
50
|
+
}
|
|
51
|
+
.button--primary {
|
|
52
|
+
--color: var(--primary);
|
|
53
|
+
}
|
|
54
|
+
.button--secondary {
|
|
55
|
+
--color: var(--secondary);
|
|
56
|
+
}
|
|
57
|
+
.button--success {
|
|
58
|
+
--color: var(--success);
|
|
59
|
+
}
|
|
60
|
+
.button--danger {
|
|
61
|
+
--color: var(--danger);
|
|
62
|
+
}
|
|
63
|
+
.button--solid {
|
|
64
|
+
--bg: var(--color);
|
|
65
|
+
--bg-hover: var(--bg);
|
|
66
|
+
}
|
|
67
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
68
|
+
.button--solid {
|
|
69
|
+
--bg-hover: color-mix(in oklab, var(--bg) 90%, var(--eclipse) 10%);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.button--solid {
|
|
73
|
+
--bg-active: var(--bg);
|
|
74
|
+
}
|
|
75
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
76
|
+
.button--solid {
|
|
77
|
+
--bg-active: color-mix(in oklab, var(--bg) 80%, var(--eclipse) 20%);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
.button--solid {
|
|
81
|
+
--fg: var(--color-white);
|
|
82
|
+
}
|
|
83
|
+
.button--solid.button--secondary {
|
|
84
|
+
--bg: var(--color);
|
|
85
|
+
}
|
|
86
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
87
|
+
.button--solid.button--secondary {
|
|
88
|
+
--bg: color-mix(in oklab, var(--color) 5%, transparent);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
.button--solid.button--secondary {
|
|
92
|
+
--bg-hover: var(--bg);
|
|
93
|
+
}
|
|
94
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
95
|
+
.button--solid.button--secondary {
|
|
96
|
+
--bg-hover: color-mix(in oklab, var(--bg) 95%, var(--eclipse) 5%);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
.button--solid.button--secondary {
|
|
100
|
+
--bg-active: var(--bg);
|
|
101
|
+
}
|
|
102
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
103
|
+
.button--solid.button--secondary {
|
|
104
|
+
--bg-active: color-mix(in oklab, var(--bg) 90%, var(--eclipse) 10%);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.button--solid.button--secondary {
|
|
108
|
+
--fg: var(--color);
|
|
109
|
+
}
|
|
110
|
+
.button--bordered,
|
|
111
|
+
.button--light {
|
|
112
|
+
--fg: var(--color);
|
|
113
|
+
--bg-hover: var(--fg);
|
|
114
|
+
}
|
|
115
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
116
|
+
.button--bordered,
|
|
117
|
+
.button--light {
|
|
118
|
+
--bg-hover: color-mix(in oklab, var(--fg) 5%, transparent);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.button {
|
|
122
|
+
justify-content: center;
|
|
123
|
+
align-items: center;
|
|
124
|
+
gap: calc(var(--spacing, 0.25rem) * 2);
|
|
125
|
+
--tw-font-weight: var(--font-weight-medium, 500);
|
|
126
|
+
font-weight: var(--font-weight-medium, 500);
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
color: var(--fg);
|
|
129
|
+
transition-property:
|
|
130
|
+
color,
|
|
131
|
+
background-color,
|
|
132
|
+
border-color,
|
|
133
|
+
outline-color,
|
|
134
|
+
text-decoration-color,
|
|
135
|
+
fill,
|
|
136
|
+
stroke,
|
|
137
|
+
--tw-gradient-from,
|
|
138
|
+
--tw-gradient-via,
|
|
139
|
+
--tw-gradient-to,
|
|
140
|
+
opacity,
|
|
141
|
+
box-shadow,
|
|
142
|
+
transform,
|
|
143
|
+
translate,
|
|
144
|
+
scale,
|
|
145
|
+
rotate,
|
|
146
|
+
filter,
|
|
147
|
+
-webkit-backdrop-filter,
|
|
148
|
+
backdrop-filter,
|
|
149
|
+
display,
|
|
150
|
+
content-visibility,
|
|
151
|
+
overlay,
|
|
152
|
+
pointer-events;
|
|
153
|
+
transition-timing-function: var(
|
|
154
|
+
--tw-ease,
|
|
155
|
+
var(--default-transition-timing-function, cubic-bezier(0.4, 0, 0.2, 1))
|
|
156
|
+
);
|
|
157
|
+
transition-duration: var(
|
|
158
|
+
--tw-duration,
|
|
159
|
+
var(--default-transition-duration, 0.15s)
|
|
160
|
+
);
|
|
161
|
+
-webkit-user-select: none;
|
|
162
|
+
user-select: none;
|
|
163
|
+
display: inline-flex;
|
|
164
|
+
}
|
|
165
|
+
.button:focus-visible {
|
|
166
|
+
--tw-outline-style: none;
|
|
167
|
+
outline-style: none;
|
|
168
|
+
}
|
|
169
|
+
.button:enabled {
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
}
|
|
172
|
+
.button:disabled {
|
|
173
|
+
pointer-events: none;
|
|
174
|
+
opacity: 0.5;
|
|
175
|
+
}
|
|
176
|
+
.button:hover {
|
|
177
|
+
background-color: var(--bg-hover);
|
|
178
|
+
}
|
|
179
|
+
.button:active {
|
|
180
|
+
--tw-scale-x: 95%;
|
|
181
|
+
--tw-scale-y: 95%;
|
|
182
|
+
--tw-scale-z: 95%;
|
|
183
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
184
|
+
background-color: var(--bg-active);
|
|
185
|
+
}
|
|
186
|
+
.button[data-pending="true"] {
|
|
187
|
+
pointer-events: none;
|
|
188
|
+
}
|
|
189
|
+
.button--solid {
|
|
190
|
+
background-color: var(--bg);
|
|
191
|
+
}
|
|
192
|
+
.button--bordered {
|
|
193
|
+
border-style: var(--tw-border-style);
|
|
194
|
+
border-width: 2px;
|
|
195
|
+
border-color: var(--fg);
|
|
196
|
+
}
|
|
197
|
+
.button--bordered:focus-visible:not([data-pending]) {
|
|
198
|
+
--tw-ring-color: currentcolor;
|
|
199
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0
|
|
200
|
+
calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
201
|
+
box-shadow:
|
|
202
|
+
var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
|
|
203
|
+
var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
204
|
+
--tw-ring-offset-width: 2px;
|
|
205
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0
|
|
206
|
+
var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
207
|
+
}
|
|
208
|
+
.button--light {
|
|
209
|
+
text-underline-offset: 6px;
|
|
210
|
+
text-decoration-line: underline;
|
|
211
|
+
position: relative;
|
|
212
|
+
}
|
|
213
|
+
@media (hover: hover) {
|
|
214
|
+
.button--light:hover {
|
|
215
|
+
text-decoration-line: none;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
.button--light:focus-visible:not([data-pending]):after {
|
|
219
|
+
top: calc(var(--spacing, 0.25rem) * 2);
|
|
220
|
+
right: calc(var(--spacing, 0.25rem) * 3);
|
|
221
|
+
left: calc(var(--spacing, 0.25rem) * 3);
|
|
222
|
+
height: calc(var(--spacing, 0.25rem) * 0.5);
|
|
223
|
+
content: "";
|
|
224
|
+
background-color: currentColor;
|
|
225
|
+
position: absolute;
|
|
226
|
+
}
|
|
227
|
+
.spinner {
|
|
228
|
+
animation: var(--animate-spin, spin 1s linear infinite);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
@property --tw-font-weight {
|
|
232
|
+
syntax: "*";
|
|
233
|
+
inherits: false;
|
|
234
|
+
}
|
|
235
|
+
@property --tw-scale-x {
|
|
236
|
+
syntax: "*";
|
|
237
|
+
inherits: false;
|
|
238
|
+
initial-value: 1;
|
|
239
|
+
}
|
|
240
|
+
@property --tw-scale-y {
|
|
241
|
+
syntax: "*";
|
|
242
|
+
inherits: false;
|
|
243
|
+
initial-value: 1;
|
|
244
|
+
}
|
|
245
|
+
@property --tw-scale-z {
|
|
246
|
+
syntax: "*";
|
|
247
|
+
inherits: false;
|
|
248
|
+
initial-value: 1;
|
|
249
|
+
}
|
|
250
|
+
@property --tw-border-style {
|
|
251
|
+
syntax: "*";
|
|
252
|
+
inherits: false;
|
|
253
|
+
initial-value: solid;
|
|
254
|
+
}
|
|
255
|
+
@property --tw-shadow {
|
|
256
|
+
syntax: "*";
|
|
257
|
+
inherits: false;
|
|
258
|
+
initial-value: 0 0 #0000;
|
|
259
|
+
}
|
|
260
|
+
@property --tw-shadow-color {
|
|
261
|
+
syntax: "*";
|
|
262
|
+
inherits: false;
|
|
263
|
+
}
|
|
264
|
+
@property --tw-shadow-alpha {
|
|
265
|
+
syntax: "<percentage>";
|
|
266
|
+
inherits: false;
|
|
267
|
+
initial-value: 100%;
|
|
268
|
+
}
|
|
269
|
+
@property --tw-inset-shadow {
|
|
270
|
+
syntax: "*";
|
|
271
|
+
inherits: false;
|
|
272
|
+
initial-value: 0 0 #0000;
|
|
273
|
+
}
|
|
274
|
+
@property --tw-inset-shadow-color {
|
|
275
|
+
syntax: "*";
|
|
276
|
+
inherits: false;
|
|
277
|
+
}
|
|
278
|
+
@property --tw-inset-shadow-alpha {
|
|
279
|
+
syntax: "<percentage>";
|
|
280
|
+
inherits: false;
|
|
281
|
+
initial-value: 100%;
|
|
282
|
+
}
|
|
283
|
+
@property --tw-ring-color {
|
|
284
|
+
syntax: "*";
|
|
285
|
+
inherits: false;
|
|
286
|
+
}
|
|
287
|
+
@property --tw-ring-shadow {
|
|
288
|
+
syntax: "*";
|
|
289
|
+
inherits: false;
|
|
290
|
+
initial-value: 0 0 #0000;
|
|
291
|
+
}
|
|
292
|
+
@property --tw-inset-ring-color {
|
|
293
|
+
syntax: "*";
|
|
294
|
+
inherits: false;
|
|
295
|
+
}
|
|
296
|
+
@property --tw-inset-ring-shadow {
|
|
297
|
+
syntax: "*";
|
|
298
|
+
inherits: false;
|
|
299
|
+
initial-value: 0 0 #0000;
|
|
300
|
+
}
|
|
301
|
+
@property --tw-ring-inset {
|
|
302
|
+
syntax: "*";
|
|
303
|
+
inherits: false;
|
|
304
|
+
}
|
|
305
|
+
@property --tw-ring-offset-width {
|
|
306
|
+
syntax: "<length>";
|
|
307
|
+
inherits: false;
|
|
308
|
+
initial-value: 0;
|
|
309
|
+
}
|
|
310
|
+
@property --tw-ring-offset-color {
|
|
311
|
+
syntax: "*";
|
|
312
|
+
inherits: false;
|
|
313
|
+
initial-value: #fff;
|
|
314
|
+
}
|
|
315
|
+
@property --tw-ring-offset-shadow {
|
|
316
|
+
syntax: "*";
|
|
317
|
+
inherits: false;
|
|
318
|
+
initial-value: 0 0 #0000;
|
|
319
|
+
}
|
|
320
|
+
@keyframes spin {
|
|
321
|
+
to {
|
|
322
|
+
transform: rotate(360deg);
|
|
323
|
+
}
|
|
324
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,89 @@
|
|
|
1
|
-
import{Button as e}from"@base-ui/react";
|
|
1
|
+
import { Button as e } from "@base-ui/react";
|
|
2
|
+
import { cn as t } from "cn";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { tv as i } from "tailwind-variants";
|
|
5
|
+
import './index.css';//#region src/spinner/spinner.tsx
|
|
6
|
+
var a = ({ className: e, size: r = 24 }) => /* @__PURE__ */ n("svg", {
|
|
7
|
+
stroke: "currentColor",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
strokeWidth: "0",
|
|
10
|
+
version: "1.1",
|
|
11
|
+
viewBox: "0 0 16 16",
|
|
12
|
+
height: r,
|
|
13
|
+
width: r,
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
className: t("spinner", e),
|
|
16
|
+
children: /* @__PURE__ */ n("path", { d: "M16 8c-0.020-1.045-0.247-2.086-0.665-3.038-0.417-0.953-1.023-1.817-1.766-2.53s-1.624-1.278-2.578-1.651c-0.953-0.374-1.978-0.552-2.991-0.531-1.013 0.020-2.021 0.24-2.943 0.646-0.923 0.405-1.758 0.992-2.449 1.712s-1.237 1.574-1.597 2.497c-0.361 0.923-0.533 1.914-0.512 2.895 0.020 0.981 0.234 1.955 0.627 2.847 0.392 0.892 0.961 1.7 1.658 2.368s1.523 1.195 2.416 1.543c0.892 0.348 1.851 0.514 2.799 0.493 0.949-0.020 1.89-0.227 2.751-0.608 0.862-0.379 1.642-0.929 2.287-1.604s1.154-1.472 1.488-2.335c0.204-0.523 0.342-1.069 0.415-1.622 0.019 0.001 0.039 0.002 0.059 0.002 0.552 0 1-0.448 1-1 0-0.028-0.001-0.056-0.004-0.083h0.004zM14.411 10.655c-0.367 0.831-0.898 1.584-1.55 2.206s-1.422 1.112-2.254 1.434c-0.832 0.323-1.723 0.476-2.608 0.454-0.884-0.020-1.759-0.215-2.56-0.57-0.801-0.354-1.526-0.867-2.125-1.495s-1.071-1.371-1.38-2.173c-0.31-0.801-0.457-1.66-0.435-2.512s0.208-1.694 0.551-2.464c0.342-0.77 0.836-1.468 1.441-2.044s1.321-1.029 2.092-1.326c0.771-0.298 1.596-0.438 2.416-0.416s1.629 0.202 2.368 0.532c0.74 0.329 1.41 0.805 1.963 1.387s0.988 1.27 1.272 2.011c0.285 0.74 0.418 1.532 0.397 2.32h0.004c-0.002 0.027-0.004 0.055-0.004 0.083 0 0.516 0.39 0.94 0.892 0.994-0.097 0.544-0.258 1.075-0.481 1.578z" })
|
|
17
|
+
}), o = i({
|
|
18
|
+
base: "button",
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
solid: "button--solid",
|
|
22
|
+
bordered: "button--bordered",
|
|
23
|
+
light: "button--light"
|
|
24
|
+
},
|
|
25
|
+
color: {
|
|
26
|
+
primary: "button--primary",
|
|
27
|
+
secondary: "button--secondary",
|
|
28
|
+
success: "button--success",
|
|
29
|
+
danger: "button--danger"
|
|
30
|
+
},
|
|
31
|
+
rounded: {
|
|
32
|
+
full: "rounded-full",
|
|
33
|
+
lg: "rounded-lg",
|
|
34
|
+
md: "rounded-md",
|
|
35
|
+
sm: "rounded-sm",
|
|
36
|
+
none: "rounded-none"
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
sm: "h-9 text-sm",
|
|
40
|
+
md: "h-10 text-sm",
|
|
41
|
+
lg: "h-11 text-base"
|
|
42
|
+
},
|
|
43
|
+
isIconOnly: {
|
|
44
|
+
true: "shrink-0",
|
|
45
|
+
false: "px-4"
|
|
46
|
+
},
|
|
47
|
+
fullWidth: { true: "w-full" }
|
|
48
|
+
},
|
|
49
|
+
defaultVariants: {
|
|
50
|
+
variant: "solid",
|
|
51
|
+
color: "primary",
|
|
52
|
+
rounded: "lg",
|
|
53
|
+
size: "md"
|
|
54
|
+
},
|
|
55
|
+
compoundVariants: [
|
|
56
|
+
{
|
|
57
|
+
isIconOnly: !0,
|
|
58
|
+
size: "sm",
|
|
59
|
+
class: "w-9"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
isIconOnly: !0,
|
|
63
|
+
size: "md",
|
|
64
|
+
class: "w-10"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
isIconOnly: !0,
|
|
68
|
+
size: "lg",
|
|
69
|
+
class: "w-11"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}), s = ({ children: i, icon: s, className: c, variant: l, color: u, rounded: d, size: f, isIconOnly: p, fullWidth: m, isPending: h, ...g }) => {
|
|
73
|
+
let _ = t(o({
|
|
74
|
+
variant: l,
|
|
75
|
+
color: u,
|
|
76
|
+
rounded: d,
|
|
77
|
+
size: f,
|
|
78
|
+
isIconOnly: p,
|
|
79
|
+
fullWidth: m
|
|
80
|
+
}), c);
|
|
81
|
+
return /* @__PURE__ */ r(e, {
|
|
82
|
+
className: _,
|
|
83
|
+
"data-pending": h,
|
|
84
|
+
...g,
|
|
85
|
+
children: [h ? /* @__PURE__ */ n(a, {}) : s, !p && /* @__PURE__ */ n("span", { children: i })]
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { s as Button, a as Spinner };
|