diff --git a/packages/web/src/components/search-provider-logo/custom-icons.ts b/packages/web/src/components/search-provider-logo/custom-icons.ts new file mode 100644 index 00000000..a6828284 --- /dev/null +++ b/packages/web/src/components/search-provider-logo/custom-icons.ts @@ -0,0 +1,93 @@ +/** + * Custom FontAwesome icon definitions for search providers + * that don't have icons in the FA free icon packs. + * + * Sources: + * - tavily, jina, exa, bocha, serper: brand SVGs provided externally + * - duckduckgo, searxng, sogou: Simple Icons (https://simpleicons.org) + * + * Each icon is registered with the 'fac' (custom) prefix and can be used + * as ['fac', 'icon-name'] in FontAwesomeIcon components. + */ + +import type { IconDefinition } from '@fortawesome/fontawesome-svg-core' + +function defineCustomIcon( + name: string, + width: number, + height: number, + pathData: string, +): IconDefinition { + return { + prefix: 'fac' as IconDefinition['prefix'], + iconName: name as IconDefinition['iconName'], + icon: [width, height, [], '', pathData], + } +} + +export const facTavily = defineCustomIcon( + 'tavily', + 24, + 24, + 'M8.033 14.273a1.612 1.612 0 011.139.47l.04.042.044.043a1.61 1.61 0 010 2.277l-3.073 3.073.816.816c.6.6.303 1.627-.525 1.814l-5.159 1.165a1.07 1.07 0 01-.897-.2l-.102-.09a1.07 1.07 0 01-.289-1l1.164-5.158A1.079 1.079 0 013.006 17l.816.817 3.074-3.074a1.612 1.612 0 011.137-.47zM17.042 13.246c0-.85.935-1.366 1.653-.912l4.47 2.824c.336.212.503.562.503.911 0 .35-.167.7-.501.913l-4.472 2.824a1.079 1.079 0 01-1.654-.912v-1.155h-7.027c.37-.4.605-.902.677-1.438l.022-.232a2.65 2.65 0 00-.492-1.669h6.821v-1.154zM8.188 0c.35 0 .7.168.913.503l2.823 4.47a1.079 1.079 0 01-.911 1.655H9.857v6.692h-1.67a2.633 2.633 0 00-1.668.48V6.629H5.365c-.849 0-1.366-.936-.912-1.654L7.276.503A1.072 1.072 0 018.188 0z', +) + +export const facJina = defineCustomIcon( + 'jina', + 24, + 24, + 'M6.608 21.416a4.608 4.608 0 100-9.217 4.608 4.608 0 000 9.217zM20.894 2.015c.614 0 1.106.492 1.106 1.106v9.002c0 5.13-4.148 9.309-9.217 9.37v-9.355l-.03-9.032c0-.614.491-1.106 1.106-1.106h7.158l-.123.015z', +) + +export const facExa = defineCustomIcon( + 'exa', + 24, + 24, + 'M3 0h19v1.791L13.892 12 22 22.209V24H3V0zm9.62 10.348l6.589-8.557H6.03l6.59 8.557zM5.138 3.935v7.17h5.52l-5.52-7.17zm5.52 8.96h-5.52v7.17l5.52-7.17zM6.03 22.21l6.59-8.557 6.589 8.557H6.03z', +) + +export const facBocha = defineCustomIcon( + 'bocha', + 463, + 395, + 'M52.6531 54.652C91.561 35.683 138.473 51.843 157.46 90.756L197.998 173.838C207.483 193.277 199.421 216.728 179.991 226.217C179.983 226.221 179.975 226.225 179.967 226.229C160.513 235.713 137.057 227.633 127.563 208.177L52.6531 54.652Z M12 133.819C42.6115 103.22 92.214 103.22 122.826 133.819L190.618 201.583C205.907 216.865 205.918 241.653 190.642 256.949C190.634 256.957 190.626 256.965 190.618 256.973C175.313 272.272 150.511 272.272 135.205 256.973L12 133.819Z M292.854 68.333C380.336 68.333 451.253 139.222 451.253 226.667C451.253 269.36 429.304 312.74 401.821 341.217L390.442 327.576C370.921 304.18 363.989 272.751 371.853 243.309C373.277 237.973 373.99 233.071 373.99 228.602C373.99 183.499 337.411 146.935 292.289 146.935C247.168 146.935 210.589 183.499 210.589 228.602C210.589 273.705 247.168 310.269 292.289 310.269C300.737 310.269 308.884 308.987 316.549 306.608C339.517 299.479 364.544 305.399 381.889 322.065L401.821 341.217C373.52 367.628 334.626 385 292.854 385C205.373 385 134.456 314.112 134.456 226.667C134.456 139.222 205.373 68.333 292.854 68.333Z M134.456 10C177.736 10 212.821 45.102 212.821 88.401V144.932C212.821 188.232 177.736 223.333 134.456 223.333V10Z', +) + +export const facDuckduckgo = defineCustomIcon( + 'duckduckgo', + 24, + 24, + 'M12 0C5.37 0 0 5.37 0 12s5.37 12 12 12s12-5.37 12-12S18.63 0 12 0m0 .984C18.083.984 23.016 5.916 23.016 12S18.084 23.016 12 23.016S.984 18.084.984 12S5.916.984 12 .984m0 .938C6.434 1.922 1.922 6.434 1.922 12c0 4.437 2.867 8.205 6.85 9.55c-.237-.82-.776-2.753-1.6-6.052c-1.184-4.741-2.064-8.606 2.379-9.813c.047-.011.064-.064.03-.093c-.514-.467-1.382-.548-2.233-.38a.06.06 0 0 1-.07-.058c0-.011 0-.023.011-.035c.205-.286.572-.507.822-.64a1.8 1.8 0 0 0-.607-.335c-.059-.022-.059-.12-.006-.144q.008-.01.024-.012c1.749-.233 3.586.292 4.49 1.448a.1.1 0 0 0 .035.023c2.968.635 3.509 4.837 3.328 5.998a9.6 9.6 0 0 0 2.346-.576c.746-.286 1.008-.222 1.101-.053c.1.193-.018.513-.28.81c-.496.567-1.393 1.01-2.974 1.137c-.546.044-1.029.024-1.445.006c-.789-.035-1.339-.059-1.633.39c-.192.298-.041.998 1.487 1.22c1.09.157 2.078.047 2.798-.034c.643-.07 1.073-.118 1.172.069c.21.402-.996 1.207-3.066 1.224q-.238-.002-.467-.011c-1.283-.065-2.227-.414-2.816-.735a.1.1 0 0 1-.035-.017c-.105-.059-.31.045-.188.267c.07.134.444.478 1.004.776c-.058.466.087 1.184.338 2l.088-.016q.063-.015.134-.025c.507-.082.775.012.926.175c.717-.536 1.913-1.294 2.03-1.154c.583.694.66 2.332.53 2.99q-.006.018-.04.035c-.274.117-1.783-.296-1.783-.511c-.059-1.075-.26-1.173-.493-1.225h-.156a.1.1 0 0 1 .018.03l.052.12c.093.257.24 1.063.13 1.26c-.112.199-.835.297-1.284.303c-.443.006-.543-.158-.637-.408c-.07-.204-.103-.675-.103-.95a1 1 0 0 1 .012-.216c-.134.058-.333.193-.397.281c-.017.262-.017.682.123 1.149c.07.221-1.518 1.164-1.74.99c-.227-.181-.634-1.952-.459-2.67c-.187.017-.338.075-.42.191c-.367.508.093 2.933.582 3.248c.257.169 1.54-.553 2.176-1.095c.105.145.305.158.553.158c.326-.012.782-.06 1.103-.158c.192.45.423.972.613 1.388c4.47-1.032 7.803-5.037 7.803-9.82c0-5.566-4.512-10.078-10.078-10.078m1.791 5.646c-.42 0-.678.146-.795.332c-.023.047.047.094.094.07c.14-.075.357-.161.701-.156c.328.006.516.09.67.159l.023.01c.041.017.088-.03.059-.065c-.134-.18-.332-.35-.752-.35m-5.078.198a1.2 1.2 0 0 0-.522.082c-.454.169-.67.526-.67.76c0 .051.112.057.141.011c.081-.123.21-.31.617-.478c.408-.17.73-.146.951-.094c.047.012.083-.041.041-.07a1 1 0 0 0-.558-.211m5.434 1.423a.65.65 0 0 0-.655.647a.652.652 0 0 0 1.307 0a.646.646 0 0 0-.652-.647m.283.262h.008a.17.17 0 0 1 .17.17c0 .093-.077.17-.17.17a.17.17 0 0 1-.17-.17c0-.09.072-.165.162-.17m-5.358.076a.75.75 0 0 0-.758.758c0 .42.338.758.758.758s.758-.337.758-.758a.756.756 0 0 0-.758-.758m.328.303h.01a.199.199 0 1 1 0 .397a.195.195 0 0 1-.197-.198c0-.107.082-.194.187-.199', +) + +export const facSearxng = defineCustomIcon( + 'searxng', + 24, + 24, + 'm13.716 17.261l6.873 6.582L24 20.282l-6.824-6.536a9.1 9.1 0 0 0 1.143-4.43c0-5.055-4.105-9.159-9.16-9.159S0 4.261 0 9.316s4.104 9.159 9.159 9.159a9.1 9.1 0 0 0 4.557-1.214M9.159 2.773a6.546 6.546 0 0 1 6.543 6.543a6.545 6.545 0 0 1-6.543 6.542a6.545 6.545 0 0 1-6.542-6.542a6.545 6.545 0 0 1 6.542-6.543M7.26 5.713a4.065 4.065 0 0 1 4.744.747a4.06 4.06 0 0 1 .707 4.749l1.157.611a5.38 5.38 0 0 0-.935-6.282a5.38 5.38 0 0 0-6.274-.987z', +) + +export const facSogou = defineCustomIcon( + 'sogou', + 24, + 24, + 'M16.801 22.74L17.79 24c1.561-.676 2.926-1.62 4.051-2.851l-.946-1.318a10.3 10.3 0 0 1-4.08 2.909zM12 22.199c-5.775 0-10.455-4.619-10.455-10.35C1.545 6.15 6.225 1.53 12 1.53s10.456 4.65 10.456 10.35c0 2.55-.946 4.891-2.507 6.69l.945 1.261C22.801 17.729 24 14.939 24 11.88C24 5.295 18.63 0 12 0S0 5.311 0 11.85c0 6.57 5.37 11.88 12 11.88c1.71 0 3.33-.346 4.801-.99l-.961-1.26c-1.2.45-2.49.719-3.84.719m6-9.553c-2.25-1.86-5.34-2.101-7.801-3.556c-.75-.479-.148-1.395.602-1.425c2.699-.45 5.369.63 7.889 1.5l.151-2.655c-3.151-1.14-6.57-1.875-9.901-1.35c-1.2.3-2.4.675-3.254 1.56c-1.171 1.2-.961 3.36.389 4.32c2.236 1.755 5.176 2.011 7.621 3.36c.96.39.555 1.68-.391 1.77c-2.925.555-5.805-.721-8.325-2.1c-.03 1.02-.06 2.01-.06 3c3.195 1.409 6.75 2.069 10.2 1.529c1.17-.225 2.37-.6 3.225-1.454c1.229-1.2 1.111-3.511-.33-4.5H18z', +) + +export const facSerper = defineCustomIcon( + 'serper', + 70, + 70, + 'M35 0A35 35 0 1 1 35 70A35 35 0 1 1 35 0Z M35 6A29 29 0 1 0 35 64A29 29 0 1 0 35 6Z M35.699 17.526c1.8718 0 3.6377.3174 5.2979.9521 1.6764.6348 3.1412 1.5137 4.3945 2.6367 1.2533 1.1231 2.2054 2.4252 2.8564 3.9063.1465.3255.2198.6592.2198 1.001 0 .6673-.2442 1.2451-.7324 1.7334-.4721.472-1.0417.708-1.709.708-.4395 0-.8789-.1384-1.3184-.4151-.4394-.2929-.7487-.6429-.9277-1.0498-.6185-1.3997-1.652-2.5146-3.1006-3.3447-1.4323-.8301-3.0925-1.2451-4.9805-1.2451-.9277 0-1.9124.1139-2.9541.3418-1.0254.2278-1.9938.5778-2.9053 1.0498-.9114.4557-1.652 1.0335-2.2216 1.7334-.5697.6998-.8545 1.5137-.8545 2.4414 0 .7487.2441 1.3997.7324 1.9531.4883.5371 1.0335.9603 1.6357 1.2695 1.4161.6999 2.9786 1.1882 4.6875 1.4649 1.7253.2767 3.4668.5452 5.2246.8057 1.7579.2604 3.3936.7161 4.9073 1.3671.9603.4069 1.8799.9685 2.7588 1.6846.8789.7162 1.595 1.5869 2.1484 2.6123s.8301 2.2298.8301 3.6133c0 1.7904-.4313 3.361-1.294 4.7119-.8626 1.3509-1.9938 2.474-3.3935 3.3691-1.3998.8952-2.9216 1.5707-4.5655 2.0264-1.6276.4395-3.2226.6592-4.7851.6592-2.1159 0-4.1016-.3337-5.957-1.001-1.8555-.6836-3.475-1.6439-4.8584-2.8808-1.3835-1.2533-2.4414-2.7181-3.1739-4.3946-.1465-.3255-.2197-.651-.2197-.9765 0-.6674.236-1.237.708-1.709.4883-.4883 1.0661-.7324 1.7334-.7324.4557 0 .9033.1464 1.3428.4394.4394.2767.7405.6266.9033 1.0498.7162 1.6439 1.9287 2.946 3.6377 3.9063 1.709.944 3.6702 1.416 5.8838 1.416 1.3835 0 2.7751-.2035 4.1748-.6104 1.3997-.4231 2.5716-1.066 3.5156-1.9287.9603-.8789 1.4404-1.9938 1.4404-3.3447 0-.8626-.2929-1.5706-.8789-2.124-.5696-.5697-1.1962-1.001-1.8798-1.294-1.5463-.6673-3.1983-1.123-4.9561-1.3672-1.7578-.2604-3.5075-.5289-5.249-.8056-1.7416-.293-3.3692-.822-4.8828-1.5869-1.2858-.6511-2.4577-1.5951-3.5157-2.8321-1.0416-1.2532-1.5625-2.8401-1.5625-4.7607 0-1.6927.4069-3.182 1.2207-4.4678.8301-1.3021 1.9206-2.3926 3.2715-3.2715 1.3672-.8952 2.8646-1.5706 4.4922-2.0263 1.6276-.4558 3.2471-.6836 4.8584-.6836z', +) + +export const customSearchIcons = [ + facTavily, + facJina, + facExa, + facBocha, + facDuckduckgo, + facSearxng, + facSogou, + facSerper, +] diff --git a/packages/web/src/components/search-provider-logo/icons.ts b/packages/web/src/components/search-provider-logo/icons.ts index 36c11448..b8890fa4 100644 --- a/packages/web/src/components/search-provider-logo/icons.ts +++ b/packages/web/src/components/search-provider-logo/icons.ts @@ -3,6 +3,7 @@ * * To add a new provider icon: * 1. Find the icon in FontAwesome (https://fontawesome.com/icons) + * or add a custom definition in custom-icons.ts * 2. Import it in `main.ts` and add to `library.add()` * 3. Add the [prefix, iconName] tuple to PROVIDER_ICONS below * @@ -13,6 +14,15 @@ const PROVIDER_ICONS: Record = { brave: ['fab', 'brave'], bing: ['fab', 'microsoft'], google: ['fab', 'google'], + yandex: ['fab', 'yandex'], + tavily: ['fac', 'tavily'], + jina: ['fac', 'jina'], + exa: ['fac', 'exa'], + bocha: ['fac', 'bocha'], + duckduckgo: ['fac', 'duckduckgo'], + searxng: ['fac', 'searxng'], + sogou: ['fac', 'sogou'], + serper: ['fac', 'serper'], } const DEFAULT_ICON: [string, string] = ['fas', 'globe'] diff --git a/packages/web/src/main.ts b/packages/web/src/main.ts index a40f1630..e6de838d 100644 --- a/packages/web/src/main.ts +++ b/packages/web/src/main.ts @@ -59,7 +59,8 @@ import { faComments, faComment, } from '@fortawesome/free-regular-svg-icons' -import { faSlack, faBrave, faGoogle, faMicrosoft } from '@fortawesome/free-brands-svg-icons' +import { faSlack, faBrave, faGoogle, faMicrosoft, faYandex } from '@fortawesome/free-brands-svg-icons' +import { customSearchIcons } from './components/search-provider-logo/custom-icons' library.add( faGear, @@ -105,6 +106,8 @@ library.add( faBrave, faGoogle, faMicrosoft, + faYandex, + ...customSearchIcons, ) createApp(App)