@xwadex/fesd-next 0.3.4-7.6 → 0.3.4-7.7
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/anchors/anchors.d.ts +16 -0
- package/dist/components/anchors/anchors.js +26 -0
- package/dist/components/anchors/index.d.ts +1 -0
- package/dist/components/anchors/index.js +1 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/tests/index.d.ts +1 -0
- package/dist/components/tests/index.js +1 -0
- package/dist/components/tests/tests.d.ts +4 -0
- package/dist/components/tests/tests.js +8 -0
- package/dist/hooks/useAnchors.d.ts +8 -5
- package/dist/hooks/useAnchors.js +74 -68
- package/dist/shadcns/components/ui/accordion.d.ts +7 -0
- package/dist/shadcns/components/ui/accordion.js +18 -0
- package/dist/shadcns/components/ui/alert-dialog.d.ts +14 -0
- package/dist/shadcns/components/ui/alert-dialog.js +39 -0
- package/dist/shadcns/components/ui/alert.d.ts +9 -0
- package/dist/shadcns/components/ui/alert.js +24 -0
- package/dist/shadcns/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/shadcns/components/ui/aspect-ratio.js +7 -0
- package/dist/shadcns/components/ui/avatar.d.ts +6 -0
- package/dist/shadcns/components/ui/avatar.js +14 -0
- package/dist/shadcns/components/ui/badge.d.ts +9 -0
- package/dist/shadcns/components/ui/badge.js +22 -0
- package/dist/shadcns/components/ui/breadcrumb.d.ts +11 -0
- package/dist/shadcns/components/ui/breadcrumb.js +27 -0
- package/dist/shadcns/components/ui/button.d.ts +10 -0
- package/dist/shadcns/components/ui/button.js +32 -0
- package/dist/shadcns/components/ui/calendar.d.ts +8 -0
- package/dist/shadcns/components/ui/calendar.js +74 -0
- package/dist/shadcns/components/ui/card.d.ts +9 -0
- package/dist/shadcns/components/ui/card.js +24 -0
- package/dist/shadcns/components/ui/carousel.d.ts +19 -0
- package/dist/shadcns/components/ui/carousel.js +91 -0
- package/dist/shadcns/components/ui/chart.d.ts +40 -0
- package/dist/shadcns/components/ui/chart.js +114 -0
- package/dist/shadcns/components/ui/checkbox.d.ts +4 -0
- package/dist/shadcns/components/ui/checkbox.js +9 -0
- package/dist/shadcns/components/ui/collapsible.d.ts +5 -0
- package/dist/shadcns/components/ui/collapsible.js +13 -0
- package/dist/shadcns/components/ui/command.d.ts +18 -0
- package/dist/shadcns/components/ui/command.js +34 -0
- package/dist/shadcns/components/ui/context-menu.d.ts +25 -0
- package/dist/shadcns/components/ui/context-menu.js +51 -0
- package/dist/shadcns/components/ui/dialog.d.ts +15 -0
- package/dist/shadcns/components/ui/dialog.js +36 -0
- package/dist/shadcns/components/ui/drawer.d.ts +13 -0
- package/dist/shadcns/components/ui/drawer.js +35 -0
- package/dist/shadcns/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/shadcns/components/ui/dropdown-menu.js +51 -0
- package/dist/shadcns/components/ui/form.d.ts +24 -0
- package/dist/shadcns/components/ui/form.js +57 -0
- package/dist/shadcns/components/ui/hover-card.d.ts +6 -0
- package/dist/shadcns/components/ui/hover-card.js +14 -0
- package/dist/shadcns/components/ui/input-otp.d.ts +11 -0
- package/dist/shadcns/components/ui/input-otp.js +21 -0
- package/dist/shadcns/components/ui/input.d.ts +3 -0
- package/dist/shadcns/components/ui/input.js +6 -0
- package/dist/shadcns/components/ui/label.d.ts +4 -0
- package/dist/shadcns/components/ui/label.js +8 -0
- package/dist/shadcns/components/ui/menubar.d.ts +26 -0
- package/dist/shadcns/components/ui/menubar.js +54 -0
- package/dist/shadcns/components/ui/navigation-menu.d.ts +14 -0
- package/dist/shadcns/components/ui/navigation-menu.js +31 -0
- package/dist/shadcns/components/ui/pagination.d.ts +13 -0
- package/dist/shadcns/components/ui/pagination.js +29 -0
- package/dist/shadcns/components/ui/popover.d.ts +7 -0
- package/dist/shadcns/components/ui/popover.js +17 -0
- package/dist/shadcns/components/ui/progress.d.ts +4 -0
- package/dist/shadcns/components/ui/progress.js +8 -0
- package/dist/shadcns/components/ui/radio-group.d.ts +5 -0
- package/dist/shadcns/components/ui/radio-group.js +12 -0
- package/dist/shadcns/components/ui/resizable.d.ts +8 -0
- package/dist/shadcns/components/ui/resizable.js +15 -0
- package/dist/shadcns/components/ui/scroll-area.d.ts +5 -0
- package/dist/shadcns/components/ui/scroll-area.js +11 -0
- package/dist/shadcns/components/ui/select.d.ts +15 -0
- package/dist/shadcns/components/ui/select.js +38 -0
- package/dist/shadcns/components/ui/separator.d.ts +4 -0
- package/dist/shadcns/components/ui/separator.js +8 -0
- package/dist/shadcns/components/ui/sheet.d.ts +13 -0
- package/dist/shadcns/components/ui/sheet.js +40 -0
- package/dist/shadcns/components/ui/sidebar.d.ts +69 -0
- package/dist/shadcns/components/ui/sidebar.js +211 -0
- package/dist/shadcns/components/ui/skeleton.d.ts +2 -0
- package/dist/shadcns/components/ui/skeleton.js +6 -0
- package/dist/shadcns/components/ui/slider.d.ts +4 -0
- package/dist/shadcns/components/ui/slider.js +10 -0
- package/dist/shadcns/components/ui/sonner.d.ts +3 -0
- package/dist/shadcns/components/ui/sonner.js +13 -0
- package/dist/shadcns/components/ui/switch.d.ts +4 -0
- package/dist/shadcns/components/ui/switch.js +8 -0
- package/dist/shadcns/components/ui/table.d.ts +10 -0
- package/dist/shadcns/components/ui/table.js +28 -0
- package/dist/shadcns/components/ui/tabs.d.ts +7 -0
- package/dist/shadcns/components/ui/tabs.js +17 -0
- package/dist/shadcns/components/ui/textarea.d.ts +3 -0
- package/dist/shadcns/components/ui/textarea.js +6 -0
- package/dist/shadcns/components/ui/toggle-group.d.ts +7 -0
- package/dist/shadcns/components/ui/toggle-group.js +21 -0
- package/dist/shadcns/components/ui/toggle.d.ts +9 -0
- package/dist/shadcns/components/ui/toggle.js +26 -0
- package/dist/shadcns/components/ui/tooltip.d.ts +7 -0
- package/dist/shadcns/components/ui/tooltip.js +17 -0
- package/dist/shadcns/hooks/use-mobile.d.ts +1 -0
- package/dist/shadcns/hooks/use-mobile.js +15 -0
- package/dist/shadcns/lib/utils.d.ts +2 -0
- package/dist/shadcns/lib/utils.js +5 -0
- package/package.json +13 -1
- package/dist/components/TestComponent.d.ts +0 -4
- package/dist/components/TestComponent.js +0 -10
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
5
|
+
import { DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
import { Button, buttonVariants } from '../../../shadcns/components/ui/button';
|
|
8
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'ghost', formatters, components, ...props }) {
|
|
9
|
+
const defaultClassNames = getDefaultClassNames();
|
|
10
|
+
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent', String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: {
|
|
11
|
+
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
12
|
+
...formatters,
|
|
13
|
+
}, classNames: {
|
|
14
|
+
root: cn('w-fit', defaultClassNames.root),
|
|
15
|
+
months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
|
|
16
|
+
month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
|
|
17
|
+
nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
|
|
18
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
|
|
19
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
|
|
20
|
+
month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
|
|
21
|
+
dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
|
|
22
|
+
dropdown_root: cn('relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md', defaultClassNames.dropdown_root),
|
|
23
|
+
dropdown: cn('absolute inset-0 opacity-0', defaultClassNames.dropdown),
|
|
24
|
+
caption_label: cn('select-none font-medium', captionLayout === 'label'
|
|
25
|
+
? 'text-sm'
|
|
26
|
+
: 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label),
|
|
27
|
+
table: 'w-full border-collapse',
|
|
28
|
+
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
29
|
+
weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday),
|
|
30
|
+
week: cn('flex w-full mt-2', defaultClassNames.week),
|
|
31
|
+
week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
32
|
+
week_number: cn('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
|
|
33
|
+
day: cn('relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none', defaultClassNames.day),
|
|
34
|
+
range_start: cn('rounded-l-md bg-accent', defaultClassNames.range_start),
|
|
35
|
+
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
36
|
+
range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),
|
|
37
|
+
today: cn('bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
|
|
38
|
+
outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
|
|
39
|
+
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
40
|
+
hidden: cn('invisible', defaultClassNames.hidden),
|
|
41
|
+
...classNames,
|
|
42
|
+
}, components: {
|
|
43
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
44
|
+
return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props }));
|
|
45
|
+
},
|
|
46
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
47
|
+
if (orientation === 'left') {
|
|
48
|
+
return _jsx(ChevronLeftIcon, { className: cn('size-4', className), ...props });
|
|
49
|
+
}
|
|
50
|
+
if (orientation === 'right') {
|
|
51
|
+
return _jsx(ChevronRightIcon, { className: cn('size-4', className), ...props });
|
|
52
|
+
}
|
|
53
|
+
return _jsx(ChevronDownIcon, { className: cn('size-4', className), ...props });
|
|
54
|
+
},
|
|
55
|
+
DayButton: CalendarDayButton,
|
|
56
|
+
WeekNumber: ({ children, ...props }) => {
|
|
57
|
+
return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
|
|
58
|
+
},
|
|
59
|
+
...components,
|
|
60
|
+
}, ...props }));
|
|
61
|
+
}
|
|
62
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
63
|
+
const defaultClassNames = getDefaultClassNames();
|
|
64
|
+
const ref = React.useRef(null);
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
if (modifiers.focused)
|
|
67
|
+
ref.current?.focus();
|
|
68
|
+
}, [modifiers.focused]);
|
|
69
|
+
return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
|
|
70
|
+
!modifiers.range_start &&
|
|
71
|
+
!modifiers.range_end &&
|
|
72
|
+
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn('data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
|
|
73
|
+
}
|
|
74
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Card({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../lib/utils';
|
|
3
|
+
function Card({ className, ...props }) {
|
|
4
|
+
return (_jsx("div", { "data-slot": "card", className: cn('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
function CardHeader({ className, ...props }) {
|
|
7
|
+
return (_jsx("div", { "data-slot": "card-header", className: cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6', className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function CardTitle({ className, ...props }) {
|
|
10
|
+
return (_jsx("div", { "data-slot": "card-title", className: cn('leading-none font-semibold', className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function CardDescription({ className, ...props }) {
|
|
13
|
+
return (_jsx("div", { "data-slot": "card-description", className: cn('text-muted-foreground text-sm', className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
function CardAction({ className, ...props }) {
|
|
16
|
+
return (_jsx("div", { "data-slot": "card-action", className: cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function CardContent({ className, ...props }) {
|
|
19
|
+
return _jsx("div", { "data-slot": "card-content", className: cn('px-6', className), ...props });
|
|
20
|
+
}
|
|
21
|
+
function CardFooter({ className, ...props }) {
|
|
22
|
+
return (_jsx("div", { "data-slot": "card-footer", className: cn('flex items-center px-6 [.border-t]:pt-6', className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';
|
|
3
|
+
import { Button } from '../../components/ui/button';
|
|
4
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
5
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
6
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
7
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
8
|
+
type CarouselProps = {
|
|
9
|
+
opts?: CarouselOptions;
|
|
10
|
+
plugins?: CarouselPlugin;
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
|
+
setApi?: (api: CarouselApi) => void;
|
|
13
|
+
};
|
|
14
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<'div'> & CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function CarouselContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
5
|
+
import { ArrowLeft, ArrowRight } from 'lucide-react';
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
import { Button } from '../../components/ui/button';
|
|
8
|
+
const CarouselContext = React.createContext(null);
|
|
9
|
+
function useCarousel() {
|
|
10
|
+
const context = React.useContext(CarouselContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error('useCarousel must be used within a <Carousel />');
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
function Carousel({ orientation = 'horizontal', opts, setApi, plugins, className, children, ...props }) {
|
|
17
|
+
const [carouselRef, api] = useEmblaCarousel({
|
|
18
|
+
...opts,
|
|
19
|
+
axis: orientation === 'horizontal' ? 'x' : 'y',
|
|
20
|
+
}, plugins);
|
|
21
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
22
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
23
|
+
const onSelect = React.useCallback((api) => {
|
|
24
|
+
if (!api)
|
|
25
|
+
return;
|
|
26
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
27
|
+
setCanScrollNext(api.canScrollNext());
|
|
28
|
+
}, []);
|
|
29
|
+
const scrollPrev = React.useCallback(() => {
|
|
30
|
+
api?.scrollPrev();
|
|
31
|
+
}, [api]);
|
|
32
|
+
const scrollNext = React.useCallback(() => {
|
|
33
|
+
api?.scrollNext();
|
|
34
|
+
}, [api]);
|
|
35
|
+
const handleKeyDown = React.useCallback((event) => {
|
|
36
|
+
if (event.key === 'ArrowLeft') {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
scrollPrev();
|
|
39
|
+
}
|
|
40
|
+
else if (event.key === 'ArrowRight') {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
scrollNext();
|
|
43
|
+
}
|
|
44
|
+
}, [scrollPrev, scrollNext]);
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (!api || !setApi)
|
|
47
|
+
return;
|
|
48
|
+
setApi(api);
|
|
49
|
+
}, [api, setApi]);
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
if (!api)
|
|
52
|
+
return;
|
|
53
|
+
onSelect(api);
|
|
54
|
+
api.on('reInit', onSelect);
|
|
55
|
+
api.on('select', onSelect);
|
|
56
|
+
return () => {
|
|
57
|
+
api?.off('select', onSelect);
|
|
58
|
+
};
|
|
59
|
+
}, [api, onSelect]);
|
|
60
|
+
return (_jsx(CarouselContext.Provider, { value: {
|
|
61
|
+
carouselRef,
|
|
62
|
+
api: api,
|
|
63
|
+
opts,
|
|
64
|
+
orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),
|
|
65
|
+
scrollPrev,
|
|
66
|
+
scrollNext,
|
|
67
|
+
canScrollPrev,
|
|
68
|
+
canScrollNext,
|
|
69
|
+
}, children: _jsx("div", { onKeyDownCapture: handleKeyDown, className: cn('relative', className), role: "region", "aria-roledescription": "carousel", "data-slot": "carousel", ...props, children: children }) }));
|
|
70
|
+
}
|
|
71
|
+
function CarouselContent({ className, ...props }) {
|
|
72
|
+
const { carouselRef, orientation } = useCarousel();
|
|
73
|
+
return (_jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: _jsx("div", { className: cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className), ...props }) }));
|
|
74
|
+
}
|
|
75
|
+
function CarouselItem({ className, ...props }) {
|
|
76
|
+
const { orientation } = useCarousel();
|
|
77
|
+
return (_jsx("div", { role: "group", "aria-roledescription": "slide", "data-slot": "carousel-item", className: cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className), ...props }));
|
|
78
|
+
}
|
|
79
|
+
function CarouselPrevious({ className, variant = 'outline', size = 'icon', ...props }) {
|
|
80
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
81
|
+
return (_jsxs(Button, { "data-slot": "carousel-previous", variant: variant, size: size, className: cn('absolute size-8 rounded-full', orientation === 'horizontal'
|
|
82
|
+
? 'top-1/2 -left-12 -translate-y-1/2'
|
|
83
|
+
: '-top-12 left-1/2 -translate-x-1/2 rotate-90', className), disabled: !canScrollPrev, onClick: scrollPrev, ...props, children: [_jsx(ArrowLeft, {}), _jsx("span", { className: "sr-only", children: "Previous slide" })] }));
|
|
84
|
+
}
|
|
85
|
+
function CarouselNext({ className, variant = 'outline', size = 'icon', ...props }) {
|
|
86
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
87
|
+
return (_jsxs(Button, { "data-slot": "carousel-next", variant: variant, size: size, className: cn('absolute size-8 rounded-full', orientation === 'horizontal'
|
|
88
|
+
? 'top-1/2 -right-12 -translate-y-1/2'
|
|
89
|
+
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90', className), disabled: !canScrollNext, onClick: scrollNext, ...props, children: [_jsx(ArrowRight, {}), _jsx("span", { className: "sr-only", children: "Next slide" })] }));
|
|
90
|
+
}
|
|
91
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RechartsPrimitive from 'recharts';
|
|
3
|
+
declare const THEMES: {
|
|
4
|
+
readonly light: "";
|
|
5
|
+
readonly dark: ".dark";
|
|
6
|
+
};
|
|
7
|
+
export type ChartConfig = {
|
|
8
|
+
[k in string]: {
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
icon?: React.ComponentType;
|
|
11
|
+
} & ({
|
|
12
|
+
color?: string;
|
|
13
|
+
theme?: never;
|
|
14
|
+
} | {
|
|
15
|
+
color?: never;
|
|
16
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<'div'> & {
|
|
20
|
+
config: ChartConfig;
|
|
21
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare const ChartStyle: ({ id, config }: {
|
|
24
|
+
id: string;
|
|
25
|
+
config: ChartConfig;
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
28
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<'div'> & {
|
|
29
|
+
hideLabel?: boolean;
|
|
30
|
+
hideIndicator?: boolean;
|
|
31
|
+
indicator?: 'line' | 'dot' | 'dashed';
|
|
32
|
+
nameKey?: string;
|
|
33
|
+
labelKey?: string;
|
|
34
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
35
|
+
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
36
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<'div'> & Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
|
|
37
|
+
hideIcon?: boolean;
|
|
38
|
+
nameKey?: string;
|
|
39
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
40
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as RechartsPrimitive from 'recharts';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
|
+
const THEMES = { light: '', dark: '.dark' };
|
|
8
|
+
const ChartContext = React.createContext(null);
|
|
9
|
+
function useChart() {
|
|
10
|
+
const context = React.useContext(ChartContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error('useChart must be used within a <ChartContainer />');
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
function ChartContainer({ id, className, children, config, ...props }) {
|
|
17
|
+
const uniqueId = React.useId();
|
|
18
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
|
|
19
|
+
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
|
|
20
|
+
}
|
|
21
|
+
const ChartStyle = ({ id, config }) => {
|
|
22
|
+
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
|
23
|
+
if (!colorConfig.length) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return (_jsx("style", { dangerouslySetInnerHTML: {
|
|
27
|
+
__html: Object.entries(THEMES)
|
|
28
|
+
.map(([theme, prefix]) => `
|
|
29
|
+
${prefix} [data-chart=${id}] {
|
|
30
|
+
${colorConfig
|
|
31
|
+
.map(([key, itemConfig]) => {
|
|
32
|
+
const color = itemConfig.theme?.[theme] || itemConfig.color;
|
|
33
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
34
|
+
})
|
|
35
|
+
.join('\n')}
|
|
36
|
+
}
|
|
37
|
+
`)
|
|
38
|
+
.join('\n'),
|
|
39
|
+
} }));
|
|
40
|
+
};
|
|
41
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
42
|
+
function ChartTooltipContent({ active, payload, className, indicator = 'dot', hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
|
|
43
|
+
const { config } = useChart();
|
|
44
|
+
const tooltipLabel = React.useMemo(() => {
|
|
45
|
+
if (hideLabel || !payload?.length) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const [item] = payload;
|
|
49
|
+
const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;
|
|
50
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
51
|
+
const value = !labelKey && typeof label === 'string'
|
|
52
|
+
? config[label]?.label || label
|
|
53
|
+
: itemConfig?.label;
|
|
54
|
+
if (labelFormatter) {
|
|
55
|
+
return (_jsx("div", { className: cn('font-medium', labelClassName), children: labelFormatter(value, payload) }));
|
|
56
|
+
}
|
|
57
|
+
if (!value) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return _jsx("div", { className: cn('font-medium', labelClassName), children: value });
|
|
61
|
+
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
|
62
|
+
if (!active || !payload?.length) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
|
66
|
+
return (_jsxs("div", { className: cn('border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl', className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
|
|
67
|
+
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
|
68
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
69
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
70
|
+
return (_jsx("div", { className: cn('[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5', indicator === 'dot' && 'items-center'), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [itemConfig?.icon ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {
|
|
71
|
+
'h-2.5 w-2.5': indicator === 'dot',
|
|
72
|
+
'w-1': indicator === 'line',
|
|
73
|
+
'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',
|
|
74
|
+
'my-0.5': nestLabel && indicator === 'dashed',
|
|
75
|
+
}), style: {
|
|
76
|
+
'--color-bg': indicatorColor,
|
|
77
|
+
'--color-border': indicatorColor,
|
|
78
|
+
} }))), _jsxs("div", { className: cn('flex flex-1 justify-between leading-none', nestLabel ? 'items-end' : 'items-center'), children: [_jsxs("div", { className: "grid gap-1.5", children: [nestLabel ? tooltipLabel : null, _jsx("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })] }), item.value && (_jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() }))] })] })) }, item.dataKey));
|
|
79
|
+
}) })] }));
|
|
80
|
+
}
|
|
81
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
82
|
+
function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey, }) {
|
|
83
|
+
const { config } = useChart();
|
|
84
|
+
if (!payload?.length) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return (_jsx("div", { className: cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className), children: payload.map((item) => {
|
|
88
|
+
const key = `${nameKey || item.dataKey || 'value'}`;
|
|
89
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
90
|
+
return (_jsxs("div", { className: cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3'), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
|
|
91
|
+
backgroundColor: item.color,
|
|
92
|
+
} })), itemConfig?.label] }, item.value));
|
|
93
|
+
}) }));
|
|
94
|
+
}
|
|
95
|
+
// Helper to extract item config from a payload.
|
|
96
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
97
|
+
if (typeof payload !== 'object' || payload === null) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
const payloadPayload = 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null
|
|
101
|
+
? payload.payload
|
|
102
|
+
: undefined;
|
|
103
|
+
let configLabelKey = key;
|
|
104
|
+
if (key in payload && typeof payload[key] === 'string') {
|
|
105
|
+
configLabelKey = payload[key];
|
|
106
|
+
}
|
|
107
|
+
else if (payloadPayload &&
|
|
108
|
+
key in payloadPayload &&
|
|
109
|
+
typeof payloadPayload[key] === 'string') {
|
|
110
|
+
configLabelKey = payloadPayload[key];
|
|
111
|
+
}
|
|
112
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
113
|
+
}
|
|
114
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
4
|
+
import { CheckIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
function Checkbox({ className, ...props }) {
|
|
7
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn('peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center text-current transition-none", children: _jsx(CheckIcon, { className: "size-3.5" }) }) }));
|
|
8
|
+
}
|
|
9
|
+
export { Checkbox };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
2
|
+
declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
4
|
+
function Collapsible({ ...props }) {
|
|
5
|
+
return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
6
|
+
}
|
|
7
|
+
function CollapsibleTrigger({ ...props }) {
|
|
8
|
+
return _jsx(CollapsiblePrimitive.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props });
|
|
9
|
+
}
|
|
10
|
+
function CollapsibleContent({ ...props }) {
|
|
11
|
+
return _jsx(CollapsiblePrimitive.CollapsibleContent, { "data-slot": "collapsible-content", ...props });
|
|
12
|
+
}
|
|
13
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
3
|
+
import { Dialog } from '../../components/ui/dialog';
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
4
|
+
import { SearchIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from '../../components/ui/dialog';
|
|
7
|
+
function Command({ className, ...props }) {
|
|
8
|
+
return (_jsx(CommandPrimitive, { "data-slot": "command", className: cn('bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md', className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function CommandDialog({ title = 'Command Palette', description = 'Search for a command to run...', children, className, showCloseButton = true, ...props }) {
|
|
11
|
+
return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn('overflow-hidden p-0', className), showCloseButton: showCloseButton, children: _jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) })] }));
|
|
12
|
+
}
|
|
13
|
+
function CommandInput({ className, ...props }) {
|
|
14
|
+
return (_jsxs("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3", children: [_jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn('placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] }));
|
|
15
|
+
}
|
|
16
|
+
function CommandList({ className, ...props }) {
|
|
17
|
+
return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn('max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto', className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function CommandEmpty({ ...props }) {
|
|
20
|
+
return (_jsx(CommandPrimitive.Empty, { "data-slot": "command-empty", className: "py-6 text-center text-sm", ...props }));
|
|
21
|
+
}
|
|
22
|
+
function CommandGroup({ className, ...props }) {
|
|
23
|
+
return (_jsx(CommandPrimitive.Group, { "data-slot": "command-group", className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function CommandSeparator({ className, ...props }) {
|
|
26
|
+
return (_jsx(CommandPrimitive.Separator, { "data-slot": "command-separator", className: cn('bg-border -mx-1 h-px', className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
function CommandItem({ className, ...props }) {
|
|
29
|
+
return (_jsx(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
function CommandShortcut({ className, ...props }) {
|
|
32
|
+
return (_jsx("span", { "data-slot": "command-shortcut", className: cn('text-muted-foreground ml-auto text-xs tracking-widest', className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
3
|
+
declare function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ContextMenuTrigger({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function ContextMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
variant?: 'default' | 'destructive';
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function ContextMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function ContextMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function ContextMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
4
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
function ContextMenu({ ...props }) {
|
|
7
|
+
return _jsx(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
|
|
8
|
+
}
|
|
9
|
+
function ContextMenuTrigger({ ...props }) {
|
|
10
|
+
return _jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", ...props });
|
|
11
|
+
}
|
|
12
|
+
function ContextMenuGroup({ ...props }) {
|
|
13
|
+
return _jsx(ContextMenuPrimitive.Group, { "data-slot": "context-menu-group", ...props });
|
|
14
|
+
}
|
|
15
|
+
function ContextMenuPortal({ ...props }) {
|
|
16
|
+
return _jsx(ContextMenuPrimitive.Portal, { "data-slot": "context-menu-portal", ...props });
|
|
17
|
+
}
|
|
18
|
+
function ContextMenuSub({ ...props }) {
|
|
19
|
+
return _jsx(ContextMenuPrimitive.Sub, { "data-slot": "context-menu-sub", ...props });
|
|
20
|
+
}
|
|
21
|
+
function ContextMenuRadioGroup({ ...props }) {
|
|
22
|
+
return _jsx(ContextMenuPrimitive.RadioGroup, { "data-slot": "context-menu-radio-group", ...props });
|
|
23
|
+
}
|
|
24
|
+
function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
25
|
+
return (_jsxs(ContextMenuPrimitive.SubTrigger, { "data-slot": "context-menu-sub-trigger", "data-inset": inset, className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] }));
|
|
26
|
+
}
|
|
27
|
+
function ContextMenuSubContent({ className, ...props }) {
|
|
28
|
+
return (_jsx(ContextMenuPrimitive.SubContent, { "data-slot": "context-menu-sub-content", className: cn('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 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg', className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
function ContextMenuContent({ className, ...props }) {
|
|
31
|
+
return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, { "data-slot": "context-menu-content", className: cn('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 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md', className), ...props }) }));
|
|
32
|
+
}
|
|
33
|
+
function ContextMenuItem({ className, inset, variant = 'default', ...props }) {
|
|
34
|
+
return (_jsx(ContextMenuPrimitive.Item, { "data-slot": "context-menu-item", "data-inset": inset, "data-variant": variant, className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
35
|
+
}
|
|
36
|
+
function ContextMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
37
|
+
return (_jsxs(ContextMenuPrimitive.CheckboxItem, { "data-slot": "context-menu-checkbox-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
38
|
+
}
|
|
39
|
+
function ContextMenuRadioItem({ className, children, ...props }) {
|
|
40
|
+
return (_jsxs(ContextMenuPrimitive.RadioItem, { "data-slot": "context-menu-radio-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
41
|
+
}
|
|
42
|
+
function ContextMenuLabel({ className, inset, ...props }) {
|
|
43
|
+
return (_jsx(ContextMenuPrimitive.Label, { "data-slot": "context-menu-label", "data-inset": inset, className: cn('text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className), ...props }));
|
|
44
|
+
}
|
|
45
|
+
function ContextMenuSeparator({ className, ...props }) {
|
|
46
|
+
return (_jsx(ContextMenuPrimitive.Separator, { "data-slot": "context-menu-separator", className: cn('bg-border -mx-1 my-1 h-px', className), ...props }));
|
|
47
|
+
}
|
|
48
|
+
function ContextMenuShortcut({ className, ...props }) {
|
|
49
|
+
return (_jsx("span", { "data-slot": "context-menu-shortcut", className: cn('text-muted-foreground ml-auto text-xs tracking-widest', className), ...props }));
|
|
50
|
+
}
|
|
51
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|