@komensal/ui 0.11.8 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +10 -1
- package/dist/index.js +217 -196
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -72,7 +72,7 @@ var AddTile = React.forwardRef(
|
|
|
72
72
|
"button",
|
|
73
73
|
{
|
|
74
74
|
className: cn(
|
|
75
|
-
"group border-border text-muted hover:border-primary-hover hover:bg-brand-200 hover:text-primary focus-visible:ring-ring flex min-h-
|
|
75
|
+
"group border-border text-muted hover:border-primary-hover hover:bg-brand-200 hover:text-primary focus-visible:ring-ring flex min-h-92.5 cursor-pointer flex-col items-center justify-center gap-2 rounded-2xl border-2 border-dashed transition-colors focus-visible:ring-2 focus-visible:outline-none",
|
|
76
76
|
className
|
|
77
77
|
),
|
|
78
78
|
ref,
|
|
@@ -142,10 +142,30 @@ var AuthHeader = ({
|
|
|
142
142
|
] });
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
+
// src/components/breadcrumb.tsx
|
|
146
|
+
import * as React2 from "react";
|
|
147
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
148
|
+
var Breadcrumb = React2.forwardRef(({ className, items, ...props }, ref) => /* @__PURE__ */ jsx4("div", { className: cn("flex items-center gap-1 text-sm", className), ref, ...props, children: items.map((item, index) => {
|
|
149
|
+
const isLast = index === items.length - 1;
|
|
150
|
+
return /* @__PURE__ */ jsxs4("span", { className: "flex items-center gap-1", children: [
|
|
151
|
+
index > 0 && /* @__PURE__ */ jsx4("span", { className: "text-muted", children: "\u203A" }),
|
|
152
|
+
item.onClick && !isLast ? /* @__PURE__ */ jsx4(
|
|
153
|
+
"button",
|
|
154
|
+
{
|
|
155
|
+
className: "text-muted hover:text-foreground transition-colors",
|
|
156
|
+
onClick: item.onClick,
|
|
157
|
+
type: "button",
|
|
158
|
+
children: item.label
|
|
159
|
+
}
|
|
160
|
+
) : /* @__PURE__ */ jsx4("span", { className: isLast ? "text-foreground font-medium" : "text-muted", children: item.label })
|
|
161
|
+
] }, `${item.label}-${index}`);
|
|
162
|
+
}) }));
|
|
163
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
164
|
+
|
|
145
165
|
// src/components/button.tsx
|
|
146
166
|
import { Slot } from "@radix-ui/react-slot";
|
|
147
167
|
import { cva } from "class-variance-authority";
|
|
148
|
-
import * as
|
|
168
|
+
import * as React4 from "react";
|
|
149
169
|
|
|
150
170
|
// src/components/spinner.tsx
|
|
151
171
|
import clsx2 from "clsx";
|
|
@@ -196,7 +216,7 @@ var setUiLanguage = (lng) => uiI18n.changeLanguage(lng);
|
|
|
196
216
|
var useUiT = () => useTranslation("ui", { i18n: uiI18n }).t;
|
|
197
217
|
|
|
198
218
|
// src/components/spinner.tsx
|
|
199
|
-
import { Fragment as Fragment2, jsx as
|
|
219
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
200
220
|
var sizes = {
|
|
201
221
|
lg: "70",
|
|
202
222
|
md: "50",
|
|
@@ -211,8 +231,8 @@ var variants = {
|
|
|
211
231
|
};
|
|
212
232
|
var Spinner = ({ className = "", loadingLabel, size = "md", variant = "primary" }) => {
|
|
213
233
|
const t = useUiT();
|
|
214
|
-
return /* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
235
|
+
/* @__PURE__ */ jsx5(
|
|
216
236
|
"svg",
|
|
217
237
|
{
|
|
218
238
|
fill: "currentColor",
|
|
@@ -221,9 +241,9 @@ var Spinner = ({ className = "", loadingLabel, size = "md", variant = "primary"
|
|
|
221
241
|
viewBox: "0 0 100 100",
|
|
222
242
|
width: sizes[size],
|
|
223
243
|
xmlns: "http://www.w3.org/2000/svg",
|
|
224
|
-
children: /* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */
|
|
244
|
+
children: /* @__PURE__ */ jsxs5("g", { className: clsx2("spinner_V8m1", className), children: [
|
|
245
|
+
/* @__PURE__ */ jsx5("circle", { cx: "50", cy: "50", fill: "none", opacity: "0.25", r: "35", stroke: "currentColor", strokeWidth: "10" }),
|
|
246
|
+
/* @__PURE__ */ jsx5(
|
|
227
247
|
"circle",
|
|
228
248
|
{
|
|
229
249
|
cx: "50",
|
|
@@ -233,7 +253,7 @@ var Spinner = ({ className = "", loadingLabel, size = "md", variant = "primary"
|
|
|
233
253
|
stroke: "currentColor",
|
|
234
254
|
strokeDasharray: "164.93361431346415 56.97787143782138",
|
|
235
255
|
strokeWidth: "10",
|
|
236
|
-
children: /* @__PURE__ */
|
|
256
|
+
children: /* @__PURE__ */ jsx5(
|
|
237
257
|
"animateTransform",
|
|
238
258
|
{
|
|
239
259
|
attributeName: "transform",
|
|
@@ -249,18 +269,18 @@ var Spinner = ({ className = "", loadingLabel, size = "md", variant = "primary"
|
|
|
249
269
|
] })
|
|
250
270
|
}
|
|
251
271
|
),
|
|
252
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ jsx5("span", { className: "sr-only", children: loadingLabel ?? t("spinner.loading") })
|
|
253
273
|
] });
|
|
254
274
|
};
|
|
255
275
|
|
|
256
276
|
// src/components/tooltip.tsx
|
|
257
277
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
258
|
-
import * as
|
|
259
|
-
import { jsx as
|
|
278
|
+
import * as React3 from "react";
|
|
279
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
260
280
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
261
281
|
var TooltipRoot = TooltipPrimitive.Root;
|
|
262
282
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
263
|
-
var TooltipContent =
|
|
283
|
+
var TooltipContent = React3.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx6(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx6(
|
|
264
284
|
TooltipPrimitive.Content,
|
|
265
285
|
{
|
|
266
286
|
className: cn(
|
|
@@ -273,18 +293,18 @@ var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, ...props },
|
|
|
273
293
|
}
|
|
274
294
|
) }));
|
|
275
295
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
276
|
-
var Tooltip =
|
|
296
|
+
var Tooltip = React3.forwardRef(
|
|
277
297
|
({ children, childrenClassName, className, message, sideTooltip = "top" }, ref) => {
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
298
|
+
return /* @__PURE__ */ jsx6(TooltipProvider, { children: /* @__PURE__ */ jsxs6(TooltipRoot, { children: [
|
|
299
|
+
/* @__PURE__ */ jsx6(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx6("div", { className: cn("", childrenClassName), ref, children }) }),
|
|
300
|
+
/* @__PURE__ */ jsx6(TooltipContent, { className: cn("", className), side: sideTooltip, children: /* @__PURE__ */ jsx6("p", { children: message }) })
|
|
281
301
|
] }) });
|
|
282
302
|
}
|
|
283
303
|
);
|
|
284
304
|
Tooltip.displayName = "Tooltip";
|
|
285
305
|
|
|
286
306
|
// src/components/button.tsx
|
|
287
|
-
import { jsx as
|
|
307
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
288
308
|
var buttonVariants = cva(
|
|
289
309
|
"w-full inline-flex items-center justify-center gap-[10px] whitespace-nowrap rounded-[12px] border border-transparent text-base font-semibold transition-all duration-300 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:bg-inactive disabled:text-inactive-text disabled:border-transparent cursor-pointer",
|
|
290
310
|
{
|
|
@@ -330,7 +350,7 @@ var buttonVariants = cva(
|
|
|
330
350
|
}
|
|
331
351
|
}
|
|
332
352
|
);
|
|
333
|
-
var Button =
|
|
353
|
+
var Button = React4.forwardRef(
|
|
334
354
|
({
|
|
335
355
|
asChild = false,
|
|
336
356
|
children,
|
|
@@ -349,7 +369,7 @@ var Button = React3.forwardRef(
|
|
|
349
369
|
...props
|
|
350
370
|
}, ref) => {
|
|
351
371
|
const Comp = asChild ? Slot : "button";
|
|
352
|
-
const buttonNode = /* @__PURE__ */
|
|
372
|
+
const buttonNode = /* @__PURE__ */ jsxs7(
|
|
353
373
|
Comp,
|
|
354
374
|
{
|
|
355
375
|
"aria-busy": isLoading || void 0,
|
|
@@ -360,21 +380,21 @@ var Button = React3.forwardRef(
|
|
|
360
380
|
children: [
|
|
361
381
|
iconLeft,
|
|
362
382
|
icon,
|
|
363
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ jsx7("span", { className: cn("flex w-full items-center justify-center gap-2", childrenClassName), children }),
|
|
364
384
|
iconRight,
|
|
365
|
-
isLoading && /* @__PURE__ */
|
|
385
|
+
isLoading && /* @__PURE__ */ jsx7("div", { className: "absolute inset-0 flex items-center justify-center bg-black/10 backdrop-blur-sm", children: /* @__PURE__ */ jsx7(Spinner, { size: "sm" }) })
|
|
366
386
|
]
|
|
367
387
|
}
|
|
368
388
|
);
|
|
369
|
-
return tooltip ? /* @__PURE__ */
|
|
389
|
+
return tooltip ? /* @__PURE__ */ jsx7(Tooltip, { childrenClassName: "flex items-center justify-center", message: tooltip, sideTooltip, children: buttonNode }) : buttonNode;
|
|
370
390
|
}
|
|
371
391
|
);
|
|
372
392
|
Button.displayName = "Button";
|
|
373
393
|
|
|
374
394
|
// src/components/chip.tsx
|
|
375
395
|
import { cva as cva2 } from "class-variance-authority";
|
|
376
|
-
import * as
|
|
377
|
-
import { jsx as
|
|
396
|
+
import * as React5 from "react";
|
|
397
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
378
398
|
var chipVariants = cva2(
|
|
379
399
|
"focus-visible:ring-ring inline-flex cursor-pointer items-center justify-center rounded-full px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:outline-none",
|
|
380
400
|
{
|
|
@@ -389,24 +409,24 @@ var chipVariants = cva2(
|
|
|
389
409
|
}
|
|
390
410
|
}
|
|
391
411
|
);
|
|
392
|
-
var Chip =
|
|
412
|
+
var Chip = React5.forwardRef(({ active, className, ...props }, ref) => /* @__PURE__ */ jsx8("button", { className: cn(chipVariants({ active }), className), ref, type: "button", ...props }));
|
|
393
413
|
Chip.displayName = "Chip";
|
|
394
414
|
|
|
395
415
|
// src/components/command.tsx
|
|
396
416
|
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
397
417
|
import { Command as CommandPrimitive } from "cmdk";
|
|
398
|
-
import * as
|
|
418
|
+
import * as React7 from "react";
|
|
399
419
|
|
|
400
420
|
// src/components/dialog.tsx
|
|
401
421
|
import { XIcon } from "@phosphor-icons/react";
|
|
402
422
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
403
|
-
import * as
|
|
404
|
-
import { jsx as
|
|
423
|
+
import * as React6 from "react";
|
|
424
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
405
425
|
var Dialog = DialogPrimitive.Root;
|
|
406
426
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
407
427
|
var DialogPortal = DialogPrimitive.Portal;
|
|
408
428
|
var DialogClose = DialogPrimitive.Close;
|
|
409
|
-
var DialogOverlay =
|
|
429
|
+
var DialogOverlay = React6.forwardRef(({ className, isAbsolute = false, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
410
430
|
DialogPrimitive.Overlay,
|
|
411
431
|
{
|
|
412
432
|
className: cn(
|
|
@@ -419,12 +439,12 @@ var DialogOverlay = React5.forwardRef(({ className, isAbsolute = false, ...props
|
|
|
419
439
|
}
|
|
420
440
|
));
|
|
421
441
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
422
|
-
var DialogContent =
|
|
442
|
+
var DialogContent = React6.forwardRef(
|
|
423
443
|
({ children, className, closeLabel, container, isAbsolute = false, isCloseIcon = false, overlayClassName, ...props }, ref) => {
|
|
424
444
|
const t = useUiT();
|
|
425
|
-
return /* @__PURE__ */
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
/* @__PURE__ */
|
|
445
|
+
return /* @__PURE__ */ jsxs8(DialogPortal, { container, children: [
|
|
446
|
+
/* @__PURE__ */ jsx9(DialogOverlay, { className: overlayClassName, isAbsolute }),
|
|
447
|
+
/* @__PURE__ */ jsxs8(
|
|
428
448
|
DialogPrimitive.Content,
|
|
429
449
|
{
|
|
430
450
|
className: cn(
|
|
@@ -436,9 +456,9 @@ var DialogContent = React5.forwardRef(
|
|
|
436
456
|
...props,
|
|
437
457
|
children: [
|
|
438
458
|
children,
|
|
439
|
-
isCloseIcon && /* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
459
|
+
isCloseIcon && /* @__PURE__ */ jsxs8(DialogPrimitive.Close, { className: "data-[state=open]:text-muted ring-offset-surface focus:ring-ring data-[state=open]:bg-hover hover:bg-hover absolute top-5 right-5 flex h-8 w-8 min-w-8 cursor-pointer items-center justify-center rounded-full bg-transparent opacity-70 transition-all hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none", children: [
|
|
460
|
+
/* @__PURE__ */ jsx9(XIcon, { className: "text-body h-4 w-4" }),
|
|
461
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: closeLabel ?? t("dialog.close") })
|
|
442
462
|
] })
|
|
443
463
|
]
|
|
444
464
|
}
|
|
@@ -447,9 +467,9 @@ var DialogContent = React5.forwardRef(
|
|
|
447
467
|
}
|
|
448
468
|
);
|
|
449
469
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
450
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
470
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx9("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
451
471
|
DialogHeader.displayName = "DialogHeader";
|
|
452
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
472
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx9(
|
|
453
473
|
"div",
|
|
454
474
|
{
|
|
455
475
|
className: cn("flex flex-col-reverse justify-center gap-2 rounded-2xl sm:flex-row", className),
|
|
@@ -457,22 +477,22 @@ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx8(
|
|
|
457
477
|
}
|
|
458
478
|
);
|
|
459
479
|
DialogFooter.displayName = "DialogFooter";
|
|
460
|
-
var DialogTitle =
|
|
480
|
+
var DialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
461
481
|
DialogPrimitive.Title,
|
|
462
482
|
{
|
|
463
483
|
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
464
484
|
ref,
|
|
465
485
|
...props,
|
|
466
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: /* @__PURE__ */ jsx9("span", { children: props.children })
|
|
467
487
|
}
|
|
468
488
|
));
|
|
469
489
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
470
|
-
var DialogDescription =
|
|
490
|
+
var DialogDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(DialogPrimitive.Description, { className: cn("text-muted text-sm", className), ref, ...props, children: /* @__PURE__ */ jsx9("span", { children: props.children }) }));
|
|
471
491
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
472
492
|
|
|
473
493
|
// src/components/command.tsx
|
|
474
|
-
import { jsx as
|
|
475
|
-
var Command =
|
|
494
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
495
|
+
var Command = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
476
496
|
CommandPrimitive,
|
|
477
497
|
{
|
|
478
498
|
className: cn("bg-surface text-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className),
|
|
@@ -482,11 +502,11 @@ var Command = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
482
502
|
));
|
|
483
503
|
Command.displayName = CommandPrimitive.displayName;
|
|
484
504
|
var CommandDialog = ({ children, ...props }) => {
|
|
485
|
-
return /* @__PURE__ */
|
|
505
|
+
return /* @__PURE__ */ jsx10(Dialog, { ...props, children: /* @__PURE__ */ jsx10(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsx10(Command, { className: "**:[[cmdk-group-heading]]:text-muted [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group]]:px-2 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3", children }) }) });
|
|
486
506
|
};
|
|
487
|
-
var CommandInput =
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
507
|
+
var CommandInput = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs9("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
508
|
+
/* @__PURE__ */ jsx10(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
509
|
+
/* @__PURE__ */ jsx10(
|
|
490
510
|
CommandPrimitive.Input,
|
|
491
511
|
{
|
|
492
512
|
className: cn(
|
|
@@ -499,11 +519,11 @@ var CommandInput = React6.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
499
519
|
)
|
|
500
520
|
] }));
|
|
501
521
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
502
|
-
var CommandList =
|
|
522
|
+
var CommandList = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.List, { className: cn("max-h-75 overflow-x-hidden overflow-y-auto", className), ref, ...props }));
|
|
503
523
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
504
|
-
var CommandEmpty =
|
|
524
|
+
var CommandEmpty = React7.forwardRef((props, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.Empty, { className: "py-6 text-center text-sm", ref, ...props }));
|
|
505
525
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
506
|
-
var CommandGroup =
|
|
526
|
+
var CommandGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
507
527
|
CommandPrimitive.Group,
|
|
508
528
|
{
|
|
509
529
|
className: cn(
|
|
@@ -515,9 +535,9 @@ var CommandGroup = React6.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
515
535
|
}
|
|
516
536
|
));
|
|
517
537
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
518
|
-
var CommandSeparator =
|
|
538
|
+
var CommandSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.Separator, { className: cn("bg-border -mx-1 h-px", className), ref, ...props }));
|
|
519
539
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
520
|
-
var CommandItem =
|
|
540
|
+
var CommandItem = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
521
541
|
CommandPrimitive.Item,
|
|
522
542
|
{
|
|
523
543
|
className: cn(
|
|
@@ -530,25 +550,25 @@ var CommandItem = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
530
550
|
));
|
|
531
551
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
532
552
|
var CommandShortcut = ({ className, ...props }) => {
|
|
533
|
-
return /* @__PURE__ */
|
|
553
|
+
return /* @__PURE__ */ jsx10("span", { className: cn("text-muted ml-auto text-xs tracking-widest", className), ...props });
|
|
534
554
|
};
|
|
535
555
|
CommandShortcut.displayName = "CommandShortcut";
|
|
536
556
|
|
|
537
557
|
// src/components/form.tsx
|
|
538
558
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
539
|
-
import * as
|
|
559
|
+
import * as React8 from "react";
|
|
540
560
|
import { Controller, FormProvider, useFormContext } from "react-hook-form";
|
|
541
|
-
import { jsx as
|
|
561
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
542
562
|
var Form = FormProvider;
|
|
543
|
-
var FormFieldContext =
|
|
563
|
+
var FormFieldContext = React8.createContext(null);
|
|
544
564
|
var FormField = ({
|
|
545
565
|
...props
|
|
546
566
|
}) => {
|
|
547
|
-
return /* @__PURE__ */
|
|
567
|
+
return /* @__PURE__ */ jsx11(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx11(Controller, { ...props }) });
|
|
548
568
|
};
|
|
549
569
|
var useFormField = () => {
|
|
550
|
-
const fieldContext =
|
|
551
|
-
const itemContext =
|
|
570
|
+
const fieldContext = React8.useContext(FormFieldContext);
|
|
571
|
+
const itemContext = React8.useContext(FormItemContext);
|
|
552
572
|
const { formState, getFieldState } = useFormContext();
|
|
553
573
|
if (!fieldContext) {
|
|
554
574
|
throw new Error("useFormField must be used within <FormField>");
|
|
@@ -567,18 +587,18 @@ var useFormField = () => {
|
|
|
567
587
|
...fieldState
|
|
568
588
|
};
|
|
569
589
|
};
|
|
570
|
-
var FormItemContext =
|
|
571
|
-
var FormItem =
|
|
590
|
+
var FormItemContext = React8.createContext(null);
|
|
591
|
+
var FormItem = React8.forwardRef(
|
|
572
592
|
({ className, ...props }, ref) => {
|
|
573
|
-
const id =
|
|
574
|
-
return /* @__PURE__ */
|
|
593
|
+
const id = React8.useId();
|
|
594
|
+
return /* @__PURE__ */ jsx11(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx11("div", { className: cn("space-y-1", className), ref, ...props }) });
|
|
575
595
|
}
|
|
576
596
|
);
|
|
577
597
|
FormItem.displayName = "FormItem";
|
|
578
|
-
var FormControl =
|
|
598
|
+
var FormControl = React8.forwardRef(
|
|
579
599
|
({ ...props }, ref) => {
|
|
580
600
|
const { error, formDescriptionId, formItemId, formMessageId } = useFormField();
|
|
581
|
-
return /* @__PURE__ */
|
|
601
|
+
return /* @__PURE__ */ jsx11(
|
|
582
602
|
Slot2,
|
|
583
603
|
{
|
|
584
604
|
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
@@ -591,14 +611,14 @@ var FormControl = React7.forwardRef(
|
|
|
591
611
|
}
|
|
592
612
|
);
|
|
593
613
|
FormControl.displayName = "FormControl";
|
|
594
|
-
var FormMessage =
|
|
614
|
+
var FormMessage = React8.forwardRef(
|
|
595
615
|
({ children, className, ...props }, ref) => {
|
|
596
616
|
const { error, formMessageId } = useFormField();
|
|
597
617
|
const body = error?.message ? String(error.message) : children;
|
|
598
618
|
if (!body) {
|
|
599
619
|
return null;
|
|
600
620
|
}
|
|
601
|
-
return /* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */ jsx11(
|
|
602
622
|
"p",
|
|
603
623
|
{
|
|
604
624
|
className: cn("text-destructive text-[0.8rem] font-medium", className),
|
|
@@ -617,10 +637,10 @@ import { useState } from "react";
|
|
|
617
637
|
import { EyeIcon, EyeSlashIcon, XIcon as XIcon2 } from "@phosphor-icons/react";
|
|
618
638
|
|
|
619
639
|
// src/components/input.tsx
|
|
620
|
-
import * as
|
|
621
|
-
import { jsx as
|
|
622
|
-
var Input =
|
|
623
|
-
return /* @__PURE__ */
|
|
640
|
+
import * as React9 from "react";
|
|
641
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
642
|
+
var Input = React9.forwardRef(({ className, onKeyDown, type, ...props }, ref) => {
|
|
643
|
+
return /* @__PURE__ */ jsx12(
|
|
624
644
|
"input",
|
|
625
645
|
{
|
|
626
646
|
className: cn(
|
|
@@ -652,31 +672,31 @@ Input.displayName = "Input";
|
|
|
652
672
|
// src/components/label.tsx
|
|
653
673
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
654
674
|
import { cva as cva3 } from "class-variance-authority";
|
|
655
|
-
import * as
|
|
656
|
-
import { jsx as
|
|
675
|
+
import * as React10 from "react";
|
|
676
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
657
677
|
var labelVariants = cva3("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
658
|
-
var Label =
|
|
678
|
+
var Label = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx13(LabelPrimitive.Root, { className: cn(labelVariants(), className), ref, ...props }));
|
|
659
679
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
660
680
|
|
|
661
681
|
// src/components/form-fields/label-field.tsx
|
|
662
|
-
import { jsx as
|
|
682
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
663
683
|
var LabelField = ({ label, labelClassName, name, visualRequired }) => {
|
|
664
|
-
return /* @__PURE__ */
|
|
684
|
+
return /* @__PURE__ */ jsxs10(
|
|
665
685
|
Label,
|
|
666
686
|
{
|
|
667
687
|
className: cn("text-body mb-2 text-start text-sm leading-none font-normal tracking-normal", labelClassName),
|
|
668
688
|
htmlFor: name,
|
|
669
689
|
children: [
|
|
670
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ jsx14("span", { children: label }),
|
|
671
691
|
" ",
|
|
672
|
-
visualRequired && /* @__PURE__ */
|
|
692
|
+
visualRequired && /* @__PURE__ */ jsx14("span", { className: "text-destructive", children: " *" })
|
|
673
693
|
]
|
|
674
694
|
}
|
|
675
695
|
);
|
|
676
696
|
};
|
|
677
697
|
|
|
678
698
|
// src/components/form-fields/form-field-shell.tsx
|
|
679
|
-
import { jsx as
|
|
699
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
680
700
|
var FormFieldShell = ({
|
|
681
701
|
children,
|
|
682
702
|
hasError,
|
|
@@ -685,8 +705,8 @@ var FormFieldShell = ({
|
|
|
685
705
|
mainClassName,
|
|
686
706
|
name,
|
|
687
707
|
visualRequired
|
|
688
|
-
}) => /* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
708
|
+
}) => /* @__PURE__ */ jsxs11(FormItem, { className: cn("flex flex-col", mainClassName), children: [
|
|
709
|
+
/* @__PURE__ */ jsx15(
|
|
690
710
|
LabelField,
|
|
691
711
|
{
|
|
692
712
|
label,
|
|
@@ -695,12 +715,12 @@ var FormFieldShell = ({
|
|
|
695
715
|
visualRequired
|
|
696
716
|
}
|
|
697
717
|
),
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ jsx15(FormControl, { children }),
|
|
719
|
+
/* @__PURE__ */ jsx15(FormMessage, {})
|
|
700
720
|
] });
|
|
701
721
|
|
|
702
722
|
// src/components/form-fields/input-field.tsx
|
|
703
|
-
import { jsx as
|
|
723
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
704
724
|
var InputField = ({
|
|
705
725
|
clearLabel,
|
|
706
726
|
control,
|
|
@@ -725,14 +745,14 @@ var InputField = ({
|
|
|
725
745
|
};
|
|
726
746
|
const isPassword = type === "password";
|
|
727
747
|
const inputType = isPassword ? isPasswordVisible ? "text" : "password" : type;
|
|
728
|
-
return /* @__PURE__ */
|
|
748
|
+
return /* @__PURE__ */ jsx16(
|
|
729
749
|
FormField,
|
|
730
750
|
{
|
|
731
751
|
control,
|
|
732
752
|
name,
|
|
733
753
|
render: ({ field, fieldState }) => {
|
|
734
754
|
const hasError = !!fieldState.error;
|
|
735
|
-
return /* @__PURE__ */
|
|
755
|
+
return /* @__PURE__ */ jsx16(
|
|
736
756
|
FormFieldShell,
|
|
737
757
|
{
|
|
738
758
|
hasError,
|
|
@@ -741,8 +761,8 @@ var InputField = ({
|
|
|
741
761
|
mainClassName,
|
|
742
762
|
name,
|
|
743
763
|
visualRequired,
|
|
744
|
-
children: /* @__PURE__ */
|
|
745
|
-
/* @__PURE__ */
|
|
764
|
+
children: /* @__PURE__ */ jsxs12("div", { className: "relative", children: [
|
|
765
|
+
/* @__PURE__ */ jsx16(
|
|
746
766
|
Input,
|
|
747
767
|
{
|
|
748
768
|
...field,
|
|
@@ -762,25 +782,25 @@ var InputField = ({
|
|
|
762
782
|
value: field.value ?? ""
|
|
763
783
|
}
|
|
764
784
|
),
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
field.value && isClearable && /* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ jsxs12("div", { className: "absolute inset-y-0 right-0 flex items-center space-x-2 pr-2", children: [
|
|
786
|
+
field.value && isClearable && /* @__PURE__ */ jsx16(
|
|
767
787
|
"button",
|
|
768
788
|
{
|
|
769
789
|
className: "focus:outline-none",
|
|
770
790
|
onClick: onClear,
|
|
771
791
|
title: clearLabel ?? t("inputField.clear"),
|
|
772
792
|
type: "button",
|
|
773
|
-
children: /* @__PURE__ */
|
|
793
|
+
children: /* @__PURE__ */ jsx16(XIcon2, { size: 18 })
|
|
774
794
|
}
|
|
775
795
|
),
|
|
776
|
-
type === "password" && /* @__PURE__ */
|
|
796
|
+
type === "password" && /* @__PURE__ */ jsx16(
|
|
777
797
|
"button",
|
|
778
798
|
{
|
|
779
799
|
className: "focus:outline-none",
|
|
780
800
|
onClick: togglePasswordVisibility,
|
|
781
801
|
title: isPasswordVisible ? hidePasswordLabel ?? t("inputField.hidePassword") : showPasswordLabel ?? t("inputField.showPassword"),
|
|
782
802
|
type: "button",
|
|
783
|
-
children: isPasswordVisible ? /* @__PURE__ */
|
|
803
|
+
children: isPasswordVisible ? /* @__PURE__ */ jsx16(EyeIcon, { size: 18 }) : /* @__PURE__ */ jsx16(EyeSlashIcon, { size: 20 })
|
|
784
804
|
}
|
|
785
805
|
)
|
|
786
806
|
] })
|
|
@@ -1006,7 +1026,7 @@ function useGoogleMapPicker({
|
|
|
1006
1026
|
}
|
|
1007
1027
|
|
|
1008
1028
|
// src/components/google-map-picker.tsx
|
|
1009
|
-
import { jsx as
|
|
1029
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1010
1030
|
var DEFAULT_CENTER = { lat: 4.711, lng: -74.0721 };
|
|
1011
1031
|
var MapPickerContent = (props) => {
|
|
1012
1032
|
const { disabled, hasError, mapId, placeholder } = props;
|
|
@@ -1022,9 +1042,9 @@ var MapPickerContent = (props) => {
|
|
|
1022
1042
|
showDropdown,
|
|
1023
1043
|
suggestions
|
|
1024
1044
|
} = useGoogleMapPicker(props);
|
|
1025
|
-
return /* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */
|
|
1045
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-3", children: [
|
|
1046
|
+
/* @__PURE__ */ jsxs13("div", { className: "relative", children: [
|
|
1047
|
+
/* @__PURE__ */ jsx17(
|
|
1028
1048
|
"input",
|
|
1029
1049
|
{
|
|
1030
1050
|
className: cn(inputBase, inputFocus, hasError && "border-destructive"),
|
|
@@ -1037,7 +1057,7 @@ var MapPickerContent = (props) => {
|
|
|
1037
1057
|
value: inputValue
|
|
1038
1058
|
}
|
|
1039
1059
|
),
|
|
1040
|
-
showDropdown && suggestions.length > 0 && /* @__PURE__ */
|
|
1060
|
+
showDropdown && suggestions.length > 0 && /* @__PURE__ */ jsx17("ul", { className: cn("border-border bg-surface absolute mt-1 w-full overflow-hidden rounded-[10px] border shadow-md", zPopover), children: suggestions.map((suggestion) => /* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsx17(
|
|
1041
1061
|
"button",
|
|
1042
1062
|
{
|
|
1043
1063
|
className: "text-foreground hover:bg-hover w-full px-4 py-3 text-left text-sm transition-colors",
|
|
@@ -1047,7 +1067,7 @@ var MapPickerContent = (props) => {
|
|
|
1047
1067
|
}
|
|
1048
1068
|
) }, suggestion.placePrediction?.placeId ?? suggestion.placePrediction?.text.text)) })
|
|
1049
1069
|
] }),
|
|
1050
|
-
/* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ jsx17("div", { className: "border-border h-59 overflow-hidden rounded-[10px] border md:h-87.5", children: /* @__PURE__ */ jsx17(
|
|
1051
1071
|
Map2,
|
|
1052
1072
|
{
|
|
1053
1073
|
defaultCenter: DEFAULT_CENTER,
|
|
@@ -1058,23 +1078,23 @@ var MapPickerContent = (props) => {
|
|
|
1058
1078
|
mapId: mapId ?? import.meta.env.VITE_GOOGLE_MAPS_MAP_ID ?? "DEMO_MAP_ID",
|
|
1059
1079
|
onClick: handleMapClick,
|
|
1060
1080
|
style: { height: "100%", width: "100%" },
|
|
1061
|
-
children: position && /* @__PURE__ */
|
|
1081
|
+
children: position && /* @__PURE__ */ jsx17(AdvancedMarker, { draggable: !disabled, onDragEnd: handleMarkerDragEnd, position })
|
|
1062
1082
|
}
|
|
1063
1083
|
) })
|
|
1064
1084
|
] });
|
|
1065
1085
|
};
|
|
1066
|
-
var GoogleMapPicker = (props) => /* @__PURE__ */
|
|
1086
|
+
var GoogleMapPicker = (props) => /* @__PURE__ */ jsx17(
|
|
1067
1087
|
APIProvider,
|
|
1068
1088
|
{
|
|
1069
1089
|
apiKey: props.apiKey ?? import.meta.env.VITE_GOOGLE_MAPS_API_KEY ?? "",
|
|
1070
1090
|
language: "es",
|
|
1071
1091
|
region: "CO",
|
|
1072
|
-
children: /* @__PURE__ */
|
|
1092
|
+
children: /* @__PURE__ */ jsx17(MapPickerContent, { ...props })
|
|
1073
1093
|
}
|
|
1074
1094
|
);
|
|
1075
1095
|
|
|
1076
1096
|
// src/components/form-fields/map-picker-field.tsx
|
|
1077
|
-
import { jsx as
|
|
1097
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1078
1098
|
var MapPickerField = ({
|
|
1079
1099
|
control,
|
|
1080
1100
|
label,
|
|
@@ -1083,12 +1103,12 @@ var MapPickerField = ({
|
|
|
1083
1103
|
name,
|
|
1084
1104
|
visualRequired,
|
|
1085
1105
|
...pickerProps
|
|
1086
|
-
}) => /* @__PURE__ */
|
|
1106
|
+
}) => /* @__PURE__ */ jsx18(
|
|
1087
1107
|
FormField,
|
|
1088
1108
|
{
|
|
1089
1109
|
control,
|
|
1090
1110
|
name,
|
|
1091
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
1111
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsx18(
|
|
1092
1112
|
FormFieldShell,
|
|
1093
1113
|
{
|
|
1094
1114
|
hasError: !!fieldState.error,
|
|
@@ -1097,7 +1117,7 @@ var MapPickerField = ({
|
|
|
1097
1117
|
mainClassName,
|
|
1098
1118
|
name,
|
|
1099
1119
|
visualRequired,
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1120
|
+
children: /* @__PURE__ */ jsx18(
|
|
1101
1121
|
GoogleMapPicker,
|
|
1102
1122
|
{
|
|
1103
1123
|
...pickerProps,
|
|
@@ -1113,14 +1133,14 @@ var MapPickerField = ({
|
|
|
1113
1133
|
|
|
1114
1134
|
// src/components/otp-input.tsx
|
|
1115
1135
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
1116
|
-
import
|
|
1117
|
-
import { jsx as
|
|
1136
|
+
import React11 from "react";
|
|
1137
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1118
1138
|
function InputOTP({
|
|
1119
1139
|
className,
|
|
1120
1140
|
containerClassName,
|
|
1121
1141
|
...props
|
|
1122
1142
|
}) {
|
|
1123
|
-
return /* @__PURE__ */
|
|
1143
|
+
return /* @__PURE__ */ jsx19(
|
|
1124
1144
|
OTPInput,
|
|
1125
1145
|
{
|
|
1126
1146
|
className: cn("disabled:cursor-not-allowed", className),
|
|
@@ -1131,16 +1151,16 @@ function InputOTP({
|
|
|
1131
1151
|
);
|
|
1132
1152
|
}
|
|
1133
1153
|
function InputOTPGroup({ className, ...props }) {
|
|
1134
|
-
return /* @__PURE__ */
|
|
1154
|
+
return /* @__PURE__ */ jsx19("div", { className: cn("flex items-center gap-2", className), "data-slot": "input-otp-group", ...props });
|
|
1135
1155
|
}
|
|
1136
1156
|
function InputOTPSlot({
|
|
1137
1157
|
className,
|
|
1138
1158
|
index,
|
|
1139
1159
|
...props
|
|
1140
1160
|
}) {
|
|
1141
|
-
const inputOTPContext =
|
|
1161
|
+
const inputOTPContext = React11.useContext(OTPInputContext);
|
|
1142
1162
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index] ?? {};
|
|
1143
|
-
return /* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ jsxs14(
|
|
1144
1164
|
"div",
|
|
1145
1165
|
{
|
|
1146
1166
|
className: cn(
|
|
@@ -1155,14 +1175,14 @@ function InputOTPSlot({
|
|
|
1155
1175
|
...props,
|
|
1156
1176
|
children: [
|
|
1157
1177
|
char,
|
|
1158
|
-
hasFakeCaret && /* @__PURE__ */
|
|
1178
|
+
hasFakeCaret && /* @__PURE__ */ jsx19("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx19("div", { className: "animate-caret-blink bg-foreground h-6 w-px duration-1000" }) })
|
|
1159
1179
|
]
|
|
1160
1180
|
}
|
|
1161
1181
|
);
|
|
1162
1182
|
}
|
|
1163
1183
|
|
|
1164
1184
|
// src/components/form-fields/otp-field.tsx
|
|
1165
|
-
import { jsx as
|
|
1185
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1166
1186
|
function OTPField({
|
|
1167
1187
|
autoFocus,
|
|
1168
1188
|
className,
|
|
@@ -1175,13 +1195,13 @@ function OTPField({
|
|
|
1175
1195
|
otpLength = 6,
|
|
1176
1196
|
visualRequired
|
|
1177
1197
|
}) {
|
|
1178
|
-
return /* @__PURE__ */
|
|
1198
|
+
return /* @__PURE__ */ jsx20(
|
|
1179
1199
|
FormField,
|
|
1180
1200
|
{
|
|
1181
1201
|
control,
|
|
1182
1202
|
name,
|
|
1183
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
1184
|
-
label ? /* @__PURE__ */
|
|
1203
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsxs15(FormItem, { className: cn("flex flex-col", className), children: [
|
|
1204
|
+
label ? /* @__PURE__ */ jsx20(
|
|
1185
1205
|
LabelField,
|
|
1186
1206
|
{
|
|
1187
1207
|
label,
|
|
@@ -1190,7 +1210,7 @@ function OTPField({
|
|
|
1190
1210
|
visualRequired
|
|
1191
1211
|
}
|
|
1192
1212
|
) : null,
|
|
1193
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ jsx20(FormControl, { children: /* @__PURE__ */ jsx20(
|
|
1194
1214
|
InputOTP,
|
|
1195
1215
|
{
|
|
1196
1216
|
"aria-invalid": fieldState.invalid || void 0,
|
|
@@ -1205,10 +1225,10 @@ function OTPField({
|
|
|
1205
1225
|
onPaste: (e) => field.onChange(e.clipboardData.getData("text")),
|
|
1206
1226
|
pattern: "[0-9]*",
|
|
1207
1227
|
value: field.value ?? "",
|
|
1208
|
-
children: /* @__PURE__ */
|
|
1228
|
+
children: /* @__PURE__ */ jsx20(InputOTPGroup, { children: Array.from({ length: otpLength }).map((_, i) => /* @__PURE__ */ jsx20(InputOTPSlot, { "aria-invalid": fieldState.invalid || void 0, index: i }, i)) })
|
|
1209
1229
|
}
|
|
1210
1230
|
) }),
|
|
1211
|
-
/* @__PURE__ */
|
|
1231
|
+
/* @__PURE__ */ jsx20(FormMessage, {})
|
|
1212
1232
|
] })
|
|
1213
1233
|
}
|
|
1214
1234
|
);
|
|
@@ -1220,11 +1240,11 @@ import { cloneElement, useCallback as useCallback2, useEffect as useEffect4, use
|
|
|
1220
1240
|
|
|
1221
1241
|
// src/components/popover.tsx
|
|
1222
1242
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1223
|
-
import * as
|
|
1224
|
-
import { jsx as
|
|
1243
|
+
import * as React12 from "react";
|
|
1244
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1225
1245
|
var Popover = PopoverPrimitive.Root;
|
|
1226
1246
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1227
|
-
var PopoverContent =
|
|
1247
|
+
var PopoverContent = React12.forwardRef(({ align = "center", className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx21(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx21(
|
|
1228
1248
|
PopoverPrimitive.Content,
|
|
1229
1249
|
{
|
|
1230
1250
|
align,
|
|
@@ -1240,20 +1260,20 @@ var PopoverContent = React11.forwardRef(({ align = "center", className, sideOffs
|
|
|
1240
1260
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1241
1261
|
|
|
1242
1262
|
// src/components/time-columns.tsx
|
|
1243
|
-
import * as
|
|
1244
|
-
import { jsx as
|
|
1263
|
+
import * as React13 from "react";
|
|
1264
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1245
1265
|
var TimeColumns = ({ hours, minutes, onSelectHour, onSelectMinute, value }) => {
|
|
1246
1266
|
const [selectedHour, selectedMinute] = value ? value.split(":") : ["", ""];
|
|
1247
|
-
const hourListRef =
|
|
1248
|
-
const minuteListRef =
|
|
1249
|
-
|
|
1267
|
+
const hourListRef = React13.useRef(null);
|
|
1268
|
+
const minuteListRef = React13.useRef(null);
|
|
1269
|
+
React13.useEffect(() => {
|
|
1250
1270
|
hourListRef.current?.querySelector('[data-selected="true"]')?.scrollIntoView({ block: "center" });
|
|
1251
1271
|
minuteListRef.current?.querySelector('[data-selected="true"]')?.scrollIntoView({ block: "center" });
|
|
1252
1272
|
}, []);
|
|
1253
|
-
return /* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1273
|
+
return /* @__PURE__ */ jsxs16("div", { className: "divide-border flex divide-x", children: [
|
|
1274
|
+
/* @__PURE__ */ jsx22("div", { className: "max-h-60 flex-1 overflow-y-auto", ref: hourListRef, children: hours.map((hour) => {
|
|
1255
1275
|
const isSelected = hour === selectedHour;
|
|
1256
|
-
return /* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ jsx22(
|
|
1257
1277
|
"button",
|
|
1258
1278
|
{
|
|
1259
1279
|
className: cn(
|
|
@@ -1268,9 +1288,9 @@ var TimeColumns = ({ hours, minutes, onSelectHour, onSelectMinute, value }) => {
|
|
|
1268
1288
|
hour
|
|
1269
1289
|
);
|
|
1270
1290
|
}) }),
|
|
1271
|
-
/* @__PURE__ */
|
|
1291
|
+
/* @__PURE__ */ jsx22("div", { className: "max-h-60 flex-1 overflow-y-auto", ref: minuteListRef, children: minutes.map((minute) => {
|
|
1272
1292
|
const isSelected = minute === selectedMinute;
|
|
1273
|
-
return /* @__PURE__ */
|
|
1293
|
+
return /* @__PURE__ */ jsx22(
|
|
1274
1294
|
"button",
|
|
1275
1295
|
{
|
|
1276
1296
|
className: cn(
|
|
@@ -1330,7 +1350,7 @@ function usePopoverWidth() {
|
|
|
1330
1350
|
}
|
|
1331
1351
|
|
|
1332
1352
|
// src/components/select-input.tsx
|
|
1333
|
-
import { Fragment as Fragment3, jsx as
|
|
1353
|
+
import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1334
1354
|
var SelectInput = (props) => {
|
|
1335
1355
|
const t = useUiT();
|
|
1336
1356
|
const {
|
|
@@ -1418,9 +1438,9 @@ var SelectInput = (props) => {
|
|
|
1418
1438
|
useEffect4(() => {
|
|
1419
1439
|
setValueItem(value);
|
|
1420
1440
|
}, [value]);
|
|
1421
|
-
return /* @__PURE__ */
|
|
1422
|
-
/* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
1441
|
+
return /* @__PURE__ */ jsx23("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ jsxs17("div", { className: "relative flex flex-col justify-center", children: [
|
|
1442
|
+
/* @__PURE__ */ jsxs17(Popover, { onOpenChange: setOpen, open, children: [
|
|
1443
|
+
/* @__PURE__ */ jsx23(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx23(
|
|
1424
1444
|
Button,
|
|
1425
1445
|
{
|
|
1426
1446
|
"aria-controls": listboxId,
|
|
@@ -1433,33 +1453,33 @@ var SelectInput = (props) => {
|
|
|
1433
1453
|
ref: divRef,
|
|
1434
1454
|
role: "combobox",
|
|
1435
1455
|
variant: "primary",
|
|
1436
|
-
children: loading ? /* @__PURE__ */
|
|
1456
|
+
children: loading ? /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
1437
1457
|
loadingLabel ?? t("selectInput.loading"),
|
|
1438
1458
|
" ",
|
|
1439
|
-
/* @__PURE__ */
|
|
1440
|
-
] }) : /* @__PURE__ */
|
|
1441
|
-
valueItem ? filteredOptions.find((i) => i[valueKey] === valueItem)?.[labelKey] : /* @__PURE__ */
|
|
1442
|
-
/* @__PURE__ */
|
|
1443
|
-
] }) : /* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */
|
|
1445
|
-
leftIcon && /* @__PURE__ */
|
|
1446
|
-
valueItem ? filteredOptions.find((i) => i[valueKey] === valueItem)?.[labelKey] : /* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ jsx23(Spinner, {})
|
|
1460
|
+
] }) : /* @__PURE__ */ jsx23("div", { className: "relative flex h-5 w-full items-center", children: timeField ? /* @__PURE__ */ jsxs17("div", { className: "flex w-full items-center justify-center gap-5 truncate", children: [
|
|
1461
|
+
valueItem ? filteredOptions.find((i) => i[valueKey] === valueItem)?.[labelKey] : /* @__PURE__ */ jsx23("span", { className: cn(inputPlaceholder, placeholderClassName), children: resolvedPlaceholder }),
|
|
1462
|
+
/* @__PURE__ */ jsx23(ClockIcon, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
1463
|
+
] }) : /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
1464
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex w-full max-w-[90%] items-center truncate", children: [
|
|
1465
|
+
leftIcon && /* @__PURE__ */ jsx23("span", { className: "mr-2 shrink-0", children: cloneElement(leftIcon, { size: 20, strokeWidth: 1 }) }),
|
|
1466
|
+
valueItem ? filteredOptions.find((i) => i[valueKey] === valueItem)?.[labelKey] : /* @__PURE__ */ jsx23("span", { className: cn(inputPlaceholder, placeholderClassName), children: resolvedPlaceholder })
|
|
1447
1467
|
] }),
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
ableDeleteOption && /* @__PURE__ */
|
|
1450
|
-
!open ? /* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ jsxs17("div", { className: "absolute top-0.5 right-0 flex gap-2", children: [
|
|
1469
|
+
ableDeleteOption && /* @__PURE__ */ jsx23("div", { "aria-hidden": true, className: "h-4 w-4 shrink-0" }),
|
|
1470
|
+
!open ? /* @__PURE__ */ jsx23(CaretDownIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" }) : /* @__PURE__ */ jsx23(CaretUpIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1451
1471
|
] })
|
|
1452
1472
|
] }) })
|
|
1453
1473
|
}
|
|
1454
1474
|
) }),
|
|
1455
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ jsx23(
|
|
1456
1476
|
PopoverContent,
|
|
1457
1477
|
{
|
|
1458
1478
|
className: cn("bg-surface border-border rounded-sm p-1", zPopoverAboveDialog),
|
|
1459
1479
|
id: listboxId,
|
|
1460
1480
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1461
1481
|
style: timeField ? { maxWidth: "auto", width: "180px" } : { maxWidth: "auto", minWidth: `${width}px`, width: `${width}px` },
|
|
1462
|
-
children: timeField ? /* @__PURE__ */
|
|
1482
|
+
children: timeField ? /* @__PURE__ */ jsx23(
|
|
1463
1483
|
TimeColumns,
|
|
1464
1484
|
{
|
|
1465
1485
|
hours: timeHours,
|
|
@@ -1468,8 +1488,8 @@ var SelectInput = (props) => {
|
|
|
1468
1488
|
onSelectMinute: handleSelectMinute,
|
|
1469
1489
|
value: valueItem
|
|
1470
1490
|
}
|
|
1471
|
-
) : /* @__PURE__ */
|
|
1472
|
-
search && /* @__PURE__ */
|
|
1491
|
+
) : /* @__PURE__ */ jsxs17(Command, { className: "flex w-full flex-col gap-2", children: [
|
|
1492
|
+
search && /* @__PURE__ */ jsx23(
|
|
1473
1493
|
Input,
|
|
1474
1494
|
{
|
|
1475
1495
|
className: "mb-1 rounded-sm",
|
|
@@ -1478,11 +1498,11 @@ var SelectInput = (props) => {
|
|
|
1478
1498
|
value: query
|
|
1479
1499
|
}
|
|
1480
1500
|
),
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
/* @__PURE__ */
|
|
1501
|
+
/* @__PURE__ */ jsx23(CommandEmpty, { className: "text-center", children: noResultsLabel ?? t("selectInput.noResults") }),
|
|
1502
|
+
/* @__PURE__ */ jsx23(CommandList, { children: /* @__PURE__ */ jsx23(CommandGroup, { className: "p-0", children: filteredOptions.map((item) => {
|
|
1483
1503
|
const labelValue = item[labelKey];
|
|
1484
1504
|
const valueValue = item[valueKey];
|
|
1485
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ jsx23(
|
|
1486
1506
|
CommandItem,
|
|
1487
1507
|
{
|
|
1488
1508
|
className: cn(
|
|
@@ -1505,7 +1525,7 @@ var SelectInput = (props) => {
|
|
|
1505
1525
|
}
|
|
1506
1526
|
)
|
|
1507
1527
|
] }),
|
|
1508
|
-
ableDeleteOption && !loading && !timeField && /* @__PURE__ */
|
|
1528
|
+
ableDeleteOption && !loading && !timeField && /* @__PURE__ */ jsx23(
|
|
1509
1529
|
"button",
|
|
1510
1530
|
{
|
|
1511
1531
|
"aria-label": t("selectInput.clear"),
|
|
@@ -1518,14 +1538,14 @@ var SelectInput = (props) => {
|
|
|
1518
1538
|
setOpen(false);
|
|
1519
1539
|
},
|
|
1520
1540
|
type: "button",
|
|
1521
|
-
children: /* @__PURE__ */
|
|
1541
|
+
children: /* @__PURE__ */ jsx23(XIcon3, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
1522
1542
|
}
|
|
1523
1543
|
)
|
|
1524
1544
|
] }) });
|
|
1525
1545
|
};
|
|
1526
1546
|
|
|
1527
1547
|
// src/components/form-fields/select-field.tsx
|
|
1528
|
-
import { jsx as
|
|
1548
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1529
1549
|
var SelectField = ({
|
|
1530
1550
|
ableDeleteOption,
|
|
1531
1551
|
className,
|
|
@@ -1541,14 +1561,14 @@ var SelectField = ({
|
|
|
1541
1561
|
search,
|
|
1542
1562
|
visualRequired
|
|
1543
1563
|
}) => {
|
|
1544
|
-
return /* @__PURE__ */
|
|
1564
|
+
return /* @__PURE__ */ jsx24(
|
|
1545
1565
|
FormField,
|
|
1546
1566
|
{
|
|
1547
1567
|
control,
|
|
1548
1568
|
name,
|
|
1549
1569
|
render: ({ field, fieldState }) => {
|
|
1550
1570
|
const hasError = !!fieldState.error;
|
|
1551
|
-
return /* @__PURE__ */
|
|
1571
|
+
return /* @__PURE__ */ jsx24(
|
|
1552
1572
|
FormFieldShell,
|
|
1553
1573
|
{
|
|
1554
1574
|
hasError,
|
|
@@ -1557,7 +1577,7 @@ var SelectField = ({
|
|
|
1557
1577
|
mainClassName,
|
|
1558
1578
|
name,
|
|
1559
1579
|
visualRequired,
|
|
1560
|
-
children: /* @__PURE__ */
|
|
1580
|
+
children: /* @__PURE__ */ jsx24(
|
|
1561
1581
|
SelectInput,
|
|
1562
1582
|
{
|
|
1563
1583
|
ableDeleteOption,
|
|
@@ -1583,13 +1603,13 @@ var SelectField = ({
|
|
|
1583
1603
|
|
|
1584
1604
|
// src/components/password-checklist.tsx
|
|
1585
1605
|
import { CheckCircleIcon as CheckCircleIcon2, XCircleIcon } from "@phosphor-icons/react";
|
|
1586
|
-
import { jsx as
|
|
1606
|
+
import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1587
1607
|
var PasswordChecklist = ({ className, rules, value }) => {
|
|
1588
1608
|
if (rules.length === 0) return null;
|
|
1589
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsx25("ul", { className: cn("flex flex-col gap-1", className), children: rules.map((rule) => {
|
|
1590
1610
|
const isMet = rule.test(value);
|
|
1591
1611
|
const Icon = isMet ? CheckCircleIcon2 : XCircleIcon;
|
|
1592
|
-
return /* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ jsxs18(
|
|
1593
1613
|
"li",
|
|
1594
1614
|
{
|
|
1595
1615
|
className: cn(
|
|
@@ -1597,8 +1617,8 @@ var PasswordChecklist = ({ className, rules, value }) => {
|
|
|
1597
1617
|
isMet ? "text-success" : "text-inactive-text"
|
|
1598
1618
|
),
|
|
1599
1619
|
children: [
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
/* @__PURE__ */
|
|
1620
|
+
/* @__PURE__ */ jsx25(Icon, { "aria-hidden": "true", className: "h-4 w-4 shrink-0" }),
|
|
1621
|
+
/* @__PURE__ */ jsx25("span", { children: rule.label })
|
|
1602
1622
|
]
|
|
1603
1623
|
},
|
|
1604
1624
|
rule.key
|
|
@@ -1607,22 +1627,22 @@ var PasswordChecklist = ({ className, rules, value }) => {
|
|
|
1607
1627
|
};
|
|
1608
1628
|
|
|
1609
1629
|
// src/components/step-header.tsx
|
|
1610
|
-
import { jsx as
|
|
1611
|
-
var StepHeader = ({ subtitle, subtitleClassName, title }) => /* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
subtitle !== void 0 && /* @__PURE__ */
|
|
1630
|
+
import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1631
|
+
var StepHeader = ({ subtitle, subtitleClassName, title }) => /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-1", children: [
|
|
1632
|
+
/* @__PURE__ */ jsx26("h1", { className: "text-title text-2xl font-bold", children: title }),
|
|
1633
|
+
subtitle !== void 0 && /* @__PURE__ */ jsx26("p", { className: cn("text-subtitle text-sm", subtitleClassName), children: subtitle })
|
|
1614
1634
|
] });
|
|
1615
1635
|
|
|
1616
1636
|
// src/components/stepper.tsx
|
|
1617
1637
|
import { CheckIcon } from "@phosphor-icons/react";
|
|
1618
|
-
import { jsx as
|
|
1638
|
+
import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1619
1639
|
var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
1620
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ jsx27("div", { className: cn("flex w-full items-start", className), children: steps.map((step, index) => {
|
|
1621
1641
|
const isCompleted = intermediate ? index <= activeIndex : index < activeIndex;
|
|
1622
1642
|
const isActive = !intermediate && index === activeIndex;
|
|
1623
|
-
return /* @__PURE__ */
|
|
1624
|
-
/* @__PURE__ */
|
|
1625
|
-
/* @__PURE__ */
|
|
1643
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex flex-1 flex-col items-center", children: [
|
|
1644
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex w-full items-center", children: [
|
|
1645
|
+
/* @__PURE__ */ jsx27(
|
|
1626
1646
|
"div",
|
|
1627
1647
|
{
|
|
1628
1648
|
className: cn(
|
|
@@ -1632,7 +1652,7 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1632
1652
|
)
|
|
1633
1653
|
}
|
|
1634
1654
|
),
|
|
1635
|
-
/* @__PURE__ */
|
|
1655
|
+
/* @__PURE__ */ jsx27(
|
|
1636
1656
|
"div",
|
|
1637
1657
|
{
|
|
1638
1658
|
"aria-current": isActive ? "step" : void 0,
|
|
@@ -1642,10 +1662,10 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1642
1662
|
isActive && "bg-primary border-primary text-inverse",
|
|
1643
1663
|
!isCompleted && !isActive && "bg-inactive border-inactive text-surface"
|
|
1644
1664
|
),
|
|
1645
|
-
children: isCompleted ? /* @__PURE__ */
|
|
1665
|
+
children: isCompleted ? /* @__PURE__ */ jsx27(CheckIcon, { className: "h-4 w-4" }) : index + 1
|
|
1646
1666
|
}
|
|
1647
1667
|
),
|
|
1648
|
-
/* @__PURE__ */
|
|
1668
|
+
/* @__PURE__ */ jsx27(
|
|
1649
1669
|
"div",
|
|
1650
1670
|
{
|
|
1651
1671
|
className: cn(
|
|
@@ -1653,7 +1673,7 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1653
1673
|
isCompleted ? "bg-primary" : "bg-inactive",
|
|
1654
1674
|
index === steps.length - 1 && "rounded-r-full"
|
|
1655
1675
|
),
|
|
1656
|
-
children: index === 0 && /* @__PURE__ */
|
|
1676
|
+
children: index === 0 && /* @__PURE__ */ jsx27(
|
|
1657
1677
|
"div",
|
|
1658
1678
|
{
|
|
1659
1679
|
className: cn(
|
|
@@ -1665,16 +1685,16 @@ var Stepper = ({ activeIndex, className, intermediate = false, steps }) => {
|
|
|
1665
1685
|
}
|
|
1666
1686
|
)
|
|
1667
1687
|
] }),
|
|
1668
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx27("span", { className: cn("mt-1 text-xs font-normal", isCompleted || isActive ? "text-primary" : "text-muted"), children: step.label })
|
|
1669
1689
|
] }, step.label);
|
|
1670
1690
|
}) });
|
|
1671
1691
|
};
|
|
1672
1692
|
|
|
1673
1693
|
// src/components/switch.tsx
|
|
1674
1694
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
1675
|
-
import * as
|
|
1676
|
-
import { jsx as
|
|
1677
|
-
var Switch =
|
|
1695
|
+
import * as React14 from "react";
|
|
1696
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1697
|
+
var Switch = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1678
1698
|
SwitchPrimitive.Root,
|
|
1679
1699
|
{
|
|
1680
1700
|
className: cn(
|
|
@@ -1683,7 +1703,7 @@ var Switch = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
1683
1703
|
),
|
|
1684
1704
|
ref,
|
|
1685
1705
|
...props,
|
|
1686
|
-
children: /* @__PURE__ */
|
|
1706
|
+
children: /* @__PURE__ */ jsx28(SwitchPrimitive.Thumb, { className: "bg-surface pointer-events-none absolute top-[3px] left-[3px] block h-[18px] w-[18px] rounded-full shadow-lg transition-transform data-[state=checked]:translate-x-6" })
|
|
1687
1707
|
}
|
|
1688
1708
|
));
|
|
1689
1709
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
@@ -1691,7 +1711,7 @@ Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
|
1691
1711
|
// src/components/toast/toast.tsx
|
|
1692
1712
|
import { CheckIcon as CheckIcon2, FileLockIcon, InfoIcon as InfoIcon2, WarningIcon as WarningIcon2, XIcon as XIcon4 } from "@phosphor-icons/react";
|
|
1693
1713
|
import { useEffect as useEffect5, useRef as useRef4, useState as useState5 } from "react";
|
|
1694
|
-
import { jsx as
|
|
1714
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1695
1715
|
var EXIT_ANIMATION_MS = 200;
|
|
1696
1716
|
var typeIcons = {
|
|
1697
1717
|
destructive: XIcon4,
|
|
@@ -1728,7 +1748,7 @@ function Toast({ duration = 2500, id, onClose, subtitle, title, type }) {
|
|
|
1728
1748
|
if (exitRef.current) clearTimeout(exitRef.current);
|
|
1729
1749
|
};
|
|
1730
1750
|
}, [id, duration, onClose]);
|
|
1731
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ jsxs21(
|
|
1732
1752
|
"div",
|
|
1733
1753
|
{
|
|
1734
1754
|
"aria-live": "polite",
|
|
@@ -1746,13 +1766,13 @@ function Toast({ duration = 2500, id, onClose, subtitle, title, type }) {
|
|
|
1746
1766
|
),
|
|
1747
1767
|
role: "status",
|
|
1748
1768
|
children: [
|
|
1749
|
-
/* @__PURE__ */
|
|
1750
|
-
subtitle ? /* @__PURE__ */
|
|
1751
|
-
/* @__PURE__ */
|
|
1769
|
+
/* @__PURE__ */ jsx29("div", { className: "min-w-0 pr-4", children: /* @__PURE__ */ jsx29("h4", { className: cn("text-[16px] leading-normal font-semibold", "text-foreground", "line-clamp-2"), children: title }) }),
|
|
1770
|
+
subtitle ? /* @__PURE__ */ jsx29("div", { className: "shrink-0 pr-4 text-left", children: /* @__PURE__ */ jsx29("div", { className: cn("max-w-28 text-[14px] leading-[19.5px] font-normal", "text-body"), children: subtitle }) }) : null,
|
|
1771
|
+
/* @__PURE__ */ jsx29(
|
|
1752
1772
|
"div",
|
|
1753
1773
|
{
|
|
1754
1774
|
className: cn("shrink-0", "flex h-8 w-8 min-w-8 items-center justify-center rounded-full border-2", styles.iconBorder),
|
|
1755
|
-
children: /* @__PURE__ */
|
|
1775
|
+
children: /* @__PURE__ */ jsx29(Icon, { className: cn("h-5 w-5", styles.icon) })
|
|
1756
1776
|
}
|
|
1757
1777
|
)
|
|
1758
1778
|
]
|
|
@@ -1762,7 +1782,7 @@ function Toast({ duration = 2500, id, onClose, subtitle, title, type }) {
|
|
|
1762
1782
|
|
|
1763
1783
|
// src/components/toast/toast-provider.tsx
|
|
1764
1784
|
import { useCallback as useCallback3, useEffect as useEffect6, useLayoutEffect, useMemo as useMemo4, useRef as useRef5, useState as useState6 } from "react";
|
|
1765
|
-
import { Fragment as Fragment4, jsx as
|
|
1785
|
+
import { Fragment as Fragment4, jsx as jsx30 } from "react/jsx-runtime";
|
|
1766
1786
|
function ToastProvider() {
|
|
1767
1787
|
const [toasts, setToasts] = useState6([]);
|
|
1768
1788
|
const itemRefs = useRef5(/* @__PURE__ */ new Map());
|
|
@@ -1823,7 +1843,7 @@ function ToastProvider() {
|
|
|
1823
1843
|
itemRefs.current.set(id, el);
|
|
1824
1844
|
};
|
|
1825
1845
|
}, []);
|
|
1826
|
-
return /* @__PURE__ */
|
|
1846
|
+
return /* @__PURE__ */ jsx30(Fragment4, { children: Object.entries(grouped).map(([position, list]) => /* @__PURE__ */ jsx30("div", { className: `fixed ${zToast} ${getPositionClass(position)}`, children: /* @__PURE__ */ jsx30("div", { className: "relative flex flex-col gap-3", children: list.map((toast2) => /* @__PURE__ */ jsx30("div", { ref: setItemRef(toast2.id), children: /* @__PURE__ */ jsx30(
|
|
1827
1847
|
Toast,
|
|
1828
1848
|
{
|
|
1829
1849
|
duration: toast2.duration,
|
|
@@ -1851,14 +1871,15 @@ function getPositionClass(position) {
|
|
|
1851
1871
|
}
|
|
1852
1872
|
|
|
1853
1873
|
// src/components/wrapper.tsx
|
|
1854
|
-
import { jsx as
|
|
1874
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1855
1875
|
var Wrapper = ({ children, className }) => {
|
|
1856
|
-
return /* @__PURE__ */
|
|
1876
|
+
return /* @__PURE__ */ jsx31("div", { className: cn("mx-auto h-full w-full", className), children });
|
|
1857
1877
|
};
|
|
1858
1878
|
export {
|
|
1859
1879
|
AddTile,
|
|
1860
1880
|
Alert,
|
|
1861
1881
|
AuthHeader,
|
|
1882
|
+
Breadcrumb,
|
|
1862
1883
|
Button,
|
|
1863
1884
|
Chip,
|
|
1864
1885
|
Command,
|