diff --git a/front/public/static/systemavatar/claudeInstant_avatar_full.png b/front/public/static/systemavatar/claudeInstant_avatar_full.png new file mode 100644 index 000000000000..ce5a0af77a54 Binary files /dev/null and b/front/public/static/systemavatar/claudeInstant_avatar_full.png differ diff --git a/front/public/static/systemavatar/llama_avatar_full.png b/front/public/static/systemavatar/llama_avatar_full.png new file mode 100644 index 000000000000..4beaeae23d74 Binary files /dev/null and b/front/public/static/systemavatar/llama_avatar_full.png differ diff --git a/front/public/static/systemavatar/mistral_avatar_full.png b/front/public/static/systemavatar/mistral_avatar_full.png new file mode 100644 index 000000000000..4a5d486cb36e Binary files /dev/null and b/front/public/static/systemavatar/mistral_avatar_full.png differ diff --git a/sparkle/package-lock.json b/sparkle/package-lock.json index f4179d226bb4..f4315019b35c 100644 --- a/sparkle/package-lock.json +++ b/sparkle/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dust-tt/sparkle", - "version": "0.1.93", + "version": "0.1.96", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dust-tt/sparkle", - "version": "0.1.93", + "version": "0.1.96", "license": "ISC", "dependencies": { "@headlessui/react": "^1.7.17" diff --git a/sparkle/package.json b/sparkle/package.json index ed4225e68b1f..4b52c1e02703 100644 --- a/sparkle/package.json +++ b/sparkle/package.json @@ -1,6 +1,6 @@ { "name": "@dust-tt/sparkle", - "version": "0.1.95", + "version": "0.1.96", "scripts": { "build": "rm -rf dist && rollup -c", "build:with-tw-base": "rollup -c --environment INCLUDE_TW_BASE:true", diff --git a/sparkle/src/components/Searchbar.tsx b/sparkle/src/components/Searchbar.tsx index 1807d7261ea1..7545a0a8fee5 100644 --- a/sparkle/src/components/Searchbar.tsx +++ b/sparkle/src/components/Searchbar.tsx @@ -1,8 +1,11 @@ -import React from "react"; +import React, { useRef } from "react"; -import { MagnifyingGlass } from "@sparkle/icons/stroke"; +import { Icon } from "@sparkle/components/Icon"; import { classNames } from "@sparkle/lib/utils"; +import { MagnifyingGlassStrokeIcon, XMarkIcon } from ".."; +import { IconButton } from "./IconButton"; + export function Searchbar({ placeholder, value, @@ -24,20 +27,33 @@ export function Searchbar({ disabled?: boolean; className?: string; }) { + const clearInputField = () => { + onChange?.(""); + }; + return (
-
+
- +
+ {value && onChange ? ( + + ) : ( + + )} +
diff --git a/sparkle/src/stories/Searchbar.stories.tsx b/sparkle/src/stories/Searchbar.stories.tsx index 9e450b6d8fb5..71261619a5c3 100644 --- a/sparkle/src/stories/Searchbar.stories.tsx +++ b/sparkle/src/stories/Searchbar.stories.tsx @@ -1,5 +1,5 @@ import type { Meta } from "@storybook/react"; -import React from "react"; +import React, { useState } from "react"; import { Searchbar } from "../index_with_tw_base"; @@ -10,34 +10,63 @@ const meta = { export default meta; -export const SearchbarExample = () => ( -
- - - - - -
-); +export const SearchbarExample = () => { + const [inputValue, setInputValue] = useState(""); + const [inputValue2, setInputValue2] = useState("value"); + const [inputValue3, setInputValue3] = useState("value"); + const [inputValue4, setInputValue4] = useState("value"); + + const handleChange = (value: string) => { + setInputValue(value); + }; + const handleChange2 = (value: string) => { + setInputValue2(value); + }; + const handleChange3 = (value: string) => { + setInputValue3(value); + }; + const handleChange4 = (value: string) => { + setInputValue4(value); + }; + + return ( +
+ + + + + +
+ ); +};