@ludo.ninja/components 2.3.52 → 2.3.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/search/searchSuggestions/index.js +1 -1
- package/build/components/search/searchSuggestions/searchSuggestionsItem/index.d.ts +1 -0
- package/build/components/search/searchSuggestions/searchSuggestionsItem/index.js +9 -2
- package/build/system/Overlay/index.js +12 -0
- package/package.json +1 -1
|
@@ -81,7 +81,7 @@ const SearchSuggestions = ({ searchTerm, assets = [], profiles = [], collections
|
|
|
81
81
|
caption: "Projects",
|
|
82
82
|
children: projects.map((project) => ((0, jsx_runtime_1.jsx)(searchSuggestionsItem_1.default, { name: project?.name, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["welcome"]}/x/${project?.slug}`,
|
|
83
83
|
// imgUrl={`${staticLink}/public/noContent/noContent.svg`}
|
|
84
|
-
searchTerm: searchTerm }, `${project?.id}.${Math.random()}`))),
|
|
84
|
+
searchTerm: searchTerm, projectRank: project?.ludoRank }, `${project?.id}.${Math.random()}`))),
|
|
85
85
|
},
|
|
86
86
|
]
|
|
87
87
|
: []),
|
|
@@ -11,6 +11,7 @@ const ScreenWidth_1 = require("../../../../styles/ScreenWidth");
|
|
|
11
11
|
const colors_1 = require("../../../../styles/colors");
|
|
12
12
|
const typography_1 = require("../../../../styles/typography");
|
|
13
13
|
const ImageInterceptor_1 = require("../../../../system/Img/ImageInterceptor");
|
|
14
|
+
const ui_1 = require("@ludo.ninja/ui");
|
|
14
15
|
// Styles
|
|
15
16
|
const StyledSearchSuggestionsItem = styled_components_1.default.div `
|
|
16
17
|
user-select: none;
|
|
@@ -41,6 +42,12 @@ const StyledSearchSuggestionsItem = styled_components_1.default.div `
|
|
|
41
42
|
color: ${colors_1.TextDarkGrayColor};
|
|
42
43
|
margin-left: auto;
|
|
43
44
|
}
|
|
45
|
+
|
|
46
|
+
.ludo-rank {
|
|
47
|
+
color: ${colors_1.TextGrayColor};
|
|
48
|
+
flex-grow: 1;
|
|
49
|
+
text-align: end;
|
|
50
|
+
}
|
|
44
51
|
|
|
45
52
|
.text {
|
|
46
53
|
display: flex;
|
|
@@ -119,10 +126,10 @@ const StyledSearchSuggestionsItem = styled_components_1.default.div `
|
|
|
119
126
|
}
|
|
120
127
|
`;
|
|
121
128
|
// Components
|
|
122
|
-
const SearchSuggestionsItem = ({ name, link, imgUrl, borderRadius, additionalHTML, searchTerm, afterText }) => ((0, jsx_runtime_1.jsx)(StyledSearchSuggestionsItem, { borderRadius: borderRadius, children: (0, jsx_runtime_1.jsxs)("a", { href: link, className: 'link', children: [Boolean(imgUrl) && ((0, jsx_runtime_1.jsx)(ImageInterceptor_1.ImageInterceptor, { borderRadiusSkeleton: borderRadius && 16, children: (0, jsx_runtime_1.jsx)("img", { src: imgUrl, alt: 'pirate', width: 32, height: 32 }) })), (0, jsx_runtime_1.jsxs)("div", { className: 'text', children: [(0, jsx_runtime_1.jsx)("p", { className: 'regular', children: (0, utils_1.searchQueryLetters)({
|
|
129
|
+
const SearchSuggestionsItem = ({ name, link, imgUrl, borderRadius, additionalHTML, searchTerm, projectRank, afterText }) => ((0, jsx_runtime_1.jsx)(StyledSearchSuggestionsItem, { borderRadius: borderRadius, children: (0, jsx_runtime_1.jsxs)("a", { href: link, className: 'link', children: [Boolean(imgUrl) && ((0, jsx_runtime_1.jsx)(ImageInterceptor_1.ImageInterceptor, { borderRadiusSkeleton: borderRadius && 16, children: (0, jsx_runtime_1.jsx)("img", { src: imgUrl, alt: 'pirate', width: 32, height: 32 }) })), (0, jsx_runtime_1.jsxs)("div", { className: 'text', children: [(0, jsx_runtime_1.jsx)("p", { className: 'regular', children: (0, utils_1.searchQueryLetters)({
|
|
123
130
|
text: name,
|
|
124
131
|
searchQuery: searchTerm,
|
|
125
132
|
className: 'strong',
|
|
126
|
-
}) }), afterText] }), additionalHTML] }) }));
|
|
133
|
+
}) }), afterText] }), (0, jsx_runtime_1.jsx)(ui_1.H5, { className: 'ludo-rank', children: projectRank ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["LR ", (0, jsx_runtime_1.jsx)("span", { style: { color: (0, utils_1.getRankColor)(projectRank), fontWeight: 700 }, children: projectRank })] })) : ((0, jsx_runtime_1.jsx)("span", { style: { color: colors_1.ErrorColor }, children: "Rugged" })) }), additionalHTML] }) }));
|
|
127
134
|
// Export
|
|
128
135
|
exports.default = SearchSuggestionsItem;
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
7
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
9
|
const ui_1 = require("../../store/ui");
|
|
9
10
|
const colors_1 = require("../../styles/colors");
|
|
@@ -35,6 +36,17 @@ const Overlay = () => {
|
|
|
35
36
|
closeOverlay: state.closeOverlay,
|
|
36
37
|
isOverlayActive: state.isOverlayActive,
|
|
37
38
|
}));
|
|
39
|
+
(0, react_1.useEffect)(() => {
|
|
40
|
+
const handleEsc = (event) => {
|
|
41
|
+
if (event.key === 'Escape') {
|
|
42
|
+
closeOverlay();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
window.addEventListener('keydown', handleEsc);
|
|
46
|
+
return () => {
|
|
47
|
+
window.removeEventListener('keydown', handleEsc);
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
38
50
|
return ((0, jsx_runtime_1.jsx)(StyledOverlay, { isActive: isOverlayActive, onClick: closeOverlay, children: (0, jsx_runtime_1.jsx)("div", { className: 'blur' }) }));
|
|
39
51
|
};
|
|
40
52
|
// Export
|