Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
iipanda committed Oct 21, 2024
1 parent bdbd0c1 commit b722eb1
Show file tree
Hide file tree
Showing 406 changed files with 9 additions and 7,040 deletions.
18 changes: 0 additions & 18 deletions .kodiak.toml

This file was deleted.

174 changes: 0 additions & 174 deletions CONTRIBUTING.md

This file was deleted.

4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ Beautifully designed chatbot components built with and compatible with the shadc

Visit http://sck.blazity.com/docs to view the documentation.

## Contributing

Please read the [contributing guide](/CONTRIBUTING.md).

## License

Licensed under the [MIT license](https://github.com/Blazity/shadcn-chatbot-kit/blob/main/LICENSE.md).
10 changes: 5 additions & 5 deletions apps/www/content/docs/components/sidebar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,11 @@ The `SidebarProvider` component is used to provide the sidebar context to the `S

### Props

| Name | Type | Description |
| ------------- | ------------------------- | -------------------------------------------- |
| `defaultOpen` | `boolean` | Default open state of the sidebar. |
| `open` | `boolean` | Open state of the sidebar (controlled). |
| `onOpenChange`| `(open: boolean) => void` | Sets open state of the sidebar (controlled). |
| Name | Type | Description |
| -------------- | ------------------------- | -------------------------------------------- |
| `defaultOpen` | `boolean` | Default open state of the sidebar. |
| `open` | `boolean` | Open state of the sidebar (controlled). |
| `onOpenChange` | `(open: boolean) => void` | Sets open state of the sidebar (controlled). |

### Width

Expand Down
12 changes: 0 additions & 12 deletions apps/www/public/r/chat-bubble.json

This file was deleted.

13 changes: 0 additions & 13 deletions apps/www/public/r/chat-demo.json

This file was deleted.

2 changes: 1 addition & 1 deletion apps/www/public/r/chat-message.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
{
"path": "ui/chat-message.tsx",
"content": "\"use client\"\n\nimport React from \"react\"\nimport type { Attachment } from \"ai\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { ThumbsDown, ThumbsUp } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/default/ui/button\"\nimport { CopyButton } from \"@/registry/default/ui/copy-button\"\nimport { MarkdownRenderer } from \"@/registry/default/ui/markdown-renderer\"\n\nconst chatBubbleVariants = cva(\n \"group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]\",\n {\n variants: {\n isUser: {\n true: \"bg-primary\",\n false: \"bg-muted\",\n },\n animation: {\n none: \"\",\n slide: \"animate-in fade-in-0 duration-300\",\n scale: \"animate-in fade-in-0 zoom-in-75 duration-300\",\n fade: \"animate-in fade-in-0 duration-500\",\n },\n },\n compoundVariants: [\n {\n isUser: true,\n animation: \"slide\",\n class: \"slide-in-from-right\",\n },\n {\n isUser: false,\n animation: \"slide\",\n class: \"slide-in-from-left\",\n },\n {\n isUser: true,\n animation: \"scale\",\n class: \"origin-bottom-right\",\n },\n {\n isUser: false,\n animation: \"scale\",\n class: \"origin-bottom-left\",\n },\n ],\n }\n)\n\ntype Animation = VariantProps<typeof chatBubbleVariants>[\"animation\"]\n\nexport interface Message {\n id: string\n role: \"user\" | \"assistant\" | (string & {})\n content: string\n createdAt?: Date\n experimental_attachments?: Attachment[]\n}\n\nexport interface ChatMessageProps extends Message {\n showTimeStamp?: boolean\n animation?: Animation\n}\n\nexport const ChatMessage: React.FC<ChatMessageProps> = ({\n role,\n content,\n createdAt,\n showTimeStamp = true,\n animation = \"scale\",\n}) => {\n const isUser = role === \"user\"\n\n const formattedTime = createdAt?.toLocaleTimeString(\"en-US\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })\n\n return (\n <div className={cn(\"flex flex-col\", isUser ? \"items-end\" : \"items-start\")}>\n <div className={chatBubbleVariants({ isUser, animation })}>\n {/* TODO: improve markdown rendering */}\n <div\n className={cn(\n \"space-y-3\",\n isUser ? \"text-primary-foreground\" : \"text-foreground\"\n )}\n >\n <MarkdownRenderer content={content} />\n </div>\n\n {role === \"assistant\" ? (\n <div className=\"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 opacity-0 transition-opacity group-hover/message:opacity-100\">\n <div className=\"border-r pr-1\">\n <CopyButton\n content={content}\n copyMessage=\"Copied response to clipboard!\"\n />\n </div>\n <Button size=\"icon\" variant=\"ghost\" className=\"h-6 w-6\">\n <ThumbsUp className=\"h-4 w-4\" />\n </Button>\n <Button size=\"icon\" variant=\"ghost\" className=\"h-6 w-6\">\n <ThumbsDown className=\"h-4 w-4\" />\n </Button>\n </div>\n ) : null}\n </div>\n\n {showTimeStamp && createdAt ? (\n <span\n className={cn(\n \"mt-1 block px-1 text-xs opacity-50\",\n animation !== \"none\" && \"animate-in fade-in-0 duration-500\"\n )}\n >\n {formattedTime}\n </span>\n ) : null}\n </div>\n )\n}\n",
"content": "\"use client\"\n\nimport React from \"react\"\nimport type { Attachment } from \"ai\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { ThumbsDown, ThumbsUp } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/default/ui/button\"\nimport { CopyButton } from \"@/registry/default/ui/copy-button\"\nimport { MarkdownRenderer } from \"@/registry/default/ui/markdown-renderer\"\n\nconst chatBubbleVariants = cva(\n \"group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]\",\n {\n variants: {\n isUser: {\n true: \"bg-primary\",\n false: \"bg-muted\",\n },\n animation: {\n none: \"\",\n slide: \"animate-in fade-in-0 duration-300\",\n scale: \"animate-in fade-in-0 zoom-in-75 duration-300\",\n fade: \"animate-in fade-in-0 duration-500\",\n },\n },\n compoundVariants: [\n {\n isUser: true,\n animation: \"slide\",\n class: \"slide-in-from-right\",\n },\n {\n isUser: false,\n animation: \"slide\",\n class: \"slide-in-from-left\",\n },\n {\n isUser: true,\n animation: \"scale\",\n class: \"origin-bottom-right\",\n },\n {\n isUser: false,\n animation: \"scale\",\n class: \"origin-bottom-left\",\n },\n ],\n }\n)\n\ntype Animation = VariantProps<typeof chatBubbleVariants>[\"animation\"]\n\nexport interface Message {\n id: string\n role: \"user\" | \"assistant\" | (string & {})\n content: string\n createdAt?: Date\n experimental_attachments?: Attachment[]\n}\n\nexport interface ChatMessageProps extends Message {\n showTimeStamp?: boolean\n animation?: Animation\n}\n\nexport const ChatMessage: React.FC<ChatMessageProps> = ({\n role,\n content,\n createdAt,\n showTimeStamp = false,\n animation = \"scale\",\n}) => {\n const isUser = role === \"user\"\n\n const formattedTime = createdAt?.toLocaleTimeString(\"en-US\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })\n\n return (\n <div className={cn(\"flex flex-col\", isUser ? \"items-end\" : \"items-start\")}>\n <div className={chatBubbleVariants({ isUser, animation })}>\n <div\n className={cn(\n \"space-y-3\",\n isUser ? \"text-primary-foreground\" : \"text-foreground\"\n )}\n >\n <MarkdownRenderer>{content}</MarkdownRenderer>\n </div>\n\n {role === \"assistant\" ? (\n <div className=\"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 opacity-0 transition-opacity group-hover/message:opacity-100\">\n <div className=\"border-r pr-1\">\n <CopyButton\n content={content}\n copyMessage=\"Copied response to clipboard!\"\n />\n </div>\n <Button size=\"icon\" variant=\"ghost\" className=\"h-6 w-6\">\n <ThumbsUp className=\"h-4 w-4\" />\n </Button>\n <Button size=\"icon\" variant=\"ghost\" className=\"h-6 w-6\">\n <ThumbsDown className=\"h-4 w-4\" />\n </Button>\n </div>\n ) : null}\n </div>\n\n {showTimeStamp && createdAt ? (\n <span\n className={cn(\n \"mt-1 block px-1 text-xs opacity-50\",\n animation !== \"none\" && \"animate-in fade-in-0 duration-500\"\n )}\n >\n {formattedTime}\n </span>\n ) : null}\n </div>\n )\n}\n",
"type": "registry:ui",
"target": ""
}
Expand Down
Loading

0 comments on commit b722eb1

Please sign in to comment.