Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mottled-library

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mottled-library - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

css/AccountInput.css

2

dist/components/NetworkIcon/NetworkIcon.js

@@ -1,1 +0,1 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react"));exports.NetworkIcon=({network:e="polkadot",size:o="2xl",show:r="both",color:a})=>{const c="txt-".concat(o),n=e.toLowerCase();return t.default.createElement("div",{className:"__mottled_networkicon_container",style:{color:a}},("icon"===r||"both"===r)&&t.default.createElement("div",{className:["_mottled_icon",c].join(" "),style:"icon"===r?{marginRight:"0"}:{marginRight:"0.625rem"}},n),("name"===r||"both"===r)&&t.default.createElement("div",{className:c.concat(" cap"),style:{color:a}},n))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../core/index.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../Accordion/Accordion.js"),require("../../recipes/NetworkSlider/NetworkSlider.js");var r=o(e);exports.NetworkIcon=({network:e="polkadot",size:o="2xl",show:c="both",color:i})=>{var n;const a="txt-".concat(o),l=e.toLowerCase(),s=(null===(n=t.getChain(e.toString()))||void 0===n?void 0:n.icon)||"substrate";return r.default.createElement("div",{className:"__mottled_networkicon_container",style:{color:i}},("icon"===c||"both"===c)&&r.default.createElement("div",{className:["_mottled_icon",a].join(" "),style:"icon"===c?{marginRight:"0"}:{marginRight:"0.625rem"}},s),("name"===c||"both"===c)&&r.default.createElement("div",{className:a.concat(" cap"),style:{color:i}},l))};
import { useClickedOutside, useDebounce, useIsMounted, useMountedState, useLocalStorage } from "./hooks";
export { useClickedOutside, useDebounce, useIsMounted, useMountedState, useLocalStorage, };
export declare const createSecColor: (color: string, amount: number) => string;
export declare type Network = "polkadot" | "kusama" | "westend" | "rococo";
export declare type Network = "polkadot" | "kusama" | "westend" | "rococo" | "statemine" | "statemint";
export interface NetworkDetails {

@@ -9,2 +8,3 @@ id: string;

color: string;
icon?: string;
secColor: string;

@@ -15,3 +15,5 @@ type?: Network;

export declare const defaultChains: Network[];
export declare const createSecColor: (color: string, amount: number) => string;
export declare const getChain: (a: string) => NetworkDetails | undefined;
export declare const getChains: () => Map<string, NetworkDetails>;
export declare const unknownNetwork: (name: string) => NetworkDetails;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");const e=(e,o)=>"#"+e.replace(/^#/,"").replace(/../g,(e=>("0"+Math.min(255,Math.max(0,parseInt(e,16)+o)).toString(16)).substr(-2))),o={id:"polkadot",name:"Polkadot",color:"#E6007A"},s={id:"ksmcc3",name:"Kusama",color:"#2F2F2F"},t={id:"westend2",name:"Westend",color:"#FF9C28"},c={id:"rococo_v_2",name:"Rococo",color:"#696bff"},a=new Map;a.set("polkadot",Object.assign(Object.assign({},o),{secColor:e(o.color,-60)})),a.set("kusama",Object.assign(Object.assign({},s),{secColor:e(s.color,-60)})),a.set("westend",Object.assign(Object.assign({},t),{secColor:e(t.color,-60)})),a.set("rococo",Object.assign(Object.assign({},c),{secColor:e(c.color,-60)}));exports.createSecColor=e,exports.defaultChains=["polkadot","kusama","westend","rococo"],exports.getChain=e=>a.get(e),exports.getChains=()=>a;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");var e=require("./nodes.js");const r=[...e.relay,...e.para],o=r.map((e=>e.name.toLowerCase())),t=(e,r)=>"#"+e.replace(/^#/,"").replace(/../g,(e=>("0"+Math.min(255,Math.max(0,parseInt(e,16)+r)).toString(16)).substr(-2))),a=new Map;r.forEach((e=>{a.set(e.name.toLowerCase(),Object.assign(Object.assign({},e),{secColor:t(e.color,-60)}))}));exports.createSecColor=t,exports.defaultChains=o,exports.getChain=e=>a.get(e),exports.getChains=()=>a,exports.unknownNetwork=e=>({id:e,name:e,icon:"",color:"#c9c9c9",secColor:t("#c9c9c9",-60)});

@@ -1,29 +0,1 @@

"use strict"
Object.defineProperty(exports, "__esModule", { value: !0 })
var e = require("./core/index.js"),
o = require("./components/Button/Button.js"),
r = require("./components/NetworkIcon/NetworkIcon.js"),
t = require("./components/Card/Card.js"),
s = require("./components/Tooltip/Tooltip.js"),
u = require("./components/Accordion/Accordion.js"),
i = require("./recipes/NetworkSlider/NetworkSlider.js"),
c = require("./core/hooks/useClickedOutside.js"),
n = require("./core/hooks/useDebounce.js"),
d = require("./core/hooks/useIsMounted.js"),
p = require("./core/hooks/useMountedState.js"),
a = require("./core/hooks/useLocalStorage.js")
;(exports.createSecColor = e.createSecColor),
(exports.defaultChains = e.defaultChains),
(exports.getChain = e.getChain),
(exports.getChains = e.getChains),
(exports.Button = o.Button),
(exports.NetworkIcon = r.NetworkIcon),
(exports.Card = t.Card),
(exports.Tooltip = s.Tooltip),
(exports.Accordion = u.Accordion),
(exports.NetworkSlider = i.NetworkSlider),
(exports.useClickedOutside = c.useClickedOutside),
(exports.useDebounce = n.useDebounce),
(exports.useIsMounted = d.useIsMounted),
(exports.useMountedState = p.useMountedState),
(exports.useLocalStorage = a.useLocalStorage)
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./core/index.js"),o=require("./components/Button/Button.js"),r=require("./components/NetworkIcon/NetworkIcon.js"),t=require("./components/Card/Card.js"),s=require("./components/Tooltip/Tooltip.js"),u=require("./components/Accordion/Accordion.js"),n=require("./recipes/NetworkSlider/NetworkSlider.js"),i=require("./core/hooks/useClickedOutside.js"),c=require("./core/hooks/useDebounce.js"),d=require("./core/hooks/useIsMounted.js"),p=require("./core/hooks/useMountedState.js"),a=require("./core/hooks/useLocalStorage.js");exports.createSecColor=e.createSecColor,exports.defaultChains=e.defaultChains,exports.getChain=e.getChain,exports.getChains=e.getChains,exports.unknownNetwork=e.unknownNetwork,exports.Button=o.Button,exports.NetworkIcon=r.NetworkIcon,exports.Card=t.Card,exports.Tooltip=s.Tooltip,exports.Accordion=u.Accordion,exports.NetworkSlider=n.NetworkSlider,exports.useClickedOutside=i.useClickedOutside,exports.useDebounce=c.useDebounce,exports.useIsMounted=d.useIsMounted,exports.useMountedState=p.useMountedState,exports.useLocalStorage=a.useLocalStorage;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../core/index.js"),o=require("../../components/Button/Button.js"),r=require("../../components/NetworkIcon/NetworkIcon.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../components/Accordion/Accordion.js");var l=n(e);const c=(e,t,o,r,n=!1)=>({backgroundColor:e,hover:{backgroundColor:t,border:`0.1rem solid ${e}`},display:n?r>0?"flex":"none":o?"none":"flex"}),u=l.default.memo((({network:e,active:t,cb:n,type:c,leftPosition:u,primary:a})=>{const s=Object.assign({},{left:`${u}px`},t?{backgroundColor:"#ffffff",color:a,hover:{backgroundColor:"#ffffff",color:a}}:{});return l.default.createElement(o.Button,{cName:"positioning _mottled_button_ow",st:s,onClick:()=>n(e)},l.default.createElement(r.NetworkIcon,{size:"2xl",network:e,show:c}))}));exports.NetworkSlider=({networks:r,defaultNetwork:n,setNetwork:a,type:s="both"})=>{const[i,d]=e.useState(n||"polkadot"),[f,m]=e.useState(150),k=r||t.defaultChains,p=e.useRef(null),[v,h]=e.useState(0),[b,w]=e.useState(!0),[C,g]=e.useState({});return e.useEffect((()=>{"icon"===s?m(50):"name"===s&&m(130)}),[s]),e.useEffect((()=>{if(p.current){const e=k.length*f,t=p.current.offsetWidth;w(e<=t||k.length*f*v>e)}}),[k.length,v,f,p]),e.useEffect((()=>{const e=t.getChain(i);e&&(g(e),a(e))}),[i,a]),l.default.createElement("div",{"data-testid":"NetworkSlider",ref:p,style:{background:null==C?void 0:C.secColor},className:"_mottled_SliderButtons"},l.default.createElement(o.Button,{cName:"_mottled_handle",st:c(null==C?void 0:C.color,null==C?void 0:C.secColor,b,v,!0),onClick:()=>h(v-1)},"<"),l.default.createElement(o.Button,{st:c(null==C?void 0:C.color,null==C?void 0:C.secColor,b,v),cName:"_mottled_handle handle_right",onClick:()=>h(v+1)},">"),k.map((e=>l.default.createElement(u,{primary:null==C?void 0:C.color,secondary:null==C?void 0:C.secColor,leftPosition:-v*f,key:e,network:e,type:s,active:i===e,cb:d}))))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../core/index.js"),o=require("../../components/Button/Button.js"),n=require("../../components/NetworkIcon/NetworkIcon.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../components/Accordion/Accordion.js");var l=r(e);const c=(e,t,o,n,r=!1)=>({backgroundColor:e,hover:{backgroundColor:t,border:`0.1rem solid ${e}`},display:r?n>0?"flex":"none":o?"none":"flex"}),u=l.default.memo((({network:e,active:t,cb:r,type:c,leftPosition:u,primary:a})=>{const s=Object.assign({},{left:`${u}px`},t?{backgroundColor:"#ffffff",color:a,hover:{backgroundColor:"#ffffff",color:a}}:{});return l.default.createElement(o.Button,{cName:"positioning _mottled_button_ow",st:s,onClick:()=>r(e)},l.default.createElement(n.NetworkIcon,{size:"2xl",network:e,show:c}))}));exports.NetworkSlider=({networks:n,defaultNetwork:r,setNetwork:a,type:s="both"})=>{const[i,d]=e.useState(r||n&&n[0].toString()||"polkadot"),[f,k]=e.useState(190),m=n||t.defaultChains,p=e.useRef(null),[w,h]=e.useState(0),[v,g]=e.useState(!0),[b,C]=e.useState({}),[N,_]=e.useState(m.length);return e.useEffect((()=>{"icon"===s?k(50):"name"===s&&k(130)}),[s]),e.useEffect((()=>{if(p.current){const e=(null==p?void 0:p.current).offsetWidth,t=Math.trunc(e/f);_(m.length-t);const o=m.length*f;g(o<=e||N===w)}}),[m.length,w,f,p]),e.useEffect((()=>{const e=t.getChain(i);C(e||t.unknownNetwork(i)),a(e||t.unknownNetwork(i))}),[i]),l.default.createElement("div",{"data-testid":"NetworkSlider",ref:p,style:{background:null==b?void 0:b.secColor},className:"_mottled_SliderButtons"},l.default.createElement(o.Button,{cName:"_mottled_handle",st:c(null==b?void 0:b.color,null==b?void 0:b.secColor,v,w,!0),onClick:()=>h(w-1)},"<"),l.default.createElement(o.Button,{st:c(null==b?void 0:b.color,null==b?void 0:b.secColor,v,w),cName:"_mottled_handle handle_right",onClick:()=>h(w+1)},">"),m.map((e=>l.default.createElement(u,{primary:null==b?void 0:b.color,secondary:null==b?void 0:b.secColor,leftPosition:-w*f,key:e,network:e,type:s,active:i===e,cb:d}))))};
{
"name": "mottled-library",
"version": "0.0.15",
"version": "0.0.16",
"author": "Parity Team <admin@parity.io>",

@@ -5,0 +5,0 @@ "maintainers": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc