New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@flows/react-components

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flows/react-components - npm Package Compare versions

Comparing version

to
1.0.3

dist/tooltip-CfH5Fbkg.d.mts

2

dist/index.js
"use client"
"use strict";var j=Object.create;var v=Object.defineProperty,tt=Object.defineProperties,et=Object.getOwnPropertyDescriptor,ot=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,lt=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var $=(t,e,o)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,m=(t,e)=>{for(var o in e||(e={}))N.call(e,o)&&$(t,o,e[o]);if(g)for(var o of g(e))M.call(e,o)&&$(t,o,e[o]);return t},O=(t,e)=>tt(t,ot(e));var p=(t,e)=>{var o={};for(var n in t)N.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&g)for(var n of g(t))e.indexOf(n)<0&&M.call(t,n)&&(o[n]=t[n]);return o};var rt=(t,e)=>{for(var o in e)v(t,o,{get:e[o],enumerable:!0})},k=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of nt(e))!N.call(t,l)&&l!==o&&v(t,l,{get:()=>e[l],enumerable:!(n=et(e,l))||n.enumerable});return t};var b=(t,e,o)=>(o=t!=null?j(lt(t)):{},k(e||!t||!t.__esModule?v(o,"default",{value:t,enumerable:!0}):o,t)),it=t=>k(v({},"__esModule",{value:!0}),t);var yt={};rt(yt,{Modal:()=>st,Tooltip:()=>pt});module.exports=it(yt);var D=b(require("classnames"));var L=require("react/jsx-runtime"),_=n=>{var l=n,{className:t,variant:e}=l,o=p(l,["className","variant"]);return(0,L.jsx)("button",m({type:"button",className:(0,D.default)("flows_button",`flows_button_${e}`,t)},o))};var q=b(require("classnames"));var x=require("react/jsx-runtime");function w(t){return(0,x.jsx)("svg",O(m({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},t),{children:(0,x.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 A=b(require("classnames"));var I=require("react/jsx-runtime"),y=n=>{var l=n,{className:t,variant:e}=l,o=p(l,["className","variant"]);return(0,I.jsx)("p",m({className:(0,A.default)("flows_text",`flows_text_${e}`,t)},o))};var G=b(require("classnames"));var H=require("react/jsx-runtime"),C=o=>{var n=o,{className:t}=n,e=p(n,["className"]);return(0,H.jsx)("button",m({type:"button",className:(0,G.default)("flows_iconButton",t)},e))};var r=require("react/jsx-runtime"),U=t=>(0,r.jsxs)(r.Fragment,{children:[t.overlay?(0,r.jsx)("div",{className:(0,q.default)("flows_modal_overlay",t.onClose&&"flows_modal_clickable"),onClick:t.onClose,"aria-hidden":"true"}):null,(0,r.jsx)("div",{className:"flows_modal_wrapper",children:(0,r.jsxs)("div",{className:"flows_modal_modal",children:[(0,r.jsx)(y,{variant:"title",children:t.title}),(0,r.jsx)(y,{variant:"body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,r.jsx)("div",{className:"flows_modal_footer",children:t.buttons}):null,t.onClose?(0,r.jsx)(C,{"aria-label":"Close",className:"flows_modal_close",onClick:t.onClose,children:(0,r.jsx)(w,{})}):null]})})]});var T=require("react/jsx-runtime"),st=t=>{let e=[];return t.continueText&&e.push((0,T.jsx)(_,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,T.jsx)(U,{title:t.title,body:t.body,buttons:e.length?e:void 0,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0})};var u=require("react"),s=require("@floating-ui/react-dom"),E=b(require("classnames"));var at="#22262d",ct="#fff",V="%cFlows%c",Q=`color:${ct};background:${at};padding:2px 4px;border-radius:4px`,W={error:(t,...e)=>{console.error(`${V} ${t}`,Q,"",...e)},warn:(t,...e)=>{console.warn(`${V} ${t}`,Q,"",...e)}};var h=require("react");function X(t){let[e,o]=(0,h.useState)(t?document.querySelector(t):null);return(0,h.useEffect)(()=>{if(!t){o(null);return}let n=()=>{let c=document.querySelector(t);o(f=>f!==c?c:f)};n();let l=new MutationObserver(c=>{c.some(d=>d.addedNodes.length>0||d.removedNodes.length>0)&&n()});return l.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[t]),e}var i=require("react/jsx-runtime"),mt=4,Y=6,ut=mt+Y,dt=8,ft=8,Z=t=>{var F,S;let e=(0,u.useRef)(null),o=(0,u.useRef)(null),n=(0,u.useRef)(null),l=X(t.targetElement),{refs:c,middlewareData:f,placement:d,x:K,y:z}=(0,s.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:s.autoUpdate,middleware:[(0,s.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,s.shift)({crossAxis:!0,padding:dt}),(0,s.arrow)({element:o,padding:ft}),(0,s.offset)(ut)]}),J=(0,u.useMemo)(()=>d.includes("top")?"bottom":d.includes("bottom")?"top":d.includes("left")?"right":"left",[d]);if((0,u.useEffect)(()=>{t.targetElement||W.error("Cannot render Tooltip without target element")},[t.targetElement]),!l)return null;c.floating.current&&(c.floating.current.style.left=`${K}px`,c.floating.current.style.top=`${z}px`);let B=(F=f.arrow)==null?void 0:F.x,R=(S=f.arrow)==null?void 0:S.y;if([o,e].forEach(a=>{a.current&&(a.current.style.left=B!=null?`${B}px`:"",a.current.style.top=R!=null?`${R}px`:"",a.current.style.right="",a.current.style.bottom="",a.current.style[J]=`${-Y}px`)}),n.current){let a=l.getBoundingClientRect();n.current.style.top=`${a.top}px`,n.current.style.left=`${a.left}px`,n.current.style.width=`${a.width}px`,n.current.style.height=`${a.height}px`}return(0,i.jsxs)("div",{className:"flows_tooltip_root",children:[t.overlay?(0,i.jsx)("div",{className:"flows_tooltip_overlay",ref:n}):null,(0,i.jsxs)("div",{className:"flows_tooltip_tooltip",ref:c.setFloating,children:[(0,i.jsx)(y,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,i.jsx)(y,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,i.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,i.jsx)(C,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,i.jsx)(w,{})}):null,(0,i.jsx)("div",{className:(0,E.default)("flows_tooltip_arrow","flows_tooltip_arrow-bottom"),ref:o}),(0,i.jsx)("div",{className:(0,E.default)("flows_tooltip_arrow","flows_tooltip_arrow-top"),ref:e})]})]})};var P=require("react/jsx-runtime"),pt=t=>{let e=[];return t.continueText&&e.push((0,P.jsx)(_,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,P.jsx)(Z,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0,buttons:e.length?e:void 0})};
"use strict";var j=Object.create;var v=Object.defineProperty,tt=Object.defineProperties,et=Object.getOwnPropertyDescriptor,ot=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,lt=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var $=(t,e,o)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,m=(t,e)=>{for(var o in e||(e={}))N.call(e,o)&&$(t,o,e[o]);if(g)for(var o of g(e))M.call(e,o)&&$(t,o,e[o]);return t},O=(t,e)=>tt(t,ot(e));var p=(t,e)=>{var o={};for(var n in t)N.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&g)for(var n of g(t))e.indexOf(n)<0&&M.call(t,n)&&(o[n]=t[n]);return o};var rt=(t,e)=>{for(var o in e)v(t,o,{get:e[o],enumerable:!0})},k=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of nt(e))!N.call(t,l)&&l!==o&&v(t,l,{get:()=>e[l],enumerable:!(n=et(e,l))||n.enumerable});return t};var b=(t,e,o)=>(o=t!=null?j(lt(t)):{},k(e||!t||!t.__esModule?v(o,"default",{value:t,enumerable:!0}):o,t)),st=t=>k(v({},"__esModule",{value:!0}),t);var yt={};rt(yt,{Modal:()=>it,Tooltip:()=>pt});module.exports=st(yt);var D=b(require("classnames"));var L=require("react/jsx-runtime"),_=n=>{var l=n,{className:t,variant:e}=l,o=p(l,["className","variant"]);return(0,L.jsx)("button",m({type:"button",className:(0,D.default)("flows_button",`flows_button_${e}`,t)},o))};var q=b(require("classnames"));var x=require("react/jsx-runtime");function C(t){return(0,x.jsx)("svg",O(m({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},t),{children:(0,x.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 A=b(require("classnames"));var I=require("react/jsx-runtime"),y=n=>{var l=n,{className:t,variant:e}=l,o=p(l,["className","variant"]);return(0,I.jsx)("p",m({className:(0,A.default)("flows_text",`flows_text_${e}`,t)},o))};var G=b(require("classnames"));var H=require("react/jsx-runtime"),w=o=>{var n=o,{className:t}=n,e=p(n,["className"]);return(0,H.jsx)("button",m({type:"button",className:(0,G.default)("flows_iconButton",t)},e))};var r=require("react/jsx-runtime"),U=t=>(0,r.jsxs)(r.Fragment,{children:[t.overlay?(0,r.jsx)("div",{className:(0,q.default)("flows_modal_overlay",t.onClose&&"flows_modal_clickable"),onClick:t.onClose,"aria-hidden":"true"}):null,(0,r.jsx)("div",{className:"flows_modal_wrapper",children:(0,r.jsxs)("div",{className:"flows_modal_modal",children:[(0,r.jsx)(y,{variant:"title",children:t.title}),(0,r.jsx)(y,{variant:"body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,r.jsx)("div",{className:"flows_modal_footer",children:t.buttons}):null,t.onClose?(0,r.jsx)(w,{"aria-label":"Close",className:"flows_modal_close",onClick:t.onClose,children:(0,r.jsx)(C,{})}):null]})})]});var T=require("react/jsx-runtime"),it=t=>{let e=[];return t.continueText&&e.push((0,T.jsx)(_,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,T.jsx)(U,{title:t.title,body:t.body,buttons:e.length?e:void 0,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0})};var u=require("react"),i=require("@floating-ui/react-dom"),E=b(require("classnames"));var at="#22262d",ct="#fff",V="%cFlows%c",Q=`color:${ct};background:${at};padding:2px 4px;border-radius:4px`,W={error:(t,...e)=>{console.error(`${V} ${t}`,Q,"",...e)},warn:(t,...e)=>{console.warn(`${V} ${t}`,Q,"",...e)}};var h=require("react");function X(t){let[e,o]=(0,h.useState)(t?document.querySelector(t):null);return(0,h.useEffect)(()=>{if(!t){o(null);return}let n=()=>{let c=document.querySelector(t);o(f=>f!==c?c:f)};n();let l=new MutationObserver(c=>{c.some(d=>d.addedNodes.length>0||d.removedNodes.length>0)&&n()});return l.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[t]),e}var s=require("react/jsx-runtime"),mt=4,Y=6,ut=mt+Y,dt=8,ft=8,Z=t=>{var F,S;let e=(0,u.useRef)(null),o=(0,u.useRef)(null),n=(0,u.useRef)(null),l=X(t.targetElement),{refs:c,middlewareData:f,placement:d,x:K,y:z}=(0,i.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:i.autoUpdate,middleware:[(0,i.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,i.shift)({crossAxis:!0,padding:dt}),(0,i.arrow)({element:o,padding:ft}),(0,i.offset)(ut)]}),J=(0,u.useMemo)(()=>d.includes("top")?"bottom":d.includes("bottom")?"top":d.includes("left")?"right":"left",[d]);if((0,u.useEffect)(()=>{t.targetElement||W.error("Cannot render Tooltip without target element")},[t.targetElement]),!l)return null;c.floating.current&&(c.floating.current.style.left=`${K}px`,c.floating.current.style.top=`${z}px`);let B=(F=f.arrow)==null?void 0:F.x,R=(S=f.arrow)==null?void 0:S.y;if([o,e].forEach(a=>{a.current&&(a.current.style.left=B!=null?`${B}px`:"",a.current.style.top=R!=null?`${R}px`:"",a.current.style.right="",a.current.style.bottom="",a.current.style[J]=`${-Y}px`)}),n.current){let a=l.getBoundingClientRect();n.current.style.top=`${a.top}px`,n.current.style.left=`${a.left}px`,n.current.style.width=`${a.width}px`,n.current.style.height=`${a.height}px`}return(0,s.jsxs)("div",{className:"flows_tooltip_root",children:[t.overlay?(0,s.jsx)("div",{className:"flows_tooltip_overlay",ref:n}):null,(0,s.jsxs)("div",{className:"flows_tooltip_tooltip",ref:c.setFloating,children:[(0,s.jsx)(y,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,s.jsx)(y,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,s.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,s.jsx)(w,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,s.jsx)(C,{})}):null,(0,s.jsx)("div",{className:(0,E.default)("flows_tooltip_arrow","flows_tooltip_arrow-bottom"),ref:o}),(0,s.jsx)("div",{className:(0,E.default)("flows_tooltip_arrow","flows_tooltip_arrow-top"),ref:e})]})]})};var P=require("react/jsx-runtime"),pt=t=>{let e=[];return t.continueText&&e.push((0,P.jsx)(_,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,P.jsx)(Z,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0,buttons:e.length?e:void 0})};
import { FC } from 'react';
import { P as Placement } from './tooltip-S3Jb9fey.js';
import { T as TourComponentProps, P as Placement } from './tooltip-CfH5Fbkg.js';
type TourComponentProps<T extends Record<string, any> = any> = {
continue: () => void;
previous?: () => void;
cancel: () => void;
} & T;
type ModalProps = TourComponentProps<{

@@ -11,0 +5,0 @@ title: string;

{
"name": "@flows/react-components",
"version": "1.0.2",
"version": "1.0.3",
"description": "Built-in components for Flows React SDK",

@@ -38,4 +38,4 @@ "keywords": [

"typescript": "^5.7.3",
"@flows/shared": "1.0.0",
"@flows/styles": "1.0.0"
"@flows/styles": "1.0.0",
"@flows/shared": "1.0.0"
},

@@ -42,0 +42,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet