@chat-js/cli 0.6.1 → 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 (153) hide show
  1. package/dist/index.js +16938 -16786
  2. package/package.json +1 -1
  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 +1 -1
  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/package.json +1 -1
  130. package/templates/chat-app/lib/ai/tools/tools-definitions.ts +0 -83
  131. /package/templates/chat-app/{lib/ai/tools/get-weather.ts → tools/chatjs/get-weather/tool.ts} +0 -0
  132. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.javascript.ts +0 -0
  133. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.python.ts +0 -0
  134. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.shared.test.ts +0 -0
  135. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.shared.ts +0 -0
  136. /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.types.ts +0 -0
  137. /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/configuration.ts +0 -0
  138. /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/prompts.ts +0 -0
  139. /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/researcher-agent.ts +0 -0
  140. /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/supervisor-agent.ts +0 -0
  141. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/code-guidelines.ts +0 -0
  142. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/create-code-document.ts +0 -0
  143. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/create-sheet-document.ts +0 -0
  144. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/create-text-document.ts +0 -0
  145. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/edit-code-document.ts +0 -0
  146. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/edit-sheet-document.ts +0 -0
  147. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/edit-text-document.ts +0 -0
  148. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/sheet-guidelines.ts +0 -0
  149. /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/text-guidelines.ts +0 -0
  150. /package/templates/chat-app/{lib/ai/tools → tools/platform}/generate-image.ts +0 -0
  151. /package/templates/chat-app/{lib/ai/tools → tools/platform}/research-updates-schema.ts +0 -0
  152. /package/templates/chat-app/{lib/ai/tools → tools/platform}/steps/search-utils.ts +0 -0
  153. /package/templates/chat-app/{lib/ai/tools → tools/platform}/types.ts +0 -0
@@ -1,13 +1,13 @@
1
1
  import { cn } from "@/lib/utils";
2
2
 
3
3
  function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
- return (
5
- <div
6
- className={cn("animate-pulse rounded-md bg-muted", className)}
7
- data-slot="skeleton"
8
- {...props}
9
- />
10
- );
4
+ return (
5
+ <div
6
+ className={cn("animate-pulse rounded-md bg-muted", className)}
7
+ data-slot="skeleton"
8
+ {...props}
9
+ />
10
+ );
11
11
  }
12
12
 
13
13
  export { Skeleton };
@@ -6,58 +6,58 @@ import * as React from "react";
6
6
  import { cn } from "@/lib/utils";
7
7
 
8
8
  function Slider({
9
- className,
10
- defaultValue,
11
- value,
12
- min = 0,
13
- max = 100,
14
- ...props
9
+ className,
10
+ defaultValue,
11
+ value,
12
+ min = 0,
13
+ max = 100,
14
+ ...props
15
15
  }: React.ComponentProps<typeof SliderPrimitive.Root>) {
16
- const _values = React.useMemo(
17
- () =>
18
- Array.isArray(value)
19
- ? value
20
- : Array.isArray(defaultValue)
21
- ? defaultValue
22
- : [min, max],
23
- [value, defaultValue, min, max]
24
- );
16
+ const _values = React.useMemo(
17
+ () =>
18
+ Array.isArray(value)
19
+ ? value
20
+ : Array.isArray(defaultValue)
21
+ ? defaultValue
22
+ : [min, max],
23
+ [value, defaultValue, min, max],
24
+ );
25
25
 
26
- return (
27
- <SliderPrimitive.Root
28
- className={cn(
29
- "relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",
30
- className
31
- )}
32
- data-slot="slider"
33
- defaultValue={defaultValue}
34
- max={max}
35
- min={min}
36
- value={value}
37
- {...props}
38
- >
39
- <SliderPrimitive.Track
40
- className={cn(
41
- "relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5"
42
- )}
43
- data-slot="slider-track"
44
- >
45
- <SliderPrimitive.Range
46
- className={cn(
47
- "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
48
- )}
49
- data-slot="slider-range"
50
- />
51
- </SliderPrimitive.Track>
52
- {Array.from({ length: _values.length }, (_, index) => (
53
- <SliderPrimitive.Thumb
54
- className="block size-4 shrink-0 rounded-full border border-primary bg-background shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50"
55
- data-slot="slider-thumb"
56
- key={index}
57
- />
58
- ))}
59
- </SliderPrimitive.Root>
60
- );
26
+ return (
27
+ <SliderPrimitive.Root
28
+ className={cn(
29
+ "relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",
30
+ className,
31
+ )}
32
+ data-slot="slider"
33
+ defaultValue={defaultValue}
34
+ max={max}
35
+ min={min}
36
+ value={value}
37
+ {...props}
38
+ >
39
+ <SliderPrimitive.Track
40
+ className={cn(
41
+ "relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5",
42
+ )}
43
+ data-slot="slider-track"
44
+ >
45
+ <SliderPrimitive.Range
46
+ className={cn(
47
+ "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",
48
+ )}
49
+ data-slot="slider-range"
50
+ />
51
+ </SliderPrimitive.Track>
52
+ {Array.from({ length: _values.length }, (_, index) => (
53
+ <SliderPrimitive.Thumb
54
+ className="block size-4 shrink-0 rounded-full border border-primary bg-background shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50"
55
+ data-slot="slider-thumb"
56
+ key={index}
57
+ />
58
+ ))}
59
+ </SliderPrimitive.Root>
60
+ );
61
61
  }
