Skip to content

Commit

Permalink
Merge branch 'master' of github.com:xola/ui-kit into X2-6577
Browse files Browse the repository at this point in the history
* 'master' of github.com:xola/ui-kit:
  New X icon for twitter (X2-6791) (xola#263)
  2.1.14
  X2-6853 : Not able to search traveler in quick search with valid booking (xola#257)
  • Loading branch information
rushi committed Sep 8, 2023
2 parents 14fa503 + a5a79a9 commit b6cadb3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xola/ui-kit",
"version": "2.1.13",
"version": "2.1.14",
"description": "Xola UI Kit",
"license": "MIT",
"files": [
Expand Down
11 changes: 9 additions & 2 deletions src/components/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const Search = ({
shouldStayOpen = false,
shouldDestroyOnClose = true,
shouldHideMenu = false,
minChars = 0,
...rest
}) => {
const [showShortcutKey, setShowShortcutKey] = useState(true);
Expand Down Expand Up @@ -123,7 +124,7 @@ export const Search = ({

// Show dropdown only when `isOpen` is set to `true` and there are items in the list.
const open = (isOpen || !canClose || shouldStayOpen) && itemList.length > 0 && !shouldHideMenu;
const noResultFound = open && !isLoading && itemList.length <= 1;
const noResultFound = open && !isLoading && itemList.length <= 1 && inputValue.length >= minChars;

// Keyboard shortcuts.
useHotkeys(isOSX ? "cmd+k" : "ctrl+k", (event) => {
Expand Down Expand Up @@ -190,7 +191,13 @@ export const Search = ({
highlightedIndex === index ? "bg-blue-light text-white" : "",
)}
>
Show all results for <strong>{inputValue}</strong>
{inputValue.length >= minChars ? (
<>
Show all results for <strong>{inputValue}</strong>
</>
) : (
`Enter at least ${minChars} characters to begin search`
)}
</div>

{isLoading ? (
Expand Down
15 changes: 15 additions & 0 deletions src/icons/Logos/XIcon.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import { createIcon } from "../../helpers/icon";

export const XIcon = createIcon((props) => {
return (
<svg xmlns="http://www.w3.org/2000/svg" width={18} height={18} viewBox="0 0 30 30" {...props}>
<path
d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z"
fill="#000"
/>
</svg>
);
});

XIcon.tags = ["logo", "social media", "x"];
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export { WarningTriangleIcon } from "./icons/WarningTriangleIcon";
export { WeightIcon } from "./icons/WeightIcon";
export { WifiIcon } from "./icons/WifiIcon";
export { WriteIcon } from "./icons/WriteIcon";
export { XIcon } from "./icons/Logos/XIcon";
export { XolaBotIcon } from "./icons/XolaBotIcon";
export { XrayIcon } from "./icons/XrayIcon";
export { YelpIcon } from "./icons/Logos/YelpIcon";
Expand Down

0 comments on commit b6cadb3

Please sign in to comment.