@bubo-squared/ui-framework 0.2.28 → 0.2.29
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.cjs +371 -362
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -11
- package/dist/index.d.ts +21 -11
- package/dist/index.js +344 -335
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// src/components/Buttons/Button.tsx
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
2
|
+
import * as React2 from "react";
|
|
3
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
5
4
|
|
|
6
5
|
// src/lib/utils.tsx
|
|
7
6
|
import { clsx } from "clsx";
|
|
@@ -41,14 +40,67 @@ function spawnRipple(target, clientX, clientY, options = {}) {
|
|
|
41
40
|
window.setTimeout(cleanup, durationMs + 50);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
// src/components/
|
|
45
|
-
import
|
|
43
|
+
// src/components/ui/button.tsx
|
|
44
|
+
import "react";
|
|
45
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
46
|
+
import { cva } from "class-variance-authority";
|
|
47
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
46
48
|
var buttonVariants = cva(
|
|
47
|
-
"
|
|
49
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-0 focus-visible:shadow-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
50
|
+
{
|
|
51
|
+
variants: {
|
|
52
|
+
variant: {
|
|
53
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
54
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 dark:bg-destructive/60",
|
|
55
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
56
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
57
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
58
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
59
|
+
},
|
|
60
|
+
size: {
|
|
61
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
62
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
63
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
64
|
+
icon: "size-9",
|
|
65
|
+
"icon-sm": "size-8",
|
|
66
|
+
"icon-lg": "size-10"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
defaultVariants: {
|
|
70
|
+
variant: "default",
|
|
71
|
+
size: "default"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
function Button({
|
|
76
|
+
className,
|
|
77
|
+
variant = "default",
|
|
78
|
+
size = "default",
|
|
79
|
+
asChild = false,
|
|
80
|
+
...props
|
|
81
|
+
}) {
|
|
82
|
+
const Comp = asChild ? Slot : "button";
|
|
83
|
+
return /* @__PURE__ */ jsx2(
|
|
84
|
+
Comp,
|
|
85
|
+
{
|
|
86
|
+
"data-slot": "button",
|
|
87
|
+
"data-variant": variant,
|
|
88
|
+
"data-size": size,
|
|
89
|
+
className,
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// src/components/Buttons/Button.tsx
|
|
96
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
97
|
+
var buttonVariants2 = cva2(
|
|
98
|
+
"relative inline-flex items-center justify-center whitespace-nowrap rounded-8 transition-colors disabled:pointer-events-none overflow-hidden cursor-pointer",
|
|
48
99
|
{
|
|
49
100
|
variants: {
|
|
50
101
|
variant: {
|
|
51
102
|
primary: [
|
|
103
|
+
// BaseButton applies some defaults, but our classes will override via cn() in BaseButton
|
|
52
104
|
"btn-primary",
|
|
53
105
|
"focus-ring-primary"
|
|
54
106
|
],
|
|
@@ -85,7 +137,7 @@ var buttonVariants = cva(
|
|
|
85
137
|
}
|
|
86
138
|
}
|
|
87
139
|
);
|
|
88
|
-
var buttonIconVariants =
|
|
140
|
+
var buttonIconVariants = cva2("relative", {
|
|
89
141
|
variants: {
|
|
90
142
|
size: {
|
|
91
143
|
sm: ["size-5", "*:size-5"],
|
|
@@ -95,7 +147,7 @@ var buttonIconVariants = cva("relative", {
|
|
|
95
147
|
}
|
|
96
148
|
}
|
|
97
149
|
});
|
|
98
|
-
var buttonTextVariants =
|
|
150
|
+
var buttonTextVariants = cva2("flex text-center justify-center font-normal", {
|
|
99
151
|
variants: {
|
|
100
152
|
size: {
|
|
101
153
|
sm: ["paragraph-sm"],
|
|
@@ -105,7 +157,7 @@ var buttonTextVariants = cva("flex text-center justify-center font-normal", {
|
|
|
105
157
|
}
|
|
106
158
|
}
|
|
107
159
|
});
|
|
108
|
-
var
|
|
160
|
+
var Button2 = React2.forwardRef(
|
|
109
161
|
(props, ref) => {
|
|
110
162
|
const {
|
|
111
163
|
className,
|
|
@@ -118,7 +170,6 @@ var Button = React.forwardRef(
|
|
|
118
170
|
onPointerDown,
|
|
119
171
|
...rest
|
|
120
172
|
} = props;
|
|
121
|
-
const Comp = asChild ? Slot : "button";
|
|
122
173
|
const handlePointerDown = (e) => {
|
|
123
174
|
onPointerDown?.(e);
|
|
124
175
|
if (e.defaultPrevented) return;
|
|
@@ -127,27 +178,28 @@ var Button = React.forwardRef(
|
|
|
127
178
|
spawnRipple(e.currentTarget, e.clientX, e.clientY);
|
|
128
179
|
};
|
|
129
180
|
return /* @__PURE__ */ jsxs(
|
|
130
|
-
|
|
181
|
+
Button,
|
|
131
182
|
{
|
|
132
|
-
|
|
183
|
+
asChild,
|
|
133
184
|
ref,
|
|
185
|
+
className: cn(buttonVariants2({ variant, size, className })),
|
|
134
186
|
onPointerDown: handlePointerDown,
|
|
135
187
|
...rest,
|
|
136
188
|
children: [
|
|
137
|
-
leadingIcon && /* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
trailingIcon && /* @__PURE__ */
|
|
189
|
+
leadingIcon && /* @__PURE__ */ jsx3("div", { className: cn(buttonIconVariants({ size })), children: leadingIcon }),
|
|
190
|
+
/* @__PURE__ */ jsx3("div", { className: cn(buttonTextVariants({ size })), children }),
|
|
191
|
+
trailingIcon && /* @__PURE__ */ jsx3("div", { className: cn(buttonIconVariants({ size })), children: trailingIcon })
|
|
140
192
|
]
|
|
141
193
|
}
|
|
142
194
|
);
|
|
143
195
|
}
|
|
144
196
|
);
|
|
145
|
-
|
|
197
|
+
Button2.displayName = "Button";
|
|
146
198
|
|
|
147
199
|
// src/components/Buttons/ButtonGroup.tsx
|
|
148
|
-
import { cva as
|
|
149
|
-
import { jsx as
|
|
150
|
-
var buttonGroupVariants =
|
|
200
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
201
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
202
|
+
var buttonGroupVariants = cva3(
|
|
151
203
|
"flex items-center justify-center gap-4 pt-4 w-fit",
|
|
152
204
|
{
|
|
153
205
|
variants: {
|
|
@@ -168,7 +220,7 @@ var ButtonGroup = (props) => {
|
|
|
168
220
|
children,
|
|
169
221
|
...rest
|
|
170
222
|
} = props;
|
|
171
|
-
return /* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ jsx4(
|
|
172
224
|
"div",
|
|
173
225
|
{
|
|
174
226
|
className: cn(buttonGroupVariants({ orientation }), className),
|
|
@@ -179,11 +231,10 @@ var ButtonGroup = (props) => {
|
|
|
179
231
|
};
|
|
180
232
|
|
|
181
233
|
// src/components/Buttons/IconButton.tsx
|
|
182
|
-
import * as
|
|
183
|
-
import {
|
|
184
|
-
import {
|
|
185
|
-
|
|
186
|
-
var iconButtonVariants = cva3(
|
|
234
|
+
import * as React3 from "react";
|
|
235
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
236
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
237
|
+
var iconButtonVariants = cva4(
|
|
187
238
|
"relative inline-flex items-center justify-center whitespace-nowrap transition-colors disabled:pointer-events-none overflow-hidden p-2 cursor-pointer",
|
|
188
239
|
{
|
|
189
240
|
variants: {
|
|
@@ -221,7 +272,7 @@ var iconButtonVariants = cva3(
|
|
|
221
272
|
}
|
|
222
273
|
}
|
|
223
274
|
);
|
|
224
|
-
var IconButton =
|
|
275
|
+
var IconButton = React3.forwardRef(
|
|
225
276
|
(props, ref) => {
|
|
226
277
|
const {
|
|
227
278
|
className,
|
|
@@ -233,7 +284,6 @@ var IconButton = React2.forwardRef(
|
|
|
233
284
|
onPointerDown,
|
|
234
285
|
...rest
|
|
235
286
|
} = props;
|
|
236
|
-
const Comp = asChild ? Slot2 : "button";
|
|
237
287
|
const handlePointerDown = (e) => {
|
|
238
288
|
onPointerDown?.(e);
|
|
239
289
|
if (e.defaultPrevented) return;
|
|
@@ -241,14 +291,15 @@ var IconButton = React2.forwardRef(
|
|
|
241
291
|
if (e.button !== 0 || !e.isPrimary) return;
|
|
242
292
|
spawnRipple(e.currentTarget, e.clientX, e.clientY);
|
|
243
293
|
};
|
|
244
|
-
return /* @__PURE__ */
|
|
245
|
-
|
|
294
|
+
return /* @__PURE__ */ jsx5(
|
|
295
|
+
Button,
|
|
246
296
|
{
|
|
247
|
-
className: cn(iconButtonVariants({ variant, size }), round ? "rounded-full" : "rounded-
|
|
297
|
+
className: cn(iconButtonVariants({ variant, size }), round ? "rounded-full" : "rounded-8", className),
|
|
248
298
|
ref,
|
|
299
|
+
asChild,
|
|
249
300
|
onPointerDown: handlePointerDown,
|
|
250
301
|
...rest,
|
|
251
|
-
children: /* @__PURE__ */
|
|
302
|
+
children: /* @__PURE__ */ jsx5("div", { className: "buttonIcon flex items-center justify-center", children: icon })
|
|
252
303
|
}
|
|
253
304
|
);
|
|
254
305
|
}
|
|
@@ -257,10 +308,10 @@ IconButton.displayName = "IconButton";
|
|
|
257
308
|
|
|
258
309
|
// src/components/Buttons/IconButtonGroup.tsx
|
|
259
310
|
import "react";
|
|
260
|
-
import { cva as
|
|
261
|
-
import { jsx as
|
|
311
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
312
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
262
313
|
var IconGroupLinesClass = "inline-flex items-center justify-center gap-0 [&>button]:outline-none! [&>button]:rounded-none [&>button:focus]:shadow-none [&>button:focus]:bg-(--border-secondary) [&>button:first-child]:rounded-l-4 [&>button:last-child]:rounded-r-4";
|
|
263
|
-
var IconGroupSizeVariants =
|
|
314
|
+
var IconGroupSizeVariants = cva5("", {
|
|
264
315
|
variants: {
|
|
265
316
|
size: {
|
|
266
317
|
sm: "[&>button]:px-1.5",
|
|
@@ -278,7 +329,7 @@ var IconButtonGroup = (props) => {
|
|
|
278
329
|
if (!items || items.length === 0) {
|
|
279
330
|
return null;
|
|
280
331
|
}
|
|
281
|
-
return /* @__PURE__ */
|
|
332
|
+
return /* @__PURE__ */ jsx6(
|
|
282
333
|
"div",
|
|
283
334
|
{
|
|
284
335
|
className: cn(
|
|
@@ -287,7 +338,7 @@ var IconButtonGroup = (props) => {
|
|
|
287
338
|
className
|
|
288
339
|
),
|
|
289
340
|
...rest,
|
|
290
|
-
children: items.map((item, index) => /* @__PURE__ */
|
|
341
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx6(
|
|
291
342
|
IconButton,
|
|
292
343
|
{
|
|
293
344
|
variant: "secondary",
|
|
@@ -311,11 +362,11 @@ var IconButtonGroup = (props) => {
|
|
|
311
362
|
IconButtonGroup.displayName = "IconButtonGroup";
|
|
312
363
|
|
|
313
364
|
// src/components/Buttons/LinkButton.tsx
|
|
314
|
-
import * as
|
|
315
|
-
import { Slot as
|
|
316
|
-
import { cva as
|
|
317
|
-
import { jsx as
|
|
318
|
-
var linkButtonVariants =
|
|
365
|
+
import * as React5 from "react";
|
|
366
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
367
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
368
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
369
|
+
var linkButtonVariants = cva6(
|
|
319
370
|
"inline-flex items-center justify-center whitespace-nowrap rounded-4 transition-colors disabled:pointer-events-none overflow-hidden gap-2 cursor-pointer",
|
|
320
371
|
{
|
|
321
372
|
variants: {
|
|
@@ -337,7 +388,7 @@ var linkButtonVariants = cva5(
|
|
|
337
388
|
}
|
|
338
389
|
}
|
|
339
390
|
);
|
|
340
|
-
var linkButtonIconVariants =
|
|
391
|
+
var linkButtonIconVariants = cva6("relative", {
|
|
341
392
|
variants: {
|
|
342
393
|
size: {
|
|
343
394
|
sm: ["size-5", "*:size-5"],
|
|
@@ -347,7 +398,7 @@ var linkButtonIconVariants = cva5("relative", {
|
|
|
347
398
|
}
|
|
348
399
|
}
|
|
349
400
|
});
|
|
350
|
-
var linkButtonTextVariants =
|
|
401
|
+
var linkButtonTextVariants = cva6("inline-flex items-center text-center font-medium", {
|
|
351
402
|
variants: {
|
|
352
403
|
size: {
|
|
353
404
|
sm: ["text-sm", "leading-5"],
|
|
@@ -357,7 +408,7 @@ var linkButtonTextVariants = cva5("inline-flex items-center text-center font-med
|
|
|
357
408
|
}
|
|
358
409
|
}
|
|
359
410
|
});
|
|
360
|
-
var LinkButton =
|
|
411
|
+
var LinkButton = React5.forwardRef(
|
|
361
412
|
(props, ref) => {
|
|
362
413
|
const {
|
|
363
414
|
className,
|
|
@@ -369,7 +420,7 @@ var LinkButton = React4.forwardRef(
|
|
|
369
420
|
leadingIcon,
|
|
370
421
|
...rest
|
|
371
422
|
} = props;
|
|
372
|
-
const Comp = asChild ?
|
|
423
|
+
const Comp = asChild ? Slot2 : "button";
|
|
373
424
|
return /* @__PURE__ */ jsxs2(
|
|
374
425
|
Comp,
|
|
375
426
|
{
|
|
@@ -377,9 +428,9 @@ var LinkButton = React4.forwardRef(
|
|
|
377
428
|
ref,
|
|
378
429
|
...rest,
|
|
379
430
|
children: [
|
|
380
|
-
leadingIcon && /* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
trailingIcon && /* @__PURE__ */
|
|
431
|
+
leadingIcon && /* @__PURE__ */ jsx7("div", { className: cn(linkButtonIconVariants({ size })), children: leadingIcon }),
|
|
432
|
+
/* @__PURE__ */ jsx7("div", { className: cn(linkButtonTextVariants({ size })), children }),
|
|
433
|
+
trailingIcon && /* @__PURE__ */ jsx7("div", { className: cn(linkButtonIconVariants({ size })), children: trailingIcon })
|
|
383
434
|
]
|
|
384
435
|
}
|
|
385
436
|
);
|
|
@@ -388,8 +439,8 @@ var LinkButton = React4.forwardRef(
|
|
|
388
439
|
LinkButton.displayName = "LinkButton";
|
|
389
440
|
|
|
390
441
|
// src/components/Buttons/MessageButton.tsx
|
|
391
|
-
import * as
|
|
392
|
-
import { jsx as
|
|
442
|
+
import * as React6 from "react";
|
|
443
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
393
444
|
var MessageButton = (props) => {
|
|
394
445
|
const {
|
|
395
446
|
onClick,
|
|
@@ -401,7 +452,7 @@ var MessageButton = (props) => {
|
|
|
401
452
|
className = "",
|
|
402
453
|
...buttonProps
|
|
403
454
|
} = props;
|
|
404
|
-
const [status, setStatus] =
|
|
455
|
+
const [status, setStatus] = React6.useState("idle");
|
|
405
456
|
const handleClick = async (_event) => {
|
|
406
457
|
if (status === "loading") return;
|
|
407
458
|
setStatus("loading");
|
|
@@ -427,8 +478,8 @@ var MessageButton = (props) => {
|
|
|
427
478
|
onClick: handleClick,
|
|
428
479
|
className: `inline-flex items-center justify-center rounded-4 px-1.5 py-1 gap-1 text-sm transition-colors cursor-pointer ${statusClasses} ${className}`,
|
|
429
480
|
children: [
|
|
430
|
-
props.icon && /* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
481
|
+
props.icon && /* @__PURE__ */ jsx8("div", { className: "size-5 *:size-5 relative", children: props.icon }),
|
|
482
|
+
/* @__PURE__ */ jsx8("div", { className: "text-center text-xl font-normal leading-7", children: label })
|
|
432
483
|
]
|
|
433
484
|
}
|
|
434
485
|
);
|
|
@@ -436,11 +487,11 @@ var MessageButton = (props) => {
|
|
|
436
487
|
MessageButton.displayName = "MessageButton";
|
|
437
488
|
|
|
438
489
|
// src/components/Content/Accordion.tsx
|
|
439
|
-
import * as
|
|
490
|
+
import * as React7 from "react";
|
|
440
491
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
441
492
|
import { ChevronDownIcon } from "@bubo-squared/icons";
|
|
442
|
-
import { jsx as
|
|
443
|
-
var Accordion =
|
|
493
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
494
|
+
var Accordion = React7.forwardRef(
|
|
444
495
|
(props, ref) => {
|
|
445
496
|
const {
|
|
446
497
|
title,
|
|
@@ -458,7 +509,7 @@ var Accordion = React6.forwardRef(
|
|
|
458
509
|
...restRootProps
|
|
459
510
|
} = rootProps;
|
|
460
511
|
const resolvedDefaultValue = value === void 0 && defaultValue === void 0 && defaultOpen ? "item" : defaultValue;
|
|
461
|
-
return /* @__PURE__ */
|
|
512
|
+
return /* @__PURE__ */ jsx9(
|
|
462
513
|
AccordionPrimitive.Root,
|
|
463
514
|
{
|
|
464
515
|
ref,
|
|
@@ -475,7 +526,7 @@ var Accordion = React6.forwardRef(
|
|
|
475
526
|
value: "item",
|
|
476
527
|
className: cn(bordered ? "border rounded-4" : "border-b", "border-secondary px-4"),
|
|
477
528
|
children: [
|
|
478
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ jsx9(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs4(
|
|
479
530
|
AccordionPrimitive.Trigger,
|
|
480
531
|
{
|
|
481
532
|
className: cn(
|
|
@@ -485,12 +536,12 @@ var Accordion = React6.forwardRef(
|
|
|
485
536
|
"disabled:cursor-not-allowed disabled:text-primary-disabled cursor-pointer"
|
|
486
537
|
),
|
|
487
538
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ jsx9("span", { className: "flex-1", children: title }),
|
|
540
|
+
/* @__PURE__ */ jsx9("span", { className: "accordion-icon inline-flex shrink-0 transition-transform duration-200 [&>svg]:size-5", children: expandIcon ?? /* @__PURE__ */ jsx9(ChevronDownIcon, {}) })
|
|
490
541
|
]
|
|
491
542
|
}
|
|
492
543
|
) }),
|
|
493
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ jsx9(AccordionPrimitive.Content, { className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden", children: /* @__PURE__ */ jsx9("div", { className: "pb-3", children }) })
|
|
494
545
|
]
|
|
495
546
|
}
|
|
496
547
|
)
|
|
@@ -501,12 +552,12 @@ var Accordion = React6.forwardRef(
|
|
|
501
552
|
Accordion.displayName = "Accordion";
|
|
502
553
|
|
|
503
554
|
// src/components/Content/Avatar.tsx
|
|
504
|
-
import * as
|
|
505
|
-
import { Slot as
|
|
506
|
-
import { cva as
|
|
555
|
+
import * as React8 from "react";
|
|
556
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
557
|
+
import { cva as cva7 } from "class-variance-authority";
|
|
507
558
|
import { UserIcon } from "@bubo-squared/icons";
|
|
508
|
-
import { jsx as
|
|
509
|
-
var avatarVariants =
|
|
559
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
560
|
+
var avatarVariants = cva7(
|
|
510
561
|
"relative inline-flex items-center justify-center rounded-full border-secondary border-1 bg-(--background-primary) text-primary overflow-hidden hover:border-(--focus-secondary) focus-visible:border-(--focus-primary) focus-visible:outline-none",
|
|
511
562
|
{
|
|
512
563
|
variants: {
|
|
@@ -525,7 +576,7 @@ var avatarVariants = cva6(
|
|
|
525
576
|
}
|
|
526
577
|
}
|
|
527
578
|
);
|
|
528
|
-
var avatarInitialsVariants =
|
|
579
|
+
var avatarInitialsVariants = cva7(
|
|
529
580
|
"flex items-center justify-center text-primary leading-none ",
|
|
530
581
|
{
|
|
531
582
|
variants: {
|
|
@@ -544,7 +595,7 @@ var avatarInitialsVariants = cva6(
|
|
|
544
595
|
}
|
|
545
596
|
}
|
|
546
597
|
);
|
|
547
|
-
var avatarIconVariants =
|
|
598
|
+
var avatarIconVariants = cva7(
|
|
548
599
|
"flex items-center justify-center text-(--icon-primary)",
|
|
549
600
|
{
|
|
550
601
|
variants: {
|
|
@@ -563,7 +614,7 @@ var avatarIconVariants = cva6(
|
|
|
563
614
|
}
|
|
564
615
|
}
|
|
565
616
|
);
|
|
566
|
-
var Avatar =
|
|
617
|
+
var Avatar = React8.forwardRef(
|
|
567
618
|
(props, ref) => {
|
|
568
619
|
const {
|
|
569
620
|
asChild = false,
|
|
@@ -575,7 +626,7 @@ var Avatar = React7.forwardRef(
|
|
|
575
626
|
className,
|
|
576
627
|
...rest
|
|
577
628
|
} = props;
|
|
578
|
-
const Comp = asChild ?
|
|
629
|
+
const Comp = asChild ? Slot3 : "button";
|
|
579
630
|
const hasImage = variant === "image" && typeof src === "string" && src.length > 0;
|
|
580
631
|
return /* @__PURE__ */ jsxs5(
|
|
581
632
|
Comp,
|
|
@@ -584,7 +635,7 @@ var Avatar = React7.forwardRef(
|
|
|
584
635
|
className: cn(avatarVariants({ size }), className),
|
|
585
636
|
...rest,
|
|
586
637
|
children: [
|
|
587
|
-
hasImage ? /* @__PURE__ */
|
|
638
|
+
hasImage ? /* @__PURE__ */ jsx10(
|
|
588
639
|
"img",
|
|
589
640
|
{
|
|
590
641
|
src,
|
|
@@ -592,8 +643,8 @@ var Avatar = React7.forwardRef(
|
|
|
592
643
|
className: "w-full h-full object-cover"
|
|
593
644
|
}
|
|
594
645
|
) : null,
|
|
595
|
-
!hasImage && variant === "initials" && /* @__PURE__ */
|
|
596
|
-
!hasImage && variant === "icon" && /* @__PURE__ */
|
|
646
|
+
!hasImage && variant === "initials" && /* @__PURE__ */ jsx10("span", { className: cn(avatarInitialsVariants({ size }), "relative bottom-px"), children: initials }),
|
|
647
|
+
!hasImage && variant === "icon" && /* @__PURE__ */ jsx10("span", { className: cn(avatarIconVariants({ size })), children: /* @__PURE__ */ jsx10(UserIcon, {}) })
|
|
597
648
|
]
|
|
598
649
|
}
|
|
599
650
|
);
|
|
@@ -603,7 +654,7 @@ Avatar.displayName = "Avatar";
|
|
|
603
654
|
|
|
604
655
|
// src/components/Content/Typography.tsx
|
|
605
656
|
import "react";
|
|
606
|
-
import { jsx as
|
|
657
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
607
658
|
var mbCapableBaseClasses = /* @__PURE__ */ new Set([
|
|
608
659
|
"h1-intro",
|
|
609
660
|
"h2-intro",
|
|
@@ -639,7 +690,7 @@ var Typography = (props) => {
|
|
|
639
690
|
const Comp = as ?? "span";
|
|
640
691
|
const mbClassName = useMargin ? getMbClassName(variant) : null;
|
|
641
692
|
const weightClassName = weight === "regular" ? null : `${variant}-${weight}`;
|
|
642
|
-
return /* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ jsx11(
|
|
643
694
|
Comp,
|
|
644
695
|
{
|
|
645
696
|
className: cn("text-primary", variant, weightClassName, mbClassName, className),
|
|
@@ -651,11 +702,11 @@ var Typography = (props) => {
|
|
|
651
702
|
Typography.displayName = "Typography";
|
|
652
703
|
|
|
653
704
|
// src/components/Content/Badge.tsx
|
|
654
|
-
import * as
|
|
655
|
-
import { Slot as
|
|
656
|
-
import { cva as
|
|
657
|
-
import { Fragment, jsx as
|
|
658
|
-
var badgeVariants =
|
|
705
|
+
import * as React10 from "react";
|
|
706
|
+
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
707
|
+
import { cva as cva8 } from "class-variance-authority";
|
|
708
|
+
import { Fragment, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
709
|
+
var badgeVariants = cva8(
|
|
659
710
|
"inline-flex items-center justify-center rounded-4 leading-none whitespace-nowrap gap-1 py-0",
|
|
660
711
|
{
|
|
661
712
|
variants: {
|
|
@@ -684,7 +735,7 @@ var badgeVariants = cva7(
|
|
|
684
735
|
}
|
|
685
736
|
}
|
|
686
737
|
);
|
|
687
|
-
var Badge =
|
|
738
|
+
var Badge = React10.forwardRef(
|
|
688
739
|
(props, ref) => {
|
|
689
740
|
const {
|
|
690
741
|
asChild = false,
|
|
@@ -695,19 +746,19 @@ var Badge = React9.forwardRef(
|
|
|
695
746
|
className,
|
|
696
747
|
...rest
|
|
697
748
|
} = props;
|
|
698
|
-
const Comp = asChild ?
|
|
749
|
+
const Comp = asChild ? Slot4 : "div";
|
|
699
750
|
const hasValue = typeof value === "string" ? value.trim() !== "" : value != null;
|
|
700
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ jsx12(
|
|
701
752
|
Comp,
|
|
702
753
|
{
|
|
703
754
|
ref,
|
|
704
755
|
className: cn(badgeVariants({ size, variant }), className),
|
|
705
756
|
...rest,
|
|
706
757
|
children: hasValue ? /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
707
|
-
/* @__PURE__ */
|
|
708
|
-
/* @__PURE__ */
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
] }) : /* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ jsx12("span", { className: "font-normal", children: label }),
|
|
759
|
+
/* @__PURE__ */ jsx12("span", { className: "font-normal", children: ":" }),
|
|
760
|
+
/* @__PURE__ */ jsx12("span", { className: "font-medium", children: value })
|
|
761
|
+
] }) : /* @__PURE__ */ jsx12("span", { className: "font-normal", children: label })
|
|
711
762
|
}
|
|
712
763
|
);
|
|
713
764
|
}
|
|
@@ -715,10 +766,10 @@ var Badge = React9.forwardRef(
|
|
|
715
766
|
Badge.displayName = "Badge";
|
|
716
767
|
|
|
717
768
|
// src/components/Content/BadgeDigit.tsx
|
|
718
|
-
import * as
|
|
719
|
-
import { cva as
|
|
720
|
-
import { jsx as
|
|
721
|
-
var badgeDigitVariants =
|
|
769
|
+
import * as React11 from "react";
|
|
770
|
+
import { cva as cva9 } from "class-variance-authority";
|
|
771
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
772
|
+
var badgeDigitVariants = cva9(
|
|
722
773
|
"inline-flex items-center justify-center leading-none whitespace-nowrap text-(--color-b-white)",
|
|
723
774
|
{
|
|
724
775
|
variants: {
|
|
@@ -742,7 +793,7 @@ var badgeDigitVariants = cva8(
|
|
|
742
793
|
}
|
|
743
794
|
}
|
|
744
795
|
);
|
|
745
|
-
var BadgeDigit =
|
|
796
|
+
var BadgeDigit = React11.forwardRef(
|
|
746
797
|
(props, ref) => {
|
|
747
798
|
const {
|
|
748
799
|
value,
|
|
@@ -751,7 +802,7 @@ var BadgeDigit = React10.forwardRef(
|
|
|
751
802
|
className,
|
|
752
803
|
...rest
|
|
753
804
|
} = props;
|
|
754
|
-
return /* @__PURE__ */
|
|
805
|
+
return /* @__PURE__ */ jsx13(
|
|
755
806
|
"div",
|
|
756
807
|
{
|
|
757
808
|
ref,
|
|
@@ -766,9 +817,9 @@ BadgeDigit.displayName = "BadgeDigit";
|
|
|
766
817
|
|
|
767
818
|
// src/components/Content/BadgeDot.tsx
|
|
768
819
|
import "react";
|
|
769
|
-
import { cva as
|
|
770
|
-
import { jsx as
|
|
771
|
-
var badgeDotVariants =
|
|
820
|
+
import { cva as cva10 } from "class-variance-authority";
|
|
821
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
822
|
+
var badgeDotVariants = cva10("rounded-12 size-3", {
|
|
772
823
|
variants: {
|
|
773
824
|
status: {
|
|
774
825
|
disabled: "bg-(--color-primary)",
|
|
@@ -783,14 +834,14 @@ var badgeDotVariants = cva9("rounded-12 size-3", {
|
|
|
783
834
|
}
|
|
784
835
|
});
|
|
785
836
|
var BadgeDot = ({ status, className }) => {
|
|
786
|
-
return /* @__PURE__ */
|
|
837
|
+
return /* @__PURE__ */ jsx14("div", { className: cn(badgeDotVariants({ status }), className) });
|
|
787
838
|
};
|
|
788
839
|
BadgeDot.displayName = "BadgeDot";
|
|
789
840
|
|
|
790
841
|
// src/components/Content/BadgeStatus.tsx
|
|
791
|
-
import * as
|
|
792
|
-
import { jsx as
|
|
793
|
-
var BadgeStatus =
|
|
842
|
+
import * as React13 from "react";
|
|
843
|
+
import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
844
|
+
var BadgeStatus = React13.forwardRef(
|
|
794
845
|
(props, ref) => {
|
|
795
846
|
const {
|
|
796
847
|
label,
|
|
@@ -808,7 +859,7 @@ var BadgeStatus = React12.forwardRef(
|
|
|
808
859
|
className: cn("inline-flex items-center gap-2", className),
|
|
809
860
|
...rest,
|
|
810
861
|
children: [
|
|
811
|
-
/* @__PURE__ */
|
|
862
|
+
/* @__PURE__ */ jsx15(
|
|
812
863
|
"span",
|
|
813
864
|
{
|
|
814
865
|
className: cn(
|
|
@@ -818,7 +869,7 @@ var BadgeStatus = React12.forwardRef(
|
|
|
818
869
|
)
|
|
819
870
|
}
|
|
820
871
|
),
|
|
821
|
-
/* @__PURE__ */
|
|
872
|
+
/* @__PURE__ */ jsx15("span", { className: textClasses, children: label })
|
|
822
873
|
]
|
|
823
874
|
}
|
|
824
875
|
);
|
|
@@ -829,7 +880,7 @@ BadgeStatus.displayName = "BadgeStatus";
|
|
|
829
880
|
// src/components/Content/Divider.tsx
|
|
830
881
|
import "react";
|
|
831
882
|
import { TargetIcon } from "@bubo-squared/icons";
|
|
832
|
-
import { jsx as
|
|
883
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
833
884
|
var gapBySize = {
|
|
834
885
|
sm: "gap-2",
|
|
835
886
|
md: "gap-3",
|
|
@@ -864,14 +915,14 @@ var Divider = (props) => {
|
|
|
864
915
|
className: _className,
|
|
865
916
|
...divProps
|
|
866
917
|
} = props;
|
|
867
|
-
return /* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ jsx16(
|
|
868
919
|
"div",
|
|
869
920
|
{
|
|
870
921
|
className: wrapperClass,
|
|
871
922
|
role: "separator",
|
|
872
923
|
"aria-orientation": ariaOrientation,
|
|
873
924
|
...divProps,
|
|
874
|
-
children: /* @__PURE__ */
|
|
925
|
+
children: /* @__PURE__ */ jsx16("div", { className: lineClass })
|
|
875
926
|
}
|
|
876
927
|
);
|
|
877
928
|
}
|
|
@@ -893,8 +944,8 @@ var Divider = (props) => {
|
|
|
893
944
|
"aria-orientation": ariaOrientation,
|
|
894
945
|
...divProps,
|
|
895
946
|
children: [
|
|
896
|
-
/* @__PURE__ */
|
|
897
|
-
/* @__PURE__ */
|
|
947
|
+
/* @__PURE__ */ jsx16("div", { className: lineClass }),
|
|
948
|
+
/* @__PURE__ */ jsx16(
|
|
898
949
|
"span",
|
|
899
950
|
{
|
|
900
951
|
className: cn(
|
|
@@ -904,7 +955,7 @@ var Divider = (props) => {
|
|
|
904
955
|
children: textLabel
|
|
905
956
|
}
|
|
906
957
|
),
|
|
907
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ jsx16("div", { className: lineClass })
|
|
908
959
|
]
|
|
909
960
|
}
|
|
910
961
|
);
|
|
@@ -929,18 +980,18 @@ var Divider = (props) => {
|
|
|
929
980
|
"aria-orientation": ariaOrientation,
|
|
930
981
|
...divProps,
|
|
931
982
|
children: [
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ jsx16("div", { className: lineClass }),
|
|
984
|
+
/* @__PURE__ */ jsx16(
|
|
934
985
|
IconButton,
|
|
935
986
|
{
|
|
936
987
|
variant: iconButtonVariant ?? "secondary",
|
|
937
988
|
size: resolvedSize,
|
|
938
989
|
"aria-label": ariaLabel ?? "More options",
|
|
939
|
-
icon: icon ?? /* @__PURE__ */
|
|
990
|
+
icon: icon ?? /* @__PURE__ */ jsx16(TargetIcon, {}),
|
|
940
991
|
onClick: onIconClick
|
|
941
992
|
}
|
|
942
993
|
),
|
|
943
|
-
/* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ jsx16("div", { className: lineClass })
|
|
944
995
|
]
|
|
945
996
|
}
|
|
946
997
|
);
|
|
@@ -962,8 +1013,8 @@ var Divider = (props) => {
|
|
|
962
1013
|
"aria-orientation": ariaOrientation,
|
|
963
1014
|
...divProps,
|
|
964
1015
|
children: [
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ jsx16("div", { className: lineClass }),
|
|
1017
|
+
/* @__PURE__ */ jsx16(
|
|
967
1018
|
IconButtonGroup,
|
|
968
1019
|
{
|
|
969
1020
|
className: resolvedOrientation === "vertical" ? "flex-col" : "flex-row",
|
|
@@ -971,7 +1022,7 @@ var Divider = (props) => {
|
|
|
971
1022
|
size: resolvedSize
|
|
972
1023
|
}
|
|
973
1024
|
),
|
|
974
|
-
/* @__PURE__ */
|
|
1025
|
+
/* @__PURE__ */ jsx16("div", { className: lineClass })
|
|
975
1026
|
]
|
|
976
1027
|
}
|
|
977
1028
|
);
|
|
@@ -995,9 +1046,9 @@ var Divider = (props) => {
|
|
|
995
1046
|
"aria-orientation": ariaOrientation,
|
|
996
1047
|
...divProps,
|
|
997
1048
|
children: [
|
|
998
|
-
/* @__PURE__ */
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
|
|
1049
|
+
/* @__PURE__ */ jsx16("div", { className: lineClass }),
|
|
1050
|
+
/* @__PURE__ */ jsx16(
|
|
1051
|
+
Button2,
|
|
1001
1052
|
{
|
|
1002
1053
|
variant: buttonVariant ?? "secondary",
|
|
1003
1054
|
size: resolvedSize,
|
|
@@ -1005,7 +1056,7 @@ var Divider = (props) => {
|
|
|
1005
1056
|
children: buttonLabel
|
|
1006
1057
|
}
|
|
1007
1058
|
),
|
|
1008
|
-
/* @__PURE__ */
|
|
1059
|
+
/* @__PURE__ */ jsx16("div", { className: lineClass })
|
|
1009
1060
|
]
|
|
1010
1061
|
}
|
|
1011
1062
|
);
|
|
@@ -1015,11 +1066,11 @@ var Divider = (props) => {
|
|
|
1015
1066
|
Divider.displayName = "Divider";
|
|
1016
1067
|
|
|
1017
1068
|
// src/components/Content/Progress.tsx
|
|
1018
|
-
import * as
|
|
1069
|
+
import * as React16 from "react";
|
|
1019
1070
|
|
|
1020
1071
|
// src/components/Inputs/Field.tsx
|
|
1021
|
-
import * as
|
|
1022
|
-
import { jsx as
|
|
1072
|
+
import * as React15 from "react";
|
|
1073
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1023
1074
|
var fieldBase = "flex flex-col gap-2 items-start";
|
|
1024
1075
|
var Field = (props) => {
|
|
1025
1076
|
const {
|
|
@@ -1034,18 +1085,18 @@ var Field = (props) => {
|
|
|
1034
1085
|
} = props;
|
|
1035
1086
|
const hasLabel = label != null;
|
|
1036
1087
|
const hasHint = hint != null;
|
|
1037
|
-
const fieldId =
|
|
1088
|
+
const fieldId = React15.useId();
|
|
1038
1089
|
const labelId = hasLabel ? `${fieldId}-label` : void 0;
|
|
1039
1090
|
const hintId = hasHint ? `${fieldId}-hint` : void 0;
|
|
1040
1091
|
const hintColorClass = disabled ? "text-primary-disabled" : status === "success" ? "text-(--color-success)" : status === "error" ? "text-(--color-error)" : "text-(--color-secondary)";
|
|
1041
1092
|
const labelColorClass = disabled ? "text-primary-disabled" : "text-primary";
|
|
1042
1093
|
return /* @__PURE__ */ jsxs9("div", { className: cn(fieldBase, className), children: [
|
|
1043
1094
|
hasLabel && /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between", children: [
|
|
1044
|
-
/* @__PURE__ */
|
|
1095
|
+
/* @__PURE__ */ jsx17("label", { id: labelId, className: cn("paragraph-sm", labelColorClass), children: label }),
|
|
1045
1096
|
labelRight
|
|
1046
1097
|
] }),
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
!hideHint && /* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ jsx17("div", { className: "relative w-full", children }),
|
|
1099
|
+
!hideHint && /* @__PURE__ */ jsx17(
|
|
1049
1100
|
"p",
|
|
1050
1101
|
{
|
|
1051
1102
|
id: hasHint ? hintId : void 0,
|
|
@@ -1058,13 +1109,13 @@ var Field = (props) => {
|
|
|
1058
1109
|
Field.displayName = "Field";
|
|
1059
1110
|
|
|
1060
1111
|
// src/components/Content/Progress.tsx
|
|
1061
|
-
import { jsx as
|
|
1112
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1062
1113
|
var sizeToBarClasses = {
|
|
1063
1114
|
lg: "h-4 rounded-16",
|
|
1064
1115
|
md: "h-2 rounded-8",
|
|
1065
1116
|
sm: "h-1 rounded-4"
|
|
1066
1117
|
};
|
|
1067
|
-
var Progress =
|
|
1118
|
+
var Progress = React16.forwardRef(
|
|
1068
1119
|
(props, ref) => {
|
|
1069
1120
|
const {
|
|
1070
1121
|
value,
|
|
@@ -1084,17 +1135,17 @@ var Progress = React15.forwardRef(
|
|
|
1084
1135
|
const percentageLabel = `${Math.round(clamped)}%`;
|
|
1085
1136
|
const resolvedAriaLabel = ariaLabel ?? (typeof label === "string" ? label : void 0);
|
|
1086
1137
|
const barHeightClasses = sizeToBarClasses[size];
|
|
1087
|
-
return /* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ jsx18(
|
|
1088
1139
|
Field,
|
|
1089
1140
|
{
|
|
1090
1141
|
label,
|
|
1091
|
-
labelRight: !hideProgressLabel && label != null ? /* @__PURE__ */
|
|
1142
|
+
labelRight: !hideProgressLabel && label != null ? /* @__PURE__ */ jsx18("span", { className: "footnote text-(--color-secondary)", children: percentageLabel }) : void 0,
|
|
1092
1143
|
hint,
|
|
1093
1144
|
hideHint,
|
|
1094
1145
|
status,
|
|
1095
1146
|
disabled,
|
|
1096
1147
|
className: cn("w-full", className),
|
|
1097
|
-
children: /* @__PURE__ */
|
|
1148
|
+
children: /* @__PURE__ */ jsx18(
|
|
1098
1149
|
"div",
|
|
1099
1150
|
{
|
|
1100
1151
|
ref,
|
|
@@ -1104,7 +1155,7 @@ var Progress = React15.forwardRef(
|
|
|
1104
1155
|
"aria-valuemax": 100,
|
|
1105
1156
|
"aria-label": resolvedAriaLabel,
|
|
1106
1157
|
...rest,
|
|
1107
|
-
children: /* @__PURE__ */
|
|
1158
|
+
children: /* @__PURE__ */ jsx18(
|
|
1108
1159
|
"div",
|
|
1109
1160
|
{
|
|
1110
1161
|
className: cn(
|
|
@@ -1112,7 +1163,7 @@ var Progress = React15.forwardRef(
|
|
|
1112
1163
|
barHeightClasses,
|
|
1113
1164
|
disabled && "opacity-50"
|
|
1114
1165
|
),
|
|
1115
|
-
children: /* @__PURE__ */
|
|
1166
|
+
children: /* @__PURE__ */ jsx18(
|
|
1116
1167
|
"div",
|
|
1117
1168
|
{
|
|
1118
1169
|
className: cn(
|
|
@@ -1134,8 +1185,8 @@ var Progress = React15.forwardRef(
|
|
|
1134
1185
|
Progress.displayName = "Progress";
|
|
1135
1186
|
|
|
1136
1187
|
// src/components/Content/StatusAvatar.tsx
|
|
1137
|
-
import * as
|
|
1138
|
-
import { cva as
|
|
1188
|
+
import * as React17 from "react";
|
|
1189
|
+
import { cva as cva11 } from "class-variance-authority";
|
|
1139
1190
|
import {
|
|
1140
1191
|
BookmarkCheckIcon,
|
|
1141
1192
|
CheckIcon,
|
|
@@ -1143,8 +1194,8 @@ import {
|
|
|
1143
1194
|
PlusIcon,
|
|
1144
1195
|
StarIcon
|
|
1145
1196
|
} from "@bubo-squared/icons";
|
|
1146
|
-
import { jsx as
|
|
1147
|
-
var iconStatusVariants =
|
|
1197
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1198
|
+
var iconStatusVariants = cva11(
|
|
1148
1199
|
"inline-flex size-5 items-center justify-center rounded-full border-1 border-(--color-primary-inverse) p-1",
|
|
1149
1200
|
{
|
|
1150
1201
|
variants: {
|
|
@@ -1168,11 +1219,11 @@ var presenceDotByVariant = {
|
|
|
1168
1219
|
away: "bg-(--background-warning) border-1 border-(--color-primary-inverse)",
|
|
1169
1220
|
busy: "bg-(--background-error) border-1 border-(--color-primary-inverse)"
|
|
1170
1221
|
};
|
|
1171
|
-
var StatusAvatar =
|
|
1222
|
+
var StatusAvatar = React17.forwardRef((props, ref) => {
|
|
1172
1223
|
const { variant = "verified", className, ...rest } = props;
|
|
1173
1224
|
if (variant === "offline" || variant === "online" || variant === "away" || variant === "busy") {
|
|
1174
1225
|
const dotClasses = presenceDotByVariant[variant];
|
|
1175
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ jsx19(
|
|
1176
1227
|
"div",
|
|
1177
1228
|
{
|
|
1178
1229
|
ref,
|
|
@@ -1181,7 +1232,7 @@ var StatusAvatar = React16.forwardRef((props, ref) => {
|
|
|
1181
1232
|
className
|
|
1182
1233
|
),
|
|
1183
1234
|
...rest,
|
|
1184
|
-
children: /* @__PURE__ */
|
|
1235
|
+
children: /* @__PURE__ */ jsx19("div", { className: cn(dotClasses, "size-3.5 rounded-full") })
|
|
1185
1236
|
}
|
|
1186
1237
|
);
|
|
1187
1238
|
}
|
|
@@ -1193,11 +1244,11 @@ var StatusAvatar = React16.forwardRef((props, ref) => {
|
|
|
1193
1244
|
className: cn(iconStatusVariants({ variant: iconVariant }), className),
|
|
1194
1245
|
...rest,
|
|
1195
1246
|
children: [
|
|
1196
|
-
iconVariant === "verified" && /* @__PURE__ */
|
|
1197
|
-
iconVariant === "bookmark" && /* @__PURE__ */
|
|
1198
|
-
iconVariant === "favorite" && /* @__PURE__ */
|
|
1199
|
-
iconVariant === "add" && /* @__PURE__ */
|
|
1200
|
-
iconVariant === "remove" && /* @__PURE__ */
|
|
1247
|
+
iconVariant === "verified" && /* @__PURE__ */ jsx19(CheckIcon, { className: "size-3 text-button-white" }),
|
|
1248
|
+
iconVariant === "bookmark" && /* @__PURE__ */ jsx19(BookmarkCheckIcon, { className: "size-3 text-button-white" }),
|
|
1249
|
+
iconVariant === "favorite" && /* @__PURE__ */ jsx19(StarIcon, { className: "size-3 text-button-white" }),
|
|
1250
|
+
iconVariant === "add" && /* @__PURE__ */ jsx19(PlusIcon, { className: "size-3 text-button-white" }),
|
|
1251
|
+
iconVariant === "remove" && /* @__PURE__ */ jsx19(CrossIcon, { className: "size-3 text-button-white" })
|
|
1201
1252
|
]
|
|
1202
1253
|
}
|
|
1203
1254
|
);
|
|
@@ -1205,11 +1256,11 @@ var StatusAvatar = React16.forwardRef((props, ref) => {
|
|
|
1205
1256
|
StatusAvatar.displayName = "StatusAvatar";
|
|
1206
1257
|
|
|
1207
1258
|
// src/components/Content/Tag.tsx
|
|
1208
|
-
import * as
|
|
1209
|
-
import { Slot as
|
|
1210
|
-
import { cva as
|
|
1211
|
-
import { jsx as
|
|
1212
|
-
var tagVariants =
|
|
1259
|
+
import * as React18 from "react";
|
|
1260
|
+
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
1261
|
+
import { cva as cva12 } from "class-variance-authority";
|
|
1262
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1263
|
+
var tagVariants = cva12(
|
|
1213
1264
|
"inline-flex flex-row items-center justify-center rounded-6 gap-2 px-3 overflow-hidden border-1 border-secondary bg-(--background-neutral) focus:border-brand focus-ring-primary ",
|
|
1214
1265
|
{
|
|
1215
1266
|
variants: {
|
|
@@ -1225,7 +1276,7 @@ var tagVariants = cva11(
|
|
|
1225
1276
|
);
|
|
1226
1277
|
var disabledTag = "pointer-events-none border-secondary-disabled bg-(--background-neutral-disabled) text-primary-disabled";
|
|
1227
1278
|
var iconClasses = "flex items-center justify-center w-5 h-5 [&>*]:w-5 [&>*]:h-5 shrink-0 text-primary";
|
|
1228
|
-
var Tag =
|
|
1279
|
+
var Tag = React18.forwardRef(
|
|
1229
1280
|
(props, ref) => {
|
|
1230
1281
|
const {
|
|
1231
1282
|
size = "sm",
|
|
@@ -1237,9 +1288,9 @@ var Tag = React17.forwardRef(
|
|
|
1237
1288
|
...rest
|
|
1238
1289
|
} = props;
|
|
1239
1290
|
const hasValue = typeof value === "string" ? value.trim() !== "" : value != null;
|
|
1240
|
-
const Comp = asChild ?
|
|
1241
|
-
const leading = props.leadingIcon &&
|
|
1242
|
-
const trailing = props.trailingIcon &&
|
|
1291
|
+
const Comp = asChild ? Slot5 : "div";
|
|
1292
|
+
const leading = props.leadingIcon && React18.isValidElement(props.leadingIcon) ? React18.cloneElement(props.leadingIcon, { disabled, ...props.leadingIcon.props }) : null;
|
|
1293
|
+
const trailing = props.trailingIcon && React18.isValidElement(props.trailingIcon) ? React18.cloneElement(props.trailingIcon, { disabled, ...props.trailingIcon.props }) : null;
|
|
1243
1294
|
return /* @__PURE__ */ jsxs11(
|
|
1244
1295
|
Comp,
|
|
1245
1296
|
{
|
|
@@ -1247,13 +1298,13 @@ var Tag = React17.forwardRef(
|
|
|
1247
1298
|
ref,
|
|
1248
1299
|
...rest,
|
|
1249
1300
|
children: [
|
|
1250
|
-
leading && /* @__PURE__ */
|
|
1301
|
+
leading && /* @__PURE__ */ jsx20("div", { className: iconClasses, children: leading }),
|
|
1251
1302
|
hasValue ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-row gap-1 items-center", children: [
|
|
1252
|
-
/* @__PURE__ */
|
|
1253
|
-
/* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
] }) : /* @__PURE__ */
|
|
1256
|
-
trailing && /* @__PURE__ */
|
|
1303
|
+
/* @__PURE__ */ jsx20("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: label }),
|
|
1304
|
+
/* @__PURE__ */ jsx20("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: ":" }),
|
|
1305
|
+
/* @__PURE__ */ jsx20("span", { className: "text-primary paragraph-lg-medium mb-0! cursor-default font-medium", children: value })
|
|
1306
|
+
] }) : /* @__PURE__ */ jsx20("span", { className: "text-primary paragraph-lg mb-0! cursor-default", children: label }),
|
|
1307
|
+
trailing && /* @__PURE__ */ jsx20("div", { className: iconClasses, children: trailing })
|
|
1257
1308
|
]
|
|
1258
1309
|
}
|
|
1259
1310
|
);
|
|
@@ -1264,15 +1315,15 @@ var Tag = React17.forwardRef(
|
|
|
1264
1315
|
import "react";
|
|
1265
1316
|
|
|
1266
1317
|
// src/components/ui/dropdown-menu.tsx
|
|
1267
|
-
import * as
|
|
1318
|
+
import * as React19 from "react";
|
|
1268
1319
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1269
1320
|
import { ChevronRightIcon } from "@bubo-squared/icons";
|
|
1270
1321
|
|
|
1271
1322
|
// src/components/ui/dropdown-styles.ts
|
|
1272
|
-
import { cva as
|
|
1323
|
+
import { cva as cva13 } from "class-variance-authority";
|
|
1273
1324
|
var dropdownSurfaceClass = "z-50 rounded-4 border border-secondary-hover bg-(--background-neutral) shadow-card-md";
|
|
1274
1325
|
var dropdownScrollClass = "max-h-79 overflow-y-auto dropdown-scrollbar";
|
|
1275
|
-
var dropdownRowVariants =
|
|
1326
|
+
var dropdownRowVariants = cva13(
|
|
1276
1327
|
"flex w-full items-center gap-2 pl-(--space-8) pr-(--space-16) text-left text-primary cursor-pointer hover:bg-(--background-secondary)",
|
|
1277
1328
|
{
|
|
1278
1329
|
variants: {
|
|
@@ -1293,26 +1344,26 @@ var dropdownRowVariants = cva12(
|
|
|
1293
1344
|
);
|
|
1294
1345
|
|
|
1295
1346
|
// src/components/ui/dropdown-menu.tsx
|
|
1296
|
-
import { jsx as
|
|
1297
|
-
var DropdownMenuSizeContext =
|
|
1347
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1348
|
+
var DropdownMenuSizeContext = React19.createContext("lg");
|
|
1298
1349
|
function useDropdownMenuSize(explicitSize) {
|
|
1299
|
-
const contextSize =
|
|
1350
|
+
const contextSize = React19.useContext(DropdownMenuSizeContext);
|
|
1300
1351
|
return explicitSize ?? contextSize;
|
|
1301
1352
|
}
|
|
1302
1353
|
function DropdownMenu({
|
|
1303
1354
|
...props
|
|
1304
1355
|
}) {
|
|
1305
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ jsx21(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
1306
1357
|
}
|
|
1307
1358
|
function DropdownMenuPortal({
|
|
1308
1359
|
...props
|
|
1309
1360
|
}) {
|
|
1310
|
-
return /* @__PURE__ */
|
|
1361
|
+
return /* @__PURE__ */ jsx21(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
1311
1362
|
}
|
|
1312
1363
|
function DropdownMenuTrigger({
|
|
1313
1364
|
...props
|
|
1314
1365
|
}) {
|
|
1315
|
-
return /* @__PURE__ */
|
|
1366
|
+
return /* @__PURE__ */ jsx21(
|
|
1316
1367
|
DropdownMenuPrimitive.Trigger,
|
|
1317
1368
|
{
|
|
1318
1369
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -1326,7 +1377,7 @@ function DropdownMenuContent({
|
|
|
1326
1377
|
size = "lg",
|
|
1327
1378
|
...props
|
|
1328
1379
|
}) {
|
|
1329
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ jsx21(DropdownMenuSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx21(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx21(
|
|
1330
1381
|
DropdownMenuPrimitive.Content,
|
|
1331
1382
|
{
|
|
1332
1383
|
"data-slot": "dropdown-menu-content",
|
|
@@ -1344,7 +1395,7 @@ function DropdownMenuContent({
|
|
|
1344
1395
|
function DropdownMenuGroup({
|
|
1345
1396
|
...props
|
|
1346
1397
|
}) {
|
|
1347
|
-
return /* @__PURE__ */
|
|
1398
|
+
return /* @__PURE__ */ jsx21(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
1348
1399
|
}
|
|
1349
1400
|
function DropdownMenuItem({
|
|
1350
1401
|
className,
|
|
@@ -1354,7 +1405,7 @@ function DropdownMenuItem({
|
|
|
1354
1405
|
...props
|
|
1355
1406
|
}) {
|
|
1356
1407
|
const resolvedSize = useDropdownMenuSize(size);
|
|
1357
|
-
return /* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ jsx21(
|
|
1358
1409
|
DropdownMenuPrimitive.Item,
|
|
1359
1410
|
{
|
|
1360
1411
|
"data-slot": "dropdown-menu-item",
|
|
@@ -1379,7 +1430,7 @@ function DropdownMenuLabel({
|
|
|
1379
1430
|
...props
|
|
1380
1431
|
}) {
|
|
1381
1432
|
const resolvedSize = useDropdownMenuSize(size);
|
|
1382
|
-
return /* @__PURE__ */
|
|
1433
|
+
return /* @__PURE__ */ jsx21(
|
|
1383
1434
|
DropdownMenuPrimitive.Label,
|
|
1384
1435
|
{
|
|
1385
1436
|
"data-slot": "dropdown-menu-label",
|
|
@@ -1397,7 +1448,7 @@ function DropdownMenuSeparator({
|
|
|
1397
1448
|
className,
|
|
1398
1449
|
...props
|
|
1399
1450
|
}) {
|
|
1400
|
-
return /* @__PURE__ */
|
|
1451
|
+
return /* @__PURE__ */ jsx21(
|
|
1401
1452
|
DropdownMenuPrimitive.Separator,
|
|
1402
1453
|
{
|
|
1403
1454
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -1410,7 +1461,7 @@ function DropdownMenuShortcut({
|
|
|
1410
1461
|
className,
|
|
1411
1462
|
...props
|
|
1412
1463
|
}) {
|
|
1413
|
-
return /* @__PURE__ */
|
|
1464
|
+
return /* @__PURE__ */ jsx21(
|
|
1414
1465
|
"span",
|
|
1415
1466
|
{
|
|
1416
1467
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -1425,7 +1476,7 @@ function DropdownMenuShortcut({
|
|
|
1425
1476
|
function DropdownMenuSub({
|
|
1426
1477
|
...props
|
|
1427
1478
|
}) {
|
|
1428
|
-
return /* @__PURE__ */
|
|
1479
|
+
return /* @__PURE__ */ jsx21(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
1429
1480
|
}
|
|
1430
1481
|
function DropdownMenuSubTrigger({
|
|
1431
1482
|
className,
|
|
@@ -1451,7 +1502,7 @@ function DropdownMenuSubTrigger({
|
|
|
1451
1502
|
...props,
|
|
1452
1503
|
children: [
|
|
1453
1504
|
children,
|
|
1454
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ jsx21(ChevronRightIcon, { className: "ml-auto size-4 text-(--icon-primary)" })
|
|
1455
1506
|
]
|
|
1456
1507
|
}
|
|
1457
1508
|
);
|
|
@@ -1462,7 +1513,7 @@ function DropdownMenuSubContent({
|
|
|
1462
1513
|
...props
|
|
1463
1514
|
}) {
|
|
1464
1515
|
const resolvedSize = useDropdownMenuSize(size);
|
|
1465
|
-
return /* @__PURE__ */
|
|
1516
|
+
return /* @__PURE__ */ jsx21(DropdownMenuSizeContext.Provider, { value: resolvedSize, children: /* @__PURE__ */ jsx21(
|
|
1466
1517
|
DropdownMenuPrimitive.SubContent,
|
|
1467
1518
|
{
|
|
1468
1519
|
"data-slot": "dropdown-menu-sub-content",
|
|
@@ -1478,7 +1529,7 @@ function DropdownMenuSubContent({
|
|
|
1478
1529
|
}
|
|
1479
1530
|
|
|
1480
1531
|
// src/components/Content/Menu.tsx
|
|
1481
|
-
import { jsx as
|
|
1532
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1482
1533
|
var Menu = (props) => {
|
|
1483
1534
|
const {
|
|
1484
1535
|
trigger,
|
|
@@ -1493,8 +1544,8 @@ var Menu = (props) => {
|
|
|
1493
1544
|
modal
|
|
1494
1545
|
} = props;
|
|
1495
1546
|
return /* @__PURE__ */ jsxs13(DropdownMenu, { open, onOpenChange, modal, children: [
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ jsx22(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
1548
|
+
/* @__PURE__ */ jsx22(
|
|
1498
1549
|
DropdownMenuContent,
|
|
1499
1550
|
{
|
|
1500
1551
|
align,
|
|
@@ -1519,19 +1570,19 @@ var MenuSubContent = DropdownMenuSubContent;
|
|
|
1519
1570
|
var MenuSubTrigger = DropdownMenuSubTrigger;
|
|
1520
1571
|
|
|
1521
1572
|
// src/components/Inputs/Checkbox.tsx
|
|
1522
|
-
import * as
|
|
1573
|
+
import * as React21 from "react";
|
|
1523
1574
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
1524
1575
|
import { CheckIcon as CheckIcon2 } from "@bubo-squared/icons";
|
|
1525
1576
|
import { MinusIcon } from "@bubo-squared/icons";
|
|
1526
|
-
import { jsx as
|
|
1527
|
-
var Checkbox =
|
|
1577
|
+
import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1578
|
+
var Checkbox = React21.forwardRef(({ label, className, ...props }, forwardedRef) => {
|
|
1528
1579
|
return /* @__PURE__ */ jsxs14("label", { className: "inline-flex items-center gap-(--space-12) cursor-pointer select-none", children: [
|
|
1529
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ jsx23(
|
|
1530
1581
|
CheckboxPrimitive.Root,
|
|
1531
1582
|
{
|
|
1532
1583
|
ref: forwardedRef,
|
|
1533
1584
|
className: cn(
|
|
1534
|
-
"group flex h-5 w-5 items-center justify-center rounded-
|
|
1585
|
+
"group flex h-5 w-5 items-center justify-center rounded-4 border border-secondary bg-(--background-neutral) text-primary-inverse",
|
|
1535
1586
|
"data-[state=checked]:bg-(--background-brand) data-[state=checked]:text-button-white data-[state=checked]:border-none",
|
|
1536
1587
|
"data-[state=indeterminate]:bg-(--background-brand) data-[state=indeterminate]:text-button-white data-[state=indeterminate]:border-none",
|
|
1537
1588
|
"data-[state=checked]:hover:bg-(--background-brand-hover) data-[state=indeterminate]:hover:bg-(--background-brand-hover)",
|
|
@@ -1544,26 +1595,26 @@ var Checkbox = React20.forwardRef(({ label, className, ...props }, forwardedRef)
|
|
|
1544
1595
|
),
|
|
1545
1596
|
...props,
|
|
1546
1597
|
children: /* @__PURE__ */ jsxs14(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1598
|
+
/* @__PURE__ */ jsx23(CheckIcon2, { className: "h-5 w-5 hidden group-data-[state=checked]:block" }),
|
|
1599
|
+
/* @__PURE__ */ jsx23(MinusIcon, { className: "h-5 w-5 hidden group-data-[state=indeterminate]:block" })
|
|
1549
1600
|
] })
|
|
1550
1601
|
}
|
|
1551
1602
|
),
|
|
1552
|
-
label && /* @__PURE__ */
|
|
1603
|
+
label && /* @__PURE__ */ jsx23("span", { className: "paragraph-md-medium text-primary", children: label })
|
|
1553
1604
|
] });
|
|
1554
1605
|
});
|
|
1555
1606
|
Checkbox.displayName = "Checkbox";
|
|
1556
1607
|
|
|
1557
1608
|
// src/components/Inputs/Autocomplete.tsx
|
|
1558
|
-
import * as
|
|
1559
|
-
import { cva as
|
|
1609
|
+
import * as React24 from "react";
|
|
1610
|
+
import { cva as cva15 } from "class-variance-authority";
|
|
1560
1611
|
|
|
1561
1612
|
// src/components/Inputs/InputShell.tsx
|
|
1562
|
-
import * as
|
|
1563
|
-
import { cva as
|
|
1564
|
-
import { jsx as
|
|
1565
|
-
var inputShellVariants =
|
|
1566
|
-
"group flex w-full items-center rounded-
|
|
1613
|
+
import * as React22 from "react";
|
|
1614
|
+
import { cva as cva14 } from "class-variance-authority";
|
|
1615
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1616
|
+
var inputShellVariants = cva14(
|
|
1617
|
+
"group flex w-full items-center rounded-8 border bg-(--background-primary) text-left cursor-text border-secondary",
|
|
1567
1618
|
{
|
|
1568
1619
|
variants: {
|
|
1569
1620
|
size: {
|
|
@@ -1587,9 +1638,9 @@ var inputShellVariants = cva13(
|
|
|
1587
1638
|
}
|
|
1588
1639
|
}
|
|
1589
1640
|
);
|
|
1590
|
-
var InputShell =
|
|
1641
|
+
var InputShell = React22.forwardRef(
|
|
1591
1642
|
({ size = "md", status, disabled, className, ...rest }, ref) => {
|
|
1592
|
-
return /* @__PURE__ */
|
|
1643
|
+
return /* @__PURE__ */ jsx24(
|
|
1593
1644
|
"div",
|
|
1594
1645
|
{
|
|
1595
1646
|
ref,
|
|
@@ -1606,14 +1657,14 @@ var InputShell = React21.forwardRef(
|
|
|
1606
1657
|
InputShell.displayName = "InputShell";
|
|
1607
1658
|
|
|
1608
1659
|
// src/components/ui/input.tsx
|
|
1609
|
-
import * as
|
|
1610
|
-
import { jsx as
|
|
1611
|
-
var Input =
|
|
1660
|
+
import * as React23 from "react";
|
|
1661
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1662
|
+
var Input = React23.forwardRef(
|
|
1612
1663
|
({ className, type, variant = "default", ...props }, ref) => {
|
|
1613
1664
|
const base = "text-primary placeholder:text-(--color-secondary) disabled:text-primary-disabled disabled:placeholder:text-primary-disabled selection:bg-primary selection:text-primary-foreground file:text-foreground";
|
|
1614
1665
|
const defaultStyles = "dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 shadow-xs transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 focus-visible:border-ring focus-visible:ring-0 focus-visible:shadow-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive";
|
|
1615
1666
|
const bareStyles = "bg-transparent outline-none w-full";
|
|
1616
|
-
return /* @__PURE__ */
|
|
1667
|
+
return /* @__PURE__ */ jsx25(
|
|
1617
1668
|
"input",
|
|
1618
1669
|
{
|
|
1619
1670
|
ref,
|
|
@@ -1632,8 +1683,8 @@ var Input = React22.forwardRef(
|
|
|
1632
1683
|
Input.displayName = "Input";
|
|
1633
1684
|
|
|
1634
1685
|
// src/components/Inputs/Autocomplete.tsx
|
|
1635
|
-
import { jsx as
|
|
1636
|
-
var inputTextVariants =
|
|
1686
|
+
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1687
|
+
var inputTextVariants = cva15("truncate", {
|
|
1637
1688
|
variants: {
|
|
1638
1689
|
size: {
|
|
1639
1690
|
sm: "paragraph-md",
|
|
@@ -1646,7 +1697,7 @@ var inputTextVariants = cva14("truncate", {
|
|
|
1646
1697
|
size: "lg"
|
|
1647
1698
|
}
|
|
1648
1699
|
});
|
|
1649
|
-
var optionVariants =
|
|
1700
|
+
var optionVariants = cva15(
|
|
1650
1701
|
"w-full text-left hover:bg-(--background-secondary)",
|
|
1651
1702
|
{
|
|
1652
1703
|
variants: {
|
|
@@ -1666,7 +1717,7 @@ var optionVariants = cva14(
|
|
|
1666
1717
|
}
|
|
1667
1718
|
}
|
|
1668
1719
|
);
|
|
1669
|
-
var iconWrapperVariants =
|
|
1720
|
+
var iconWrapperVariants = cva15(
|
|
1670
1721
|
"flex items-center justify-center shrink-0 text-(--icon-primary)",
|
|
1671
1722
|
{
|
|
1672
1723
|
variants: {
|
|
@@ -1685,7 +1736,7 @@ var iconWrapperVariants = cva14(
|
|
|
1685
1736
|
}
|
|
1686
1737
|
}
|
|
1687
1738
|
);
|
|
1688
|
-
var Autocomplete =
|
|
1739
|
+
var Autocomplete = React24.forwardRef((props, forwardedRef) => {
|
|
1689
1740
|
const {
|
|
1690
1741
|
label,
|
|
1691
1742
|
hint,
|
|
@@ -1717,17 +1768,17 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1717
1768
|
...inputProps
|
|
1718
1769
|
} = props;
|
|
1719
1770
|
const isValueControlled = value !== void 0;
|
|
1720
|
-
const [internalValue, setInternalValue] =
|
|
1771
|
+
const [internalValue, setInternalValue] = React24.useState(
|
|
1721
1772
|
defaultValue ?? ""
|
|
1722
1773
|
);
|
|
1723
1774
|
const isInputControlled = inputValue !== void 0;
|
|
1724
|
-
const [internalInputValue, setInternalInputValue] =
|
|
1775
|
+
const [internalInputValue, setInternalInputValue] = React24.useState(
|
|
1725
1776
|
defaultInputValue ?? ""
|
|
1726
1777
|
);
|
|
1727
|
-
const [isFocused, setIsFocused] =
|
|
1728
|
-
const [activeIndex, setActiveIndex] =
|
|
1729
|
-
const inputRef =
|
|
1730
|
-
const setInputRef =
|
|
1778
|
+
const [isFocused, setIsFocused] = React24.useState(false);
|
|
1779
|
+
const [activeIndex, setActiveIndex] = React24.useState(-1);
|
|
1780
|
+
const inputRef = React24.useRef(null);
|
|
1781
|
+
const setInputRef = React24.useCallback(
|
|
1731
1782
|
(node) => {
|
|
1732
1783
|
inputRef.current = node;
|
|
1733
1784
|
if (!forwardedRef) return;
|
|
@@ -1739,12 +1790,12 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1739
1790
|
},
|
|
1740
1791
|
[forwardedRef]
|
|
1741
1792
|
);
|
|
1742
|
-
const baseId =
|
|
1793
|
+
const baseId = React24.useId();
|
|
1743
1794
|
const inputId = id ?? baseId;
|
|
1744
1795
|
const listboxId = `${inputId}-listbox`;
|
|
1745
1796
|
const currentValue = (isValueControlled ? value : internalValue) ?? "";
|
|
1746
1797
|
const currentInput = (isInputControlled ? inputValue : internalInputValue) ?? "";
|
|
1747
|
-
|
|
1798
|
+
React24.useEffect(() => {
|
|
1748
1799
|
if (isFocused) return;
|
|
1749
1800
|
if (isInputControlled) return;
|
|
1750
1801
|
if (!isValueControlled) return;
|
|
@@ -1863,7 +1914,7 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1863
1914
|
const activeDescendantId = activeIndex >= 0 ? `${inputId}-option-${activeIndex}` : void 0;
|
|
1864
1915
|
const showLeadingIcon = !!leadingIcon;
|
|
1865
1916
|
const showTrailingIcon = !!trailingIcon;
|
|
1866
|
-
return /* @__PURE__ */
|
|
1917
|
+
return /* @__PURE__ */ jsx26(Field, { label, hint, hideHint, status, disabled, children: /* @__PURE__ */ jsxs15("div", { className: "relative w-full", children: [
|
|
1867
1918
|
/* @__PURE__ */ jsxs15(
|
|
1868
1919
|
InputShell,
|
|
1869
1920
|
{
|
|
@@ -1873,8 +1924,8 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1873
1924
|
className,
|
|
1874
1925
|
onClick: handleContainerClick,
|
|
1875
1926
|
children: [
|
|
1876
|
-
showLeadingIcon && /* @__PURE__ */
|
|
1877
|
-
/* @__PURE__ */
|
|
1927
|
+
showLeadingIcon && /* @__PURE__ */ jsx26("span", { className: cn(iconWrapperVariants({ size, disabled: !!disabled })), children: leadingIcon }),
|
|
1928
|
+
/* @__PURE__ */ jsx26(
|
|
1878
1929
|
Input,
|
|
1879
1930
|
{
|
|
1880
1931
|
ref: setInputRef,
|
|
@@ -1897,11 +1948,11 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1897
1948
|
...inputProps
|
|
1898
1949
|
}
|
|
1899
1950
|
),
|
|
1900
|
-
showTrailingIcon && /* @__PURE__ */
|
|
1951
|
+
showTrailingIcon && /* @__PURE__ */ jsx26("span", { className: cn(iconWrapperVariants({ size, disabled: !!disabled })), children: trailingIcon })
|
|
1901
1952
|
]
|
|
1902
1953
|
}
|
|
1903
1954
|
),
|
|
1904
|
-
showDropdown && /* @__PURE__ */
|
|
1955
|
+
showDropdown && /* @__PURE__ */ jsx26(
|
|
1905
1956
|
"div",
|
|
1906
1957
|
{
|
|
1907
1958
|
className: cn(
|
|
@@ -1910,27 +1961,27 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1910
1961
|
dropdownScrollClass,
|
|
1911
1962
|
dropdownClassName
|
|
1912
1963
|
),
|
|
1913
|
-
children: loading ? /* @__PURE__ */
|
|
1964
|
+
children: loading ? /* @__PURE__ */ jsx26(
|
|
1914
1965
|
"div",
|
|
1915
1966
|
{
|
|
1916
1967
|
className: cn(optionVariants({ size }), "px-(--space-8) pr-(--space-16) text-secondary"),
|
|
1917
1968
|
"aria-live": "polite",
|
|
1918
1969
|
children: loadingText
|
|
1919
1970
|
}
|
|
1920
|
-
) : options.length === 0 ? /* @__PURE__ */
|
|
1971
|
+
) : options.length === 0 ? /* @__PURE__ */ jsx26(
|
|
1921
1972
|
"div",
|
|
1922
1973
|
{
|
|
1923
1974
|
className: cn(optionVariants({ size }), "px-(--space-8) pr-(--space-16) text-secondary"),
|
|
1924
1975
|
"aria-live": "polite",
|
|
1925
1976
|
children: noOptionsText
|
|
1926
1977
|
}
|
|
1927
|
-
) : /* @__PURE__ */
|
|
1978
|
+
) : /* @__PURE__ */ jsx26(
|
|
1928
1979
|
"ul",
|
|
1929
1980
|
{
|
|
1930
1981
|
id: listboxId,
|
|
1931
1982
|
role: "listbox",
|
|
1932
1983
|
className: cn("flex flex-col", listboxClassName),
|
|
1933
|
-
children: options.map((option, index) => /* @__PURE__ */
|
|
1984
|
+
children: options.map((option, index) => /* @__PURE__ */ jsx26(
|
|
1934
1985
|
"li",
|
|
1935
1986
|
{
|
|
1936
1987
|
id: `${inputId}-option-${index}`,
|
|
@@ -1956,13 +2007,13 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
|
|
|
1956
2007
|
Autocomplete.displayName = "Autocomplete";
|
|
1957
2008
|
|
|
1958
2009
|
// src/components/Inputs/Select.tsx
|
|
1959
|
-
import * as
|
|
2010
|
+
import * as React25 from "react";
|
|
1960
2011
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1961
|
-
import { cva as
|
|
2012
|
+
import { cva as cva16 } from "class-variance-authority";
|
|
1962
2013
|
import { ChevronDownIcon as ChevronDownIcon2 } from "@bubo-squared/icons";
|
|
1963
|
-
import { jsx as
|
|
1964
|
-
var selectTriggerVariants =
|
|
1965
|
-
"group flex w-full items-center justify-between rounded-
|
|
2014
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2015
|
+
var selectTriggerVariants = cva16(
|
|
2016
|
+
"group flex w-full items-center justify-between rounded-8 border bg-(--background-primary) p-2 text-left transition-[background-color] cursor-pointer hover:bg-(--background-primary-hover) disabled:bg-(--background-primary-disabled) disabled:text-primary-disabled disabled:cursor-default",
|
|
1966
2017
|
{
|
|
1967
2018
|
variants: {
|
|
1968
2019
|
size: {
|
|
@@ -1983,7 +2034,7 @@ var selectTriggerVariants = cva15(
|
|
|
1983
2034
|
}
|
|
1984
2035
|
}
|
|
1985
2036
|
);
|
|
1986
|
-
var textVariants =
|
|
2037
|
+
var textVariants = cva16("truncate", {
|
|
1987
2038
|
variants: {
|
|
1988
2039
|
size: {
|
|
1989
2040
|
sm: "paragraph-md",
|
|
@@ -2004,7 +2055,7 @@ var textVariants = cva15("truncate", {
|
|
|
2004
2055
|
hasValue: false
|
|
2005
2056
|
}
|
|
2006
2057
|
});
|
|
2007
|
-
var selectIconVariants =
|
|
2058
|
+
var selectIconVariants = cva16("flex items-center justify-center shrink-0", {
|
|
2008
2059
|
variants: {
|
|
2009
2060
|
size: {
|
|
2010
2061
|
sm: "size-4",
|
|
@@ -2022,7 +2073,7 @@ var selectIconVariants = cva15("flex items-center justify-center shrink-0", {
|
|
|
2022
2073
|
disabled: false
|
|
2023
2074
|
}
|
|
2024
2075
|
});
|
|
2025
|
-
var selectButtonVariants =
|
|
2076
|
+
var selectButtonVariants = cva16(
|
|
2026
2077
|
"flex w-full items-center gap-2 pl-(--space-8) pr-(--space-16) text-left paragraph-lg text-primary hover:bg-(--background-secondary)",
|
|
2027
2078
|
{
|
|
2028
2079
|
variants: {
|
|
@@ -2035,7 +2086,7 @@ var selectButtonVariants = cva15(
|
|
|
2035
2086
|
}
|
|
2036
2087
|
}
|
|
2037
2088
|
);
|
|
2038
|
-
var Select =
|
|
2089
|
+
var Select = React25.forwardRef((props, forwardedRef) => {
|
|
2039
2090
|
const {
|
|
2040
2091
|
label = "Field Label",
|
|
2041
2092
|
hint = "This is a hint text to help user.",
|
|
@@ -2056,10 +2107,10 @@ var Select = React24.forwardRef((props, forwardedRef) => {
|
|
|
2056
2107
|
} = props;
|
|
2057
2108
|
const isControlled = value !== void 0;
|
|
2058
2109
|
const controlledValue = value ?? "";
|
|
2059
|
-
const [internalValue, setInternalValue] =
|
|
2110
|
+
const [internalValue, setInternalValue] = React25.useState(
|
|
2060
2111
|
defaultValue ?? ""
|
|
2061
2112
|
);
|
|
2062
|
-
const [open, setOpen] =
|
|
2113
|
+
const [open, setOpen] = React25.useState(false);
|
|
2063
2114
|
const rawValue = isControlled ? controlledValue : internalValue;
|
|
2064
2115
|
const selectedOption = options.find((opt) => opt.value === rawValue);
|
|
2065
2116
|
const currentValue = selectedOption ? selectedOption.value : "";
|
|
@@ -2088,7 +2139,7 @@ var Select = React24.forwardRef((props, forwardedRef) => {
|
|
|
2088
2139
|
setOpen(false);
|
|
2089
2140
|
}
|
|
2090
2141
|
};
|
|
2091
|
-
return /* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ jsx27(
|
|
2092
2143
|
Field,
|
|
2093
2144
|
{
|
|
2094
2145
|
label,
|
|
@@ -2107,7 +2158,7 @@ var Select = React24.forwardRef((props, forwardedRef) => {
|
|
|
2107
2158
|
name,
|
|
2108
2159
|
required,
|
|
2109
2160
|
children: [
|
|
2110
|
-
/* @__PURE__ */
|
|
2161
|
+
/* @__PURE__ */ jsx27(SelectPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs16(
|
|
2111
2162
|
"button",
|
|
2112
2163
|
{
|
|
2113
2164
|
ref: forwardedRef,
|
|
@@ -2129,18 +2180,18 @@ var Select = React24.forwardRef((props, forwardedRef) => {
|
|
|
2129
2180
|
"data-open": isOpen || void 0,
|
|
2130
2181
|
...buttonProps,
|
|
2131
2182
|
children: [
|
|
2132
|
-
/* @__PURE__ */
|
|
2133
|
-
/* @__PURE__ */
|
|
2183
|
+
/* @__PURE__ */ jsx27(SelectPrimitive.Value, { placeholder }),
|
|
2184
|
+
/* @__PURE__ */ jsx27(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx27(
|
|
2134
2185
|
"span",
|
|
2135
2186
|
{
|
|
2136
2187
|
className: cn(selectIconVariants({ size, disabled: !!disabled })),
|
|
2137
|
-
children: /* @__PURE__ */
|
|
2188
|
+
children: /* @__PURE__ */ jsx27(ChevronDownIcon2, {})
|
|
2138
2189
|
}
|
|
2139
2190
|
) })
|
|
2140
2191
|
]
|
|
2141
2192
|
}
|
|
2142
2193
|
) }),
|
|
2143
|
-
/* @__PURE__ */
|
|
2194
|
+
/* @__PURE__ */ jsx27(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx27(
|
|
2144
2195
|
SelectPrimitive.Content,
|
|
2145
2196
|
{
|
|
2146
2197
|
position: "popper",
|
|
@@ -2149,11 +2200,11 @@ var Select = React24.forwardRef((props, forwardedRef) => {
|
|
|
2149
2200
|
className: cn(
|
|
2150
2201
|
dropdownSurfaceClass,
|
|
2151
2202
|
dropdownScrollClass,
|
|
2152
|
-
"min-w-343"
|
|
2203
|
+
"min-w-343 rounded-8"
|
|
2153
2204
|
),
|
|
2154
2205
|
style: { minWidth: "var(--radix-select-trigger-width)" },
|
|
2155
|
-
children: /* @__PURE__ */
|
|
2156
|
-
hasValue && /* @__PURE__ */
|
|
2206
|
+
children: /* @__PURE__ */ jsx27(SelectPrimitive.Viewport, { children: /* @__PURE__ */ jsxs16("div", { className: "flex flex-col", children: [
|
|
2207
|
+
hasValue && /* @__PURE__ */ jsx27("div", { className: cn("bg-(--background-neutral)"), children: /* @__PURE__ */ jsx27(
|
|
2157
2208
|
"button",
|
|
2158
2209
|
{
|
|
2159
2210
|
type: "button",
|
|
@@ -2165,7 +2216,7 @@ var Select = React24.forwardRef((props, forwardedRef) => {
|
|
|
2165
2216
|
children: "Clear"
|
|
2166
2217
|
}
|
|
2167
2218
|
) }),
|
|
2168
|
-
options.map((opt) => /* @__PURE__ */
|
|
2219
|
+
options.map((opt) => /* @__PURE__ */ jsx27(
|
|
2169
2220
|
SelectPrimitive.Item,
|
|
2170
2221
|
{
|
|
2171
2222
|
value: opt.value,
|
|
@@ -2174,7 +2225,7 @@ var Select = React24.forwardRef((props, forwardedRef) => {
|
|
|
2174
2225
|
"data-highlighted:bg-(--background-secondary) data-highlighted:outline-none",
|
|
2175
2226
|
"data-[state=checked]:bg-(--background-secondary)"
|
|
2176
2227
|
),
|
|
2177
|
-
children: /* @__PURE__ */
|
|
2228
|
+
children: /* @__PURE__ */ jsx27("div", { className: selectButtonVariants({ size }), children: /* @__PURE__ */ jsx27(SelectPrimitive.ItemText, { children: opt.label }) })
|
|
2178
2229
|
},
|
|
2179
2230
|
opt.value
|
|
2180
2231
|
))
|
|
@@ -2190,11 +2241,11 @@ var Select = React24.forwardRef((props, forwardedRef) => {
|
|
|
2190
2241
|
Select.displayName = "Select";
|
|
2191
2242
|
|
|
2192
2243
|
// src/components/Inputs/PasswordInput.tsx
|
|
2193
|
-
import * as
|
|
2194
|
-
import { cva as
|
|
2244
|
+
import * as React26 from "react";
|
|
2245
|
+
import { cva as cva17 } from "class-variance-authority";
|
|
2195
2246
|
import { EyeIcon, EyeSlashIcon } from "@bubo-squared/icons";
|
|
2196
|
-
import { jsx as
|
|
2197
|
-
var passwordTextVariants =
|
|
2247
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2248
|
+
var passwordTextVariants = cva17("truncate", {
|
|
2198
2249
|
variants: {
|
|
2199
2250
|
size: {
|
|
2200
2251
|
sm: "paragraph-md",
|
|
@@ -2212,7 +2263,7 @@ var passwordTextVariants = cva16("truncate", {
|
|
|
2212
2263
|
disabled: false
|
|
2213
2264
|
}
|
|
2214
2265
|
});
|
|
2215
|
-
var iconWrapperVariants2 =
|
|
2266
|
+
var iconWrapperVariants2 = cva17(
|
|
2216
2267
|
"flex items-center justify-center shrink-0 text-(--icon-primary)",
|
|
2217
2268
|
{
|
|
2218
2269
|
variants: {
|
|
@@ -2231,7 +2282,7 @@ var iconWrapperVariants2 = cva16(
|
|
|
2231
2282
|
}
|
|
2232
2283
|
}
|
|
2233
2284
|
);
|
|
2234
|
-
var actionButtonVariants =
|
|
2285
|
+
var actionButtonVariants = cva17(
|
|
2235
2286
|
"flex items-center justify-center shrink-0 cursor-pointer bg-transparent border-0 p-0 text-left paragraph-sm text-(--icon-primary) hover:text-(--icon-primary-hover) focus:outline-none ",
|
|
2236
2287
|
{
|
|
2237
2288
|
variants: {
|
|
@@ -2250,7 +2301,7 @@ var actionButtonVariants = cva16(
|
|
|
2250
2301
|
}
|
|
2251
2302
|
}
|
|
2252
2303
|
);
|
|
2253
|
-
var PasswordInput =
|
|
2304
|
+
var PasswordInput = React26.forwardRef((props, forwardedRef) => {
|
|
2254
2305
|
const {
|
|
2255
2306
|
label,
|
|
2256
2307
|
hint,
|
|
@@ -2268,13 +2319,13 @@ var PasswordInput = React25.forwardRef((props, forwardedRef) => {
|
|
|
2268
2319
|
...inputProps
|
|
2269
2320
|
} = props;
|
|
2270
2321
|
const isControlled = value !== void 0;
|
|
2271
|
-
const [internalValue, setInternalValue] =
|
|
2322
|
+
const [internalValue, setInternalValue] = React26.useState(
|
|
2272
2323
|
defaultValue ?? ""
|
|
2273
2324
|
);
|
|
2274
|
-
const [isRevealed, setIsRevealed] =
|
|
2325
|
+
const [isRevealed, setIsRevealed] = React26.useState(false);
|
|
2275
2326
|
const currentValue = (isControlled ? value : internalValue) ?? "";
|
|
2276
|
-
const inputRef =
|
|
2277
|
-
const setInputRef =
|
|
2327
|
+
const inputRef = React26.useRef(null);
|
|
2328
|
+
const setInputRef = React26.useCallback(
|
|
2278
2329
|
(node) => {
|
|
2279
2330
|
inputRef.current = node;
|
|
2280
2331
|
if (!forwardedRef) return;
|
|
@@ -2297,7 +2348,7 @@ var PasswordInput = React25.forwardRef((props, forwardedRef) => {
|
|
|
2297
2348
|
}
|
|
2298
2349
|
onChange?.(event);
|
|
2299
2350
|
};
|
|
2300
|
-
return /* @__PURE__ */
|
|
2351
|
+
return /* @__PURE__ */ jsx28(
|
|
2301
2352
|
Field,
|
|
2302
2353
|
{
|
|
2303
2354
|
label,
|
|
@@ -2314,7 +2365,7 @@ var PasswordInput = React25.forwardRef((props, forwardedRef) => {
|
|
|
2314
2365
|
className,
|
|
2315
2366
|
onClick: handleContainerClick,
|
|
2316
2367
|
children: [
|
|
2317
|
-
showLeadingIcon && /* @__PURE__ */
|
|
2368
|
+
showLeadingIcon && /* @__PURE__ */ jsx28(
|
|
2318
2369
|
"span",
|
|
2319
2370
|
{
|
|
2320
2371
|
className: cn(
|
|
@@ -2323,7 +2374,7 @@ var PasswordInput = React25.forwardRef((props, forwardedRef) => {
|
|
|
2323
2374
|
children: leadingIcon
|
|
2324
2375
|
}
|
|
2325
2376
|
),
|
|
2326
|
-
/* @__PURE__ */
|
|
2377
|
+
/* @__PURE__ */ jsx28(
|
|
2327
2378
|
Input,
|
|
2328
2379
|
{
|
|
2329
2380
|
ref: setInputRef,
|
|
@@ -2338,7 +2389,7 @@ var PasswordInput = React25.forwardRef((props, forwardedRef) => {
|
|
|
2338
2389
|
...inputProps
|
|
2339
2390
|
}
|
|
2340
2391
|
),
|
|
2341
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ jsx28(
|
|
2342
2393
|
"button",
|
|
2343
2394
|
{
|
|
2344
2395
|
type: "button",
|
|
@@ -2353,7 +2404,7 @@ var PasswordInput = React25.forwardRef((props, forwardedRef) => {
|
|
|
2353
2404
|
"cursor-pointer",
|
|
2354
2405
|
variant === "text" ? actionButtonVariants({ size, disabled: !!disabled }) : iconWrapperVariants2({ size, disabled: !!disabled })
|
|
2355
2406
|
),
|
|
2356
|
-
children: variant === "icon" ? isRevealed ? /* @__PURE__ */
|
|
2407
|
+
children: variant === "icon" ? isRevealed ? /* @__PURE__ */ jsx28(EyeSlashIcon, {}) : /* @__PURE__ */ jsx28(EyeIcon, {}) : isRevealed ? "Hide" : "Show"
|
|
2357
2408
|
}
|
|
2358
2409
|
)
|
|
2359
2410
|
]
|
|
@@ -2370,58 +2421,6 @@ import { CheckIcon as CheckIcon3, CodeIcon } from "@bubo-squared/icons";
|
|
|
2370
2421
|
import * as RPNInput from "react-phone-number-input";
|
|
2371
2422
|
import flags from "react-phone-number-input/flags";
|
|
2372
2423
|
|
|
2373
|
-
// src/components/ui/button.tsx
|
|
2374
|
-
import "react";
|
|
2375
|
-
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
2376
|
-
import { cva as cva17 } from "class-variance-authority";
|
|
2377
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2378
|
-
var buttonVariants2 = cva17(
|
|
2379
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-0 focus-visible:shadow-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
2380
|
-
{
|
|
2381
|
-
variants: {
|
|
2382
|
-
variant: {
|
|
2383
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
2384
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 dark:bg-destructive/60",
|
|
2385
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
2386
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
2387
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
2388
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
2389
|
-
},
|
|
2390
|
-
size: {
|
|
2391
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
2392
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
2393
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
2394
|
-
icon: "size-9",
|
|
2395
|
-
"icon-sm": "size-8",
|
|
2396
|
-
"icon-lg": "size-10"
|
|
2397
|
-
}
|
|
2398
|
-
},
|
|
2399
|
-
defaultVariants: {
|
|
2400
|
-
variant: "default",
|
|
2401
|
-
size: "default"
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
);
|
|
2405
|
-
function Button2({
|
|
2406
|
-
className,
|
|
2407
|
-
variant = "default",
|
|
2408
|
-
size = "default",
|
|
2409
|
-
asChild = false,
|
|
2410
|
-
...props
|
|
2411
|
-
}) {
|
|
2412
|
-
const Comp = asChild ? Slot7 : "button";
|
|
2413
|
-
return /* @__PURE__ */ jsx28(
|
|
2414
|
-
Comp,
|
|
2415
|
-
{
|
|
2416
|
-
"data-slot": "button",
|
|
2417
|
-
"data-variant": variant,
|
|
2418
|
-
"data-size": size,
|
|
2419
|
-
className: cn(buttonVariants2({ variant, size, className })),
|
|
2420
|
-
...props
|
|
2421
|
-
}
|
|
2422
|
-
);
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
2424
|
// src/components/ui/command.tsx
|
|
2426
2425
|
import "react";
|
|
2427
2426
|
import { Command as CommandPrimitive } from "cmdk";
|
|
@@ -2737,7 +2736,7 @@ function ScrollBar({
|
|
|
2737
2736
|
// src/components/Inputs/PhoneInput.tsx
|
|
2738
2737
|
import { cva as cva18 } from "class-variance-authority";
|
|
2739
2738
|
import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2740
|
-
var inputBase = "h-full rounded-
|
|
2739
|
+
var inputBase = "h-full rounded-8 border border-secondary bg-(--background-primary) hover:border-secondary-hover";
|
|
2741
2740
|
var sizeBase = cva18(
|
|
2742
2741
|
"flex w-full",
|
|
2743
2742
|
{
|
|
@@ -2906,11 +2905,11 @@ var CountrySelect = ({
|
|
|
2906
2905
|
},
|
|
2907
2906
|
children: [
|
|
2908
2907
|
/* @__PURE__ */ jsx33(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs21(
|
|
2909
|
-
|
|
2908
|
+
Button,
|
|
2910
2909
|
{
|
|
2911
2910
|
type: "button",
|
|
2912
|
-
variant: "
|
|
2913
|
-
className: cn(inputBase, "flex gap-1
|
|
2911
|
+
variant: "secondary",
|
|
2912
|
+
className: cn(inputBase, "flex items-center justify-center gap-1 px-3 focus:z-10 mr-(--space-12) text-primary-disabled hover:text-(--color-primary-hover) focus:text-(--color-primary-focus)"),
|
|
2914
2913
|
disabled,
|
|
2915
2914
|
children: [
|
|
2916
2915
|
/* @__PURE__ */ jsx33(
|
|
@@ -2937,7 +2936,7 @@ var CountrySelect = ({
|
|
|
2937
2936
|
{
|
|
2938
2937
|
align: "start",
|
|
2939
2938
|
className: cn(
|
|
2940
|
-
"p-0 **:data-[slot='command-input-wrapper']:border-b-(--border-secondary)",
|
|
2939
|
+
"p-0 **:data-[slot='command-input-wrapper']:border-b-(--border-secondary) rounded-8",
|
|
2941
2940
|
dropdownWidthVariants({ size }),
|
|
2942
2941
|
dropdownSurfaceClass
|
|
2943
2942
|
),
|
|
@@ -3633,7 +3632,7 @@ var Slider = React35.forwardRef((props, forwardedRef) => {
|
|
|
3633
3632
|
tabIndex: disabled ? -1 : 0,
|
|
3634
3633
|
className: cn(
|
|
3635
3634
|
"absolute -translate-x-1/2 flex items-center justify-center",
|
|
3636
|
-
"h-8 w-4.5 rounded-
|
|
3635
|
+
"h-8 w-4.5 rounded-8",
|
|
3637
3636
|
"transition-shadow duration-150",
|
|
3638
3637
|
!disabled && (isDragging ? "shadow-[0_0_0_12px_var(--slider-halo-color)]" : "hover:shadow-[0_0_0_8px_var(--slider-halo-color)]"),
|
|
3639
3638
|
disabled ? "bg-(--icon-primary-disabled) cursor-default" : "bg-(--icon-primary-hover) outline-none focus-visible:shadow-[0_0_0_var(--focus-ring-spread)_var(--focus-primary)] cursor-pointer"
|
|
@@ -3711,7 +3710,7 @@ var Slider = React35.forwardRef((props, forwardedRef) => {
|
|
|
3711
3710
|
"div",
|
|
3712
3711
|
{
|
|
3713
3712
|
className: cn(
|
|
3714
|
-
"relative w-full flex items-center rounded-
|
|
3713
|
+
"relative w-full flex items-center rounded-8",
|
|
3715
3714
|
disabled ? "bg-(--background-slider-track-disabled) cursor-default" : "bg-(--background-slider-track) cursor-pointer"
|
|
3716
3715
|
),
|
|
3717
3716
|
style: { height: `${trackHeight}px` },
|
|
@@ -3722,7 +3721,7 @@ var Slider = React35.forwardRef((props, forwardedRef) => {
|
|
|
3722
3721
|
"div",
|
|
3723
3722
|
{
|
|
3724
3723
|
className: cn(
|
|
3725
|
-
"absolute h-full rounded-
|
|
3724
|
+
"absolute h-full rounded-8",
|
|
3726
3725
|
disabled ? "bg-(--background-slider-track-disabled)" : "bg-(--background-slider-track)"
|
|
3727
3726
|
),
|
|
3728
3727
|
style: {
|
|
@@ -3872,7 +3871,7 @@ var TextArea = React36.forwardRef((props, forwardedRef) => {
|
|
|
3872
3871
|
"div",
|
|
3873
3872
|
{
|
|
3874
3873
|
className: cn(
|
|
3875
|
-
"relative flex w-full rounded-
|
|
3874
|
+
"relative flex w-full rounded-8 border bg-(--background-primary) cursor-text",
|
|
3876
3875
|
"border-secondary",
|
|
3877
3876
|
statusShellClass[status],
|
|
3878
3877
|
disabled && "bg-(--background-primary-disabled) border-secondary-disabled cursor-default",
|
|
@@ -4262,6 +4261,7 @@ var Popover2 = (props) => {
|
|
|
4262
4261
|
className,
|
|
4263
4262
|
placement = "bottom",
|
|
4264
4263
|
offset = 10,
|
|
4264
|
+
customContent,
|
|
4265
4265
|
children
|
|
4266
4266
|
} = props;
|
|
4267
4267
|
const hasStrapline = typeof strapline === "string" ? strapline.trim() !== "" : strapline != null;
|
|
@@ -4275,7 +4275,7 @@ var Popover2 = (props) => {
|
|
|
4275
4275
|
onOk?.();
|
|
4276
4276
|
setOpen(false);
|
|
4277
4277
|
};
|
|
4278
|
-
const popoverClasses = "group bg-(--background-popover) popover w-80 max-w-[calc(100vw-2rem)] shadow-card-md border-none [&>span]:scale-240 rounded-
|
|
4278
|
+
const popoverClasses = "group bg-(--background-popover) popover w-80 max-w-[calc(100vw-2rem)] shadow-card-md border-none [&>span]:scale-240 rounded-8";
|
|
4279
4279
|
const popoverArrowClasses = "relative fill-(--background-popover) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=bottom]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=left]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=right]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)]";
|
|
4280
4280
|
const mapPlacementToSideAndAlign2 = (placement2) => {
|
|
4281
4281
|
switch (placement2) {
|
|
@@ -4319,15 +4319,15 @@ var Popover2 = (props) => {
|
|
|
4319
4319
|
className: cn(popoverClasses, className),
|
|
4320
4320
|
children: [
|
|
4321
4321
|
showArrow && /* @__PURE__ */ jsx42(PopoverArrow, { className: popoverArrowClasses }),
|
|
4322
|
-
/* @__PURE__ */ jsxs30("div", { className: "grid gap-4", children: [
|
|
4322
|
+
customContent ? typeof customContent === "function" ? customContent({ close: () => setOpen(false), ok: handleOk, cancel: handleCancel }) : customContent : /* @__PURE__ */ jsxs30("div", { className: "grid gap-4", children: [
|
|
4323
4323
|
/* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
|
|
4324
4324
|
hasStrapline && /* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
|
|
4325
4325
|
/* @__PURE__ */ jsx42("h4", { className: "subtitle-medium text-primary", children: title }),
|
|
4326
4326
|
hasDescription && /* @__PURE__ */ jsx42("p", { className: "paragraph-sm text-primary", children: description })
|
|
4327
4327
|
] }),
|
|
4328
4328
|
/* @__PURE__ */ jsxs30("div", { className: "flex justify-start items-center gap-4 flex-wrap", children: [
|
|
4329
|
-
/* @__PURE__ */ jsx42(
|
|
4330
|
-
/* @__PURE__ */ jsx42(
|
|
4329
|
+
/* @__PURE__ */ jsx42(Button2, { size: "sm", variant: "secondary", onClick: handleCancel, children: cancelText || "Cancel" }),
|
|
4330
|
+
/* @__PURE__ */ jsx42(Button2, { size: "sm", variant: "primary", onClick: handleOk, children: okText || "Ok" })
|
|
4331
4331
|
] })
|
|
4332
4332
|
] })
|
|
4333
4333
|
]
|
|
@@ -4365,7 +4365,7 @@ import * as React43 from "react";
|
|
|
4365
4365
|
|
|
4366
4366
|
// src/components/ui/breadcrumb.tsx
|
|
4367
4367
|
import "react";
|
|
4368
|
-
import { Slot as
|
|
4368
|
+
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
4369
4369
|
import { jsx as jsx44, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4370
4370
|
var breadcrumbItemClasses = "h6-title inline-flex items-center gap-1.5 text-(--color-secondary) hover:text-(--color-primary-hover) focus-within:text-(--color-secondary-focus) [&_[aria-current=page]]:font-medium [&_[aria-current=page]]:text-primary";
|
|
4371
4371
|
var disabledItemClasses = "text-primary-disabled cursor-default pointer-events-none";
|
|
@@ -4452,7 +4452,16 @@ var breadcrumbSeparatorVariants = "size-5 relative bottom-1 [&>svg]:text-seconda
|
|
|
4452
4452
|
var breadcrumbItemBase = "h6-title text-secondary hover:text-primary-hover";
|
|
4453
4453
|
var Breadcrumbs = React43.forwardRef(
|
|
4454
4454
|
(props, ref) => {
|
|
4455
|
-
const {
|
|
4455
|
+
const {
|
|
4456
|
+
separator,
|
|
4457
|
+
ellipsis,
|
|
4458
|
+
children,
|
|
4459
|
+
className,
|
|
4460
|
+
breadcrumbItemClassName,
|
|
4461
|
+
breadcrumbPageClassName,
|
|
4462
|
+
separatorClassName,
|
|
4463
|
+
...rest
|
|
4464
|
+
} = props;
|
|
4456
4465
|
const items = React43.Children.toArray(children).filter(Boolean);
|
|
4457
4466
|
const shouldCollapse = Boolean(ellipsis) && items.length >= 5;
|
|
4458
4467
|
const hiddenItems = shouldCollapse ? items.slice(1, -2) : [];
|
|
@@ -4462,7 +4471,7 @@ var Breadcrumbs = React43.forwardRef(
|
|
|
4462
4471
|
const key = isEllipsis ? "__ellipsis" : React43.isValidElement(child) && child.key != null ? String(child.key) : String(index);
|
|
4463
4472
|
const isLast = index === displayItems.length - 1;
|
|
4464
4473
|
return /* @__PURE__ */ jsxs32(React43.Fragment, { children: [
|
|
4465
|
-
isEllipsis ? /* @__PURE__ */ jsx45(BreadcrumbItem, { className: cn(breadcrumbItemBase,
|
|
4474
|
+
isEllipsis ? /* @__PURE__ */ jsx45(BreadcrumbItem, { className: cn(breadcrumbItemBase, breadcrumbItemClassName), children: /* @__PURE__ */ jsxs32(DropdownMenu, { children: [
|
|
4466
4475
|
/* @__PURE__ */ jsx45(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4467
4476
|
"button",
|
|
4468
4477
|
{
|
|
@@ -4501,14 +4510,14 @@ var Breadcrumbs = React43.forwardRef(
|
|
|
4501
4510
|
}) })
|
|
4502
4511
|
}
|
|
4503
4512
|
)
|
|
4504
|
-
] }) }) : isLast ? /* @__PURE__ */ jsx45(BreadcrumbItem, { className: cn(breadcrumbItemBase,
|
|
4513
|
+
] }) }) : isLast ? /* @__PURE__ */ jsx45(BreadcrumbItem, { className: cn(breadcrumbItemBase, breadcrumbItemClassName), children: /* @__PURE__ */ jsx45(
|
|
4505
4514
|
BreadcrumbPage,
|
|
4506
4515
|
{
|
|
4507
|
-
className: cn("h6-title-medium cursor-pointer",
|
|
4516
|
+
className: cn("h6-title-medium cursor-pointer", breadcrumbPageClassName),
|
|
4508
4517
|
children: child
|
|
4509
4518
|
}
|
|
4510
|
-
) }) : /* @__PURE__ */ jsx45(BreadcrumbItem, { className: cn(breadcrumbItemBase,
|
|
4511
|
-
!isLast && /* @__PURE__ */ jsx45(BreadcrumbSeparator, { className: cn(breadcrumbSeparatorVariants,
|
|
4519
|
+
) }) : /* @__PURE__ */ jsx45(BreadcrumbItem, { className: cn(breadcrumbItemBase, breadcrumbItemClassName), children: child }),
|
|
4520
|
+
!isLast && /* @__PURE__ */ jsx45(BreadcrumbSeparator, { className: cn(breadcrumbSeparatorVariants, separatorClassName), children: separator })
|
|
4512
4521
|
] }, key);
|
|
4513
4522
|
}) }) });
|
|
4514
4523
|
}
|
|
@@ -4623,7 +4632,7 @@ export {
|
|
|
4623
4632
|
BadgeDot,
|
|
4624
4633
|
BadgeStatus,
|
|
4625
4634
|
Breadcrumbs,
|
|
4626
|
-
Button,
|
|
4635
|
+
Button2 as Button,
|
|
4627
4636
|
ButtonGroup,
|
|
4628
4637
|
Checkbox,
|
|
4629
4638
|
Divider,
|