create-disposabl-app 0.10.0 → 0.10.1
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/disposabl.js +1 -1
- package/dist/index.js +2 -2
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.api-keys.tsx +1 -1
- package/dist/templates/default/bun.lock +16 -1230
- package/dist/templates/default/packages/cli/README.md +9 -24
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +1 -1
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +1 -1
- package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +71 -13
- package/dist/templates/default/packages/disposabl-kit/package.json +0 -12
- package/package.json +1 -1
- package/dist/templates/default/apps/web/src/components/connections/expo-connection.tsx +0 -97
- package/dist/templates/default/apps/web/src/components/connections/provider-logo.tsx +0 -44
- package/dist/templates/default/apps/web/src/components/connections/use-connection-setup.ts +0 -169
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/accordion.tsx +0 -77
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert-dialog.tsx +0 -185
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert.tsx +0 -75
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/aspect-ratio.tsx +0 -22
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/attachment.tsx +0 -207
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/avatar.tsx +0 -106
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/badge.tsx +0 -51
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/breadcrumb.tsx +0 -121
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/bubble.tsx +0 -127
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/button-group.tsx +0 -87
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/calendar.tsx +0 -241
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/carousel.tsx +0 -239
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/chart.tsx +0 -368
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/checkbox.tsx +0 -27
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/code-block.tsx +0 -243
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/collapsible.tsx +0 -19
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/combobox.tsx +0 -300
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/command.tsx +0 -194
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/context-menu.tsx +0 -271
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/dialog.tsx +0 -156
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/direction.tsx +0 -4
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/drawer.tsx +0 -224
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/dropdown-menu.tsx +0 -269
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/empty.tsx +0 -103
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/hover-card.tsx +0 -50
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-group.tsx +0 -158
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-otp.tsx +0 -83
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/item.tsx +0 -201
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/kbd.tsx +0 -26
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/marker.tsx +0 -70
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/menubar.tsx +0 -284
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/message-scroller.tsx +0 -128
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/message.tsx +0 -91
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/native-select.tsx +0 -64
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/navigation-menu.tsx +0 -170
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/pagination.tsx +0 -133
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/popover.tsx +0 -87
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/progress.tsx +0 -82
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/questionnaire.tsx +0 -330
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/radio-group.tsx +0 -35
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/resizable.tsx +0 -49
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/scroll-area.tsx +0 -51
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/select.tsx +0 -201
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/sheet.tsx +0 -132
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/sidebar.tsx +0 -723
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/skeleton.tsx +0 -13
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/slider.tsx +0 -51
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/switch.tsx +0 -31
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/table.tsx +0 -113
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/tabs.tsx +0 -81
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/textarea.tsx +0 -17
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/toast.tsx +0 -229
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle-group.tsx +0 -87
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle.tsx +0 -42
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/tooltip.tsx +0 -65
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/trace.tsx +0 -161
- package/dist/templates/default/packages/disposabl-kit/client/hooks/use-mobile.ts +0 -21
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
3
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
|
|
5
|
-
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
6
|
-
|
|
7
|
-
function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
|
|
8
|
-
return (
|
|
9
|
-
<nav
|
|
10
|
-
aria-label="breadcrumb"
|
|
11
|
-
data-slot="breadcrumb"
|
|
12
|
-
className={cn(className)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
19
|
-
return (
|
|
20
|
-
<ol
|
|
21
|
-
data-slot="breadcrumb-list"
|
|
22
|
-
className={cn(
|
|
23
|
-
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5",
|
|
24
|
-
className,
|
|
25
|
-
)}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
32
|
-
return (
|
|
33
|
-
<li
|
|
34
|
-
data-slot="breadcrumb-item"
|
|
35
|
-
className={cn("inline-flex items-center gap-1.5", className)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function BreadcrumbLink({
|
|
42
|
-
className,
|
|
43
|
-
render,
|
|
44
|
-
...props
|
|
45
|
-
}: useRender.ComponentProps<"a">) {
|
|
46
|
-
return useRender({
|
|
47
|
-
defaultTagName: "a",
|
|
48
|
-
props: mergeProps<"a">(
|
|
49
|
-
{
|
|
50
|
-
className: cn("transition-colors hover:text-foreground", className),
|
|
51
|
-
},
|
|
52
|
-
props,
|
|
53
|
-
),
|
|
54
|
-
render,
|
|
55
|
-
state: {
|
|
56
|
-
slot: "breadcrumb-link",
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
62
|
-
return (
|
|
63
|
-
<span
|
|
64
|
-
data-slot="breadcrumb-page"
|
|
65
|
-
role="link"
|
|
66
|
-
aria-disabled="true"
|
|
67
|
-
aria-current="page"
|
|
68
|
-
className={cn("font-normal text-foreground", className)}
|
|
69
|
-
{...props}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function BreadcrumbSeparator({
|
|
75
|
-
children,
|
|
76
|
-
className,
|
|
77
|
-
...props
|
|
78
|
-
}: React.ComponentProps<"li">) {
|
|
79
|
-
return (
|
|
80
|
-
<li
|
|
81
|
-
data-slot="breadcrumb-separator"
|
|
82
|
-
role="presentation"
|
|
83
|
-
aria-hidden="true"
|
|
84
|
-
className={cn("[&>svg]:size-3.5", className)}
|
|
85
|
-
{...props}
|
|
86
|
-
>
|
|
87
|
-
{children ?? <ChevronRightIcon />}
|
|
88
|
-
</li>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function BreadcrumbEllipsis({
|
|
93
|
-
className,
|
|
94
|
-
...props
|
|
95
|
-
}: React.ComponentProps<"span">) {
|
|
96
|
-
return (
|
|
97
|
-
<span
|
|
98
|
-
data-slot="breadcrumb-ellipsis"
|
|
99
|
-
role="presentation"
|
|
100
|
-
aria-hidden="true"
|
|
101
|
-
className={cn(
|
|
102
|
-
"flex size-5 items-center justify-center [&>svg]:size-4",
|
|
103
|
-
className,
|
|
104
|
-
)}
|
|
105
|
-
{...props}
|
|
106
|
-
>
|
|
107
|
-
<MoreHorizontalIcon />
|
|
108
|
-
<span className="sr-only">More</span>
|
|
109
|
-
</span>
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export {
|
|
114
|
-
Breadcrumb,
|
|
115
|
-
BreadcrumbList,
|
|
116
|
-
BreadcrumbItem,
|
|
117
|
-
BreadcrumbLink,
|
|
118
|
-
BreadcrumbPage,
|
|
119
|
-
BreadcrumbSeparator,
|
|
120
|
-
BreadcrumbEllipsis,
|
|
121
|
-
};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
3
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
-
import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
|
|
6
|
-
|
|
7
|
-
function BubbleGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
8
|
-
return (
|
|
9
|
-
<div
|
|
10
|
-
data-slot="bubble-group"
|
|
11
|
-
className={cn("flex min-w-0 flex-col gap-2", className)}
|
|
12
|
-
{...props}
|
|
13
|
-
/>
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const bubbleVariants = cva(
|
|
18
|
-
"group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",
|
|
19
|
-
{
|
|
20
|
-
variants: {
|
|
21
|
-
variant: {
|
|
22
|
-
default:
|
|
23
|
-
"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",
|
|
24
|
-
secondary:
|
|
25
|
-
"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",
|
|
26
|
-
muted:
|
|
27
|
-
"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",
|
|
28
|
-
tinted:
|
|
29
|
-
"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",
|
|
30
|
-
outline:
|
|
31
|
-
"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",
|
|
32
|
-
ghost:
|
|
33
|
-
"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",
|
|
34
|
-
destructive:
|
|
35
|
-
"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
defaultVariants: {
|
|
39
|
-
variant: "default",
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
function Bubble({
|
|
45
|
-
variant = "default",
|
|
46
|
-
align = "start",
|
|
47
|
-
className,
|
|
48
|
-
...props
|
|
49
|
-
}: React.ComponentProps<"div"> &
|
|
50
|
-
VariantProps<typeof bubbleVariants> & {
|
|
51
|
-
align?: "start" | "end";
|
|
52
|
-
}) {
|
|
53
|
-
return (
|
|
54
|
-
<div
|
|
55
|
-
data-slot="bubble"
|
|
56
|
-
data-variant={variant}
|
|
57
|
-
data-align={align}
|
|
58
|
-
className={cn(bubbleVariants({ variant }), className)}
|
|
59
|
-
{...props}
|
|
60
|
-
/>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function BubbleContent({
|
|
65
|
-
className,
|
|
66
|
-
render,
|
|
67
|
-
...props
|
|
68
|
-
}: useRender.ComponentProps<"div">) {
|
|
69
|
-
return useRender({
|
|
70
|
-
defaultTagName: "div",
|
|
71
|
-
props: mergeProps<"div">(
|
|
72
|
-
{
|
|
73
|
-
className: cn(
|
|
74
|
-
"w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",
|
|
75
|
-
className,
|
|
76
|
-
),
|
|
77
|
-
},
|
|
78
|
-
props,
|
|
79
|
-
),
|
|
80
|
-
render,
|
|
81
|
-
state: {
|
|
82
|
-
slot: "bubble-content",
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const bubbleReactionsVariants = cva(
|
|
88
|
-
"absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",
|
|
89
|
-
{
|
|
90
|
-
variants: {
|
|
91
|
-
side: {
|
|
92
|
-
top: "top-0 -translate-y-3/4",
|
|
93
|
-
bottom: "bottom-0 translate-y-3/4",
|
|
94
|
-
},
|
|
95
|
-
align: {
|
|
96
|
-
start: "left-3",
|
|
97
|
-
end: "right-3",
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
defaultVariants: {
|
|
101
|
-
side: "bottom",
|
|
102
|
-
align: "end",
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
function BubbleReactions({
|
|
108
|
-
side = "bottom",
|
|
109
|
-
align = "end",
|
|
110
|
-
className,
|
|
111
|
-
...props
|
|
112
|
-
}: React.ComponentProps<"div"> & {
|
|
113
|
-
align?: "start" | "end";
|
|
114
|
-
side?: "top" | "bottom";
|
|
115
|
-
}) {
|
|
116
|
-
return (
|
|
117
|
-
<div
|
|
118
|
-
data-slot="bubble-reactions"
|
|
119
|
-
data-align={align}
|
|
120
|
-
data-side={side}
|
|
121
|
-
className={cn(bubbleReactionsVariants({ side, align }), className)}
|
|
122
|
-
{...props}
|
|
123
|
-
/>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export { BubbleGroup, Bubble, BubbleContent, BubbleReactions };
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
-
import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
|
|
5
|
-
|
|
6
|
-
import { Separator } from "@disposabl/disposabl-kit/client/components/ui/separator";
|
|
7
|
-
|
|
8
|
-
const buttonGroupVariants = cva(
|
|
9
|
-
"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",
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
orientation: {
|
|
13
|
-
horizontal:
|
|
14
|
-
"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",
|
|
15
|
-
vertical:
|
|
16
|
-
"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
defaultVariants: {
|
|
20
|
-
orientation: "horizontal",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
function ButtonGroup({
|
|
26
|
-
className,
|
|
27
|
-
orientation,
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
|
|
30
|
-
return (
|
|
31
|
-
<div
|
|
32
|
-
role="group"
|
|
33
|
-
data-slot="button-group"
|
|
34
|
-
data-orientation={orientation}
|
|
35
|
-
className={cn(buttonGroupVariants({ orientation }), className)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function ButtonGroupText({
|
|
42
|
-
className,
|
|
43
|
-
render,
|
|
44
|
-
...props
|
|
45
|
-
}: useRender.ComponentProps<"div">) {
|
|
46
|
-
return useRender({
|
|
47
|
-
defaultTagName: "div",
|
|
48
|
-
props: mergeProps<"div">(
|
|
49
|
-
{
|
|
50
|
-
className: cn(
|
|
51
|
-
"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",
|
|
52
|
-
className,
|
|
53
|
-
),
|
|
54
|
-
},
|
|
55
|
-
props,
|
|
56
|
-
),
|
|
57
|
-
render,
|
|
58
|
-
state: {
|
|
59
|
-
slot: "button-group-text",
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function ButtonGroupSeparator({
|
|
65
|
-
className,
|
|
66
|
-
orientation = "vertical",
|
|
67
|
-
...props
|
|
68
|
-
}: React.ComponentProps<typeof Separator>) {
|
|
69
|
-
return (
|
|
70
|
-
<Separator
|
|
71
|
-
data-slot="button-group-separator"
|
|
72
|
-
orientation={orientation}
|
|
73
|
-
className={cn(
|
|
74
|
-
"relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto",
|
|
75
|
-
className,
|
|
76
|
-
)}
|
|
77
|
-
{...props}
|
|
78
|
-
/>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export {
|
|
83
|
-
ButtonGroup,
|
|
84
|
-
ButtonGroupSeparator,
|
|
85
|
-
ButtonGroupText,
|
|
86
|
-
buttonGroupVariants,
|
|
87
|
-
};
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
|
|
5
|
-
import {
|
|
6
|
-
DayPicker,
|
|
7
|
-
getDefaultClassNames,
|
|
8
|
-
type DayButton,
|
|
9
|
-
type Locale,
|
|
10
|
-
} from "react-day-picker";
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
Button,
|
|
14
|
-
buttonVariants,
|
|
15
|
-
} from "@disposabl/disposabl-kit/client/components/ui/button";
|
|
16
|
-
import {
|
|
17
|
-
ChevronLeftIcon,
|
|
18
|
-
ChevronRightIcon,
|
|
19
|
-
ChevronDownIcon,
|
|
20
|
-
} from "lucide-react";
|
|
21
|
-
|
|
22
|
-
function Calendar({
|
|
23
|
-
className,
|
|
24
|
-
classNames,
|
|
25
|
-
showOutsideDays = true,
|
|
26
|
-
captionLayout = "label",
|
|
27
|
-
buttonVariant = "ghost",
|
|
28
|
-
locale,
|
|
29
|
-
formatters,
|
|
30
|
-
components,
|
|
31
|
-
...props
|
|
32
|
-
}: React.ComponentProps<typeof DayPicker> & {
|
|
33
|
-
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
34
|
-
}) {
|
|
35
|
-
const defaultClassNames = getDefaultClassNames();
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<DayPicker
|
|
39
|
-
showOutsideDays={showOutsideDays}
|
|
40
|
-
className={cn(
|
|
41
|
-
"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",
|
|
42
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
43
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
44
|
-
className,
|
|
45
|
-
)}
|
|
46
|
-
captionLayout={captionLayout}
|
|
47
|
-
locale={locale}
|
|
48
|
-
formatters={{
|
|
49
|
-
formatMonthDropdown: (date) =>
|
|
50
|
-
date.toLocaleString(locale?.code, { month: "short" }),
|
|
51
|
-
...formatters,
|
|
52
|
-
}}
|
|
53
|
-
classNames={{
|
|
54
|
-
root: cn("w-fit", defaultClassNames.root),
|
|
55
|
-
months: cn(
|
|
56
|
-
"relative flex flex-col gap-4 md:flex-row",
|
|
57
|
-
defaultClassNames.months,
|
|
58
|
-
),
|
|
59
|
-
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
60
|
-
nav: cn(
|
|
61
|
-
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
62
|
-
defaultClassNames.nav,
|
|
63
|
-
),
|
|
64
|
-
button_previous: cn(
|
|
65
|
-
buttonVariants({ variant: buttonVariant }),
|
|
66
|
-
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
67
|
-
defaultClassNames.button_previous,
|
|
68
|
-
),
|
|
69
|
-
button_next: cn(
|
|
70
|
-
buttonVariants({ variant: buttonVariant }),
|
|
71
|
-
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
72
|
-
defaultClassNames.button_next,
|
|
73
|
-
),
|
|
74
|
-
month_caption: cn(
|
|
75
|
-
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
76
|
-
defaultClassNames.month_caption,
|
|
77
|
-
),
|
|
78
|
-
dropdowns: cn(
|
|
79
|
-
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
80
|
-
defaultClassNames.dropdowns,
|
|
81
|
-
),
|
|
82
|
-
dropdown_root: cn(
|
|
83
|
-
"relative rounded-(--cell-radius)",
|
|
84
|
-
defaultClassNames.dropdown_root,
|
|
85
|
-
),
|
|
86
|
-
dropdown: cn(
|
|
87
|
-
"absolute inset-0 bg-popover opacity-0",
|
|
88
|
-
defaultClassNames.dropdown,
|
|
89
|
-
),
|
|
90
|
-
caption_label: cn(
|
|
91
|
-
"font-medium select-none",
|
|
92
|
-
captionLayout === "label"
|
|
93
|
-
? "text-sm"
|
|
94
|
-
: "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
95
|
-
defaultClassNames.caption_label,
|
|
96
|
-
),
|
|
97
|
-
month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
|
|
98
|
-
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
99
|
-
weekday: cn(
|
|
100
|
-
"flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
|
|
101
|
-
defaultClassNames.weekday,
|
|
102
|
-
),
|
|
103
|
-
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
104
|
-
week_number_header: cn(
|
|
105
|
-
"w-(--cell-size) select-none",
|
|
106
|
-
defaultClassNames.week_number_header,
|
|
107
|
-
),
|
|
108
|
-
week_number: cn(
|
|
109
|
-
"text-[0.8rem] text-muted-foreground select-none",
|
|
110
|
-
defaultClassNames.week_number,
|
|
111
|
-
),
|
|
112
|
-
day: cn(
|
|
113
|
-
"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)",
|
|
114
|
-
props.showWeekNumber
|
|
115
|
-
? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)"
|
|
116
|
-
: "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
|
|
117
|
-
defaultClassNames.day,
|
|
118
|
-
),
|
|
119
|
-
range_start: cn(
|
|
120
|
-
"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",
|
|
121
|
-
defaultClassNames.range_start,
|
|
122
|
-
),
|
|
123
|
-
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
124
|
-
range_end: cn(
|
|
125
|
-
"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",
|
|
126
|
-
defaultClassNames.range_end,
|
|
127
|
-
),
|
|
128
|
-
today: cn(
|
|
129
|
-
"rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
|
|
130
|
-
defaultClassNames.today,
|
|
131
|
-
),
|
|
132
|
-
outside: cn(
|
|
133
|
-
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
134
|
-
defaultClassNames.outside,
|
|
135
|
-
),
|
|
136
|
-
disabled: cn(
|
|
137
|
-
"text-muted-foreground opacity-50",
|
|
138
|
-
defaultClassNames.disabled,
|
|
139
|
-
),
|
|
140
|
-
hidden: cn("invisible", defaultClassNames.hidden),
|
|
141
|
-
...classNames,
|
|
142
|
-
}}
|
|
143
|
-
components={{
|
|
144
|
-
Root: ({ className: rootClassName, rootRef, ...rootProps }) => {
|
|
145
|
-
return (
|
|
146
|
-
<div
|
|
147
|
-
data-slot="calendar"
|
|
148
|
-
ref={rootRef}
|
|
149
|
-
className={cn(rootClassName)}
|
|
150
|
-
{...rootProps}
|
|
151
|
-
/>
|
|
152
|
-
);
|
|
153
|
-
},
|
|
154
|
-
Chevron: ({
|
|
155
|
-
className: chevronClassName,
|
|
156
|
-
orientation,
|
|
157
|
-
...chevronProps
|
|
158
|
-
}) => {
|
|
159
|
-
if (orientation === "left") {
|
|
160
|
-
return (
|
|
161
|
-
<ChevronLeftIcon
|
|
162
|
-
className={cn("size-4", chevronClassName)}
|
|
163
|
-
{...chevronProps}
|
|
164
|
-
/>
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (orientation === "right") {
|
|
169
|
-
return (
|
|
170
|
-
<ChevronRightIcon
|
|
171
|
-
className={cn("size-4", chevronClassName)}
|
|
172
|
-
{...chevronProps}
|
|
173
|
-
/>
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return (
|
|
178
|
-
<ChevronDownIcon
|
|
179
|
-
className={cn("size-4", chevronClassName)}
|
|
180
|
-
{...chevronProps}
|
|
181
|
-
/>
|
|
182
|
-
);
|
|
183
|
-
},
|
|
184
|
-
DayButton: (dayButtonProps) => (
|
|
185
|
-
<CalendarDayButton locale={locale} {...dayButtonProps} />
|
|
186
|
-
),
|
|
187
|
-
WeekNumber: ({ children, ...weekNumberProps }) => {
|
|
188
|
-
return (
|
|
189
|
-
<td {...weekNumberProps}>
|
|
190
|
-
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
191
|
-
{children}
|
|
192
|
-
</div>
|
|
193
|
-
</td>
|
|
194
|
-
);
|
|
195
|
-
},
|
|
196
|
-
...components,
|
|
197
|
-
}}
|
|
198
|
-
{...props}
|
|
199
|
-
/>
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function CalendarDayButton({
|
|
204
|
-
className,
|
|
205
|
-
day,
|
|
206
|
-
modifiers,
|
|
207
|
-
locale,
|
|
208
|
-
...props
|
|
209
|
-
}: React.ComponentProps<typeof DayButton> & { locale?: Partial<Locale> }) {
|
|
210
|
-
const defaultClassNames = getDefaultClassNames();
|
|
211
|
-
|
|
212
|
-
const ref = React.useRef<HTMLButtonElement>(null);
|
|
213
|
-
React.useEffect(() => {
|
|
214
|
-
if (modifiers.focused) ref.current?.focus();
|
|
215
|
-
}, [modifiers.focused]);
|
|
216
|
-
|
|
217
|
-
return (
|
|
218
|
-
<Button
|
|
219
|
-
variant="ghost"
|
|
220
|
-
size="icon"
|
|
221
|
-
data-day={day.date.toLocaleDateString(locale?.code)}
|
|
222
|
-
data-selected-single={
|
|
223
|
-
modifiers.selected &&
|
|
224
|
-
!modifiers.range_start &&
|
|
225
|
-
!modifiers.range_end &&
|
|
226
|
-
!modifiers.range_middle
|
|
227
|
-
}
|
|
228
|
-
data-range-start={modifiers.range_start}
|
|
229
|
-
data-range-end={modifiers.range_end}
|
|
230
|
-
data-range-middle={modifiers.range_middle}
|
|
231
|
-
className={cn(
|
|
232
|
-
"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",
|
|
233
|
-
defaultClassNames.day,
|
|
234
|
-
className,
|
|
235
|
-
)}
|
|
236
|
-
{...props}
|
|
237
|
-
/>
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export { Calendar, CalendarDayButton };
|