@websolutespa/ask-ui 1.0.2 → 1.0.4
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/accordion.d.mts +25 -0
- package/dist/components/accordion.mjs +55 -0
- package/dist/components/ai-elements/attachments.d.mts +94 -0
- package/dist/components/ai-elements/attachments.mjs +174 -0
- package/dist/components/ai-elements/conversation.d.mts +51 -0
- package/dist/components/ai-elements/conversation.mjs +85 -0
- package/dist/components/ai-elements/message.d.mts +89 -0
- package/dist/components/ai-elements/message.mjs +175 -0
- package/dist/components/ai-elements/prompt-input.d.mts +277 -0
- package/dist/components/ai-elements/prompt-input.mjs +703 -0
- package/dist/components/ai-elements/speech-input.d.mts +64 -0
- package/dist/components/ai-elements/speech-input.mjs +153 -0
- package/dist/components/alert-dialog.d.mts +60 -0
- package/dist/components/alert-dialog.mjs +101 -0
- package/dist/components/alert.d.mts +28 -0
- package/dist/components/alert.mjs +43 -0
- package/dist/components/aspect-ratio.d.mts +9 -0
- package/dist/components/aspect-ratio.mjs +12 -0
- package/dist/components/avatar.d.mts +34 -0
- package/dist/components/avatar.mjs +51 -0
- package/dist/components/badge.d.mts +19 -0
- package/dist/components/badge.mjs +27 -0
- package/dist/components/breadcrumb.d.mts +38 -0
- package/dist/components/breadcrumb.mjs +70 -0
- package/dist/components/button-group.d.mts +28 -0
- package/dist/components/button-group.mjs +38 -0
- package/dist/components/button.d.mts +21 -0
- package/dist/components/button.mjs +47 -0
- package/dist/components/calendar.d.mts +30 -0
- package/dist/components/calendar.mjs +109 -0
- package/dist/components/card.d.mts +37 -0
- package/dist/components/card.mjs +56 -0
- package/dist/components/carousel.d.mts +56 -0
- package/dist/components/carousel.mjs +132 -0
- package/dist/components/chart.d.mts +78 -0
- package/dist/components/chart.mjs +146 -0
- package/dist/components/checkbox.d.mts +11 -0
- package/dist/components/checkbox.mjs +21 -0
- package/dist/components/collapsible.d.mts +15 -0
- package/dist/components/collapsible.mjs +24 -0
- package/dist/components/combobox.d.mts +81 -0
- package/dist/components/combobox.mjs +163 -0
- package/dist/components/command.d.mts +54 -0
- package/dist/components/command.mjs +88 -0
- package/dist/components/context-menu.d.mts +85 -0
- package/dist/components/context-menu.mjs +125 -0
- package/dist/components/dialog.d.mts +51 -0
- package/dist/components/dialog.mjs +96 -0
- package/dist/components/direction.d.mts +15 -0
- package/dist/components/direction.mjs +14 -0
- package/dist/components/drawer.d.mts +47 -0
- package/dist/components/drawer.mjs +79 -0
- package/dist/components/dropdown-menu.d.mts +87 -0
- package/dist/components/dropdown-menu.mjs +131 -0
- package/dist/components/empty.d.mts +35 -0
- package/dist/components/empty.mjs +59 -0
- package/dist/components/field.d.mts +64 -0
- package/dist/components/field.mjs +110 -0
- package/dist/components/hover-card.d.mts +22 -0
- package/dist/components/hover-card.mjs +33 -0
- package/dist/components/input-group.d.mts +43 -0
- package/dist/components/input-group.mjs +79 -0
- package/dist/components/input-otp.d.mts +28 -0
- package/dist/components/input-otp.mjs +47 -0
- package/dist/components/input.d.mts +11 -0
- package/dist/components/input.mjs +14 -0
- package/dist/components/item.d.mts +62 -0
- package/dist/components/item.mjs +117 -0
- package/dist/components/kbd.d.mts +13 -0
- package/dist/components/kbd.mjs +19 -0
- package/dist/components/label.d.mts +11 -0
- package/dist/components/label.mjs +15 -0
- package/dist/components/menubar.d.mts +90 -0
- package/dist/components/menubar.mjs +135 -0
- package/dist/components/native-select.d.mts +21 -0
- package/dist/components/native-select.mjs +37 -0
- package/dist/components/navigation-menu.d.mts +46 -0
- package/dist/components/navigation-menu.mjs +80 -0
- package/dist/components/pagination.d.mts +45 -0
- package/dist/components/pagination.mjs +80 -0
- package/dist/components/popover.d.mts +34 -0
- package/dist/components/popover.mjs +56 -0
- package/dist/components/progress.d.mts +12 -0
- package/dist/components/progress.mjs +20 -0
- package/dist/components/radio-group.d.mts +15 -0
- package/dist/components/radio-group.mjs +27 -0
- package/dist/components/resizable.d.mts +20 -0
- package/dist/components/resizable.mjs +28 -0
- package/dist/components/scroll-area.d.mts +17 -0
- package/dist/components/scroll-area.mjs +37 -0
- package/dist/components/select.d.mts +53 -0
- package/dist/components/select.mjs +100 -0
- package/dist/components/separator.d.mts +13 -0
- package/dist/components/separator.mjs +17 -0
- package/dist/components/sheet.d.mts +42 -0
- package/dist/components/sheet.mjs +90 -0
- package/dist/components/sidebar.d.mts +167 -0
- package/dist/components/sidebar.mjs +374 -0
- package/dist/components/skeleton.d.mts +9 -0
- package/dist/components/skeleton.mjs +12 -0
- package/dist/components/slider.d.mts +15 -0
- package/dist/components/slider.mjs +36 -0
- package/dist/components/sonner.d.mts +9 -0
- package/dist/components/sonner.mjs +30 -0
- package/dist/components/spinner.d.mts +9 -0
- package/dist/components/spinner.mjs +14 -0
- package/dist/components/switch.d.mts +14 -0
- package/dist/components/switch.mjs +20 -0
- package/dist/components/table.d.mts +38 -0
- package/dist/components/table.mjs +67 -0
- package/dist/components/tabs.d.mts +30 -0
- package/dist/components/tabs.mjs +46 -0
- package/dist/components/textarea.d.mts +10 -0
- package/dist/components/textarea.mjs +13 -0
- package/dist/components/toggle-group.d.mts +28 -0
- package/dist/components/toggle-group.mjs +51 -0
- package/dist/components/toggle.d.mts +19 -0
- package/dist/components/toggle.mjs +37 -0
- package/dist/components/tooltip.d.mts +23 -0
- package/dist/components/tooltip.mjs +36 -0
- package/dist/exports/components.d.mts +61 -2248
- package/dist/exports/components.mjs +60 -4481
- package/dist/exports/hooks.d.mts +1 -3
- package/dist/exports/hooks.mjs +1 -1
- package/dist/exports/lib.d.mts +1 -1
- package/dist/exports/lib.mjs +1 -1
- package/dist/hooks/use-mobile.d.mts +4 -0
- package/dist/{use-mobile-SSHtEcOs.mjs → hooks/use-mobile.mjs} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{utils-CCM7KiiI.d.mts → lib/utils.d.mts} +1 -1
- package/dist/{utils-XdqGR1qq.mjs → lib/utils.mjs} +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/breadcrumb.tsx
|
|
7
|
+
function Breadcrumb({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
9
|
+
"aria-label": "breadcrumb",
|
|
10
|
+
"data-slot": "breadcrumb",
|
|
11
|
+
className: cn(className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function BreadcrumbList({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
17
|
+
"data-slot": "breadcrumb-list",
|
|
18
|
+
className: cn("flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5", className),
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx("li", {
|
|
24
|
+
"data-slot": "breadcrumb-item",
|
|
25
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function BreadcrumbLink({ asChild, className, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsx(asChild ? Slot.Root : "a", {
|
|
31
|
+
"data-slot": "breadcrumb-link",
|
|
32
|
+
className: cn("transition-colors hover:text-foreground", className),
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
37
|
+
return /* @__PURE__ */ jsx("span", {
|
|
38
|
+
"data-slot": "breadcrumb-page",
|
|
39
|
+
role: "link",
|
|
40
|
+
"aria-disabled": "true",
|
|
41
|
+
"aria-current": "page",
|
|
42
|
+
className: cn("font-normal text-foreground", className),
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsx("li", {
|
|
48
|
+
"data-slot": "breadcrumb-separator",
|
|
49
|
+
role: "presentation",
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
52
|
+
...props,
|
|
53
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
58
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
59
|
+
role: "presentation",
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
className: cn("flex size-5 items-center justify-center [&>svg]:size-4", className),
|
|
62
|
+
...props,
|
|
63
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: "sr-only",
|
|
65
|
+
children: "More"
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Separator } from "./separator.mjs";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
+
|
|
6
|
+
//#region src/components/button-group.d.ts
|
|
7
|
+
declare const buttonGroupVariants: (props?: ({
|
|
8
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
9
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
|
+
declare function ButtonGroup({
|
|
11
|
+
className,
|
|
12
|
+
orientation,
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>): _$react_jsx_runtime0.JSX.Element;
|
|
15
|
+
declare function ButtonGroupText({
|
|
16
|
+
className,
|
|
17
|
+
asChild,
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<'div'> & {
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
22
|
+
declare function ButtonGroupSeparator({
|
|
23
|
+
className,
|
|
24
|
+
orientation,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof Separator>): _$react_jsx_runtime0.JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { Separator as Separator$1 } from "./separator.mjs";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
//#region src/components/button-group.tsx
|
|
7
|
+
const buttonGroupVariants = cva("flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
|
|
8
|
+
variants: { orientation: {
|
|
9
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md!",
|
|
10
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md!"
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { orientation: "horizontal" }
|
|
13
|
+
});
|
|
14
|
+
function ButtonGroup({ className, orientation, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx("div", {
|
|
16
|
+
role: "group",
|
|
17
|
+
"data-slot": "button-group",
|
|
18
|
+
"data-orientation": orientation,
|
|
19
|
+
className: cn(buttonGroupVariants({ orientation }), className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function ButtonGroupText({ className, asChild = false, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx(asChild ? Slot.Root : "div", {
|
|
25
|
+
className: cn("flex items-center gap-2 rounded-md border bg-muted px-2.5 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsx(Separator$1, {
|
|
31
|
+
"data-slot": "button-group-separator",
|
|
32
|
+
orientation,
|
|
33
|
+
className: cn("relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto", className),
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
+
|
|
6
|
+
//#region src/components/button.d.ts
|
|
7
|
+
declare const buttonVariants: (props?: ({
|
|
8
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
9
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
10
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
|
+
declare function Button({
|
|
12
|
+
className,
|
|
13
|
+
variant,
|
|
14
|
+
size,
|
|
15
|
+
asChild,
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
//#region src/components/button.tsx
|
|
7
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none cursor-pointer focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
11
|
+
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/0 dark:hover:bg-input/15",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
13
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
14
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
15
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
19
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
20
|
+
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
21
|
+
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
22
|
+
icon: "size-9",
|
|
23
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
24
|
+
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
25
|
+
"icon-lg": "size-10"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
variant: "default",
|
|
30
|
+
size: "default"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(asChild ? Slot.Root : "button", {
|
|
35
|
+
"data-slot": "button",
|
|
36
|
+
"data-variant": variant,
|
|
37
|
+
"data-size": size,
|
|
38
|
+
className: cn(buttonVariants({
|
|
39
|
+
variant,
|
|
40
|
+
size,
|
|
41
|
+
className
|
|
42
|
+
})),
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Button } from "./button.mjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { DayButton, DayPicker, Locale } from "react-day-picker";
|
|
5
|
+
|
|
6
|
+
//#region src/components/calendar.d.ts
|
|
7
|
+
declare function Calendar({
|
|
8
|
+
className,
|
|
9
|
+
classNames,
|
|
10
|
+
showOutsideDays,
|
|
11
|
+
captionLayout,
|
|
12
|
+
buttonVariant,
|
|
13
|
+
locale,
|
|
14
|
+
formatters,
|
|
15
|
+
components,
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof DayPicker> & {
|
|
18
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
19
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
20
|
+
declare function CalendarDayButton({
|
|
21
|
+
className,
|
|
22
|
+
day,
|
|
23
|
+
modifiers,
|
|
24
|
+
locale,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof DayButton> & {
|
|
27
|
+
locale?: Partial<Locale>;
|
|
28
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { Button, buttonVariants } from "./button.mjs";
|
|
4
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
8
|
+
//#region src/components/calendar.tsx
|
|
9
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
|
|
10
|
+
const defaultClassNames = getDefaultClassNames();
|
|
11
|
+
return /* @__PURE__ */ jsx(DayPicker, {
|
|
12
|
+
showOutsideDays,
|
|
13
|
+
className: cn("group/calendar bg-background p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-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),
|
|
14
|
+
captionLayout,
|
|
15
|
+
locale,
|
|
16
|
+
formatters: {
|
|
17
|
+
formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
|
|
18
|
+
...formatters
|
|
19
|
+
},
|
|
20
|
+
classNames: {
|
|
21
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
22
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
23
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
24
|
+
nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
25
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
26
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
27
|
+
month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
28
|
+
dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
29
|
+
dropdown_root: cn("relative rounded-(--cell-radius)", defaultClassNames.dropdown_root),
|
|
30
|
+
dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
31
|
+
caption_label: cn("font-medium select-none", captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
|
|
32
|
+
table: "w-full border-collapse",
|
|
33
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
34
|
+
weekday: cn("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
|
|
35
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
36
|
+
week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
37
|
+
week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
|
|
38
|
+
day: cn("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", defaultClassNames.day),
|
|
39
|
+
range_start: cn("relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted", defaultClassNames.range_start),
|
|
40
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
41
|
+
range_end: cn("relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted", defaultClassNames.range_end),
|
|
42
|
+
today: cn("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
43
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
44
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
45
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
46
|
+
...classNames
|
|
47
|
+
},
|
|
48
|
+
components: {
|
|
49
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
"data-slot": "calendar",
|
|
52
|
+
ref: rootRef,
|
|
53
|
+
className: cn(className),
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
58
|
+
if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
59
|
+
className: cn("size-4", className),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
63
|
+
className: cn("size-4", className),
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
67
|
+
className: cn("size-4", className),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
DayButton: ({ ...props }) => /* @__PURE__ */ jsx(CalendarDayButton, {
|
|
72
|
+
locale,
|
|
73
|
+
...props
|
|
74
|
+
}),
|
|
75
|
+
WeekNumber: ({ children, ...props }) => {
|
|
76
|
+
return /* @__PURE__ */ jsx("td", {
|
|
77
|
+
...props,
|
|
78
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
79
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
80
|
+
children
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
...components
|
|
85
|
+
},
|
|
86
|
+
...props
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function CalendarDayButton({ className, day, modifiers, locale, ...props }) {
|
|
90
|
+
const defaultClassNames = getDefaultClassNames();
|
|
91
|
+
const ref = React.useRef(null);
|
|
92
|
+
React.useEffect(() => {
|
|
93
|
+
if (modifiers.focused) ref.current?.focus();
|
|
94
|
+
}, [modifiers.focused]);
|
|
95
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
96
|
+
ref,
|
|
97
|
+
variant: "ghost",
|
|
98
|
+
size: "icon",
|
|
99
|
+
"data-day": day.date.toLocaleDateString(locale?.code),
|
|
100
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
101
|
+
"data-range-start": modifiers.range_start,
|
|
102
|
+
"data-range-end": modifiers.range_end,
|
|
103
|
+
"data-range-middle": modifiers.range_middle,
|
|
104
|
+
className: cn("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/card.d.ts
|
|
5
|
+
declare function Card({
|
|
6
|
+
className,
|
|
7
|
+
size,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<'div'> & {
|
|
10
|
+
size?: 'default' | 'sm';
|
|
11
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function CardHeader({
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
16
|
+
declare function CardTitle({
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
20
|
+
declare function CardDescription({
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
24
|
+
declare function CardAction({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
28
|
+
declare function CardContent({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
32
|
+
declare function CardFooter({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/card.tsx
|
|
5
|
+
function Card({ className, size = "default", ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
"data-slot": "card",
|
|
8
|
+
"data-size": size,
|
|
9
|
+
className: cn("group/card flex flex-col gap-6 overflow-hidden rounded-xl bg-card py-6 text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function CardHeader({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("div", {
|
|
15
|
+
"data-slot": "card-header",
|
|
16
|
+
className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-6 group-data-[size=sm]/card:px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4", className),
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function CardTitle({ className, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx("div", {
|
|
22
|
+
"data-slot": "card-title",
|
|
23
|
+
className: cn("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm", className),
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function CardDescription({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
"data-slot": "card-description",
|
|
30
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function CardAction({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx("div", {
|
|
36
|
+
"data-slot": "card-action",
|
|
37
|
+
className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function CardContent({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
"data-slot": "card-content",
|
|
44
|
+
className: cn("px-6 group-data-[size=sm]/card:px-4", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function CardFooter({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx("div", {
|
|
50
|
+
"data-slot": "card-footer",
|
|
51
|
+
className: cn("flex items-center rounded-b-xl px-6 group-data-[size=sm]/card:px-4 [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4", className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Button } from "./button.mjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/carousel.d.ts
|
|
7
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
8
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
9
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
10
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
11
|
+
type CarouselProps = {
|
|
12
|
+
opts?: CarouselOptions;
|
|
13
|
+
plugins?: CarouselPlugin;
|
|
14
|
+
orientation?: 'horizontal' | 'vertical';
|
|
15
|
+
setApi?: (api: CarouselApi) => void;
|
|
16
|
+
};
|
|
17
|
+
type CarouselContextProps = {
|
|
18
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
19
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
20
|
+
scrollPrev: () => void;
|
|
21
|
+
scrollNext: () => void;
|
|
22
|
+
canScrollPrev: boolean;
|
|
23
|
+
canScrollNext: boolean;
|
|
24
|
+
} & CarouselProps;
|
|
25
|
+
declare function useCarousel(): CarouselContextProps;
|
|
26
|
+
declare function Carousel({
|
|
27
|
+
orientation,
|
|
28
|
+
opts,
|
|
29
|
+
setApi,
|
|
30
|
+
plugins,
|
|
31
|
+
className,
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<'div'> & CarouselProps): _$react_jsx_runtime0.JSX.Element;
|
|
35
|
+
declare function CarouselContent({
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
39
|
+
declare function CarouselItem({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}: React.ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
43
|
+
declare function CarouselPrevious({
|
|
44
|
+
className,
|
|
45
|
+
variant,
|
|
46
|
+
size,
|
|
47
|
+
...props
|
|
48
|
+
}: React.ComponentProps<typeof Button>): _$react_jsx_runtime0.JSX.Element;
|
|
49
|
+
declare function CarouselNext({
|
|
50
|
+
className,
|
|
51
|
+
variant,
|
|
52
|
+
size,
|
|
53
|
+
...props
|
|
54
|
+
}: React.ComponentProps<typeof Button>): _$react_jsx_runtime0.JSX.Element;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.mjs";
|
|
3
|
+
import { Button } from "./button.mjs";
|
|
4
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
8
|
+
//#region src/components/carousel.tsx
|
|
9
|
+
const CarouselContext = React.createContext(null);
|
|
10
|
+
function useCarousel() {
|
|
11
|
+
const context = React.useContext(CarouselContext);
|
|
12
|
+
if (!context) throw new Error("useCarousel must be used within a <Carousel />");
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
|
|
16
|
+
const [carouselRef, api] = useEmblaCarousel({
|
|
17
|
+
...opts,
|
|
18
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
19
|
+
}, plugins);
|
|
20
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
21
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
22
|
+
const onSelect = React.useCallback((api) => {
|
|
23
|
+
if (!api) return;
|
|
24
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
25
|
+
setCanScrollNext(api.canScrollNext());
|
|
26
|
+
}, []);
|
|
27
|
+
const scrollPrev = React.useCallback(() => {
|
|
28
|
+
api?.scrollPrev();
|
|
29
|
+
}, [api]);
|
|
30
|
+
const scrollNext = React.useCallback(() => {
|
|
31
|
+
api?.scrollNext();
|
|
32
|
+
}, [api]);
|
|
33
|
+
const handleKeyDown = React.useCallback((event) => {
|
|
34
|
+
if (event.key === "ArrowLeft") {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
scrollPrev();
|
|
37
|
+
} else if (event.key === "ArrowRight") {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
scrollNext();
|
|
40
|
+
}
|
|
41
|
+
}, [scrollPrev, scrollNext]);
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
if (!api || !setApi) return;
|
|
44
|
+
setApi(api);
|
|
45
|
+
}, [api, setApi]);
|
|
46
|
+
React.useEffect(() => {
|
|
47
|
+
if (!api) return;
|
|
48
|
+
onSelect(api);
|
|
49
|
+
api.on("reInit", onSelect);
|
|
50
|
+
api.on("select", onSelect);
|
|
51
|
+
return () => {
|
|
52
|
+
api?.off("select", onSelect);
|
|
53
|
+
};
|
|
54
|
+
}, [api, onSelect]);
|
|
55
|
+
return /* @__PURE__ */ jsx(CarouselContext.Provider, {
|
|
56
|
+
value: {
|
|
57
|
+
carouselRef,
|
|
58
|
+
api,
|
|
59
|
+
opts,
|
|
60
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
61
|
+
scrollPrev,
|
|
62
|
+
scrollNext,
|
|
63
|
+
canScrollPrev,
|
|
64
|
+
canScrollNext
|
|
65
|
+
},
|
|
66
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
67
|
+
onKeyDownCapture: handleKeyDown,
|
|
68
|
+
className: cn("relative", className),
|
|
69
|
+
role: "region",
|
|
70
|
+
"aria-roledescription": "carousel",
|
|
71
|
+
"data-slot": "carousel",
|
|
72
|
+
...props,
|
|
73
|
+
children
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function CarouselContent({ className, ...props }) {
|
|
78
|
+
const { carouselRef, orientation } = useCarousel();
|
|
79
|
+
return /* @__PURE__ */ jsx("div", {
|
|
80
|
+
ref: carouselRef,
|
|
81
|
+
className: "overflow-hidden",
|
|
82
|
+
"data-slot": "carousel-content",
|
|
83
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
84
|
+
className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
|
|
85
|
+
...props
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function CarouselItem({ className, ...props }) {
|
|
90
|
+
const { orientation } = useCarousel();
|
|
91
|
+
return /* @__PURE__ */ jsx("div", {
|
|
92
|
+
role: "group",
|
|
93
|
+
"aria-roledescription": "slide",
|
|
94
|
+
"data-slot": "carousel-item",
|
|
95
|
+
className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className),
|
|
96
|
+
...props
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function CarouselPrevious({ className, variant = "outline", size = "icon-sm", ...props }) {
|
|
100
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
101
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
102
|
+
"data-slot": "carousel-previous",
|
|
103
|
+
variant,
|
|
104
|
+
size,
|
|
105
|
+
className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
106
|
+
disabled: !canScrollPrev,
|
|
107
|
+
onClick: scrollPrev,
|
|
108
|
+
...props,
|
|
109
|
+
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
110
|
+
className: "sr-only",
|
|
111
|
+
children: "Previous slide"
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function CarouselNext({ className, variant = "outline", size = "icon-sm", ...props }) {
|
|
116
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
117
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
118
|
+
"data-slot": "carousel-next",
|
|
119
|
+
variant,
|
|
120
|
+
size,
|
|
121
|
+
className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
122
|
+
disabled: !canScrollNext,
|
|
123
|
+
onClick: scrollNext,
|
|
124
|
+
...props,
|
|
125
|
+
children: [/* @__PURE__ */ jsx(ChevronRightIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
126
|
+
className: "sr-only",
|
|
127
|
+
children: "Next slide"
|
|
128
|
+
})]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|