62
62
 
63
63
  export { Slider };
@@ -3,14 +3,14 @@ import { Loader2Icon } from "lucide-react";
3
3
  import { cn } from "@/lib/utils";
4
4
 
5
5
  function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
6
- return (
7
- <Loader2Icon
8
- aria-label="Loading"
9
- className={cn("size-4 animate-spin", className)}
10
- role="status"
11
- {...props}
12
- />
13
- );
6
+ return (
7
+ <Loader2Icon
8
+ aria-label="Loading"
9
+ className={cn("size-4 animate-spin", className)}
10
+ role="status"
11
+ {...props}
12
+ />
13
+ );
14
14
  }
15
15
 
16
16
  export { Spinner };
@@ -6,23 +6,23 @@ import * as React from "react";
6
6
  import { cn } from "@/lib/utils";
7
7
 
8
8
  const Switch = React.forwardRef<
9
- React.ElementRef<typeof SwitchPrimitives.Root>,
10
- React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
9
+ React.ElementRef<typeof SwitchPrimitives.Root>,
10
+ React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
11
11
  >(({ className, ...props }, ref) => (
12
- <SwitchPrimitives.Root
13
- className={cn(
14
- "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
15
- className
16
- )}
17
- {...props}
18
- ref={ref}
19
- >
20
- <SwitchPrimitives.Thumb
21
- className={cn(
22
- "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
23
- )}
24
- />
25
- </SwitchPrimitives.Root>
12
+ <SwitchPrimitives.Root
13
+ className={cn(
14
+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
15
+ className,
16
+ )}
17
+ {...props}
18
+ ref={ref}
19
+ >
20
+ <SwitchPrimitives.Thumb
21
+ className={cn(
22
+ "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
23
+ )}
24
+ />
25
+ </SwitchPrimitives.Root>
26
26
  ));
27
27
  Switch.displayName = SwitchPrimitives.Root.displayName;
28
28
 
@@ -3,115 +3,115 @@ import * as React from "react";
3
3
  import { cn } from "@/lib/utils";
4
4
 
5
5
  const Table = React.forwardRef<
6
- HTMLTableElement,
7
- React.HTMLAttributes<HTMLTableElement>
6
+ HTMLTableElement,
7
+ React.HTMLAttributes<HTMLTableElement>
8
8
  >(({ className, ...props }, ref) => (
9
- <div className="relative w-full overflow-auto">
10
- <table
11
- className={cn("w-full caption-bottom text-sm", className)}
12
- ref={ref}
13
- {...props}
14
- />
15
- </div>
9
+ <div className="relative w-full overflow-auto">
10
+ <table
11
+ className={cn("w-full caption-bottom text-sm", className)}
12
+ ref={ref}
13
+ {...props}
14
+ />
15
+ </div>
16
16
  ));
17
17
  Table.displayName = "Table";
18
18
 
19
19
  const TableHeader = React.forwardRef<
20
- HTMLTableSectionElement,
21
- React.HTMLAttributes<HTMLTableSectionElement>
20
+ HTMLTableSectionElement,
21
+ React.HTMLAttributes<HTMLTableSectionElement>
22
22
  >(({ className, ...props }, ref) => (
23
- <thead className={cn("[&_tr]:border-b", className)} ref={ref} {...props} />
23
+ <thead className={cn("[&_tr]:border-b", className)} ref={ref} {...props} />
24
24
  ));
25
25
  TableHeader.displayName = "TableHeader";
26
26
 
27
27
  const TableBody = React.forwardRef<
28
- HTMLTableSectionElement,
29
- React.HTMLAttributes<HTMLTableSectionElement>
28
+ HTMLTableSectionElement,
29
+ React.HTMLAttributes<HTMLTableSectionElement>
30
30
  >(({ className, ...props }, ref) => (
31
- <tbody
32
- className={cn("[&_tr:last-child]:border-0", className)}
33
- ref={ref}
34
- {...props}
35
- />
31
+ <tbody
32
+ className={cn("[&_tr:last-child]:border-0", className)}
33
+ ref={ref}
34
+ {...props}
35
+ />
36
36
  ));
