@chat-js/cli 0.6.0 → 0.6.2

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.
Files changed (154) hide show
  1. package/dist/index.js +17007 -16480
  2. package/package.json +4 -3
  3. package/templates/chat-app/app/(auth)/login/page.tsx +3 -3
  4. package/templates/chat-app/app/(chat)/api/chat/route.ts +4 -60
  5. package/templates/chat-app/app/not-found.tsx +2 -2
  6. package/templates/chat-app/chat.config.ts +3 -0
  7. package/templates/chat-app/components/ai-elements/actions.tsx +44 -44
  8. package/templates/chat-app/components/ai-elements/artifact.tsx +92 -92
  9. package/templates/chat-app/components/ai-elements/code-block.tsx +143 -143
  10. package/templates/chat-app/components/ai-elements/context.tsx +313 -313
  11. package/templates/chat-app/components/ai-elements/conversation.tsx +65 -65
  12. package/templates/chat-app/components/ai-elements/extra/conversation-content-scroll-area.tsx +29 -29
  13. package/templates/chat-app/components/ai-elements/extra/mcp-tool-header.tsx +27 -27
  14. package/templates/chat-app/components/ai-elements/message.tsx +341 -344
  15. package/templates/chat-app/components/ai-elements/parseIncompleteMarkdown.tsx +122 -122
  16. package/templates/chat-app/components/ai-elements/prompt-input.tsx +1059 -1059
  17. package/templates/chat-app/components/ai-elements/reasoning.tsx +131 -131
  18. package/templates/chat-app/components/ai-elements/response.tsx +15 -12
  19. package/templates/chat-app/components/ai-elements/sandbox.tsx +84 -84
  20. package/templates/chat-app/components/ai-elements/shimmer.tsx +47 -47
  21. package/templates/chat-app/components/ai-elements/suggestion.tsx +33 -33
  22. package/templates/chat-app/components/ai-elements/tool.tsx +118 -118
  23. package/templates/chat-app/components/app-sidebar-history-conditional.tsx +3 -3
  24. package/templates/chat-app/components/app-sidebar.tsx +3 -3
  25. package/templates/chat-app/components/connectors-dropdown.tsx +6 -3
  26. package/templates/chat-app/components/deep-research-progress.tsx +1 -1
  27. package/templates/chat-app/components/header-breadcrumb.tsx +14 -11
  28. package/templates/chat-app/components/internal-link.tsx +73 -0
  29. package/templates/chat-app/components/login-form.tsx +5 -5
  30. package/templates/chat-app/components/message-parts.tsx +1 -71
  31. package/templates/chat-app/components/model-selector.tsx +3 -3
  32. package/templates/chat-app/components/new-chat-button.tsx +4 -4
  33. package/templates/chat-app/components/part/document-common.tsx +3 -3
  34. package/templates/chat-app/components/part/document-tool.tsx +3 -3
  35. package/templates/chat-app/components/part/message-annotations.tsx +2 -2
  36. package/templates/chat-app/components/part/tool-part.tsx +92 -0
  37. package/templates/chat-app/components/project-chat-item.tsx +2 -2
  38. package/templates/chat-app/components/research-progress.tsx +2 -2
  39. package/templates/chat-app/components/research-task.tsx +1 -1
  40. package/templates/chat-app/components/research-tasks.tsx +1 -1
  41. package/templates/chat-app/components/settings/connectors-settings.tsx +4 -4
  42. package/templates/chat-app/components/settings/mcp-details-page.tsx +5 -5
  43. package/templates/chat-app/components/settings/settings-nav.tsx +3 -3
  44. package/templates/chat-app/components/sidebar-chat-item.tsx +4 -12
  45. package/templates/chat-app/components/sidebar-project-item.tsx +4 -11
  46. package/templates/chat-app/components/sidebar-top-row.tsx +7 -7
  47. package/templates/chat-app/components/sidebar-user-nav.tsx +3 -3
  48. package/templates/chat-app/components/signup-form.tsx +8 -5
  49. package/templates/chat-app/components/source-badge.tsx +3 -9
  50. package/templates/chat-app/components/sources.tsx +1 -1
  51. package/templates/chat-app/components/ui/accordion.tsx +32 -32
  52. package/templates/chat-app/components/ui/alert-dialog.tsx +103 -103
  53. package/templates/chat-app/components/ui/alert.tsx +36 -36
  54. package/templates/chat-app/components/ui/avatar.tsx +28 -28
  55. package/templates/chat-app/components/ui/badge.tsx +22 -22
  56. package/templates/chat-app/components/ui/breadcrumb.tsx +72 -72
  57. package/templates/chat-app/components/ui/button-group.tsx +58 -58
  58. package/templates/chat-app/components/ui/button.tsx +45 -45
  59. package/templates/chat-app/components/ui/card.tsx +65 -65
  60. package/templates/chat-app/components/ui/checkbox.tsx +16 -16
  61. package/templates/chat-app/components/ui/collapsible.tsx +1 -1
  62. package/templates/chat-app/components/ui/command.tsx +137 -137
  63. package/templates/chat-app/components/ui/dialog.tsx +94 -94
  64. package/templates/chat-app/components/ui/drawer.tsx +68 -68
  65. package/templates/chat-app/components/ui/dropdown-menu.tsx +184 -184
  66. package/templates/chat-app/components/ui/empty.tsx +76 -76
  67. package/templates/chat-app/components/ui/extra/action-container.tsx +3 -3
  68. package/templates/chat-app/components/ui/extra/scroll-area-viewport-ref.tsx +24 -24
  69. package/templates/chat-app/components/ui/form.tsx +112 -112
  70. package/templates/chat-app/components/ui/hover-card.tsx +25 -25
  71. package/templates/chat-app/components/ui/input-group.tsx +126 -126
  72. package/templates/chat-app/components/ui/input.tsx +13 -13
  73. package/templates/chat-app/components/ui/label.tsx +12 -12
  74. package/templates/chat-app/components/ui/popover.tsx +25 -25
  75. package/templates/chat-app/components/ui/progress.tsx +19 -19
  76. package/templates/chat-app/components/ui/resizable.tsx +27 -27
  77. package/templates/chat-app/components/ui/scroll-area.tsx +30 -30
  78. package/templates/chat-app/components/ui/select.tsx +108 -108
  79. package/templates/chat-app/components/ui/separator.tsx +16 -16
  80. package/templates/chat-app/components/ui/sheet.tsx +91 -91
  81. package/templates/chat-app/components/ui/sidebar.tsx +615 -615
  82. package/templates/chat-app/components/ui/skeleton.tsx +7 -7
  83. package/templates/chat-app/components/ui/slider.tsx +50 -50
  84. package/templates/chat-app/components/ui/spinner.tsx +8 -8
  85. package/templates/chat-app/components/ui/switch.tsx +16 -16
  86. package/templates/chat-app/components/ui/table.tsx +71 -71
  87. package/templates/chat-app/components/ui/tabs.tsx +31 -31
  88. package/templates/chat-app/components/ui/textarea.tsx +10 -10
  89. package/templates/chat-app/components/ui/toggle.tsx +31 -31
  90. package/templates/chat-app/components/ui/tooltip.tsx +48 -48
  91. package/templates/chat-app/components/upgrade-cta/limit-display.tsx +7 -7
  92. package/templates/chat-app/components/upgrade-cta/login-cta-banner.tsx +3 -3
  93. package/templates/chat-app/components/upgrade-cta/login-prompt.tsx +3 -3
  94. package/templates/chat-app/hooks/use-mobile.ts +13 -13
  95. package/templates/chat-app/lib/ai/core-chat-agent.ts +25 -14
  96. package/templates/chat-app/lib/ai/eval-agent.ts +4 -5
  97. package/templates/chat-app/lib/ai/installed-tools.ts +12 -0
  98. package/templates/chat-app/lib/ai/mcp/mcp-client.ts +2 -2
  99. package/templates/chat-app/lib/ai/models.generated.ts +4236 -4585
  100. package/templates/chat-app/lib/ai/tool-renderer-registry.ts +31 -0
  101. package/templates/chat-app/lib/ai/types.ts +15 -20
  102. package/templates/chat-app/lib/config-requirements.ts +11 -6
  103. package/templates/chat-app/lib/config-schema.ts +13 -0
  104. package/templates/chat-app/lib/stores/hooks-message-parts.ts +1 -1
  105. package/templates/chat-app/lib/utils.ts +157 -157
  106. package/templates/chat-app/package.json +3 -2
  107. package/templates/chat-app/scripts/check-env.ts +229 -2
  108. package/templates/chat-app/tools/chatjs/_shared/lib/tool-part.ts +5 -0
  109. package/templates/chat-app/{components/part/weather.tsx → tools/chatjs/get-weather/renderer.tsx} +24 -38
  110. package/templates/chat-app/{components/part/retrieve-url.tsx → tools/chatjs/retrieve-url/renderer.tsx} +20 -15
  111. package/templates/chat-app/{lib/ai/tools/retrieve-url.ts → tools/chatjs/retrieve-url/tool.ts} +46 -7
  112. package/templates/chat-app/tools/chatjs/tools.ts +16 -0
  113. package/templates/chat-app/tools/chatjs/ui.ts +17 -0
  114. package/templates/chat-app/tools/chatjs/word-count/renderer.tsx +50 -0
  115. package/templates/chat-app/tools/chatjs/word-count/tool.ts +30 -0
  116. package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.ts +3 -5
  117. package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/deep-research.ts +2 -3
  118. package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/pipeline.ts +1 -1
  119. package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/types.ts +1 -1
  120. package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/utils.ts +7 -7
  121. package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/types.ts +1 -1
  122. package/templates/chat-app/{lib/ai/tools → tools/platform}/generate-video.ts +4 -6
  123. package/templates/chat-app/{lib/ai/tools → tools/platform}/read-document.ts +2 -2
  124. package/templates/chat-app/{lib/ai/tools → tools/platform}/steps/multi-query-web-search.ts +1 -1
  125. package/templates/chat-app/{lib/ai/tools → tools/platform}/steps/web-search.ts +1 -1
  126. package/templates/chat-app/{lib/ai/tools → tools/platform}/tools.ts +20 -20
  127. package/templates/chat-app/{lib/ai/tools → tools/platform}/web-search.ts +7 -5
  128. package/templates/electron/CHANGELOG.md +7 -1
  129. package/templates/electron/forge.config.ts +1 -6
  130. package/templates/electron/package.json +1 -1
  131. package/templates/chat-app/lib/ai/tools/tools-definitions.ts +0 -83
  132. /package/templates/chat-app/{lib/ai/tools/get-weather.ts → tools/chatjs/get-weather/tool.ts} +0 -0
  133. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.javascript.ts +0 -0
  134. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.python.ts +0 -0
  135. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.shared.test.ts +0 -0
  136. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.shared.ts +0 -0
  137. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.types.ts +0 -0
  138. /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/configuration.ts +0 -0
  139. /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/prompts.ts +0 -0
  140. /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/researcher-agent.ts +0 -0
  141. /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/supervisor-agent.ts +0 -0
  142. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/code-guidelines.ts +0 -0
  143. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/create-code-document.ts +0 -0
  144. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/create-sheet-document.ts +0 -0
  145. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/create-text-document.ts +0 -0
  146. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/edit-code-document.ts +0 -0
  147. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/edit-sheet-document.ts +0 -0
  148. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/edit-text-document.ts +0 -0
  149. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/sheet-guidelines.ts +0 -0
  150. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/text-guidelines.ts +0 -0
  151. /package/templates/chat-app/{lib/ai/tools → tools/platform}/generate-image.ts +0 -0
  152. /package/templates/chat-app/{lib/ai/tools → tools/platform}/research-updates-schema.ts +0 -0
  153. /package/templates/chat-app/{lib/ai/tools → tools/platform}/steps/search-utils.ts +0 -0
  154. /package/templates/chat-app/{lib/ai/tools → tools/platform}/types.ts +0 -0
