@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
@@ -5,111 +5,111 @@ import * as React from "react";
5
5
  import { cn } from "@/lib/utils";
6
6
 
7
7
  const Breadcrumb = React.forwardRef<
8
- HTMLElement,
9
- React.ComponentPropsWithoutRef<"nav"> & {
10
- separator?: React.ReactNode;
11
- }
8
+ HTMLElement,
9
+ React.ComponentPropsWithoutRef<"nav"> & {
10
+ separator?: React.ReactNode;
11
+ }
12
12
  >(({ ...props }, ref) => <nav aria-label="breadcrumb" ref={ref} {...props} />);
13
13
  Breadcrumb.displayName = "Breadcrumb";
14
14
 
15
15
  const BreadcrumbList = React.forwardRef<
16
- HTMLOListElement,
17
- React.ComponentPropsWithoutRef<"ol">
16
+ HTMLOListElement,
17
+ React.ComponentPropsWithoutRef<"ol">
18
18
  >(({ className, ...props }, ref) => (
19
- <ol
20
- className={cn(
21
- "flex flex-wrap items-center gap-1.5 break-words text-muted-foreground text-sm sm:gap-2.5",
22
- className
23
- )}
24
- ref={ref}
25
- {...props}
26
- />
19
+ <ol
20
+ className={cn(
21
+ "flex flex-wrap items-center gap-1.5 break-words text-muted-foreground text-sm sm:gap-2.5",
22
+ className,
23
+ )}
24
+ ref={ref}
25
+ {...props}
26
+ />
27
27
  ));
28
28
  BreadcrumbList.displayName = "BreadcrumbList";
29
29
 
30
30
  const BreadcrumbItem = React.forwardRef<
31
- HTMLLIElement,
32
- React.ComponentPropsWithoutRef<"li">
31
+ HTMLLIElement,
32
+ React.ComponentPropsWithoutRef<"li">
33
33
  >(({ className, ...props }, ref) => (
34
- <li
35
- className={cn("inline-flex items-center gap-1.5", className)}
36
- ref={ref}
37
- {...props}
38
- />
34
+ <li
35
+ className={cn("inline-flex items-center gap-1.5", className)}
36
+ ref={ref}
37
+ {...props}
38
+ />
39
39
  ));
40
40
  BreadcrumbItem.displayName = "BreadcrumbItem";
41
41
 
42
42
  const BreadcrumbLink = React.forwardRef<
43
- HTMLAnchorElement,
44
- React.ComponentPropsWithoutRef<"a"> & {
45
- asChild?: boolean;
46
- }
43
+ HTMLAnchorElement,
44
+ React.ComponentPropsWithoutRef<"a"> & {
45
+ asChild?: boolean;
46
+ }
47
47
  >(({ asChild, className, ...props }, ref) => {
48
- const Comp = asChild ? Slot : "a";
48
+ const Comp = asChild ? Slot : "a";
49
49
 
50
- return (
51
- <Comp
52
- className={cn("transition-colors hover:text-foreground", className)}
53
- ref={ref}
54
- {...props}
55
- />
56
- );
50
+ return (
51
+ <Comp
52
+ className={cn("transition-colors hover:text-foreground", className)}
53
+ ref={ref}
54
+ {...props}
55
+ />
56
+ );
57
57
  });
58
58
  BreadcrumbLink.displayName = "BreadcrumbLink";
59
59
 
60
60
  const BreadcrumbPage = React.forwardRef<
61
- HTMLSpanElement,
62
- React.ComponentPropsWithoutRef<"span">
61
+ HTMLSpanElement,
62
+ React.ComponentPropsWithoutRef<"span">
63
63
  >(({ className, ...props }, ref) => (
64
- <span
65
- aria-current="page"
66
- aria-disabled="true"
67
- className={cn("font-normal text-foreground", className)}
68
- ref={ref}
69
- role="link"
70
- {...props}
71
- />
64
+ <span
65
+ aria-current="page"
66
+ aria-disabled="true"
67
+ className={cn("font-normal text-foreground", className)}
68
+ ref={ref}
69
+ role="link"
70
+ {...props}
71
+ />
72
72
  ));
73
73
  BreadcrumbPage.displayName = "BreadcrumbPage";
74
74
 
