@api3/logos 0.3.10 → 0.4.0

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.
@@ -0,0 +1,29 @@
1
+
2
+ /**
3
+ *
4
+ * @param {string} id - Unique ID for the logo element.
5
+ * @param {boolean} [light=false] - Light version.
6
+ * @returns
7
+ * DappLogo component
8
+ *
9
+ * @example
10
+ * ```
11
+ * import { DappLogoSvg } from '@api3/logos';
12
+ *
13
+ * const App = () => {
14
+ * return <img src={DappLogoSvg("eth")} alt="Logo" />;
15
+ * }
16
+ * ```
17
+ *
18
+ * @example
19
+ * ```
20
+ * import { DappLogoSvg } from '@api3/logos';
21
+ *
22
+ * const App = () => {
23
+ * return <img src={DappLogoSvg("eth")} alt="Logo" width="64" height="64" />;
24
+ * }
25
+ * ```
26
+ *
27
+ */
28
+ declare function DappLogo(id: string, light?: boolean): string;
29
+ export default DappLogo;
@@ -0,0 +1,14 @@
1
+ const DappPlaceholder = require('../logos/dapp/Placeholder.svg');
2
+ function sanitizeName(id) {
3
+ return id.replace(/\s+|-/g, '').replace(/ExchangeRate/g, '');
4
+ }
5
+ function DappLogo(id, light = false) {
6
+ if (!id) {
7
+ return DappPlaceholder;
8
+ }
9
+ switch (sanitizeName(`${id}${light ? "light" : ""}`).toLowerCase()) {
10
+ default:
11
+ return light ? DappLogo(id) : DappPlaceholder;
12
+ }
13
+ }
14
+ module.exports = DappLogo;
@@ -0,0 +1 @@
1
+ ["aave","abracadabra","aeroscraper","aurelius","aurum-finance","avalon","benqi","beraborrow","burrbear","compound-finance","correlate","curvance","dahlia","dolomite","dtrinity","eggs","elara","enclabs","fisclend","fluid","granary","hana","init","ionic","juice","lendle","macaron","mach-finance","minterest","moonwell","nitro","omega","orbit","origami","pac","paddle","positions","roots","sake","scallop","silo","spark","stacking-salmon","stout","sumer","takara","takotako","taofi","untitled-bank","ursa","venus","vestation","vicuna-finance","yei","yield-hive","yieldfi","zeno","zerolend","zeru"]
@@ -1,6 +1,8 @@
1
1
  export { default as ChainLogo } from './ChainLogo.js';
2
2
  export { default as ChainLogoMissing } from './ChainLogoMissing.json';
3
- export { default as ApiProviderLogo } from './ApiProviderLogo.js';
4
- export { default as ApiProviderLogoMissing } from './ApiProviderLogoMissing.json';
5
3
  export { default as SymbolLogo } from './SymbolLogo.js';
6
4
  export { default as SymbolLogoMissing } from './SymbolLogoMissing.json';
5
+ export { default as ApiProviderLogo } from './ApiProviderLogo.js';
6
+ export { default as ApiProviderLogoMissing } from './ApiProviderLogoMissing.json';
7
+ export { default as DappLogo } from './DappLogo.js';
8
+ export { default as DappLogoMissing } from './DappLogoMissing.json';
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  module.exports.ChainLogo = require('./ChainLogo.js');
2
2
  module.exports.ChainLogoMissing = require('./ChainLogoMissing.json');
3
- module.exports.ApiProviderLogo = require('./ApiProviderLogo.js');
4
- module.exports.ApiProviderLogoMissing = require('./ApiProviderLogoMissing.json');
5
3
  module.exports.SymbolLogo = require('./SymbolLogo.js');
6
4
  module.exports.SymbolLogoMissing = require('./SymbolLogoMissing.json');
5
+ module.exports.ApiProviderLogo = require('./ApiProviderLogo.js');
6
+ module.exports.ApiProviderLogoMissing = require('./ApiProviderLogoMissing.json');
7
+ module.exports.DappLogo = require('./DappLogo.js');
8
+ module.exports.DappLogoMissing = require('./DappLogoMissing.json');
@@ -0,0 +1,29 @@
1
+
2
+ /**
3
+ *
4
+ * @param {string} id - Unique ID for the logo element.
5
+ * @param {boolean} [light=false] - Light version.
6
+ * @returns
7
+ * DappLogo component
8
+ *
9
+ * @example
10
+ * ```
11
+ * import { DappLogoSvg } from '@api3/logos';
12
+ *
13
+ * const App = () => {
14
+ * return <img src={DappLogoSvg("eth")} alt="Logo" />;
15
+ * }
16
+ * ```
17
+ *
18
+ * @example
19
+ * ```
20
+ * import { DappLogoSvg } from '@api3/logos';
21
+ *
22
+ * const App = () => {
23
+ * return <img src={DappLogoSvg("eth")} alt="Logo" width="64" height="64" />;
24
+ * }
25
+ * ```
26
+ *
27
+ */
28
+ declare function DappLogo(id: string, light?: boolean): string;
29
+ export default DappLogo;
@@ -0,0 +1,14 @@
1
+ import DappPlaceholder from '../logos/dapp/Placeholder.svg';
2
+ function sanitizeName(id) {
3
+ return id.replace(/\s+|-/g, '').replace(/ExchangeRate/g, '');
4
+ }
5
+ function DappLogo(id, light = false) {
6
+ if (!id) {
7
+ return DappPlaceholder;
8
+ }
9
+ switch (sanitizeName(`${id}${light ? "light" : ""}`).toLowerCase()) {
10
+ default:
11
+ return light ? DappLogo(id) : DappPlaceholder;
12
+ }
13
+ }
14
+ export default DappLogo;
@@ -0,0 +1 @@
1
+ ["aave","abracadabra","aeroscraper","aurelius","aurum-finance","avalon","benqi","beraborrow","burrbear","compound-finance","correlate","curvance","dahlia","dolomite","dtrinity","eggs","elara","enclabs","fisclend","fluid","granary","hana","init","ionic","juice","lendle","macaron","mach-finance","minterest","moonwell","nitro","omega","orbit","origami","pac","paddle","positions","roots","sake","scallop","silo","spark","stacking-salmon","stout","sumer","takara","takotako","taofi","untitled-bank","ursa","venus","vestation","vicuna-finance","yei","yield-hive","yieldfi","zeno","zerolend","zeru"]
@@ -1,5 +1,7 @@
1
1
  export { default as ApiProviderLogo } from './ApiProviderLogo.js';