37
37
  TableBody.displayName = "TableBody";
38
38
 
39
39
  const TableFooter = React.forwardRef<
40
- HTMLTableSectionElement,
41
- React.HTMLAttributes<HTMLTableSectionElement>
40
+ HTMLTableSectionElement,
41
+ React.HTMLAttributes<HTMLTableSectionElement>
42
42
  >(({ className, ...props }, ref) => (
43
- <tfoot
44
- className={cn(
45
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
46
- className
47
- )}
48
- ref={ref}
49
- {...props}
50
- />
43
+ <tfoot
44
+ className={cn(
45
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
46
+ className,
47
+ )}
48
+ ref={ref}
49
+ {...props}
50
+ />
51
51
  ));
52
52
  TableFooter.displayName = "TableFooter";
53
53
 
54
54
  const TableRow = React.forwardRef<
55
- HTMLTableRowElement,
56
- React.HTMLAttributes<HTMLTableRowElement>
55
+ HTMLTableRowElement,
56
+ React.HTMLAttributes<HTMLTableRowElement>
57
57
  >(({ className, ...props }, ref) => (
58
- <tr
59
- className={cn(
60
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
61
- className
62
- )}
63
- ref={ref}
64
- {...props}
65
- />
58
+ <tr
59
+ className={cn(
60
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
61
+ className,
62
+ )}
63
+ ref={ref}
64
+ {...props}
65
+ />
66
66
  ));
67
67
  TableRow.displayName = "TableRow";
68
68
 
69
69
  const TableHead = React.forwardRef<
70
- HTMLTableCellElement,
71
- React.ThHTMLAttributes<HTMLTableCellElement>
70
+ HTMLTableCellElement,
71
+ React.ThHTMLAttributes<HTMLTableCellElement>
72
72
  >(({ className, ...props }, ref) => (
73
- <th
74
- className={cn(
75
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
76
- className
77
- )}
78
- ref={ref}
79
- {...props}
80
- />
73
+ <th
74
+ className={cn(
75
+ "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
76
+ className,
77
+ )}
78
+ ref={ref}
79
+ {...props}
80
+ />
81
81
  ));
82
82
  TableHead.displayName = "TableHead";
83
83
 
84
84
  const TableCell = React.forwardRef<
85
- HTMLTableCellElement,
86
- React.TdHTMLAttributes<HTMLTableCellElement>
85
+ HTMLTableCellElement,
86
+ React.TdHTMLAttributes<HTMLTableCellElement>
87
87
  >(({ className, ...props }, ref) => (
88
- <td
89
- className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
90
- ref={ref}
91
- {...props}
92
- />
88
+ <td
89
+ className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
90
+ ref={ref}
91
+ {...props}
92
+ />
93
93
  ));
94
94
  TableCell.displayName = "TableCell";
95
95
 
96
96
  const TableCaption = React.forwardRef<
97
- HTMLTableCaptionElement,
98
- React.HTMLAttributes<HTMLTableCaptionElement>
97
+ HTMLTableCaptionElement,
98
+ React.HTMLAttributes<HTMLTableCaptionElement>
99
99
  >(({ className, ...props }, ref) => (
100
- <caption
101
- className={cn("mt-4 text-muted-foreground text-sm", className)}
102
- ref={ref}
103
- {...props}
104
- />
100
+ <caption
101
+ className={cn("mt-4 text-muted-foreground text-sm", className)}
102
+ ref={ref}
103
+ {...props}
104
+ />
105
105
  ));
106
106
  TableCaption.displayName = "TableCaption";
107
107
 
108
108
  export {
109
- Table,
110
- TableHeader,
111
- TableBody,
112
- TableFooter,
113
- TableHead,
114
- TableRow,
115
- TableCell,
116
- TableCaption,
109
+ Table,
110
+ TableBody,
111
+ TableCaption,
112
+ TableCell,
113
+ TableFooter,
114
+ TableHead,
115
+ TableHeader,
116
+ TableRow,
117
117
  };
@@ -8,48 +8,48 @@ import { cn } from "@/lib/utils";
8
8
  const Tabs = TabsPrimitive.Root;
9
9
 
10
10
  const TabsList = React.forwardRef<
11
- React.ElementRef<typeof TabsPrimitive.List>,
12
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
11
+ React.ElementRef<typeof TabsPrimitive.List>,
12
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
13
13
  >(({ className, ...props }, ref) => (
14
- <TabsPrimitive.List
15
- className={cn(
16
- "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
17
- className
18
- )}
19
- ref={ref}
20
- {...props}
21
- />
14
+ <TabsPrimitive.List
15
+ className={cn(
16
+ "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
17
+ className,
18
+ )}
19
+ ref={ref}
20
+ {...props}
21
+ />
22
22
  ));