75
75
  const BreadcrumbSeparator = ({
76
- children,
77
- className,
78
- ...props
76
+ children,
77
+ className,
78
+ ...props
79
79
  }: React.ComponentProps<"li">) => (
80
- <li
81
- aria-hidden="true"
82
- className={cn("[&>svg]:h-3.5 [&>svg]:w-3.5", className)}
83
- role="presentation"
84
- {...props}
85
- >
86
- {children ?? <ChevronRight />}
87
- </li>
80
+ <li
81
+ aria-hidden="true"
82
+ className={cn("[&>svg]:h-3.5 [&>svg]:w-3.5", className)}
83
+ role="presentation"
84
+ {...props}
85
+ >
86
+ {children ?? <ChevronRight />}
87
+ </li>
88
88
  );
89
89
  BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
90
90
 
91
91
  const BreadcrumbEllipsis = ({
92
- className,
93
- ...props
92
+ className,
93
+ ...props
94
94
  }: React.ComponentProps<"span">) => (
95
- <span
96
- aria-hidden="true"
97
- className={cn("flex h-9 w-9 items-center justify-center", className)}
98
- role="presentation"
99
- {...props}
100
- >
101
- <MoreHorizontal className="h-4 w-4" />
102
- <span className="sr-only">More</span>
103
- </span>
95
+ <span
96
+ aria-hidden="true"
97
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
98
+ role="presentation"
99
+ {...props}
100
+ >
101
+ <MoreHorizontal className="h-4 w-4" />
102
+ <span className="sr-only">More</span>
103
+ </span>
104
104
  );
105
105
  BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
106
106
 
107
107
  export {
108
- Breadcrumb,
109
- BreadcrumbList,
110
- BreadcrumbItem,
111
- BreadcrumbLink,
112
- BreadcrumbPage,
113
- BreadcrumbSeparator,
114
- BreadcrumbEllipsis,
108
+ Breadcrumb,
109
+ BreadcrumbEllipsis,
110
+ BreadcrumbItem,
111
+ BreadcrumbLink,
112
+ BreadcrumbList,
113
+ BreadcrumbPage,
114
+ BreadcrumbSeparator,
115
115
  };
@@ -4,79 +4,79 @@ import { Separator } from "@/components/ui/separator";
4
4
  import { cn } from "@/lib/utils";
5
5
 
