@brosco/ui 0.0.80 → 0.0.81
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 +451 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +191 -1
- package/dist/tabs/index.d.ts +1 -0
- package/dist/tabs/tabs.d.ts +7 -0
- package/dist/tabs-navigation /index.d.ts +1 -0
- package/dist/tabs-navigation /tabs-navigation .d.ts +14 -0
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1,2 +1,452 @@
|
|
|
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-shadow: 0 0 #0000;
|
|
14
|
+
--tw-shadow-color: initial;
|
|
15
|
+
--tw-shadow-alpha: 100%;
|
|
16
|
+
--tw-inset-shadow: 0 0 #0000;
|
|
17
|
+
--tw-inset-shadow-color: initial;
|
|
18
|
+
--tw-inset-shadow-alpha: 100%;
|
|
19
|
+
--tw-ring-color: initial;
|
|
20
|
+
--tw-ring-shadow: 0 0 #0000;
|
|
21
|
+
--tw-inset-ring-color: initial;
|
|
22
|
+
--tw-inset-ring-shadow: 0 0 #0000;
|
|
23
|
+
--tw-ring-inset: initial;
|
|
24
|
+
--tw-ring-offset-width: 0px;
|
|
25
|
+
--tw-ring-offset-color: #fff;
|
|
26
|
+
--tw-ring-offset-shadow: 0 0 #0000;
|
|
27
|
+
--tw-border-style: solid;
|
|
28
|
+
--tw-duration: initial;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
@layer theme {
|
|
33
|
+
:root {
|
|
34
|
+
--eclipse: var(--color-zinc-900);
|
|
35
|
+
--background: var(--color-white);
|
|
36
|
+
--foreground: var(--eclipse);
|
|
37
|
+
--muted: var(--color-zinc-500);
|
|
38
|
+
--primary: var(--color-blue-500);
|
|
39
|
+
--secondary: var(--eclipse);
|
|
40
|
+
--success: var(--color-green-600);
|
|
41
|
+
--danger: var(--color-red-500);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
:root,
|
|
45
|
+
:host {
|
|
46
|
+
--color-background: var(--background);
|
|
47
|
+
--color-foreground: var(--foreground);
|
|
48
|
+
--color-muted: var(--muted);
|
|
49
|
+
}
|
|
50
|
+
@layer utilities;
|
|
51
|
+
@layer components {
|
|
52
|
+
.button {
|
|
53
|
+
--color: transparent;
|
|
54
|
+
--bg: transparent;
|
|
55
|
+
--bg-hover: var(--bg);
|
|
56
|
+
--bg-active: var(--bg-hover);
|
|
57
|
+
--fg: currentColor;
|
|
58
|
+
}
|
|
59
|
+
.button--primary {
|
|
60
|
+
--color: var(--primary);
|
|
61
|
+
}
|
|
62
|
+
.button--secondary {
|
|
63
|
+
--color: var(--secondary);
|
|
64
|
+
}
|
|
65
|
+
.button--success {
|
|
66
|
+
--color: var(--success);
|
|
67
|
+
}
|
|
68
|
+
.button--danger {
|
|
69
|
+
--color: var(--danger);
|
|
70
|
+
}
|
|
71
|
+
.button--solid {
|
|
72
|
+
--bg: var(--color);
|
|
73
|
+
--bg-hover: var(--bg);
|
|
74
|
+
}
|
|
75
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
76
|
+
.button--solid {
|
|
77
|
+
--bg-hover: color-mix(in oklab, var(--bg) 90%, var(--eclipse) 10%);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
.button--solid {
|
|
81
|
+
--bg-active: var(--bg);
|
|
82
|
+
}
|
|
83
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
84
|
+
.button--solid {
|
|
85
|
+
--bg-active: color-mix(in oklab, var(--bg) 80%, var(--eclipse) 20%);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
.button--solid {
|
|
89
|
+
--fg: var(--color-white);
|
|
90
|
+
}
|
|
91
|
+
.button--solid.button--secondary {
|
|
92
|
+
--bg: var(--color);
|
|
93
|
+
}
|
|
94
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
95
|
+
.button--solid.button--secondary {
|
|
96
|
+
--bg: color-mix(in oklab, var(--color) 5%, transparent);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
.button--solid.button--secondary {
|
|
100
|
+
--bg-hover: var(--bg);
|
|
101
|
+
}
|
|
102
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
103
|
+
.button--solid.button--secondary {
|
|
104
|
+
--bg-hover: color-mix(in oklab, var(--bg) 95%, var(--eclipse) 5%);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.button--solid.button--secondary {
|
|
108
|
+
--bg-active: var(--bg);
|
|
109
|
+
}
|
|
110
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
111
|
+
.button--solid.button--secondary {
|
|
112
|
+
--bg-active: color-mix(in oklab, var(--bg) 90%, var(--eclipse) 10%);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
.button--solid.button--secondary {
|
|
116
|
+
--fg: var(--color);
|
|
117
|
+
}
|
|
118
|
+
.button--bordered,
|
|
119
|
+
.button--light {
|
|
120
|
+
--fg: var(--color);
|
|
121
|
+
--bg-hover: var(--fg);
|
|
122
|
+
}
|
|
123
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
124
|
+
.button--bordered,
|
|
125
|
+
.button--light {
|
|
126
|
+
--bg-hover: color-mix(in oklab, var(--fg) 5%, transparent);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
.button {
|
|
130
|
+
justify-content: center;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: calc(var(--spacing, 0.25rem) * 2);
|
|
133
|
+
--tw-font-weight: var(--font-weight-medium, 500);
|
|
134
|
+
font-weight: var(--font-weight-medium, 500);
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
color: var(--fg);
|
|
137
|
+
transition-property: background-color, scale;
|
|
138
|
+
transition-timing-function: var(
|
|
139
|
+
--tw-ease,
|
|
140
|
+
var(--default-transition-timing-function, cubic-bezier(0.4, 0, 0.2, 1))
|
|
141
|
+
);
|
|
142
|
+
transition-duration: var(
|
|
143
|
+
--tw-duration,
|
|
144
|
+
var(--default-transition-duration, 0.15s)
|
|
145
|
+
);
|
|
146
|
+
-webkit-user-select: none;
|
|
147
|
+
user-select: none;
|
|
148
|
+
display: inline-flex;
|
|
149
|
+
}
|
|
150
|
+
.button:focus-visible {
|
|
151
|
+
--tw-outline-style: none;
|
|
152
|
+
outline-style: none;
|
|
153
|
+
}
|
|
154
|
+
.button:enabled {
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
}
|
|
157
|
+
.button:hover {
|
|
158
|
+
background-color: var(--bg-hover);
|
|
159
|
+
}
|
|
160
|
+
.button:active {
|
|
161
|
+
--tw-scale-x: 95%;
|
|
162
|
+
--tw-scale-y: 95%;
|
|
163
|
+
--tw-scale-z: 95%;
|
|
164
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
165
|
+
background-color: var(--bg-active);
|
|
166
|
+
}
|
|
167
|
+
.button--pending {
|
|
168
|
+
pointer-events: none;
|
|
169
|
+
}
|
|
170
|
+
.button--sm {
|
|
171
|
+
height: calc(var(--spacing, 0.25rem) * 9);
|
|
172
|
+
font-size: var(--text-sm, 0.875rem);
|
|
173
|
+
line-height: var(
|
|
174
|
+
--tw-leading,
|
|
175
|
+
var(--text-sm--line-height, calc(1.25 / 0.875))
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
.button--md {
|
|
179
|
+
height: calc(var(--spacing, 0.25rem) * 10);
|
|
180
|
+
font-size: var(--text-sm, 0.875rem);
|
|
181
|
+
line-height: var(
|
|
182
|
+
--tw-leading,
|
|
183
|
+
var(--text-sm--line-height, calc(1.25 / 0.875))
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
.button--lg {
|
|
187
|
+
height: calc(var(--spacing, 0.25rem) * 11);
|
|
188
|
+
font-size: var(--text-base, 1rem);
|
|
189
|
+
line-height: var(
|
|
190
|
+
--tw-leading,
|
|
191
|
+
var(--text-base--line-height, calc(1.5 / 1))
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
.button--icon-only {
|
|
195
|
+
flex-shrink: 0;
|
|
196
|
+
}
|
|
197
|
+
.button--icon-only.button--sm {
|
|
198
|
+
width: calc(var(--spacing, 0.25rem) * 9);
|
|
199
|
+
}
|
|
200
|
+
.button--icon-only.button--md {
|
|
201
|
+
width: calc(var(--spacing, 0.25rem) * 10);
|
|
202
|
+
}
|
|
203
|
+
.button--icon-only.button--lg {
|
|
204
|
+
width: calc(var(--spacing, 0.25rem) * 11);
|
|
205
|
+
}
|
|
206
|
+
.button--solid {
|
|
207
|
+
background-color: var(--bg);
|
|
208
|
+
}
|
|
209
|
+
.button--solid:focus-visible:not(.button--pending) {
|
|
210
|
+
--tw-ring-color: var(--color);
|
|
211
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0
|
|
212
|
+
calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
213
|
+
box-shadow:
|
|
214
|
+
var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
|
|
215
|
+
var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
216
|
+
--tw-ring-offset-width: 2px;
|
|
217
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0
|
|
218
|
+
var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
219
|
+
}
|
|
220
|
+
.button--bordered {
|
|
221
|
+
border-style: var(--tw-border-style);
|
|
222
|
+
border-width: 2px;
|
|
223
|
+
border-color: var(--fg);
|
|
224
|
+
}
|
|
225
|
+
.button--bordered:focus-visible:not(.button--pending) {
|
|
226
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0
|
|
227
|
+
calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
228
|
+
box-shadow:
|
|
229
|
+
var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
|
|
230
|
+
var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
231
|
+
--tw-ring-offset-width: 2px;
|
|
232
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0
|
|
233
|
+
var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
234
|
+
}
|
|
235
|
+
.button--light {
|
|
236
|
+
text-underline-offset: 6px;
|
|
237
|
+
text-decoration-line: underline;
|
|
238
|
+
position: relative;
|
|
239
|
+
}
|
|
240
|
+
@media (hover: hover) {
|
|
241
|
+
.button--light:hover {
|
|
242
|
+
text-decoration-line: none;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
.button--light:focus-visible:not(.button--pending):after {
|
|
246
|
+
top: calc(var(--spacing, 0.25rem) * 2);
|
|
247
|
+
right: calc(var(--spacing, 0.25rem) * 3);
|
|
248
|
+
left: calc(var(--spacing, 0.25rem) * 3);
|
|
249
|
+
height: calc(var(--spacing, 0.25rem) * 0.5);
|
|
250
|
+
content: "";
|
|
251
|
+
background-color: currentColor;
|
|
252
|
+
position: absolute;
|
|
253
|
+
}
|
|
254
|
+
.spinner {
|
|
255
|
+
animation: var(--animate-spin, spin 1s linear infinite);
|
|
256
|
+
}
|
|
257
|
+
[role="tabs"] {
|
|
258
|
+
display: flex;
|
|
259
|
+
}
|
|
260
|
+
[role="tabs"] [role="tablist"] {
|
|
261
|
+
gap: var(--spacing, 0.25rem);
|
|
262
|
+
display: flex;
|
|
263
|
+
position: relative;
|
|
264
|
+
}
|
|
265
|
+
[role="tabs"] [role="tab"],
|
|
266
|
+
[role="tabs"] .menu-tab {
|
|
267
|
+
z-index: 10;
|
|
268
|
+
height: calc(var(--spacing, 0.25rem) * 9);
|
|
269
|
+
cursor: pointer;
|
|
270
|
+
padding-inline: calc(var(--spacing, 0.25rem) * 4);
|
|
271
|
+
font-size: var(--text-sm, 0.875rem);
|
|
272
|
+
line-height: var(
|
|
273
|
+
--tw-leading,
|
|
274
|
+
var(--text-sm--line-height, calc(1.25 / 0.875))
|
|
275
|
+
);
|
|
276
|
+
--tw-font-weight: var(--font-weight-medium, 500);
|
|
277
|
+
font-weight: var(--font-weight-medium, 500);
|
|
278
|
+
white-space: nowrap;
|
|
279
|
+
color: var(--color-muted);
|
|
280
|
+
-webkit-user-select: none;
|
|
281
|
+
user-select: none;
|
|
282
|
+
justify-content: center;
|
|
283
|
+
align-items: center;
|
|
284
|
+
display: inline-flex;
|
|
285
|
+
position: relative;
|
|
286
|
+
}
|
|
287
|
+
:is([role="tabs"] [role="tab"], [role="tabs"] .menu-tab):focus-visible {
|
|
288
|
+
--tw-outline-style: none;
|
|
289
|
+
outline-style: none;
|
|
290
|
+
}
|
|
291
|
+
:is([role="tabs"] [role="tab"], [role="tabs"] .menu-tab):hover,
|
|
292
|
+
:is([role="tabs"] [role="tab"], [role="tabs"] .menu-tab)[data-active],
|
|
293
|
+
:is([role="tabs"] [role="tab"], [role="tabs"] .menu-tab)[data-popup-open] {
|
|
294
|
+
color: var(--color-foreground);
|
|
295
|
+
}
|
|
296
|
+
[role="tabs"] [role="presentation"] {
|
|
297
|
+
background-color: var(--color-foreground);
|
|
298
|
+
transition-property: left, width;
|
|
299
|
+
transition-timing-function: var(
|
|
300
|
+
--tw-ease,
|
|
301
|
+
var(--default-transition-timing-function, cubic-bezier(0.4, 0, 0.2, 1))
|
|
302
|
+
);
|
|
303
|
+
transition-duration: var(
|
|
304
|
+
--tw-duration,
|
|
305
|
+
var(--default-transition-duration, 0.15s)
|
|
306
|
+
);
|
|
307
|
+
--tw-duration: 0.2s;
|
|
308
|
+
bottom: 0;
|
|
309
|
+
left: var(--active-tab-left);
|
|
310
|
+
width: var(--active-tab-width);
|
|
311
|
+
border-radius: 2147483647px;
|
|
312
|
+
height: 3px;
|
|
313
|
+
transition-duration: 0.2s;
|
|
314
|
+
position: absolute;
|
|
315
|
+
}
|
|
316
|
+
.menu-popup {
|
|
317
|
+
min-width: calc(var(--spacing, 0.25rem) * 40);
|
|
318
|
+
border-radius: var(--radius-md, 0.375rem);
|
|
319
|
+
border-style: var(--tw-border-style);
|
|
320
|
+
background-color: var(--color-background);
|
|
321
|
+
padding: var(--spacing, 0.25rem);
|
|
322
|
+
--tw-shadow:
|
|
323
|
+
0 10px 15px -3px var(--tw-shadow-color, #0000001a),
|
|
324
|
+
0 4px 6px -4px var(--tw-shadow-color, #0000001a);
|
|
325
|
+
box-shadow:
|
|
326
|
+
var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
|
|
327
|
+
var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
328
|
+
border-width: 1px;
|
|
329
|
+
}
|
|
330
|
+
.menu-item {
|
|
331
|
+
cursor: pointer;
|
|
332
|
+
border-radius: var(--radius-sm, 0.25rem);
|
|
333
|
+
padding-inline: calc(var(--spacing, 0.25rem) * 3);
|
|
334
|
+
padding-block: calc(var(--spacing, 0.25rem) * 2);
|
|
335
|
+
font-size: var(--text-sm, 0.875rem);
|
|
336
|
+
line-height: var(
|
|
337
|
+
--tw-leading,
|
|
338
|
+
var(--text-sm--line-height, calc(1.25 / 0.875))
|
|
339
|
+
);
|
|
340
|
+
--tw-outline-style: none;
|
|
341
|
+
outline-style: none;
|
|
342
|
+
align-items: center;
|
|
343
|
+
display: flex;
|
|
344
|
+
}
|
|
345
|
+
.menu-item:hover,
|
|
346
|
+
.menu-item[data-highlighted] {
|
|
347
|
+
background-color: var(--color-muted);
|
|
348
|
+
}
|
|
349
|
+
:disabled,
|
|
350
|
+
[data-disabled] {
|
|
351
|
+
pointer-events: none;
|
|
352
|
+
opacity: 0.5;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
@property --tw-font-weight {
|
|
356
|
+
syntax: "*";
|
|
357
|
+
inherits: false;
|
|
358
|
+
}
|
|
359
|
+
@property --tw-scale-x {
|
|
360
|
+
syntax: "*";
|
|
361
|
+
inherits: false;
|
|
362
|
+
initial-value: 1;
|
|
363
|
+
}
|
|
364
|
+
@property --tw-scale-y {
|
|
365
|
+
syntax: "*";
|
|
366
|
+
inherits: false;
|
|
367
|
+
initial-value: 1;
|
|
368
|
+
}
|
|
369
|
+
@property --tw-scale-z {
|
|
370
|
+
syntax: "*";
|
|
371
|
+
inherits: false;
|
|
372
|
+
initial-value: 1;
|
|
373
|
+
}
|
|
374
|
+
@property --tw-shadow {
|
|
375
|
+
syntax: "*";
|
|
376
|
+
inherits: false;
|
|
377
|
+
initial-value: 0 0 #0000;
|
|
378
|
+
}
|
|
379
|
+
@property --tw-shadow-color {
|
|
380
|
+
syntax: "*";
|
|
381
|
+
inherits: false;
|
|
382
|
+
}
|
|
383
|
+
@property --tw-shadow-alpha {
|
|
384
|
+
syntax: "<percentage>";
|
|
385
|
+
inherits: false;
|
|
386
|
+
initial-value: 100%;
|
|
387
|
+
}
|
|
388
|
+
@property --tw-inset-shadow {
|
|
389
|
+
syntax: "*";
|
|
390
|
+
inherits: false;
|
|
391
|
+
initial-value: 0 0 #0000;
|
|
392
|
+
}
|
|
393
|
+
@property --tw-inset-shadow-color {
|
|
394
|
+
syntax: "*";
|
|
395
|
+
inherits: false;
|
|
396
|
+
}
|
|
397
|
+
@property --tw-inset-shadow-alpha {
|
|
398
|
+
syntax: "<percentage>";
|
|
399
|
+
inherits: false;
|
|
400
|
+
initial-value: 100%;
|
|
401
|
+
}
|
|
402
|
+
@property --tw-ring-color {
|
|
403
|
+
syntax: "*";
|
|
404
|
+
inherits: false;
|
|
405
|
+
}
|
|
406
|
+
@property --tw-ring-shadow {
|
|
407
|
+
syntax: "*";
|
|
408
|
+
inherits: false;
|
|
409
|
+
initial-value: 0 0 #0000;
|
|
410
|
+
}
|
|
411
|
+
@property --tw-inset-ring-color {
|
|
412
|
+
syntax: "*";
|
|
413
|
+
inherits: false;
|
|
414
|
+
}
|
|
415
|
+
@property --tw-inset-ring-shadow {
|
|
416
|
+
syntax: "*";
|
|
417
|
+
inherits: false;
|
|
418
|
+
initial-value: 0 0 #0000;
|
|
419
|
+
}
|
|
420
|
+
@property --tw-ring-inset {
|
|
421
|
+
syntax: "*";
|
|
422
|
+
inherits: false;
|
|
423
|
+
}
|
|
424
|
+
@property --tw-ring-offset-width {
|
|
425
|
+
syntax: "<length>";
|
|
426
|
+
inherits: false;
|
|
427
|
+
initial-value: 0;
|
|
428
|
+
}
|
|
429
|
+
@property --tw-ring-offset-color {
|
|
430
|
+
syntax: "*";
|
|
431
|
+
inherits: false;
|
|
432
|
+
initial-value: #fff;
|
|
433
|
+
}
|
|
434
|
+
@property --tw-ring-offset-shadow {
|
|
435
|
+
syntax: "*";
|
|
436
|
+
inherits: false;
|
|
437
|
+
initial-value: 0 0 #0000;
|
|
438
|
+
}
|
|
439
|
+
@property --tw-border-style {
|
|
440
|
+
syntax: "*";
|
|
441
|
+
inherits: false;
|
|
442
|
+
initial-value: solid;
|
|
443
|
+
}
|
|
444
|
+
@property --tw-duration {
|
|
445
|
+
syntax: "*";
|
|
446
|
+
inherits: false;
|
|
447
|
+
}
|
|
448
|
+
@keyframes spin {
|
|
449
|
+
to {
|
|
450
|
+
transform: rotate(360deg);
|
|
451
|
+
}
|
|
452
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1,191 @@
|
|
|
1
|
-
import{Button as e}from"@base-ui/react"
|
|
1
|
+
import { Button as e } from "@base-ui/react"
|
|
2
|
+
import { Menu as a } from "@base-ui/react/menu"
|
|
3
|
+
import { Tabs as o } from "@base-ui/react/tabs"
|
|
4
|
+
import { cn as t } from "cn"
|
|
5
|
+
import * as s from "react"
|
|
6
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime"
|
|
7
|
+
import { tv as i } from "tailwind-variants"
|
|
8
|
+
import "./index.css"
|
|
9
|
+
|
|
10
|
+
var c = ({ className: e, size: r = 24 }) =>
|
|
11
|
+
n(`svg`, {
|
|
12
|
+
className: t(`spinner`, e),
|
|
13
|
+
fill: `currentColor`,
|
|
14
|
+
height: r,
|
|
15
|
+
stroke: `currentColor`,
|
|
16
|
+
strokeWidth: `0`,
|
|
17
|
+
version: `1.1`,
|
|
18
|
+
viewBox: `0 0 16 16`,
|
|
19
|
+
width: r,
|
|
20
|
+
xmlns: `http://www.w3.org/2000/svg`,
|
|
21
|
+
children: n(`path`, {
|
|
22
|
+
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`,
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
l = i({
|
|
26
|
+
base: `button`,
|
|
27
|
+
variants: {
|
|
28
|
+
variant: {
|
|
29
|
+
solid: `button--solid`,
|
|
30
|
+
bordered: `button--bordered`,
|
|
31
|
+
light: `button--light`,
|
|
32
|
+
},
|
|
33
|
+
color: {
|
|
34
|
+
primary: `button--primary`,
|
|
35
|
+
secondary: `button--secondary`,
|
|
36
|
+
success: `button--success`,
|
|
37
|
+
danger: `button--danger`,
|
|
38
|
+
},
|
|
39
|
+
rounded: {
|
|
40
|
+
full: `rounded-full`,
|
|
41
|
+
lg: `rounded-lg`,
|
|
42
|
+
md: `rounded-md`,
|
|
43
|
+
sm: `rounded-sm`,
|
|
44
|
+
none: `rounded-none`,
|
|
45
|
+
},
|
|
46
|
+
size: { sm: `button--sm`, md: `button--md`, lg: `button--lg` },
|
|
47
|
+
isIconOnly: { true: `button--icon-only`, false: `px-4` },
|
|
48
|
+
fullWidth: { true: `w-full` },
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
variant: `light`,
|
|
52
|
+
color: `primary`,
|
|
53
|
+
rounded: `lg`,
|
|
54
|
+
size: `md`,
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
u = i({
|
|
58
|
+
extend: l,
|
|
59
|
+
variants: { isPending: { true: `button--pending` } },
|
|
60
|
+
defaultVariants: { variant: `solid` },
|
|
61
|
+
}),
|
|
62
|
+
d = ({
|
|
63
|
+
children: i,
|
|
64
|
+
icon: a,
|
|
65
|
+
className: o,
|
|
66
|
+
disabled: s,
|
|
67
|
+
variant: d,
|
|
68
|
+
color: f,
|
|
69
|
+
rounded: p,
|
|
70
|
+
size: m,
|
|
71
|
+
isIconOnly: h,
|
|
72
|
+
fullWidth: g,
|
|
73
|
+
isPending: _,
|
|
74
|
+
...v
|
|
75
|
+
}) => {
|
|
76
|
+
let y = !!v.render,
|
|
77
|
+
b = y
|
|
78
|
+
? l({
|
|
79
|
+
variant: d,
|
|
80
|
+
color: f,
|
|
81
|
+
rounded: p,
|
|
82
|
+
size: m,
|
|
83
|
+
isIconOnly: h,
|
|
84
|
+
fullWidth: g,
|
|
85
|
+
})
|
|
86
|
+
: u({
|
|
87
|
+
variant: d,
|
|
88
|
+
color: f,
|
|
89
|
+
rounded: p,
|
|
90
|
+
size: m,
|
|
91
|
+
isIconOnly: h,
|
|
92
|
+
fullWidth: g,
|
|
93
|
+
isPending: _,
|
|
94
|
+
})
|
|
95
|
+
return r(e, {
|
|
96
|
+
className: t(b, o),
|
|
97
|
+
disabled: !y && s,
|
|
98
|
+
nativeButton: !y,
|
|
99
|
+
...v,
|
|
100
|
+
children: [_ && !y ? n(c, {}) : a, !h && n(`span`, { children: i })],
|
|
101
|
+
})
|
|
102
|
+
},
|
|
103
|
+
f = s.createContext(null)
|
|
104
|
+
function p({ defaultValue: e, children: t }) {
|
|
105
|
+
let i = s.useRef(null),
|
|
106
|
+
a = s.useRef(new Map()),
|
|
107
|
+
[c, l] = s.useState(null),
|
|
108
|
+
u = s.useCallback((e, t, n) => {
|
|
109
|
+
t && a.current.set(e, { element: t, active: n })
|
|
110
|
+
}, []),
|
|
111
|
+
d = s.useCallback((e) => {
|
|
112
|
+
a.current.delete(e)
|
|
113
|
+
}, []),
|
|
114
|
+
p = s.useCallback(() => {
|
|
115
|
+
let e = i.current
|
|
116
|
+
if (!e) return
|
|
117
|
+
let t = Array.from(a.current.values()).find((e) => e.active)
|
|
118
|
+
if (!t) {
|
|
119
|
+
l(null)
|
|
120
|
+
return
|
|
121
|
+
}
|
|
122
|
+
let n = e.getBoundingClientRect(),
|
|
123
|
+
r = t.element.getBoundingClientRect()
|
|
124
|
+
l({ left: r.left - n.left, width: r.width })
|
|
125
|
+
}, [])
|
|
126
|
+
return n(o.Root, {
|
|
127
|
+
defaultValue: e,
|
|
128
|
+
role: `tabs`,
|
|
129
|
+
children: n(f.Provider, {
|
|
130
|
+
value: { registerMenuTab: u, unregisterMenuTab: d, updateIndicator: p },
|
|
131
|
+
children: r(o.List, {
|
|
132
|
+
ref: i,
|
|
133
|
+
children: [
|
|
134
|
+
t,
|
|
135
|
+
n(o.Indicator, {
|
|
136
|
+
style: c ? { left: c.left, width: c.width } : void 0,
|
|
137
|
+
}),
|
|
138
|
+
],
|
|
139
|
+
}),
|
|
140
|
+
}),
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
function m({ id: e, active: t = !1, children: i, items: o }) {
|
|
144
|
+
let c = s.useContext(f),
|
|
145
|
+
l = s.useRef(null)
|
|
146
|
+
return (
|
|
147
|
+
s.useLayoutEffect(() => {
|
|
148
|
+
if (c)
|
|
149
|
+
return (
|
|
150
|
+
c.registerMenuTab(e, l.current, t),
|
|
151
|
+
c.updateIndicator(),
|
|
152
|
+
() => {
|
|
153
|
+
c.unregisterMenuTab(e)
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
}, [c, e, t]),
|
|
157
|
+
r(a.Root, {
|
|
158
|
+
children: [
|
|
159
|
+
n(a.Trigger, {
|
|
160
|
+
className: `menu-tab`,
|
|
161
|
+
"data-active": t ? `` : void 0,
|
|
162
|
+
ref: l,
|
|
163
|
+
children: i,
|
|
164
|
+
}),
|
|
165
|
+
n(a.Portal, {
|
|
166
|
+
children: n(a.Positioner, {
|
|
167
|
+
sideOffset: 6,
|
|
168
|
+
children: n(a.Popup, {
|
|
169
|
+
className: `menu-popup`,
|
|
170
|
+
children: o.map((e) =>
|
|
171
|
+
n(
|
|
172
|
+
a.LinkItem,
|
|
173
|
+
{ className: `menu-item`, href: e.href, children: e.label },
|
|
174
|
+
e.href,
|
|
175
|
+
),
|
|
176
|
+
),
|
|
177
|
+
}),
|
|
178
|
+
}),
|
|
179
|
+
}),
|
|
180
|
+
],
|
|
181
|
+
})
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
export {
|
|
185
|
+
d as Button,
|
|
186
|
+
m as MenuTab,
|
|
187
|
+
c as Spinner,
|
|
188
|
+
p as TabsNavigation,
|
|
189
|
+
u as buttonVariants,
|
|
190
|
+
l as linkVariants,
|
|
191
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tabs";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from "@base-ui/react/tabs";
|
|
2
|
+
export declare const Tabs: {
|
|
3
|
+
Root: (props: BaseTabs.Root.Props) => import("react").JSX.Element;
|
|
4
|
+
List: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").TabsListProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Tab: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").TabsTabProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
6
|
+
Indicator: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").TabsIndicatorProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tabs-navigation ";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare function TabsNavigation({ defaultValue, children, }: {
|
|
3
|
+
defaultValue: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export declare function MenuTab({ id, active, children, items, }: {
|
|
7
|
+
id: string;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
items: Array<{
|
|
11
|
+
label: string;
|
|
12
|
+
href: string;
|
|
13
|
+
}>;
|
|
14
|
+
}): React.JSX.Element;
|