23
23
  TabsList.displayName = TabsPrimitive.List.displayName;
24
24
 
25
25
  const TabsTrigger = React.forwardRef<
26
- React.ElementRef<typeof TabsPrimitive.Trigger>,
27
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
26
+ React.ElementRef<typeof TabsPrimitive.Trigger>,
27
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
28
28
  >(({ className, ...props }, ref) => (
29
- <TabsPrimitive.Trigger
30
- className={cn(
31
- "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
32
- className
33
- )}
34
- ref={ref}
35
- {...props}
36
- />
29
+ <TabsPrimitive.Trigger
30
+ className={cn(
31
+ "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
32
+ className,
33
+ )}
34
+ ref={ref}
35
+ {...props}
36
+ />
37
37
  ));
38
38
  TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
39
39
 
40
40
  const TabsContent = React.forwardRef<
41
- React.ElementRef<typeof TabsPrimitive.Content>,
42
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
41
+ React.ElementRef<typeof TabsPrimitive.Content>,
42
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
43
43
  >(({ className, ...props }, ref) => (
44
- <TabsPrimitive.Content
45
- className={cn(
46
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
47
- className
48
- )}
49
- ref={ref}
50
- {...props}
51
- />
44
+ <TabsPrimitive.Content
45
+ className={cn(
46
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
47
+ className,
48
+ )}
49
+ ref={ref}
50
+ {...props}
51
+ />
52
52
  ));
53
53
  TabsContent.displayName = TabsPrimitive.Content.displayName;
54
54
 
55
- export { Tabs, TabsList, TabsTrigger, TabsContent };
55
+ export { Tabs, TabsContent, TabsList, TabsTrigger };
@@ -3,17 +3,17 @@ import * as React from "react";
3
3
  import { cn } from "@/lib/utils";
4
4
 
5
5
  const Textarea = React.forwardRef<
6
- HTMLTextAreaElement,
7
- React.ComponentProps<"textarea">
6
+ HTMLTextAreaElement,
7
+ React.ComponentProps<"textarea">
8
8
  >(({ className, ...props }, ref) => (
9
- <textarea
10
- className={cn(
11
- "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
- className
13
- )}
14
- ref={ref}
15
- {...props}
16
- />
9
+ <textarea
10
+ className={cn(
11
+ "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
+ className,
13
+ )}
14
+ ref={ref}
15
+ {...props}
16
+ />
17
17
  ));
18
18
  Textarea.displayName = "Textarea";
19
19
 
@@ -7,41 +7,41 @@ import type * as React from "react";
7
7
  import { cn } from "@/lib/utils";
8
8
 
9
9
  const toggleVariants = cva(
10
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
11
- {
12
- variants: {
13
- variant: {
14
- default: "bg-transparent",
15
- outline:
16
- "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
17
- },
18
- size: {
19
- default: "h-9 min-w-9 px-2",
20
- sm: "h-8 min-w-8 px-1.5",
21
- lg: "h-10 min-w-10 px-2.5",
22
- },
23
- },
24
- defaultVariants: {
25
- variant: "default",
26
- size: "default",
27
- },
28
- }
10
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
11
+ {
12
+ variants: {
13
+ variant: {
14
+ default: "bg-transparent",
15
+ outline:
16
+ "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
17
+ },
18
+ size: {
19
+ default: "h-9 min-w-9 px-2",
20
+ sm: "h-8 min-w-8 px-1.5",
21
+ lg: "h-10 min-w-10 px-2.5",
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ size: "default",
27
+ },
28
+ },
29
29
  );
30
30
 
31
31
  function Toggle({
32
- className,
33
- variant,
34
- size,
35
- ...props
32
+ className,
33
+ variant,
34
+ size,
35
+ ...props
36
36
  }: React.ComponentProps<typeof TogglePrimitive.Root> &
37
- VariantProps<typeof toggleVariants>) {
38
- return (
39
- <TogglePrimitive.Root
40
- className={cn(toggleVariants({ variant, size, className }))}
41
- data-slot="toggle"
42
- {...props}
43
- />
44
- );
37
+ VariantProps<typeof toggleVariants>) {
38
+ return (
39
+ <TogglePrimitive.Root
40
+ className={cn(toggleVariants({ variant, size, className }))}
41
+ data-slot="toggle"
42
+ {...props}
43
+ />
44
+ );
45
45
  }
46
46
 
47
47
  export { Toggle, toggleVariants };