6
6
  const buttonGroupVariants = cva(
7
- "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
8
- {
9
- variants: {
10
- orientation: {
11
- horizontal:
12
- "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
13
- vertical:
14
- "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
15
- },
16
- },
17
- defaultVariants: {
18
- orientation: "horizontal",
19
- },
20
- }
7
+ "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
8
+ {
9
+ variants: {
10
+ orientation: {
11
+ horizontal:
12
+ "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
13
+ vertical:
14
+ "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ orientation: "horizontal",
19
+ },
20
+ },
21
21
  );
22
22
 
23
23
  function ButtonGroup({
24
- className,
25
- orientation,
26
- ...props
24
+ className,
25
+ orientation,
26
+ ...props
27
27
  }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
28
- return (
29
- <div
30
- className={cn(buttonGroupVariants({ orientation }), className)}
31
- data-orientation={orientation}
32
- data-slot="button-group"
33
- role="group"
34
- {...props}
35
- />
36
- );
28
+ return (
29
+ <div
30
+ className={cn(buttonGroupVariants({ orientation }), className)}
31
+ data-orientation={orientation}
32
+ data-slot="button-group"
33
+ role="group"
34
+ {...props}
35
+ />
36
+ );
37
37
  }
38
38
 
39
39
  function ButtonGroupText({
40
- className,
41
- asChild = false,
42
- ...props
40
+ className,
41
+ asChild = false,
42
+ ...props
43
43
  }: React.ComponentProps<"div"> & {
44
- asChild?: boolean;
44
+ asChild?: boolean;
45
45
  }) {
46
- const Comp = asChild ? Slot : "div";
46
+ const Comp = asChild ? Slot : "div";
47
47
 
48
- return (
49
- <Comp
50
- className={cn(
51
- "flex items-center gap-2 rounded-md border bg-muted px-4 font-medium text-sm shadow-xs [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
52
- className
53
- )}
54
- {...props}
55
- />
56
- );
48
+ return (
49
+ <Comp
50
+ className={cn(
51
+ "flex items-center gap-2 rounded-md border bg-muted px-4 font-medium text-sm shadow-xs [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
52
+ className,
53
+ )}
54
+ {...props}
55
+ />
56
+ );
57
57
  }
58
58
 
59
59
  function ButtonGroupSeparator({
60
- className,
61
- orientation = "vertical",
62
- ...props
60
+ className,
61
+ orientation = "vertical",
62
+ ...props
63
63
  }: React.ComponentProps<typeof Separator>) {
64
- return (
65
- <Separator
66
- className={cn(
67
- "!m-0 relative self-stretch bg-input data-[orientation=vertical]:h-auto",
68
- className
69
- )}
70
- data-slot="button-group-separator"
71
- orientation={orientation}
72
- {...props}
73
- />
74
- );
64
+ return (
65
+ <Separator
66
+ className={cn(
67
+ "!m-0 relative self-stretch bg-input data-[orientation=vertical]:h-auto",
68
+ className,
69
+ )}
70
+ data-slot="button-group-separator"
71
+ orientation={orientation}
72
+ {...props}
73
+ />
74
+ );
75
75
  }
76
76
 
77
77
  export {
78
- ButtonGroup,
79
- ButtonGroupSeparator,
80
- ButtonGroupText,
81
- buttonGroupVariants,
78
+ ButtonGroup,
79
+ ButtonGroupSeparator,
80
+ ButtonGroupText,
81
+ buttonGroupVariants,
82
82
  };
@@ -5,56 +5,56 @@ import type * as React from "react";
5
5
  import { cn } from "@/lib/utils";
6
6
 
7
7
  const buttonVariants = cva(
8
- "inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all 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 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
- destructive:
14
- "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
15
- outline:
16
- "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
17
- secondary:
18
- "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
- ghost:
20
- "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
21
- link: "text-primary underline-offset-4 hover:underline",
22
- },
23
- size: {
24
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
25
- sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
26
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
27
- icon: "size-9",
28
- "icon-sm": "size-8",
29
- "icon-lg": "size-10",
30
- },
31
- },
32
- defaultVariants: {
33
- variant: "default",
34
- size: "default",
35
- },
36
- }
8
+ "inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all 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 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
+ destructive:
14
+ "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
15
+ outline:
16
+ "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
17
+ secondary:
18
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
+ ghost:
20
+ "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
21
+ link: "text-primary underline-offset-4 hover:underline",
22
+ },
23
+ size: {
24
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
25
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
26
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
27
+ icon: "size-9",
28
+ "icon-sm": "size-8",
29
+ "icon-lg": "size-10",
30
+ },
31
+ },
32
+ defaultVariants: {
33
+ variant: "default",
34
+ size: "default",
35
+ },
36
+ },
37
37
  );
38
38
 
39
39
  function Button({
40
- className,
41
- variant,
42
- size,
43
- asChild = false,
44
- ...props
40
+ className,
41
+ variant,
42
+ size,
43
+ asChild = false,
44
+ ...props
45
45
  }: React.ComponentProps<"button"> &
46
- VariantProps<typeof buttonVariants> & {
47
- asChild?: boolean;
48
- }) {
49
- const Comp = asChild ? Slot : "button";
46
+ VariantProps<typeof buttonVariants> & {
47
+ asChild?: boolean;
48
+ }) {
49
+ const Comp = asChild ? Slot : "button";
50
50
 
51
- return (
52
- <Comp
53
- className={cn(buttonVariants({ variant, size, className }))}
54
- data-slot="button"
55
- {...props}
56
- />
57
- );
51
+ return (
52
+ <Comp
53
+ className={cn(buttonVariants({ variant, size, className }))}
54
+ data-slot="button"
55
+ {...props}
56
+ />
57
+ );
58
58
  }
59
59
 
60
60
  export { Button, buttonVariants };
@@ -3,90 +3,90 @@ import type * as React from "react";
3
3
  import { cn } from "@/lib/utils";
4
4
 
5
5
  function Card({ className, ...props }: React.ComponentProps<"div">) {
6
- return (
7
- <div
8
- className={cn(
9
- "flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",
10
- className
11
- )}
12
- data-slot="card"
13
- {...props}
14
- />
15
- );
6
+ return (
7
+ <div
8
+ className={cn(
9
+ "flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",
10
+ className,
11
+ )}
12
+ data-slot="card"
13
+ {...props}
14
+ />
15
+ );
16
16
  }
17
17
 
18
18
  function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
