diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES index 019e924..f31717d 100644 --- a/THIRD-PARTY-NOTICES +++ b/THIRD-PARTY-NOTICES @@ -142,8 +142,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The following NPM packages may be included in this product: - @yext/chat-core@0.8.2 - - @yext/chat-headless-react@0.9.0 - - @yext/chat-headless@0.10.0 + - @yext/chat-headless-react@0.9.1 + - @yext/chat-headless@0.10.1 These packages each contain the following license and notice below: diff --git a/package-lock.json b/package-lock.json index 3993e96..ccc33b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@yext/chat-ui-react", - "version": "0.11.0", + "version": "0.11.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@yext/chat-ui-react", - "version": "0.11.0", + "version": "0.11.3", "license": "BSD-3-Clause", "dependencies": { "react-markdown": "^6.0.3", @@ -37,7 +37,7 @@ "@testing-library/user-event": "^14.4.3", "@types/jest": "^29.5.1", "@types/react": "^18.2.7", - "@yext/chat-headless-react": "^0.9.0", + "@yext/chat-headless-react": "^0.9.1", "@yext/eslint-config": "^1.0.0", "babel-jest": "^29.5.0", "eslint": "^8.39.0", @@ -59,7 +59,7 @@ "typescript": "^5.0.4" }, "peerDependencies": { - "@yext/chat-headless-react": "^0.9.0", + "@yext/chat-headless-react": "^0.9.1", "react": "^16.14 || ^17 || ^18", "react-dom": "^16.14 || ^17 || || ^18" } @@ -8182,9 +8182,9 @@ } }, "node_modules/@yext/chat-headless": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@yext/chat-headless/-/chat-headless-0.10.0.tgz", - "integrity": "sha512-rYabLNfU8KcMDw/HqAkWbFuu2AavSjEtU5kYYAVdTRcS3LyrsNXe/l7lp11R3RCmJCcJnn5TXqhcTKzfI8I9zA==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@yext/chat-headless/-/chat-headless-0.10.1.tgz", + "integrity": "sha512-CuJw7IdPo3ZE8SdypgDuSDEMpnYsRgjKf4ZYF+a4qxNLlgs5wsORzKiqxo6PmK/+yf3A71s0nwVHGxvVlT4YQA==", "dev": true, "dependencies": { "@reduxjs/toolkit": "^1.9.5", @@ -8193,13 +8193,13 @@ } }, "node_modules/@yext/chat-headless-react": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@yext/chat-headless-react/-/chat-headless-react-0.9.0.tgz", - "integrity": "sha512-8JaLGsAm6YW6fNKZqOzMQOM/i3HcbEND8M4WCvt8lz4kLqV0qeA8KsBZWEM7NX7/rGafwzeLQzYGD8B1EW7Jfg==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@yext/chat-headless-react/-/chat-headless-react-0.9.1.tgz", + "integrity": "sha512-tRfi4isVzAYGrJL1ikz+bCEsk4cTkZgLO/K0Sk48Et/AyixWsdfFy+JaP8NGpnB1OZH2n7lVkRB7R80bzhMUjg==", "dev": true, "dependencies": { "@reduxjs/toolkit": "^1.9.5", - "@yext/chat-headless": "^0.10.0", + "@yext/chat-headless": "^0.10.1", "react-redux": "^8.0.5" }, "peerDependencies": { diff --git a/package.json b/package.json index 3cb3b1e..925fa5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@yext/chat-ui-react", - "version": "0.11.0", + "version": "0.11.3", "description": "A library of React Components for powering Yext Chat integrations.", "author": "clippy@yext.com", "main": "./lib/commonjs/src/index.js", @@ -69,7 +69,7 @@ "@testing-library/user-event": "^14.4.3", "@types/jest": "^29.5.1", "@types/react": "^18.2.7", - "@yext/chat-headless-react": "^0.9.0", + "@yext/chat-headless-react": "^0.9.1", "@yext/eslint-config": "^1.0.0", "babel-jest": "^29.5.0", "eslint": "^8.39.0", @@ -91,7 +91,7 @@ "typescript": "^5.0.4" }, "peerDependencies": { - "@yext/chat-headless-react": "^0.9.0", + "@yext/chat-headless-react": "^0.9.1", "react": "^16.14 || ^17 || ^18", "react-dom": "^16.14 || ^17 || || ^18" }, diff --git a/src/components/ChatInput.tsx b/src/components/ChatInput.tsx index 26bae4f..a6b0919 100644 --- a/src/components/ChatInput.tsx +++ b/src/components/ChatInput.tsx @@ -80,7 +80,7 @@ export interface ChatInputProps { export function ChatInput({ placeholder = "Type a message...", stream = false, - inputAutoFocus = false, + inputAutoFocus = true, handleError, sendButtonIcon = , customCssClasses, diff --git a/src/components/FeedbackButtons.tsx b/src/components/FeedbackButtons.tsx index 205d250..7e5f987 100644 --- a/src/components/FeedbackButtons.tsx +++ b/src/components/FeedbackButtons.tsx @@ -25,7 +25,7 @@ export interface FeedbackButtonsCssClasses { const builtInCssClasses: FeedbackButtonsCssClasses = withStylelessCssClasses("FeedbackButtons", { container: - "flex gap-x-1 absolute -right-1 -top-3 opacity-0 group-hover:opacity-100 duration-200", + "flex gap-x-1 absolute -right-1 -top-3 [@media(hover:hover)]:opacity-0 group-hover:opacity-100 duration-200", thumbsUpButton: "w-6 h-6 bg-gray-700 rounded-md flex justify-center items-center", thumbsUpIcon: "text-white w-[22px] h-[22px] stroke-[0.2]", diff --git a/tailwind.config.js b/tailwind.config.js index 651b9fe..e758e7e 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -29,4 +29,7 @@ module.exports = { require("@tailwindcss/typography"), require("@tailwindcss/container-queries"), ], + future: { + hoverOnlyWhenSupported: true, + }, }; diff --git a/test-site/package-lock.json b/test-site/package-lock.json index 70d4f05..82c133d 100644 --- a/test-site/package-lock.json +++ b/test-site/package-lock.json @@ -23,7 +23,7 @@ }, "..": { "name": "@yext/chat-ui-react", - "version": "0.11.0", + "version": "0.11.3", "license": "BSD-3-Clause", "dependencies": { "react-markdown": "^6.0.3", @@ -54,7 +54,7 @@ "@testing-library/user-event": "^14.4.3", "@types/jest": "^29.5.1", "@types/react": "^18.2.7", - "@yext/chat-headless-react": "^0.9.0", + "@yext/chat-headless-react": "^0.9.1", "@yext/eslint-config": "^1.0.0", "babel-jest": "^29.5.0", "eslint": "^8.39.0", @@ -76,7 +76,7 @@ "typescript": "^5.0.4" }, "peerDependencies": { - "@yext/chat-headless-react": "^0.9.0", + "@yext/chat-headless-react": "^0.9.1", "react": "^16.14 || ^17 || ^18", "react-dom": "^16.14 || ^17 || || ^18" } diff --git a/tests/components/ChatInput.test.tsx b/tests/components/ChatInput.test.tsx index cc88f0c..8c7b461 100644 --- a/tests/components/ChatInput.test.tsx +++ b/tests/components/ChatInput.test.tsx @@ -35,16 +35,16 @@ it("updates text when type in textarea", async () => { expect(textbox).toHaveDisplayValue("test"); }); -it("does not focus on input box by default", async () => { +it("maintains focus on input box by default", async () => { render(); const textbox = screen.getByRole("textbox"); - expect(textbox).not.toHaveFocus(); + expect(textbox).toHaveFocus(); }); -it("maintains focus on input box when inputAutoFocus field is set to true", async () => { - render(); +it("does not focus on input box when inputAutoFocus field is set to false", async () => { + render(); const textbox = screen.getByRole("textbox"); - expect(textbox).toHaveFocus(); + expect(textbox).not.toHaveFocus(); }); it("sends request and reset input when click on send button", async () => {