@thebasenet/ui 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +0 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +221 -101
- package/dist/index.js.map +1 -1
- package/dist/ui/index.d.ts +11 -1
- package/dist/ui/index.js +218 -99
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
package/dist/ui/index.d.ts
CHANGED
|
@@ -79,6 +79,16 @@ declare function Calendar({ className, classNames, showOutsideDays, captionLayou
|
|
|
79
79
|
}): react_jsx_runtime.JSX.Element;
|
|
80
80
|
declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): react_jsx_runtime.JSX.Element;
|
|
81
81
|
|
|
82
|
+
interface DateTimePickerProps {
|
|
83
|
+
value?: string;
|
|
84
|
+
onChange?: (value: string) => void;
|
|
85
|
+
className?: string;
|
|
86
|
+
label?: string;
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
disablePastDates?: boolean;
|
|
89
|
+
}
|
|
90
|
+
declare const DateTimePicker: React.NamedExoticComponent<DateTimePickerProps>;
|
|
91
|
+
|
|
82
92
|
declare function Card({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
83
93
|
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
84
94
|
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
@@ -299,4 +309,4 @@ declare const Body1: React__default.ForwardRefExoticComponent<BodyProps & React_
|
|
|
299
309
|
declare const Body2: React__default.ForwardRefExoticComponent<BodyProps & React__default.RefAttributes<HTMLParagraphElement>>;
|
|
300
310
|
declare const Body3: React__default.ForwardRefExoticComponent<BodyProps & React__default.RefAttributes<HTMLParagraphElement>>;
|
|
301
311
|
|
|
302
|
-
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Body1, Body2, Body3, type BodyProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, type HeadingProps, Input, Label, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, PasswordInput2, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, SearchInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonGroupVariants, buttonVariants, toggleVariants, useFormField };
|
|
312
|
+
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Body1, Body2, Body3, type BodyProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DateTimePicker, type DateTimePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, type HeadingProps, Input, Label, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, PasswordInput2, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, SearchInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonGroupVariants, buttonVariants, toggleVariants, useFormField };
|
package/dist/ui/index.js
CHANGED
|
@@ -4,19 +4,19 @@ import { twMerge } from 'tailwind-merge';
|
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import { EyeIcon, EyeOffIcon, ChevronDown, ChevronUp, Check,
|
|
7
|
+
import { EyeIcon, EyeOffIcon, ChevronDown, ChevronUp, Check, ChevronDownIcon, X, ChevronLeftIcon, ChevronRightIcon, ChevronRight, MoreHorizontal, CheckIcon, XIcon, SearchIcon, ChevronsUpDown, CircleIcon, MoreHorizontalIcon, Search } from 'lucide-react';
|
|
8
8
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
9
|
+
import * as React2 from 'react';
|
|
10
|
+
import React2__default, { forwardRef, useState } from 'react';
|
|
11
11
|
import { getDefaultClassNames, DayPicker } from 'react-day-picker';
|
|
12
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
13
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
12
14
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
13
15
|
import { Command as Command$1 } from 'cmdk';
|
|
14
16
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
15
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
16
17
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
17
18
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
18
19
|
import { FormProvider, Controller, useFormContext, useFormState } from 'react-hook-form';
|
|
19
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
20
20
|
import Link from 'next/link';
|
|
21
21
|
import { motion } from 'framer-motion';
|
|
22
22
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
@@ -30,7 +30,6 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
|
30
30
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
31
31
|
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
32
32
|
|
|
33
|
-
// src/ui/alert.tsx
|
|
34
33
|
function cn(...inputs) {
|
|
35
34
|
return twMerge(clsx(inputs));
|
|
36
35
|
}
|
|
@@ -502,8 +501,8 @@ function CalendarDayButton({
|
|
|
502
501
|
...props
|
|
503
502
|
}) {
|
|
504
503
|
const defaultClassNames = getDefaultClassNames();
|
|
505
|
-
const ref =
|
|
506
|
-
|
|
504
|
+
const ref = React2.useRef(null);
|
|
505
|
+
React2.useEffect(() => {
|
|
507
506
|
if (modifiers.focused) ref.current?.focus();
|
|
508
507
|
}, [modifiers.focused]);
|
|
509
508
|
return /* @__PURE__ */ jsx(
|
|
@@ -526,6 +525,187 @@ function CalendarDayButton({
|
|
|
526
525
|
}
|
|
527
526
|
);
|
|
528
527
|
}
|
|
528
|
+
function Input({ className, type, ...props }) {
|
|
529
|
+
return /* @__PURE__ */ jsx(
|
|
530
|
+
"input",
|
|
531
|
+
{
|
|
532
|
+
type,
|
|
533
|
+
"data-slot": "input",
|
|
534
|
+
className: cn(
|
|
535
|
+
"file:text-foreground placeholder:text-neutral-200/70 selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-neutral-100/60 flex h-12 w-full min-w-0 rounded-md border-[1px] bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:hidden disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-base cursor-pointer font-golos",
|
|
536
|
+
"focus-visible:border-primary-600",
|
|
537
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
538
|
+
className
|
|
539
|
+
),
|
|
540
|
+
...props
|
|
541
|
+
}
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
function Label({
|
|
545
|
+
className,
|
|
546
|
+
...props
|
|
547
|
+
}) {
|
|
548
|
+
return /* @__PURE__ */ jsx(
|
|
549
|
+
LabelPrimitive.Root,
|
|
550
|
+
{
|
|
551
|
+
"data-slot": "label",
|
|
552
|
+
className: cn(
|
|
553
|
+
"flex items-center gap-2 text-[14px] leading-none font-normal font-onest text-neutral-400 pl-1 select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
554
|
+
className
|
|
555
|
+
),
|
|
556
|
+
...props
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
function Popover({ ...props }) {
|
|
561
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
562
|
+
}
|
|
563
|
+
function PopoverTrigger({ ...props }) {
|
|
564
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
565
|
+
}
|
|
566
|
+
function PopoverContent({
|
|
567
|
+
className,
|
|
568
|
+
align = "center",
|
|
569
|
+
sideOffset = 4,
|
|
570
|
+
...props
|
|
571
|
+
}) {
|
|
572
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
573
|
+
PopoverPrimitive.Content,
|
|
574
|
+
{
|
|
575
|
+
"data-slot": "popover-content",
|
|
576
|
+
align,
|
|
577
|
+
sideOffset,
|
|
578
|
+
className: cn(
|
|
579
|
+
"bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
580
|
+
className
|
|
581
|
+
),
|
|
582
|
+
...props
|
|
583
|
+
}
|
|
584
|
+
) });
|
|
585
|
+
}
|
|
586
|
+
function PopoverAnchor({ ...props }) {
|
|
587
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
588
|
+
}
|
|
589
|
+
function parseValue(value) {
|
|
590
|
+
if (!value) return { date: void 0, time: "" };
|
|
591
|
+
const [datePart, timePart] = value.split(" ");
|
|
592
|
+
if (!datePart || !timePart)
|
|
593
|
+
return { date: void 0, time: "" };
|
|
594
|
+
const timeNoMs = timePart.split(".")[0];
|
|
595
|
+
const parsedDate = /* @__PURE__ */ new Date(`${datePart}T${timeNoMs}`);
|
|
596
|
+
if (isNaN(parsedDate.getTime()))
|
|
597
|
+
return { date: void 0, time: "" };
|
|
598
|
+
return { date: parsedDate, time: timeNoMs };
|
|
599
|
+
}
|
|
600
|
+
var DateTimePickerInner = ({
|
|
601
|
+
value,
|
|
602
|
+
onChange,
|
|
603
|
+
className,
|
|
604
|
+
label,
|
|
605
|
+
disabled,
|
|
606
|
+
disablePastDates = true
|
|
607
|
+
}) => {
|
|
608
|
+
const [open, setOpen] = React2.useState(false);
|
|
609
|
+
const [date, setDate] = React2.useState(
|
|
610
|
+
() => parseValue(value).date
|
|
611
|
+
);
|
|
612
|
+
const [time, setTime] = React2.useState(() => parseValue(value).time);
|
|
613
|
+
const suppressNotifyRef = React2.useRef(false);
|
|
614
|
+
const lastNotifiedValue = React2.useRef(null);
|
|
615
|
+
const parsed = React2.useMemo(() => parseValue(value), [value]);
|
|
616
|
+
React2.useEffect(() => {
|
|
617
|
+
const incomingDateTimeStr = parsed.date ? parsed.date.getTime() : void 0;
|
|
618
|
+
const currentDateTimeStr = date ? date.getTime() : void 0;
|
|
619
|
+
if (incomingDateTimeStr !== currentDateTimeStr) {
|
|
620
|
+
suppressNotifyRef.current = true;
|
|
621
|
+
setDate(parsed.date);
|
|
622
|
+
}
|
|
623
|
+
if (parsed.time !== time) {
|
|
624
|
+
suppressNotifyRef.current = true;
|
|
625
|
+
setTime(parsed.time);
|
|
626
|
+
}
|
|
627
|
+
}, [parsed.date?.getTime(), parsed.time]);
|
|
628
|
+
const formattedDateLabel = React2.useMemo(
|
|
629
|
+
() => date ? date.toLocaleDateString() : "Select date",
|
|
630
|
+
[date]
|
|
631
|
+
);
|
|
632
|
+
const isDateDisabled = React2.useCallback(
|
|
633
|
+
(d) => {
|
|
634
|
+
if (!disablePastDates) return false;
|
|
635
|
+
const todayStart = /* @__PURE__ */ new Date();
|
|
636
|
+
todayStart.setHours(0, 0, 0, 0);
|
|
637
|
+
return d < todayStart;
|
|
638
|
+
},
|
|
639
|
+
[disablePastDates]
|
|
640
|
+
);
|
|
641
|
+
React2.useEffect(() => {
|
|
642
|
+
if (suppressNotifyRef.current) {
|
|
643
|
+
suppressNotifyRef.current = false;
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
if (!onChange) return;
|
|
647
|
+
if (!date || !time) return;
|
|
648
|
+
const isoString = `${date.toISOString().split("T")[0]} ${time}.000000+00`;
|
|
649
|
+
if (lastNotifiedValue.current === isoString) return;
|
|
650
|
+
lastNotifiedValue.current = isoString;
|
|
651
|
+
onChange(isoString);
|
|
652
|
+
}, [date, time, onChange]);
|
|
653
|
+
const handleDateSelect = React2.useCallback((selectedDate) => {
|
|
654
|
+
setDate(selectedDate);
|
|
655
|
+
setOpen(false);
|
|
656
|
+
}, []);
|
|
657
|
+
const handleTimeChange = React2.useCallback(
|
|
658
|
+
(e) => {
|
|
659
|
+
setTime(e.target.value);
|
|
660
|
+
},
|
|
661
|
+
[]
|
|
662
|
+
);
|
|
663
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", className), children: [
|
|
664
|
+
label && /* @__PURE__ */ jsx(Label, { className: "text-sm font-medium", children: label }),
|
|
665
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2.5", children: [
|
|
666
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 flex-col gap-3", children: /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
667
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { className: "w-full", asChild: true, children: /* @__PURE__ */ jsxs(
|
|
668
|
+
Button,
|
|
669
|
+
{
|
|
670
|
+
variant: "outline",
|
|
671
|
+
id: "date-picker",
|
|
672
|
+
className: "w-full justify-between font-normal font-onest text-[15px] border-input focus-visible:border-primary-500 text-black placeholder:text-neutral-200!",
|
|
673
|
+
disabled,
|
|
674
|
+
children: [
|
|
675
|
+
formattedDateLabel,
|
|
676
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 17 })
|
|
677
|
+
]
|
|
678
|
+
}
|
|
679
|
+
) }),
|
|
680
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-auto overflow-hidden p-0", align: "start", children: /* @__PURE__ */ jsx(
|
|
681
|
+
Calendar,
|
|
682
|
+
{
|
|
683
|
+
mode: "single",
|
|
684
|
+
selected: date,
|
|
685
|
+
captionLayout: "dropdown",
|
|
686
|
+
onSelect: handleDateSelect,
|
|
687
|
+
disabled: isDateDisabled
|
|
688
|
+
}
|
|
689
|
+
) })
|
|
690
|
+
] }) }),
|
|
691
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ jsx(
|
|
692
|
+
Input,
|
|
693
|
+
{
|
|
694
|
+
type: "time",
|
|
695
|
+
id: "time-picker",
|
|
696
|
+
step: "1",
|
|
697
|
+
value: time,
|
|
698
|
+
onChange: handleTimeChange,
|
|
699
|
+
disabled,
|
|
700
|
+
className: "bg-background appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none w-32"
|
|
701
|
+
}
|
|
702
|
+
) })
|
|
703
|
+
] })
|
|
704
|
+
] });
|
|
705
|
+
};
|
|
706
|
+
var DateTimePicker = React2.memo(DateTimePickerInner, (prev, next) => {
|
|
707
|
+
return prev.value === next.value && prev.disabled === next.disabled && prev.disablePastDates === next.disablePastDates && prev.label === next.label && prev.className === next.className && prev.onChange === next.onChange;
|
|
708
|
+
});
|
|
529
709
|
function Card({ className, ...props }) {
|
|
530
710
|
return /* @__PURE__ */ jsx(
|
|
531
711
|
"div",
|
|
@@ -824,35 +1004,6 @@ function CommandShortcut({
|
|
|
824
1004
|
}
|
|
825
1005
|
);
|
|
826
1006
|
}
|
|
827
|
-
function Popover({ ...props }) {
|
|
828
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
829
|
-
}
|
|
830
|
-
function PopoverTrigger({ ...props }) {
|
|
831
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
832
|
-
}
|
|
833
|
-
function PopoverContent({
|
|
834
|
-
className,
|
|
835
|
-
align = "center",
|
|
836
|
-
sideOffset = 4,
|
|
837
|
-
...props
|
|
838
|
-
}) {
|
|
839
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
840
|
-
PopoverPrimitive.Content,
|
|
841
|
-
{
|
|
842
|
-
"data-slot": "popover-content",
|
|
843
|
-
align,
|
|
844
|
-
sideOffset,
|
|
845
|
-
className: cn(
|
|
846
|
-
"bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
847
|
-
className
|
|
848
|
-
),
|
|
849
|
-
...props
|
|
850
|
-
}
|
|
851
|
-
) });
|
|
852
|
-
}
|
|
853
|
-
function PopoverAnchor({ ...props }) {
|
|
854
|
-
return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
855
|
-
}
|
|
856
1007
|
function Combobox({
|
|
857
1008
|
options,
|
|
858
1009
|
value,
|
|
@@ -863,7 +1014,7 @@ function Combobox({
|
|
|
863
1014
|
disabled = false,
|
|
864
1015
|
className
|
|
865
1016
|
}) {
|
|
866
|
-
const [open, setOpen] =
|
|
1017
|
+
const [open, setOpen] = React2.useState(false);
|
|
867
1018
|
const selectedOption = options.find((option) => option.value === value);
|
|
868
1019
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
869
1020
|
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
@@ -1152,24 +1303,8 @@ function DropdownMenuSubContent({ className, ...props }) {
|
|
|
1152
1303
|
}
|
|
1153
1304
|
);
|
|
1154
1305
|
}
|
|
1155
|
-
function Label2({
|
|
1156
|
-
className,
|
|
1157
|
-
...props
|
|
1158
|
-
}) {
|
|
1159
|
-
return /* @__PURE__ */ jsx(
|
|
1160
|
-
LabelPrimitive.Root,
|
|
1161
|
-
{
|
|
1162
|
-
"data-slot": "label",
|
|
1163
|
-
className: cn(
|
|
1164
|
-
"flex items-center gap-2 text-[14px] leading-none font-normal font-onest text-neutral-400 pl-1 select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
1165
|
-
className
|
|
1166
|
-
),
|
|
1167
|
-
...props
|
|
1168
|
-
}
|
|
1169
|
-
);
|
|
1170
|
-
}
|
|
1171
1306
|
var Form = FormProvider;
|
|
1172
|
-
var FormFieldContext =
|
|
1307
|
+
var FormFieldContext = React2.createContext(
|
|
1173
1308
|
{}
|
|
1174
1309
|
);
|
|
1175
1310
|
var FormField = ({
|
|
@@ -1178,8 +1313,8 @@ var FormField = ({
|
|
|
1178
1313
|
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
|
|
1179
1314
|
};
|
|
1180
1315
|
var useFormField = () => {
|
|
1181
|
-
const fieldContext =
|
|
1182
|
-
const itemContext =
|
|
1316
|
+
const fieldContext = React2.useContext(FormFieldContext);
|
|
1317
|
+
const itemContext = React2.useContext(FormItemContext);
|
|
1183
1318
|
const { getFieldState } = useFormContext();
|
|
1184
1319
|
const formState = useFormState({ name: fieldContext.name });
|
|
1185
1320
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
@@ -1196,11 +1331,11 @@ var useFormField = () => {
|
|
|
1196
1331
|
...fieldState
|
|
1197
1332
|
};
|
|
1198
1333
|
};
|
|
1199
|
-
var FormItemContext =
|
|
1334
|
+
var FormItemContext = React2.createContext(
|
|
1200
1335
|
{}
|
|
1201
1336
|
);
|
|
1202
1337
|
function FormItem({ className, ...props }) {
|
|
1203
|
-
const id =
|
|
1338
|
+
const id = React2.useId();
|
|
1204
1339
|
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx(
|
|
1205
1340
|
"div",
|
|
1206
1341
|
{
|
|
@@ -1216,7 +1351,7 @@ function FormLabel({
|
|
|
1216
1351
|
}) {
|
|
1217
1352
|
const { error, formItemId } = useFormField();
|
|
1218
1353
|
return /* @__PURE__ */ jsx(
|
|
1219
|
-
|
|
1354
|
+
Label,
|
|
1220
1355
|
{
|
|
1221
1356
|
"data-slot": "form-label",
|
|
1222
1357
|
"data-error": !!error,
|
|
@@ -1268,22 +1403,6 @@ function FormMessage({ className, ...props }) {
|
|
|
1268
1403
|
}
|
|
1269
1404
|
);
|
|
1270
1405
|
}
|
|
1271
|
-
function Input({ className, type, ...props }) {
|
|
1272
|
-
return /* @__PURE__ */ jsx(
|
|
1273
|
-
"input",
|
|
1274
|
-
{
|
|
1275
|
-
type,
|
|
1276
|
-
"data-slot": "input",
|
|
1277
|
-
className: cn(
|
|
1278
|
-
"file:text-foreground placeholder:text-neutral-200/70 selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-neutral-100/60 flex h-12 w-full min-w-0 rounded-md border-[1px] bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:hidden disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-base cursor-pointer font-golos",
|
|
1279
|
-
"focus-visible:border-primary-600",
|
|
1280
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
1281
|
-
className
|
|
1282
|
-
),
|
|
1283
|
-
...props
|
|
1284
|
-
}
|
|
1285
|
-
);
|
|
1286
|
-
}
|
|
1287
1406
|
function Pagination({ className, ...props }) {
|
|
1288
1407
|
return /* @__PURE__ */ jsx(
|
|
1289
1408
|
"nav",
|
|
@@ -1561,7 +1680,7 @@ function TooltipContent({
|
|
|
1561
1680
|
}
|
|
1562
1681
|
) });
|
|
1563
1682
|
}
|
|
1564
|
-
var Progress =
|
|
1683
|
+
var Progress = React2.forwardRef(
|
|
1565
1684
|
({ className, value = 0, withTooltip = false, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1566
1685
|
"div",
|
|
1567
1686
|
{
|
|
@@ -1670,7 +1789,7 @@ function SearchInput({
|
|
|
1670
1789
|
var Select = SelectPrimitive.Root;
|
|
1671
1790
|
var SelectGroup = SelectPrimitive.Group;
|
|
1672
1791
|
var SelectValue = SelectPrimitive.Value;
|
|
1673
|
-
var SelectTrigger =
|
|
1792
|
+
var SelectTrigger = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1674
1793
|
SelectPrimitive.Trigger,
|
|
1675
1794
|
{
|
|
1676
1795
|
ref,
|
|
@@ -1686,7 +1805,7 @@ var SelectTrigger = React10.forwardRef(({ className, children, ...props }, ref)
|
|
|
1686
1805
|
}
|
|
1687
1806
|
));
|
|
1688
1807
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1689
|
-
var SelectScrollUpButton =
|
|
1808
|
+
var SelectScrollUpButton = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1690
1809
|
SelectPrimitive.ScrollUpButton,
|
|
1691
1810
|
{
|
|
1692
1811
|
ref,
|
|
@@ -1696,7 +1815,7 @@ var SelectScrollUpButton = React10.forwardRef(({ className, ...props }, ref) =>
|
|
|
1696
1815
|
}
|
|
1697
1816
|
));
|
|
1698
1817
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1699
|
-
var SelectScrollDownButton =
|
|
1818
|
+
var SelectScrollDownButton = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1700
1819
|
SelectPrimitive.ScrollDownButton,
|
|
1701
1820
|
{
|
|
1702
1821
|
ref,
|
|
@@ -1706,7 +1825,7 @@ var SelectScrollDownButton = React10.forwardRef(({ className, ...props }, ref) =
|
|
|
1706
1825
|
}
|
|
1707
1826
|
));
|
|
1708
1827
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1709
|
-
var SelectContent =
|
|
1828
|
+
var SelectContent = React2.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
1710
1829
|
SelectPrimitive.Content,
|
|
1711
1830
|
{
|
|
1712
1831
|
ref,
|
|
@@ -1731,9 +1850,9 @@ var SelectContent = React10.forwardRef(({ className, children, position = "poppe
|
|
|
1731
1850
|
}
|
|
1732
1851
|
) }));
|
|
1733
1852
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1734
|
-
var SelectLabel =
|
|
1853
|
+
var SelectLabel = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Label, { ref, className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className), ...props }));
|
|
1735
1854
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1736
|
-
var SelectItem =
|
|
1855
|
+
var SelectItem = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1737
1856
|
SelectPrimitive.Item,
|
|
1738
1857
|
{
|
|
1739
1858
|
ref,
|
|
@@ -1749,7 +1868,7 @@ var SelectItem = React10.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
1749
1868
|
}
|
|
1750
1869
|
));
|
|
1751
1870
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1752
|
-
var SelectSeparator =
|
|
1871
|
+
var SelectSeparator = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props }));
|
|
1753
1872
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
1754
1873
|
function Sheet({ ...props }) {
|
|
1755
1874
|
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
@@ -1830,7 +1949,7 @@ function Skeleton({ className, ...props }) {
|
|
|
1830
1949
|
}
|
|
1831
1950
|
);
|
|
1832
1951
|
}
|
|
1833
|
-
var Slider =
|
|
1952
|
+
var Slider = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1834
1953
|
SliderPrimitive.Root,
|
|
1835
1954
|
{
|
|
1836
1955
|
ref,
|
|
@@ -1859,7 +1978,7 @@ var Toaster = ({ ...props }) => {
|
|
|
1859
1978
|
}
|
|
1860
1979
|
);
|
|
1861
1980
|
};
|
|
1862
|
-
var Switch =
|
|
1981
|
+
var Switch = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1863
1982
|
SwitchPrimitives.Root,
|
|
1864
1983
|
{
|
|
1865
1984
|
className: cn(
|
|
@@ -1908,7 +2027,7 @@ function TabsTrigger({ className, ...props }) {
|
|
|
1908
2027
|
function TabsContent({ className, ...props }) {
|
|
1909
2028
|
return /* @__PURE__ */ jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn("flex-1 outline-none", className), ...props });
|
|
1910
2029
|
}
|
|
1911
|
-
var Textarea =
|
|
2030
|
+
var Textarea = React2.forwardRef(({ className, ...props }, ref) => {
|
|
1912
2031
|
return /* @__PURE__ */ jsx(
|
|
1913
2032
|
"textarea",
|
|
1914
2033
|
{
|
|
@@ -1957,7 +2076,7 @@ function Toggle({
|
|
|
1957
2076
|
}
|
|
1958
2077
|
);
|
|
1959
2078
|
}
|
|
1960
|
-
var ToggleGroupContext =
|
|
2079
|
+
var ToggleGroupContext = React2.createContext({
|
|
1961
2080
|
size: "default",
|
|
1962
2081
|
variant: "default",
|
|
1963
2082
|
spacing: 0
|
|
@@ -1994,7 +2113,7 @@ function ToggleGroupItem({
|
|
|
1994
2113
|
size,
|
|
1995
2114
|
...props
|
|
1996
2115
|
}) {
|
|
1997
|
-
const context =
|
|
2116
|
+
const context = React2.useContext(ToggleGroupContext);
|
|
1998
2117
|
return /* @__PURE__ */ jsx(
|
|
1999
2118
|
ToggleGroupPrimitive.Item,
|
|
2000
2119
|
{
|
|
@@ -2016,43 +2135,43 @@ function ToggleGroupItem({
|
|
|
2016
2135
|
}
|
|
2017
2136
|
);
|
|
2018
2137
|
}
|
|
2019
|
-
var Heading1 =
|
|
2138
|
+
var Heading1 = React2__default.forwardRef(
|
|
2020
2139
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h1", { className: cn("text-3xl font-[700] font-onest text-black dark:text-white", className), ref, ...props, children })
|
|
2021
2140
|
);
|
|
2022
2141
|
Heading1.displayName = "Heading1";
|
|
2023
|
-
var Heading2 =
|
|
2142
|
+
var Heading2 = React2__default.forwardRef(
|
|
2024
2143
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h2", { className: cn("text-[26px] font-[600] font-onest text-black dark:text-neutral-100", className), ref, ...props, children })
|
|
2025
2144
|
);
|
|
2026
2145
|
Heading2.displayName = "Heading2";
|
|
2027
|
-
var Heading3 =
|
|
2146
|
+
var Heading3 = React2__default.forwardRef(
|
|
2028
2147
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h3", { className: cn("text-2xl font-semibold font-onest text-neutral-900 dark:text-neutral-200", className), ref, ...props, children })
|
|
2029
2148
|
);
|
|
2030
2149
|
Heading3.displayName = "Heading3";
|
|
2031
|
-
var Heading4 =
|
|
2150
|
+
var Heading4 = React2__default.forwardRef(
|
|
2032
2151
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h4", { className: cn("text-[22px] font-semibold text-neutral-800 dark:text-neutral-200", className), ref, ...props, children })
|
|
2033
2152
|
);
|
|
2034
2153
|
Heading4.displayName = "Heading4";
|
|
2035
|
-
var Heading5 =
|
|
2154
|
+
var Heading5 = React2__default.forwardRef(
|
|
2036
2155
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h5", { className: cn("text-lg font-semibold text-black dark:text-neutral-300", className), ref, ...props, children })
|
|
2037
2156
|
);
|
|
2038
2157
|
Heading5.displayName = "Heading5";
|
|
2039
|
-
var Heading6 =
|
|
2158
|
+
var Heading6 = React2__default.forwardRef(
|
|
2040
2159
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h6", { className: cn("text-base font-[500] text-black dark:text-neutral-300", className), ref, ...props, children })
|
|
2041
2160
|
);
|
|
2042
2161
|
Heading6.displayName = "Heading6";
|
|
2043
|
-
var Body1 =
|
|
2162
|
+
var Body1 = React2__default.forwardRef(
|
|
2044
2163
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("p", { className: cn("text-[18px] text-neutral-700 dark:text-neutral-400 font-golos", className), ref, ...props, children })
|
|
2045
2164
|
);
|
|
2046
2165
|
Body1.displayName = "Body1";
|
|
2047
|
-
var Body2 =
|
|
2166
|
+
var Body2 = React2__default.forwardRef(
|
|
2048
2167
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("p", { className: cn("text-base text-neutral-700 dark:text-neutral-400 font-golos", className), ref, ...props, children })
|
|
2049
2168
|
);
|
|
2050
2169
|
Body2.displayName = "Body2";
|
|
2051
|
-
var Body3 =
|
|
2170
|
+
var Body3 = React2__default.forwardRef(
|
|
2052
2171
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("p", { className: cn("text-sm lg:leading-[22px] text-neutral-600 dark:text-neutral-400 font-golos", className), ref, ...props, children })
|
|
2053
2172
|
);
|
|
2054
2173
|
Body3.displayName = "Body3";
|
|
2055
2174
|
|
|
2056
|
-
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Body1, Body2, Body3, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Input,
|
|
2175
|
+
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Body1, Body2, Body3, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DateTimePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Input, Label, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, PasswordInput2, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup2 as RadioGroup, RadioGroupItem, SearchInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonGroupVariants, buttonVariants, toggleVariants, useFormField };
|
|
2057
2176
|
//# sourceMappingURL=index.js.map
|
|
2058
2177
|
//# sourceMappingURL=index.js.map
|