rusty-replay 0.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/.eslintrc.js +10 -0
- package/.vscode/settings.json +3 -0
- package/README.md +92 -0
- package/apps/web/README.md +11 -0
- package/apps/web/api/auth/keys.ts +3 -0
- package/apps/web/api/auth/types.ts +25 -0
- package/apps/web/api/auth/use-query-profile.ts +19 -0
- package/apps/web/api/auth/use-sign-in.ts +24 -0
- package/apps/web/api/axios.ts +122 -0
- package/apps/web/api/error-code.ts +36 -0
- package/apps/web/api/event/keys.ts +14 -0
- package/apps/web/api/event/types.ts +91 -0
- package/apps/web/api/event/use-mutation-event-assignee.ts +103 -0
- package/apps/web/api/event/use-mutation-event-priority.ts +97 -0
- package/apps/web/api/event/use-mutation-event-status.ts +198 -0
- package/apps/web/api/event/use-query-event-detail.ts +25 -0
- package/apps/web/api/event/use-query-event-list.ts +42 -0
- package/apps/web/api/health-check/index.ts +21 -0
- package/apps/web/api/project/keys.ts +4 -0
- package/apps/web/api/project/types.ts +28 -0
- package/apps/web/api/project/use-create-project.ts +30 -0
- package/apps/web/api/project/use-query-project-list.ts +19 -0
- package/apps/web/api/project/use-query-project-users.ts +23 -0
- package/apps/web/api/types.ts +44 -0
- package/apps/web/app/(auth)/layout.tsx +5 -0
- package/apps/web/app/(auth)/sign-in/page.tsx +20 -0
- package/apps/web/app/(auth)/sign-up/page.tsx +5 -0
- package/apps/web/app/(project)/project/[project_id]/issues/[issue_id]/page.tsx +17 -0
- package/apps/web/app/(project)/project/[project_id]/issues/page.tsx +15 -0
- package/apps/web/app/(project)/project/[project_id]/page.tsx +10 -0
- package/apps/web/app/(project)/project/page.tsx +10 -0
- package/apps/web/app/(report)/error-list/page.tsx +7 -0
- package/apps/web/app/favicon.ico +0 -0
- package/apps/web/app/layout.tsx +35 -0
- package/apps/web/app/page.tsx +3 -0
- package/apps/web/components/.gitkeep +0 -0
- package/apps/web/components/event-list/event-detail.tsx +242 -0
- package/apps/web/components/event-list/event-list.tsx +376 -0
- package/apps/web/components/event-list/preview.tsx +573 -0
- package/apps/web/components/layouts/default-layout.tsx +59 -0
- package/apps/web/components/login-form.tsx +124 -0
- package/apps/web/components/project/create-project.tsx +130 -0
- package/apps/web/components/project/hooks/use-get-event-params.ts +9 -0
- package/apps/web/components/project/hooks/use-get-project-params.ts +10 -0
- package/apps/web/components/project/project-detail.tsx +240 -0
- package/apps/web/components/project/project-list.tsx +137 -0
- package/apps/web/components/providers.tsx +25 -0
- package/apps/web/components/ui/assignee-dropdown.tsx +176 -0
- package/apps/web/components/ui/event-status-dropdown.tsx +104 -0
- package/apps/web/components/ui/priority-dropdown.tsx +123 -0
- package/apps/web/components/widget/app-sidebar.tsx +225 -0
- package/apps/web/components/widget/nav-main.tsx +73 -0
- package/apps/web/components/widget/nav-projects.tsx +84 -0
- package/apps/web/components/widget/nav-user.tsx +113 -0
- package/apps/web/components.json +20 -0
- package/apps/web/constants/routes.ts +12 -0
- package/apps/web/eslint.config.js +4 -0
- package/apps/web/hooks/use-boolean-state.ts +13 -0
- package/apps/web/lib/.gitkeep +0 -0
- package/apps/web/next-env.d.ts +5 -0
- package/apps/web/next.config.mjs +6 -0
- package/apps/web/package.json +60 -0
- package/apps/web/postcss.config.mjs +1 -0
- package/apps/web/providers/flag-provider.tsx +35 -0
- package/apps/web/providers/query-client-provider.tsx +17 -0
- package/apps/web/providers/telemetry-provider.tsx +12 -0
- package/apps/web/tsconfig.json +24 -0
- package/apps/web/utils/avatar.ts +26 -0
- package/apps/web/utils/date.ts +26 -0
- package/apps/web/utils/front-end-tracer.ts +119 -0
- package/apps/web/utils/schema/project.schema.ts +12 -0
- package/apps/web/utils/span-processor.ts +36 -0
- package/package.json +21 -0
- package/packages/eslint-config/README.md +3 -0
- package/packages/eslint-config/base.js +32 -0
- package/packages/eslint-config/next.js +51 -0
- package/packages/eslint-config/package.json +25 -0
- package/packages/eslint-config/react-internal.js +41 -0
- package/packages/rusty-replay/README.md +165 -0
- package/packages/rusty-replay/package.json +67 -0
- package/packages/rusty-replay/src/environment.ts +27 -0
- package/packages/rusty-replay/src/error-batcher.ts +75 -0
- package/packages/rusty-replay/src/front-end-tracer.ts +86 -0
- package/packages/rusty-replay/src/handler.ts +37 -0
- package/packages/rusty-replay/src/index.ts +8 -0
- package/packages/rusty-replay/src/recorder.ts +71 -0
- package/packages/rusty-replay/src/reporter.ts +115 -0
- package/packages/rusty-replay/src/utils.ts +13 -0
- package/packages/rusty-replay/tsconfig.build.json +13 -0
- package/packages/rusty-replay/tsconfig.json +27 -0
- package/packages/rusty-replay/tsup.config.ts +39 -0
- package/packages/typescript-config/README.md +3 -0
- package/packages/typescript-config/base.json +20 -0
- package/packages/typescript-config/nextjs.json +13 -0
- package/packages/typescript-config/package.json +9 -0
- package/packages/typescript-config/react-library.json +8 -0
- package/packages/ui/components.json +20 -0
- package/packages/ui/eslint.config.js +4 -0
- package/packages/ui/package.json +60 -0
- package/packages/ui/postcss.config.mjs +6 -0
- package/packages/ui/src/components/.gitkeep +0 -0
- package/packages/ui/src/components/avatar.tsx +53 -0
- package/packages/ui/src/components/badge.tsx +46 -0
- package/packages/ui/src/components/breadcrumb.tsx +109 -0
- package/packages/ui/src/components/button.tsx +59 -0
- package/packages/ui/src/components/calendar.tsx +75 -0
- package/packages/ui/src/components/calendars/date-picker.tsx +43 -0
- package/packages/ui/src/components/calendars/date-range-picker.tsx +79 -0
- package/packages/ui/src/components/card.tsx +92 -0
- package/packages/ui/src/components/checkbox.tsx +32 -0
- package/packages/ui/src/components/collapsible.tsx +33 -0
- package/packages/ui/src/components/dialog.tsx +135 -0
- package/packages/ui/src/components/dialogs/confirmation-modal.tsx +216 -0
- package/packages/ui/src/components/dropdown-menu.tsx +261 -0
- package/packages/ui/src/components/input.tsx +30 -0
- package/packages/ui/src/components/label.tsx +24 -0
- package/packages/ui/src/components/login-form.tsx +68 -0
- package/packages/ui/src/components/mode-switcher.tsx +34 -0
- package/packages/ui/src/components/popover.tsx +48 -0
- package/packages/ui/src/components/scroll-area.tsx +58 -0
- package/packages/ui/src/components/select.tsx +185 -0
- package/packages/ui/src/components/separator.tsx +28 -0
- package/packages/ui/src/components/sheet.tsx +139 -0
- package/packages/ui/src/components/sidebar.tsx +726 -0
- package/packages/ui/src/components/skeleton.tsx +13 -0
- package/packages/ui/src/components/sonner.tsx +25 -0
- package/packages/ui/src/components/table.tsx +116 -0
- package/packages/ui/src/components/tabs.tsx +66 -0
- package/packages/ui/src/components/team-switcher.tsx +91 -0
- package/packages/ui/src/components/textarea.tsx +18 -0
- package/packages/ui/src/components/tooltip.tsx +61 -0
- package/packages/ui/src/hooks/.gitkeep +0 -0
- package/packages/ui/src/hooks/use-meta-color.ts +28 -0
- package/packages/ui/src/hooks/use-mobile.ts +19 -0
- package/packages/ui/src/lib/utils.ts +6 -0
- package/packages/ui/src/styles/globals.css +138 -0
- package/packages/ui/tsconfig.json +13 -0
- package/packages/ui/tsconfig.lint.json +8 -0
- package/pnpm-workspace.yaml +4 -0
- package/tsconfig.json +4 -0
- package/turbo.json +21 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import * as React from "react"
|
4
|
+
import { ChevronLeft, ChevronRight } from "lucide-react"
|
5
|
+
import { DayPicker } from "react-day-picker"
|
6
|
+
|
7
|
+
import { cn } from "@workspace/ui/lib/utils"
|
8
|
+
import { buttonVariants } from "@workspace/ui/components/button"
|
9
|
+
|
10
|
+
function Calendar({
|
11
|
+
className,
|
12
|
+
classNames,
|
13
|
+
showOutsideDays = true,
|
14
|
+
...props
|
15
|
+
}: React.ComponentProps<typeof DayPicker>) {
|
16
|
+
return (
|
17
|
+
<DayPicker
|
18
|
+
showOutsideDays={showOutsideDays}
|
19
|
+
className={cn("p-3", className)}
|
20
|
+
classNames={{
|
21
|
+
months: "flex flex-col sm:flex-row gap-2",
|
22
|
+
month: "flex flex-col gap-4",
|
23
|
+
caption: "flex justify-center pt-1 relative items-center w-full",
|
24
|
+
caption_label: "text-sm font-medium",
|
25
|
+
nav: "flex items-center gap-1",
|
26
|
+
nav_button: cn(
|
27
|
+
buttonVariants({ variant: "outline" }),
|
28
|
+
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
29
|
+
),
|
30
|
+
nav_button_previous: "absolute left-1",
|
31
|
+
nav_button_next: "absolute right-1",
|
32
|
+
table: "w-full border-collapse space-x-1",
|
33
|
+
head_row: "flex",
|
34
|
+
head_cell:
|
35
|
+
"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",
|
36
|
+
row: "flex w-full mt-2",
|
37
|
+
cell: cn(
|
38
|
+
"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",
|
39
|
+
props.mode === "range"
|
40
|
+
? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md"
|
41
|
+
: "[&:has([aria-selected])]:rounded-md"
|
42
|
+
),
|
43
|
+
day: cn(
|
44
|
+
buttonVariants({ variant: "ghost" }),
|
45
|
+
"size-8 p-0 font-normal aria-selected:opacity-100"
|
46
|
+
),
|
47
|
+
day_range_start:
|
48
|
+
"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",
|
49
|
+
day_range_end:
|
50
|
+
"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",
|
51
|
+
day_selected:
|
52
|
+
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
53
|
+
day_today: "bg-accent text-accent-foreground",
|
54
|
+
day_outside:
|
55
|
+
"day-outside text-muted-foreground aria-selected:text-muted-foreground",
|
56
|
+
day_disabled: "text-muted-foreground opacity-50",
|
57
|
+
day_range_middle:
|
58
|
+
"aria-selected:bg-accent aria-selected:text-accent-foreground",
|
59
|
+
day_hidden: "invisible",
|
60
|
+
...classNames,
|
61
|
+
}}
|
62
|
+
components={{
|
63
|
+
IconLeft: ({ className, ...props }) => (
|
64
|
+
<ChevronLeft className={cn("size-4", className)} {...props} />
|
65
|
+
),
|
66
|
+
IconRight: ({ className, ...props }) => (
|
67
|
+
<ChevronRight className={cn("size-4", className)} {...props} />
|
68
|
+
),
|
69
|
+
}}
|
70
|
+
{...props}
|
71
|
+
/>
|
72
|
+
)
|
73
|
+
}
|
74
|
+
|
75
|
+
export { Calendar }
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { format } from 'date-fns';
|
2
|
+
import { Calendar as CalendarIcon } from 'lucide-react';
|
3
|
+
import {
|
4
|
+
Popover,
|
5
|
+
PopoverContent,
|
6
|
+
PopoverTrigger,
|
7
|
+
} from '@workspace/ui/components/popover';
|
8
|
+
import { Button } from '@workspace/ui/components/button';
|
9
|
+
import { Calendar } from '@workspace/ui/components/calendar';
|
10
|
+
import { cn } from '../../lib/utils';
|
11
|
+
|
12
|
+
type DatePickerProps = {
|
13
|
+
date: Date | undefined;
|
14
|
+
onChange: (date: Date | undefined) => void;
|
15
|
+
placeholder: string;
|
16
|
+
};
|
17
|
+
|
18
|
+
export function DatePicker({ date, onChange, placeholder }: DatePickerProps) {
|
19
|
+
return (
|
20
|
+
<Popover>
|
21
|
+
<PopoverTrigger asChild>
|
22
|
+
<Button
|
23
|
+
variant="outline"
|
24
|
+
className={cn(
|
25
|
+
'w-[200px] justify-start text-left font-normal',
|
26
|
+
!date && 'text-muted-foreground'
|
27
|
+
)}
|
28
|
+
>
|
29
|
+
<CalendarIcon className="mr-2 h-4 w-4" />
|
30
|
+
{date ? format(date, 'PPP') : <span>{placeholder}</span>}
|
31
|
+
</Button>
|
32
|
+
</PopoverTrigger>
|
33
|
+
<PopoverContent className="w-auto p-0">
|
34
|
+
<Calendar
|
35
|
+
mode="single"
|
36
|
+
selected={date ?? undefined}
|
37
|
+
onSelect={onChange}
|
38
|
+
initialFocus
|
39
|
+
/>
|
40
|
+
</PopoverContent>
|
41
|
+
</Popover>
|
42
|
+
);
|
43
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import React, { useState, useEffect } from 'react';
|
4
|
+
import { format } from 'date-fns';
|
5
|
+
import { ko } from 'date-fns/locale';
|
6
|
+
import { Calendar as CalendarIcon } from 'lucide-react';
|
7
|
+
import { DateRange } from 'react-day-picker';
|
8
|
+
|
9
|
+
import { cn } from '@workspace/ui/lib/utils';
|
10
|
+
import { Button } from '@workspace/ui/components/button';
|
11
|
+
import { Calendar } from '@workspace/ui/components/calendar';
|
12
|
+
import {
|
13
|
+
Popover,
|
14
|
+
PopoverContent,
|
15
|
+
PopoverTrigger,
|
16
|
+
} from '@workspace/ui/components/popover';
|
17
|
+
|
18
|
+
interface DateRangePickerProps {
|
19
|
+
className?: string;
|
20
|
+
dateRange: DateRange | undefined;
|
21
|
+
onDateRangeChange: (range: DateRange | undefined) => void;
|
22
|
+
}
|
23
|
+
|
24
|
+
export function DateRangePicker({
|
25
|
+
className,
|
26
|
+
dateRange,
|
27
|
+
onDateRangeChange,
|
28
|
+
}: DateRangePickerProps) {
|
29
|
+
const [date, setDate] = useState<DateRange | undefined>(dateRange);
|
30
|
+
|
31
|
+
useEffect(() => {
|
32
|
+
setDate(dateRange);
|
33
|
+
}, [dateRange]);
|
34
|
+
|
35
|
+
return (
|
36
|
+
<div className={cn('grid gap-2', className)}>
|
37
|
+
<Popover>
|
38
|
+
<PopoverTrigger asChild>
|
39
|
+
<Button
|
40
|
+
id="date"
|
41
|
+
variant="outline"
|
42
|
+
className={cn(
|
43
|
+
'w-full justify-start text-left font-normal',
|
44
|
+
!date && 'text-muted-foreground'
|
45
|
+
)}
|
46
|
+
>
|
47
|
+
<CalendarIcon className="mr-2 h-4 w-4" />
|
48
|
+
{date?.from ? (
|
49
|
+
date.to ? (
|
50
|
+
<>
|
51
|
+
{format(date.from, 'PPP', { locale: ko })} ~{' '}
|
52
|
+
{format(date.to, 'PPP', { locale: ko })}
|
53
|
+
</>
|
54
|
+
) : (
|
55
|
+
format(date.from, 'PPP', { locale: ko })
|
56
|
+
)
|
57
|
+
) : (
|
58
|
+
<span>기간 선택</span>
|
59
|
+
)}
|
60
|
+
</Button>
|
61
|
+
</PopoverTrigger>
|
62
|
+
<PopoverContent className="w-auto p-0" align="start">
|
63
|
+
<Calendar
|
64
|
+
initialFocus
|
65
|
+
mode="range"
|
66
|
+
defaultMonth={date?.from}
|
67
|
+
selected={date}
|
68
|
+
onSelect={(selectedDate) => {
|
69
|
+
setDate(selectedDate);
|
70
|
+
onDateRangeChange(selectedDate);
|
71
|
+
}}
|
72
|
+
numberOfMonths={2}
|
73
|
+
locale={ko}
|
74
|
+
/>
|
75
|
+
</PopoverContent>
|
76
|
+
</Popover>
|
77
|
+
</div>
|
78
|
+
);
|
79
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
import * as React from "react"
|
2
|
+
|
3
|
+
import { cn } from "@workspace/ui/lib/utils"
|
4
|
+
|
5
|
+
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
6
|
+
return (
|
7
|
+
<div
|
8
|
+
data-slot="card"
|
9
|
+
className={cn(
|
10
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
11
|
+
className
|
12
|
+
)}
|
13
|
+
{...props}
|
14
|
+
/>
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
19
|
+
return (
|
20
|
+
<div
|
21
|
+
data-slot="card-header"
|
22
|
+
className={cn(
|
23
|
+
"@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",
|
24
|
+
className
|
25
|
+
)}
|
26
|
+
{...props}
|
27
|
+
/>
|
28
|
+
)
|
29
|
+
}
|
30
|
+
|
31
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
32
|
+
return (
|
33
|
+
<div
|
34
|
+
data-slot="card-title"
|
35
|
+
className={cn("leading-none font-semibold", className)}
|
36
|
+
{...props}
|
37
|
+
/>
|
38
|
+
)
|
39
|
+
}
|
40
|
+
|
41
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
42
|
+
return (
|
43
|
+
<div
|
44
|
+
data-slot="card-description"
|
45
|
+
className={cn("text-muted-foreground text-sm", className)}
|
46
|
+
{...props}
|
47
|
+
/>
|
48
|
+
)
|
49
|
+
}
|
50
|
+
|
51
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
52
|
+
return (
|
53
|
+
<div
|
54
|
+
data-slot="card-action"
|
55
|
+
className={cn(
|
56
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
57
|
+
className
|
58
|
+
)}
|
59
|
+
{...props}
|
60
|
+
/>
|
61
|
+
)
|
62
|
+
}
|
63
|
+
|
64
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
65
|
+
return (
|
66
|
+
<div
|
67
|
+
data-slot="card-content"
|
68
|
+
className={cn("px-6", className)}
|
69
|
+
{...props}
|
70
|
+
/>
|
71
|
+
)
|
72
|
+
}
|
73
|
+
|
74
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
75
|
+
return (
|
76
|
+
<div
|
77
|
+
data-slot="card-footer"
|
78
|
+
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
|
79
|
+
{...props}
|
80
|
+
/>
|
81
|
+
)
|
82
|
+
}
|
83
|
+
|
84
|
+
export {
|
85
|
+
Card,
|
86
|
+
CardHeader,
|
87
|
+
CardFooter,
|
88
|
+
CardTitle,
|
89
|
+
CardAction,
|
90
|
+
CardDescription,
|
91
|
+
CardContent,
|
92
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import * as React from "react"
|
4
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
|
5
|
+
import { CheckIcon } from "lucide-react"
|
6
|
+
|
7
|
+
import { cn } from "@workspace/ui/lib/utils"
|
8
|
+
|
9
|
+
function Checkbox({
|
10
|
+
className,
|
11
|
+
...props
|
12
|
+
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
13
|
+
return (
|
14
|
+
<CheckboxPrimitive.Root
|
15
|
+
data-slot="checkbox"
|
16
|
+
className={cn(
|
17
|
+
"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",
|
18
|
+
className
|
19
|
+
)}
|
20
|
+
{...props}
|
21
|
+
>
|
22
|
+
<CheckboxPrimitive.Indicator
|
23
|
+
data-slot="checkbox-indicator"
|
24
|
+
className="flex items-center justify-center text-current transition-none"
|
25
|
+
>
|
26
|
+
<CheckIcon className="size-3.5" />
|
27
|
+
</CheckboxPrimitive.Indicator>
|
28
|
+
</CheckboxPrimitive.Root>
|
29
|
+
)
|
30
|
+
}
|
31
|
+
|
32
|
+
export { Checkbox }
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
|
4
|
+
|
5
|
+
function Collapsible({
|
6
|
+
...props
|
7
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
8
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
9
|
+
}
|
10
|
+
|
11
|
+
function CollapsibleTrigger({
|
12
|
+
...props
|
13
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
14
|
+
return (
|
15
|
+
<CollapsiblePrimitive.CollapsibleTrigger
|
16
|
+
data-slot="collapsible-trigger"
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
)
|
20
|
+
}
|
21
|
+
|
22
|
+
function CollapsibleContent({
|
23
|
+
...props
|
24
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
25
|
+
return (
|
26
|
+
<CollapsiblePrimitive.CollapsibleContent
|
27
|
+
data-slot="collapsible-content"
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
)
|
31
|
+
}
|
32
|
+
|
33
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
@@ -0,0 +1,135 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import * as React from 'react';
|
4
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
5
|
+
import { XIcon } from 'lucide-react';
|
6
|
+
|
7
|
+
import { cn } from '@workspace/ui/lib/utils';
|
8
|
+
|
9
|
+
function Dialog({
|
10
|
+
...props
|
11
|
+
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
12
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
13
|
+
}
|
14
|
+
|
15
|
+
function DialogTrigger({
|
16
|
+
...props
|
17
|
+
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
18
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
19
|
+
}
|
20
|
+
|
21
|
+
function DialogPortal({
|
22
|
+
...props
|
23
|
+
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
24
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
25
|
+
}
|
26
|
+
|
27
|
+
function DialogClose({
|
28
|
+
...props
|
29
|
+
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
30
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
31
|
+
}
|
32
|
+
|
33
|
+
function DialogOverlay({
|
34
|
+
className,
|
35
|
+
...props
|
36
|
+
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
37
|
+
return (
|
38
|
+
<DialogPrimitive.Overlay
|
39
|
+
data-slot="dialog-overlay"
|
40
|
+
className={cn(
|
41
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
42
|
+
className
|
43
|
+
)}
|
44
|
+
{...props}
|
45
|
+
/>
|
46
|
+
);
|
47
|
+
}
|
48
|
+
|
49
|
+
function DialogContent({
|
50
|
+
className,
|
51
|
+
children,
|
52
|
+
...props
|
53
|
+
}: React.ComponentProps<typeof DialogPrimitive.Content>) {
|
54
|
+
return (
|
55
|
+
<DialogPortal data-slot="dialog-portal">
|
56
|
+
<DialogOverlay />
|
57
|
+
<DialogPrimitive.Content
|
58
|
+
data-slot="dialog-content"
|
59
|
+
className={cn(
|
60
|
+
'bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
|
61
|
+
className
|
62
|
+
)}
|
63
|
+
{...props}
|
64
|
+
>
|
65
|
+
{children}
|
66
|
+
<DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
|
67
|
+
<XIcon />
|
68
|
+
<span className="sr-only">Close</span>
|
69
|
+
</DialogPrimitive.Close>
|
70
|
+
</DialogPrimitive.Content>
|
71
|
+
</DialogPortal>
|
72
|
+
);
|
73
|
+
}
|
74
|
+
|
75
|
+
function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
76
|
+
return (
|
77
|
+
<div
|
78
|
+
data-slot="dialog-header"
|
79
|
+
className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
|
80
|
+
{...props}
|
81
|
+
/>
|
82
|
+
);
|
83
|
+
}
|
84
|
+
|
85
|
+
function DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
86
|
+
return (
|
87
|
+
<div
|
88
|
+
data-slot="dialog-footer"
|
89
|
+
className={cn(
|
90
|
+
'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
|
91
|
+
className
|
92
|
+
)}
|
93
|
+
{...props}
|
94
|
+
/>
|
95
|
+
);
|
96
|
+
}
|
97
|
+
|
98
|
+
function DialogTitle({
|
99
|
+
className,
|
100
|
+
...props
|
101
|
+
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
102
|
+
return (
|
103
|
+
<DialogPrimitive.Title
|
104
|
+
data-slot="dialog-title"
|
105
|
+
className={cn('text-lg leading-none font-semibold', className)}
|
106
|
+
{...props}
|
107
|
+
/>
|
108
|
+
);
|
109
|
+
}
|
110
|
+
|
111
|
+
function DialogDescription({
|
112
|
+
className,
|
113
|
+
...props
|
114
|
+
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
|
115
|
+
return (
|
116
|
+
<DialogPrimitive.Description
|
117
|
+
data-slot="dialog-description"
|
118
|
+
className={cn('text-muted-foreground text-sm', className)}
|
119
|
+
{...props}
|
120
|
+
/>
|
121
|
+
);
|
122
|
+
}
|
123
|
+
|
124
|
+
export {
|
125
|
+
Dialog,
|
126
|
+
DialogClose,
|
127
|
+
DialogContent,
|
128
|
+
DialogDescription,
|
129
|
+
DialogFooter,
|
130
|
+
DialogHeader,
|
131
|
+
DialogOverlay,
|
132
|
+
DialogPortal,
|
133
|
+
DialogTitle,
|
134
|
+
DialogTrigger,
|
135
|
+
};
|