@douglasneuroinformatics/libui 1.5.0 → 2.0.0-beta.2

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.
@@ -1,9 +1,15 @@
1
+ import {
2
+ LegacyStepperContext,
3
+ useNotificationsStore,
4
+ useTheme,
5
+ useWindowSize
6
+ } from "../chunk-IP3LSCUG.js";
1
7
  import {
2
8
  cn
3
9
  } from "../chunk-PAAJ5AH3.js";
4
10
 
5
11
  // src/components/Accordion/AccordionContent.tsx
6
- import * as React from "react";
12
+ import React from "react";
7
13
  import * as AccordionPrimitive from "@radix-ui/react-accordion";
8
14
  import { jsx } from "react/jsx-runtime";
9
15
  var AccordionContent = React.forwardRef(function AccordionContent2({ children, className, ...props }, ref) {
@@ -19,7 +25,7 @@ var AccordionContent = React.forwardRef(function AccordionContent2({ children, c
19
25
  });
20
26
 
21
27
  // src/components/Accordion/AccordionItem.tsx
22
- import * as React2 from "react";
28
+ import React2 from "react";
23
29
  import * as AccordionPrimitive2 from "@radix-ui/react-accordion";
24
30
  import { jsx as jsx2 } from "react/jsx-runtime";
25
31
  var AccordionItem = React2.forwardRef(function AccordionItem2({ className, ...props }, ref) {
@@ -27,7 +33,7 @@ var AccordionItem = React2.forwardRef(function AccordionItem2({ className, ...pr
27
33
  });
28
34
 
29
35
  // src/components/Accordion/AccordionRoot.tsx
30
- import * as React3 from "react";
36
+ import React3 from "react";
31
37
  import * as AccordionPrimitive3 from "@radix-ui/react-accordion";
32
38
  import { jsx as jsx3 } from "react/jsx-runtime";
33
39
  var AccordionRoot = React3.forwardRef(function AccordionRoot2(props, ref) {
@@ -35,7 +41,7 @@ var AccordionRoot = React3.forwardRef(function AccordionRoot2(props, ref) {
35
41
  });
36
42
 
37
43
  // src/components/Accordion/AccordionTrigger.tsx
38
- import * as React4 from "react";
44
+ import React4 from "react";
39
45
  import * as AccordionPrimitive4 from "@radix-ui/react-accordion";
40
46
  import { ChevronDownIcon } from "lucide-react";
41
47
  import { jsx as jsx4, jsxs } from "react/jsx-runtime";
@@ -64,9 +70,13 @@ var Accordion = Object.assign(AccordionRoot, {
64
70
  Trigger: AccordionTrigger
65
71
  });
66
72
 
67
- // src/components/ArrowToggle/ArrowToggle.tsx
68
- import React6, { useMemo } from "react";
69
- import { ChevronUpIcon } from "lucide-react";
73
+ // src/components/AlertDialog/AlertDialog.tsx
74
+ import { Root as Root2 } from "@radix-ui/react-alert-dialog";
75
+ import { Trigger as Trigger2 } from "@radix-ui/react-alert-dialog";
76
+
77
+ // src/components/AlertDialog/AlertDialogAction.tsx
78
+ import React6 from "react";
79
+ import { Action } from "@radix-ui/react-alert-dialog";
70
80
 
71
81
  // src/components/Button/Button.tsx
72
82
  import React5 from "react";
@@ -111,9 +121,103 @@ var Button = React5.forwardRef(function Button2({ asChild, children, className,
111
121
  ] });
112
122
  });
113
123
 
114
- // src/components/ArrowToggle/ArrowToggle.tsx
124
+ // src/components/AlertDialog/AlertDialogAction.tsx
115
125
  import { jsx as jsx6 } from "react/jsx-runtime";
116
- var ArrowToggle = React6.forwardRef(function ArrowToggle2({ className, isToggled, position, rotation = 0, variant = "ghost", ...props }, ref) {
126
+ var AlertDialogAction = React6.forwardRef(function AlertDialogAction2({ className, ...props }, ref) {
127
+ return /* @__PURE__ */ jsx6(Action, { className: cn(buttonVariants(), className), ref, ...props });
128
+ });
129
+
130
+ // src/components/AlertDialog/AlertDialogCancel.tsx
131
+ import React7 from "react";
132
+ import { Cancel } from "@radix-ui/react-alert-dialog";
133
+ import { jsx as jsx7 } from "react/jsx-runtime";
134
+ var AlertDialogCancel = React7.forwardRef(function AlertDialogCancel2({ className, ...props }, ref) {
135
+ return /* @__PURE__ */ jsx7(Cancel, { className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className), ref, ...props });
136
+ });
137
+
138
+ // src/components/AlertDialog/AlertDialogContent.tsx
139
+ import React9 from "react";
140
+ import { Content as Content2, Portal } from "@radix-ui/react-alert-dialog";
141
+
142
+ // src/components/AlertDialog/AlertDialogOverlay.tsx
143
+ import React8 from "react";
144
+ import { Overlay } from "@radix-ui/react-alert-dialog";
145
+ import { jsx as jsx8 } from "react/jsx-runtime";
146
+ var AlertDialogOverlay = React8.forwardRef(function AlertDialogOverlay2({ className, ...props }, ref) {
147
+ return /* @__PURE__ */ jsx8(
148
+ Overlay,
149
+ {
150
+ className: cn(
151
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
152
+ className
153
+ ),
154
+ ...props,
155
+ ref
156
+ }
157
+ );
158
+ });
159
+
160
+ // src/components/AlertDialog/AlertDialogContent.tsx
161
+ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
162
+ var AlertDialogContent = React9.forwardRef(function AlertDialogContent2({ className, ...props }, ref) {
163
+ return /* @__PURE__ */ jsxs3(Portal, { children: [
164
+ /* @__PURE__ */ jsx9(AlertDialogOverlay, {}),
165
+ /* @__PURE__ */ jsx9(
166
+ Content2,
167
+ {
168
+ className: cn(
169
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
170
+ className
171
+ ),
172
+ ref,
173
+ ...props
174
+ }
175
+ )
176
+ ] });
177
+ });
178
+
179
+ // src/components/AlertDialog/AlertDialogDescription.tsx
180
+ import React10 from "react";
181
+ import { Description } from "@radix-ui/react-alert-dialog";
182
+ import { jsx as jsx10 } from "react/jsx-runtime";
183
+ var AlertDialogDescription = React10.forwardRef(function AlertDialogDescription2({ className, ...props }, ref) {
184
+ return /* @__PURE__ */ jsx10(Description, { className: cn("text-sm text-muted-foreground", className), ref, ...props });
185
+ });
186
+
187
+ // src/components/AlertDialog/AlertDialogFooter.tsx
188
+ import { jsx as jsx11 } from "react/jsx-runtime";
189
+ var AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx11("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
190
+
191
+ // src/components/AlertDialog/AlertDialogHeader.tsx
192
+ import { jsx as jsx12 } from "react/jsx-runtime";
193
+ var AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx12("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props });
194
+
195
+ // src/components/AlertDialog/AlertDialogTitle.tsx
196
+ import React11 from "react";
197
+ import { Title } from "@radix-ui/react-alert-dialog";
198
+ import { jsx as jsx13 } from "react/jsx-runtime";
199
+ var AlertDialogTitle = React11.forwardRef(function AlertDialogTitle2({ className, ...props }, ref) {
200
+ return /* @__PURE__ */ jsx13(Title, { className: cn("text-lg font-semibold", className), ref, ...props });
201
+ });
202
+
203
+ // src/components/AlertDialog/AlertDialog.tsx
204
+ var AlertDialog = Object.assign(Root2, {
205
+ Action: AlertDialogAction,
206
+ Cancel: AlertDialogCancel,
207
+ Content: AlertDialogContent,
208
+ Description: AlertDialogDescription,
209
+ Footer: AlertDialogFooter,
210
+ Header: AlertDialogHeader,
211
+ Overlay: AlertDialogOverlay,
212
+ Title: AlertDialogTitle,
213
+ Trigger: Trigger2
214
+ });
215
+
216
+ // src/components/ArrowToggle/ArrowToggle.tsx
217
+ import React12, { useMemo } from "react";
218
+ import { ChevronUpIcon } from "lucide-react";
219
+ import { jsx as jsx14 } from "react/jsx-runtime";
220
+ var ArrowToggle = React12.forwardRef(function ArrowToggle2({ className, isToggled, position, rotation = 0, variant = "ghost", ...props }, ref) {
117
221
  const computedRotation = useMemo(() => {
118
222
  const toggleRotation = isToggled ? rotation : 0;
119
223
  switch (position) {
@@ -127,7 +231,7 @@ var ArrowToggle = React6.forwardRef(function ArrowToggle2({ className, isToggled
127
231
  return 270 + toggleRotation;
128
232
  }
129
233
  }, [position, rotation, isToggled]);
130
- return /* @__PURE__ */ jsx6(
234
+ return /* @__PURE__ */ jsx14(
131
235
  Button,
132
236
  {
133
237
  className: cn("h-6 w-6", className),
@@ -137,7 +241,7 @@ var ArrowToggle = React6.forwardRef(function ArrowToggle2({ className, isToggled
137
241
  type: "button",
138
242
  variant,
139
243
  ...props,
140
- children: /* @__PURE__ */ jsx6(
244
+ children: /* @__PURE__ */ jsx14(
141
245
  ChevronUpIcon,
142
246
  {
143
247
  className: "transform-gpu transition-transform",
@@ -149,42 +253,3456 @@ var ArrowToggle = React6.forwardRef(function ArrowToggle2({ className, isToggled
149
253
  );
150
254
  });
151
255
 
152
- // src/components/Input/Input.tsx
153
- import * as React7 from "react";
154
- import { jsx as jsx7 } from "react/jsx-runtime";
155
- var Input = React7.forwardRef(function Input2({ className, type, ...props }, ref) {
156
- return /* @__PURE__ */ jsx7(
157
- "input",
256
+ // src/components/Avatar/AvatarFallback.tsx
257
+ import React13 from "react";
258
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
259
+ import { jsx as jsx15 } from "react/jsx-runtime";
260
+ var AvatarFallback = React13.forwardRef(function AvatarFallback2({ className, ...props }, ref) {
261
+ return /* @__PURE__ */ jsx15(
262
+ AvatarPrimitive.Fallback,
263
+ {
264
+ className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className),
265
+ ref,
266
+ ...props
267
+ }
268
+ );
269
+ });
270
+
271
+ // src/components/Avatar/AvatarImage.tsx
272
+ import React14 from "react";
273
+ import * as AvatarPrimitive2 from "@radix-ui/react-avatar";
274
+ import { jsx as jsx16 } from "react/jsx-runtime";
275
+ var AvatarImage = React14.forwardRef(function AvatarImage2({ className, ...props }, ref) {
276
+ return /* @__PURE__ */ jsx16(AvatarPrimitive2.Image, { className: cn("aspect-square h-full w-full", className), ref, ...props });
277
+ });
278
+
279
+ // src/components/Avatar/AvatarRoot.tsx
280
+ import React15 from "react";
281
+ import * as AvatarPrimitive3 from "@radix-ui/react-avatar";
282
+ import { jsx as jsx17 } from "react/jsx-runtime";
283
+ var AvatarRoot = React15.forwardRef(function AvatarRoot2({ className, ...props }, ref) {
284
+ return /* @__PURE__ */ jsx17(
285
+ AvatarPrimitive3.Root,
286
+ {
287
+ className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
288
+ "data-testid": "avatar",
289
+ ref,
290
+ ...props
291
+ }
292
+ );
293
+ });
294
+
295
+ // src/components/Avatar/Avatar.tsx
296
+ var Avatar = Object.assign(AvatarRoot, {
297
+ Fallback: AvatarFallback,
298
+ Image: AvatarImage
299
+ });
300
+
301
+ // src/components/Badge/Badge.tsx
302
+ import "react";
303
+ import { cva as cva2 } from "class-variance-authority";
304
+ import { jsx as jsx18 } from "react/jsx-runtime";
305
+ var badgeVariants = cva2(
306
+ "inline-flex items-center rounded-sm border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
307
+ {
308
+ defaultVariants: {
309
+ variant: "default"
310
+ },
311
+ variants: {
312
+ variant: {
313
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
314
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
315
+ outline: "text-foreground",
316
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80"
317
+ }
318
+ }
319
+ }
320
+ );
321
+ var Badge = ({ className, variant, ...props }) => {
322
+ return /* @__PURE__ */ jsx18("div", { className: cn(badgeVariants({ variant }), className), "data-testid": "badge", ...props });
323
+ };
324
+
325
+ // src/components/Breadcrumb/BreadcrumbEllipsis.tsx
326
+ import { MoreHorizontalIcon } from "lucide-react";
327
+ import { jsx as jsx19 } from "react/jsx-runtime";
328
+ var BreadcrumbEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsx19(
329
+ "span",
330
+ {
331
+ "aria-hidden": "true",
332
+ className: cn("flex h-9 w-9 items-center justify-center", className),
333
+ role: "presentation",
334
+ ...props,
335
+ children: /* @__PURE__ */ jsx19(MoreHorizontalIcon, { className: "h-4 w-4" })
336
+ }
337
+ );
338
+
339
+ // src/components/Breadcrumb/BreadcrumbItem.tsx
340
+ import React17 from "react";
341
+ import { jsx as jsx20 } from "react/jsx-runtime";
342
+ var BreadcrumbItem = React17.forwardRef(
343
+ function BreadcrumbItem2({ className, ...props }, ref) {
344
+ return /* @__PURE__ */ jsx20("li", { className: cn("inline-flex items-center gap-1.5", className), ref, ...props });
345
+ }
346
+ );
347
+
348
+ // src/components/Breadcrumb/BreadcrumbLink.tsx
349
+ import React18 from "react";
350
+ import { Slot as Slot2 } from "@radix-ui/react-slot";
351
+ import { jsx as jsx21 } from "react/jsx-runtime";
352
+ var BreadcrumbLink = React18.forwardRef(function BreadcrumbLink2({ asChild, className, ...props }, ref) {
353
+ const Comp = asChild ? Slot2 : "a";
354
+ return /* @__PURE__ */ jsx21(Comp, { className: cn("transition-colors hover:text-foreground", className), ref, ...props });
355
+ });
356
+
357
+ // src/components/Breadcrumb/BreadcrumbList.tsx
358
+ import React19 from "react";
359
+ import { jsx as jsx22 } from "react/jsx-runtime";
360
+ var BreadcrumbList = React19.forwardRef(
361
+ function BreadcrumbList2({ className, ...props }, ref) {
362
+ return /* @__PURE__ */ jsx22(
363
+ "ol",
364
+ {
365
+ className: cn(
366
+ "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
367
+ className
368
+ ),
369
+ ref,
370
+ ...props
371
+ }
372
+ );
373
+ }
374
+ );
375
+
376
+ // src/components/Breadcrumb/BreadcrumbPage.tsx
377
+ import React20 from "react";
378
+ import { jsx as jsx23 } from "react/jsx-runtime";
379
+ var BreadcrumbPage = React20.forwardRef(
380
+ function BreadcrumbPage2({ className, ...props }, ref) {
381
+ return /* @__PURE__ */ jsx23(
382
+ "span",
383
+ {
384
+ "aria-current": "page",
385
+ "aria-disabled": "true",
386
+ className: cn("font-normal text-foreground", className),
387
+ ref,
388
+ role: "link",
389
+ ...props
390
+ }
391
+ );
392
+ }
393
+ );
394
+
395
+ // src/components/Breadcrumb/BreadcrumbRoot.tsx
396
+ import React21 from "react";
397
+ import { jsx as jsx24 } from "react/jsx-runtime";
398
+ var BreadcrumbRoot = React21.forwardRef(function BreadcrumbRoot2({ ...props }, ref) {
399
+ return /* @__PURE__ */ jsx24("nav", { "aria-label": "breadcrumb", ref, ...props });
400
+ });
401
+
402
+ // src/components/Breadcrumb/BreadcrumbSeparator.tsx
403
+ import { ChevronRightIcon } from "lucide-react";
404
+ import { jsx as jsx25 } from "react/jsx-runtime";
405
+ var BreadcrumbSeparator = ({ children, className, ...props }) => /* @__PURE__ */ jsx25("li", { "aria-hidden": "true", className: cn("[&>svg]:size-3.5", className), role: "presentation", ...props, children: children ?? /* @__PURE__ */ jsx25(ChevronRightIcon, {}) });
406
+
407
+ // src/components/Breadcrumb/Breadcrumb.tsx
408
+ var Breadcrumb = Object.assign(BreadcrumbRoot, {
409
+ Ellipsis: BreadcrumbEllipsis,
410
+ Item: BreadcrumbItem,
411
+ Link: BreadcrumbLink,
412
+ List: BreadcrumbList,
413
+ Page: BreadcrumbPage,
414
+ Separator: BreadcrumbSeparator
415
+ });
416
+
417
+ // src/components/Card/Card.tsx
418
+ import React22 from "react";
419
+ import { jsx as jsx26 } from "react/jsx-runtime";
420
+ var CardRoot = React22.forwardRef(function CardRoot2({ className, ...props }, ref) {
421
+ return /* @__PURE__ */ jsx26(
422
+ "div",
423
+ {
424
+ className: cn("rounded-xl border bg-card text-card-foreground shadow", className),
425
+ "data-testid": "card",
426
+ ref,
427
+ ...props
428
+ }
429
+ );
430
+ });
431
+ var Card = Object.assign(CardRoot, {
432
+ Content: ({ className, ...props }) => /* @__PURE__ */ jsx26("div", { className: cn("p-6 pt-0", className), ...props }),
433
+ Description: ({ className, ...props }) => /* @__PURE__ */ jsx26("p", { className: cn("text-sm text-muted-foreground", className), ...props }),
434
+ Footer: ({ className, ...props }) => {
435
+ return /* @__PURE__ */ jsx26("div", { className: cn("flex items-center p-6 pt-0", className), ...props });
436
+ },
437
+ Header: ({ className, ...props }) => /* @__PURE__ */ jsx26("div", { className: cn("flex flex-col space-y-1.5 p-6", className), ...props }),
438
+ Title: ({ children, className, ...props }) => /* @__PURE__ */ jsx26("h3", { className: cn("font-semibold leading-none tracking-tight", className), ...props, children })
439
+ });
440
+
441
+ // src/components/Checkbox/Checkbox.tsx
442
+ import React23 from "react";
443
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
444
+ import { CheckIcon } from "lucide-react";
445
+ import { jsx as jsx27 } from "react/jsx-runtime";
446
+ var Checkbox = React23.forwardRef(function Checkbox2({ className, ...props }, ref) {
447
+ return /* @__PURE__ */ jsx27(
448
+ CheckboxPrimitive.Root,
158
449
  {
159
- autoComplete: "off",
160
450
  className: cn(
161
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
451
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
452
+ className
453
+ ),
454
+ "data-testid": "checkbox",
455
+ ref,
456
+ ...props,
457
+ children: /* @__PURE__ */ jsx27(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: /* @__PURE__ */ jsx27(CheckIcon, { className: "h-4 w-4" }) })
458
+ }
459
+ );
460
+ });
461
+
462
+ // src/components/Collapsible/Collapsible.tsx
463
+ import { Content as Content3, Root as Root5, Trigger as Trigger3 } from "@radix-ui/react-collapsible";
464
+ var Collapsible = Object.assign(Root5, {
465
+ Content: Content3,
466
+ Trigger: Trigger3
467
+ });
468
+
469
+ // src/components/Command/Command.tsx
470
+ import React31 from "react";
471
+ import { Command as CommandPrimitive7 } from "cmdk";
472
+
473
+ // src/components/Command/CommandEmpty.tsx
474
+ import React24 from "react";
475
+ import { Command as CommandPrimitive } from "cmdk";
476
+ import { jsx as jsx28 } from "react/jsx-runtime";
477
+ var CommandEmpty = React24.forwardRef(function CommandEmpty2(props, ref) {
478
+ return /* @__PURE__ */ jsx28(CommandPrimitive.Empty, { className: "py-6 text-center text-sm", ref, ...props });
479
+ });
480
+
481
+ // src/components/Command/CommandGroup.tsx
482
+ import React25 from "react";
483
+ import { Command as CommandPrimitive2 } from "cmdk";
484
+ import { jsx as jsx29 } from "react/jsx-runtime";
485
+ var CommandGroup = React25.forwardRef(function CommandGroup2({ className, ...props }, ref) {
486
+ return /* @__PURE__ */ jsx29(
487
+ CommandPrimitive2.Group,
488
+ {
489
+ className: cn(
490
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
162
491
  className
163
492
  ),
164
- "data-testid": "input",
165
493
  ref,
166
- type,
167
494
  ...props
168
495
  }
169
496
  );
170
497
  });
171
498
 
172
- // src/components/Label/Label.tsx
173
- import * as React8 from "react";
174
- import * as LabelPrimitive from "@radix-ui/react-label";
175
- import { cva as cva2 } from "class-variance-authority";
176
- import { jsx as jsx8 } from "react/jsx-runtime";
177
- var labelVariants = cva2("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
178
- var Label = React8.forwardRef(function Label2({ className, ...props }, ref) {
179
- return /* @__PURE__ */ jsx8(LabelPrimitive.Root, { className: cn(labelVariants(), className), ref, ...props });
499
+ // src/components/Command/CommandInput.tsx
500
+ import React26 from "react";
501
+ import { Command as CommandPrimitive3 } from "cmdk";
502
+ import { SearchIcon } from "lucide-react";
503
+ import { jsx as jsx30, jsxs as jsxs4 } from "react/jsx-runtime";
504
+ var CommandInput = React26.forwardRef(function CommandInput2({ className, ...props }, ref) {
505
+ return (
506
+ // eslint-disable-next-line react/no-unknown-property
507
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
508
+ /* @__PURE__ */ jsx30(SearchIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
509
+ /* @__PURE__ */ jsx30(
510
+ CommandPrimitive3.Input,
511
+ {
512
+ className: cn(
513
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
514
+ className
515
+ ),
516
+ ref,
517
+ ...props
518
+ }
519
+ )
520
+ ] })
521
+ );
522
+ });
523
+
524
+ // src/components/Command/CommandItem.tsx
525
+ import React27 from "react";
526
+ import { Command as CommandPrimitive4 } from "cmdk";
527
+ import { jsx as jsx31 } from "react/jsx-runtime";
528
+ var CommandItem = React27.forwardRef(function CommandItem2({ className, ...props }, ref) {
529
+ return /* @__PURE__ */ jsx31(
530
+ CommandPrimitive4.Item,
531
+ {
532
+ className: cn(
533
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
534
+ className
535
+ ),
536
+ ref,
537
+ ...props
538
+ }
539
+ );
540
+ });
541
+
542
+ // src/components/Command/CommandList.tsx
543
+ import React28 from "react";
544
+ import { Command as CommandPrimitive5 } from "cmdk";
545
+ import { jsx as jsx32 } from "react/jsx-runtime";
546
+ var CommandList = React28.forwardRef(function CommandList2({ className, ...props }, ref) {
547
+ return /* @__PURE__ */ jsx32(
548
+ CommandPrimitive5.List,
549
+ {
550
+ className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
551
+ ref,
552
+ ...props
553
+ }
554
+ );
555
+ });
556
+
557
+ // src/components/Command/CommandSeparator.tsx
558
+ import React29 from "react";
559
+ import { Command as CommandPrimitive6 } from "cmdk";
560
+ import { jsx as jsx33 } from "react/jsx-runtime";
561
+ var CommandSeparator = React29.forwardRef(function CommandSeparator2({ className, ...props }, ref) {
562
+ return /* @__PURE__ */ jsx33(CommandPrimitive6.Separator, { className: cn("-mx-1 h-px bg-border", className), ref, ...props });
563
+ });
564
+
565
+ // src/components/Command/CommandShortcut.tsx
566
+ import "react";
567
+ import { jsx as jsx34 } from "react/jsx-runtime";
568
+ var CommandShortcut = ({ className, ...props }) => {
569
+ return /* @__PURE__ */ jsx34("span", { className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props });
570
+ };
571
+
572
+ // src/components/Command/Command.tsx
573
+ import { jsx as jsx35 } from "react/jsx-runtime";
574
+ var CommandRoot = React31.forwardRef(function Command({ className, ...props }, ref) {
575
+ return /* @__PURE__ */ jsx35(
576
+ CommandPrimitive7,
577
+ {
578
+ className: cn(
579
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
580
+ className
581
+ ),
582
+ ref,
583
+ ...props
584
+ }
585
+ );
586
+ });
587
+ var Command2 = Object.assign(CommandRoot, {
588
+ Empty: CommandEmpty,
589
+ Group: CommandGroup,
590
+ Input: CommandInput,
591
+ Item: CommandItem,
592
+ List: CommandList,
593
+ Separator: CommandSeparator,
594
+ Shortcut: CommandShortcut
595
+ });
596
+
597
+ // src/components/ContextMenu/ContextMenu.tsx
598
+ import { Group, Portal as Portal3, RadioGroup, Root as Root6, Sub, Trigger as Trigger4 } from "@radix-ui/react-context-menu";
599
+
600
+ // src/components/ContextMenu/ContextMenuCheckboxItem.tsx
601
+ import React32 from "react";
602
+ import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
603
+ import { CheckIcon as CheckIcon2 } from "lucide-react";
604
+ import { jsx as jsx36, jsxs as jsxs5 } from "react/jsx-runtime";
605
+ var ContextMenuCheckboxItem = React32.forwardRef(function ContextMenuCheckboxItem2({ checked, children, className, ...props }, ref) {
606
+ return /* @__PURE__ */ jsxs5(
607
+ ContextMenuPrimitive.CheckboxItem,
608
+ {
609
+ checked,
610
+ className: cn(
611
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
612
+ className
613
+ ),
614
+ ref,
615
+ ...props,
616
+ children: [
617
+ /* @__PURE__ */ jsx36("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx36(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx36(CheckIcon2, { className: "h-4 w-4" }) }) }),
618
+ children
619
+ ]
620
+ }
621
+ );
622
+ });
623
+
624
+ // src/components/ContextMenu/ContextMenuContent.tsx
625
+ import React33 from "react";
626
+ import * as ContextMenuPrimitive2 from "@radix-ui/react-context-menu";
627
+ import { jsx as jsx37 } from "react/jsx-runtime";
628
+ var ContextMenuContent = React33.forwardRef(function ContextMenuContent2({ className, ...props }, ref) {
629
+ return /* @__PURE__ */ jsx37(ContextMenuPrimitive2.Portal, { children: /* @__PURE__ */ jsx37(
630
+ ContextMenuPrimitive2.Content,
631
+ {
632
+ className: cn(
633
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
634
+ className
635
+ ),
636
+ ref,
637
+ ...props
638
+ }
639
+ ) });
640
+ });
641
+
642
+ // src/components/ContextMenu/ContextMenuItem.tsx
643
+ import React34 from "react";
644
+ import * as ContextMenuPrimitive3 from "@radix-ui/react-context-menu";
645
+ import { jsx as jsx38 } from "react/jsx-runtime";
646
+ var ContextMenuItem = React34.forwardRef(function ContextMenuItem2({ className, inset, ...props }, ref) {
647
+ return /* @__PURE__ */ jsx38(
648
+ ContextMenuPrimitive3.Item,
649
+ {
650
+ className: cn(
651
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
652
+ inset && "pl-8",
653
+ className
654
+ ),
655
+ ref,
656
+ ...props
657
+ }
658
+ );
659
+ });
660
+
661
+ // src/components/ContextMenu/ContextMenuLabel.tsx
662
+ import React35 from "react";
663
+ import * as ContextMenuPrimitive4 from "@radix-ui/react-context-menu";
664
+ import { jsx as jsx39 } from "react/jsx-runtime";
665
+ var ContextMenuLabel = React35.forwardRef(function ContextMenuLabel2({ className, inset, ...props }, ref) {
666
+ return /* @__PURE__ */ jsx39(
667
+ ContextMenuPrimitive4.Label,
668
+ {
669
+ className: cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className),
670
+ ref,
671
+ ...props
672
+ }
673
+ );
674
+ });
675
+
676
+ // src/components/ContextMenu/ContextMenuRadioItem.tsx
677
+ import React36 from "react";
678
+ import * as ContextMenuPrimitive5 from "@radix-ui/react-context-menu";
679
+ import { CircleIcon } from "lucide-react";
680
+ import { jsx as jsx40, jsxs as jsxs6 } from "react/jsx-runtime";
681
+ var ContextMenuRadioItem = React36.forwardRef(function ContextMenuRadioItem2({ children, className, ...props }, ref) {
682
+ return /* @__PURE__ */ jsxs6(
683
+ ContextMenuPrimitive5.RadioItem,
684
+ {
685
+ className: cn(
686
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
687
+ className
688
+ ),
689
+ ref,
690
+ ...props,
691
+ children: [
692
+ /* @__PURE__ */ jsx40("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx40(ContextMenuPrimitive5.ItemIndicator, { children: /* @__PURE__ */ jsx40(CircleIcon, { className: "fill-current", style: { height: 8, width: 8 } }) }) }),
693
+ children
694
+ ]
695
+ }
696
+ );
697
+ });
698
+
699
+ // src/components/ContextMenu/ContextMenuSeparator.tsx
700
+ import React37 from "react";
701
+ import * as ContextMenuPrimitive6 from "@radix-ui/react-context-menu";
702
+ import { jsx as jsx41 } from "react/jsx-runtime";
703
+ var ContextMenuSeparator = React37.forwardRef(function ContextMenuSeparator2({ className, ...props }, ref) {
704
+ return /* @__PURE__ */ jsx41(ContextMenuPrimitive6.Separator, { className: cn("-mx-1 my-1 h-px bg-border", className), ref, ...props });
705
+ });
706
+
707
+ // src/components/ContextMenu/ContextMenuShortcut.tsx
708
+ import "react";
709
+ import { jsx as jsx42 } from "react/jsx-runtime";
710
+ var ContextMenuShortcut = ({ className, ...props }) => {
711
+ return /* @__PURE__ */ jsx42("span", { className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props });
712
+ };
713
+
714
+ // src/components/ContextMenu/ContextMenuSubContent.tsx
715
+ import React39 from "react";
716
+ import * as ContextMenuPrimitive7 from "@radix-ui/react-context-menu";
717
+ import { jsx as jsx43 } from "react/jsx-runtime";
718
+ var ContextMenuSubContent = React39.forwardRef(function ContextMenuSubContent2({ className, ...props }, ref) {
719
+ return /* @__PURE__ */ jsx43(
720
+ ContextMenuPrimitive7.SubContent,
721
+ {
722
+ className: cn(
723
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
724
+ className
725
+ ),
726
+ ref,
727
+ ...props
728
+ }
729
+ );
730
+ });
731
+
732
+ // src/components/ContextMenu/ContextMenuSubTrigger.tsx
733
+ import React40 from "react";
734
+ import * as ContextMenuPrimitive8 from "@radix-ui/react-context-menu";
735
+ import { ChevronRightIcon as ChevronRightIcon2 } from "lucide-react";
736
+ import { jsx as jsx44, jsxs as jsxs7 } from "react/jsx-runtime";
737
+ var ContextMenuSubTrigger = React40.forwardRef(function ContextMenuSubTrigger2({ children, className, inset, ...props }, ref) {
738
+ return /* @__PURE__ */ jsxs7(
739
+ ContextMenuPrimitive8.SubTrigger,
740
+ {
741
+ className: cn(
742
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
743
+ inset && "pl-8",
744
+ className
745
+ ),
746
+ ref,
747
+ ...props,
748
+ children: [
749
+ children,
750
+ /* @__PURE__ */ jsx44(ChevronRightIcon2, { className: "ml-auto h-4 w-4" })
751
+ ]
752
+ }
753
+ );
754
+ });
755
+
756
+ // src/components/ContextMenu/ContextMenu.tsx
757
+ var ContextMenu = Object.assign(Root6, {
758
+ CheckboxItem: ContextMenuCheckboxItem,
759
+ Content: ContextMenuContent,
760
+ Group,
761
+ Item: ContextMenuItem,
762
+ Label: ContextMenuLabel,
763
+ Portal: Portal3,
764
+ RadioGroup,
765
+ RadioItem: ContextMenuRadioItem,
766
+ Separator: ContextMenuSeparator,
767
+ Shortcut: ContextMenuShortcut,
768
+ Sub,
769
+ SubContent: ContextMenuSubContent,
770
+ SubTrigger: ContextMenuSubTrigger,
771
+ Trigger: Trigger4
772
+ });
773
+
774
+ // src/components/DatePicker/DatePicker.tsx
775
+ import React44, { useReducer, useState } from "react";
776
+ import { AnimatePresence as AnimatePresence2, motion as motion2 } from "framer-motion";
777
+ import { useTranslation as useTranslation2 } from "react-i18next";
778
+
779
+ // src/components/DatePicker/Calendar.tsx
780
+ import React41 from "react";
781
+ import { AnimatePresence, motion } from "framer-motion";
782
+ import { range } from "lodash-es";
783
+ import { useTranslation } from "react-i18next";
784
+ import { jsx as jsx45, jsxs as jsxs8 } from "react/jsx-runtime";
785
+ var CALENDAR_ANIMATION_DURATION = 0.2;
786
+ var Calendar = React41.forwardRef(function Calendar2(props, ref) {
787
+ const { t } = useTranslation("libui");
788
+ const firstDay = new Date(props.year, props.month).getDay();
789
+ const lastDay = new Date(props.year, props.month + 1, 0).getDate();
790
+ const days = range(1, lastDay + 1);
791
+ const daysOfWeek = [
792
+ t("days.sunday"),
793
+ t("days.monday"),
794
+ t("days.tuesday"),
795
+ t("days.wednesday"),
796
+ t("days.thursday"),
797
+ t("days.friday"),
798
+ t("days.saturday")
799
+ ];
800
+ return /* @__PURE__ */ jsx45(AnimatePresence, { initial: false, mode: "wait", children: /* @__PURE__ */ jsx45(
801
+ motion.div,
802
+ {
803
+ animate: { opacity: 1, x: 0 },
804
+ exit: { opacity: 0, x: -20 },
805
+ initial: { opacity: 0, x: 20 },
806
+ transition: { duration: CALENDAR_ANIMATION_DURATION },
807
+ children: /* @__PURE__ */ jsxs8("div", { className: "grid h-56 w-56 grid-cols-7 text-sm", ref, children: [
808
+ daysOfWeek.map((label) => /* @__PURE__ */ jsx45("div", { className: "flex h-8 w-8 items-center justify-center text-muted-foreground", children: label.charAt(0).toUpperCase() }, label)),
809
+ /* @__PURE__ */ jsx45("div", { style: { gridColumn: `span ${firstDay} / span ${firstDay}` } }),
810
+ days.map((day) => /* @__PURE__ */ jsx45(
811
+ "button",
812
+ {
813
+ className: "dark:hover:bg-extra-muted flex h-8 w-8 items-center justify-center rounded-md hover:bg-slate-200 dark:hover:bg-slate-700",
814
+ tabIndex: -1,
815
+ type: "button",
816
+ onClick: () => {
817
+ props.onSelection(new Date(props.year, props.month, day));
818
+ },
819
+ children: day
820
+ },
821
+ day
822
+ ))
823
+ ] })
824
+ },
825
+ `${props.year}-${props.month}`
826
+ ) });
827
+ });
828
+
829
+ // src/components/DatePicker/YearSelector.tsx
830
+ import { useEffect, useRef } from "react";
831
+ import { range as range2 } from "lodash-es";
832
+
833
+ // src/components/ScrollArea/ScrollArea.tsx
834
+ import React43 from "react";
835
+ import { Corner, Root as Root7, Viewport } from "@radix-ui/react-scroll-area";
836
+
837
+ // src/components/ScrollArea/ScrollBar.tsx
838
+ import React42 from "react";
839
+ import { ScrollAreaScrollbar, ScrollAreaThumb } from "@radix-ui/react-scroll-area";
840
+ import { jsx as jsx46 } from "react/jsx-runtime";
841
+ var ScrollBar = React42.forwardRef(function ScrollBar2({ className, orientation = "vertical", ...props }, ref) {
842
+ return /* @__PURE__ */ jsx46(
843
+ ScrollAreaScrollbar,
844
+ {
845
+ className: cn(
846
+ "flex touch-none select-none transition-colors",
847
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
848
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
849
+ className
850
+ ),
851
+ orientation,
852
+ ref,
853
+ ...props,
854
+ children: /* @__PURE__ */ jsx46(ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
855
+ }
856
+ );
857
+ });
858
+
859
+ // src/components/ScrollArea/ScrollArea.tsx
860
+ import { jsx as jsx47, jsxs as jsxs9 } from "react/jsx-runtime";
861
+ var ScrollArea = React43.forwardRef(
862
+ function ScrollArea2({ children, className, ...props }, ref) {
863
+ return /* @__PURE__ */ jsxs9(Root7, { className: cn("relative overflow-hidden", className), "data-testid": "scroll-area", ref, ...props, children: [
864
+ /* @__PURE__ */ jsx47(Viewport, { className: "h-full w-full rounded-[inherit]", children }),
865
+ /* @__PURE__ */ jsx47(ScrollBar, {}),
866
+ /* @__PURE__ */ jsx47(Corner, {})
867
+ ] });
868
+ }
869
+ );
870
+
871
+ // src/components/DatePicker/YearSelector.tsx
872
+ import { jsx as jsx48 } from "react/jsx-runtime";
873
+ var YearSelector = (props) => {
874
+ const selectedRef = useRef(null);
875
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
876
+ const years = Array.from(range2(currentYear - 100, currentYear + 8)).reverse();
877
+ useEffect(() => {
878
+ if (selectedRef.current) {
879
+ selectedRef.current.scrollIntoView({ block: "center" });
880
+ }
881
+ }, []);
882
+ return /* @__PURE__ */ jsx48(ScrollArea, { className: "h-56 w-56", children: /* @__PURE__ */ jsx48("div", { className: "grid grid-cols-3 gap-x-2 gap-y-1 text-sm text-muted-foreground", children: years.map((year) => /* @__PURE__ */ jsx48("div", { className: "flex h-7 items-center justify-center", children: /* @__PURE__ */ jsx48(
883
+ "button",
884
+ {
885
+ className: cn(
886
+ "h-full w-full rounded-md hover:bg-slate-200 dark:hover:bg-slate-700",
887
+ year === props.selected.getFullYear() && "bg-primary text-primary-foreground hover:bg-primary dark:hover:bg-primary"
888
+ ),
889
+ ref: year === props.selected.getFullYear() ? selectedRef : null,
890
+ tabIndex: -1,
891
+ type: "button",
892
+ onClick: () => {
893
+ props.onSelection(new Date(year, 0));
894
+ },
895
+ children: year
896
+ }
897
+ ) }, year)) }) });
898
+ };
899
+
900
+ // src/components/DatePicker/DatePicker.tsx
901
+ import { jsx as jsx49, jsxs as jsxs10 } from "react/jsx-runtime";
902
+ var MONTHS = [
903
+ "january",
904
+ "february",
905
+ "march",
906
+ "april",
907
+ "may",
908
+ "june",
909
+ "july",
910
+ "august",
911
+ "september",
912
+ "october",
913
+ "november",
914
+ "december"
915
+ ];
916
+ var reducer = (previousDate, action) => {
917
+ const newDate = new Date(previousDate.valueOf());
918
+ switch (action.type) {
919
+ case "increment":
920
+ newDate.setMonth(newDate.getMonth() + 1);
921
+ break;
922
+ case "decrement":
923
+ newDate.setMonth(newDate.getMonth() - 1);
924
+ break;
925
+ case "set-year":
926
+ newDate.setFullYear(action.value);
927
+ }
928
+ return newDate;
929
+ };
930
+ var DatePicker = React44.forwardRef(function DatePicker2({ onSelection, ...props }, ref) {
931
+ const [date, dispatch] = useReducer(reducer, /* @__PURE__ */ new Date());
932
+ const [showYearSelector, setShowYearSelector] = useState(false);
933
+ const { t } = useTranslation2("libui");
934
+ const [canSetMonth, setCanSetMonth] = useState(true);
935
+ const monthName = t(`months.${MONTHS[date.getMonth()]}`);
936
+ const handleYearSelection = (date2) => {
937
+ dispatch({ type: "set-year", value: date2.getFullYear() });
938
+ setShowYearSelector(false);
939
+ };
940
+ return /* @__PURE__ */ jsxs10(Card, { className: "w-fit p-3", "data-testid": "datepicker", ref, ...props, children: [
941
+ /* @__PURE__ */ jsxs10("div", { className: "mb-3 flex items-center justify-between px-1", children: [
942
+ /* @__PURE__ */ jsxs10("div", { className: "flex items-center", children: [
943
+ /* @__PURE__ */ jsx49("span", { className: "mx-1 text-sm font-medium tracking-tight", children: `${monthName} ${date.getFullYear()}` }),
944
+ /* @__PURE__ */ jsx49(
945
+ ArrowToggle,
946
+ {
947
+ className: "flex items-center justify-center rounded-full p-1 hover:bg-slate-200 dark:hover:bg-slate-700",
948
+ isToggled: showYearSelector,
949
+ position: "up",
950
+ rotation: 180,
951
+ tabIndex: -1,
952
+ onClick: () => {
953
+ setShowYearSelector(!showYearSelector);
954
+ }
955
+ }
956
+ )
957
+ ] }),
958
+ /* @__PURE__ */ jsxs10("div", { className: cn("flex", { hidden: showYearSelector }), children: [
959
+ /* @__PURE__ */ jsx49(
960
+ ArrowToggle,
961
+ {
962
+ className: "flex items-center justify-center rounded-full p-1 hover:bg-slate-200 dark:hover:bg-slate-700",
963
+ position: "left",
964
+ tabIndex: -1,
965
+ onClick: () => {
966
+ if (canSetMonth) {
967
+ setCanSetMonth(false);
968
+ dispatch({ type: "decrement" });
969
+ setTimeout(() => {
970
+ setCanSetMonth(true);
971
+ }, CALENDAR_ANIMATION_DURATION * 2e3);
972
+ }
973
+ }
974
+ }
975
+ ),
976
+ /* @__PURE__ */ jsx49(
977
+ ArrowToggle,
978
+ {
979
+ className: "flex items-center justify-center rounded-full p-1 hover:bg-slate-200 dark:hover:bg-slate-700",
980
+ position: "right",
981
+ tabIndex: -1,
982
+ onClick: () => {
983
+ if (canSetMonth) {
984
+ setCanSetMonth(false);
985
+ dispatch({ type: "increment" });
986
+ setTimeout(() => {
987
+ setCanSetMonth(true);
988
+ }, CALENDAR_ANIMATION_DURATION * 2e3);
989
+ }
990
+ }
991
+ }
992
+ )
993
+ ] })
994
+ ] }),
995
+ /* @__PURE__ */ jsx49("div", { children: /* @__PURE__ */ jsx49(AnimatePresence2, { initial: false, mode: "wait", children: showYearSelector ? /* @__PURE__ */ jsx49(
996
+ motion2.div,
997
+ {
998
+ animate: { opacity: 1, y: 0 },
999
+ exit: { opacity: 0, y: 10 },
1000
+ initial: { opacity: 0, y: 10 },
1001
+ transition: { duration: 0.2 },
1002
+ children: /* @__PURE__ */ jsx49(YearSelector, { selected: date, onSelection: handleYearSelection })
1003
+ },
1004
+ 0
1005
+ ) : /* @__PURE__ */ jsx49(
1006
+ motion2.div,
1007
+ {
1008
+ animate: { opacity: 1, y: 0 },
1009
+ exit: { opacity: 0, y: -10 },
1010
+ initial: { opacity: 0, y: -10 },
1011
+ transition: { duration: 0.2 },
1012
+ children: /* @__PURE__ */ jsx49(Calendar, { month: date.getMonth(), year: date.getFullYear(), onSelection })
1013
+ },
1014
+ 1
1015
+ ) }) })
1016
+ ] });
1017
+ });
1018
+
1019
+ // src/components/Dialog/Dialog.tsx
1020
+ import { Root as Root8, Trigger as Trigger5 } from "@radix-ui/react-dialog";
1021
+
1022
+ // src/components/Dialog/DialogContent.tsx
1023
+ import React46 from "react";
1024
+ import { Close, Content as Content5, Portal as Portal4 } from "@radix-ui/react-dialog";
1025
+ import { XIcon } from "lucide-react";
1026
+
1027
+ // src/components/Dialog/DialogOverlay.tsx
1028
+ import React45 from "react";
1029
+ import { Overlay as Overlay2 } from "@radix-ui/react-dialog";
1030
+ import { jsx as jsx50 } from "react/jsx-runtime";
1031
+ var DialogOverlay = React45.forwardRef(function DialogOverlay2({ className, ...props }, ref) {
1032
+ return /* @__PURE__ */ jsx50(
1033
+ Overlay2,
1034
+ {
1035
+ className: cn(
1036
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1037
+ className
1038
+ ),
1039
+ ref,
1040
+ ...props
1041
+ }
1042
+ );
1043
+ });
1044
+
1045
+ // src/components/Dialog/DialogContent.tsx
1046
+ import { jsx as jsx51, jsxs as jsxs11 } from "react/jsx-runtime";
1047
+ var DialogContent = React46.forwardRef(function DialogContent2({ children, className, ...props }, ref) {
1048
+ return /* @__PURE__ */ jsxs11(Portal4, { children: [
1049
+ /* @__PURE__ */ jsx51(DialogOverlay, {}),
1050
+ /* @__PURE__ */ jsxs11(
1051
+ Content5,
1052
+ {
1053
+ className: cn(
1054
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
1055
+ className
1056
+ ),
1057
+ ref,
1058
+ ...props,
1059
+ children: [
1060
+ children,
1061
+ /* @__PURE__ */ jsx51(Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: /* @__PURE__ */ jsx51(XIcon, { className: "h-4 w-4" }) })
1062
+ ]
1063
+ }
1064
+ )
1065
+ ] });
1066
+ });
1067
+
1068
+ // src/components/Dialog/DialogDescription.tsx
1069
+ import React47 from "react";
1070
+ import { Description as Description2 } from "@radix-ui/react-dialog";
1071
+ import { jsx as jsx52 } from "react/jsx-runtime";
1072
+ var DialogDescription = React47.forwardRef(function DialogDescription2({ className, ...props }, ref) {
1073
+ return /* @__PURE__ */ jsx52(Description2, { className: cn("text-sm text-muted-foreground", className), ref, ...props });
1074
+ });
1075
+
1076
+ // src/components/Dialog/DialogFooter.tsx
1077
+ import "react";
1078
+ import { jsx as jsx53 } from "react/jsx-runtime";
1079
+ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx53("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
1080
+
1081
+ // src/components/Dialog/DialogHeader.tsx
1082
+ import { jsx as jsx54 } from "react/jsx-runtime";
1083
+ var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx54("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
1084
+
1085
+ // src/components/Dialog/DialogTitle.tsx
1086
+ import React49 from "react";
1087
+ import { Title as Title2 } from "@radix-ui/react-dialog";
1088
+ import { jsx as jsx55 } from "react/jsx-runtime";
1089
+ var DialogTitle = React49.forwardRef(function DialogTitle2({ className, ...props }, ref) {
1090
+ return /* @__PURE__ */ jsx55(Title2, { className: cn("text-lg font-semibold leading-none tracking-tight", className), ref, ...props });
1091
+ });
1092
+
1093
+ // src/components/Dialog/Dialog.tsx
1094
+ var Dialog = Object.assign(Root8, {
1095
+ Content: DialogContent,
1096
+ Description: DialogDescription,
1097
+ Footer: DialogFooter,
1098
+ Header: DialogHeader,
1099
+ Title: DialogTitle,
1100
+ Trigger: Trigger5
1101
+ });
1102
+
1103
+ // src/components/Drawer/Drawer.tsx
1104
+ import "react";
1105
+ import { Drawer as DrawerPrimitive4 } from "vaul";
1106
+
1107
+ // src/components/Drawer/DrawerContent.tsx
1108
+ import React50 from "react";
1109
+ import { Drawer as DrawerPrimitive } from "vaul";
1110
+ import { jsx as jsx56, jsxs as jsxs12 } from "react/jsx-runtime";
1111
+ var DrawerContent = React50.forwardRef(function DrawerContent2({ children, className, ...props }, ref) {
1112
+ return /* @__PURE__ */ jsxs12(DrawerPrimitive.Portal, { children: [
1113
+ /* @__PURE__ */ jsx56(DrawerPrimitive.Overlay, { className: cn("fixed inset-0 z-50 bg-black/80", className), ref, ...props }),
1114
+ /* @__PURE__ */ jsxs12(
1115
+ DrawerPrimitive.Content,
1116
+ {
1117
+ className: cn(
1118
+ "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
1119
+ className
1120
+ ),
1121
+ ref,
1122
+ ...props,
1123
+ children: [
1124
+ /* @__PURE__ */ jsx56("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
1125
+ children
1126
+ ]
1127
+ }
1128
+ )
1129
+ ] });
1130
+ });
1131
+
1132
+ // src/components/Drawer/DrawerDescription.tsx
1133
+ import React51 from "react";
1134
+ import { Drawer as DrawerPrimitive2 } from "vaul";
1135
+ import { jsx as jsx57 } from "react/jsx-runtime";
1136
+ var DrawerDescription = React51.forwardRef(function DrawerDescription2({ className, ...props }, ref) {
1137
+ return /* @__PURE__ */ jsx57(DrawerPrimitive2.Description, { className: cn("text-sm text-muted-foreground", className), ref, ...props });
1138
+ });
1139
+
1140
+ // src/components/Drawer/DrawerFooter.tsx
1141
+ import { jsx as jsx58 } from "react/jsx-runtime";
1142
+ var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsx58("div", { className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props });
1143
+
1144
+ // src/components/Drawer/DrawerHeader.tsx
1145
+ import "react";
1146
+ import { jsx as jsx59 } from "react/jsx-runtime";
1147
+ var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsx59("div", { className: cn("grid gap-1.5 p-4 text-center sm:text-left", className), ...props });
1148
+
1149
+ // src/components/Drawer/DrawerTitle.tsx
1150
+ import React53 from "react";
1151
+ import { Drawer as DrawerPrimitive3 } from "vaul";
1152
+ import { jsx as jsx60 } from "react/jsx-runtime";
1153
+ var DrawerTitle = React53.forwardRef(function DrawerTitle2({ className, ...props }, ref) {
1154
+ return /* @__PURE__ */ jsx60(
1155
+ DrawerPrimitive3.Title,
1156
+ {
1157
+ className: cn("text-lg font-semibold leading-none tracking-tight", className),
1158
+ ref,
1159
+ ...props
1160
+ }
1161
+ );
1162
+ });
1163
+
1164
+ // src/components/Drawer/Drawer.tsx
1165
+ import { jsx as jsx61 } from "react/jsx-runtime";
1166
+ var DrawerRoot = ({ shouldScaleBackground = true, ...props }) => /* @__PURE__ */ jsx61(DrawerPrimitive4.Root, { shouldScaleBackground, ...props });
1167
+ var Drawer = Object.assign(DrawerRoot, {
1168
+ Close: DrawerPrimitive4.Close,
1169
+ Content: DrawerContent,
1170
+ Description: DrawerDescription,
1171
+ Footer: DrawerFooter,
1172
+ Header: DrawerHeader,
1173
+ Title: DrawerTitle,
1174
+ Trigger: DrawerPrimitive4.Trigger
1175
+ });
1176
+
1177
+ // src/components/DropdownButton/DropdownButton.tsx
1178
+ import React55 from "react";
1179
+ import { ChevronDownIcon as ChevronDownIcon2 } from "lucide-react";
1180
+ import { jsx as jsx62, jsxs as jsxs13 } from "react/jsx-runtime";
1181
+ var DropdownButton = React55.forwardRef(
1182
+ function DropdownButton2({ children, className, ...props }, ref) {
1183
+ return /* @__PURE__ */ jsxs13(
1184
+ "button",
1185
+ {
1186
+ className: cn(
1187
+ "flex h-9 w-full items-center whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
1188
+ children ? "justify-between" : "justify-end",
1189
+ className
1190
+ ),
1191
+ ref,
1192
+ type: "button",
1193
+ ...props,
1194
+ children: [
1195
+ children,
1196
+ /* @__PURE__ */ jsx62(ChevronDownIcon2, { className: "h-4 w-4 opacity-50" })
1197
+ ]
1198
+ }
1199
+ );
1200
+ }
1201
+ );
1202
+
1203
+ // src/components/DropdownMenu/DropdownMenu.tsx
1204
+ import * as DropdownMenuPrimitive9 from "@radix-ui/react-dropdown-menu";
1205
+
1206
+ // src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx
1207
+ import React56 from "react";
1208
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
1209
+ import { CheckIcon as CheckIcon3 } from "lucide-react";
1210
+ import { jsx as jsx63, jsxs as jsxs14 } from "react/jsx-runtime";
1211
+ var DropdownMenuCheckboxItem = React56.forwardRef(function DropdownMenuCheckboxItem2({ checked, children, className, ...props }, ref) {
1212
+ return /* @__PURE__ */ jsxs14(
1213
+ DropdownMenuPrimitive.CheckboxItem,
1214
+ {
1215
+ checked,
1216
+ className: cn(
1217
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1218
+ className
1219
+ ),
1220
+ ref,
1221
+ ...props,
1222
+ children: [
1223
+ /* @__PURE__ */ jsx63("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx63(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx63(CheckIcon3, { className: "h-4 w-4" }) }) }),
1224
+ children
1225
+ ]
1226
+ }
1227
+ );
1228
+ });
1229
+
1230
+ // src/components/DropdownMenu/DropdownMenuContent.tsx
1231
+ import React57 from "react";
1232
+ import * as DropdownMenuPrimitive2 from "@radix-ui/react-dropdown-menu";
1233
+ import { jsx as jsx64 } from "react/jsx-runtime";
1234
+ var DropdownMenuContent = React57.forwardRef(function DropdownMenuContent2({ className, sideOffset = 4, widthFull = false, ...props }, ref) {
1235
+ return /* @__PURE__ */ jsx64(DropdownMenuPrimitive2.Portal, { children: /* @__PURE__ */ jsx64(
1236
+ DropdownMenuPrimitive2.Content,
1237
+ {
1238
+ className: cn(
1239
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
1240
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1241
+ widthFull && "w-[var(--radix-dropdown-menu-trigger-width)]",
1242
+ className
1243
+ ),
1244
+ ref,
1245
+ sideOffset,
1246
+ ...props
1247
+ }
1248
+ ) });
1249
+ });
1250
+
1251
+ // src/components/DropdownMenu/DropdownMenuItem.tsx
1252
+ import React58 from "react";
1253
+ import * as DropdownMenuPrimitive3 from "@radix-ui/react-dropdown-menu";
1254
+ import { jsx as jsx65 } from "react/jsx-runtime";
1255
+ var DropdownMenuItem = React58.forwardRef(function DropdownMenuItem2({ className, inset, ...props }, ref) {
1256
+ return /* @__PURE__ */ jsx65(
1257
+ DropdownMenuPrimitive3.Item,
1258
+ {
1259
+ className: cn(
1260
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1261
+ inset && "pl-8",
1262
+ className
1263
+ ),
1264
+ ref,
1265
+ ...props
1266
+ }
1267
+ );
1268
+ });
1269
+
1270
+ // src/components/DropdownMenu/DropdownMenuLabel.tsx
1271
+ import React59 from "react";
1272
+ import * as DropdownMenuPrimitive4 from "@radix-ui/react-dropdown-menu";
1273
+ import { jsx as jsx66 } from "react/jsx-runtime";
1274
+ var DropdownMenuLabel = React59.forwardRef(function DropdownMenuLabel2({ className, inset, ...props }, ref) {
1275
+ return /* @__PURE__ */ jsx66(
1276
+ DropdownMenuPrimitive4.Label,
1277
+ {
1278
+ className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
1279
+ ref,
1280
+ ...props
1281
+ }
1282
+ );
1283
+ });
1284
+
1285
+ // src/components/DropdownMenu/DropdownMenuRadioItem.tsx
1286
+ import React60 from "react";
1287
+ import * as DropdownMenuPrimitive5 from "@radix-ui/react-dropdown-menu";
1288
+ import { CircleIcon as CircleIcon2 } from "lucide-react";
1289
+ import { jsx as jsx67, jsxs as jsxs15 } from "react/jsx-runtime";
1290
+ var DropdownMenuRadioItem = React60.forwardRef(function DropdownMenuRadioItem2({ children, className, ...props }, ref) {
1291
+ return /* @__PURE__ */ jsxs15(
1292
+ DropdownMenuPrimitive5.RadioItem,
1293
+ {
1294
+ className: cn(
1295
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1296
+ className
1297
+ ),
1298
+ ref,
1299
+ ...props,
1300
+ children: [
1301
+ /* @__PURE__ */ jsx67("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx67(DropdownMenuPrimitive5.ItemIndicator, { children: /* @__PURE__ */ jsx67(CircleIcon2, { className: "h-4 w-4 fill-current" }) }) }),
1302
+ children
1303
+ ]
1304
+ }
1305
+ );
1306
+ });
1307
+
1308
+ // src/components/DropdownMenu/DropdownMenuSeparator.tsx
1309
+ import React61 from "react";
1310
+ import * as DropdownMenuPrimitive6 from "@radix-ui/react-dropdown-menu";
1311
+ import { jsx as jsx68 } from "react/jsx-runtime";
1312
+ var DropdownMenuSeparator = React61.forwardRef(function DropdownMenuSeparator2({ className, ...props }, ref) {
1313
+ return /* @__PURE__ */ jsx68(DropdownMenuPrimitive6.Separator, { className: cn("-mx-1 my-1 h-px bg-muted", className), ref, ...props });
1314
+ });
1315
+
1316
+ // src/components/DropdownMenu/DropdownMenuShortcut.tsx
1317
+ import "react";
1318
+ import { jsx as jsx69 } from "react/jsx-runtime";
1319
+ var DropdownMenuShortcut = ({ className, ...props }) => {
1320
+ return /* @__PURE__ */ jsx69("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props });
1321
+ };
1322
+
1323
+ // src/components/DropdownMenu/DropdownMenuSubContent.tsx
1324
+ import React63 from "react";
1325
+ import * as DropdownMenuPrimitive7 from "@radix-ui/react-dropdown-menu";
1326
+ import { jsx as jsx70 } from "react/jsx-runtime";
1327
+ var DropdownMenuSubContent = React63.forwardRef(function DropdownMenuSubContent2({ className, ...props }, ref) {
1328
+ return /* @__PURE__ */ jsx70(
1329
+ DropdownMenuPrimitive7.SubContent,
1330
+ {
1331
+ className: cn(
1332
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1333
+ className
1334
+ ),
1335
+ ref,
1336
+ ...props
1337
+ }
1338
+ );
1339
+ });
1340
+
1341
+ // src/components/DropdownMenu/DropdownMenuSubTrigger.tsx
1342
+ import React64 from "react";
1343
+ import * as DropdownMenuPrimitive8 from "@radix-ui/react-dropdown-menu";
1344
+ import { ChevronRightIcon as ChevronRightIcon3 } from "lucide-react";
1345
+ import { jsx as jsx71, jsxs as jsxs16 } from "react/jsx-runtime";
1346
+ var DropdownMenuSubTrigger = React64.forwardRef(function DropdownMenuSubTrigger2({ children, className, inset, ...props }, ref) {
1347
+ return /* @__PURE__ */ jsxs16(
1348
+ DropdownMenuPrimitive8.SubTrigger,
1349
+ {
1350
+ className: cn(
1351
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
1352
+ inset && "pl-8",
1353
+ className
1354
+ ),
1355
+ ref,
1356
+ ...props,
1357
+ children: [
1358
+ children,
1359
+ /* @__PURE__ */ jsx71(ChevronRightIcon3, { className: "ml-auto h-4 w-4" })
1360
+ ]
1361
+ }
1362
+ );
1363
+ });
1364
+
1365
+ // src/components/DropdownMenu/DropdownMenu.tsx
1366
+ var DropdownMenu = Object.assign(DropdownMenuPrimitive9.Root, {
1367
+ CheckboxItem: DropdownMenuCheckboxItem,
1368
+ Content: DropdownMenuContent,
1369
+ Group: DropdownMenuPrimitive9.Group,
1370
+ Item: DropdownMenuItem,
1371
+ Label: DropdownMenuLabel,
1372
+ Portal: DropdownMenuPrimitive9.Portal,
1373
+ RadioGroup: DropdownMenuPrimitive9.RadioGroup,
1374
+ RadioItem: DropdownMenuRadioItem,
1375
+ Separator: DropdownMenuSeparator,
1376
+ Shortcut: DropdownMenuShortcut,
1377
+ Sub: DropdownMenuPrimitive9.Sub,
1378
+ SubContent: DropdownMenuSubContent,
1379
+ SubTrigger: DropdownMenuSubTrigger,
1380
+ Trigger: DropdownMenuPrimitive9.Trigger
1381
+ });
1382
+
1383
+ // src/components/ErrorBoundary/ErrorBoundary.tsx
1384
+ import { ErrorBoundary as ReactErrorBoundary } from "react-error-boundary";
1385
+
1386
+ // src/components/ErrorFallback/ErrorFallback.tsx
1387
+ import { useEffect as useEffect2 } from "react";
1388
+ import { jsx as jsx72, jsxs as jsxs17 } from "react/jsx-runtime";
1389
+ var ErrorFallback = ({ error }) => {
1390
+ useEffect2(() => {
1391
+ console.error(error);
1392
+ }, [error]);
1393
+ return /* @__PURE__ */ jsxs17("div", { className: "flex min-h-screen flex-col items-center justify-center gap-1 p-3 text-center", children: [
1394
+ /* @__PURE__ */ jsx72("h1", { className: "text-sm font-semibold uppercase tracking-wide text-muted-foreground", children: "Unexpected Error" }),
1395
+ /* @__PURE__ */ jsx72("h3", { className: "text-3xl font-extrabold tracking-tight sm:text-4xl md:text-5xl", children: "Something Went Wrong" }),
1396
+ /* @__PURE__ */ jsx72("p", { className: "mt-2 max-w-prose text-sm text-muted-foreground sm:text-base", children: "We apologize for the inconvenience. Please contact us for further assistance." }),
1397
+ /* @__PURE__ */ jsx72("div", { className: "mt-6", children: /* @__PURE__ */ jsxs17(
1398
+ "button",
1399
+ {
1400
+ className: "text-sky-800 underline-offset-4 hover:text-sky-700 hover:underline dark:text-sky-200 dark:hover:text-sky-300",
1401
+ type: "button",
1402
+ onClick: () => {
1403
+ window.location.assign(window.location.origin);
1404
+ },
1405
+ children: [
1406
+ "Reload Page",
1407
+ /* @__PURE__ */ jsx72("span", { "aria-hidden": "true", children: " \u2192" })
1408
+ ]
1409
+ }
1410
+ ) })
1411
+ ] });
1412
+ };
1413
+
1414
+ // src/components/ErrorBoundary/ErrorBoundary.tsx
1415
+ import { jsx as jsx73 } from "react/jsx-runtime";
1416
+ var ErrorBoundary = ({ children }) => {
1417
+ return /* @__PURE__ */ jsx73(ReactErrorBoundary, { FallbackComponent: ErrorFallback, children });
1418
+ };
1419
+
1420
+ // src/components/Form/Form.tsx
1421
+ import { useState as useState5 } from "react";
1422
+ import { set } from "lodash-es";
1423
+ import { useTranslation as useTranslation5 } from "react-i18next";
1424
+ import { twMerge } from "tailwind-merge";
1425
+ import "zod";
1426
+
1427
+ // src/components/Heading/Heading.tsx
1428
+ import { jsx as jsx74 } from "react/jsx-runtime";
1429
+ var Heading = ({ children, className, variant }) => {
1430
+ switch (variant) {
1431
+ case "h1":
1432
+ return /* @__PURE__ */ jsx74("h1", { className: cn("text-3xl font-bold tracking-tight", className), children });
1433
+ case "h2":
1434
+ return /* @__PURE__ */ jsx74("h2", { className: cn("text-2xl font-semibold tracking-tight", className), children });
1435
+ case "h3":
1436
+ return /* @__PURE__ */ jsx74("h3", { className: cn("text-xl font-semibold tracking-tight", className), children });
1437
+ case "h4":
1438
+ return /* @__PURE__ */ jsx74("h4", { className: cn("text-lg font-semibold tracking-tight", className), children });
1439
+ case "h5":
1440
+ return /* @__PURE__ */ jsx74("h4", { className: cn("text-base font-semibold tracking-tight", className), children });
1441
+ default:
1442
+ throw new Error(`Unhandled heading variant: ${variant}`);
1443
+ }
1444
+ };
1445
+
1446
+ // src/components/Form/ErrorMessage.tsx
1447
+ import { CircleAlertIcon } from "lucide-react";
1448
+ import { jsx as jsx75, jsxs as jsxs18 } from "react/jsx-runtime";
1449
+ var ErrorMessage = ({ error }) => error ? /* @__PURE__ */ jsxs18("div", { className: "flex w-full items-center text-sm font-medium text-destructive", children: [
1450
+ /* @__PURE__ */ jsx75(CircleAlertIcon, { className: "mr-1", style: { strokeWidth: "2px" } }),
1451
+ /* @__PURE__ */ jsx75("span", { children: error })
1452
+ ] }) : null;
1453
+
1454
+ // src/components/Form/DynamicField.tsx
1455
+ import { useEffect as useEffect7, useMemo as useMemo2, useState as useState4 } from "react";
1456
+ import { pick } from "lodash-es";
1457
+
1458
+ // src/components/Form/StaticField.tsx
1459
+ import { useCallback as useCallback2 } from "react";
1460
+ import { match as match6 } from "ts-pattern";
1461
+
1462
+ // src/components/Form/NumberRecordField.tsx
1463
+ import { useEffect as useEffect3 } from "react";
1464
+
1465
+ // src/components/Form/NumberField/NumberField.tsx
1466
+ import { match } from "ts-pattern";
1467
+
1468
+ // src/components/Input/Input.tsx
1469
+ import React65 from "react";
1470
+ import { jsx as jsx76 } from "react/jsx-runtime";
1471
+ var Input = React65.forwardRef(function Input2({ className, type, ...props }, ref) {
1472
+ return /* @__PURE__ */ jsx76(
1473
+ "input",
1474
+ {
1475
+ autoComplete: "off",
1476
+ className: cn(
1477
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1478
+ className
1479
+ ),
1480
+ "data-testid": "input",
1481
+ ref,
1482
+ type,
1483
+ ...props
1484
+ }
1485
+ );
1486
+ });
1487
+
1488
+ // src/components/Label/Label.tsx
1489
+ import React66 from "react";
1490
+ import * as LabelPrimitive from "@radix-ui/react-label";
1491
+ import { cva as cva3 } from "class-variance-authority";
1492
+ import { jsx as jsx77 } from "react/jsx-runtime";
1493
+ var labelVariants = cva3(
1494
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1495
+ );
1496
+ var Label3 = React66.forwardRef(function Label4({ className, ...props }, ref) {
1497
+ return /* @__PURE__ */ jsx77(LabelPrimitive.Root, { className: cn(labelVariants(), className), ref, ...props });
1498
+ });
1499
+
1500
+ // src/components/Form/FieldGroup/FieldGroupDescription.tsx
1501
+ import { CircleHelpIcon } from "lucide-react";
1502
+
1503
+ // src/components/Popover/Popover.tsx
1504
+ import { Root as PopoverRoot, Trigger as PopoverTrigger } from "@radix-ui/react-popover";
1505
+
1506
+ // src/components/Popover/PopoverContent.tsx
1507
+ import React67 from "react";
1508
+ import { Content as Content7, Portal as Portal7 } from "@radix-ui/react-popover";
1509
+ import { jsx as jsx78 } from "react/jsx-runtime";
1510
+ var PopoverContent = React67.forwardRef(
1511
+ function PopoverContent2({ align = "center", asChild, autofocus = true, className, collisionPadding = 0, sideOffset = 4, ...props }, ref) {
1512
+ return /* @__PURE__ */ jsx78(Portal7, { children: /* @__PURE__ */ jsx78(
1513
+ Content7,
1514
+ {
1515
+ align,
1516
+ asChild,
1517
+ className: cn(
1518
+ "z-50 w-72 rounded-md border bg-popover px-3 py-1.5 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1519
+ className
1520
+ ),
1521
+ collisionPadding,
1522
+ ref,
1523
+ sideOffset,
1524
+ onOpenAutoFocus: autofocus === false ? (event) => event.preventDefault() : void 0,
1525
+ ...props
1526
+ }
1527
+ ) });
1528
+ }
1529
+ );
1530
+
1531
+ // src/components/Popover/Popover.tsx
1532
+ var Popover = Object.assign(PopoverRoot, {
1533
+ Content: PopoverContent,
1534
+ Trigger: PopoverTrigger
1535
+ });
1536
+
1537
+ // src/components/Form/FieldGroup/FieldGroupDescription.tsx
1538
+ import { jsx as jsx79, jsxs as jsxs19 } from "react/jsx-runtime";
1539
+ var FieldGroupDescription = ({ description }) => description ? /* @__PURE__ */ jsxs19(Popover, { children: [
1540
+ /* @__PURE__ */ jsx79(Popover.Trigger, { children: /* @__PURE__ */ jsx79(CircleHelpIcon, { className: "text-muted-foreground" }) }),
1541
+ /* @__PURE__ */ jsx79(Popover.Content, { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsx79("p", { children: description }) })
1542
+ ] }) : null;
1543
+
1544
+ // src/components/Form/FieldGroup/FieldGroupRoot.tsx
1545
+ import "react";
1546
+ import { jsx as jsx80 } from "react/jsx-runtime";
1547
+ var FieldGroupRoot = ({ children }) => /* @__PURE__ */ jsx80("div", { className: "flex flex-col gap-2 @container", children });
1548
+
1549
+ // src/components/Form/FieldGroup/FieldGroupRow.tsx
1550
+ import { jsx as jsx81 } from "react/jsx-runtime";
1551
+ var FieldGroupRow = ({ children }) => /* @__PURE__ */ jsx81("div", { className: "relative flex items-center gap-2", children });
1552
+
1553
+ // src/components/Form/FieldGroup/FieldGroup.tsx
1554
+ var FieldGroup = Object.assign(FieldGroupRoot, {
1555
+ Description: FieldGroupDescription,
1556
+ Error: ErrorMessage,
1557
+ Row: FieldGroupRow
1558
+ });
1559
+
1560
+ // src/components/Form/NumberField/NumberFieldInput.tsx
1561
+ import { jsx as jsx82, jsxs as jsxs20 } from "react/jsx-runtime";
1562
+ var NumberFieldInput = ({
1563
+ description,
1564
+ error,
1565
+ label,
1566
+ max,
1567
+ min,
1568
+ name,
1569
+ setValue,
1570
+ value
1571
+ }) => {
1572
+ const handleChange = (event) => {
1573
+ const newValue = parseFloat(event.target.value);
1574
+ if (Number.isNaN(newValue)) {
1575
+ setValue(void 0);
1576
+ } else if (newValue >= (min ?? -Infinity) && newValue <= (max ?? Infinity)) {
1577
+ setValue(newValue);
1578
+ }
1579
+ };
1580
+ return /* @__PURE__ */ jsxs20(FieldGroup, { children: [
1581
+ /* @__PURE__ */ jsxs20(FieldGroup.Row, { children: [
1582
+ /* @__PURE__ */ jsx82(Label3, { children: label }),
1583
+ /* @__PURE__ */ jsx82(FieldGroup.Description, { description })
1584
+ ] }),
1585
+ /* @__PURE__ */ jsx82(Input, { max, min, name, type: "text", value: value ?? "", onChange: handleChange }),
1586
+ /* @__PURE__ */ jsx82(FieldGroup.Error, { error })
1587
+ ] });
1588
+ };
1589
+
1590
+ // src/components/RadioGroup/RadioGroup.tsx
1591
+ import React70 from "react";
1592
+ import * as RadioGroupPrimitive2 from "@radix-ui/react-radio-group";
1593
+
1594
+ // src/components/RadioGroup/RadioGroupItem.tsx
1595
+ import React69 from "react";
1596
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
1597
+ import { CircleIcon as CircleIcon3 } from "lucide-react";
1598
+ import { jsx as jsx83 } from "react/jsx-runtime";
1599
+ var RadioGroupItem = React69.forwardRef(function RadioGroupItem2({ className, ...props }, ref) {
1600
+ return /* @__PURE__ */ jsx83(
1601
+ RadioGroupPrimitive.Item,
1602
+ {
1603
+ className: cn(
1604
+ "flex aspect-square h-4 w-4 items-center justify-center rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1605
+ className
1606
+ ),
1607
+ ref,
1608
+ ...props,
1609
+ children: /* @__PURE__ */ jsx83(RadioGroupPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ jsx83(
1610
+ CircleIcon3,
1611
+ {
1612
+ className: "fill-current text-current",
1613
+ style: { height: "0.625rem", strokeWidth: "2px", width: "0.625rem" }
1614
+ }
1615
+ ) })
1616
+ }
1617
+ );
1618
+ });
1619
+
1620
+ // src/components/RadioGroup/RadioGroup.tsx
1621
+ import { jsx as jsx84 } from "react/jsx-runtime";
1622
+ var RadioGroupRoot = React70.forwardRef(function RadioGroup3({ className, ...props }, ref) {
1623
+ return /* @__PURE__ */ jsx84(RadioGroupPrimitive2.Root, { className: cn("grid gap-2", className), "data-testid": "radio-group", ...props, ref });
1624
+ });
1625
+ var RadioGroup4 = Object.assign(RadioGroupRoot, {
1626
+ Item: RadioGroupItem
1627
+ });
1628
+
1629
+ // src/components/Form/NumberField/NumberFieldRadio.tsx
1630
+ import { jsx as jsx85, jsxs as jsxs21 } from "react/jsx-runtime";
1631
+ var NumberFieldRadio = ({
1632
+ description,
1633
+ error,
1634
+ label,
1635
+ name,
1636
+ options,
1637
+ setValue,
1638
+ value
1639
+ }) => {
1640
+ const optionsCount = Object.keys(options).length;
1641
+ return /* @__PURE__ */ jsxs21(FieldGroup, { children: [
1642
+ /* @__PURE__ */ jsxs21(FieldGroup.Row, { children: [
1643
+ /* @__PURE__ */ jsx85(Label3, { children: label }),
1644
+ /* @__PURE__ */ jsx85(FieldGroup.Description, { description })
1645
+ ] }),
1646
+ /* @__PURE__ */ jsx85(
1647
+ RadioGroup4,
1648
+ {
1649
+ className: cn(
1650
+ "flex",
1651
+ optionsCount > 5 ? "flex-col" : "flex-col @3xl:flex-row @3xl:items-center @3xl:justify-between"
1652
+ ),
1653
+ name,
1654
+ value: value?.toString() ?? "",
1655
+ onValueChange: (value2) => setValue(parseInt(value2)),
1656
+ children: Object.keys(options).map((val) => parseInt(val)).toSorted((a, b) => a - b).map((key) => /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2", children: [
1657
+ /* @__PURE__ */ jsx85(RadioGroup4.Item, { id: `${name}-${key}`, value: key.toString() }),
1658
+ /* @__PURE__ */ jsx85(Label3, { className: "font-normal", htmlFor: `${name}-${key}`, children: options[key] })
1659
+ ] }, key))
1660
+ }
1661
+ ),
1662
+ /* @__PURE__ */ jsx85(FieldGroup.Error, { error })
1663
+ ] });
1664
+ };
1665
+
1666
+ // src/components/Slider/Slider.tsx
1667
+ import React71 from "react";
1668
+ import { Range, Root as Root12, Thumb, Track } from "@radix-ui/react-slider";
1669
+ import { jsx as jsx86, jsxs as jsxs22 } from "react/jsx-runtime";
1670
+ var Slider = React71.forwardRef(
1671
+ function Slider2({ className, ...props }, ref) {
1672
+ return /* @__PURE__ */ jsxs22(
1673
+ Root12,
1674
+ {
1675
+ className: cn("relative flex w-full touch-none select-none items-center py-1.5", className),
1676
+ ref,
1677
+ ...props,
1678
+ children: [
1679
+ /* @__PURE__ */ jsx86(Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary opacity-15", children: /* @__PURE__ */ jsx86(Range, { className: "absolute h-full bg-primary" }) }),
1680
+ /* @__PURE__ */ jsx86(Thumb, { className: "block h-4 w-4 rounded-full border border-slate-500 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" })
1681
+ ]
1682
+ }
1683
+ );
1684
+ }
1685
+ );
1686
+
1687
+ // src/components/Form/NumberField/NumberFieldSlider.tsx
1688
+ import { jsx as jsx87, jsxs as jsxs23 } from "react/jsx-runtime";
1689
+ var NumberFieldSlider = ({
1690
+ description,
1691
+ error,
1692
+ label,
1693
+ max,
1694
+ min,
1695
+ name,
1696
+ setValue,
1697
+ value
1698
+ }) => {
1699
+ return /* @__PURE__ */ jsxs23(FieldGroup, { children: [
1700
+ /* @__PURE__ */ jsxs23(FieldGroup.Row, { children: [
1701
+ /* @__PURE__ */ jsx87(Label3, { children: label }),
1702
+ /* @__PURE__ */ jsx87(FieldGroup.Description, { description })
1703
+ ] }),
1704
+ /* @__PURE__ */ jsxs23(FieldGroup.Row, { children: [
1705
+ /* @__PURE__ */ jsx87(Slider, { max, min, name, value: [value ?? 0], onValueChange: ([value2]) => setValue(value2) }),
1706
+ /* @__PURE__ */ jsx87("span", { className: "flex h-full w-8 items-center justify-center text-sm text-muted-foreground", children: value ?? "NA" })
1707
+ ] }),
1708
+ /* @__PURE__ */ jsx87(FieldGroup.Error, { error })
1709
+ ] });
1710
+ };
1711
+
1712
+ // src/components/Form/NumberField/NumberField.tsx
1713
+ import { jsx as jsx88 } from "react/jsx-runtime";
1714
+ var NumberField = (props) => {
1715
+ return match(props).with({ variant: "input" }, (props2) => /* @__PURE__ */ jsx88(NumberFieldInput, { ...props2 })).with({ variant: "slider" }, (props2) => /* @__PURE__ */ jsx88(NumberFieldSlider, { ...props2 })).with({ variant: "radio" }, (props2) => /* @__PURE__ */ jsx88(NumberFieldRadio, { ...props2 })).exhaustive();
1716
+ };
1717
+
1718
+ // src/components/Form/NumberRecordField.tsx
1719
+ import { jsx as jsx89, jsxs as jsxs24 } from "react/jsx-runtime";
1720
+ var NumberRecordField = ({
1721
+ error: recordError,
1722
+ items,
1723
+ label,
1724
+ options,
1725
+ setError: setRecordError,
1726
+ setValue: setRecordValue,
1727
+ value: recordValue
1728
+ }) => {
1729
+ useEffect3(() => {
1730
+ setRecordValue({});
1731
+ }, [options]);
1732
+ if (!recordValue) {
1733
+ return null;
1734
+ }
1735
+ return /* @__PURE__ */ jsxs24("div", { className: "space-y-4", children: [
1736
+ /* @__PURE__ */ jsx89(Heading, { variant: "h5", children: label }),
1737
+ /* @__PURE__ */ jsx89("div", { className: "space-y-8", children: Object.keys(items).map((name) => {
1738
+ const item = items[name];
1739
+ return /* @__PURE__ */ jsx89(
1740
+ NumberField,
1741
+ {
1742
+ error: recordError?.[name],
1743
+ kind: "number",
1744
+ name,
1745
+ options,
1746
+ setError: (error) => setRecordError({ ...recordError, [name]: error }),
1747
+ setValue: (value) => setRecordValue({ ...recordValue, [name]: value }),
1748
+ value: recordValue?.[name],
1749
+ variant: "radio",
1750
+ ...item
1751
+ },
1752
+ name
1753
+ );
1754
+ }) })
1755
+ ] });
1756
+ };
1757
+
1758
+ // src/components/Form/RecordArrayField.tsx
1759
+ import { memo, useEffect as useEffect6 } from "react";
1760
+ import { MinusCircleIcon, PlusCircleIcon } from "lucide-react";
1761
+ import { useTranslation as useTranslation4 } from "react-i18next";
1762
+
1763
+ // src/components/Form/BooleanField/BooleanField.tsx
1764
+ import { match as match3 } from "ts-pattern";
1765
+
1766
+ // src/components/Form/BooleanField/BooleanFieldCheckbox.tsx
1767
+ import { jsx as jsx90, jsxs as jsxs25 } from "react/jsx-runtime";
1768
+ var BooleanFieldCheckbox = ({ error, label, name, setValue, value }) => {
1769
+ return /* @__PURE__ */ jsxs25(FieldGroup, { children: [
1770
+ /* @__PURE__ */ jsxs25(FieldGroup.Row, { children: [
1771
+ /* @__PURE__ */ jsx90(
1772
+ Checkbox,
1773
+ {
1774
+ checked: value,
1775
+ id: name,
1776
+ name,
1777
+ onCheckedChange: (value2) => {
1778
+ if (typeof value2 === "boolean") {
1779
+ setValue(value2);
1780
+ }
1781
+ }
1782
+ }
1783
+ ),
1784
+ /* @__PURE__ */ jsx90(Label3, { htmlFor: name, children: label })
1785
+ ] }),
1786
+ /* @__PURE__ */ jsx90(FieldGroup.Error, { error })
1787
+ ] });
1788
+ };
1789
+
1790
+ // src/components/Form/BooleanField/BooleanFieldRadio.tsx
1791
+ import { useCallback } from "react";
1792
+ import { useTranslation as useTranslation3 } from "react-i18next";
1793
+ import { match as match2 } from "ts-pattern";
1794
+ import { jsx as jsx91, jsxs as jsxs26 } from "react/jsx-runtime";
1795
+ var stringifyBoolean = (value) => match2(value).with(void 0, () => "").with(true, () => "true").with(false, () => "false").exhaustive();
1796
+ var BooleanFieldRadio = ({ error, label, name, options, setValue, value }) => {
1797
+ const { t } = useTranslation3("libui");
1798
+ const handleValueChange = useCallback(
1799
+ (value2) => {
1800
+ match2(value2).with("", () => setValue(void 0)).with("true", () => setValue(true)).with("false", () => setValue(false)).otherwise((value3) => console.error(`Unexpected value for boolean field '${name}': ${value3}`));
1801
+ },
1802
+ [match2, setValue]
1803
+ );
1804
+ return /* @__PURE__ */ jsxs26(FieldGroup, { children: [
1805
+ /* @__PURE__ */ jsx91(Label3, { children: label }),
1806
+ /* @__PURE__ */ jsxs26(RadioGroup4, { name, value: stringifyBoolean(value), onValueChange: handleValueChange, children: [
1807
+ /* @__PURE__ */ jsxs26(FieldGroup.Row, { children: [
1808
+ /* @__PURE__ */ jsx91(RadioGroup4.Item, { id: `${name}-true`, value: "true" }),
1809
+ /* @__PURE__ */ jsx91(Label3, { className: "font-normal", htmlFor: `${name}-true`, children: options?.true ?? t("form.radioLabels.true") })
1810
+ ] }),
1811
+ /* @__PURE__ */ jsxs26(FieldGroup.Row, { children: [
1812
+ /* @__PURE__ */ jsx91(RadioGroup4.Item, { id: `${name}-false`, value: "false" }),
1813
+ /* @__PURE__ */ jsx91(Label3, { className: "font-normal", htmlFor: `${name}-false`, children: options?.false ?? t("form.radioLabels.false") })
1814
+ ] })
1815
+ ] }),
1816
+ /* @__PURE__ */ jsx91(FieldGroup.Error, { error })
1817
+ ] });
1818
+ };
1819
+
1820
+ // src/components/Form/BooleanField/BooleanField.tsx
1821
+ import { jsx as jsx92 } from "react/jsx-runtime";
1822
+ var BooleanField = (props) => {
1823
+ return match3(props).with({ variant: "radio" }, (props2) => /* @__PURE__ */ jsx92(BooleanFieldRadio, { ...props2 })).with({ variant: "checkbox" }, (props2) => /* @__PURE__ */ jsx92(BooleanFieldCheckbox, { ...props2 })).exhaustive();
1824
+ };
1825
+
1826
+ // src/components/Form/DateField/DateField.tsx
1827
+ import { useEffect as useEffect4, useState as useState2 } from "react";
1828
+ import { toBasicISOString } from "@douglasneuroinformatics/libjs";
1829
+ import { jsx as jsx93, jsxs as jsxs27 } from "react/jsx-runtime";
1830
+ var isValidDateString = (s) => /^(\d{4})-((0[1-9])|(1[0-2]))-((0[1-9])|([12])[0-9]|3[01])$/.test(s);
1831
+ var DateField = ({ error, label, name, setValue, value }) => {
1832
+ const [isDatePickerOpen, setIsDatePickerOpen] = useState2(false);
1833
+ const [isInputFocused, setIsInputFocused] = useState2(false);
1834
+ const [inputValue, setInputValue] = useState2("");
1835
+ useEffect4(() => {
1836
+ const isSelecting = isDatePickerOpen || isInputFocused;
1837
+ if (isSelecting) {
1838
+ return;
1839
+ } else if (isValidDateString(inputValue)) {
1840
+ setValue(new Date(inputValue));
1841
+ } else {
1842
+ setInputValue("");
1843
+ }
1844
+ }, [isDatePickerOpen, isInputFocused]);
1845
+ useEffect4(() => {
1846
+ setInputValue(value ? toBasicISOString(value) : "");
1847
+ }, [value]);
1848
+ return /* @__PURE__ */ jsxs27(FieldGroup, { children: [
1849
+ /* @__PURE__ */ jsx93(Label3, { htmlFor: name, children: label }),
1850
+ /* @__PURE__ */ jsxs27(Popover, { open: isDatePickerOpen, onOpenChange: setIsDatePickerOpen, children: [
1851
+ /* @__PURE__ */ jsx93(Popover.Trigger, { children: /* @__PURE__ */ jsx93(
1852
+ Input,
1853
+ {
1854
+ autoComplete: "off",
1855
+ "data-cy": "date-input",
1856
+ "data-testid": "date-input",
1857
+ placeholder: "YYYY-MM-DD",
1858
+ type: "text",
1859
+ value: inputValue,
1860
+ onBlur: () => setIsInputFocused(false),
1861
+ onChange: (event) => setInputValue(event.target.value),
1862
+ onFocus: () => setIsInputFocused(true)
1863
+ }
1864
+ ) }),
1865
+ /* @__PURE__ */ jsx93(Popover.Content, { asChild: true, align: "start", autofocus: false, className: "w-auto", children: /* @__PURE__ */ jsx93(
1866
+ DatePicker,
1867
+ {
1868
+ onSelection: (value2) => {
1869
+ setInputValue(toBasicISOString(value2));
1870
+ setIsDatePickerOpen(false);
1871
+ }
1872
+ }
1873
+ ) })
1874
+ ] }),
1875
+ /* @__PURE__ */ jsx93(FieldGroup.Error, { error })
1876
+ ] });
1877
+ };
1878
+
1879
+ // src/components/Form/SetField/SetField.tsx
1880
+ import { useEffect as useEffect5 } from "react";
1881
+ import { match as match4 } from "ts-pattern";
1882
+
1883
+ // src/components/Form/SetField/SetFieldListbox.tsx
1884
+ import { jsx as jsx94, jsxs as jsxs28 } from "react/jsx-runtime";
1885
+ var SetFieldListbox = ({
1886
+ description,
1887
+ error,
1888
+ label,
1889
+ name,
1890
+ onCheckedChange,
1891
+ options,
1892
+ value
1893
+ }) => {
1894
+ return /* @__PURE__ */ jsxs28(FieldGroup, { children: [
1895
+ /* @__PURE__ */ jsxs28(FieldGroup.Row, { children: [
1896
+ /* @__PURE__ */ jsx94(Label3, { children: label }),
1897
+ /* @__PURE__ */ jsx94(FieldGroup.Description, { description })
1898
+ ] }),
1899
+ Object.keys(options).map((option) => /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
1900
+ /* @__PURE__ */ jsx94(
1901
+ Checkbox,
1902
+ {
1903
+ checked: value?.has(option) ?? false,
1904
+ id: `${name}-${option}`,
1905
+ onCheckedChange: (checked) => {
1906
+ onCheckedChange(option, !checked);
1907
+ }
1908
+ }
1909
+ ),
1910
+ /* @__PURE__ */ jsx94(Label3, { className: "font-normal", htmlFor: `${name}-${option}`, children: options[option] })
1911
+ ] }, option)),
1912
+ /* @__PURE__ */ jsx94(FieldGroup.Error, { error })
1913
+ ] });
1914
+ };
1915
+
1916
+ // src/components/Form/SetField/SetFieldSelect.tsx
1917
+ import { jsx as jsx95, jsxs as jsxs29 } from "react/jsx-runtime";
1918
+ var SetFieldSelect = ({
1919
+ description,
1920
+ error,
1921
+ label,
1922
+ onCheckedChange,
1923
+ options,
1924
+ value
1925
+ }) => {
1926
+ return value ? /* @__PURE__ */ jsxs29(FieldGroup, { children: [
1927
+ /* @__PURE__ */ jsxs29(FieldGroup.Row, { children: [
1928
+ /* @__PURE__ */ jsx95(Label3, { children: label }),
1929
+ /* @__PURE__ */ jsx95(FieldGroup.Description, { description })
1930
+ ] }),
1931
+ /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
1932
+ /* @__PURE__ */ jsx95(DropdownMenu.Trigger, { asChild: true, className: "w-full", children: /* @__PURE__ */ jsx95(DropdownButton, { children: value.size ? /* @__PURE__ */ jsx95("div", { className: "flex items-center gap-2", children: Array.from(value).map((option) => /* @__PURE__ */ jsx95(Badge, { className: "font-normal", variant: "outline", children: options[option] }, option)) }) : null }) }),
1933
+ /* @__PURE__ */ jsx95(DropdownMenu.Content, { widthFull: true, align: "start", children: Object.keys(options).map((option) => {
1934
+ const checked = value.has(option);
1935
+ return /* @__PURE__ */ jsx95(
1936
+ DropdownMenu.CheckboxItem,
1937
+ {
1938
+ checked,
1939
+ onSelect: (event) => {
1940
+ event.preventDefault();
1941
+ onCheckedChange(option, value.has(option));
1942
+ },
1943
+ children: options[option]
1944
+ },
1945
+ option
1946
+ );
1947
+ }) })
1948
+ ] }),
1949
+ /* @__PURE__ */ jsx95(FieldGroup.Error, { error })
1950
+ ] }) : null;
1951
+ };
1952
+
1953
+ // src/components/Form/SetField/SetField.tsx
1954
+ import { jsx as jsx96 } from "react/jsx-runtime";
1955
+ var SetField = (props) => {
1956
+ useEffect5(() => {
1957
+ if (!props.value) {
1958
+ props.setValue(/* @__PURE__ */ new Set([]));
1959
+ }
1960
+ }, [props.value]);
1961
+ const handleCheckedChange = (option, isChecked) => {
1962
+ if (isChecked) {
1963
+ const updatedValue = new Set(props.value);
1964
+ updatedValue.delete(option);
1965
+ props.setValue(updatedValue);
1966
+ } else {
1967
+ const updatedValue = new Set(props.value);
1968
+ updatedValue.add(option);
1969
+ props.setValue(updatedValue);
1970
+ }
1971
+ };
1972
+ return match4(props).with({ variant: "select" }, (props2) => /* @__PURE__ */ jsx96(SetFieldSelect, { onCheckedChange: handleCheckedChange, ...props2 })).with({ variant: "listbox" }, (props2) => /* @__PURE__ */ jsx96(SetFieldListbox, { onCheckedChange: handleCheckedChange, ...props2 })).exhaustive();
1973
+ };
1974
+
1975
+ // src/components/Form/StringField/StringField.tsx
1976
+ import { match as match5 } from "ts-pattern";
1977
+
1978
+ // src/components/Form/StringField/StringFieldInput.tsx
1979
+ import { jsx as jsx97, jsxs as jsxs30 } from "react/jsx-runtime";
1980
+ var StringFieldInput = ({ description, error, label, name, setValue, value }) => {
1981
+ return /* @__PURE__ */ jsxs30(FieldGroup, { children: [
1982
+ /* @__PURE__ */ jsxs30(FieldGroup.Row, { children: [
1983
+ /* @__PURE__ */ jsx97(Label3, { children: label }),
1984
+ /* @__PURE__ */ jsx97(FieldGroup.Description, { description })
1985
+ ] }),
1986
+ /* @__PURE__ */ jsx97(Input, { name, type: "text", value: value ?? "", onChange: (event) => setValue(event.target.value) }),
1987
+ /* @__PURE__ */ jsx97(FieldGroup.Error, { error })
1988
+ ] });
1989
+ };
1990
+
1991
+ // src/components/Form/StringField/StringFieldPassword.tsx
1992
+ import { useState as useState3 } from "react";
1993
+ import { EyeIcon, EyeOffIcon } from "lucide-react";
1994
+ import { jsx as jsx98, jsxs as jsxs31 } from "react/jsx-runtime";
1995
+ var StringFieldPassword = ({ description, error, label, name, setValue, value }) => {
1996
+ const [show, setShow] = useState3(false);
1997
+ return /* @__PURE__ */ jsxs31(FieldGroup, { children: [
1998
+ /* @__PURE__ */ jsxs31(FieldGroup.Row, { children: [
1999
+ /* @__PURE__ */ jsx98(Label3, { children: label }),
2000
+ /* @__PURE__ */ jsx98(FieldGroup.Description, { description })
2001
+ ] }),
2002
+ /* @__PURE__ */ jsxs31(FieldGroup.Row, { children: [
2003
+ /* @__PURE__ */ jsx98(
2004
+ Input,
2005
+ {
2006
+ name,
2007
+ type: show ? "text" : "password",
2008
+ value: value ?? "",
2009
+ onChange: (event) => setValue(event.target.value)
2010
+ }
2011
+ ),
2012
+ /* @__PURE__ */ jsxs31(
2013
+ "button",
2014
+ {
2015
+ className: "absolute right-0 flex h-full w-8 items-center justify-center text-muted-foreground",
2016
+ type: "button",
2017
+ onClick: () => setShow(!show),
2018
+ children: [
2019
+ /* @__PURE__ */ jsx98(EyeIcon, { className: cn("absolute transition-all", show ? "-rotate-90 scale-0" : "rotate-0 scale-100") }),
2020
+ /* @__PURE__ */ jsx98(EyeOffIcon, { className: cn("absolute transition-all", !show ? "rotate-90 scale-0" : "rotate-0 scale-100") })
2021
+ ]
2022
+ }
2023
+ )
2024
+ ] }),
2025
+ /* @__PURE__ */ jsx98(FieldGroup.Error, { error })
2026
+ ] });
2027
+ };
2028
+
2029
+ // src/components/Form/BaseRadioField.tsx
2030
+ import { cva as cva4 } from "class-variance-authority";
2031
+ import { jsx as jsx99, jsxs as jsxs32 } from "react/jsx-runtime";
2032
+ var baseRadioFieldVariants = cva4("flex", {
2033
+ defaultVariants: {
2034
+ orientation: "vertical"
2035
+ },
2036
+ variants: {
2037
+ orientation: {
2038
+ horizontal: "flex-col @3xl:flex-row @3xl:items-center @3xl:justify-between",
2039
+ vertical: "flex-col"
2040
+ }
2041
+ }
2042
+ });
2043
+ var BaseRadioField = ({
2044
+ description,
2045
+ error,
2046
+ label,
2047
+ name,
2048
+ options,
2049
+ orientation = "vertical",
2050
+ setValue,
2051
+ value
2052
+ }) => {
2053
+ const optionsCount = Object.keys(options).length;
2054
+ return /* @__PURE__ */ jsxs32(FieldGroup, { children: [
2055
+ /* @__PURE__ */ jsxs32(FieldGroup.Row, { children: [
2056
+ /* @__PURE__ */ jsx99(Label3, { children: label }),
2057
+ /* @__PURE__ */ jsx99(FieldGroup.Description, { description })
2058
+ ] }),
2059
+ /* @__PURE__ */ jsx99(
2060
+ RadioGroup4,
2061
+ {
2062
+ className: baseRadioFieldVariants({ orientation: optionsCount > 5 ? "vertical" : orientation }),
2063
+ name,
2064
+ value: value ?? "",
2065
+ onValueChange: (value2) => setValue(value2),
2066
+ children: Object.keys(options).map((option) => /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2", children: [
2067
+ /* @__PURE__ */ jsx99(RadioGroup4.Item, { id: `${name}-${option}`, value: option }),
2068
+ /* @__PURE__ */ jsx99(Label3, { className: "font-normal", htmlFor: `${name}-${option}`, children: options[option] })
2069
+ ] }, option))
2070
+ }
2071
+ ),
2072
+ /* @__PURE__ */ jsx99(FieldGroup.Error, { error })
2073
+ ] });
2074
+ };
2075
+
2076
+ // src/components/Form/StringField/StringFieldRadio.tsx
2077
+ import { jsx as jsx100 } from "react/jsx-runtime";
2078
+ var StringFieldRadio = (props) => {
2079
+ return /* @__PURE__ */ jsx100(BaseRadioField, { ...props });
2080
+ };
2081
+
2082
+ // src/components/Select/Select.tsx
2083
+ import * as SelectPrimitive8 from "@radix-ui/react-select";
2084
+
2085
+ // src/components/Select/SelectContent.tsx
2086
+ import React74 from "react";
2087
+ import * as SelectPrimitive3 from "@radix-ui/react-select";
2088
+
2089
+ // src/components/Select/SelectScrollDownButton.tsx
2090
+ import React72 from "react";
2091
+ import * as SelectPrimitive from "@radix-ui/react-select";
2092
+ import { ChevronDownIcon as ChevronDownIcon3 } from "lucide-react";
2093
+ import { jsx as jsx101 } from "react/jsx-runtime";
2094
+ var SelectScrollDownButton = React72.forwardRef(function SelectScrollDownButton2({ className, ...props }, ref) {
2095
+ return /* @__PURE__ */ jsx101(
2096
+ SelectPrimitive.ScrollDownButton,
2097
+ {
2098
+ className: cn("flex cursor-default items-center justify-center py-1", className),
2099
+ ref,
2100
+ ...props,
2101
+ children: /* @__PURE__ */ jsx101(ChevronDownIcon3, {})
2102
+ }
2103
+ );
2104
+ });
2105
+
2106
+ // src/components/Select/SelectScrollUpButton.tsx
2107
+ import React73 from "react";
2108
+ import * as SelectPrimitive2 from "@radix-ui/react-select";
2109
+ import { ChevronUpIcon as ChevronUpIcon2 } from "lucide-react";
2110
+ import { jsx as jsx102 } from "react/jsx-runtime";
2111
+ var SelectScrollUpButton = React73.forwardRef(function SelectScrollUpButton2({ className, ...props }, ref) {
2112
+ return /* @__PURE__ */ jsx102(
2113
+ SelectPrimitive2.ScrollUpButton,
2114
+ {
2115
+ className: cn("flex cursor-default items-center justify-center py-1", className),
2116
+ ref,
2117
+ ...props,
2118
+ children: /* @__PURE__ */ jsx102(ChevronUpIcon2, {})
2119
+ }
2120
+ );
2121
+ });
2122
+
2123
+ // src/components/Select/SelectContent.tsx
2124
+ import { jsx as jsx103, jsxs as jsxs33 } from "react/jsx-runtime";
2125
+ var SelectContent = React74.forwardRef(function SelectContent2({ children, className, position = "popper", ...props }, ref) {
2126
+ return /* @__PURE__ */ jsx103(SelectPrimitive3.Portal, { children: /* @__PURE__ */ jsxs33(
2127
+ SelectPrimitive3.Content,
2128
+ {
2129
+ className: cn(
2130
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2131
+ position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
2132
+ className
2133
+ ),
2134
+ position,
2135
+ ref,
2136
+ ...props,
2137
+ children: [
2138
+ /* @__PURE__ */ jsx103(SelectScrollUpButton, {}),
2139
+ /* @__PURE__ */ jsx103(
2140
+ SelectPrimitive3.Viewport,
2141
+ {
2142
+ className: cn(
2143
+ "p-1",
2144
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
2145
+ ),
2146
+ children
2147
+ }
2148
+ ),
2149
+ /* @__PURE__ */ jsx103(SelectScrollDownButton, {})
2150
+ ]
2151
+ }
2152
+ ) });
2153
+ });
2154
+
2155
+ // src/components/Select/SelectItem.tsx
2156
+ import React75 from "react";
2157
+ import * as SelectPrimitive4 from "@radix-ui/react-select";
2158
+ import { CheckIcon as CheckIcon4 } from "lucide-react";
2159
+ import { jsx as jsx104, jsxs as jsxs34 } from "react/jsx-runtime";
2160
+ var SelectItem = React75.forwardRef(function SelectItem2({ children, className, ...props }, ref) {
2161
+ return /* @__PURE__ */ jsxs34(
2162
+ SelectPrimitive4.Item,
2163
+ {
2164
+ className: cn(
2165
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2166
+ className
2167
+ ),
2168
+ ref,
2169
+ ...props,
2170
+ children: [
2171
+ /* @__PURE__ */ jsx104("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx104(SelectPrimitive4.ItemIndicator, { children: /* @__PURE__ */ jsx104(CheckIcon4, { className: "h-4 w-4" }) }) }),
2172
+ /* @__PURE__ */ jsx104(SelectPrimitive4.ItemText, { children })
2173
+ ]
2174
+ }
2175
+ );
2176
+ });
2177
+
2178
+ // src/components/Select/SelectLabel.tsx
2179
+ import React76 from "react";
2180
+ import * as SelectPrimitive5 from "@radix-ui/react-select";
2181
+ import { jsx as jsx105 } from "react/jsx-runtime";
2182
+ var SelectLabel = React76.forwardRef(function SelectLabel2({ className, ...props }, ref) {
2183
+ return /* @__PURE__ */ jsx105(SelectPrimitive5.Label, { className: cn("px-2 py-1.5 text-sm font-semibold", className), ref, ...props });
2184
+ });
2185
+
2186
+ // src/components/Select/SelectSeparator.tsx
2187
+ import React77 from "react";
2188
+ import * as SelectPrimitive6 from "@radix-ui/react-select";
2189
+ import { jsx as jsx106 } from "react/jsx-runtime";
2190
+ var SelectSeparator = React77.forwardRef(function SelectSeparator2({ className, ...props }, ref) {
2191
+ return /* @__PURE__ */ jsx106(SelectPrimitive6.Separator, { className: cn("-mx-1 my-1 h-px bg-muted", className), ref, ...props });
2192
+ });
2193
+
2194
+ // src/components/Select/SelectTrigger.tsx
2195
+ import React78 from "react";
2196
+ import * as SelectPrimitive7 from "@radix-ui/react-select";
2197
+ import { jsx as jsx107 } from "react/jsx-runtime";
2198
+ var SelectTrigger = React78.forwardRef(function SelectTrigger2({ children, className, ...props }, ref) {
2199
+ return /* @__PURE__ */ jsx107(SelectPrimitive7.Trigger, { asChild: true, className, ref, ...props, children: /* @__PURE__ */ jsx107(DropdownButton, { children }) });
2200
+ });
2201
+
2202
+ // src/components/Select/Select.tsx
2203
+ var Select = Object.assign(SelectPrimitive8.Root, {
2204
+ Content: SelectContent,
2205
+ Group: SelectPrimitive8.Group,
2206
+ Item: SelectItem,
2207
+ Label: SelectLabel,
2208
+ ScrollDownButton: SelectScrollDownButton,
2209
+ ScrollUpButton: SelectScrollUpButton,
2210
+ Separator: SelectSeparator,
2211
+ Trigger: SelectTrigger,
2212
+ Value: SelectPrimitive8.Value
2213
+ });
2214
+
2215
+ // src/components/Form/StringField/StringFieldSelect.tsx
2216
+ import { jsx as jsx108, jsxs as jsxs35 } from "react/jsx-runtime";
2217
+ var StringFieldSelect = ({
2218
+ description,
2219
+ error,
2220
+ label,
2221
+ name,
2222
+ options,
2223
+ setValue,
2224
+ value
2225
+ }) => {
2226
+ return /* @__PURE__ */ jsxs35(FieldGroup, { children: [
2227
+ /* @__PURE__ */ jsxs35(FieldGroup.Row, { children: [
2228
+ /* @__PURE__ */ jsx108(Label3, { children: label }),
2229
+ /* @__PURE__ */ jsx108(FieldGroup.Description, { description })
2230
+ ] }),
2231
+ /* @__PURE__ */ jsxs35(Select, { name, value: value ?? "", onValueChange: (value2) => setValue(value2), children: [
2232
+ /* @__PURE__ */ jsx108(Select.Trigger, { children: /* @__PURE__ */ jsx108(Select.Value, {}) }),
2233
+ /* @__PURE__ */ jsx108(Select.Content, { children: Object.keys(options).map((option) => /* @__PURE__ */ jsx108(Select.Item, { value: option, children: options[option] }, option)) })
2234
+ ] }),
2235
+ /* @__PURE__ */ jsx108(FieldGroup.Error, { error })
2236
+ ] });
2237
+ };
2238
+
2239
+ // src/components/TextArea/TextArea.tsx
2240
+ import React79 from "react";
2241
+ import { jsx as jsx109 } from "react/jsx-runtime";
2242
+ var TextArea = React79.forwardRef(function TextArea2({ className, ...props }, ref) {
2243
+ return /* @__PURE__ */ jsx109(
2244
+ "textarea",
2245
+ {
2246
+ autoComplete: "off",
2247
+ className: cn(
2248
+ "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
2249
+ className
2250
+ ),
2251
+ "data-testid": "text-area",
2252
+ ref,
2253
+ ...props
2254
+ }
2255
+ );
2256
+ });
2257
+
2258
+ // src/components/Form/StringField/StringFieldTextArea.tsx
2259
+ import { jsx as jsx110, jsxs as jsxs36 } from "react/jsx-runtime";
2260
+ var StringFieldTextArea = ({ description, error, label, name, setValue, value }) => {
2261
+ return /* @__PURE__ */ jsxs36(FieldGroup, { children: [
2262
+ /* @__PURE__ */ jsxs36(FieldGroup.Row, { children: [
2263
+ /* @__PURE__ */ jsx110(Label3, { children: label }),
2264
+ /* @__PURE__ */ jsx110(FieldGroup.Description, { description })
2265
+ ] }),
2266
+ /* @__PURE__ */ jsx110(TextArea, { name, rows: 5, value: value ?? "", onChange: (event) => setValue(event.target.value) }),
2267
+ /* @__PURE__ */ jsx110(FieldGroup.Error, { error })
2268
+ ] });
2269
+ };
2270
+
2271
+ // src/components/Form/StringField/StringField.tsx
2272
+ import { jsx as jsx111 } from "react/jsx-runtime";
2273
+ var StringField = (props) => {
2274
+ return match5(props).with({ variant: "textarea" }, (props2) => /* @__PURE__ */ jsx111(StringFieldTextArea, { ...props2 })).with({ variant: "password" }, (props2) => /* @__PURE__ */ jsx111(StringFieldPassword, { ...props2 })).with({ variant: "input" }, (props2) => /* @__PURE__ */ jsx111(StringFieldInput, { ...props2 })).with({ variant: "select" }, (props2) => /* @__PURE__ */ jsx111(StringFieldSelect, { ...props2 })).with({ variant: "radio" }, (props2) => /* @__PURE__ */ jsx111(StringFieldRadio, { ...props2 })).exhaustive();
2275
+ };
2276
+
2277
+ // src/components/Form/ScalarField.tsx
2278
+ import { jsx as jsx112 } from "react/jsx-runtime";
2279
+ var ScalarField = ({ field, ...props }) => {
2280
+ switch (field.kind) {
2281
+ case "string":
2282
+ return /* @__PURE__ */ jsx112(StringField, { ...field, ...props });
2283
+ case "number":
2284
+ return /* @__PURE__ */ jsx112(NumberField, { ...field, ...props });
2285
+ case "date":
2286
+ return /* @__PURE__ */ jsx112(DateField, { ...field, ...props });
2287
+ case "boolean":
2288
+ return /* @__PURE__ */ jsx112(BooleanField, { ...field, ...props });
2289
+ case "set":
2290
+ return /* @__PURE__ */ jsx112(SetField, { ...field, ...props });
2291
+ default:
2292
+ throw new Error(`Unexpected value for kind: ${Reflect.get(field, "kind")}`);
2293
+ }
2294
+ };
2295
+
2296
+ // src/components/Form/RecordArrayField.tsx
2297
+ import { jsx as jsx113, jsxs as jsxs37 } from "react/jsx-runtime";
2298
+ var RecordArrayField = memo(function RecordArrayField2({
2299
+ error: arrayError,
2300
+ fieldset,
2301
+ label,
2302
+ setError: setArrayError,
2303
+ setValue: setArrayValue,
2304
+ value: arrayValue
2305
+ }) {
2306
+ const { t } = useTranslation4();
2307
+ const createNewRecord = () => Object.fromEntries(Object.keys(fieldset).map((fieldName) => [fieldName, void 0]));
2308
+ useEffect6(() => {
2309
+ setArrayValue([createNewRecord()]);
2310
+ }, [fieldset]);
2311
+ if (!arrayValue) {
2312
+ return null;
2313
+ }
2314
+ const appendField = () => {
2315
+ setArrayValue([...arrayValue, createNewRecord()]);
2316
+ };
2317
+ const removeField = () => {
2318
+ if (arrayValue.length > 1) {
2319
+ setArrayValue(arrayValue.slice(0, arrayValue.length - 1));
2320
+ }
2321
+ };
2322
+ return /* @__PURE__ */ jsxs37("div", { className: "space-y-4", children: [
2323
+ /* @__PURE__ */ jsx113(Heading, { variant: "h5", children: label }),
2324
+ /* @__PURE__ */ jsx113("div", { className: "space-y-8", children: arrayValue.map((fields, i) => /* @__PURE__ */ jsxs37("div", { className: "space-y-4", children: [
2325
+ /* @__PURE__ */ jsx113(Label3, { className: "font-semibold italic", children: label + " " + (i + 1) }),
2326
+ Object.keys(fields).map((name) => {
2327
+ const field = fieldset[name];
2328
+ const fieldProps = field?.kind === "dynamic" ? field.render(fields) : field;
2329
+ if (!fieldProps) {
2330
+ return null;
2331
+ }
2332
+ return /* @__PURE__ */ jsx113(
2333
+ ScalarField,
2334
+ {
2335
+ error: arrayError?.[i]?.[name],
2336
+ field: fieldProps,
2337
+ name,
2338
+ setError: (error) => {
2339
+ const newArrayError = arrayError ? [...arrayError] : [];
2340
+ if (!newArrayError[i]) {
2341
+ newArrayError[i] = {};
2342
+ }
2343
+ newArrayError[i][name] = error;
2344
+ setArrayError(newArrayError);
2345
+ },
2346
+ setValue: (value) => {
2347
+ const newArrayValue = [...arrayValue];
2348
+ newArrayValue[i][name] = value;
2349
+ setArrayValue(newArrayValue);
2350
+ },
2351
+ value: arrayValue?.[i]?.[name]
2352
+ },
2353
+ name
2354
+ );
2355
+ })
2356
+ ] }, i)) }),
2357
+ /* @__PURE__ */ jsxs37("div", { className: "flex gap-3", children: [
2358
+ /* @__PURE__ */ jsxs37(Button, { type: "button", variant: "outline", onClick: appendField, children: [
2359
+ t("form.append"),
2360
+ /* @__PURE__ */ jsx113(PlusCircleIcon, { className: "ml-2" })
2361
+ ] }),
2362
+ /* @__PURE__ */ jsxs37(Button, { type: "button", variant: "outline", onClick: removeField, children: [
2363
+ t("form.remove"),
2364
+ /* @__PURE__ */ jsx113(MinusCircleIcon, { className: "ml-2" })
2365
+ ] })
2366
+ ] })
2367
+ ] });
2368
+ });
2369
+
2370
+ // src/components/Form/StaticField.tsx
2371
+ import { jsx as jsx114 } from "react/jsx-runtime";
2372
+ var StaticField = ({
2373
+ errors,
2374
+ field,
2375
+ name,
2376
+ setErrors,
2377
+ setValues,
2378
+ values
2379
+ }) => {
2380
+ const setError = useCallback2(
2381
+ (error) => {
2382
+ return setErrors((prevErrors) => ({ ...prevErrors, [name]: error }));
2383
+ },
2384
+ [setErrors]
2385
+ );
2386
+ const setValue = useCallback2(
2387
+ (value) => {
2388
+ return setValues((prevValues) => ({ ...prevValues, [name]: value }));
2389
+ },
2390
+ [setValues]
2391
+ );
2392
+ return match6(field).with({ kind: "record-array" }, (field2) => /* @__PURE__ */ jsx114(
2393
+ RecordArrayField,
2394
+ {
2395
+ ...field2,
2396
+ error: errors[name],
2397
+ name,
2398
+ setError,
2399
+ setValue,
2400
+ value: values[name]
2401
+ }
2402
+ )).with({ kind: "number-record" }, (field2) => /* @__PURE__ */ jsx114(
2403
+ NumberRecordField,
2404
+ {
2405
+ ...field2,
2406
+ error: errors[name],
2407
+ name,
2408
+ setError,
2409
+ setValue,
2410
+ value: values[name]
2411
+ }
2412
+ )).otherwise((field2) => /* @__PURE__ */ jsx114(
2413
+ ScalarField,
2414
+ {
2415
+ error: errors[name],
2416
+ field: field2,
2417
+ name,
2418
+ setError,
2419
+ setValue,
2420
+ value: values[name]
2421
+ }
2422
+ ));
2423
+ };
2424
+
2425
+ // src/components/Form/DynamicField.tsx
2426
+ import { jsx as jsx115 } from "react/jsx-runtime";
2427
+ var DynamicField = ({
2428
+ field,
2429
+ name,
2430
+ values,
2431
+ ...props
2432
+ }) => {
2433
+ const [dependentValues, setDependentValues] = useState4(pick(values, field.deps));
2434
+ const staticField = useMemo2(() => {
2435
+ return field.render(values);
2436
+ }, [dependentValues, field.render]);
2437
+ useEffect7(() => {
2438
+ for (const key of field.deps) {
2439
+ if (dependentValues[key] !== values[key]) {
2440
+ setDependentValues(pick(values, field.deps));
2441
+ break;
2442
+ }
2443
+ }
2444
+ }, [field.deps, values]);
2445
+ if (!staticField) {
2446
+ return null;
2447
+ }
2448
+ return /* @__PURE__ */ jsx115(StaticField, { ...props, field: staticField, name, values });
2449
+ };
2450
+
2451
+ // src/components/Form/FieldsComponent.tsx
2452
+ import { createElement } from "react";
2453
+ var FieldsComponent = ({ fields, ...props }) => {
2454
+ return Object.keys(fields).map((name) => {
2455
+ const field = fields[name];
2456
+ if (field.kind === "dynamic") {
2457
+ return /* @__PURE__ */ createElement(DynamicField, { ...props, field, key: name, name });
2458
+ }
2459
+ return /* @__PURE__ */ createElement(StaticField, { ...props, field, key: name, name });
2460
+ });
2461
+ };
2462
+
2463
+ // src/components/Form/utils.ts
2464
+ function getInitialValues(values) {
2465
+ const initialValues = {};
2466
+ for (const key in values) {
2467
+ const value = values[key];
2468
+ if (value === null || value === void 0) {
2469
+ continue;
2470
+ } else if (Array.isArray(value)) {
2471
+ initialValues[key] = value.map(getInitialValues);
2472
+ } else {
2473
+ initialValues[key] = value;
2474
+ }
2475
+ }
2476
+ return initialValues;
2477
+ }
2478
+
2479
+ // src/components/Form/Form.tsx
2480
+ import { jsx as jsx116, jsxs as jsxs38 } from "react/jsx-runtime";
2481
+ var Form = ({
2482
+ className,
2483
+ content,
2484
+ id,
2485
+ initialValues,
2486
+ onError,
2487
+ onSubmit,
2488
+ resetBtn,
2489
+ submitBtnLabel,
2490
+ validationSchema,
2491
+ ...props
2492
+ }) => {
2493
+ const { t } = useTranslation5();
2494
+ const [rootError, setRootError] = useState5(null);
2495
+ const [errors, setErrors] = useState5({});
2496
+ const [values, setValues] = useState5(
2497
+ initialValues ? getInitialValues(initialValues) : {}
2498
+ );
2499
+ const handleError = (error) => {
2500
+ const fieldErrors = {};
2501
+ const rootErrors = [];
2502
+ for (const issue of error.issues) {
2503
+ if (issue.path.length > 0) {
2504
+ set(fieldErrors, issue.path, issue.message);
2505
+ } else {
2506
+ rootErrors.push(issue.message);
2507
+ }
2508
+ }
2509
+ setRootError(rootErrors.join("\n"));
2510
+ setErrors(fieldErrors);
2511
+ if (onError) {
2512
+ onError(error);
2513
+ }
2514
+ };
2515
+ const reset = () => {
2516
+ setRootError(null);
2517
+ setErrors({});
2518
+ setValues({});
2519
+ };
2520
+ const handleSubmit = (event) => {
2521
+ event.preventDefault();
2522
+ const result = validationSchema.safeParse(values);
2523
+ if (result.success) {
2524
+ reset();
2525
+ onSubmit(result.data);
2526
+ } else {
2527
+ console.error(result.error.issues);
2528
+ handleError(result.error);
2529
+ }
2530
+ };
2531
+ const isGrouped = Array.isArray(content);
2532
+ return /* @__PURE__ */ jsxs38(
2533
+ "form",
2534
+ {
2535
+ autoComplete: "off",
2536
+ className: twMerge("my-8 w-full", isGrouped ? "space-y-8 divide-y" : "space-y-8", className),
2537
+ id,
2538
+ onSubmit: handleSubmit,
2539
+ ...props,
2540
+ children: [
2541
+ isGrouped ? content.map((fieldGroup, i) => {
2542
+ return /* @__PURE__ */ jsxs38("div", { className: "space-y-8 [&:not(:first-child)]:pt-8", children: [
2543
+ /* @__PURE__ */ jsxs38("div", { children: [
2544
+ /* @__PURE__ */ jsx116(Heading, { variant: "h4", children: fieldGroup.title }),
2545
+ fieldGroup.description && /* @__PURE__ */ jsx116("small", { className: "text-sm italic text-muted-foreground", children: fieldGroup.description })
2546
+ ] }),
2547
+ /* @__PURE__ */ jsx116(
2548
+ FieldsComponent,
2549
+ {
2550
+ errors,
2551
+ fields: fieldGroup.fields,
2552
+ setErrors,
2553
+ setValues,
2554
+ values
2555
+ }
2556
+ )
2557
+ ] }, i);
2558
+ }) : /* @__PURE__ */ jsx116(FieldsComponent, { errors, fields: content, setErrors, setValues, values }),
2559
+ /* @__PURE__ */ jsxs38("div", { className: "flex w-full gap-3", children: [
2560
+ /* @__PURE__ */ jsx116(
2561
+ Button,
2562
+ {
2563
+ "aria-label": "Submit Button",
2564
+ className: "block w-full",
2565
+ "data-cy": "submit-form",
2566
+ type: "submit",
2567
+ variant: "primary",
2568
+ children: submitBtnLabel ?? t("form.submit")
2569
+ }
2570
+ ),
2571
+ resetBtn && /* @__PURE__ */ jsx116(Button, { "aria-label": "Reset Button", className: "block w-full", type: "button", variant: "secondary", onClick: reset, children: t("form.reset") })
2572
+ ] }),
2573
+ rootError && /* @__PURE__ */ jsx116(ErrorMessage, { error: rootError })
2574
+ ]
2575
+ }
2576
+ );
2577
+ };
2578
+
2579
+ // src/components/HoverCard/HoverCard.tsx
2580
+ import { Root as Root14, Trigger as Trigger8 } from "@radix-ui/react-hover-card";
2581
+
2582
+ // src/components/HoverCard/HoverCardContent.tsx
2583
+ import React81 from "react";
2584
+ import { Content as Content9 } from "@radix-ui/react-hover-card";
2585
+ import { jsx as jsx117 } from "react/jsx-runtime";
2586
+ var HoverCardContent = React81.forwardRef(function HoverCardContent2({ align = "center", className, sideOffset = 4, ...props }, ref) {
2587
+ return /* @__PURE__ */ jsx117(
2588
+ Content9,
2589
+ {
2590
+ align,
2591
+ className: cn(
2592
+ "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2593
+ className
2594
+ ),
2595
+ ref,
2596
+ sideOffset,
2597
+ ...props
2598
+ }
2599
+ );
2600
+ });
2601
+
2602
+ // src/components/HoverCard/HoverCard.tsx
2603
+ var HoverCard = Object.assign(Root14, {
2604
+ Content: HoverCardContent,
2605
+ Trigger: Trigger8
2606
+ });
2607
+
2608
+ // src/components/LanguageToggle/LanguageToggle.tsx
2609
+ import { LanguagesIcon } from "lucide-react";
2610
+ import { useTranslation as useTranslation6 } from "react-i18next";
2611
+ import { jsx as jsx118, jsxs as jsxs39 } from "react/jsx-runtime";
2612
+ var LanguageToggle = ({ align } = { align: "start" }) => {
2613
+ const { i18n } = useTranslation6();
2614
+ return /* @__PURE__ */ jsxs39(DropdownMenu, { children: [
2615
+ /* @__PURE__ */ jsx118(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx118(Button, { size: "icon", variant: "outline", children: /* @__PURE__ */ jsx118(LanguagesIcon, {}) }) }),
2616
+ /* @__PURE__ */ jsxs39(DropdownMenu.Content, { align, children: [
2617
+ /* @__PURE__ */ jsx118(DropdownMenu.Item, { onClick: () => i18n.changeLanguage("en"), children: "English" }),
2618
+ /* @__PURE__ */ jsx118(DropdownMenu.Item, { onClick: () => i18n.changeLanguage("fr"), children: "Fran\xE7ais" })
2619
+ ] })
2620
+ ] });
2621
+ };
2622
+
2623
+ // src/components/LegacyStepper/LegacyStepper.tsx
2624
+ import React82, { useEffect as useEffect8, useReducer as useReducer2, useRef as useRef2, useState as useState6 } from "react";
2625
+ import clsx from "clsx";
2626
+ import { jsx as jsx119, jsxs as jsxs40 } from "react/jsx-runtime";
2627
+ var LegacyStepper = ({ className, steps }) => {
2628
+ const icons = useRef2([]);
2629
+ const [divideStyles, setDivideStyles] = useState6([]);
2630
+ const { height, width } = useWindowSize();
2631
+ useEffect8(() => {
2632
+ const styles = [];
2633
+ for (let i = 0; i < steps.length - 1; i++) {
2634
+ const current = icons.current[i];
2635
+ const next = icons.current[i + 1];
2636
+ const left = current.offsetLeft + current.offsetWidth;
2637
+ styles.push({
2638
+ left,
2639
+ width: next.offsetLeft - left
2640
+ });
2641
+ }
2642
+ setDivideStyles(styles);
2643
+ }, [height, width]);
2644
+ const [index, updateIndex] = useReducer2((prevIndex, action) => {
2645
+ if (action === "decrement" && prevIndex > 0) {
2646
+ return prevIndex - 1;
2647
+ } else if (action === "increment" && prevIndex < steps.length - 1) {
2648
+ return prevIndex + 1;
2649
+ }
2650
+ return prevIndex;
2651
+ }, 0);
2652
+ return /* @__PURE__ */ jsx119(LegacyStepperContext.Provider, { value: { index, updateIndex }, children: /* @__PURE__ */ jsxs40("div", { className: cn("flex flex-col", className), children: [
2653
+ /* @__PURE__ */ jsx119("div", { className: "relative mb-12 flex items-center justify-between print:hidden", children: steps.map((step, i) => {
2654
+ return /* @__PURE__ */ jsxs40(React82.Fragment, { children: [
2655
+ /* @__PURE__ */ jsx119("div", { className: "flex items-center", children: /* @__PURE__ */ jsxs40("div", { className: "flex flex-col items-center justify-center", children: [
2656
+ /* @__PURE__ */ jsx119(
2657
+ "div",
2658
+ {
2659
+ className: clsx(
2660
+ "h-12 w-12 rounded-full bg-sky-700 py-3 text-white transition duration-500 ease-in-out [&>*]:h-full [&>*]:w-full",
2661
+ i > index && "bg-slate-200 dark:bg-slate-700"
2662
+ ),
2663
+ ref: (e) => {
2664
+ icons.current[i] = e;
2665
+ },
2666
+ children: step.icon
2667
+ }
2668
+ ),
2669
+ /* @__PURE__ */ jsx119("span", { className: "mt-2 text-xs font-medium uppercase text-muted-foreground", children: step.label })
2670
+ ] }) }),
2671
+ i !== steps.length - 1 && /* @__PURE__ */ jsx119(
2672
+ "div",
2673
+ {
2674
+ className: clsx(
2675
+ "absolute top-6 flex-auto border-t-2 transition duration-500 ease-in-out",
2676
+ i >= index ? "border-slate-200 dark:border-slate-700" : "border-sky-700"
2677
+ ),
2678
+ style: divideStyles[i]
2679
+ }
2680
+ )
2681
+ ] }, i);
2682
+ }) }),
2683
+ /* @__PURE__ */ jsx119("div", { className: "flex-grow", children: steps[index]?.element })
2684
+ ] }) });
2685
+ };
2686
+
2687
+ // src/components/LineGraph/LineGraph.tsx
2688
+ import React83 from "react";
2689
+ import { toBasicISOString as toBasicISOString2 } from "@douglasneuroinformatics/libjs";
2690
+ import { useTranslation as useTranslation7 } from "react-i18next";
2691
+ import {
2692
+ CartesianGrid,
2693
+ ErrorBar,
2694
+ Label as Label6,
2695
+ Legend,
2696
+ Line,
2697
+ LineChart,
2698
+ ResponsiveContainer,
2699
+ Tooltip,
2700
+ XAxis,
2701
+ YAxis
2702
+ } from "recharts";
2703
+ import { jsx as jsx120, jsxs as jsxs41 } from "react/jsx-runtime";
2704
+ import { createElement as createElement2 } from "react";
2705
+ var strokeColors = {
2706
+ dark: "#cbd5e1",
2707
+ // slate-300
2708
+ light: "#475569"
2709
+ // slate-600
2710
+ };
2711
+ var tooltipStyles = {
2712
+ dark: {
2713
+ backgroundColor: "#0f172a",
2714
+ // slate-900
2715
+ borderColor: strokeColors.light,
2716
+ borderRadius: "2px"
2717
+ },
2718
+ light: {
2719
+ backgroundColor: "#f1f5f9",
2720
+ // slate-100
2721
+ borderColor: strokeColors.dark,
2722
+ borderRadius: "2px"
2723
+ }
2724
+ };
2725
+ function LineGraphComponent({
2726
+ data,
2727
+ lines,
2728
+ xAxis
2729
+ }) {
2730
+ const { i18n } = useTranslation7();
2731
+ const [theme] = useTheme();
2732
+ return /* @__PURE__ */ jsx120(ResponsiveContainer, { height: 400, width: "100%", children: /* @__PURE__ */ jsxs41(LineChart, { data: [...data], margin: { bottom: 5, left: 15, right: 15, top: 5 }, children: [
2733
+ /* @__PURE__ */ jsx120(CartesianGrid, { stroke: "#64748b", strokeDasharray: "5 5" }),
2734
+ /* @__PURE__ */ jsx120(
2735
+ XAxis,
2736
+ {
2737
+ axisLine: { stroke: "#64748b" },
2738
+ dataKey: xAxis?.key,
2739
+ domain: ["auto", "auto"],
2740
+ height: 50,
2741
+ interval: "preserveStartEnd",
2742
+ padding: { left: 20, right: 20 },
2743
+ stroke: strokeColors[theme],
2744
+ tickFormatter: (time) => toBasicISOString2(new Date(time)),
2745
+ tickLine: { stroke: "#64748b" },
2746
+ tickMargin: 8,
2747
+ tickSize: 8,
2748
+ type: "number",
2749
+ children: /* @__PURE__ */ jsx120(Label6, { fill: strokeColors[theme], offset: 0, position: "insideBottom", value: xAxis?.label })
2750
+ }
2751
+ ),
2752
+ /* @__PURE__ */ jsx120(
2753
+ YAxis,
2754
+ {
2755
+ axisLine: { stroke: "#64748b" },
2756
+ stroke: strokeColors[theme],
2757
+ tickLine: { stroke: "#64748b" },
2758
+ tickMargin: 5,
2759
+ tickSize: 8,
2760
+ width: 40
2761
+ }
2762
+ ),
2763
+ /* @__PURE__ */ jsx120(
2764
+ Tooltip,
2765
+ {
2766
+ contentStyle: tooltipStyles[theme],
2767
+ labelFormatter: (time) => {
2768
+ const date = new Date(time);
2769
+ return new Intl.DateTimeFormat(i18n.resolvedLanguage, {
2770
+ dateStyle: "full",
2771
+ timeStyle: "medium"
2772
+ }).format(date);
2773
+ },
2774
+ labelStyle: { color: strokeColors[theme], fontWeight: 500, whiteSpace: "pre-wrap" }
2775
+ }
2776
+ ),
2777
+ lines.map(({ err, name, stroke, type, val, ...props }) => /* @__PURE__ */ createElement2(
2778
+ Line,
2779
+ {
2780
+ ...props,
2781
+ dataKey: val,
2782
+ key: val,
2783
+ name,
2784
+ stroke: stroke ?? strokeColors[theme],
2785
+ type: type ?? "linear"
2786
+ },
2787
+ err && /* @__PURE__ */ jsx120(ErrorBar, { dataKey: err, stroke: "#64748b" })
2788
+ )),
2789
+ /* @__PURE__ */ jsx120(Legend, { wrapperStyle: { paddingLeft: 40, paddingTop: 10 } })
2790
+ ] }) });
2791
+ }
2792
+ var LineGraph = React83.memo(LineGraphComponent);
2793
+
2794
+ // src/components/MenuBar/MenuBar.tsx
2795
+ import { Group as Group4, Menu, Portal as Portal10, RadioGroup as RadioGroup5, Sub as Sub3 } from "@radix-ui/react-menubar";
2796
+
2797
+ // src/components/MenuBar/MenuBarCheckboxItem.tsx
2798
+ import React84 from "react";
2799
+ import { CheckboxItem as CheckboxItem3, ItemIndicator as ItemIndicator6 } from "@radix-ui/react-menubar";
2800
+ import { CheckIcon as CheckIcon5 } from "lucide-react";
2801
+ import { jsx as jsx121, jsxs as jsxs42 } from "react/jsx-runtime";
2802
+ var MenuBarCheckboxItem = React84.forwardRef(function MenuBarCheckboxItem2({ checked, children, className, ...props }, ref) {
2803
+ return /* @__PURE__ */ jsxs42(
2804
+ CheckboxItem3,
2805
+ {
2806
+ checked,
2807
+ className: cn(
2808
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2809
+ className
2810
+ ),
2811
+ ref,
2812
+ ...props,
2813
+ children: [
2814
+ /* @__PURE__ */ jsx121("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx121(ItemIndicator6, { children: /* @__PURE__ */ jsx121(CheckIcon5, { className: "h-4 w-4" }) }) }),
2815
+ children
2816
+ ]
2817
+ }
2818
+ );
2819
+ });
2820
+
2821
+ // src/components/MenuBar/MenuBarContent.tsx
2822
+ import React85 from "react";
2823
+ import { Content as Content10, Portal as Portal9 } from "@radix-ui/react-menubar";
2824
+ import { jsx as jsx122 } from "react/jsx-runtime";
2825
+ var MenuBarContent = React85.forwardRef(function MenuBarContent2({ align = "start", alignOffset = -4, className, sideOffset = 8, ...props }, ref) {
2826
+ return /* @__PURE__ */ jsx122(Portal9, { children: /* @__PURE__ */ jsx122(
2827
+ Content10,
2828
+ {
2829
+ align,
2830
+ alignOffset,
2831
+ className: cn(
2832
+ "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2833
+ className
2834
+ ),
2835
+ ref,
2836
+ sideOffset,
2837
+ ...props
2838
+ }
2839
+ ) });
2840
+ });
2841
+
2842
+ // src/components/MenuBar/MenuBarItem.tsx
2843
+ import React86 from "react";
2844
+ import { Item as Item6 } from "@radix-ui/react-menubar";
2845
+ import { jsx as jsx123 } from "react/jsx-runtime";
2846
+ var MenuBarItem = React86.forwardRef(function MenuBarItem2({ className, inset, ...props }, ref) {
2847
+ return /* @__PURE__ */ jsx123(
2848
+ Item6,
2849
+ {
2850
+ className: cn(
2851
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2852
+ inset && "pl-8",
2853
+ className
2854
+ ),
2855
+ ref,
2856
+ ...props
2857
+ }
2858
+ );
2859
+ });
2860
+
2861
+ // src/components/MenuBar/MenuBarLabel.tsx
2862
+ import React87 from "react";
2863
+ import { Label as Label7 } from "@radix-ui/react-menubar";
2864
+ import { jsx as jsx124 } from "react/jsx-runtime";
2865
+ var MenuBarLabel = React87.forwardRef(function MenuBarLabel2({ className, inset, ...props }, ref) {
2866
+ return /* @__PURE__ */ jsx124(Label7, { className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ref, ...props });
2867
+ });
2868
+
2869
+ // src/components/MenuBar/MenuBarRadioItem.tsx
2870
+ import React88 from "react";
2871
+ import { ItemIndicator as ItemIndicator7, RadioItem as RadioItem3 } from "@radix-ui/react-menubar";
2872
+ import { CircleIcon as CircleIcon4 } from "lucide-react";
2873
+ import { jsx as jsx125, jsxs as jsxs43 } from "react/jsx-runtime";
2874
+ var MenuBarRadioItem = React88.forwardRef(function MenuBarRadioItem2({ children, className, ...props }, ref) {
2875
+ return /* @__PURE__ */ jsxs43(
2876
+ RadioItem3,
2877
+ {
2878
+ className: cn(
2879
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2880
+ className
2881
+ ),
2882
+ ref,
2883
+ ...props,
2884
+ children: [
2885
+ /* @__PURE__ */ jsx125("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx125(ItemIndicator7, { children: /* @__PURE__ */ jsx125(CircleIcon4, { className: "fill-current", style: { height: 8, width: 8 } }) }) }),
2886
+ children
2887
+ ]
2888
+ }
2889
+ );
2890
+ });
2891
+
2892
+ // src/components/MenuBar/MenuBarRoot.tsx
2893
+ import React89 from "react";
2894
+ import { Root as Root15 } from "@radix-ui/react-menubar";
2895
+ import { jsx as jsx126 } from "react/jsx-runtime";
2896
+ var MenuBarRoot = React89.forwardRef(
2897
+ function MenuBarRoot2({ className, ...props }, ref) {
2898
+ return /* @__PURE__ */ jsx126(
2899
+ Root15,
2900
+ {
2901
+ className: cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm", className),
2902
+ ref,
2903
+ ...props
2904
+ }
2905
+ );
2906
+ }
2907
+ );
2908
+
2909
+ // src/components/MenuBar/MenuBarSeparator.tsx
2910
+ import React90 from "react";
2911
+ import { Separator as Separator4 } from "@radix-ui/react-menubar";
2912
+ import { jsx as jsx127 } from "react/jsx-runtime";
2913
+ var MenuBarSeparator = React90.forwardRef(function MenuBarSeparator2({ className, ...props }, ref) {
2914
+ return /* @__PURE__ */ jsx127(Separator4, { className: cn("-mx-1 my-1 h-px bg-muted", className), ref, ...props });
2915
+ });
2916
+
2917
+ // src/components/MenuBar/MenuBarShortcut.tsx
2918
+ import "react";
2919
+ import { jsx as jsx128 } from "react/jsx-runtime";
2920
+ var MenuBarShortcut = ({ className, ...props }) => {
2921
+ return /* @__PURE__ */ jsx128("span", { className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props });
2922
+ };
2923
+
2924
+ // src/components/MenuBar/MenuBarSubContent.tsx
2925
+ import React92 from "react";
2926
+ import { SubContent as SubContent3 } from "@radix-ui/react-menubar";
2927
+ import { jsx as jsx129 } from "react/jsx-runtime";
2928
+ var MenuBarSubContent = React92.forwardRef(function MenuBarSubContent2({ className, ...props }, ref) {
2929
+ return /* @__PURE__ */ jsx129(
2930
+ SubContent3,
2931
+ {
2932
+ className: cn(
2933
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2934
+ className
2935
+ ),
2936
+ ref,
2937
+ ...props
2938
+ }
2939
+ );
2940
+ });
2941
+
2942
+ // src/components/MenuBar/MenuBarSubTrigger.tsx
2943
+ import React93 from "react";
2944
+ import { SubTrigger as SubTrigger3 } from "@radix-ui/react-menubar";
2945
+ import { ChevronRightIcon as ChevronRightIcon4 } from "lucide-react";
2946
+ import { jsx as jsx130, jsxs as jsxs44 } from "react/jsx-runtime";
2947
+ var MenuBarSubTrigger = React93.forwardRef(function MenuBarSubTrigger2({ children, className, inset, ...props }, ref) {
2948
+ return /* @__PURE__ */ jsxs44(
2949
+ SubTrigger3,
2950
+ {
2951
+ className: cn(
2952
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
2953
+ inset && "pl-8",
2954
+ className
2955
+ ),
2956
+ ref,
2957
+ ...props,
2958
+ children: [
2959
+ children,
2960
+ /* @__PURE__ */ jsx130(ChevronRightIcon4, { className: "ml-auto h-4 w-4" })
2961
+ ]
2962
+ }
2963
+ );
2964
+ });
2965
+
2966
+ // src/components/MenuBar/MenuBarTrigger.tsx
2967
+ import React94 from "react";
2968
+ import { Trigger as Trigger9 } from "@radix-ui/react-menubar";
2969
+ import { jsx as jsx131 } from "react/jsx-runtime";
2970
+ var MenuBarTrigger = React94.forwardRef(function MenuBarTrigger2({ className, ...props }, ref) {
2971
+ return /* @__PURE__ */ jsx131(
2972
+ Trigger9,
2973
+ {
2974
+ className: cn(
2975
+ "flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
2976
+ className
2977
+ ),
2978
+ ref,
2979
+ ...props
2980
+ }
2981
+ );
2982
+ });
2983
+
2984
+ // src/components/MenuBar/MenuBar.tsx
2985
+ var MenuBar = Object.assign(MenuBarRoot, {
2986
+ CheckboxItem: MenuBarCheckboxItem,
2987
+ Content: MenuBarContent,
2988
+ Group: Group4,
2989
+ Item: MenuBarItem,
2990
+ Label: MenuBarLabel,
2991
+ Menu,
2992
+ Portal: Portal10,
2993
+ RadioGroup: RadioGroup5,
2994
+ RadioItem: MenuBarRadioItem,
2995
+ Separator: MenuBarSeparator,
2996
+ Shortcut: MenuBarShortcut,
2997
+ Sub: Sub3,
2998
+ SubContent: MenuBarSubContent,
2999
+ SubTrigger: MenuBarSubTrigger,
3000
+ Trigger: MenuBarTrigger
3001
+ });
3002
+
3003
+ // src/components/NotificationHub/NotificationHub.tsx
3004
+ import { AnimatePresence as AnimatePresence3, motion as motion3 } from "framer-motion";
3005
+ import { XIcon as XIcon2 } from "lucide-react";
3006
+ import { useTranslation as useTranslation8 } from "react-i18next";
3007
+
3008
+ // src/components/NotificationHub/NotificationIcon.tsx
3009
+ import { CheckCircleIcon, ExclamationCircleIcon, InformationCircleIcon, XCircleIcon } from "@heroicons/react/24/solid";
3010
+ import { jsx as jsx132 } from "react/jsx-runtime";
3011
+ var NotificationIcon = ({ type }) => {
3012
+ switch (type) {
3013
+ case "info":
3014
+ return /* @__PURE__ */ jsx132(InformationCircleIcon, { "aria-hidden": "true", className: "h-6 w-6 text-blue-500" });
3015
+ case "success":
3016
+ return /* @__PURE__ */ jsx132(CheckCircleIcon, { "aria-hidden": "true", className: "h-6 w-6 text-green-500" });
3017
+ case "warning":
3018
+ return /* @__PURE__ */ jsx132(ExclamationCircleIcon, { "aria-hidden": "true", className: "h-6 w-6 text-yellow-500" });
3019
+ case "error":
3020
+ return /* @__PURE__ */ jsx132(XCircleIcon, { "aria-hidden": "true", className: "h-6 w-6 text-red-500" });
3021
+ }
3022
+ };
3023
+
3024
+ // src/components/NotificationHub/NotificationHub.tsx
3025
+ import { jsx as jsx133, jsxs as jsxs45 } from "react/jsx-runtime";
3026
+ var NotificationHub = ({ timeout = 5e3 }) => {
3027
+ const { t } = useTranslation8();
3028
+ const { dismissNotification, notifications } = useNotificationsStore();
3029
+ return /* @__PURE__ */ jsx133("div", { className: "fixed bottom-0 z-50 w-full print:hidden", children: /* @__PURE__ */ jsx133(AnimatePresence3, { children: notifications.map((item) => /* @__PURE__ */ jsx133(
3030
+ motion3.div,
3031
+ {
3032
+ animate: { height: "auto", opacity: 1 },
3033
+ className: "relative max-w-sm",
3034
+ exit: { height: 0, opacity: 0 },
3035
+ initial: { height: 0, opacity: 0 },
3036
+ transition: { bounce: 0.1, type: "spring" },
3037
+ children: /* @__PURE__ */ jsx133("div", { className: "w-full p-2", children: /* @__PURE__ */ jsxs45(Card, { className: "w-full rounded-lg p-0", children: [
3038
+ /* @__PURE__ */ jsxs45("div", { className: "p-4", children: [
3039
+ /* @__PURE__ */ jsxs45("div", { className: "mb-2 flex items-center", children: [
3040
+ /* @__PURE__ */ jsx133(NotificationIcon, { type: item.type }),
3041
+ /* @__PURE__ */ jsx133("h5", { className: "ml-3 flex-grow font-medium text-slate-900 dark:text-slate-100", children: item.title ?? t(`notifications.types.${item.type}`) }),
3042
+ /* @__PURE__ */ jsx133(
3043
+ "button",
3044
+ {
3045
+ className: "inline-flex rounded-md text-slate-400 hover:text-slate-500 focus:outline-none focus:ring-1 focus:ring-sky-500 dark:focus:ring-sky-600",
3046
+ type: "button",
3047
+ onClick: () => {
3048
+ dismissNotification(item.id);
3049
+ },
3050
+ children: /* @__PURE__ */ jsx133(XIcon2, { "aria-hidden": "true", className: "h-5 w-5" })
3051
+ }
3052
+ )
3053
+ ] }),
3054
+ /* @__PURE__ */ jsx133("p", { className: "my-2 text-muted-foreground", children: item.message })
3055
+ ] }),
3056
+ /* @__PURE__ */ jsx133(
3057
+ motion3.div,
3058
+ {
3059
+ animate: { width: "100%" },
3060
+ className: "h-1 bg-slate-500",
3061
+ initial: { width: "0%" },
3062
+ transition: { duration: timeout / 1e3, ease: "linear" },
3063
+ onAnimationComplete: () => {
3064
+ dismissNotification(item.id);
3065
+ }
3066
+ }
3067
+ )
3068
+ ] }) })
3069
+ },
3070
+ item.id
3071
+ )) }) });
3072
+ };
3073
+
3074
+ // src/components/Pagination/PaginationContent.tsx
3075
+ import "react";
3076
+ import { jsx as jsx134 } from "react/jsx-runtime";
3077
+ var PaginationContent = ({ className, ...props }) => /* @__PURE__ */ jsx134("ul", { className: cn("flex flex-row items-center gap-1", className), ...props });
3078
+
3079
+ // src/components/Pagination/PaginationEllipsis.tsx
3080
+ import "react";
3081
+ import { MoreHorizontalIcon as MoreHorizontalIcon2 } from "lucide-react";
3082
+ import { jsx as jsx135, jsxs as jsxs46 } from "react/jsx-runtime";
3083
+ var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs46("span", { "aria-hidden": true, className: cn("flex h-9 w-9 items-center justify-center", className), ...props, children: [
3084
+ /* @__PURE__ */ jsx135(MoreHorizontalIcon2, { className: "h-4 w-4" }),
3085
+ /* @__PURE__ */ jsx135("span", { className: "sr-only", children: "More pages" })
3086
+ ] });
3087
+
3088
+ // src/components/Pagination/PaginationItem.tsx
3089
+ import { jsx as jsx136 } from "react/jsx-runtime";
3090
+ var PaginationItem = ({ className, ...props }) => /* @__PURE__ */ jsx136("li", { className, ...props });
3091
+
3092
+ // src/components/Pagination/PaginationLink.tsx
3093
+ import "react";
3094
+ import { jsx as jsx137 } from "react/jsx-runtime";
3095
+ var PaginationLink = ({ children, className, isActive, size = "icon", ...props }) => /* @__PURE__ */ jsx137(
3096
+ "a",
3097
+ {
3098
+ "aria-current": isActive ? "page" : void 0,
3099
+ className: cn(
3100
+ buttonVariants({
3101
+ size,
3102
+ variant: isActive ? "outline" : "ghost"
3103
+ }),
3104
+ className
3105
+ ),
3106
+ ...props,
3107
+ children
3108
+ }
3109
+ );
3110
+
3111
+ // src/components/Pagination/PaginationNext.tsx
3112
+ import "react";
3113
+ import { ChevronRightIcon as ChevronRightIcon5 } from "lucide-react";
3114
+ import { useTranslation as useTranslation9 } from "react-i18next";
3115
+ import { jsx as jsx138, jsxs as jsxs47 } from "react/jsx-runtime";
3116
+ var PaginationNext = ({ className, ...props }) => {
3117
+ const { t } = useTranslation9("libui");
3118
+ return /* @__PURE__ */ jsxs47(PaginationLink, { "aria-label": "Go to next page", className: cn("gap-1 pr-2.5", className), size: "md", ...props, children: [
3119
+ /* @__PURE__ */ jsx138("span", { children: t("pagination.next") }),
3120
+ /* @__PURE__ */ jsx138(ChevronRightIcon5, { className: "h-4 w-4" })
3121
+ ] });
3122
+ };
3123
+
3124
+ // src/components/Pagination/PaginationPrevious.tsx
3125
+ import { ChevronLeftIcon } from "lucide-react";
3126
+ import { useTranslation as useTranslation10 } from "react-i18next";
3127
+ import { jsx as jsx139, jsxs as jsxs48 } from "react/jsx-runtime";
3128
+ var PaginationPrevious = ({ className, ...props }) => {
3129
+ const { t } = useTranslation10("libui");
3130
+ return /* @__PURE__ */ jsxs48(PaginationLink, { "aria-label": "Go to previous page", className: cn("gap-1 pl-2.5", className), size: "md", ...props, children: [
3131
+ /* @__PURE__ */ jsx139(ChevronLeftIcon, { className: "h-4 w-4" }),
3132
+ /* @__PURE__ */ jsx139("span", { children: t("pagination.previous") })
3133
+ ] });
3134
+ };
3135
+
3136
+ // src/components/Pagination/PaginationRoot.tsx
3137
+ import "react";
3138
+ import { jsx as jsx140 } from "react/jsx-runtime";
3139
+ var PaginationRoot = ({ className, ...props }) => /* @__PURE__ */ jsx140(
3140
+ "nav",
3141
+ {
3142
+ "aria-label": "pagination",
3143
+ className: cn("mx-auto flex w-full justify-center", className),
3144
+ role: "navigation",
3145
+ ...props
3146
+ }
3147
+ );
3148
+
3149
+ // src/components/Pagination/Pagination.tsx
3150
+ var Pagination = Object.assign(PaginationRoot, {
3151
+ Content: PaginationContent,
3152
+ Ellipsis: PaginationEllipsis,
3153
+ Item: PaginationItem,
3154
+ Link: PaginationLink,
3155
+ Next: PaginationNext,
3156
+ Previous: PaginationPrevious
3157
+ });
3158
+
3159
+ // src/components/Progress/Progress.tsx
3160
+ import React100 from "react";
3161
+ import * as ProgressPrimitive from "@radix-ui/react-progress";
3162
+ import { jsx as jsx141 } from "react/jsx-runtime";
3163
+ var Progress = React100.forwardRef(function Progress2({ className, value, ...props }, ref) {
3164
+ return /* @__PURE__ */ jsx141(
3165
+ ProgressPrimitive.Root,
3166
+ {
3167
+ className: cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className),
3168
+ ref,
3169
+ ...props,
3170
+ children: /* @__PURE__ */ jsx141(
3171
+ ProgressPrimitive.Indicator,
3172
+ {
3173
+ className: "h-full w-full flex-1 bg-primary transition-all",
3174
+ style: { transform: `translateX(-${100 - (value ?? 0)}%)` }
3175
+ }
3176
+ )
3177
+ }
3178
+ );
3179
+ });
3180
+
3181
+ // src/components/Resizable/Resizable.tsx
3182
+ import "react";
3183
+ import { Panel } from "react-resizable-panels";
3184
+
3185
+ // src/components/Resizable/ResizableHandle.tsx
3186
+ import { GripVertical } from "lucide-react";
3187
+ import { PanelResizeHandle } from "react-resizable-panels";
3188
+ import { jsx as jsx142 } from "react/jsx-runtime";
3189
+ var ResizableHandle = ({ className, withHandle, ...props }) => /* @__PURE__ */ jsx142(
3190
+ PanelResizeHandle,
3191
+ {
3192
+ className: cn(
3193
+ "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
3194
+ className
3195
+ ),
3196
+ ...props,
3197
+ children: withHandle && /* @__PURE__ */ jsx142("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ jsx142(GripVertical, { className: "h-2.5 w-2.5" }) })
3198
+ }
3199
+ );
3200
+
3201
+ // src/components/Resizable/ResizablePanelGroup.tsx
3202
+ import { PanelGroup } from "react-resizable-panels";
3203
+ import { jsx as jsx143 } from "react/jsx-runtime";
3204
+ var ResizablePanelGroup = ({ className, ...props }) => /* @__PURE__ */ jsx143(
3205
+ PanelGroup,
3206
+ {
3207
+ className: cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className),
3208
+ ...props
3209
+ }
3210
+ );
3211
+
3212
+ // src/components/Resizable/Resizable.tsx
3213
+ import { Fragment, jsx as jsx144 } from "react/jsx-runtime";
3214
+ var ResizableRoot = ({ children }) => /* @__PURE__ */ jsx144(Fragment, { children });
3215
+ var Resizable = Object.assign(ResizableRoot, {
3216
+ Handle: ResizableHandle,
3217
+ Panel,
3218
+ PanelGroup: ResizablePanelGroup
3219
+ });
3220
+
3221
+ // src/components/SearchBar/SearchBar.tsx
3222
+ import { SearchIcon as SearchIcon2 } from "lucide-react";
3223
+ import { useTranslation as useTranslation11 } from "react-i18next";
3224
+ import { jsx as jsx145, jsxs as jsxs49 } from "react/jsx-runtime";
3225
+ var SearchBar = ({ className, onValueChange, placeholder, value }) => {
3226
+ const { t } = useTranslation11();
3227
+ return /* @__PURE__ */ jsxs49("form", { className: cn("relative", className), children: [
3228
+ /* @__PURE__ */ jsx145(SearchIcon2, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
3229
+ /* @__PURE__ */ jsx145(
3230
+ Input,
3231
+ {
3232
+ className: "pl-8",
3233
+ placeholder: placeholder ?? t("searchBar.placeholder"),
3234
+ type: "search",
3235
+ value,
3236
+ onChange: (event) => {
3237
+ onValueChange?.(event.target.value);
3238
+ }
3239
+ }
3240
+ )
3241
+ ] });
3242
+ };
3243
+
3244
+ // src/components/Separator/Separator.tsx
3245
+ import React102 from "react";
3246
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
3247
+ import { jsx as jsx146 } from "react/jsx-runtime";
3248
+ var Separator5 = React102.forwardRef(function Separator6({ className, decorative = true, orientation = "horizontal", ...props }, ref) {
3249
+ return /* @__PURE__ */ jsx146(
3250
+ SeparatorPrimitive.Root,
3251
+ {
3252
+ className: cn(
3253
+ "shrink-0 bg-border",
3254
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
3255
+ className
3256
+ ),
3257
+ "data-testid": "separator",
3258
+ decorative,
3259
+ orientation,
3260
+ ref,
3261
+ ...props
3262
+ }
3263
+ );
3264
+ });
3265
+
3266
+ // src/components/Sheet/Sheet.tsx
3267
+ import { Close as Close3, Portal as Portal12, Root as Root18, Trigger as Trigger10 } from "@radix-ui/react-dialog";
3268
+
3269
+ // src/components/Sheet/SheetContent.tsx
3270
+ import React103 from "react";
3271
+ import { Close as Close2, Content as Content11, Overlay as Overlay3, Portal as Portal11 } from "@radix-ui/react-dialog";
3272
+ import { cva as cva5 } from "class-variance-authority";
3273
+ import { XIcon as XIcon3 } from "lucide-react";
3274
+ import { jsx as jsx147, jsxs as jsxs50 } from "react/jsx-runtime";
3275
+ var sheetVariants = cva5(
3276
+ "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
3277
+ {
3278
+ defaultVariants: {
3279
+ side: "right"
3280
+ },
3281
+ variants: {
3282
+ side: {
3283
+ bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
3284
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
3285
+ right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
3286
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top"
3287
+ }
3288
+ }
3289
+ }
3290
+ );
3291
+ var SheetContent = React103.forwardRef(function SheetContent2({ children, className, side = "right", ...props }, ref) {
3292
+ return /* @__PURE__ */ jsxs50(Portal11, { children: [
3293
+ /* @__PURE__ */ jsx147(Overlay3, {}),
3294
+ /* @__PURE__ */ jsxs50(Content11, { className: cn(sheetVariants({ side }), className), ref, ...props, children: [
3295
+ children,
3296
+ /* @__PURE__ */ jsxs50(Close2, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
3297
+ /* @__PURE__ */ jsx147(XIcon3, { className: "h-4 w-4" }),
3298
+ /* @__PURE__ */ jsx147("span", { className: "sr-only", children: "Close" })
3299
+ ] })
3300
+ ] })
3301
+ ] });
3302
+ });
3303
+
3304
+ // src/components/Sheet/SheetDescription.tsx
3305
+ import React104 from "react";
3306
+ import { Description as Description3 } from "@radix-ui/react-dialog";
3307
+ import { jsx as jsx148 } from "react/jsx-runtime";
3308
+ var SheetDescription = React104.forwardRef(function SheetDescription2({ className, ...props }, ref) {
3309
+ return /* @__PURE__ */ jsx148(Description3, { className: cn("text-sm text-muted-foreground", className), ref, ...props });
3310
+ });
3311
+
3312
+ // src/components/Sheet/SheetFooter.tsx
3313
+ import "react";
3314
+ import { jsx as jsx149 } from "react/jsx-runtime";
3315
+ var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsx149("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
3316
+
3317
+ // src/components/Sheet/SheetHeader.tsx
3318
+ import "react";
3319
+ import { jsx as jsx150 } from "react/jsx-runtime";
3320
+ var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsx150("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props });
3321
+
3322
+ // src/components/Sheet/SheetOverlay.tsx
3323
+ import React107 from "react";
3324
+ import { Overlay as Overlay4 } from "@radix-ui/react-dialog";
3325
+ import { jsx as jsx151 } from "react/jsx-runtime";
3326
+ var SheetOverlay = React107.forwardRef(function SheetOverlay2({ className, ...props }, ref) {
3327
+ return /* @__PURE__ */ jsx151(
3328
+ Overlay4,
3329
+ {
3330
+ className: cn(
3331
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
3332
+ className
3333
+ ),
3334
+ ...props,
3335
+ ref
3336
+ }
3337
+ );
3338
+ });
3339
+
3340
+ // src/components/Sheet/SheetTitle.tsx
3341
+ import React108 from "react";
3342
+ import { Title as Title3 } from "@radix-ui/react-dialog";
3343
+ import { jsx as jsx152 } from "react/jsx-runtime";
3344
+ var SheetTitle = React108.forwardRef(function SheetTitle2({ className, ...props }, ref) {
3345
+ return /* @__PURE__ */ jsx152(Title3, { className: cn("text-lg font-semibold text-foreground", className), ref, ...props });
3346
+ });
3347
+
3348
+ // src/components/Sheet/Sheet.tsx
3349
+ var Sheet = Object.assign(Root18, {
3350
+ Close: Close3,
3351
+ Content: SheetContent,
3352
+ Description: SheetDescription,
3353
+ Footer: SheetFooter,
3354
+ Header: SheetHeader,
3355
+ Overlay: SheetOverlay,
3356
+ Portal: Portal12,
3357
+ Title: SheetTitle,
3358
+ Trigger: Trigger10
3359
+ });
3360
+
3361
+ // src/components/Spinner/Spinner.tsx
3362
+ import { jsx as jsx153 } from "react/jsx-runtime";
3363
+ var Spinner = ({ className, ...props }) => {
3364
+ return /* @__PURE__ */ jsx153("div", { className: cn("flex h-full w-full items-center justify-center", className), ...props, children: /* @__PURE__ */ jsx153(
3365
+ "span",
3366
+ {
3367
+ className: "relative animate-spinner overflow-hidden text-slate-900 dark:text-slate-100",
3368
+ style: {
3369
+ borderRadius: "50%",
3370
+ fontSize: "45px",
3371
+ height: "1em",
3372
+ textIndent: "-9999em",
3373
+ transform: "translateZ(0)",
3374
+ width: "1em"
3375
+ }
3376
+ }
3377
+ ) });
3378
+ };
3379
+
3380
+ // src/components/SpinnerIcon/SpinnerIcon.tsx
3381
+ import { jsx as jsx154 } from "react/jsx-runtime";
3382
+ var SpinnerIcon = ({ className, ...props }) => /* @__PURE__ */ jsx154(
3383
+ "svg",
3384
+ {
3385
+ className: cn("animate-spin", className),
3386
+ fill: "none",
3387
+ height: "24",
3388
+ stroke: "currentColor",
3389
+ strokeLinecap: "round",
3390
+ strokeLinejoin: "round",
3391
+ strokeWidth: "2",
3392
+ viewBox: "0 0 24 24",
3393
+ width: "24",
3394
+ xmlns: "http://www.w3.org/2000/svg",
3395
+ ...props,
3396
+ children: /* @__PURE__ */ jsx154("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
3397
+ }
3398
+ );
3399
+
3400
+ // src/components/Switch/Switch.tsx
3401
+ import React109 from "react";
3402
+ import * as SwitchPrimitives from "@radix-ui/react-switch";
3403
+ import { jsx as jsx155 } from "react/jsx-runtime";
3404
+ var Switch = React109.forwardRef(function Switch2({ className, ...props }, ref) {
3405
+ return /* @__PURE__ */ jsx155(
3406
+ SwitchPrimitives.Root,
3407
+ {
3408
+ className: cn(
3409
+ "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
3410
+ className
3411
+ ),
3412
+ ...props,
3413
+ ref,
3414
+ children: /* @__PURE__ */ jsx155(
3415
+ SwitchPrimitives.Thumb,
3416
+ {
3417
+ className: cn(
3418
+ "pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
3419
+ )
3420
+ }
3421
+ )
3422
+ }
3423
+ );
3424
+ });
3425
+
3426
+ // src/components/Table/TableBody.tsx
3427
+ import React110 from "react";
3428
+ import { jsx as jsx156 } from "react/jsx-runtime";
3429
+ var TableBody = React110.forwardRef(
3430
+ function TableBody2({ className, ...props }, ref) {
3431
+ return /* @__PURE__ */ jsx156("tbody", { className: cn("[&_tr:last-child]:border-0", className), ref, ...props });
3432
+ }
3433
+ );
3434
+
3435
+ // src/components/Table/TableCaption.tsx
3436
+ import React111 from "react";
3437
+ import { jsx as jsx157 } from "react/jsx-runtime";
3438
+ var TableCaption = React111.forwardRef(
3439
+ function TableCaption2({ className, ...props }, ref) {
3440
+ return /* @__PURE__ */ jsx157("caption", { className: cn("mt-4 text-sm text-muted-foreground", className), ref, ...props });
3441
+ }
3442
+ );
3443
+
3444
+ // src/components/Table/TableCell.tsx
3445
+ import React112 from "react";
3446
+ import { jsx as jsx158 } from "react/jsx-runtime";
3447
+ var TableCell = React112.forwardRef(
3448
+ function TableCell2({ className, ...props }, ref) {
3449
+ return /* @__PURE__ */ jsx158("td", { className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ref, ...props });
3450
+ }
3451
+ );
3452
+
3453
+ // src/components/Table/TableFooter.tsx
3454
+ import React113 from "react";
3455
+ import { jsx as jsx159 } from "react/jsx-runtime";
3456
+ var TableFooter = React113.forwardRef(
3457
+ function TableFooter2({ className, ...props }, ref) {
3458
+ return /* @__PURE__ */ jsx159(
3459
+ "tfoot",
3460
+ {
3461
+ className: cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className),
3462
+ ref,
3463
+ ...props
3464
+ }
3465
+ );
3466
+ }
3467
+ );
3468
+
3469
+ // src/components/Table/TableHead.tsx
3470
+ import React114 from "react";
3471
+ import { jsx as jsx160 } from "react/jsx-runtime";
3472
+ var TableHead = React114.forwardRef(
3473
+ function TableHead2({ className, ...props }, ref) {
3474
+ return /* @__PURE__ */ jsx160(
3475
+ "th",
3476
+ {
3477
+ className: cn(
3478
+ "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
3479
+ className
3480
+ ),
3481
+ ref,
3482
+ ...props
3483
+ }
3484
+ );
3485
+ }
3486
+ );
3487
+
3488
+ // src/components/Table/TableHeader.tsx
3489
+ import React115 from "react";
3490
+ import { jsx as jsx161 } from "react/jsx-runtime";
3491
+ var TableHeader = React115.forwardRef(
3492
+ function TableHeader2({ className, ...props }, ref) {
3493
+ return /* @__PURE__ */ jsx161("thead", { className: cn("[&_tr]:border-b", className), ref, ...props });
3494
+ }
3495
+ );
3496
+
3497
+ // src/components/Table/TableRoot.tsx
3498
+ import React116 from "react";
3499
+ import { jsx as jsx162 } from "react/jsx-runtime";
3500
+ var TableRoot = React116.forwardRef(function TableRoot2({ className, ...props }, ref) {
3501
+ return /* @__PURE__ */ jsx162("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx162("table", { className: cn("w-full caption-bottom text-sm", className), ref, ...props }) });
3502
+ });
3503
+
3504
+ // src/components/Table/TableRow.tsx
3505
+ import React117 from "react";
3506
+ import { jsx as jsx163 } from "react/jsx-runtime";
3507
+ var TableRow = React117.forwardRef(
3508
+ function TableRow2({ className, ...props }, ref) {
3509
+ return /* @__PURE__ */ jsx163(
3510
+ "tr",
3511
+ {
3512
+ className: cn("hover:bg-muted/50 border-b transition-colors data-[state=selected]:bg-muted", className),
3513
+ ref,
3514
+ ...props
3515
+ }
3516
+ );
3517
+ }
3518
+ );
3519
+
3520
+ // src/components/Table/Table.tsx
3521
+ var Table = Object.assign(TableRoot, {
3522
+ Body: TableBody,
3523
+ Caption: TableCaption,
3524
+ Cell: TableCell,
3525
+ Footer: TableFooter,
3526
+ Head: TableHead,
3527
+ Header: TableHeader,
3528
+ Row: TableRow
3529
+ });
3530
+
3531
+ // src/components/Tabs/Tabs.tsx
3532
+ import * as TabsPrimitive4 from "@radix-ui/react-tabs";
3533
+
3534
+ // src/components/Tabs/TabsContent.tsx
3535
+ import React118 from "react";
3536
+ import * as TabsPrimitive from "@radix-ui/react-tabs";
3537
+ import { jsx as jsx164 } from "react/jsx-runtime";
3538
+ var TabsContent = React118.forwardRef(function TabsContent2({ className, ...props }, ref) {
3539
+ return /* @__PURE__ */ jsx164(
3540
+ TabsPrimitive.Content,
3541
+ {
3542
+ className: cn(
3543
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
3544
+ className
3545
+ ),
3546
+ ref,
3547
+ ...props
3548
+ }
3549
+ );
3550
+ });
3551
+
3552
+ // src/components/Tabs/TabsList.tsx
3553
+ import React119 from "react";
3554
+ import * as TabsPrimitive2 from "@radix-ui/react-tabs";
3555
+ import { jsx as jsx165 } from "react/jsx-runtime";
3556
+ var TabsList = React119.forwardRef(function TabsList2({ className, ...props }, ref) {
3557
+ return /* @__PURE__ */ jsx165(
3558
+ TabsPrimitive2.List,
3559
+ {
3560
+ className: cn(
3561
+ "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
3562
+ className
3563
+ ),
3564
+ ref,
3565
+ ...props
3566
+ }
3567
+ );
3568
+ });
3569
+
3570
+ // src/components/Tabs/TabsTrigger.tsx
3571
+ import React120 from "react";
3572
+ import * as TabsPrimitive3 from "@radix-ui/react-tabs";
3573
+ import { jsx as jsx166 } from "react/jsx-runtime";
3574
+ var TabsTrigger = React120.forwardRef(function TabsTrigger2({ className, ...props }, ref) {
3575
+ return /* @__PURE__ */ jsx166(
3576
+ TabsPrimitive3.Trigger,
3577
+ {
3578
+ className: cn(
3579
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
3580
+ className
3581
+ ),
3582
+ ref,
3583
+ ...props
3584
+ }
3585
+ );
3586
+ });
3587
+
3588
+ // src/components/Tabs/Tabs.tsx
3589
+ var Tabs = Object.assign(TabsPrimitive4.Root, {
3590
+ Content: TabsContent,
3591
+ List: TabsList,
3592
+ Trigger: TabsTrigger
3593
+ });
3594
+
3595
+ // src/components/ThemeToggle/ThemeToggle.tsx
3596
+ import { MoonIcon, SunIcon } from "lucide-react";
3597
+ import { jsx as jsx167, jsxs as jsxs51 } from "react/jsx-runtime";
3598
+ var ThemeToggle = () => {
3599
+ const [theme, setTheme] = useTheme();
3600
+ const toggleTheme = () => {
3601
+ setTheme(theme === "dark" ? "light" : "dark");
3602
+ };
3603
+ return /* @__PURE__ */ jsxs51(Button, { size: "icon", variant: "outline", onClick: toggleTheme, children: [
3604
+ /* @__PURE__ */ jsx167(SunIcon, { className: "rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
3605
+ /* @__PURE__ */ jsx167(MoonIcon, { className: "absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })
3606
+ ] });
3607
+ };
3608
+
3609
+ // src/components/Tooltip/TooltipContent.tsx
3610
+ import React121 from "react";
3611
+ import { Content as Content13 } from "@radix-ui/react-tooltip";
3612
+ import { jsx as jsx168 } from "react/jsx-runtime";
3613
+ var TooltipContent = React121.forwardRef(
3614
+ function TooltipContent2({ className, collisionPadding = 0, sideOffset = 4, ...props }, ref) {
3615
+ return /* @__PURE__ */ jsx168(
3616
+ Content13,
3617
+ {
3618
+ className: cn(
3619
+ "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
3620
+ className
3621
+ ),
3622
+ collisionPadding,
3623
+ ref,
3624
+ sideOffset,
3625
+ ...props
3626
+ }
3627
+ );
3628
+ }
3629
+ );
3630
+
3631
+ // src/components/Tooltip/TooltipRoot.tsx
3632
+ import "react";
3633
+ import { Provider, Root as Root21 } from "@radix-ui/react-tooltip";
3634
+ import { jsx as jsx169 } from "react/jsx-runtime";
3635
+ var TooltipRoot = ({ children, delayDuration = 0, skipDelayDuration = 300 }) => {
3636
+ return /* @__PURE__ */ jsx169(Provider, { delayDuration, skipDelayDuration, children: /* @__PURE__ */ jsx169(Root21, { children }) });
3637
+ };
3638
+
3639
+ // src/components/Tooltip/TooltipTrigger.tsx
3640
+ import React123 from "react";
3641
+ import { Trigger as Trigger12 } from "@radix-ui/react-tooltip";
3642
+ import { jsx as jsx170 } from "react/jsx-runtime";
3643
+ var TooltipTrigger = React123.forwardRef(
3644
+ function TooltipTrigger2({ variant = "outline", ...props }, ref) {
3645
+ return /* @__PURE__ */ jsx170(Trigger12, { asChild: true, ref, children: /* @__PURE__ */ jsx170(Button, { variant, ...props }) });
3646
+ }
3647
+ );
3648
+
3649
+ // src/components/Tooltip/Tooltip.tsx
3650
+ var Tooltip2 = Object.assign(TooltipRoot, {
3651
+ Content: TooltipContent,
3652
+ Trigger: TooltipTrigger
180
3653
  });
181
3654
  export {
182
3655
  Accordion,
3656
+ AlertDialog,
183
3657
  ArrowToggle,
3658
+ Avatar,
184
3659
  BUTTON_ICON_SIZE,
3660
+ Badge,
3661
+ Breadcrumb,
185
3662
  Button,
3663
+ Card,
3664
+ Checkbox,
3665
+ Collapsible,
3666
+ Command2 as Command,
3667
+ ContextMenu,
3668
+ DatePicker,
3669
+ Dialog,
3670
+ Drawer,
3671
+ DropdownButton,
3672
+ DropdownMenu,
3673
+ ErrorBoundary,
3674
+ ErrorFallback,
3675
+ Form,
3676
+ Heading,
3677
+ HoverCard,
186
3678
  Input,
187
- Label,
188
- buttonVariants
3679
+ Label3 as Label,
3680
+ LanguageToggle,
3681
+ LegacyStepper,
3682
+ LineGraph,
3683
+ MenuBar,
3684
+ NotificationHub,
3685
+ Pagination,
3686
+ Popover,
3687
+ Progress,
3688
+ RadioGroup4 as RadioGroup,
3689
+ Resizable,
3690
+ ScrollArea,
3691
+ SearchBar,
3692
+ Select,
3693
+ Separator5 as Separator,
3694
+ Sheet,
3695
+ Slider,
3696
+ Spinner,
3697
+ SpinnerIcon,
3698
+ Switch,
3699
+ Table,
3700
+ Tabs,
3701
+ TextArea,
3702
+ ThemeToggle,
3703
+ Tooltip2 as Tooltip,
3704
+ badgeVariants,
3705
+ buttonVariants,
3706
+ labelVariants
189
3707
  };
190
3708
  //# sourceMappingURL=index.js.map