@flows/react-components
Advanced tools
Comparing version
"use client" | ||
"use strict";var eo=Object.create;var u=Object.defineProperty,to=Object.defineProperties,ro=Object.getOwnPropertyDescriptor,lo=Object.getOwnPropertyDescriptors,ao=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,io=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var A=(o,e,t)=>e in o?u(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,f=(o,e)=>{for(var t in e||(e={}))k.call(e,t)&&A(o,t,e[t]);if(g)for(var t of g(e))G.call(e,t)&&A(o,t,e[t]);return o},L=(o,e)=>to(o,lo(e));var w=(o,e)=>{var t={};for(var r in o)k.call(o,r)&&e.indexOf(r)<0&&(t[r]=o[r]);if(o!=null&&g)for(var r of g(o))e.indexOf(r)<0&&G.call(o,r)&&(t[r]=o[r]);return t};var P=(o,e)=>{for(var t in e)u(o,t,{get:e[t],enumerable:!0})},_=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of ao(e))!k.call(o,l)&&l!==t&&u(o,l,{get:()=>e[l],enumerable:!(r=ro(e,l))||r.enumerable});return o};var v=(o,e,t)=>(t=o!=null?eo(io(o)):{},_(e||!o||!o.__esModule?u(t,"default",{value:o,enumerable:!0}):t,o)),so=o=>_(u({},"__esModule",{value:!0}),o);var ho={};P(ho,{components:()=>B,tourComponents:()=>N});module.exports=so(ho);var B={};P(B,{Modal:()=>co,Tooltip:()=>vo});var U=v(require("classnames"));var R={button:"s",primary:"o",secondary:"r"};var V=require("react/jsx-runtime"),s=r=>{var l=r,{className:o,variant:e}=l,t=w(l,["className","variant"]);return(0,V.jsx)("button",f({type:"button",className:(0,U.default)(R.button,R[e],o)},t))};var q=v(require("classnames"));var $=v(require("classnames"));var T={text:"i",body:"f",title:"d"};var H=require("react/jsx-runtime"),b=r=>{var l=r,{className:o,variant:e}=l,t=w(l,["className","variant"]);return(0,H.jsx)("p",f({className:(0,$.default)(T.text,T[e],o)},t))};var Y=v(require("classnames"));var X={button:"a"};var Z=require("react/jsx-runtime"),x=t=>{var r=t,{className:o}=r,e=w(r,["className"]);return(0,Z.jsx)("button",f({type:"button",className:(0,Y.default)(X.button,o)},e))};var F=require("react/jsx-runtime");function y(o){return(0,F.jsx)("svg",L(f({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},o),{children:(0,F.jsx)("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})}))}var c={overlay:"t",wrapper:"n",modal:"w",footer:"b",close:"p"};var a=require("react/jsx-runtime"),h=o=>(0,a.jsxs)(a.Fragment,{children:[o.overlay?(0,a.jsx)("div",{className:(0,q.default)(c.overlay,o.onClose&&c.clickable),onClick:o.onClose,"aria-hidden":"true"}):null,(0,a.jsx)("div",{className:c.wrapper,children:(0,a.jsxs)("div",{className:c.modal,children:[(0,a.jsx)(b,{variant:"title",children:o.title}),(0,a.jsx)(b,{variant:"body",children:o.body}),(0,a.jsx)("div",{className:c.footer,children:o.buttons}),o.onClose?(0,a.jsx)(x,{className:c.close,onClick:o.onClose,children:(0,a.jsx)(y,{})}):null]})})]});var S=require("react/jsx-runtime"),co=o=>(0,S.jsx)(h,{title:o.title,body:o.body,buttons:(0,S.jsx)(s,{variant:"primary",onClick:o.continue,children:o.continueText}),overlay:!o.hideOverlay,onClose:o.showCloseButton?o.close:void 0});var K=require("react"),n=require("@floating-ui/react-dom");var d={root:"g",tooltip:"l",arrow:"v","arrow-bottom":"m","arrow-top":"x",footer:"u",close:"h"};var i=require("react/jsx-runtime"),bo=4,J=6,uo=8,go=8,C=o=>{var M,O;let e=(0,K.useRef)(null),t=bo+J,{refs:r,middlewareData:l,placement:z,x:Q,y:j}=(0,n.useFloating)({elements:{reference:document.querySelector(o.targetElement)},middleware:[(0,n.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,n.shift)({crossAxis:!0,padding:uo}),(0,n.arrow)({element:e,padding:go}),(0,n.offset)(t)]}),oo=z.includes("top")?"bottom":z.includes("bottom")?"top":z.includes("left")?"right":"left",W=(M=l.arrow)==null?void 0:M.x,I=(O=l.arrow)==null?void 0:O.y,D={left:W!=null?`${W}px`:"",top:I!=null?`${I}px`:"",right:"",bottom:"",[oo]:`${-J}px`};return(0,i.jsx)("div",{className:d.root,children:(0,i.jsxs)("div",{className:d.tooltip,ref:r.setFloating,style:{left:Q,top:j},children:[(0,i.jsx)(b,{variant:"title",children:o.title}),(0,i.jsx)(b,{variant:"body",children:o.body}),(0,i.jsx)("div",{className:d.footer,children:o.buttons}),o.onClose?(0,i.jsx)(x,{className:d.close,onClick:o.onClose,children:(0,i.jsx)(y,{})}):null,(0,i.jsx)("div",{className:[d.arrow,d["arrow-bottom"]].join(" "),ref:e,style:D}),(0,i.jsx)("div",{className:[d.arrow,d["arrow-top"]].join(" "),style:D})]})})};var E=require("react/jsx-runtime"),vo=o=>(0,E.jsx)(C,{title:o.title,body:o.body,targetElement:o.targetElement,onClose:o.showCloseButton?o.close:void 0,buttons:(0,E.jsx)(s,{variant:"primary",onClick:o.continue,children:o.continueText})});var N={};P(N,{Modal:()=>xo,Tooltip:()=>yo});var m=require("react/jsx-runtime"),xo=o=>(0,m.jsx)(h,{title:o.title,body:o.body,overlay:!o.hideOverlay,buttons:(0,m.jsxs)(m.Fragment,{children:[o.previous?(0,m.jsx)(s,{variant:"secondary",onClick:o.previous,children:o.previousText}):null,(0,m.jsx)(s,{variant:"primary",onClick:o.continue,children:o.continueText})]}),onClose:o.showCloseButton?o.cancel:void 0});var p=require("react/jsx-runtime"),yo=o=>(0,p.jsx)(C,{title:o.title,body:o.body,targetElement:o.targetElement,onClose:o.showCloseButton?o.cancel:void 0,buttons:(0,p.jsxs)(p.Fragment,{children:[o.previous?(0,p.jsx)(s,{variant:"secondary",onClick:o.previous,children:o.previousText}):null,(0,p.jsx)(s,{variant:"primary",onClick:o.continue,children:o.continueText})]})}); | ||
"use strict";var Q=Object.create;var w=Object.defineProperty,j=Object.defineProperties,oo=Object.getOwnPropertyDescriptor,eo=Object.getOwnPropertyDescriptors,to=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,ro=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var W=(o,e,t)=>e in o?w(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,d=(o,e)=>{for(var t in e||(e={}))y.call(e,t)&&W(o,t,e[t]);if(c)for(var t of c(e))E.call(e,t)&&W(o,t,e[t]);return o},I=(o,e)=>j(o,eo(e));var m=(o,e)=>{var t={};for(var r in o)y.call(o,r)&&e.indexOf(r)<0&&(t[r]=o[r]);if(o!=null&&c)for(var r of c(o))e.indexOf(r)<0&&E.call(o,r)&&(t[r]=o[r]);return t};var D=(o,e)=>{for(var t in e)w(o,t,{get:e[t],enumerable:!0})},M=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of to(e))!y.call(o,a)&&a!==t&&w(o,a,{get:()=>e[a],enumerable:!(r=oo(e,a))||r.enumerable});return o};var b=(o,e,t)=>(t=o!=null?Q(ro(o)):{},M(e||!o||!o.__esModule?w(t,"default",{value:o,enumerable:!0}):t,o)),ao=o=>M(w({},"__esModule",{value:!0}),o);var go={};D(go,{components:()=>x});module.exports=ao(go);var x={};D(x,{Modal:()=>fo,Tooltip:()=>bo});var A=b(require("classnames"));var C={button:"s",primary:"o",secondary:"r"};var G=require("react/jsx-runtime"),g=r=>{var a=r,{className:o,variant:e}=a,t=m(a,["className","variant"]);return(0,G.jsx)("button",d({type:"button",className:(0,A.default)(C.button,C[e],o)},t))};var $=b(require("classnames"));var O=b(require("classnames"));var N={text:"i",body:"f",title:"d"};var L=require("react/jsx-runtime"),p=r=>{var a=r,{className:o,variant:e}=a,t=m(a,["className","variant"]);return(0,L.jsx)("p",d({className:(0,O.default)(N.text,N[e],o)},t))};var U=b(require("classnames"));var _={button:"a"};var V=require("react/jsx-runtime"),v=t=>{var r=t,{className:o}=r,e=m(r,["className"]);return(0,V.jsx)("button",d({type:"button",className:(0,U.default)(_.button,o)},e))};var z=require("react/jsx-runtime");function u(o){return(0,z.jsx)("svg",I(d({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},o),{children:(0,z.jsx)("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})}))}var f={overlay:"t",wrapper:"n",modal:"w",footer:"b",close:"p"};var l=require("react/jsx-runtime"),H=o=>(0,l.jsxs)(l.Fragment,{children:[o.overlay?(0,l.jsx)("div",{className:(0,$.default)(f.overlay,o.onClose&&f.clickable),onClick:o.onClose,"aria-hidden":"true"}):null,(0,l.jsx)("div",{className:f.wrapper,children:(0,l.jsxs)("div",{className:f.modal,children:[(0,l.jsx)(p,{variant:"title",children:o.title}),(0,l.jsx)(p,{variant:"body",children:o.body}),(0,l.jsx)("div",{className:f.footer,children:o.buttons}),o.onClose?(0,l.jsx)(v,{className:f.close,onClick:o.onClose,children:(0,l.jsx)(u,{})}):null]})})]});var R=require("react/jsx-runtime"),fo=o=>(0,R.jsx)(H,{title:o.title,body:o.body,buttons:(0,R.jsx)(g,{variant:"primary",onClick:o.continue,children:o.continueText}),overlay:!o.hideOverlay,onClose:o.showCloseButton?o.close:void 0});var Y=require("react"),i=require("@floating-ui/react-dom");var n={root:"g",tooltip:"l",arrow:"v","arrow-bottom":"m","arrow-top":"x",footer:"u",close:"h"};var s=require("react/jsx-runtime"),po=4,X=6,wo=8,co=8,Z=o=>{var S,F;let e=(0,Y.useRef)(null),t=po+X,{refs:r,middlewareData:a,placement:h,x:q,y:J}=(0,i.useFloating)({elements:{reference:document.querySelector(o.targetElement)},middleware:[(0,i.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,i.shift)({crossAxis:!0,padding:wo}),(0,i.arrow)({element:e,padding:co}),(0,i.offset)(t)]}),K=h.includes("top")?"bottom":h.includes("bottom")?"top":h.includes("left")?"right":"left",B=(S=a.arrow)==null?void 0:S.x,P=(F=a.arrow)==null?void 0:F.y,T={left:B!=null?`${B}px`:"",top:P!=null?`${P}px`:"",right:"",bottom:"",[K]:`${-X}px`};return(0,s.jsx)("div",{className:n.root,children:(0,s.jsxs)("div",{className:n.tooltip,ref:r.setFloating,style:{left:q,top:J},children:[(0,s.jsx)(p,{variant:"title",children:o.title}),(0,s.jsx)(p,{variant:"body",children:o.body}),(0,s.jsx)("div",{className:n.footer,children:o.buttons}),o.onClose?(0,s.jsx)(v,{className:n.close,onClick:o.onClose,children:(0,s.jsx)(u,{})}):null,(0,s.jsx)("div",{className:[n.arrow,n["arrow-bottom"]].join(" "),ref:e,style:T}),(0,s.jsx)("div",{className:[n.arrow,n["arrow-top"]].join(" "),style:T})]})})};var k=require("react/jsx-runtime"),bo=o=>(0,k.jsx)(Z,{title:o.title,body:o.body,targetElement:o.targetElement,onClose:o.showCloseButton?o.close:void 0,buttons:(0,k.jsx)(g,{variant:"primary",onClick:o.continue,children:o.continueText})}); |
{ | ||
"name": "@flows/react-components", | ||
"version": "0.0.2-canary.2", | ||
"version": "0.0.2-canary.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
29447
40.44%13
85.71%120
87.5%4
33.33%