Skip to content

Commit

Permalink
filip(feat): add search button
Browse files Browse the repository at this point in the history
  • Loading branch information
fstoqnov-iohk committed May 13, 2024
1 parent c5195d0 commit f59a94d
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 9 deletions.
8 changes: 7 additions & 1 deletion .docusaurus/codeTranslations.json
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
{}
{
"cmfcmf/d-s-l.searchBar.placeholder": "Search...",
"cmfcmf/d-s-l.searchBar.noResults": "No results found.",
"cmfcmf/d-s-l.searchBar.clearButtonTitle": "Clear",
"cmfcmf/d-s-l.searchBar.detachedCancelButtonText": "Cancel",
"cmfcmf/d-s-l.searchBar.submitButtonTitle": "Submit"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2581,6 +2581,7 @@
},
"docusaurus-plugin-debug": {},
"docusaurus-theme-classic": {},
"@cmfcmf/docusaurus-search-local": {},
"docusaurus-node-polyfills": {},
"docusaurus-plugin-client-redirects": {},
"docusaurus-bootstrap-plugin": {},
Expand Down
6 changes: 6 additions & 0 deletions .docusaurus/docusaurus.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ export default {
"localeConfigs": {}
},
"plugins": [
[
"@cmfcmf/docusaurus-search-local",
{
"indexDocs": true
}
],
[
"docusaurus-node-polyfills",
{
Expand Down
10 changes: 10 additions & 0 deletions .docusaurus/globalData.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"@cmfcmf/docusaurus-search-local": {
"default": {
"titleBoost": 5,
"contentBoost": 1,
"tagsBoost": 3,
"parentCategoriesBoost": 2,
"indexDocSidebarParentCategories": 0,
"maxSearchResults": 8
}
},
"docusaurus-plugin-content-docs": {
"default": {
"path": "/",
Expand Down
5 changes: 5 additions & 0 deletions .docusaurus/site-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
"name": "@docusaurus/theme-classic",
"version": "3.1.1"
},
"@cmfcmf/docusaurus-search-local": {
"type": "package",
"name": "@cmfcmf/docusaurus-search-local",
"version": "1.1.0"
},
"docusaurus-node-polyfills": {
"type": "package",
"name": "docusaurus-node-polyfills",
Expand Down
6 changes: 6 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ const config: Config = {
},

plugins: [
[
'@cmfcmf/docusaurus-search-local',
{
indexDocs: true,
},
],
['docusaurus-node-polyfills', { excludeAliases: ['console'] }],
[
'@docusaurus/plugin-client-redirects',
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"typecheck": "tsc"
},
"dependencies": {
"@cmfcmf/docusaurus-search-local": "^1.1.0",
"@ctrl/tinycolor": "^4.0.3",
"@docusaurus/core": "3.1.1",
"@docusaurus/plugin-client-redirects": "3.1.1",
Expand All @@ -39,6 +40,7 @@
"path-browserify": "^1.0.1",
"posthog-js": "^1.76.0",
"prism-react-renderer": "^2.3.0",
"puppeteer": "^5.3.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-google-recaptcha": "^3.1.0",
Expand All @@ -47,8 +49,7 @@
"react-tooltip": "^4.2.21",
"styled-components": "^6.1.10",
"styled-icons": "^9.0.1",
"victory": "^36.5.3",
"puppeteer": "^5.3.1"
"victory": "^36.5.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.1.1",
Expand Down
27 changes: 26 additions & 1 deletion src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,30 @@ body {
background-color: #fff;
}

.aa-DetachedSearchButtonPlaceholder {
display: none;
}

.aa-DetachedSearchButtonQuery {
display: none;
}

.aa-DetachedSearchButton {
border-radius: 20px !important;
padding: 0 !important;
background-color: #fff !important;
}

.aa-DetachedSearchButtonIcon {
color: rgba(62, 52, 211) !important;
}

@media (max-width: 1445px) {
.navbar__link {
max-width: 120px;
}
}

@media (max-width: 1380px) {
.navbar__link {
font-size: 12px;
Expand All @@ -231,7 +255,8 @@ body {
padding: 3rem 1.5rem;
}
.navbar__link {
max-width: 88px;
font-size: 10.5px;
max-width: 81px;
}
}

Expand Down
82 changes: 77 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# yarn lockfile v1


"@algolia/[email protected]":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.17.0.tgz#b9e62d9677dc0ee818bb59d917ff58908356a9a0"
integrity sha512-6E4sVb5+fGtSQs9mULlxUH84OWFUVZPMapa5dMCtUc7KyDRLY6+X/dA8xbDA8CX5phdBn1plLUET1B6NZnrZuw==
dependencies:
"@algolia/autocomplete-plugin-algolia-insights" "1.17.0"
"@algolia/autocomplete-shared" "1.17.0"

"@algolia/[email protected]":
version "1.9.3"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz#1d56482a768c33aae0868c8533049e02e8961be7"
Expand All @@ -10,25 +18,60 @@
"@algolia/autocomplete-plugin-algolia-insights" "1.9.3"
"@algolia/autocomplete-shared" "1.9.3"

"@algolia/autocomplete-js@^1.8.2":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-js/-/autocomplete-js-1.17.0.tgz#91f0ef2232646316a26c79dadbeb2e7791de623c"
integrity sha512-RbD98hXtZOl6VohSAo7kMOFWQHR1x4wWaJFadJradFQ1TAA9hFEyirSIM+yT96UpKkdi08V2EBI+YwZ3/VETvw==
dependencies:
"@algolia/autocomplete-core" "1.17.0"
"@algolia/autocomplete-preset-algolia" "1.17.0"
"@algolia/autocomplete-shared" "1.17.0"
htm "^3.1.1"
preact "^10.13.2"

"@algolia/[email protected]":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.0.tgz#dcec9b03a47375860a9f927816a1275d885ebdff"
integrity sha512-zbWImu+VxBDzUQONEhQXq3OzlipHLEtWbL4Nf/VOb1p1qHG/f96jCegOzzEZVPiQvZpRJnmhCUmsYNHlIBxKWw==
dependencies:
"@algolia/autocomplete-shared" "1.17.0"

"@algolia/[email protected]":
version "1.9.3"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.9.3.tgz#9b7f8641052c8ead6d66c1623d444cbe19dde587"
integrity sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==
dependencies:
"@algolia/autocomplete-shared" "1.9.3"

"@algolia/[email protected]":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.0.tgz#9d7d9673a922d75dfbedd3119e7ffa76f4c118c6"
integrity sha512-DhTkMs/9BzThhTU2nSTpQxVxHLzaRDZLid4Tf56D8s9IhEGfmzbNuLRmJNzgAOPv1smHtUErndmC+S9QNMDEJA==
dependencies:
"@algolia/autocomplete-shared" "1.17.0"

"@algolia/[email protected]":
version "1.9.3"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.9.3.tgz#64cca4a4304cfcad2cf730e83067e0c1b2f485da"
integrity sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==
dependencies:
"@algolia/autocomplete-shared" "1.9.3"

"@algolia/[email protected]":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.0.tgz#7d0a8e504fe555c48df7ae6854d3d6633b0b32f5"
integrity sha512-7su4KH/2q2Fhud2VujUNhCMbIh7yp6wqWR3UuVje5P3kDRhTotPRmg3iRQi48YRYkk9o+airsrLl+rxJ/9FWng==

"@algolia/[email protected]":
version "1.9.3"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.9.3.tgz#2e22e830d36f0a9cf2c0ccd3c7f6d59435b77dfa"
integrity sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==

"@algolia/autocomplete-theme-classic@^1.8.2":
version "1.17.0"
resolved "https://registry.yarnpkg.com/@algolia/autocomplete-theme-classic/-/autocomplete-theme-classic-1.17.0.tgz#bbd79df8f5240b3ddd3f9cdc9b8273753f15cd25"
integrity sha512-FsW/J/mG1YIPv93/QQ7KxMVNXAiVi9accGgoK2y3zDz58WpVgUug97SUoQzP4I9EMZAZAHQo0QbWXxpqTWkcOA==

"@algolia/[email protected]":
version "4.23.3"
resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.23.3.tgz#0cc26b96085e1115dac5fcb9d826651ba57faabc"
Expand Down Expand Up @@ -84,7 +127,7 @@
"@algolia/requester-common" "4.23.3"
"@algolia/transporter" "4.23.3"

"@algolia/[email protected]":
"@algolia/[email protected]", "@algolia/client-search@^4.12.0":
version "4.23.3"
resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.23.3.tgz#a3486e6af13a231ec4ab43a915a1f318787b937f"
integrity sha512-P4VAKFHqU0wx9O+q29Q8YVuaowaZ5EM77rxfmGnkHUJggh28useXQdopokgwMeYw2XUht49WX5RcTQ40rZIabw==
Expand Down Expand Up @@ -1211,6 +1254,20 @@
"@babel/helper-validator-identifier" "^7.24.5"
to-fast-properties "^2.0.0"

"@cmfcmf/docusaurus-search-local@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@cmfcmf/docusaurus-search-local/-/docusaurus-search-local-1.1.0.tgz#3db5d7d6e05985cc3b06cec10436385c53033c69"
integrity sha512-0IVb/aA0IK8ZlktuxmgXmluXfcSpo6Vdd2nG21y1aOH9nVYnPP231Dn0H8Ng9Qf9ronQQCDWHnuWpYOr9rUrEQ==
dependencies:
"@algolia/autocomplete-js" "^1.8.2"
"@algolia/autocomplete-theme-classic" "^1.8.2"
"@algolia/client-search" "^4.12.0"
algoliasearch "^4.12.0"
cheerio "^1.0.0-rc.9"
clsx "^1.1.1"
lunr-languages "^1.4.0"
mark.js "^8.11.1"

"@colors/[email protected]":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
Expand Down Expand Up @@ -3113,7 +3170,7 @@ algoliasearch-helper@^3.13.3:
dependencies:
"@algolia/events" "^4.0.1"

algoliasearch@^4.18.0, algoliasearch@^4.19.1:
algoliasearch@^4.12.0, algoliasearch@^4.18.0, algoliasearch@^4.19.1:
version "4.23.3"
resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.23.3.tgz#e09011d0a3b0651444916a3e6bbcba064ec44b60"
integrity sha512-Le/3YgNvjW9zxIQMRhUHuhiUjAlKY/zsdZpfq4dlLqg6mEm0nL6yk+7f2hDOtLpxsgE4jSzDmvHL7nXdBp5feg==
Expand Down Expand Up @@ -3744,7 +3801,7 @@ cheerio-select@^2.1.0:
domhandler "^5.0.3"
domutils "^3.0.1"

cheerio@^1.0.0-rc.12:
cheerio@^1.0.0-rc.12, cheerio@^1.0.0-rc.9:
version "1.0.0-rc.12"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.12.tgz#788bf7466506b1c6bf5fae51d24a2c4d62e47683"
integrity sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==
Expand Down Expand Up @@ -3830,7 +3887,7 @@ clone-deep@^4.0.1:
kind-of "^6.0.2"
shallow-clone "^3.0.0"

clsx@^1.0.4:
clsx@^1.0.4, clsx@^1.1.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12"
integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==
Expand Down Expand Up @@ -5750,6 +5807,11 @@ hpack.js@^2.1.6:
readable-stream "^2.0.1"
wbuf "^1.1.0"

htm@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/htm/-/htm-3.1.1.tgz#49266582be0dc66ed2235d5ea892307cc0c24b78"
integrity sha512-983Vyg8NwUE7JkZ6NmOqpCZ+sh1bKv2iYTlUkzlWmA5JD2acKoxd4KVxbMmxX/85mtfdnDmTFoNKcg5DGAvxNQ==

html-entities@^2.3.2:
version "2.5.2"
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.5.2.tgz#201a3cf95d3a15be7099521620d19dfb4f65359f"
Expand Down Expand Up @@ -6696,6 +6758,16 @@ lru-cache@^5.1.1:
dependencies:
yallist "^3.0.2"

lunr-languages@^1.4.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/lunr-languages/-/lunr-languages-1.14.0.tgz#6e97635f434631729dd0e5654daedd291cd6f2d0"
integrity sha512-hWUAb2KqM3L7J5bcrngszzISY4BxrXn/Xhbb9TTCJYEGqlR1nG67/M14sp09+PTIRklobrn57IAxcdcO/ZFyNA==

mark.js@^8.11.1:
version "8.11.1"
resolved "https://registry.yarnpkg.com/mark.js/-/mark.js-8.11.1.tgz#180f1f9ebef8b0e638e4166ad52db879beb2ffc5"
integrity sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==

markdown-escapes@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535"
Expand Down Expand Up @@ -8351,7 +8423,7 @@ posthog-js@^1.76.0:
fflate "^0.4.8"
preact "^10.19.3"

preact@^10.19.3:
preact@^10.13.2, preact@^10.19.3:
version "10.21.0"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.21.0.tgz#5b0335c873a1724deb66e517830db4fd310c24f6"
integrity sha512-aQAIxtzWEwH8ou+OovWVSVNlFImL7xUCwJX3YMqA3U8iKCNC34999fFOnWjYNsylgfPgMexpbk7WYOLtKr/mxg==
Expand Down

0 comments on commit f59a94d

Please sign in to comment.