@@ -6,13 +6,13 @@ import { Drawer as DrawerPrimitive } from "vaul";
6
6
  import { cn } from "@/lib/utils";
7
7
 
8
8
  const Drawer = ({
9
- shouldScaleBackground = true,
10
- ...props
9
+ shouldScaleBackground = true,
10
+ ...props
11
11
  }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
12
- <DrawerPrimitive.Root
13
- shouldScaleBackground={shouldScaleBackground}
14
- {...props}
15
- />
12
+ <DrawerPrimitive.Root
13
+ shouldScaleBackground={shouldScaleBackground}
14
+ {...props}
15
+ />
16
16
  );
17
17
  Drawer.displayName = "Drawer";
18
18
 
@@ -23,96 +23,96 @@ const DrawerPortal = DrawerPrimitive.Portal;
23
23
  const DrawerClose = DrawerPrimitive.Close;
24
24
 
25
25
  const DrawerOverlay = React.forwardRef<
26
- React.ElementRef<typeof DrawerPrimitive.Overlay>,
27
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
26
+ React.ElementRef<typeof DrawerPrimitive.Overlay>,
27
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
28
28
  >(({ className, ...props }, ref) => (
29
- <DrawerPrimitive.Overlay
30
- className={cn("fixed inset-0 z-50 bg-black/80", className)}
31
- ref={ref}
32
- {...props}
33
- />
29
+ <DrawerPrimitive.Overlay
30
+ className={cn("fixed inset-0 z-50 bg-black/80", className)}
31
+ ref={ref}
32
+ {...props}
33
+ />
34
34
  ));