19
- return (
20
- <div
21
- className={cn(
22
- "@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",
23
- className
24
- )}
25
- data-slot="card-header"
26
- {...props}
27
- />
28
- );
19
+ return (
20
+ <div
21
+ className={cn(
22
+ "@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",
23
+ className,
24
+ )}
25
+ data-slot="card-header"
26
+ {...props}
27
+ />
28
+ );
29
29
  }
30
30
 
31
31
  function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
32
- return (
33
- <div
34
- className={cn("font-semibold leading-none", className)}
35
- data-slot="card-title"
36
- {...props}
37
- />
38
- );
32
+ return (
33
+ <div
34
+ className={cn("font-semibold leading-none", className)}
35
+ data-slot="card-title"
36
+ {...props}
37
+ />
38
+ );
39
39
  }
40
40
 
41
41
  function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
42
- return (
43
- <div
44
- className={cn("text-muted-foreground text-sm", className)}
45
- data-slot="card-description"
46
- {...props}
47
- />
48
- );
42
+ return (
43
+ <div
44
+ className={cn("text-muted-foreground text-sm", className)}
45
+ data-slot="card-description"
46
+ {...props}
47
+ />
48
+ );
49
49
  }
50
50
 
51
51
  function CardAction({ className, ...props }: React.ComponentProps<"div">) {
52
- return (
53
- <div
54
- className={cn(
55
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
56
- className
57
- )}
58
- data-slot="card-action"
59
- {...props}
60
- />
61
- );
52
+ return (
53
+ <div
54
+ className={cn(
55
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
56
+ className,
57
+ )}
58
+ data-slot="card-action"
59
+ {...props}
60
+ />
61
+ );
62
62
  }
63
63
 
64
64
  function CardContent({ className, ...props }: React.ComponentProps<"div">) {
65
- return (
66
- <div
67
- className={cn("px-6", className)}
68
- data-slot="card-content"
69
- {...props}
70
- />
71
- );
65
+ return (
66
+ <div
67
+ className={cn("px-6", className)}
68
+ data-slot="card-content"
69
+ {...props}
70
+ />
71
+ );
72
72
  }
73
73
 
74
74
  function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
75
- return (
76
- <div
77
- className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
78
- data-slot="card-footer"
79
- {...props}
80
- />
81
- );
75
+ return (
76
+ <div
77
+ className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
78
+ data-slot="card-footer"
79
+ {...props}
80
+ />
81
+ );
82
82
  }
83
83
 
84
84
  export {
85
- Card,
86
- CardHeader,
87
- CardFooter,
88
- CardTitle,
89
- CardAction,
90
- CardDescription,
91
- CardContent,
85
+ Card,
86
+ CardAction,
87
+ CardContent,
88
+ CardDescription,
89
+ CardFooter,
90
+ CardHeader,
91
+ CardTitle,
92
92
  };
@@ -7,23 +7,23 @@ import * as React from "react";
7
7
  import { cn } from "@/lib/utils";
8
8
 
9
9
  const Checkbox = React.forwardRef<
10
- React.ElementRef<typeof CheckboxPrimitive.Root>,
11
- React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
10
+ React.ElementRef<typeof CheckboxPrimitive.Root>,
11
+ React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
12
12
  >(({ className, ...props }, ref) => (
13
- <CheckboxPrimitive.Root
14
- className={cn(
15
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
16
- className
17
- )}
18
- ref={ref}
19
- {...props}
20
- >
21
- <CheckboxPrimitive.Indicator
22
- className={cn("flex items-center justify-center text-current")}
23
- >
24
- <Check className="h-4 w-4" />
25
- </CheckboxPrimitive.Indicator>
26
- </CheckboxPrimitive.Root>
13
+ <CheckboxPrimitive.Root
14
+ className={cn(
15
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
16
+ className,
17
+ )}
18
+ ref={ref}
19
+ {...props}
20
+ >
21
+ <CheckboxPrimitive.Indicator
22
+ className={cn("flex items-center justify-center text-current")}
23
+ >
24
+ <Check className="h-4 w-4" />
25
+ </CheckboxPrimitive.Indicator>
26
+ </CheckboxPrimitive.Root>
27
27
  ));
28
28
  Checkbox.displayName = CheckboxPrimitive.Root.displayName;
29
29
 
@@ -8,4 +8,4 @@ const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
8
8
 
9
9
  const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
10
10
 
11
- export { Collapsible, CollapsibleTrigger, CollapsibleContent };
11
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger };