mottled-library
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -1,1 +0,5 @@ | ||
export {}; | ||
import { useClickedOutside } from "./useClickedOutside"; | ||
import { useDebounce } from "./useDebounce"; | ||
import { useIsMounted } from "./useIsMounted"; | ||
import { useMountedState } from "./useMountedState"; | ||
export { useClickedOutside, useDebounce, useIsMounted, useMountedState }; |
@@ -6,3 +6,3 @@ import React from "react"; | ||
setNetwork: (a: NetworkDetails) => void; | ||
defaultNetwork?: Network; | ||
defaultNetwork: Network | string; | ||
type?: "both" | "icon" | "name"; | ||
@@ -9,0 +9,0 @@ } |
@@ -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"}),a=l.default.memo((({network:e,active:t,cb:n,type:c,leftPosition:a,primary:u})=>{let s=Object.assign({},{left:`${a}px`},t?{backgroundColor:"#ffffff",color:u,hover:{backgroundColor:"#ffffff",color:u}}:{});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:u,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),[w,b]=e.useState(!0),[g,C]=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;b(e<=t||k.length*f*v>e)}}),[k.length,v,f,p]),e.useEffect((()=>{const e=t.getChain(i);e&&(C(e),u(e))}),[i,u]),console.log("actNetwork",g),l.default.createElement("div",{"data-testid":"NetworkSlider",ref:p,style:{background:null==g?void 0:g.secColor},className:"_mottled_SliderButtons"},l.default.createElement(o.Button,{cName:"_mottled_handle",st:c(null==g?void 0:g.color,null==g?void 0:g.secColor,w,v,!0),onClick:()=>h(v-1)},"<"),l.default.createElement(o.Button,{st:c(null==g?void 0:g.color,null==g?void 0:g.secColor,w,v),cName:"_mottled_handle handle_right",onClick:()=>h(v+1)},">"),k.map((e=>l.default.createElement(a,{primary:null==g?void 0:g.color,secondary:null==g?void 0:g.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"),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}))))}; |
{ | ||
"name": "mottled-library", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"author": "Parity Team <admin@parity.io>", | ||
@@ -29,3 +29,3 @@ "maintainers": [ | ||
"format": "prettier --write .", | ||
"deploy-sb": "yarn run build-storybook && gh-pages -d storybook-static", | ||
"deploy-sb": "yarn run build-sb && gh-pages -d storybook-static", | ||
"ts:typedefs": "tsc --outDir ./dist --emitDeclarationOnly", | ||
@@ -47,3 +47,3 @@ "css": "postcss src/**/*.css -d css" | ||
"@storybook/react": "^6.4.22", | ||
"@storybook/testing-library": "^0.0.9", | ||
"@storybook/testing-library": "^0.0.11", | ||
"@types/babel__core": "^7", | ||
@@ -54,3 +54,3 @@ "@types/gh-pages": "^3", | ||
"@types/prettier": "^2", | ||
"@types/react": "^18.0.5", | ||
"@types/react": "^18.0.6", | ||
"@types/react-dom": "^18", | ||
@@ -61,3 +61,3 @@ "@types/rollup-plugin-peer-deps-external": "^2", | ||
"autoprefixer": "^9", | ||
"babel-loader": "^8.2.4", | ||
"babel-loader": "^8.2.5", | ||
"concurrently": "^7.1.0", | ||
@@ -64,0 +64,0 @@ "eslint": "^8.13.0", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4045971
36
147118
0