35
35
  DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
36
36
 
37
37
  const DrawerContent = React.forwardRef<
38
- React.ElementRef<typeof DrawerPrimitive.Content>,
39
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
38
+ React.ElementRef<typeof DrawerPrimitive.Content>,
39
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
40
40
  >(({ className, children, ...props }, ref) => (
41
- <DrawerPortal>
42
- <DrawerOverlay />
43
- <DrawerPrimitive.Content
44
- className={cn(
45
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
46
- className
47
- )}
48
- ref={ref}
49
- {...props}
50
- >
51
- <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
52
- {children}
53
- </DrawerPrimitive.Content>
54
- </DrawerPortal>
41
+ <DrawerPortal>
42
+ <DrawerOverlay />
43
+ <DrawerPrimitive.Content
44
+ className={cn(
45
+ "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
46
+ className,
47
+ )}
48
+ ref={ref}
49
+ {...props}
50
+ >
51
+ <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
52
+ {children}
53
+ </DrawerPrimitive.Content>
54
+ </DrawerPortal>
55
55
  ));
56
56
  DrawerContent.displayName = "DrawerContent";
57
57
 
58
58
  const DrawerHeader = ({
59
- className,
60
- ...props
59
+ className,
60
+ ...props
61
61
  }: React.HTMLAttributes<HTMLDivElement>) => (
62
- <div
63
- className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
64
- {...props}
65
- />
62
+ <div
63
+ className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
64
+ {...props}
65
+ />
66
66
  );