2
2
  export { default as ApiProviderLogoMissing } from './ApiProviderLogoMissing.json';
3
+ export { default as DappLogo } from './DappLogo.js';
4
+ export { default as DappLogoMissing } from './DappLogoMissing.json';
3
5
  export { default as SymbolLogo } from './SymbolLogo.js';
4
6
  export { default as SymbolLogoMissing } from './SymbolLogoMissing.json';
5
7
  export { default as ChainLogo } from './ChainLogo.js';
package/dist/esm/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  export { default as ApiProviderLogo } from './ApiProviderLogo.js';
2
2
  export { default as ApiProviderLogoMissing } from './ApiProviderLogoMissing.json';
3
+ export { default as DappLogo } from './DappLogo.js';
4
+ export { default as DappLogoMissing } from './DappLogoMissing.json';
3
5
  export { default as SymbolLogo } from './SymbolLogo.js';
4
6
  export { default as SymbolLogoMissing } from './SymbolLogoMissing.json';
5
7
  export { default as ChainLogo } from './ChainLogo.js';
@@ -0,0 +1,17 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 32 36">
2
+ <path fill="#F3F3F3" stroke="#C3C4C3" stroke-width="2.11764" d="M1.17601 9.61697L15.9995 1.217L30.8229 9.61697V26.3829L15.9995 34.7828L1.17601 26.3829V9.61697Z"/>
3
+ <path stroke="#C3C4C3" stroke-width="2.11764" d="M1.17601 9.61697L15.9995 1.217L30.8229 9.61697V26.3829L15.9995 34.7828L1.17601 26.3829V9.61697Z"/>
4
+ <mask id="Placeholder_svg__mask0_53_108895" width="32" height="36" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha">
5
+ <path stroke="#EFEFEF" stroke-width="2.11764" d="M1.17601 9.61697L15.9995 1.217L30.8229 9.61697V26.3829L15.9995 34.7828L1.17601 26.3829V9.61697Z"/>
6
+ </mask>
7
+ <g mask="url(#Placeholder_svg__mask0_53_108895)">
8
+ <path fill="#DDDDDD" d="M41.1085 -18.5947L66.2151 -6.04144V19.0651L41.1085 31.6184L16.002 19.0651V-6.04144L41.1085 -18.5947Z"/>
9
+ </g>
10
+ <mask id="Placeholder_svg__mask1_53_108895" width="32" height="36" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha">
11
+ <path stroke="#EFEFEF" stroke-width="2" d="M30.8809 26.4173L15.9986 34.8506L1.11628 26.4173L1.11628 9.58284L15.9986 1.14955L30.8809 9.58284L30.8809 26.4173Z"/>
12
+ </mask>
13
+ <g mask="url(#Placeholder_svg__mask1_53_108895)">
14
+ <path fill="#DDDDDD" d="M-9.10461 54.5947L-34.2112 42.0414L-34.2112 16.9349L-9.10462 4.38159L16.0019 16.9349L16.002 42.0414L-9.10461 54.5947Z"/>
15
+ </g>
16
+ <path fill="#DDDDDD" d="M15.9972 9.66211L23.219 13.8316V22.1706L15.9972 26.3401L8.77541 22.1706V13.8316L15.9972 9.66211Z"/>
17
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@api3/logos",
3
- "version": "0.3.10",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "repository": {
@@ -43,7 +43,8 @@
43
43
  "optimize-chain-logos": "rimraf ./optimized/chain & svgo -q -p 8 -f ./raw/chains -o ./optimized/chain",
44
44
  "optimize-symbol-logos": "rimraf ./optimized/symbol & svgo -q -p 8 -f ./raw/symbols -o ./optimized/symbol",
45
45
  "optimize-api-provider-logos": "rimraf ./optimized/api-provider & svgo -q -p 8 -f ./raw/api-providers -o ./optimized/api-provider",
46
- "build": "pnpm run optimize-chain-logos && pnpm run optimize-symbol-logos && pnpm run optimize-api-provider-logos && node scripts/build-svg.js",
46
+ "optimize-dapp-logos": "rimraf ./optimized/dapp & svgo -q -p 8 -f ./raw/dapps -o ./optimized/dapp",
47
+ "build": "pnpm run optimize-chain-logos && pnpm run optimize-symbol-logos && pnpm run optimize-api-provider-logos && pnpm run optimize-dapp-logos && node scripts/build-svg.js",
47
48
  "fetch": "node scripts/fetch-missing.js",
48
49
  "version-check": "node scripts/version-check.js",
49
50
  "package": "pnpm run build",