Skip to content

Commit 0cb0ab1

Browse files
feat: clear HeroUI components (#557)
Co-authored-by: Dawid Żywczak <dawid.zywczak@deepsense.ai>
1 parent a89531e commit 0cb0ab1

File tree

14 files changed

+94
-265
lines changed

14 files changed

+94
-265
lines changed

packages/ragbits-chat/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- remove HeroUI Pro components (#557)
6+
57
## 0.18.0 (2025-05-22)
68

79
### Changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import{H as e}from"./index-BDc1cJws.js";const i=()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Example Plugin"}),e.jsx("p",{children:"This is an example plugin."})]});export{i as default};
1+
import{H as e}from"./index-CNA7APJN.js";const i=()=>e.jsxs("div",{children:[e.jsx("h1",{children:"Example Plugin"}),e.jsx("p",{children:"This is an example plugin."})]});export{i as default};

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackFormPluginComponent-DKd_HI_j.js renamed to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackFormPluginComponent-BwrAso48.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-BDc1cJws.js renamed to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-CNA7APJN.js

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-D23L4yB9.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-Dk4Ry3-1.js renamed to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-DnBwcsXi.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-DxlHc-HZ.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/ragbits-chat/src/ragbits/chat/ui-build/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<link rel="icon" type="image/svg+xml" href="/assets/ragbits-9U4hpuUb.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Ragbits</title>
8-
<script type="module" crossorigin src="/assets/index-BDc1cJws.js"></script>
9-
<link rel="stylesheet" crossorigin href="/assets/index-DxlHc-HZ.css">
8+
<script type="module" crossorigin src="/assets/index-CNA7APJN.js"></script>
9+
<link rel="stylesheet" crossorigin href="/assets/index-D23L4yB9.css">
1010
</head>
1111

1212
<body class="h-full">

ui/src/App.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,16 @@ export default function Component() {
4545
const handleScroll = useCallback(() => {
4646
const AUTO_SCROLL_THRESHOLD = 25;
4747
const SCROLL_DOWN_THRESHOLD = 100;
48+
4849
if (!scrollContainerRef.current) return;
50+
4951
const container = scrollContainerRef.current;
5052
const offsetFromBottom =
5153
container.scrollHeight - container.scrollTop - container.clientHeight;
5254

5355
setShowScrollDownButton(offsetFromBottom > SCROLL_DOWN_THRESHOLD);
5456
setShouldAutoScroll(false);
57+
5558
if (offsetFromBottom > AUTO_SCROLL_THRESHOLD) {
5659
setShouldAutoScroll(false);
5760
} else {
@@ -62,6 +65,7 @@ export default function Component() {
6265
useEffect(() => {
6366
if (configRequest.data) {
6467
const config = configRequest.data.data;
68+
6569
setConfig(config);
6670
}
6771
}, [configRequest.data]);
@@ -78,6 +82,7 @@ export default function Component() {
7882

7983
useEffect(() => {
8084
setShouldAutoScroll(true);
85+
8186
if (history.length === 0) {
8287
setShowScrollDownButton(false);
8388
}
@@ -103,10 +108,12 @@ export default function Component() {
103108

104109
const scrollToBottom = useCallback(() => {
105110
if (!scrollContainerRef.current) return;
111+
106112
scrollContainerRef.current.scrollTo({
107113
top: scrollContainerRef.current.scrollHeight,
108114
behavior: "smooth",
109115
});
116+
110117
setShouldAutoScroll(true);
111118
}, []);
112119

@@ -142,6 +149,7 @@ export default function Component() {
142149

143150
const handleSubmit = () => {
144151
sendMessage(message);
152+
setMessage("");
145153
};
146154

147155
const heroMessage = `Hello! I'm your AI assistant.\n\n How can I help you today?

ui/src/core/components/ChatMessage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ const ChatMessage = forwardRef<HTMLDivElement, ChatMessageProps>(
2929
ref,
3030
) => {
3131
const rightAlign = role === MessageRole.USER;
32+
3233
const [didAnimate, setDidAnimate] = useState(false);
33-
const copyIconTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
3434
const [copyIcon, setCopyIcon] = useState("heroicons:clipboard");
35+
36+
const copyIconTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
3537
const { theme } = useThemeContext();
3638

3739
const onCopyClick = () => {

ui/src/core/components/PromptInput/PromptInput.tsx

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ const PromptInput = ({
1919
submit,
2020
isLoading,
2121
}: PromptInputProps) => {
22-
const inputRef = React.useRef<HTMLTextAreaElement>(null);
22+
const textAreaRef = React.useRef<HTMLTextAreaElement>(null);
2323

2424
const handleSubmit = useCallback(() => {
25-
if (!prompt && !isLoading) return;
25+
if (!message && !isLoading) return;
2626

2727
submit();
28-
setMessage("");
29-
inputRef?.current?.focus();
30-
}, [setMessage, isLoading, submit]);
28+
textAreaRef?.current?.focus();
29+
}, [isLoading, submit, message]);
3130

3231
const onSubmit = useCallback(
3332
(e: React.FormEvent<HTMLFormElement>) => {
3433
e.preventDefault();
34+
3535
handleSubmit();
3636
},
3737
[handleSubmit],
@@ -50,52 +50,46 @@ const PromptInput = ({
5050

5151
return (
5252
<Form
53-
className="flex w-full flex-row items-start rounded-medium bg-default-100 dark:bg-default-100"
53+
className="flex w-full flex-row items-center rounded-medium bg-default-100 pl-0 pr-2 dark:bg-default-100"
5454
validationBehavior="native"
5555
onSubmit={onSubmit}
5656
>
5757
<PromptInputText
58-
ref={inputRef}
59-
autoFocus
58+
ref={textAreaRef}
59+
aria-label="Message"
6060
classNames={{
61-
innerWrapper: "relative",
62-
input: "text-medium h-auto w-full",
61+
input: "text-medium",
6362
inputWrapper:
64-
"!bg-transparent shadow-none group-data-[focus-visible=true]:ring-0 group-data-[focus-visible=true]:ring-offset-0 pr-3 pl-[20px] pt-3 pb-4",
63+
"!bg-transparent shadow-none group-data-[focus-visible=true]:ring-0 group-data-[focus-visible=true]:ring-offset-0 py-4",
6564
}}
65+
name="message"
66+
placeholder="Enter a message here"
67+
autoFocus
6668
maxRows={16}
67-
minRows={2}
68-
name="content"
69-
radius="lg"
70-
spellCheck={"false"}
69+
minRows={1}
7170
value={message}
72-
variant="flat"
7371
onKeyDown={handleKeyDown}
7472
onValueChange={setMessage}
7573
/>
76-
<div className="flex flex-row items-center justify-end p-3">
77-
<Button
78-
isIconOnly
79-
color={!prompt ? "default" : "primary"}
80-
isDisabled={!prompt || isLoading}
81-
radius="full"
82-
size="sm"
83-
type="submit"
84-
variant="solid"
85-
>
86-
<Icon
87-
className={cn(
88-
"[&>path]:stroke-[2px]",
89-
!prompt ? "text-default-600" : "text-primary-foreground",
90-
)}
91-
icon="iconamoon:arrow-up-1-thin"
92-
width={20}
93-
/>
94-
</Button>
95-
</div>
74+
<Button
75+
isIconOnly
76+
color={!message ? "default" : "primary"}
77+
isDisabled={!message || isLoading}
78+
radius="full"
79+
size="sm"
80+
type="submit"
81+
>
82+
<Icon
83+
className={cn(
84+
"[&>path]:stroke-[2px]",
85+
!message ? "text-default-600" : "text-primary-foreground",
86+
)}
87+
icon="iconamoon:arrow-up-1-thin"
88+
width={20}
89+
/>
90+
</Button>
9691
</Form>
9792
);
9893
};
9994

10095
export default PromptInput;
101-
PromptInput.displayName = "PromptInput";

ui/src/core/components/PromptInput/PromptInputAssets.tsx

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
11
import type { TextAreaProps } from "@heroui/react";
2-
3-
import React from "react";
2+
import { forwardRef } from "react";
43
import { Textarea } from "@heroui/react";
5-
import { cn } from "@heroui/react";
64

7-
const PromptInputText = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(
5+
const PromptInputText = forwardRef<HTMLTextAreaElement, TextAreaProps>(
86
({ classNames = {}, ...props }, ref) => {
97
return (
108
<Textarea
119
ref={ref}
12-
aria-label="Prompt"
13-
className="min-h-[40px]"
14-
classNames={{
15-
...classNames,
16-
label: cn("hidden", classNames?.label),
17-
input: cn("py-0", classNames?.input),
18-
}}
19-
minRows={1}
20-
placeholder="Enter a prompt here"
21-
radius="lg"
22-
variant="bordered"
10+
className="min-h-[50px]"
11+
classNames={classNames}
2312
{...props}
2413
/>
2514
);
2615
},
2716
);
2817

2918
export default PromptInputText;
30-
31-
PromptInputText.displayName = "PromptInputText";

ui/src/core/components/SidebarDrawer.tsx

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)