67
67
  DrawerHeader.displayName = "DrawerHeader";
68
68
 
69
69
  const DrawerFooter = ({
70
- className,
71
- ...props
70
+ className,
71
+ ...props
72
72
  }: React.HTMLAttributes<HTMLDivElement>) => (
73
- <div
74
- className={cn("mt-auto flex flex-col gap-2 p-4", className)}
75
- {...props}
76
- />
73
+ <div
74
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
75
+ {...props}
76
+ />
77
77
  );
78
78
  DrawerFooter.displayName = "DrawerFooter";
79
79
 
80
80
  const DrawerTitle = React.forwardRef<
81
- React.ElementRef<typeof DrawerPrimitive.Title>,
82
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
81
+ React.ElementRef<typeof DrawerPrimitive.Title>,
82
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
83
83
  >(({ className, ...props }, ref) => (
84
- <DrawerPrimitive.Title
85
- className={cn(
86
- "font-semibold text-lg leading-none tracking-tight",
87
- className
88
- )}
89
- ref={ref}
90
- {...props}
91
- />
84
+ <DrawerPrimitive.Title
85
+ className={cn(
86
+ "font-semibold text-lg leading-none tracking-tight",
87
+ className,
88
+ )}
89
+ ref={ref}
90
+ {...props}
91
+ />
92
92
  ));
93
93
  DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
94
94
 
95
95
  const DrawerDescription = React.forwardRef<
96
- React.ElementRef<typeof DrawerPrimitive.Description>,
97
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
96
+ React.ElementRef<typeof DrawerPrimitive.Description>,
97
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
98
98
  >(({ className, ...props }, ref) => (
99
- <DrawerPrimitive.Description
100
- className={cn("text-muted-foreground text-sm", className)}
101
- ref={ref}
102
- {...props}
103
- />
99
+ <DrawerPrimitive.Description
100
+ className={cn("text-muted-foreground text-sm", className)}
101
+ ref={ref}
102
+ {...props}
103
+ />
104
104
  ));
105
105
  DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
106
106
 
107
107
  export {
108
- Drawer,
109
- DrawerPortal,
110
- DrawerOverlay,
111
- DrawerTrigger,
112
- DrawerClose,
113
- DrawerContent,
114
- DrawerHeader,
115
- DrawerFooter,
116
- DrawerTitle,
117
- DrawerDescription,
108
+ Drawer,
109
+ DrawerClose,
110
+ DrawerContent,
111
+ DrawerDescription,
112
+ DrawerFooter,
113
+ DrawerHeader,
114
+ DrawerOverlay,
115
+ DrawerPortal,
116
+ DrawerTitle,
117
+ DrawerTrigger,
118
118
  };
@@ -7,251 +7,251 @@ import type * as React from "react";
7
7
  import { cn } from "@/lib/utils";
8
8
 
9
9
  function DropdownMenu({
10
- ...props
10
+ ...props
11
11
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
12
- return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
12
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
13
13
  }
14
14
 
15
15
  function DropdownMenuPortal({
16
- ...props
16
+ ...props
17
17
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
18
- return (
19
- <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
20
- );
18
+ return (
19
+ <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
20
+ );
21
21
  }
22
22
 
23
23
  function DropdownMenuTrigger({
24
- ...props
24
+ ...props
25
25
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
26
- return (
27
- <DropdownMenuPrimitive.Trigger
28
- data-slot="dropdown-menu-trigger"
29
- {...props}
30
- />
31
- );
26
+ return (
27
+ <DropdownMenuPrimitive.Trigger
28
+ data-slot="dropdown-menu-trigger"
29
+ {...props}
30
+ />
31
+ );
32
32
  }
33
33
 
34
34
  function DropdownMenuContent({
35
- className,
36
- sideOffset = 4,
37
- ...props
35
+ className,
36
+ sideOffset = 4,
37
+ ...props
38
38
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
39
- return (
40
- <DropdownMenuPrimitive.Portal>
41
- <DropdownMenuPrimitive.Content
42
- className={cn(
43
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",
44
- className
45
- )}
46
- data-slot="dropdown-menu-content"
47
- sideOffset={sideOffset}
48
- {...props}
49
- />
50
- </DropdownMenuPrimitive.Portal>
51
- );
39
+ return (
40
+ <DropdownMenuPrimitive.Portal>
41
+ <DropdownMenuPrimitive.Content
42
+ className={cn(
43
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",
44
+ className,
45
+ )}
46
+ data-slot="dropdown-menu-content"
47
+ sideOffset={sideOffset}
48
+ {...props}
49
+ />
50
+ </DropdownMenuPrimitive.Portal>
51
+ );
52
52
  }
53
53
 
54
54
  function DropdownMenuGroup({
55
- ...props
55
+ ...props
56
56
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
57
- return (
58
- <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
59
- );
57
+ return (
58
+ <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
59
+ );
60
60
  }
61
61
 
62
62
  function DropdownMenuItem({
63
- className,
64
- inset,
65
- variant = "default",
66
- ...props
63
+ className,
64
+ inset,
65
+ variant = "default",
66
+ ...props
67
67
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
68
- inset?: boolean;
69
- variant?: "default" | "destructive";
68
+ inset?: boolean;
69
+ variant?: "default" | "destructive";
70
70
  }) {
71
- return (
72
- <DropdownMenuPrimitive.Item
73
- className={cn(
74
- "data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
75
- className
76
- )}
77
- data-inset={inset}
78
- data-slot="dropdown-menu-item"
79
- data-variant={variant}
80
- {...props}
81
- />
82
- );
71
+ return (
72
+ <DropdownMenuPrimitive.Item
73
+ className={cn(
74
+ "data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
75
+ className,
76
+ )}
77
+ data-inset={inset}
78
+ data-slot="dropdown-menu-item"
79
+ data-variant={variant}
80
+ {...props}
81
+ />
82
+ );
83
83
  }
84
84
 
85
85
  function DropdownMenuCheckboxItem({
86
- className,
87
- children,
88
- checked,
89
- ...props
86
+ className,
87
+ children,
88
+ checked,
89
+ ...props
90
90
  }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
91
- return (
92
- <DropdownMenuPrimitive.CheckboxItem
93
- checked={checked}
94
- className={cn(
95
- "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
96
- className
97
- )}
98
- data-slot="dropdown-menu-checkbox-item"
99
- {...props}
100
- >
101
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
102
- <DropdownMenuPrimitive.ItemIndicator>
103
- <CheckIcon className="size-4" />
104
- </DropdownMenuPrimitive.ItemIndicator>
105
- </span>
106
- {children}
107
- </DropdownMenuPrimitive.CheckboxItem>
108
- );
91
+ return (
92
+ <DropdownMenuPrimitive.CheckboxItem
93
+ checked={checked}
94
+ className={cn(
95
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
96
+ className,
97
+ )}
98
+ data-slot="dropdown-menu-checkbox-item"
99
+ {...props}
100
+ >
101
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
102
+ <DropdownMenuPrimitive.ItemIndicator>
103
+ <CheckIcon className="size-4" />
104
+ </DropdownMenuPrimitive.ItemIndicator>
105
+ </span>
106
+ {children}
107
+ </DropdownMenuPrimitive.CheckboxItem>
108
+ );
109
109
  }
110
110
 
111
111
  function DropdownMenuRadioGroup({
112
- ...props
112
+ ...props
113
113
  }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
114
- return (
115
- <DropdownMenuPrimitive.RadioGroup
116
- data-slot="dropdown-menu-radio-group"
117
- {...props}
118
- />
119
- );
114
+ return (
115
+ <DropdownMenuPrimitive.RadioGroup
116
+ data-slot="dropdown-menu-radio-group"
117
+ {...props}
118
+ />
119
+ );
120
120
  }
121
121
 
122
122
  function DropdownMenuRadioItem({
123
- className,
124
- children,
125
- ...props
123
+ className,
124
+ children,
125
+ ...props
126
126
  }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
127
- return (
128
- <DropdownMenuPrimitive.RadioItem
129
- className={cn(
130
- "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
131
- className
132
- )}
133
- data-slot="dropdown-menu-radio-item"
134
- {...props}
135
- >
136
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
137
- <DropdownMenuPrimitive.ItemIndicator>
138
- <CircleIcon className="size-2 fill-current" />
139
- </DropdownMenuPrimitive.ItemIndicator>
140
- </span>
141
- {children}
142
- </DropdownMenuPrimitive.RadioItem>
143
- );
127
+ return (
128
+ <DropdownMenuPrimitive.RadioItem
129
+ className={cn(
130
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
131
+ className,
132
+ )}
133
+ data-slot="dropdown-menu-radio-item"
134
+ {...props}
135
+ >
136
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
137
+ <DropdownMenuPrimitive.ItemIndicator>
138
+ <CircleIcon className="size-2 fill-current" />
139
+ </DropdownMenuPrimitive.ItemIndicator>
140
+ </span>
141
+ {children}
142
+ </DropdownMenuPrimitive.RadioItem>
143
+ );
144
144
  }
145
145
 
146
146
  function DropdownMenuLabel({
147
- className,
148
- inset,
149
- ...props
147
+ className,
148
+ inset,
149
+ ...props
150
150
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
151
- inset?: boolean;
151
+ inset?: boolean;
152
152
  }) {
153
- return (
154
- <DropdownMenuPrimitive.Label
155
- className={cn(
156
- "px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",
157
- className
158
- )}
159
- data-inset={inset}
160
- data-slot="dropdown-menu-label"
161
- {...props}
162
- />
163
- );
153
+ return (
154
+ <DropdownMenuPrimitive.Label
155
+ className={cn(
156
+ "px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",
157
+ className,
158
+ )}
159
+ data-inset={inset}
160
+ data-slot="dropdown-menu-label"
161
+ {...props}
162
+ />
163
+ );
164
164
  }
165
165
 
166
166
  function DropdownMenuSeparator({
167
- className,
168
- ...props
167
+ className,
168
+ ...props
169
169
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
170
- return (
171
- <DropdownMenuPrimitive.Separator
172
- className={cn("-mx-1 my-1 h-px bg-border", className)}
173
- data-slot="dropdown-menu-separator"
174
- {...props}
175
- />
176
- );
170
+ return (
171
+ <DropdownMenuPrimitive.Separator
172
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
173
+ data-slot="dropdown-menu-separator"
174
+ {...props}
175
+ />
176
+ );
177
177
  }
178
178
 
179
179
  function DropdownMenuShortcut({
180
- className,
181
- ...props
180
+ className,
181
+ ...props
182
182
  }: React.ComponentProps<"span">) {
183
- return (
184
- <span
185
- className={cn(
186
- "ml-auto text-muted-foreground text-xs tracking-widest",
187
- className
188
- )}
189
- data-slot="dropdown-menu-shortcut"
190
- {...props}
191
- />
192
- );
183
+ return (
184
+ <span
185
+ className={cn(
186
+ "ml-auto text-muted-foreground text-xs tracking-widest",
187
+ className,
188
+ )}
189
+ data-slot="dropdown-menu-shortcut"
190
+ {...props}
191
+ />
192
+ );
193
193
  }
194
194
 
195
195
  function DropdownMenuSub({
196
- ...props
196
+ ...props
197
197
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
198
- return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
198
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
199
199
  }
200
200
 
201
201
  function DropdownMenuSubTrigger({
202
- className,
203
- inset,
204
- children,
205
- ...props
202
+ className,
203
+ inset,
204
+ children,
205
+ ...props
206
206
  }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
207
- inset?: boolean;
207
+ inset?: boolean;
208
208
  }) {
209
- return (
210
- <DropdownMenuPrimitive.SubTrigger
211
- className={cn(
212
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[inset]:pl-8 data-[state=open]:text-accent-foreground",
213
- className
214
- )}
215
- data-inset={inset}
216
- data-slot="dropdown-menu-sub-trigger"
217
- {...props}
218
- >
219
- {children}
220
- <ChevronRightIcon className="ml-auto size-4" />
221
- </DropdownMenuPrimitive.SubTrigger>
222
- );
209
+ return (
210
+ <DropdownMenuPrimitive.SubTrigger
211
+ className={cn(
212
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[inset]:pl-8 data-[state=open]:text-accent-foreground",
213
+ className,
214
+ )}
215
+ data-inset={inset}
216
+ data-slot="dropdown-menu-sub-trigger"
217
+ {...props}
218
+ >
219
+ {children}
220
+ <ChevronRightIcon className="ml-auto size-4" />
221
+ </DropdownMenuPrimitive.SubTrigger>
222
+ );
223
223
  }
224
224
 
225
225
  function DropdownMenuSubContent({
226
- className,
227
- ...props
226
+ className,
227
+ ...props
228
228
  }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
229
- return (
230
- <DropdownMenuPrimitive.SubContent
231
- className={cn(
232
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in",
233
- className
234
- )}
235
- data-slot="dropdown-menu-sub-content"
236
- {...props}
237
- />
238
- );
229
+ return (
230
+ <DropdownMenuPrimitive.SubContent
231
+ className={cn(
232
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in",
233
+ className,
234
+ )}
235
+ data-slot="dropdown-menu-sub-content"
236
+ {...props}
237
+ />
238
+ );
239
239
  }
240
240
 
241
241
  export {
242
- DropdownMenu,
243
- DropdownMenuPortal,
244
- DropdownMenuTrigger,
245
- DropdownMenuContent,
246
- DropdownMenuGroup,
247
- DropdownMenuLabel,
248
- DropdownMenuItem,
249
- DropdownMenuCheckboxItem,
250
- DropdownMenuRadioGroup,
251
- DropdownMenuRadioItem,
252
- DropdownMenuSeparator,
253
- DropdownMenuShortcut,
254
- DropdownMenuSub,
255
- DropdownMenuSubTrigger,
256
- DropdownMenuSubContent,
242
+ DropdownMenu,
243
+ DropdownMenuCheckboxItem,
244
+ DropdownMenuContent,
245
+ DropdownMenuGroup,
246
+ DropdownMenuItem,
247
+ DropdownMenuLabel,
248
+ DropdownMenuPortal,
249
+ DropdownMenuRadioGroup,
250
+ DropdownMenuRadioItem,
251
+ DropdownMenuSeparator,
252
+ DropdownMenuShortcut,
253
+ DropdownMenuSub,
254
+ DropdownMenuSubContent,
255
+ DropdownMenuSubTrigger,
256
+ DropdownMenuTrigger,
257
257
  };