@frigade/react 2.0.0-alpha.5 → 2.0.0-alpha.7

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.
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var _ = require('react');
3
+ var X = require('react');
4
4
  var clsx = require('clsx');
5
5
  var jsxRuntime = require('@emotion/react/jsx-runtime');
6
6
  var react = require('@emotion/react');
7
7
  var solid = require('@heroicons/react/24/solid');
8
- var P = require('@radix-ui/react-popover');
8
+ var v = require('@radix-ui/react-popover');
9
9
  var js = require('@frigade/js');
10
10
 
11
11
  function _interopNamespace(e) {
@@ -26,17 +26,17 @@ function _interopNamespace(e) {
26
26
  return Object.freeze(n);
27
27
  }
28
28
 
29
- var ___namespace = /*#__PURE__*/_interopNamespace(_);
30
- var P__namespace = /*#__PURE__*/_interopNamespace(P);
29
+ var X__namespace = /*#__PURE__*/_interopNamespace(X);
30
+ var v__namespace = /*#__PURE__*/_interopNamespace(v);
31
31
 
32
- var ee=Object.defineProperty,Ee=Object.defineProperties;var Ae=Object.getOwnPropertyDescriptors;var W=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var Z=(e,t,o)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))te.call(t,o)&&Z(e,o,t[o]);if(W)for(var o of W(t))oe.call(t,o)&&Z(e,o,t[o]);return e},l=(e,t)=>Ee(e,Ae(t));var u=(e,t)=>{var o={};for(var r in e)te.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&W)for(var r of W(e))t.indexOf(r)<0&&oe.call(e,r)&&(o[r]=e[r]);return o};var re=(e,t)=>{for(var o in t)ee(e,o,{get:t[o],enumerable:!0});};var k=(e,t,o)=>new Promise((r,n)=>{var s=d=>{try{p(o.next(d));}catch(f){n(f);}},c=d=>{try{p(o.throw(d));}catch(f){n(f);}},p=d=>d.done?r(d.value):Promise.resolve(d.value).then(s,c);p((o=o.apply(e,t)).next());});var De="px",He=e=>typeof e=="number"?`${4*e}${De}`:e,Ve=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],Ie=Object.fromEntries(Ve.map(e=>[e,He(e)])),Me={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"},$={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"},colors:i({},Me),fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:"400",demibold:"600",bold:"700"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"10px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.1)"},space:Ie};var a=e=>`var(--fr-colors-${e})`,ne={neutral:{background:a("white"),border:a("gray500"),foreground:a("black"),surface:a("gray700"),active:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},focus:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},hover:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")}},primary:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500"),active:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")},focus:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500")},hover:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")}},secondary:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900"),active:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")},focus:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900")},hover:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")}}};var j=l(i({},$),{colors:i(i({},$.colors),ne)});function F(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let c=`${t.length?`${t}${o}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,F(p,c,o)):r[c]=p,r},{})}function L(e){return F(e,"--fr","-")}function ie(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=ie(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var se=L(j),g=ie(j);var z=F(g.colors),ae={color:z,backgroundColor:z,borderColor:z,border:g.borders,borderRadius:g.radii,borderWidth:g.borderWidths,fontFamily:g.fontFamilies,fontSize:g.fontSizes,fontWeight:g.fontWeights,gap:g.space,lineHeight:g.lineHeights,margin:g.space,marginTop:g.space,marginRight:g.space,marginBottom:g.space,marginLeft:g.space,padding:g.space,paddingTop:g.space,paddingRight:g.space,paddingBottom:g.space,paddingLeft:g.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"]},le={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]};function We(e){if(Array.isArray(e))return new Map(e.map(t=>[t,t]));if(typeof e=="object"&&e!==null)return new Map(Object.entries(e));if(["string","number"].includes(typeof e))return new Map([e,e]);throw new Error("Invalid entry in styleProps")}var $e=new Map(Object.entries(ae).map(([e,t])=>[e,We(t)])),je=new Map(Object.entries(le).map(([e,t])=>[e,new Set(t)]));function ce(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let s=je.get(r);s!=null&&(s.forEach(c=>{t[c]=n;}),delete t[r]);}),Object.entries(t).forEach(([r,n])=>{let s=$e.get(r);if(s!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let c=n.split(" ");o[r]=c.map(p=>{var d;return (d=s.get(p.toString()))!=null?d:p}).join(" "),delete t[r];}else s.has(n.toString())&&(o[r]=s.get(n.toString()),delete t[r]);}),{cssFromProps:o,unmatchedProps:t}}function pe(e){return e&&`fr-${e}`}function ze(e){return e&&(Array.isArray(e)?e.map(t=>pe(t)).join(" "):pe(e))}function Ke(c,s){var p=c,{as:e,children:t,className:o,part:r}=p,n=u(p,["as","children","className","part"]);let d=e!=null?e:"div",{cssFromProps:f,unmatchedProps:b}=ce(n),y=ze(r),R=o||y?clsx.clsx(o,y):void 0;return jsxRuntime.jsx(d,l(i({className:R,css:[{boxSizing:"border-box"},f]},b),{ref:s,children:t}))}var m=___namespace.forwardRef(Ke);var K={};re(K,{Body1:()=>Qe,Body2:()=>Ye,Caption:()=>Ze,Display1:()=>_e,Display2:()=>Ue,H1:()=>Xe,H2:()=>qe,H3:()=>Ge,H4:()=>Je});var w={color:"neutral.foreground",fontFamily:"default",margin:0},_e=l(i({},w),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Ue=l(i({},w),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Xe=l(i({},w),{fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"}),qe=l(i({},w),{fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"}),Ge=l(i({},w),{fontSize:"xl",fontWeight:"bold",lineHeight:"lg"}),Je=l(i({},w),{fontSize:"lg",fontWeight:"bold",lineHeight:"md"}),Qe=l(i({},w),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Ye=l(i({},w),{fontSize:"sm",fontWeight:"regular",lineHeight:"md"}),Ze=l(i({},w),{fontSize:"xs",fontWeight:"regular",lineHeight:"sm"});function fe(n){var s=n,{as:e="span",children:t,variant:o="Body1"}=s,r=u(s,["as","children","variant"]);return jsxRuntime.jsx(m,l(i(i({as:e},K[o]),r),{children:t}))}var et=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],tt=Object.fromEntries(et.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsxRuntime.jsx(fe,l(i({as:t},r),{variant:e,children:r.children}));return o.displayName=`Text.${e}`,[e,o]})),B=Object.assign(fe,tt);var N={};re(N,{Link:()=>nt,Plain:()=>it,Primary:()=>ot,Secondary:()=>rt,base:()=>O});var O=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),ot=({colors:e})=>[O,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],rt=({colors:e})=>[O,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],nt=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],it=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.neutral.foreground}];function ge(s){var c=s,{as:e,children:t,title:o,variant:r="Primary"}=c,n=u(c,["as","children","title","variant"]);return jsxRuntime.jsxs(m,l(i({as:e!=null?e:"button",css:N[r]},n),{children:[t,o&&jsxRuntime.jsx(B.Body2,{fontWeight:"demibold",color:"inherit",children:o})]}))}var st=["Primary","Secondary","Link","Plain"],at=Object.fromEntries(st.map(e=>{let t=e.toLocaleLowerCase(),o=s=>{var c=s,{part:r}=c,n=u(c,["part"]);return jsxRuntime.jsx(ge,l(i({part:[`button-${t}`,r]},n),{variant:e,children:n.children}))};return o.displayName=`Text.${e}`,[e,o]})),E=Object.assign(ge,at);var ct=___namespace.forwardRef((n,r)=>{var s=n,{children:e,css:t}=s,o=u(s,["children","css"]);return jsxRuntime.jsx(m,l(i({css:[{display:"flex",flexDirection:"row"},t]},o),{ref:r,children:e}))}),pt=___namespace.forwardRef((n,r)=>{var s=n,{children:e,css:t}=s,o=u(s,["children","css"]);return jsxRuntime.jsx(m,l(i({css:[{display:"flex",flexDirection:"column"},t]},o),{ref:r,children:e}))}),C={Column:pt,Row:ct};var U=_.createContext({apiKey:"",config:{}});function gt({apiKey:e,children:t,config:o={},theme:r}){let n=r?L(r):{};return jsxRuntime.jsxs(U.Provider,{value:{apiKey:e,config:o},children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i({},se),n)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:g,children:t})]})}function he(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=_.useState(e),[r,n]=_.useState(null),s=_.useCallback(c=>{n(c);},[]);return _.useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:s}}var ht=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function we(r){var n=r,{style:e={},part:t=""}=n,o=u(n,["style","part"]);return jsxRuntime.jsxs(m,l(i({part:`dot-wrapper ${t}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},o),{children:[jsxRuntime.jsx(m,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${ht}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(m,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Be(r){var n=r,{part:e,src:t}=n,o=u(n,["part","src"]);return jsxRuntime.jsx(m,i({as:"img",part:["image",e],src:t},o))}function Bt(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Te(r){var n=r,{part:e,src:t}=n,o=u(n,["part","src"]);let s=Bt(t);return jsxRuntime.jsx(m,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:s},o))}function X(r){var n=r,{src:e,type:t}=n,o=u(n,["src","type"]);return jsxRuntime.jsx(t==="video"?Te:Be,i({src:e},o))}function ve({props:e,alignAttr:t,sideAttr:o}){let r=o!=null?o:"bottom",n={},s=()=>{var f;if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return (f=e.align)!=null?f:"after"},c="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=c;let d=s();return ["before","end"].includes(d)?["top","bottom"].includes(r)?n.right=c:n.bottom=c:["after","start"].includes(d)?["top","bottom"].includes(r)?n.left=c:n.top=c:["top","bottom"].includes(r)?n.left=`calc(50% + ${c})`:n.top=`calc(50% + ${c})`,n}var Ce={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Re(e,t){var n,s,c,p,d;let o=Object.fromEntries(Ce.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(Ce.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0));if(o.align=(n=o.align)!=null?n:"after",o.side=(s=o.side)!=null?s:"bottom",["before","after"].includes(o.align)){let f={after:"end",before:"start"},b=(H,V)=>["top","bottom"].includes(V)?H=="after"?"marginLeft":"marginRight":H=="after"?"marginTop":"marginBottom",y=(c=o.alignOffset)!=null?c:0,R=(p=o.style)!=null?p:{},v=(d=o.side)!=null?d:"bottom",A=o.align;o.style=l(i({},R),{[b(A,v)]:y});let D=["top","bottom"].includes(v)?t.width:t.height;o.alignOffset=(D+y)*-1,o.align=f[A];}return {contentProps:o,rootProps:r}}function x(c){var p=c,{anchor:e,children:t,className:o,spotlight:r=!1,style:n}=p,s=u(p,["anchor","children","className","spotlight","style"]);let{node:d,rect:f,ref:b}=he(),{contentProps:y,rootProps:R}=Re(s,f),[v,A]=_.useState(y.align),[D,H]=_.useState(y.side);if(d!==null){let S=d.getAttribute("data-align"),Y=d.getAttribute("data-side");v!==S&&A(S),D!==Y&&H(Y);}let V=_.useRef(null),[I,Fe]=_.useState(null);if(_.useEffect(()=>{let S=document.querySelector(e);S!=null&&(V.current=S,Fe(V));},[e]),I==null)return null;let M=I.current.getBoundingClientRect(),Q="0";typeof window!="undefined"&&(Q=window.getComputedStyle(I.current).borderRadius);let Oe=ve({props:s,alignAttr:v,sideAttr:D});return jsxRuntime.jsxs(P__namespace.Root,l(i({defaultOpen:!0},R),{children:[jsxRuntime.jsx(P__namespace.Anchor,{virtualRef:I}),jsxRuntime.jsx(P__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:o,css:{position:"absolute",zIndex:9999},children:[r&&jsxRuntime.jsx(m,{borderRadius:Q,part:"tooltip-spotlight",position:"absolute",css:{boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:M.height,left:M.left,top:M.top,width:M.width}}),jsxRuntime.jsx(P__namespace.Content,l(i({asChild:!0},y),{ref:b,children:jsxRuntime.jsxs(C.Column,{backgroundColor:"neutral.background",borderRadius:"md",p:5,part:"tooltip-content",position:"relative",css:i({boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)",maxWidth:"360px"},n),children:[jsxRuntime.jsx(we,{style:Oe}),t]})}))]})})]}))}x.Close=e=>jsxRuntime.jsx(P__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(E.Plain,l(i({css:{top:"12px",right:"4px"},part:"tooltip-close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});x.Media=o=>{var r=o,{src:e}=r,t=u(r,["src"]);return e==null?null:jsxRuntime.jsx(X,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e},t))};x.Primary=r=>{var n=r,{onClick:e,title:t}=n,o=u(n,["onClick","title"]);return t==null?null:jsxRuntime.jsx(E.Primary,i({title:t,onClick:e},o))};x.Progress=o=>{var r=o,{children:e}=r,t=u(r,["children"]);return e==null?null:jsxRuntime.jsx(B.Body2,l(i({fontWeight:"demibold",part:"progress"},t),{children:e}))};x.Secondary=r=>{var n=r,{onClick:e,title:t}=n,o=u(n,["onClick","title"]);return t==null?null:jsxRuntime.jsx(E.Secondary,i({title:t,onClick:e},o))};x.Subtitle=o=>{var r=o,{children:e}=r,t=u(r,["children"]);return e==null?null:jsxRuntime.jsx(B.Body2,l(i({part:"subtitle"},t),{children:e}))};x.Title=o=>{var r=o,{children:e}=r,t=u(r,["children"]);return e==null?null:jsxRuntime.jsx(B.Body1,l(i({fontWeight:"bold",mb:1,part:"title"},t),{children:e}))};function ke(e){let[t,o]=_.useState(),[r,n]=_.useState(Math.random()),{apiKey:s,config:c}=_.useContext(U),p=Object.fromEntries(Object.entries(c).filter(([b,y])=>["apiUrl","userId"].includes(b)&&y!=null)),d=new js.Frigade(s,p);_.useEffect(()=>{let b=y=>{y.id===e&&(o(y),n(Math.random()));};return f(),d.onFlowStateChange(b),()=>{d.removeOnFlowStateChangeHandler(b);}},[]);function f(){return k(this,null,function*(){let b=yield d.getFlow(e);o(b);})}return {flow:t,fetchFlow:f}}function Et(o){var r=o,{flowId:e}=r,t=u(r,["flowId"]);var f;let{flow:n}=ke(e);if(n==null||n.isVisible===!1)return null;n.start();let s=n.getCurrentStep();s==null||s.start();function c(){return k(this,null,function*(){yield n.skip();})}function p(){return k(this,null,function*(){yield s.complete();})}let d=p;return jsxRuntime.jsxs(x,l(i({anchor:s.selector,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault()},t),{children:[jsxRuntime.jsx(x.Close,{onClick:c}),jsxRuntime.jsx(x.Media,{src:(f=s.videoUri)!=null?f:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsx(x.Title,{children:s.title}),jsxRuntime.jsx(x.Subtitle,{children:s.subtitle}),jsxRuntime.jsxs(C.Row,{pt:4,alignItems:"center",justifyContent:"space-between",children:[jsxRuntime.jsx(x.Progress,{children:`${(s==null?void 0:s.order)+1}/${n.steps.size}`}),jsxRuntime.jsxs(C.Row,{gap:3,children:[jsxRuntime.jsx(x.Secondary,{title:s.secondaryButtonTitle,onClick:d}),jsxRuntime.jsx(x.Primary,{title:s.primaryButtonTitle,onClick:p})]})]})]}))}
32
+ var ee=Object.defineProperty,Ie=Object.defineProperties;var Ve=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var Z=(e,t,o)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,s=(e,t)=>{for(var o in t||(t={}))te.call(t,o)&&Z(e,o,t[o]);if($)for(var o of $(t))oe.call(t,o)&&Z(e,o,t[o]);return e},p=(e,t)=>Ie(e,Ve(t));var f=(e,t)=>{var o={};for(var r in e)te.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&$)for(var r of $(e))t.indexOf(r)<0&&oe.call(e,r)&&(o[r]=e[r]);return o};var re=(e,t)=>{for(var o in t)ee(e,o,{get:t[o],enumerable:!0});};var T=(e,t,o)=>new Promise((r,n)=>{var i=u=>{try{d(o.next(u));}catch(c){n(c);}},l=u=>{try{d(o.throw(u));}catch(c){n(c);}},d=u=>u.done?r(u.value):Promise.resolve(u.value).then(i,l);d((o=o.apply(e,t)).next());});var We="px",$e=e=>typeof e=="number"?`${4*e}${We}`:e,je=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],Le=Object.fromEntries(je.map(e=>[e,$e(e)])),ze={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"},L={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"},colors:s({},ze),fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"10px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.1)"},space:Le};var a=e=>`var(--fr-colors-${e})`,ne={neutral:{background:a("white"),border:a("gray500"),foreground:a("black"),surface:a("gray700"),active:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},focus:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},hover:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")}},primary:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500"),active:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")},focus:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500")},hover:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")}},secondary:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900"),active:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")},focus:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900")},hover:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")}}};var z=p(s({},L),{colors:s(s({},L.colors),ne)});function k(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let l=`${t.length?`${t}${o}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,k(d,l,o)):r[l]=d,r},{})}function K(e){return k(e,"--fr","-")}function ie(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=ie(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var se=K(z),m=ie(z);var U=k(m.colors),ae={color:U,backgroundColor:U,borderColor:U,border:m.borders,borderRadius:m.radii,borderWidth:m.borderWidths,fontFamily:m.fontFamilies,fontSize:m.fontSizes,fontWeight:m.fontWeights,gap:m.space,lineHeight:m.lineHeights,margin:m.space,marginTop:m.space,marginRight:m.space,marginBottom:m.space,marginLeft:m.space,padding:m.space,paddingTop:m.space,paddingRight:m.space,paddingBottom:m.space,paddingLeft:m.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"]},le={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]};function Ke(e){if(Array.isArray(e))return new Map(e.map(t=>[t,t]));if(typeof e=="object"&&e!==null)return new Map(Object.entries(e));if(["string","number"].includes(typeof e))return new Map([e,e]);throw new Error("Invalid entry in styleProps")}var Ue=new Map(Object.entries(ae).map(([e,t])=>[e,Ke(t)])),Ne=new Map(Object.entries(le).map(([e,t])=>[e,new Set(t)]));function pe(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let i=Ne.get(r);i!=null&&(i.forEach(l=>{t[l]=n;}),delete t[r]);}),Object.entries(t).forEach(([r,n])=>{let i=Ue.get(r);if(i!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let l=n.split(" ");o[r]=l.map(d=>{var u;return (u=i.get(d.toString()))!=null?u:d}).join(" "),delete t[r];}else i.has(n.toString())&&(o[r]=i.get(n.toString()),delete t[r]);}),{cssFromProps:o,unmatchedProps:t}}function ce(e){return e&&`fr-${e}`}function Xe(e){return e&&(Array.isArray(e)?e.map(t=>ce(t)).join(" "):ce(e))}function qe(l,i){var d=l,{as:e,children:t,className:o,part:r}=d,n=f(d,["as","children","className","part"]);let u=e!=null?e:"div",{cssFromProps:c,unmatchedProps:y}=pe(n),h=Xe(r),w=o||h?clsx.clsx(o,h):void 0;return jsxRuntime.jsx(u,p(s({className:w,css:[{boxSizing:"border-box"},c]},y),{ref:i,children:t}))}var g=X__namespace.forwardRef(qe);var N={};re(N,{Body1:()=>ot,Body2:()=>rt,Caption:()=>nt,Display1:()=>Je,Display2:()=>Qe,H1:()=>Ye,H2:()=>Ze,H3:()=>et,H4:()=>tt});var C={color:"neutral.foreground",fontFamily:"default",margin:0},Je=p(s({},C),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Qe=p(s({},C),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Ye=p(s({},C),{fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"}),Ze=p(s({},C),{fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"}),et=p(s({},C),{fontSize:"xl",fontWeight:"bold",lineHeight:"lg"}),tt=p(s({},C),{fontSize:"lg",fontWeight:"bold",lineHeight:"md"}),ot=p(s({},C),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),rt=p(s({},C),{fontSize:"sm",fontWeight:"regular",lineHeight:"md"}),nt=p(s({},C),{fontSize:"xs",fontWeight:"regular",lineHeight:"sm"});function fe(n){var i=n,{as:e="span",children:t,variant:o="Body1"}=i,r=f(i,["as","children","variant"]);return jsxRuntime.jsx(g,p(s(s({as:e},N[o]),r),{children:t}))}var it=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],st=Object.fromEntries(it.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsxRuntime.jsx(fe,p(s({as:t},r),{variant:e,children:r.children}));return o.displayName=`Text.${e}`,[e,o]})),S=Object.assign(fe,st);var _={};re(_,{Link:()=>pt,Plain:()=>ct,Primary:()=>at,Secondary:()=>lt,base:()=>O});var O=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),at=({colors:e})=>[O,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],lt=({colors:e})=>[O,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],pt=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],ct=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.neutral.foreground}];function me(i){var l=i,{as:e,children:t,title:o,variant:r="Primary"}=l,n=f(l,["as","children","title","variant"]);return jsxRuntime.jsxs(g,p(s({as:e!=null?e:"button",css:_[r]},n),{children:[t,o&&jsxRuntime.jsx(S.Body2,{fontWeight:"demibold",color:"inherit",children:o})]}))}var dt=["Primary","Secondary","Link","Plain"],ft=Object.fromEntries(dt.map(e=>{let t=e.toLocaleLowerCase(),o=i=>{var l=i,{part:r}=l,n=f(l,["part"]);return jsxRuntime.jsx(me,p(s({part:[`button-${t}`,r]},n),{variant:e,children:n.children}))};return o.displayName=`Text.${e}`,[e,o]})),H=Object.assign(me,ft);var mt=X__namespace.forwardRef((n,r)=>{var i=n,{children:e,css:t}=i,o=f(i,["children","css"]);return jsxRuntime.jsx(g,p(s({css:[{display:"flex",flexDirection:"row"},t]},o),{ref:r,children:e}))}),gt=X__namespace.forwardRef((n,r)=>{var i=n,{children:e,css:t}=i,o=f(i,["children","css"]);return jsxRuntime.jsx(g,p(s({css:[{display:"flex",flexDirection:"column"},t]},o),{ref:r,children:e}))}),E={Column:gt,Row:mt};var B=X.createContext({apiKey:"",config:{},modals:[],setModals:()=>{},navigate:()=>{}});function Pt({apiKey:e,children:t,config:o={},navigate:r,theme:n}){let i=n?K(n):{},[l,d]=X.useState([]),u=r!=null?r:(c,y="_self")=>{window.open(c,y);};return jsxRuntime.jsxs(B.Provider,{value:{apiKey:e,config:o,modals:l,setModals:d,navigate:u},children:[jsxRuntime.jsx(react.Global,{styles:{":root":s(s({},se),i)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:m,children:t})]})}function he(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=X.useState(e),[r,n]=X.useState(null),i=X.useCallback(l=>{n(l);},[]);return X.useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:i}}var St=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function ve(r){var n=r,{style:e={},part:t=""}=n,o=f(n,["style","part"]);return jsxRuntime.jsxs(g,p(s({part:`dot-wrapper ${t}`,style:s({height:"48px",position:"absolute",width:"48px"},e)},o),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${St}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ce(r){var n=r,{part:e,src:t}=n,o=f(n,["part","src"]);return jsxRuntime.jsx(g,s({as:"img",part:["image",e],src:t},o))}function Ft(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function we(r){var n=r,{part:e,src:t}=n,o=f(n,["part","src"]);let i=Ft(t);return jsxRuntime.jsx(g,s({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:i},o))}function q(r){var n=r,{src:e,type:t}=n,o=f(n,["src","type"]);return jsxRuntime.jsx(t==="video"?we:Ce,s({src:e},o))}function Te({props:e,alignAttr:t,sideAttr:o}){let r=o!=null?o:"bottom",n={},i=()=>{var c;if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return (c=e.align)!=null?c:"after"},l="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=l;let u=i();return ["before","end"].includes(u)?["top","bottom"].includes(r)?n.right=l:n.bottom=l:["after","start"].includes(u)?["top","bottom"].includes(r)?n.left=l:n.top=l:["top","bottom"].includes(r)?n.left=`calc(50% + ${l})`:n.top=`calc(50% + ${l})`,n}var Se={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Be(e,t){var n,i,l,d,u;let o=Object.fromEntries(Se.content.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0)),r=Object.fromEntries(Se.root.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0));if(o.align=(n=o.align)!=null?n:"after",o.side=(i=o.side)!=null?i:"bottom",["before","after"].includes(o.align)){let c={after:"end",before:"start"},y=(A,I)=>["top","bottom"].includes(I)?A=="after"?"marginLeft":"marginRight":A=="after"?"marginTop":"marginBottom",h=(l=o.alignOffset)!=null?l:0,w=(d=o.style)!=null?d:{},P=(u=o.side)!=null?u:"bottom",M=o.align;o.style=p(s({},w),{[y(M,P)]:h});let D=["top","bottom"].includes(P)?t.width:t.height;o.alignOffset=(D+h)*-1,o.align=c[M];}return {contentProps:o,rootProps:r}}function x(l){var d=l,{anchor:e,children:t,className:o,spotlight:r=!1,style:n}=d,i=f(d,["anchor","children","className","spotlight","style"]);let{node:u,rect:c,ref:y}=he(),{contentProps:h,rootProps:w}=Be(i,c),[P,M]=X.useState(h.align),[D,A]=X.useState(h.side);if(u!==null){let F=u.getAttribute("data-align"),Y=u.getAttribute("data-side");P!==F&&M(F),D!==Y&&A(Y);}let I=X.useRef(null),[V,De]=X.useState(null);if(X.useEffect(()=>{let F=document.querySelector(e);F!=null&&(I.current=F,De(I));},[e]),V==null)return null;let W=V.current.getBoundingClientRect(),Q="0";typeof window!="undefined"&&(Q=window.getComputedStyle(V.current).borderRadius);let Ae=Te({props:i,alignAttr:P,sideAttr:D});return jsxRuntime.jsxs(v__namespace.Root,p(s({defaultOpen:!0},w),{children:[jsxRuntime.jsx(v__namespace.Anchor,{virtualRef:V}),jsxRuntime.jsx(v__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:o,css:{position:"absolute",zIndex:9999},children:[r&&jsxRuntime.jsx(g,{borderRadius:Q,part:"tooltip-spotlight",position:"absolute",css:{boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:W.height,left:W.left,top:W.top,width:W.width}}),jsxRuntime.jsx(v__namespace.Content,p(s({asChild:!0},h),{ref:y,children:jsxRuntime.jsxs(E.Column,{backgroundColor:"neutral.background",borderRadius:"md",p:5,part:"tooltip-content",position:"relative",css:s({boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)",maxWidth:"360px"},n),children:[jsxRuntime.jsx(ve,{style:Ae}),t]})}))]})})]}))}x.Close=e=>jsxRuntime.jsx(v__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(H.Plain,p(s({css:{top:"12px",right:"4px"},part:"tooltip-close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});x.Media=o=>{var r=o,{src:e}=r,t=f(r,["src"]);return e==null?null:jsxRuntime.jsx(q,s({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e},t))};x.Primary=r=>{var n=r,{onClick:e,title:t}=n,o=f(n,["onClick","title"]);return t==null?null:jsxRuntime.jsx(H.Primary,s({title:t,onClick:e},o))};x.Progress=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,p(s({fontWeight:"demibold",part:"progress"},t),{children:e}))};x.Secondary=r=>{var n=r,{onClick:e,title:t}=n,o=f(n,["onClick","title"]);return t==null?null:jsxRuntime.jsx(H.Secondary,s({title:t,onClick:e},o))};x.Subtitle=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,p(s({part:"subtitle"},t),{children:e}))};x.Title=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsxRuntime.jsx(S.Body1,p(s({fontWeight:"bold",mb:1,part:"title"},t),{children:e}))};function Re(e){let[t,o]=X.useState(),{apiKey:r,config:n}=X.useContext(B),i=Object.fromEntries(Object.entries(n).filter(([c,y])=>["apiUrl","userId"].includes(c)&&y!=null)),d=X.useRef(new js.Frigade(r,i)).current,u=c=>{if(c.id!==e)return;let y=Object.assign(Object.create(Object.getPrototypeOf(c)),c);o(y);};return X.useEffect(()=>(T(this,null,function*(){let c=yield d.getFlow(e);o(c);}),d.onStateChange(u),()=>{d.removeStateChangeHandler(u);}),[]),{flow:t}}function ke(e){let{modals:t,setModals:o}=X.useContext(B),[r,n]=X.useState(!1);return X.useEffect(()=>(o([...t,e]),()=>o(t.filter(i=>i!==e))),[]),X.useEffect(()=>{let i=t[0]===e;i!==r&&n(i);},[t]),{isCurrentModal:r}}function j(e,{onComplete:t,onDismiss:o}={}){let r=X.useRef(null);return X.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&t(e),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:X.useCallback(n=>T(this,null,function*(){if((o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;yield e.skip();}),[e])}}function He(e,{onPrimary:t,onSecondary:o}={}){let{navigate:r}=X.useContext(B);return {handlePrimary:X.useCallback(n=>T(this,null,function*(){if((t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;yield e.complete(),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);}),[e]),handleSecondary:X.useCallback(n=>T(this,null,function*(){if((o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;yield e.complete(),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);}),[e])}}function Me(l){var d=l,{step:e,flow:t,onDismiss:o,onPrimary:r,onSecondary:n}=d,i=f(d,["step","flow","onDismiss","onPrimary","onSecondary"]);var w;let{isCurrentModal:u}=ke(`${t.id}-${e.id}`),{handleDismiss:c}=j(t,{onDismiss:o}),{handlePrimary:y,handleSecondary:h}=He(e,{onPrimary:r,onSecondary:n});return u?jsxRuntime.jsxs(x,p(s({anchor:e.selector,onOpenAutoFocus:P=>P.preventDefault(),onPointerDownOutside:P=>P.preventDefault()},i),{children:[jsxRuntime.jsx(x.Close,{onClick:c}),jsxRuntime.jsx(x.Media,{src:(w=e.videoUri)!=null?w:e.imageUri,type:e.videoUri?"video":"image"}),jsxRuntime.jsx(x.Title,{children:e.title}),jsxRuntime.jsx(x.Subtitle,{children:e.subtitle}),jsxRuntime.jsxs(E.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(x.Progress,{children:`${(e==null?void 0:e.order)+1}/${t.steps.size}`}),jsxRuntime.jsx(x.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:h}),jsxRuntime.jsx(x.Primary,{title:e.primaryButtonTitle,onClick:y})]})]}),e.id):null}function Nt(r){var n=r,{flowId:e,onComplete:t}=n,o=f(n,["flowId","onComplete"]);let{flow:i}=Re(e);if(j(i,{onComplete:t}),i==null||i.isVisible===!1)return null;i.start();let l=i.getCurrentStep();return l==null||l.start(),jsxRuntime.jsx(Me,s({step:l,flow:i},o))}
33
33
 
34
- exports.Box = m;
35
- exports.Button = E;
36
- exports.Flex = C;
37
- exports.Provider = gt;
38
- exports.Text = B;
34
+ exports.Box = g;
35
+ exports.Button = H;
36
+ exports.Flex = E;
37
+ exports.Provider = Pt;
38
+ exports.Text = S;
39
39
  exports.Tooltip = x;
40
- exports.Tour = Et;
40
+ exports.Tour = Nt;
41
41
  //# sourceMappingURL=out.js.map
42
42
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Box/index.tsx","../src/shared/tokens/scalarTokens.ts","../src/shared/tokens/semanticColors.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/styleProps.ts","../src/components/Box/stylePropsToCss.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Provider/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useFlow.ts","../src/components/Tour/index.tsx"],"names":["React","clsx","SPACE_UNIT","spaceValue","key","spaceKeys","spaceScale","palette","scalarTokens","__spreadValues","colorVar","colorName","semanticColors","tokens","__spreadProps","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","colorTokens","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","_a","jsx","prefixPart","part","processPart","p","BoxWithRef","ref","_b","as","children","className","__objRest","Component","processedPart","classNameWithPart","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","BaseText","variant","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","Link","Plain","Primary","Secondary","radii","space","colors","jsxs","BaseButton","title","buttonVariantNames","buttonVariantComponents","variantPart","Button","Row","css","Column","Flex","createContext","Global","ThemeProvider","FrigadeContext","Provider","apiKey","config","themeOverrides","useEffect","useRef","useState","XMarkIcon","Popover","useCallback","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","Image","src","getVideoEmbedSrc","videoUri","_c","Video","videoEmbedSrc","Media","type","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToRadixProps","contentRect","_d","_e","contentProps","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","lengthOfCurrentSide","Tooltip","anchor","spotlight","contentNode","contentRef","setAlignAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","anchorElementRef","setAnchorElementRef","anchorQuery","anchorRect","anchorRadius","dotPosition","onClick","Frigade","useContext","useFlow","flowId","flow","setFlow","_","setNonce","filteredConfig","frigade","handler","updatedFlow","fetchFlow","__async","flowResponse","Tour","step","handleDismiss","handlePrimary","handleSecondary","e"],"mappings":"w2BAAA,UAAYA,OAAW,QACvB,OAAS,QAAAC,OAAY,OCArB,IAAMC,GAAa,KAEbC,GAAcC,GAClB,OAAOA,GAAQ,SAAW,GAAG,EAAcA,IAAMF,KAAeE,EAE5DC,GAAY,CAChB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,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AM,MAEX,WAAYA,EAAM,YAElB,OAAQA,EAAM,MACd,UAAWA,EAAM,MACjB,YAAaA,EAAM,MACnB,aAAcA,EAAM,MACpB,WAAYA,EAAM,MAElB,QAASA,EAAM,MACf,WAAYA,EAAM,MAClB,aAAcA,EAAM,MACpB,cAAeA,EAAM,MACrB,YAAaA,EAAM,MAEnB,aAAc,CACZ,SACA,QACA,MACA,aACA,WACA,SACA,WACA,iBACA,gBACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,WAAY,CACV,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,WACA,iBACA,gBACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CACT,OACA,SACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,WACA,iBACA,gBACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,cAAe,CACb,MACA,cACA,SACA,iBACA,UACA,UACA,SACA,eACA,OACF,EAEA,SAAU,CACR,SACA,OACA,eACA,UACA,UACA,SACA,eACA,OACF,EAEA,eAAgB,CACd,SACA,QACA,MACA,aACA,WACA,OACA,QACA,SACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,aAAc,CACZ,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,OACA,QACA,WACA,iBACA,gBACA,cACA,gBACA,eACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CAAC,aAAc,cAAe,UAAW,UAAW,SAAU,eAAgB,OAAO,EAEhG,SAAU,CACR,SACA,WACA,WACA,QACA,SACA,UACA,UACA,SACA,eACA,OACF,EAEA,QAAS,CACP,QACA,aACA,aACA,kBACA,aACA,WACA,OACA,YACA,OACA,UACA,UACA,SACA,cACA,cACA,mBACA,cACA,eACA,cACA,cACA,YACA,OACA,SACA,eACA,QACA,kBACA,qBACA,qBACA,YACA,aACA,qBACA,eACA,gBAC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SAAR,CAAkB,aAAGiC,GAAA,YAAAA,EAAM,OAAQ,KAAKZ,EAAK,MAAM,OAAO,EAE3D1F,EAACU,EAAK,IAAL,CAAS,IAAK,EACb,UAAArD,EAACgH,EAAQ,UAAR,CAAkB,MAAOiC,EAAK,qBAAsB,QAASG,EAAiB,EAC/EpJ,EAACgH,EAAQ,QAAR,CAAgB,MAAOiC,EAAK,mBAAoB,QAASE,EAAe,GAC3E,GACF,IACF,CAEJ","sourcesContent":["import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { stylePropsToCss } from './stylePropsToCss'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: string | string[] | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => prefixPart(p)).join(' ') : prefixPart(part)\n}\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: string | string[]\n} & React.ComponentPropsWithRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, part, ...props }: BoxProps<T>,\n ref: React.ForwardedRef<T>\n) {\n const Component = as ?? 'div'\n\n const { cssFromProps, unmatchedProps } = stylePropsToCss(props)\n\n const processedPart = processPart(part)\n const classNameWithPart = className || processedPart ? clsx(className, processedPart) : undefined\n\n const cssProp = [{ boxSizing: 'border-box' }, cssFromProps]\n\n return (\n // @ts-ignore: TODO: ref types are yet again complaining\n <Component className={classNameWithPart} css={cssProp} {...unmatchedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef)\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceScale = {\n [K in SpaceKeys[any]]: string\n}\nconst spaceScale = Object.fromEntries(spaceKeys.map((key) => [key, spaceValue(key)])) as SpaceScale\n\nexport const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n inherit: 'inherit',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n\n// Scalar = Tokens with literal values\nexport const scalarTokens = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n\n colors: {\n ...palette,\n },\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n regular: '400',\n demibold: '600',\n bold: '700',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n radii: {\n md: '10px',\n lg: '20px',\n round: '50%',\n },\n shadows: {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n },\n space: spaceScale,\n}\n","const colorVar = (colorName) => `var(--fr-colors-${colorName})`\n\n// Semantic = Tokens that reference Scalars & contextualize them according to how they're used\nexport const semanticColors = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray500'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","import { scalarTokens } from './scalarTokens'\nimport { semanticColors } from './semanticColors'\n\nexport { scalarTokens, semanticColors }\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...scalarTokens,\n colors: {\n ...scalarTokens.colors,\n ...semanticColors,\n },\n}\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(obj, path = '--fr') {\n const newObj: Record<string, any> = {}\n\n Object.keys(obj).forEach((key) => {\n const currentValue = obj[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst colorTokens: Record<string, unknown> = flattenObject(theme.colors)\n\n/*\n TODO:\n - top / right / bottom / left\n*/\n\nexport const styleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginTop: theme.space,\n marginRight: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n\n padding: theme.space,\n paddingTop: theme.space,\n paddingRight: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n\n alignContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'normal',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignSelf: [\n 'auto',\n 'normal',\n 'center',\n 'start',\n 'end',\n 'self-start',\n 'self-end',\n 'flex-start',\n 'flex-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexDirection: [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexWrap: [\n 'nowrap',\n 'wrap',\n 'wrap-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'left',\n 'right',\n 'normal',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'left',\n 'right',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'legacy right',\n 'legacy left',\n 'legacy center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n boxSizing: ['border-box', 'content-box', 'inherit', 'initial', 'revert', 'revert-layer', 'unset'],\n\n position: [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n display: [\n 'block',\n 'block flex',\n 'block flow',\n 'block flow-root',\n 'block grid',\n 'contents',\n 'flex',\n 'flow-root',\n 'grid',\n 'inherit',\n 'initial',\n 'inline',\n 'inline flex',\n 'inline flow',\n 'inline flow-root',\n 'inline grid',\n 'inline-block',\n 'inline-flex',\n 'inline-grid',\n 'list-item',\n 'none',\n 'revert',\n 'revert-layer',\n 'table',\n 'table-row-group',\n 'table-header-group',\n 'table-footer-group',\n 'table-row',\n 'table-cell',\n 'table-column-group',\n 'table-column',\n 'table-caption',\n 'unset',\n ],\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n","import { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n throw new Error('Invalid entry in styleProps')\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nexport function stylePropsToCss(props: Record<any, any>) {\n const unmatchedProps = Object.assign({}, props)\n const cssFromProps = {}\n\n // Convert shorthand styleProps to full versions\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const matchedShorthand = stylePropShorthandsMap.get(propName)\n if (matchedShorthand != null) {\n matchedShorthand.forEach((propName) => {\n unmatchedProps[propName] = propValue\n })\n\n delete unmatchedProps[propName]\n }\n })\n\n // Convert styleProps to style object\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const styleProp = stylePropsMap.get(propName)\n if (styleProp != null) {\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n // Split space-separated values out and process them individually\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n delete unmatchedProps[propName]\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n delete unmatchedProps[propName]\n }\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","const base = {\n color: 'neutral.foreground',\n fontFamily: 'default',\n margin: 0,\n}\n\nexport const Display1 = {\n ...base,\n fontSize: '5xl',\n fontWeight: 'bold',\n lineHeight: '4xl',\n}\n\nexport const Display2 = {\n ...base,\n fontSize: '4xl',\n fontWeight: 'bold',\n lineHeight: '3xl',\n}\n\nexport const H1 = {\n ...base,\n fontSize: '3xl',\n fontWeight: 'bold',\n lineHeight: '2xl',\n}\n\nexport const H2 = {\n ...base,\n fontSize: '2xl',\n fontWeight: 'bold',\n lineHeight: 'xl',\n}\n\nexport const H3 = {\n ...base,\n fontSize: 'xl',\n fontWeight: 'bold',\n lineHeight: 'lg',\n}\n\nexport const H4 = {\n ...base,\n fontSize: 'lg',\n fontWeight: 'bold',\n lineHeight: 'md',\n}\n\nexport const Body1 = {\n ...base,\n fontSize: 'md',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Body2 = {\n ...base,\n fontSize: 'sm',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Caption = {\n ...base,\n fontSize: 'xs',\n fontWeight: 'regular',\n lineHeight: 'sm',\n}\n","import { Box, BoxProps } from '../Box'\n\nimport * as styles from './Text.styles'\n\ntype TextVariant =\n | 'Display1'\n | 'Display2'\n | 'H1'\n | 'H2'\n | 'H3'\n | 'H4'\n | 'Body1'\n | 'Body2'\n | 'Caption'\n\nexport interface TextProps extends BoxProps {\n variant?: TextVariant\n}\n\nfunction BaseText({ as = 'span', children, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} {...styles[variant]} {...props}>\n {children}\n </Box>\n )\n}\n\nconst textVariantNames: TextVariant[] = [\n 'Display1',\n 'Display2',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'Body1',\n 'Body2',\n 'Caption',\n]\n\nconst textVariantComponents = Object.fromEntries(\n textVariantNames.map((variant) => {\n const asProp = ['H1', 'H2', 'H3', 'H4'].includes(variant)\n ? (variant.toLowerCase() as 'h1' | 'h2' | 'h3' | 'h4')\n : undefined\n const component = (props: TextProps) => (\n <BaseText as={asProp} {...props} variant={variant}>\n {props.children}\n </BaseText>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Text = Object.assign(BaseText, textVariantComponents)\n","export const base = ({ radii, space }) => ({\n borderWidth: 0,\n borderRadius: radii.md,\n padding: `${space[2]} ${space[4]}`,\n})\n\nexport const Primary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.primary.surface,\n color: colors.primary.foreground,\n\n '&:hover': {\n backgroundColor: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Secondary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.secondary.surface,\n color: colors.secondary.foreground,\n\n '&:hover': {\n backgroundColor: colors.secondary.hover.surface,\n },\n },\n]\n\nexport const Link = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.primary.surface,\n\n '&:hover': {\n color: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Plain = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.neutral.foreground,\n },\n]\n","import { Interpolation } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\nimport { Text } from '../Text'\n\nimport * as styles from './Button.styles'\n\n// TODO: Generate this type from buttonVariantNames\ntype ButtonVariant = 'Primary' | 'Secondary' | 'Link' | 'Plain'\n\nexport interface ButtonProps extends BoxProps {\n title?: string\n variant?: ButtonVariant\n}\n\nfunction BaseButton({ as, children, title, variant = 'Primary', ...props }: ButtonProps) {\n return (\n <Box as={as ?? 'button'} css={styles[variant] as Interpolation<any>} {...props}>\n {children}\n {title && (\n <Text.Body2 fontWeight=\"demibold\" color=\"inherit\">\n {title}\n </Text.Body2>\n )}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const variantPart = variant.toLocaleLowerCase()\n\n const component = ({ part, ...props }: ButtonProps) => (\n <BaseButton part={[`button-${variantPart}`, part]} {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { createContext } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport { createThemeVariables, theme as themeTokens, themeVariables } from '../../shared/theme'\n\nexport const FrigadeContext = createContext<{ apiKey: string; config: ProviderConfig }>({\n apiKey: '',\n config: {},\n})\n\n// TODO: type theme something like Partial<typeof themeContract>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n children?: React.ReactNode\n config?: ProviderConfig\n theme?: Record<any, any>\n}\n\ninterface ProviderConfig {\n apiUrl?: string\n userId?: string\n}\n\nexport function Provider({ apiKey, children, config = {}, theme }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n\n return (\n <FrigadeContext.Provider value={{ apiKey, config }}>\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Interpolation } from '@emotion/react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Dot } from './Dot'\nimport { Flex } from '../Flex/Flex'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToRadixProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n css?: Interpolation<any>\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n className,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToRadixProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div className={className} css={{ position: 'absolute', zIndex: 9999 }}>\n {spotlight && (\n <Box\n borderRadius={anchorRadius}\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Flex.Column\n backgroundColor=\"neutral.background\"\n borderRadius=\"md\"\n p={5}\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Flex.Column>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = (props: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '12px',\n right: '4px',\n }}\n part=\"tooltip-close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToRadixProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps['alignOffset'] = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { Flow, Frigade } from '@frigade/js'\nimport { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFlow(flowId: string) {\n const [flow, setFlow] = useState<Flow>()\n const [_, setNonce] = useState(Math.random())\n const { apiKey, config } = useContext(FrigadeContext)\n const filteredConfig = Object.fromEntries(\n Object.entries(config).filter(([k, v]) => ['apiUrl', 'userId'].includes(k) && v != null)\n )\n const frigade = new Frigade(apiKey, filteredConfig)\n\n useEffect(() => {\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n setFlow(updatedFlow)\n setNonce(Math.random())\n }\n\n fetchFlow()\n frigade.onFlowStateChange(handler)\n return () => {\n frigade.removeOnFlowStateChangeHandler(handler)\n }\n }, [])\n\n async function fetchFlow() {\n const flowResponse: Flow = await frigade.getFlow(flowId)\n setFlow(flowResponse)\n }\n\n return { flow, fetchFlow }\n}\n","import { useFlow } from '../../hooks/useFlow'\n\nimport { Flex } from '../Flex/Flex'\nimport { Tooltip, TooltipProps } from '../Tooltip'\n\nexport interface TourProps extends TooltipProps {\n flowId: string\n}\n\nexport function Tour({ flowId, ...props }: TourProps) {\n const { flow } = useFlow(flowId)\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n step?.start()\n\n async function handleDismiss() {\n await flow.skip()\n }\n\n async function handlePrimary() {\n await step.complete()\n }\n\n const handleSecondary = handlePrimary\n\n return (\n <Tooltip\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row pt={4} alignItems=\"center\" justifyContent=\"space-between\">\n <Tooltip.Progress>{`${step?.order + 1}/${flow.steps.size}`}</Tooltip.Progress>\n\n <Flex.Row gap={3}>\n <Tooltip.Secondary title={step.secondaryButtonTitle} onClick={handleSecondary} />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Flex.Row>\n </Tooltip>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/Box/index.tsx","../src/shared/tokens/scalarTokens.ts","../src/shared/tokens/semanticColors.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/styleProps.ts","../src/components/Box/stylePropsToCss.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Provider/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useFlow.ts","../src/hooks/useModal.ts","../src/hooks/useFlowHandlers.ts","../src/hooks/useStepHandlers.ts","../src/components/Tour/TourStep.tsx","../src/components/Tour/index.tsx"],"names":["React","clsx","SPACE_UNIT","spaceValue","key","spaceKeys","spaceScale","palette","scalarTokens","__spreadValues","colorVar","colorName","semanticColors","tokens","__spreadProps","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","colorTokens","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","_a","jsx","prefixPart","part","processPart","p","BoxWithRef","ref","_b","as","children","className","__objRest","Component","processedPart","classNameWithPart","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","BaseText","variant","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","Link","Plain","Primary","Secondary","radii","space","colors","jsxs","BaseButton","title","buttonVariantNames","buttonVariantComponents","variantPart","Button","Row","css","Column","Flex","createContext","useState","Global","ThemeProvider","FrigadeContext","Provider","apiKey","config","navigate","themeOverrides","modals","setModals","navigateHandler","url","target","useEffect","useRef","XMarkIcon","Popover","useCallback","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","Image","src","getVideoEmbedSrc","videoUri","_c","Video","videoEmbedSrc","Media","type","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToPopoverProps","contentRect","_d","_e","contentProps","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","lengthOfCurrentSide","Tooltip","anchor","spotlight","contentNode","contentRef","setAlignAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","anchorElementRef","setAnchorElementRef","anchorQuery","anchorRect","anchorRadius","dotPosition","onClick","Frigade","useContext","useFlow","flowId","flow","setFlow","filteredConfig","frigade","handler","updatedFlow","clonedFlow","__async","flowResponse","useModal","isCurrentModal","setIsCurrentModal","newIsCurrentModal","useFlowHandlers","onComplete","onDismiss","lastCompleted","e","useStepHandlers","step","onPrimary","onSecondary","TourStep","handleDismiss","handlePrimary","handleSecondary","Tour"],"mappings":"w2BAAA,UAAYA,OAAW,QACvB,OAAS,QAAAC,OAAY,OCArB,IAAMC,GAAa,KAEbC,GAAcC,GAClB,OAAOA,GAAQ,SAAW,GAAG,EAAcA,IAAMF,KAAeE,EAE5DC,GAAY,CAChB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,MACF,EAOMC,GAAa,OAAO,YAAYD,GAAU,IAAKD,GAAQ,CAACA,EAAKD,GAAWC,CAAG,CAAC,CAAC,CAAC,EAEvEG,GAAU,CACrB,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,SAAU,UACV,SAAU,UACV,SAAU,UACV,YAAa,YACb,QAAS,UAGT,OAAQ,SACV,EAGaC,EAAe,CAC1B,QAAS,CACP,GAAI,WACN,EACA,aAAc,CACZ,EAAG,IACH,GAAI,KACN,EAEA,OAAQC,EAAA,GACHF,IAEL,aAAc,CACZ,QAAS,gCACX,EACA,UAAW,CACT,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,M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,cAAe,CACb,MACA,cACA,SACA,iBACA,UACA,UACA,SACA,eACA,OACF,EAEA,SAAU,CACR,SACA,OACA,eACA,UACA,UACA,SACA,eACA,OACF,EAEA,eAAgB,CACd,SACA,QACA,MACA,aACA,WACA,OACA,QACA,SACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,aAAc,CACZ,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,OACA,QACA,WACA,iBACA,gBACA,cACA,gBACA,eACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CAAC,aAAc,cAAe,UAAW,UAAW,SAAU,eAAgB,OAAO,EAEhG,SAAU,CACR,SACA,WACA,WACA,QACA,SACA,UACA,UACA,SACA,eACA,OACF,EAEA,QAAS,CACP,QACA,aACA,aACA,kBACA,aACA,WACA,OACA,YACA,OACA,UACA,UACA,SACA,cACA,cACA,mBACA,cACA,eACA,cACA,cACA,YACA,OACA,SACA,eACA,QACA,kBACA,qBACA,qBACA,YACA,aACA,qBACA,eACA,gBACA,OACF,CACF,EAEaG,GAAsB,CACjC,EAAG,CAAC,QAAQ,EACZ,GAAI,CAAC,WAAW,EAChB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,aAAc,aAAa,EAChC,GAAI,CAAC,YAAa,cAAc,EAEhC,EAAG,CAAC,SAAS,EACb,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,eAAe,EACpB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAe,cAAc,EAClC,GAAI,CAAC,aAAc,eAAe,CACpC,ECpPA,SAASC,GAAUC,EAAO,CACxB,GAAI,MAAM,QAAQA,CAAK,EACrB,OAAO,IAAI,IAAIA,EAAM,IAAKC,GAAM,CAACA,EAAGA,CAAC,CAAC,CAAC,EAClC,GAAI,OAAOD,GAAU,UAAYA,IAAU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ClC,EAEA9J,EAACsH,EAAQ,MAAR,CAAe,SAAAwC,EAAK,MAAM,EAC3B9J,EAACsH,EAAQ,SAAR,CAAkB,SAAAwC,EAAK,SAAS,EAEjCnH,GAACU,EAAK,IAAL,CAAS,WAAW,SAAS,IAAK,EAAG,eAAe,WAAW,KAAK,iBAAiB,GAAI,EACxF,UAAArD,EAACsH,EAAQ,SAAR,CAAkB,aAAGwC,GAAA,YAAAA,EAAM,OAAQ,KAAKnB,EAAK,MAAM,OAAO,EAE3D3I,EAACsH,EAAQ,UAAR,CACC,WAAW,OACX,MAAOwC,EAAK,qBACZ,QAASM,EACX,EACApK,EAACsH,EAAQ,QAAR,CAAgB,MAAOwC,EAAK,mBAAoB,QAASK,EAAe,GAC3E,KAzBKL,EAAK,EA0BZ,EA9B0B,IAgC9B,CCpCS,cAAA9J,OAAA,6BAbF,SAASqK,GAAKtK,EAA6C,CAA7C,IAAAQ,EAAAR,EAAE,QAAA2I,EAAQ,WAAAe,CAjB/B,EAiBqBlJ,EAAyBf,EAAAmB,EAAzBJ,EAAyB,CAAvB,SAAQ,eAC7B,GAAM,CAAE,KAAAoI,CAAK,EAAIF,GAAQC,CAAM,EAG/B,GAFAc,EAAgBb,EAAM,CAAE,WAAAc,CAAW,CAAC,EAEhCd,GAAQ,MAAQA,EAAK,YAAc,GACrC,OAAO,KAGTA,EAAK,MAAM,EAEX,IAAMmB,EAAOnB,EAAK,eAAe,EACjC,OAAAmB,GAAA,MAAAA,EAAM,QAEC9J,GAACiK,GAAAxM,EAAA,CAAS,KAAMqM,EAAM,KAAMnB,GAAUnJ,EAAO,CACtD","sourcesContent":["import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { stylePropsToCss } from './stylePropsToCss'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: string | string[] | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => prefixPart(p)).join(' ') : prefixPart(part)\n}\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: string | string[]\n} & React.ComponentPropsWithRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, part, ...props }: BoxProps<T>,\n ref: React.ForwardedRef<T>\n) {\n const Component = as ?? 'div'\n\n const { cssFromProps, unmatchedProps } = stylePropsToCss(props)\n\n const processedPart = processPart(part)\n const classNameWithPart = className || processedPart ? clsx(className, processedPart) : undefined\n\n const cssProp = [{ boxSizing: 'border-box' }, cssFromProps]\n\n return (\n // @ts-ignore: TODO: ref types are yet again complaining\n <Component className={classNameWithPart} css={cssProp} {...unmatchedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef)\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceScale = {\n [K in SpaceKeys[any]]: string\n}\nconst spaceScale = Object.fromEntries(spaceKeys.map((key) => [key, spaceValue(key)])) as SpaceScale\n\nexport const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n inherit: 'inherit',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n\n// Scalar = Tokens with literal values\nexport const scalarTokens = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n\n colors: {\n ...palette,\n },\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n thin: '100',\n extralight: '200',\n light: '300',\n regular: '400',\n medium: '500',\n demibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n radii: {\n md: '10px',\n lg: '20px',\n round: '50%',\n },\n shadows: {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n },\n space: spaceScale,\n}\n","const colorVar = (colorName) => `var(--fr-colors-${colorName})`\n\n// Semantic = Tokens that reference Scalars & contextualize them according to how they're used\nexport const semanticColors = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray500'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","import { scalarTokens } from './scalarTokens'\nimport { semanticColors } from './semanticColors'\n\nexport { scalarTokens, semanticColors }\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...scalarTokens,\n colors: {\n ...scalarTokens.colors,\n ...semanticColors,\n },\n}\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(obj, path = '--fr') {\n const newObj: Record<string, any> = {}\n\n Object.keys(obj).forEach((key) => {\n const currentValue = obj[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst colorTokens: Record<string, unknown> = flattenObject(theme.colors)\n\n/*\n TODO:\n - top / right / bottom / left\n*/\n\nexport const styleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginTop: theme.space,\n marginRight: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n\n padding: theme.space,\n paddingTop: theme.space,\n paddingRight: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n\n alignContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'normal',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignSelf: [\n 'auto',\n 'normal',\n 'center',\n 'start',\n 'end',\n 'self-start',\n 'self-end',\n 'flex-start',\n 'flex-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexDirection: [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexWrap: [\n 'nowrap',\n 'wrap',\n 'wrap-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'left',\n 'right',\n 'normal',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'left',\n 'right',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'legacy right',\n 'legacy left',\n 'legacy center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n boxSizing: ['border-box', 'content-box', 'inherit', 'initial', 'revert', 'revert-layer', 'unset'],\n\n position: [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n display: [\n 'block',\n 'block flex',\n 'block flow',\n 'block flow-root',\n 'block grid',\n 'contents',\n 'flex',\n 'flow-root',\n 'grid',\n 'inherit',\n 'initial',\n 'inline',\n 'inline flex',\n 'inline flow',\n 'inline flow-root',\n 'inline grid',\n 'inline-block',\n 'inline-flex',\n 'inline-grid',\n 'list-item',\n 'none',\n 'revert',\n 'revert-layer',\n 'table',\n 'table-row-group',\n 'table-header-group',\n 'table-footer-group',\n 'table-row',\n 'table-cell',\n 'table-column-group',\n 'table-column',\n 'table-caption',\n 'unset',\n ],\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n","import { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n throw new Error('Invalid entry in styleProps')\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nexport function stylePropsToCss(props: Record<any, any>) {\n const unmatchedProps = Object.assign({}, props)\n const cssFromProps = {}\n\n // Convert shorthand styleProps to full versions\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const matchedShorthand = stylePropShorthandsMap.get(propName)\n if (matchedShorthand != null) {\n matchedShorthand.forEach((propName) => {\n unmatchedProps[propName] = propValue\n })\n\n delete unmatchedProps[propName]\n }\n })\n\n // Convert styleProps to style object\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const styleProp = stylePropsMap.get(propName)\n if (styleProp != null) {\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n // Split space-separated values out and process them individually\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n delete unmatchedProps[propName]\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n delete unmatchedProps[propName]\n }\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","const base = {\n color: 'neutral.foreground',\n fontFamily: 'default',\n margin: 0,\n}\n\nexport const Display1 = {\n ...base,\n fontSize: '5xl',\n fontWeight: 'bold',\n lineHeight: '4xl',\n}\n\nexport const Display2 = {\n ...base,\n fontSize: '4xl',\n fontWeight: 'bold',\n lineHeight: '3xl',\n}\n\nexport const H1 = {\n ...base,\n fontSize: '3xl',\n fontWeight: 'bold',\n lineHeight: '2xl',\n}\n\nexport const H2 = {\n ...base,\n fontSize: '2xl',\n fontWeight: 'bold',\n lineHeight: 'xl',\n}\n\nexport const H3 = {\n ...base,\n fontSize: 'xl',\n fontWeight: 'bold',\n lineHeight: 'lg',\n}\n\nexport const H4 = {\n ...base,\n fontSize: 'lg',\n fontWeight: 'bold',\n lineHeight: 'md',\n}\n\nexport const Body1 = {\n ...base,\n fontSize: 'md',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Body2 = {\n ...base,\n fontSize: 'sm',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Caption = {\n ...base,\n fontSize: 'xs',\n fontWeight: 'regular',\n lineHeight: 'sm',\n}\n","import { Box, BoxProps } from '../Box'\n\nimport * as styles from './Text.styles'\n\ntype TextVariant =\n | 'Display1'\n | 'Display2'\n | 'H1'\n | 'H2'\n | 'H3'\n | 'H4'\n | 'Body1'\n | 'Body2'\n | 'Caption'\n\nexport interface TextProps extends BoxProps {\n variant?: TextVariant\n}\n\nfunction BaseText({ as = 'span', children, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} {...styles[variant]} {...props}>\n {children}\n </Box>\n )\n}\n\nconst textVariantNames: TextVariant[] = [\n 'Display1',\n 'Display2',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'Body1',\n 'Body2',\n 'Caption',\n]\n\nconst textVariantComponents = Object.fromEntries(\n textVariantNames.map((variant) => {\n const asProp = ['H1', 'H2', 'H3', 'H4'].includes(variant)\n ? (variant.toLowerCase() as 'h1' | 'h2' | 'h3' | 'h4')\n : undefined\n const component = (props: TextProps) => (\n <BaseText as={asProp} {...props} variant={variant}>\n {props.children}\n </BaseText>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Text = Object.assign(BaseText, textVariantComponents)\n","export const base = ({ radii, space }) => ({\n borderWidth: 0,\n borderRadius: radii.md,\n padding: `${space[2]} ${space[4]}`,\n})\n\nexport const Primary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.primary.surface,\n color: colors.primary.foreground,\n\n '&:hover': {\n backgroundColor: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Secondary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.secondary.surface,\n color: colors.secondary.foreground,\n\n '&:hover': {\n backgroundColor: colors.secondary.hover.surface,\n },\n },\n]\n\nexport const Link = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.primary.surface,\n\n '&:hover': {\n color: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Plain = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.neutral.foreground,\n },\n]\n","import { Interpolation } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\nimport { Text } from '../Text'\n\nimport * as styles from './Button.styles'\n\n// TODO: Generate this type from buttonVariantNames\ntype ButtonVariant = 'Primary' | 'Secondary' | 'Link' | 'Plain'\n\nexport interface ButtonProps extends BoxProps {\n title?: string\n variant?: ButtonVariant\n}\n\nfunction BaseButton({ as, children, title, variant = 'Primary', ...props }: ButtonProps) {\n return (\n <Box as={as ?? 'button'} css={styles[variant] as Interpolation<any>} {...props}>\n {children}\n {title && (\n <Text.Body2 fontWeight=\"demibold\" color=\"inherit\">\n {title}\n </Text.Body2>\n )}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const variantPart = variant.toLocaleLowerCase()\n\n const component = ({ part, ...props }: ButtonProps) => (\n <BaseButton part={[`button-${variantPart}`, part]} {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { createContext, Dispatch, SetStateAction, useState } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport { createThemeVariables, theme as themeTokens, themeVariables } from '../../shared/theme'\n\ntype NavigateHandler = (url: string, target?: string) => void\n\n// TODO: type theme something like Partial<typeof themeTokens>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n children?: React.ReactNode\n config?: ProviderConfig\n navigate?: NavigateHandler\n theme?: Record<any, any>\n}\n\ninterface ProviderConfig {\n apiUrl?: string\n userId?: string\n}\n\ninterface ProviderContext {\n apiKey: string\n config: ProviderConfig\n modals: string[]\n setModals: Dispatch<SetStateAction<string[]>>\n navigate: NavigateHandler\n}\n\nexport const FrigadeContext = createContext<ProviderContext>({\n apiKey: '',\n config: {},\n modals: [],\n setModals: () => {},\n navigate: () => {},\n})\n\nexport function Provider({ apiKey, children, config = {}, navigate, theme }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n const [modals, setModals] = useState([])\n\n const navigateHandler =\n navigate ??\n ((url, target = '_self') => {\n window.open(url, target)\n })\n\n return (\n <FrigadeContext.Provider\n value={{ apiKey, config, modals, setModals, navigate: navigateHandler }}\n >\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Interpolation } from '@emotion/react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Dot } from './Dot'\nimport { Flex } from '../Flex/Flex'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToPopoverProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n css?: Interpolation<Record<any, any>>\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n className,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToPopoverProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div className={className} css={{ position: 'absolute', zIndex: 9999 }}>\n {spotlight && (\n <Box\n borderRadius={anchorRadius}\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Flex.Column\n backgroundColor=\"neutral.background\"\n borderRadius=\"md\"\n p={5}\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Flex.Column>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = (props: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '12px',\n right: '4px',\n }}\n part=\"tooltip-close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToPopoverProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps.alignOffset = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { Flow, Frigade } from '@frigade/js'\nimport { useContext, useEffect, useRef, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFlow(flowId: string) {\n const [flow, setFlow] = useState<Flow>()\n const { apiKey, config } = useContext(FrigadeContext)\n const filteredConfig = Object.fromEntries(\n Object.entries(config).filter(([k, v]) => ['apiUrl', 'userId'].includes(k) && v != null)\n )\n\n const frigadeRef = useRef(new Frigade(apiKey, filteredConfig))\n const frigade = frigadeRef.current\n\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n const clonedFlow = Object.assign(Object.create(Object.getPrototypeOf(updatedFlow)), updatedFlow)\n\n setFlow(clonedFlow)\n }\n\n useEffect(() => {\n ;(async () => {\n const flowResponse: Flow = await frigade.getFlow(flowId)\n\n setFlow(flowResponse)\n })()\n\n frigade.onStateChange(handler)\n\n return () => {\n frigade.removeStateChangeHandler(handler)\n }\n }, [])\n\n return { flow }\n}\n","import { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useModal(flowId: string) {\n const { modals, setModals } = useContext(FrigadeContext)\n const [isCurrentModal, setIsCurrentModal] = useState(false)\n\n useEffect(() => {\n setModals([...modals, flowId])\n\n return () => setModals(modals.filter((v) => v !== flowId))\n }, [])\n\n useEffect(() => {\n const newIsCurrentModal = modals[0] === flowId\n\n if (newIsCurrentModal !== isCurrentModal) {\n setIsCurrentModal(newIsCurrentModal)\n }\n }, [modals])\n\n return {\n isCurrentModal,\n }\n}\n","import { MouseEvent, useCallback, useEffect, useRef } from 'react'\n\nimport { Flow } from '@frigade/js'\n\nexport type FlowHandler = (flow: Flow, event?: MouseEvent<unknown>) => boolean | void\n\nexport interface StepHandlers {\n onComplete?: FlowHandler\n onDismiss?: FlowHandler\n}\n\nexport function useFlowHandlers(flow: Flow, { onComplete, onDismiss }: StepHandlers = {}) {\n const lastCompleted = useRef(null)\n\n useEffect(() => {\n if (flow == null) return\n\n if (flow.isCompleted && lastCompleted.current === false) {\n onComplete(flow)\n }\n\n lastCompleted.current = flow?.isCompleted\n }, [flow?.isCompleted])\n\n return {\n handleDismiss: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = onDismiss?.(flow, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n await flow.skip()\n },\n [flow]\n ),\n }\n}\n","import { MouseEvent, useCallback, useContext } from 'react'\n\nimport type { FlowStep } from '@frigade/js'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport type StepHandler = (step: FlowStep, event?: MouseEvent<unknown>) => boolean | void\n\nexport interface StepHandlers {\n onPrimary?: StepHandler\n onSecondary?: StepHandler\n}\n\nexport function useStepHandlers(step: FlowStep, { onPrimary, onSecondary }: StepHandlers = {}) {\n const { navigate } = useContext(FrigadeContext)\n\n return {\n handlePrimary: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = onPrimary?.(step, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n await step.complete()\n\n if (step.primaryButtonUri != null) {\n navigate(step.primaryButtonUri, step.primaryButtonUriTarget)\n }\n },\n [step]\n ),\n\n handleSecondary: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = onSecondary?.(step, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n // Should there be a step.skip method?\n await step.complete()\n\n if (step.secondaryButtonUri != null) {\n navigate(step.secondaryButtonUri, step.secondaryButtonUriTarget)\n }\n },\n [step]\n ),\n }\n}\n","import type { Flow, FlowStep } from '@frigade/js'\n\nimport { TourProps } from '.'\nimport { useModal } from '../../hooks/useModal'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { useStepHandlers } from '../../hooks/useStepHandlers'\n\nimport { Flex } from '../Flex/Flex'\nimport { Tooltip } from '../Tooltip'\n\nexport interface TourStepProps extends Omit<TourProps, 'flowId'> {\n step: FlowStep\n flow: Flow\n}\n\nexport function TourStep({\n step,\n flow,\n onDismiss,\n onPrimary,\n onSecondary,\n ...props\n}: TourStepProps) {\n const { isCurrentModal } = useModal(`${flow.id}-${step.id}`)\n\n const { handleDismiss } = useFlowHandlers(flow, {\n onDismiss,\n })\n\n const { handlePrimary, handleSecondary } = useStepHandlers(step, {\n onPrimary,\n onSecondary,\n })\n\n if (!isCurrentModal) return null\n\n return (\n <Tooltip\n key={step.id}\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row alignItems=\"center\" gap={3} justifyContent=\"flex-end\" part=\"tooltip-footer\" pt={4}>\n <Tooltip.Progress>{`${step?.order + 1}/${flow.steps.size}`}</Tooltip.Progress>\n\n <Tooltip.Secondary\n marginLeft=\"auto\"\n title={step.secondaryButtonTitle}\n onClick={handleSecondary}\n />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Tooltip>\n )\n}\n","import type { Flow } from '@frigade/js'\n\nimport { useFlow } from '../../hooks/useFlow'\nimport { TooltipProps } from '../Tooltip'\nimport { TourStep } from './TourStep'\n\nimport { FlowHandler, useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { StepHandler } from '../../hooks/useStepHandlers'\n\nexport interface TourProps extends TooltipProps {\n flowId: string\n onComplete?: FlowHandler\n onDismiss?: FlowHandler\n onPrimary?: StepHandler\n onSecondary?: StepHandler\n}\n\nexport function Tour({ flowId, onComplete, ...props }: TourProps) {\n const { flow } = useFlow(flowId)\n useFlowHandlers(flow, { onComplete })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n step?.start()\n\n return <TourStep step={step} flow={flow} {...props} />\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as React$1 from 'react';
2
- import React__default from 'react';
2
+ import React__default, { MouseEvent } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { Interpolation } from '@emotion/react';
5
5
  import * as Popover from '@radix-ui/react-popover';
6
+ import { Flow, FlowStep } from '@frigade/js';
6
7
 
7
8
  type BoxProps<T extends React$1.ElementType = React$1.ElementType> = {
8
9
  as?: T;
@@ -28,17 +29,19 @@ declare const Flex: {
28
29
  Row: React$1.ForwardRefExoticComponent<Omit<any, "ref"> & React$1.RefAttributes<unknown>>;
29
30
  };
30
31
 
32
+ type NavigateHandler = (url: string, target?: string) => void;
31
33
  interface ProviderProps {
32
34
  apiKey: string;
33
35
  children?: React.ReactNode;
34
36
  config?: ProviderConfig;
37
+ navigate?: NavigateHandler;
35
38
  theme?: Record<any, any>;
36
39
  }
37
40
  interface ProviderConfig {
38
41
  apiUrl?: string;
39
42
  userId?: string;
40
43
  }
41
- declare function Provider({ apiKey, children, config, theme }: ProviderProps): react_jsx_runtime.JSX.Element;
44
+ declare function Provider({ apiKey, children, config, navigate, theme }: ProviderProps): react_jsx_runtime.JSX.Element;
42
45
 
43
46
  type TextVariant = 'Display1' | 'Display2' | 'H1' | 'H2' | 'H3' | 'H4' | 'Body1' | 'Body2' | 'Caption';
44
47
  interface TextProps extends BoxProps {
@@ -62,7 +65,7 @@ interface MergedRadixPopoverProps extends Pick<Popover.PopoverProps, 'defaultOpe
62
65
  interface TooltipProps extends MergedRadixPopoverProps {
63
66
  align?: Popover.PopoverContentProps['align'] | 'before' | 'after';
64
67
  anchor?: string;
65
- css?: Interpolation<any>;
68
+ css?: Interpolation<Record<any, any>>;
66
69
  spotlight?: boolean;
67
70
  style?: React__default.CSSProperties;
68
71
  }
@@ -77,9 +80,17 @@ declare namespace Tooltip {
77
80
  var Title: ({ children, ...props }: TextProps) => react_jsx_runtime.JSX.Element;
78
81
  }
79
82
 
83
+ type FlowHandler = (flow: Flow, event?: MouseEvent<unknown>) => boolean | void;
84
+
85
+ type StepHandler = (step: FlowStep, event?: MouseEvent<unknown>) => boolean | void;
86
+
80
87
  interface TourProps extends TooltipProps {
81
88
  flowId: string;
89
+ onComplete?: FlowHandler;
90
+ onDismiss?: FlowHandler;
91
+ onPrimary?: StepHandler;
92
+ onSecondary?: StepHandler;
82
93
  }
83
- declare function Tour({ flowId, ...props }: TourProps): react_jsx_runtime.JSX.Element;
94
+ declare function Tour({ flowId, onComplete, ...props }: TourProps): react_jsx_runtime.JSX.Element;
84
95
 
85
96
  export { Box, BoxProps, Button, ButtonProps, Flex, Provider, ProviderProps, Text, TextProps, Tooltip, TooltipProps, Tour, TourProps };
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  'use client';
2
- import * as _ from 'react';
2
+ import * as X from 'react';
3
3
  import { createContext, useState, useRef, useEffect, useCallback, useLayoutEffect, useContext } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { jsx, jsxs } from '@emotion/react/jsx-runtime';
6
6
  import { keyframes, Global, ThemeProvider } from '@emotion/react';
7
7
  import { XMarkIcon } from '@heroicons/react/24/solid';
8
- import * as P from '@radix-ui/react-popover';
8
+ import * as v from '@radix-ui/react-popover';
9
9
  import { Frigade } from '@frigade/js';
10
10
 
11
- var ee=Object.defineProperty,Ee=Object.defineProperties;var Ae=Object.getOwnPropertyDescriptors;var W=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var Z=(e,t,o)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))te.call(t,o)&&Z(e,o,t[o]);if(W)for(var o of W(t))oe.call(t,o)&&Z(e,o,t[o]);return e},l=(e,t)=>Ee(e,Ae(t));var u=(e,t)=>{var o={};for(var r in e)te.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&W)for(var r of W(e))t.indexOf(r)<0&&oe.call(e,r)&&(o[r]=e[r]);return o};var re=(e,t)=>{for(var o in t)ee(e,o,{get:t[o],enumerable:!0});};var k=(e,t,o)=>new Promise((r,n)=>{var s=d=>{try{p(o.next(d));}catch(f){n(f);}},c=d=>{try{p(o.throw(d));}catch(f){n(f);}},p=d=>d.done?r(d.value):Promise.resolve(d.value).then(s,c);p((o=o.apply(e,t)).next());});var De="px",He=e=>typeof e=="number"?`${4*e}${De}`:e,Ve=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],Ie=Object.fromEntries(Ve.map(e=>[e,He(e)])),Me={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"},$={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"},colors:i({},Me),fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:"400",demibold:"600",bold:"700"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"10px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.1)"},space:Ie};var a=e=>`var(--fr-colors-${e})`,ne={neutral:{background:a("white"),border:a("gray500"),foreground:a("black"),surface:a("gray700"),active:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},focus:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},hover:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")}},primary:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500"),active:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")},focus:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500")},hover:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")}},secondary:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900"),active:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")},focus:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900")},hover:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")}}};var j=l(i({},$),{colors:i(i({},$.colors),ne)});function F(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let c=`${t.length?`${t}${o}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,F(p,c,o)):r[c]=p,r},{})}function L(e){return F(e,"--fr","-")}function ie(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=ie(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var se=L(j),g=ie(j);var z=F(g.colors),ae={color:z,backgroundColor:z,borderColor:z,border:g.borders,borderRadius:g.radii,borderWidth:g.borderWidths,fontFamily:g.fontFamilies,fontSize:g.fontSizes,fontWeight:g.fontWeights,gap:g.space,lineHeight:g.lineHeights,margin:g.space,marginTop:g.space,marginRight:g.space,marginBottom:g.space,marginLeft:g.space,padding:g.space,paddingTop:g.space,paddingRight:g.space,paddingBottom:g.space,paddingLeft:g.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"]},le={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]};function We(e){if(Array.isArray(e))return new Map(e.map(t=>[t,t]));if(typeof e=="object"&&e!==null)return new Map(Object.entries(e));if(["string","number"].includes(typeof e))return new Map([e,e]);throw new Error("Invalid entry in styleProps")}var $e=new Map(Object.entries(ae).map(([e,t])=>[e,We(t)])),je=new Map(Object.entries(le).map(([e,t])=>[e,new Set(t)]));function ce(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let s=je.get(r);s!=null&&(s.forEach(c=>{t[c]=n;}),delete t[r]);}),Object.entries(t).forEach(([r,n])=>{let s=$e.get(r);if(s!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let c=n.split(" ");o[r]=c.map(p=>{var d;return (d=s.get(p.toString()))!=null?d:p}).join(" "),delete t[r];}else s.has(n.toString())&&(o[r]=s.get(n.toString()),delete t[r]);}),{cssFromProps:o,unmatchedProps:t}}function pe(e){return e&&`fr-${e}`}function ze(e){return e&&(Array.isArray(e)?e.map(t=>pe(t)).join(" "):pe(e))}function Ke(c,s){var p=c,{as:e,children:t,className:o,part:r}=p,n=u(p,["as","children","className","part"]);let d=e!=null?e:"div",{cssFromProps:f,unmatchedProps:b}=ce(n),y=ze(r),R=o||y?clsx(o,y):void 0;return jsx(d,l(i({className:R,css:[{boxSizing:"border-box"},f]},b),{ref:s,children:t}))}var m=_.forwardRef(Ke);var K={};re(K,{Body1:()=>Qe,Body2:()=>Ye,Caption:()=>Ze,Display1:()=>_e,Display2:()=>Ue,H1:()=>Xe,H2:()=>qe,H3:()=>Ge,H4:()=>Je});var w={color:"neutral.foreground",fontFamily:"default",margin:0},_e=l(i({},w),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Ue=l(i({},w),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Xe=l(i({},w),{fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"}),qe=l(i({},w),{fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"}),Ge=l(i({},w),{fontSize:"xl",fontWeight:"bold",lineHeight:"lg"}),Je=l(i({},w),{fontSize:"lg",fontWeight:"bold",lineHeight:"md"}),Qe=l(i({},w),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Ye=l(i({},w),{fontSize:"sm",fontWeight:"regular",lineHeight:"md"}),Ze=l(i({},w),{fontSize:"xs",fontWeight:"regular",lineHeight:"sm"});function fe(n){var s=n,{as:e="span",children:t,variant:o="Body1"}=s,r=u(s,["as","children","variant"]);return jsx(m,l(i(i({as:e},K[o]),r),{children:t}))}var et=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],tt=Object.fromEntries(et.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsx(fe,l(i({as:t},r),{variant:e,children:r.children}));return o.displayName=`Text.${e}`,[e,o]})),B=Object.assign(fe,tt);var N={};re(N,{Link:()=>nt,Plain:()=>it,Primary:()=>ot,Secondary:()=>rt,base:()=>O});var O=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),ot=({colors:e})=>[O,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],rt=({colors:e})=>[O,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],nt=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],it=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.neutral.foreground}];function ge(s){var c=s,{as:e,children:t,title:o,variant:r="Primary"}=c,n=u(c,["as","children","title","variant"]);return jsxs(m,l(i({as:e!=null?e:"button",css:N[r]},n),{children:[t,o&&jsx(B.Body2,{fontWeight:"demibold",color:"inherit",children:o})]}))}var st=["Primary","Secondary","Link","Plain"],at=Object.fromEntries(st.map(e=>{let t=e.toLocaleLowerCase(),o=s=>{var c=s,{part:r}=c,n=u(c,["part"]);return jsx(ge,l(i({part:[`button-${t}`,r]},n),{variant:e,children:n.children}))};return o.displayName=`Text.${e}`,[e,o]})),E=Object.assign(ge,at);var ct=_.forwardRef((n,r)=>{var s=n,{children:e,css:t}=s,o=u(s,["children","css"]);return jsx(m,l(i({css:[{display:"flex",flexDirection:"row"},t]},o),{ref:r,children:e}))}),pt=_.forwardRef((n,r)=>{var s=n,{children:e,css:t}=s,o=u(s,["children","css"]);return jsx(m,l(i({css:[{display:"flex",flexDirection:"column"},t]},o),{ref:r,children:e}))}),C={Column:pt,Row:ct};var U=createContext({apiKey:"",config:{}});function gt({apiKey:e,children:t,config:o={},theme:r}){let n=r?L(r):{};return jsxs(U.Provider,{value:{apiKey:e,config:o},children:[jsx(Global,{styles:{":root":i(i({},se),n)}}),jsx(ThemeProvider,{theme:g,children:t})]})}function he(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=useState(e),[r,n]=useState(null),s=useCallback(c=>{n(c);},[]);return useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:s}}var ht=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function we(r){var n=r,{style:e={},part:t=""}=n,o=u(n,["style","part"]);return jsxs(m,l(i({part:`dot-wrapper ${t}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},o),{children:[jsx(m,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${ht}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(m,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Be(r){var n=r,{part:e,src:t}=n,o=u(n,["part","src"]);return jsx(m,i({as:"img",part:["image",e],src:t},o))}function Bt(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Te(r){var n=r,{part:e,src:t}=n,o=u(n,["part","src"]);let s=Bt(t);return jsx(m,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:s},o))}function X(r){var n=r,{src:e,type:t}=n,o=u(n,["src","type"]);return jsx(t==="video"?Te:Be,i({src:e},o))}function ve({props:e,alignAttr:t,sideAttr:o}){let r=o!=null?o:"bottom",n={},s=()=>{var f;if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return (f=e.align)!=null?f:"after"},c="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=c;let d=s();return ["before","end"].includes(d)?["top","bottom"].includes(r)?n.right=c:n.bottom=c:["after","start"].includes(d)?["top","bottom"].includes(r)?n.left=c:n.top=c:["top","bottom"].includes(r)?n.left=`calc(50% + ${c})`:n.top=`calc(50% + ${c})`,n}var Ce={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Re(e,t){var n,s,c,p,d;let o=Object.fromEntries(Ce.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(Ce.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0));if(o.align=(n=o.align)!=null?n:"after",o.side=(s=o.side)!=null?s:"bottom",["before","after"].includes(o.align)){let f={after:"end",before:"start"},b=(H,V)=>["top","bottom"].includes(V)?H=="after"?"marginLeft":"marginRight":H=="after"?"marginTop":"marginBottom",y=(c=o.alignOffset)!=null?c:0,R=(p=o.style)!=null?p:{},v=(d=o.side)!=null?d:"bottom",A=o.align;o.style=l(i({},R),{[b(A,v)]:y});let D=["top","bottom"].includes(v)?t.width:t.height;o.alignOffset=(D+y)*-1,o.align=f[A];}return {contentProps:o,rootProps:r}}function x(c){var p=c,{anchor:e,children:t,className:o,spotlight:r=!1,style:n}=p,s=u(p,["anchor","children","className","spotlight","style"]);let{node:d,rect:f,ref:b}=he(),{contentProps:y,rootProps:R}=Re(s,f),[v,A]=useState(y.align),[D,H]=useState(y.side);if(d!==null){let S=d.getAttribute("data-align"),Y=d.getAttribute("data-side");v!==S&&A(S),D!==Y&&H(Y);}let V=useRef(null),[I,Fe]=useState(null);if(useEffect(()=>{let S=document.querySelector(e);S!=null&&(V.current=S,Fe(V));},[e]),I==null)return null;let M=I.current.getBoundingClientRect(),Q="0";typeof window!="undefined"&&(Q=window.getComputedStyle(I.current).borderRadius);let Oe=ve({props:s,alignAttr:v,sideAttr:D});return jsxs(P.Root,l(i({defaultOpen:!0},R),{children:[jsx(P.Anchor,{virtualRef:I}),jsx(P.Portal,{children:jsxs("div",{className:o,css:{position:"absolute",zIndex:9999},children:[r&&jsx(m,{borderRadius:Q,part:"tooltip-spotlight",position:"absolute",css:{boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:M.height,left:M.left,top:M.top,width:M.width}}),jsx(P.Content,l(i({asChild:!0},y),{ref:b,children:jsxs(C.Column,{backgroundColor:"neutral.background",borderRadius:"md",p:5,part:"tooltip-content",position:"relative",css:i({boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)",maxWidth:"360px"},n),children:[jsx(we,{style:Oe}),t]})}))]})})]}))}x.Close=e=>jsx(P.Close,{"aria-label":"Close",asChild:!0,children:jsx(E.Plain,l(i({css:{top:"12px",right:"4px"},part:"tooltip-close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});x.Media=o=>{var r=o,{src:e}=r,t=u(r,["src"]);return e==null?null:jsx(X,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e},t))};x.Primary=r=>{var n=r,{onClick:e,title:t}=n,o=u(n,["onClick","title"]);return t==null?null:jsx(E.Primary,i({title:t,onClick:e},o))};x.Progress=o=>{var r=o,{children:e}=r,t=u(r,["children"]);return e==null?null:jsx(B.Body2,l(i({fontWeight:"demibold",part:"progress"},t),{children:e}))};x.Secondary=r=>{var n=r,{onClick:e,title:t}=n,o=u(n,["onClick","title"]);return t==null?null:jsx(E.Secondary,i({title:t,onClick:e},o))};x.Subtitle=o=>{var r=o,{children:e}=r,t=u(r,["children"]);return e==null?null:jsx(B.Body2,l(i({part:"subtitle"},t),{children:e}))};x.Title=o=>{var r=o,{children:e}=r,t=u(r,["children"]);return e==null?null:jsx(B.Body1,l(i({fontWeight:"bold",mb:1,part:"title"},t),{children:e}))};function ke(e){let[t,o]=useState(),[r,n]=useState(Math.random()),{apiKey:s,config:c}=useContext(U),p=Object.fromEntries(Object.entries(c).filter(([b,y])=>["apiUrl","userId"].includes(b)&&y!=null)),d=new Frigade(s,p);useEffect(()=>{let b=y=>{y.id===e&&(o(y),n(Math.random()));};return f(),d.onFlowStateChange(b),()=>{d.removeOnFlowStateChangeHandler(b);}},[]);function f(){return k(this,null,function*(){let b=yield d.getFlow(e);o(b);})}return {flow:t,fetchFlow:f}}function Et(o){var r=o,{flowId:e}=r,t=u(r,["flowId"]);var f;let{flow:n}=ke(e);if(n==null||n.isVisible===!1)return null;n.start();let s=n.getCurrentStep();s==null||s.start();function c(){return k(this,null,function*(){yield n.skip();})}function p(){return k(this,null,function*(){yield s.complete();})}let d=p;return jsxs(x,l(i({anchor:s.selector,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault()},t),{children:[jsx(x.Close,{onClick:c}),jsx(x.Media,{src:(f=s.videoUri)!=null?f:s.imageUri,type:s.videoUri?"video":"image"}),jsx(x.Title,{children:s.title}),jsx(x.Subtitle,{children:s.subtitle}),jsxs(C.Row,{pt:4,alignItems:"center",justifyContent:"space-between",children:[jsx(x.Progress,{children:`${(s==null?void 0:s.order)+1}/${n.steps.size}`}),jsxs(C.Row,{gap:3,children:[jsx(x.Secondary,{title:s.secondaryButtonTitle,onClick:d}),jsx(x.Primary,{title:s.primaryButtonTitle,onClick:p})]})]})]}))}
11
+ var ee=Object.defineProperty,Ie=Object.defineProperties;var Ve=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var Z=(e,t,o)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,s=(e,t)=>{for(var o in t||(t={}))te.call(t,o)&&Z(e,o,t[o]);if($)for(var o of $(t))oe.call(t,o)&&Z(e,o,t[o]);return e},p=(e,t)=>Ie(e,Ve(t));var f=(e,t)=>{var o={};for(var r in e)te.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&$)for(var r of $(e))t.indexOf(r)<0&&oe.call(e,r)&&(o[r]=e[r]);return o};var re=(e,t)=>{for(var o in t)ee(e,o,{get:t[o],enumerable:!0});};var T=(e,t,o)=>new Promise((r,n)=>{var i=u=>{try{d(o.next(u));}catch(c){n(c);}},l=u=>{try{d(o.throw(u));}catch(c){n(c);}},d=u=>u.done?r(u.value):Promise.resolve(u.value).then(i,l);d((o=o.apply(e,t)).next());});var We="px",$e=e=>typeof e=="number"?`${4*e}${We}`:e,je=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],Le=Object.fromEntries(je.map(e=>[e,$e(e)])),ze={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"},L={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"},colors:s({},ze),fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"10px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.1)"},space:Le};var a=e=>`var(--fr-colors-${e})`,ne={neutral:{background:a("white"),border:a("gray500"),foreground:a("black"),surface:a("gray700"),active:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},focus:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},hover:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")}},primary:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500"),active:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")},focus:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500")},hover:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")}},secondary:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900"),active:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")},focus:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900")},hover:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")}}};var z=p(s({},L),{colors:s(s({},L.colors),ne)});function k(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let l=`${t.length?`${t}${o}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,k(d,l,o)):r[l]=d,r},{})}function K(e){return k(e,"--fr","-")}function ie(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=ie(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var se=K(z),m=ie(z);var U=k(m.colors),ae={color:U,backgroundColor:U,borderColor:U,border:m.borders,borderRadius:m.radii,borderWidth:m.borderWidths,fontFamily:m.fontFamilies,fontSize:m.fontSizes,fontWeight:m.fontWeights,gap:m.space,lineHeight:m.lineHeights,margin:m.space,marginTop:m.space,marginRight:m.space,marginBottom:m.space,marginLeft:m.space,padding:m.space,paddingTop:m.space,paddingRight:m.space,paddingBottom:m.space,paddingLeft:m.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"]},le={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]};function Ke(e){if(Array.isArray(e))return new Map(e.map(t=>[t,t]));if(typeof e=="object"&&e!==null)return new Map(Object.entries(e));if(["string","number"].includes(typeof e))return new Map([e,e]);throw new Error("Invalid entry in styleProps")}var Ue=new Map(Object.entries(ae).map(([e,t])=>[e,Ke(t)])),Ne=new Map(Object.entries(le).map(([e,t])=>[e,new Set(t)]));function pe(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let i=Ne.get(r);i!=null&&(i.forEach(l=>{t[l]=n;}),delete t[r]);}),Object.entries(t).forEach(([r,n])=>{let i=Ue.get(r);if(i!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let l=n.split(" ");o[r]=l.map(d=>{var u;return (u=i.get(d.toString()))!=null?u:d}).join(" "),delete t[r];}else i.has(n.toString())&&(o[r]=i.get(n.toString()),delete t[r]);}),{cssFromProps:o,unmatchedProps:t}}function ce(e){return e&&`fr-${e}`}function Xe(e){return e&&(Array.isArray(e)?e.map(t=>ce(t)).join(" "):ce(e))}function qe(l,i){var d=l,{as:e,children:t,className:o,part:r}=d,n=f(d,["as","children","className","part"]);let u=e!=null?e:"div",{cssFromProps:c,unmatchedProps:y}=pe(n),h=Xe(r),w=o||h?clsx(o,h):void 0;return jsx(u,p(s({className:w,css:[{boxSizing:"border-box"},c]},y),{ref:i,children:t}))}var g=X.forwardRef(qe);var N={};re(N,{Body1:()=>ot,Body2:()=>rt,Caption:()=>nt,Display1:()=>Je,Display2:()=>Qe,H1:()=>Ye,H2:()=>Ze,H3:()=>et,H4:()=>tt});var C={color:"neutral.foreground",fontFamily:"default",margin:0},Je=p(s({},C),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Qe=p(s({},C),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Ye=p(s({},C),{fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"}),Ze=p(s({},C),{fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"}),et=p(s({},C),{fontSize:"xl",fontWeight:"bold",lineHeight:"lg"}),tt=p(s({},C),{fontSize:"lg",fontWeight:"bold",lineHeight:"md"}),ot=p(s({},C),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),rt=p(s({},C),{fontSize:"sm",fontWeight:"regular",lineHeight:"md"}),nt=p(s({},C),{fontSize:"xs",fontWeight:"regular",lineHeight:"sm"});function fe(n){var i=n,{as:e="span",children:t,variant:o="Body1"}=i,r=f(i,["as","children","variant"]);return jsx(g,p(s(s({as:e},N[o]),r),{children:t}))}var it=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],st=Object.fromEntries(it.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsx(fe,p(s({as:t},r),{variant:e,children:r.children}));return o.displayName=`Text.${e}`,[e,o]})),S=Object.assign(fe,st);var _={};re(_,{Link:()=>pt,Plain:()=>ct,Primary:()=>at,Secondary:()=>lt,base:()=>O});var O=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),at=({colors:e})=>[O,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],lt=({colors:e})=>[O,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],pt=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],ct=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.neutral.foreground}];function me(i){var l=i,{as:e,children:t,title:o,variant:r="Primary"}=l,n=f(l,["as","children","title","variant"]);return jsxs(g,p(s({as:e!=null?e:"button",css:_[r]},n),{children:[t,o&&jsx(S.Body2,{fontWeight:"demibold",color:"inherit",children:o})]}))}var dt=["Primary","Secondary","Link","Plain"],ft=Object.fromEntries(dt.map(e=>{let t=e.toLocaleLowerCase(),o=i=>{var l=i,{part:r}=l,n=f(l,["part"]);return jsx(me,p(s({part:[`button-${t}`,r]},n),{variant:e,children:n.children}))};return o.displayName=`Text.${e}`,[e,o]})),H=Object.assign(me,ft);var mt=X.forwardRef((n,r)=>{var i=n,{children:e,css:t}=i,o=f(i,["children","css"]);return jsx(g,p(s({css:[{display:"flex",flexDirection:"row"},t]},o),{ref:r,children:e}))}),gt=X.forwardRef((n,r)=>{var i=n,{children:e,css:t}=i,o=f(i,["children","css"]);return jsx(g,p(s({css:[{display:"flex",flexDirection:"column"},t]},o),{ref:r,children:e}))}),E={Column:gt,Row:mt};var B=createContext({apiKey:"",config:{},modals:[],setModals:()=>{},navigate:()=>{}});function Pt({apiKey:e,children:t,config:o={},navigate:r,theme:n}){let i=n?K(n):{},[l,d]=useState([]),u=r!=null?r:(c,y="_self")=>{window.open(c,y);};return jsxs(B.Provider,{value:{apiKey:e,config:o,modals:l,setModals:d,navigate:u},children:[jsx(Global,{styles:{":root":s(s({},se),i)}}),jsx(ThemeProvider,{theme:m,children:t})]})}function he(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=useState(e),[r,n]=useState(null),i=useCallback(l=>{n(l);},[]);return useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:i}}var St=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function ve(r){var n=r,{style:e={},part:t=""}=n,o=f(n,["style","part"]);return jsxs(g,p(s({part:`dot-wrapper ${t}`,style:s({height:"48px",position:"absolute",width:"48px"},e)},o),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${St}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ce(r){var n=r,{part:e,src:t}=n,o=f(n,["part","src"]);return jsx(g,s({as:"img",part:["image",e],src:t},o))}function Ft(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function we(r){var n=r,{part:e,src:t}=n,o=f(n,["part","src"]);let i=Ft(t);return jsx(g,s({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:i},o))}function q(r){var n=r,{src:e,type:t}=n,o=f(n,["src","type"]);return jsx(t==="video"?we:Ce,s({src:e},o))}function Te({props:e,alignAttr:t,sideAttr:o}){let r=o!=null?o:"bottom",n={},i=()=>{var c;if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return (c=e.align)!=null?c:"after"},l="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=l;let u=i();return ["before","end"].includes(u)?["top","bottom"].includes(r)?n.right=l:n.bottom=l:["after","start"].includes(u)?["top","bottom"].includes(r)?n.left=l:n.top=l:["top","bottom"].includes(r)?n.left=`calc(50% + ${l})`:n.top=`calc(50% + ${l})`,n}var Se={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Be(e,t){var n,i,l,d,u;let o=Object.fromEntries(Se.content.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0)),r=Object.fromEntries(Se.root.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0));if(o.align=(n=o.align)!=null?n:"after",o.side=(i=o.side)!=null?i:"bottom",["before","after"].includes(o.align)){let c={after:"end",before:"start"},y=(A,I)=>["top","bottom"].includes(I)?A=="after"?"marginLeft":"marginRight":A=="after"?"marginTop":"marginBottom",h=(l=o.alignOffset)!=null?l:0,w=(d=o.style)!=null?d:{},P=(u=o.side)!=null?u:"bottom",M=o.align;o.style=p(s({},w),{[y(M,P)]:h});let D=["top","bottom"].includes(P)?t.width:t.height;o.alignOffset=(D+h)*-1,o.align=c[M];}return {contentProps:o,rootProps:r}}function x(l){var d=l,{anchor:e,children:t,className:o,spotlight:r=!1,style:n}=d,i=f(d,["anchor","children","className","spotlight","style"]);let{node:u,rect:c,ref:y}=he(),{contentProps:h,rootProps:w}=Be(i,c),[P,M]=useState(h.align),[D,A]=useState(h.side);if(u!==null){let F=u.getAttribute("data-align"),Y=u.getAttribute("data-side");P!==F&&M(F),D!==Y&&A(Y);}let I=useRef(null),[V,De]=useState(null);if(useEffect(()=>{let F=document.querySelector(e);F!=null&&(I.current=F,De(I));},[e]),V==null)return null;let W=V.current.getBoundingClientRect(),Q="0";typeof window!="undefined"&&(Q=window.getComputedStyle(V.current).borderRadius);let Ae=Te({props:i,alignAttr:P,sideAttr:D});return jsxs(v.Root,p(s({defaultOpen:!0},w),{children:[jsx(v.Anchor,{virtualRef:V}),jsx(v.Portal,{children:jsxs("div",{className:o,css:{position:"absolute",zIndex:9999},children:[r&&jsx(g,{borderRadius:Q,part:"tooltip-spotlight",position:"absolute",css:{boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:W.height,left:W.left,top:W.top,width:W.width}}),jsx(v.Content,p(s({asChild:!0},h),{ref:y,children:jsxs(E.Column,{backgroundColor:"neutral.background",borderRadius:"md",p:5,part:"tooltip-content",position:"relative",css:s({boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)",maxWidth:"360px"},n),children:[jsx(ve,{style:Ae}),t]})}))]})})]}))}x.Close=e=>jsx(v.Close,{"aria-label":"Close",asChild:!0,children:jsx(H.Plain,p(s({css:{top:"12px",right:"4px"},part:"tooltip-close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});x.Media=o=>{var r=o,{src:e}=r,t=f(r,["src"]);return e==null?null:jsx(q,s({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e},t))};x.Primary=r=>{var n=r,{onClick:e,title:t}=n,o=f(n,["onClick","title"]);return t==null?null:jsx(H.Primary,s({title:t,onClick:e},o))};x.Progress=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsx(S.Body2,p(s({fontWeight:"demibold",part:"progress"},t),{children:e}))};x.Secondary=r=>{var n=r,{onClick:e,title:t}=n,o=f(n,["onClick","title"]);return t==null?null:jsx(H.Secondary,s({title:t,onClick:e},o))};x.Subtitle=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsx(S.Body2,p(s({part:"subtitle"},t),{children:e}))};x.Title=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsx(S.Body1,p(s({fontWeight:"bold",mb:1,part:"title"},t),{children:e}))};function Re(e){let[t,o]=useState(),{apiKey:r,config:n}=useContext(B),i=Object.fromEntries(Object.entries(n).filter(([c,y])=>["apiUrl","userId"].includes(c)&&y!=null)),d=useRef(new Frigade(r,i)).current,u=c=>{if(c.id!==e)return;let y=Object.assign(Object.create(Object.getPrototypeOf(c)),c);o(y);};return useEffect(()=>(T(this,null,function*(){let c=yield d.getFlow(e);o(c);}),d.onStateChange(u),()=>{d.removeStateChangeHandler(u);}),[]),{flow:t}}function ke(e){let{modals:t,setModals:o}=useContext(B),[r,n]=useState(!1);return useEffect(()=>(o([...t,e]),()=>o(t.filter(i=>i!==e))),[]),useEffect(()=>{let i=t[0]===e;i!==r&&n(i);},[t]),{isCurrentModal:r}}function j(e,{onComplete:t,onDismiss:o}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&t(e),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>T(this,null,function*(){if((o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;yield e.skip();}),[e])}}function He(e,{onPrimary:t,onSecondary:o}={}){let{navigate:r}=useContext(B);return {handlePrimary:useCallback(n=>T(this,null,function*(){if((t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;yield e.complete(),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);}),[e]),handleSecondary:useCallback(n=>T(this,null,function*(){if((o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;yield e.complete(),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);}),[e])}}function Me(l){var d=l,{step:e,flow:t,onDismiss:o,onPrimary:r,onSecondary:n}=d,i=f(d,["step","flow","onDismiss","onPrimary","onSecondary"]);var w;let{isCurrentModal:u}=ke(`${t.id}-${e.id}`),{handleDismiss:c}=j(t,{onDismiss:o}),{handlePrimary:y,handleSecondary:h}=He(e,{onPrimary:r,onSecondary:n});return u?jsxs(x,p(s({anchor:e.selector,onOpenAutoFocus:P=>P.preventDefault(),onPointerDownOutside:P=>P.preventDefault()},i),{children:[jsx(x.Close,{onClick:c}),jsx(x.Media,{src:(w=e.videoUri)!=null?w:e.imageUri,type:e.videoUri?"video":"image"}),jsx(x.Title,{children:e.title}),jsx(x.Subtitle,{children:e.subtitle}),jsxs(E.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsx(x.Progress,{children:`${(e==null?void 0:e.order)+1}/${t.steps.size}`}),jsx(x.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:h}),jsx(x.Primary,{title:e.primaryButtonTitle,onClick:y})]})]}),e.id):null}function Nt(r){var n=r,{flowId:e,onComplete:t}=n,o=f(n,["flowId","onComplete"]);let{flow:i}=Re(e);if(j(i,{onComplete:t}),i==null||i.isVisible===!1)return null;i.start();let l=i.getCurrentStep();return l==null||l.start(),jsx(Me,s({step:l,flow:i},o))}
12
12
 
13
- export { m as Box, E as Button, C as Flex, gt as Provider, B as Text, x as Tooltip, Et as Tour };
13
+ export { g as Box, H as Button, E as Flex, Pt as Provider, S as Text, x as Tooltip, Nt as Tour };
14
14
  //# sourceMappingURL=out.js.map
15
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Box/index.tsx","../src/shared/tokens/scalarTokens.ts","../src/shared/tokens/semanticColors.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/styleProps.ts","../src/components/Box/stylePropsToCss.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Provider/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useFlow.ts","../src/components/Tour/index.tsx"],"names":["React","clsx","SPACE_UNIT","spaceValue","key","spaceKeys","spaceScale","palette","scalarTokens","__spreadValues","colorVar","colorName","semanticColors","tokens","__spreadProps","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","colorTokens","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","_a","jsx","prefixPart","part","processPart","p","BoxWithRef","ref","_b","as","children","className","__objRest","Component","processedPart","classNameWithPart","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","BaseText","variant","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","Link","Plain","Primary","Secondary","radii","space","colors","jsxs","BaseButton","title","buttonVariantNames","buttonVariantComponents","variantPart","Button","Row","css","Column","Flex","createContext","Global","ThemeProvider","FrigadeContext","Provider","apiKey","config","themeOverrides","useEffect","useRef","useState","XMarkIcon","Popover","useCallback","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","Image","src","getVideoEmbedSrc","videoUri","_c","Video","videoEmbedSrc","Media","type","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToRadixProps","contentRect","_d","_e","contentProps","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","lengthOfCurrentSide","Tooltip","anchor","spotlight","contentNode","contentRef","setAlignAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","anchorElementRef","setAnchorElementRef","anchorQuery","anchorRect","anchorRadius","dotPosition","onClick","Frigade","useContext","useFlow","flowId","flow","setFlow","_","setNonce","filteredConfig","frigade","handler","updatedFlow","fetchFlow","__async","flowResponse","Tour","step","handleDismiss","handlePrimary","handleSecondary","e"],"mappings":"w2BAAA,UAAYA,OAAW,QACvB,OAAS,QAAAC,OAAY,OCArB,IAAMC,GAAa,KAEbC,GAAcC,GAClB,OAAOA,GAAQ,SAAW,GAAG,EAAcA,IAAMF,KAAeE,EAE5DC,GAAY,CAChB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,MACF,EAOMC,GAAa,OAAO,YAAYD,GAAU,IAAKD,GAAQ,CAACA,EAAKD,GAAWC,CAAG,CAAC,CAAC,CAAC,EAEvEG,GAAU,CACrB,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,SAAU,UACV,SAAU,UACV,SAAU,UACV,YAAa,YACb,QAAS,UAGT,OAAQ,SACV,EAGaC,EAAe,CAC1B,QAAS,CACP,GAAI,WACN,EACA,aAAc,CACZ,EAAG,IACH,GAAI,KACN,EAEA,OAA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iBACA,gBACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,cAAe,CACb,MACA,cACA,SACA,iBACA,UACA,UACA,SACA,eACA,OACF,EAEA,SAAU,CACR,SACA,OACA,eACA,UACA,UACA,SACA,eACA,OACF,EAEA,eAAgB,CACd,SACA,QACA,MACA,aACA,WACA,OACA,QACA,SACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,aAAc,CACZ,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,OACA,QACA,WACA,iBACA,gBACA,cACA,gBACA,eACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CAAC,aAAc,cAAe,UAAW,UAAW,SAAU,eAAgB,OAAO,EAEhG,SAAU,CACR,SACA,WACA,WACA,QACA,SACA,UACA,UACA,SACA,eACA,OACF,EAEA,QAAS,CACP,QACA,aACA,aACA,kBACA,aACA,WACA,OACA,YACA,OACA,UACA,UACA,SACA,cACA,cACA,mBACA,cACA,eACA,cACA,cACA,YACA,OACA,SACA,eACA,QACA,kBACA,qBACA,qBACA,YACA,aACA,qBACA,eACA,gBACA,OACF,CACF,EAEaG,GAAsB,CACjC,EAAG,CAAC,QAAQ,EACZ,GAAI,CAAC,WAAW,EAChB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,aAAc,aAAa,EAChC,GAAI,CAAC,YAAa,cAAc,EAEhC,EAAG,CAAC,SAAS,EACb,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,eAAe,EACpB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAe,cAAc,EAClC,GAAI,CAAC,aAAc,eAAe,CACpC,ECpPA,SAASC,GAAUC,EAAO,CACxB,GAAI,MAAM,QAAQA,CAAK,EACrB,OAAO,IAAI,IAAIA,EAAM,IAAKC,GAAM,CAACA,EAAGA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e,EACjCY,GAAA,MAAAA,EAAM,QAEN,SAAeC,GAAgB,QAAAJ,EAAA,sBAC7B,MAAMT,EAAK,KAAK,CAClB,GAEA,SAAec,GAAgB,QAAAL,EAAA,sBAC7B,MAAMG,EAAK,SAAS,CACtB,GAEA,IAAMG,EAAkBD,EAExB,OACExG,EAACqE,EAAAlJ,EAAAL,EAAA,CACC,OAAQwL,EAAK,SACb,gBAAkBI,GAAMA,EAAE,eAAe,EACzC,qBAAuBA,GAAMA,EAAE,eAAe,GAC1C7J,GAJL,CAMC,UAAAQ,EAACgH,EAAQ,MAAR,CAAc,QAASkC,EAAe,EAEvClJ,EAACgH,EAAQ,MAAR,CACC,KAAKjH,EAAAkJ,EAAK,WAAL,KAAAlJ,EAAiBkJ,EAAK,SAC3B,KAAMA,EAAK,SAAW,QAAU,QAClC,EAEAjJ,EAACgH,EAAQ,MAAR,CAAe,SAAAiC,EAAK,MAAM,EAC3BjJ,EAACgH,EAAQ,SAAR,CAAkB,SAAAiC,EAAK,SAAS,EAEjCtG,EAACU,EAAK,IAAL,CAAS,GAAI,EAAG,WAAW,SAAS,eAAe,gBAClD,UAAArD,EAACgH,EAAQ,SAAR,CAAkB,aAAGiC,GAAA,YAAAA,EAAM,OAAQ,KAAKZ,EAAK,MAAM,OAAO,EAE3D1F,EAACU,EAAK,IAAL,CAAS,IAAK,EACb,UAAArD,EAACgH,EAAQ,UAAR,CAAkB,MAAOiC,EAAK,qBAAsB,QAASG,EAAiB,EAC/EpJ,EAACgH,EAAQ,QAAR,CAAgB,MAAOiC,EAAK,mBAAoB,QAASE,EAAe,GAC3E,GACF,IACF,CAEJ","sourcesContent":["import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { stylePropsToCss } from './stylePropsToCss'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: string | string[] | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => prefixPart(p)).join(' ') : prefixPart(part)\n}\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: string | string[]\n} & React.ComponentPropsWithRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, part, ...props }: BoxProps<T>,\n ref: React.ForwardedRef<T>\n) {\n const Component = as ?? 'div'\n\n const { cssFromProps, unmatchedProps } = stylePropsToCss(props)\n\n const processedPart = processPart(part)\n const classNameWithPart = className || processedPart ? clsx(className, processedPart) : undefined\n\n const cssProp = [{ boxSizing: 'border-box' }, cssFromProps]\n\n return (\n // @ts-ignore: TODO: ref types are yet again complaining\n <Component className={classNameWithPart} css={cssProp} {...unmatchedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef)\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceScale = {\n [K in SpaceKeys[any]]: string\n}\nconst spaceScale = Object.fromEntries(spaceKeys.map((key) => [key, spaceValue(key)])) as SpaceScale\n\nexport const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n inherit: 'inherit',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n\n// Scalar = Tokens with literal values\nexport const scalarTokens = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n\n colors: {\n ...palette,\n },\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n regular: '400',\n demibold: '600',\n bold: '700',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n radii: {\n md: '10px',\n lg: '20px',\n round: '50%',\n },\n shadows: {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n },\n space: spaceScale,\n}\n","const colorVar = (colorName) => `var(--fr-colors-${colorName})`\n\n// Semantic = Tokens that reference Scalars & contextualize them according to how they're used\nexport const semanticColors = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray500'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","import { scalarTokens } from './scalarTokens'\nimport { semanticColors } from './semanticColors'\n\nexport { scalarTokens, semanticColors }\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...scalarTokens,\n colors: {\n ...scalarTokens.colors,\n ...semanticColors,\n },\n}\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(obj, path = '--fr') {\n const newObj: Record<string, any> = {}\n\n Object.keys(obj).forEach((key) => {\n const currentValue = obj[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst colorTokens: Record<string, unknown> = flattenObject(theme.colors)\n\n/*\n TODO:\n - top / right / bottom / left\n*/\n\nexport const styleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginTop: theme.space,\n marginRight: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n\n padding: theme.space,\n paddingTop: theme.space,\n paddingRight: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n\n alignContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'normal',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignSelf: [\n 'auto',\n 'normal',\n 'center',\n 'start',\n 'end',\n 'self-start',\n 'self-end',\n 'flex-start',\n 'flex-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexDirection: [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexWrap: [\n 'nowrap',\n 'wrap',\n 'wrap-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'left',\n 'right',\n 'normal',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'left',\n 'right',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'legacy right',\n 'legacy left',\n 'legacy center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n boxSizing: ['border-box', 'content-box', 'inherit', 'initial', 'revert', 'revert-layer', 'unset'],\n\n position: [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n display: [\n 'block',\n 'block flex',\n 'block flow',\n 'block flow-root',\n 'block grid',\n 'contents',\n 'flex',\n 'flow-root',\n 'grid',\n 'inherit',\n 'initial',\n 'inline',\n 'inline flex',\n 'inline flow',\n 'inline flow-root',\n 'inline grid',\n 'inline-block',\n 'inline-flex',\n 'inline-grid',\n 'list-item',\n 'none',\n 'revert',\n 'revert-layer',\n 'table',\n 'table-row-group',\n 'table-header-group',\n 'table-footer-group',\n 'table-row',\n 'table-cell',\n 'table-column-group',\n 'table-column',\n 'table-caption',\n 'unset',\n ],\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n","import { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n throw new Error('Invalid entry in styleProps')\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nexport function stylePropsToCss(props: Record<any, any>) {\n const unmatchedProps = Object.assign({}, props)\n const cssFromProps = {}\n\n // Convert shorthand styleProps to full versions\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const matchedShorthand = stylePropShorthandsMap.get(propName)\n if (matchedShorthand != null) {\n matchedShorthand.forEach((propName) => {\n unmatchedProps[propName] = propValue\n })\n\n delete unmatchedProps[propName]\n }\n })\n\n // Convert styleProps to style object\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const styleProp = stylePropsMap.get(propName)\n if (styleProp != null) {\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n // Split space-separated values out and process them individually\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n delete unmatchedProps[propName]\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n delete unmatchedProps[propName]\n }\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","const base = {\n color: 'neutral.foreground',\n fontFamily: 'default',\n margin: 0,\n}\n\nexport const Display1 = {\n ...base,\n fontSize: '5xl',\n fontWeight: 'bold',\n lineHeight: '4xl',\n}\n\nexport const Display2 = {\n ...base,\n fontSize: '4xl',\n fontWeight: 'bold',\n lineHeight: '3xl',\n}\n\nexport const H1 = {\n ...base,\n fontSize: '3xl',\n fontWeight: 'bold',\n lineHeight: '2xl',\n}\n\nexport const H2 = {\n ...base,\n fontSize: '2xl',\n fontWeight: 'bold',\n lineHeight: 'xl',\n}\n\nexport const H3 = {\n ...base,\n fontSize: 'xl',\n fontWeight: 'bold',\n lineHeight: 'lg',\n}\n\nexport const H4 = {\n ...base,\n fontSize: 'lg',\n fontWeight: 'bold',\n lineHeight: 'md',\n}\n\nexport const Body1 = {\n ...base,\n fontSize: 'md',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Body2 = {\n ...base,\n fontSize: 'sm',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Caption = {\n ...base,\n fontSize: 'xs',\n fontWeight: 'regular',\n lineHeight: 'sm',\n}\n","import { Box, BoxProps } from '../Box'\n\nimport * as styles from './Text.styles'\n\ntype TextVariant =\n | 'Display1'\n | 'Display2'\n | 'H1'\n | 'H2'\n | 'H3'\n | 'H4'\n | 'Body1'\n | 'Body2'\n | 'Caption'\n\nexport interface TextProps extends BoxProps {\n variant?: TextVariant\n}\n\nfunction BaseText({ as = 'span', children, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} {...styles[variant]} {...props}>\n {children}\n </Box>\n )\n}\n\nconst textVariantNames: TextVariant[] = [\n 'Display1',\n 'Display2',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'Body1',\n 'Body2',\n 'Caption',\n]\n\nconst textVariantComponents = Object.fromEntries(\n textVariantNames.map((variant) => {\n const asProp = ['H1', 'H2', 'H3', 'H4'].includes(variant)\n ? (variant.toLowerCase() as 'h1' | 'h2' | 'h3' | 'h4')\n : undefined\n const component = (props: TextProps) => (\n <BaseText as={asProp} {...props} variant={variant}>\n {props.children}\n </BaseText>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Text = Object.assign(BaseText, textVariantComponents)\n","export const base = ({ radii, space }) => ({\n borderWidth: 0,\n borderRadius: radii.md,\n padding: `${space[2]} ${space[4]}`,\n})\n\nexport const Primary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.primary.surface,\n color: colors.primary.foreground,\n\n '&:hover': {\n backgroundColor: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Secondary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.secondary.surface,\n color: colors.secondary.foreground,\n\n '&:hover': {\n backgroundColor: colors.secondary.hover.surface,\n },\n },\n]\n\nexport const Link = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.primary.surface,\n\n '&:hover': {\n color: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Plain = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.neutral.foreground,\n },\n]\n","import { Interpolation } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\nimport { Text } from '../Text'\n\nimport * as styles from './Button.styles'\n\n// TODO: Generate this type from buttonVariantNames\ntype ButtonVariant = 'Primary' | 'Secondary' | 'Link' | 'Plain'\n\nexport interface ButtonProps extends BoxProps {\n title?: string\n variant?: ButtonVariant\n}\n\nfunction BaseButton({ as, children, title, variant = 'Primary', ...props }: ButtonProps) {\n return (\n <Box as={as ?? 'button'} css={styles[variant] as Interpolation<any>} {...props}>\n {children}\n {title && (\n <Text.Body2 fontWeight=\"demibold\" color=\"inherit\">\n {title}\n </Text.Body2>\n )}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const variantPart = variant.toLocaleLowerCase()\n\n const component = ({ part, ...props }: ButtonProps) => (\n <BaseButton part={[`button-${variantPart}`, part]} {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { createContext } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport { createThemeVariables, theme as themeTokens, themeVariables } from '../../shared/theme'\n\nexport const FrigadeContext = createContext<{ apiKey: string; config: ProviderConfig }>({\n apiKey: '',\n config: {},\n})\n\n// TODO: type theme something like Partial<typeof themeContract>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n children?: React.ReactNode\n config?: ProviderConfig\n theme?: Record<any, any>\n}\n\ninterface ProviderConfig {\n apiUrl?: string\n userId?: string\n}\n\nexport function Provider({ apiKey, children, config = {}, theme }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n\n return (\n <FrigadeContext.Provider value={{ apiKey, config }}>\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Interpolation } from '@emotion/react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Dot } from './Dot'\nimport { Flex } from '../Flex/Flex'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToRadixProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n css?: Interpolation<any>\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n className,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToRadixProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div className={className} css={{ position: 'absolute', zIndex: 9999 }}>\n {spotlight && (\n <Box\n borderRadius={anchorRadius}\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Flex.Column\n backgroundColor=\"neutral.background\"\n borderRadius=\"md\"\n p={5}\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Flex.Column>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = (props: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '12px',\n right: '4px',\n }}\n part=\"tooltip-close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToRadixProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps['alignOffset'] = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { Flow, Frigade } from '@frigade/js'\nimport { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFlow(flowId: string) {\n const [flow, setFlow] = useState<Flow>()\n const [_, setNonce] = useState(Math.random())\n const { apiKey, config } = useContext(FrigadeContext)\n const filteredConfig = Object.fromEntries(\n Object.entries(config).filter(([k, v]) => ['apiUrl', 'userId'].includes(k) && v != null)\n )\n const frigade = new Frigade(apiKey, filteredConfig)\n\n useEffect(() => {\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n setFlow(updatedFlow)\n setNonce(Math.random())\n }\n\n fetchFlow()\n frigade.onFlowStateChange(handler)\n return () => {\n frigade.removeOnFlowStateChangeHandler(handler)\n }\n }, [])\n\n async function fetchFlow() {\n const flowResponse: Flow = await frigade.getFlow(flowId)\n setFlow(flowResponse)\n }\n\n return { flow, fetchFlow }\n}\n","import { useFlow } from '../../hooks/useFlow'\n\nimport { Flex } from '../Flex/Flex'\nimport { Tooltip, TooltipProps } from '../Tooltip'\n\nexport interface TourProps extends TooltipProps {\n flowId: string\n}\n\nexport function Tour({ flowId, ...props }: TourProps) {\n const { flow } = useFlow(flowId)\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n step?.start()\n\n async function handleDismiss() {\n await flow.skip()\n }\n\n async function handlePrimary() {\n await step.complete()\n }\n\n const handleSecondary = handlePrimary\n\n return (\n <Tooltip\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row pt={4} alignItems=\"center\" justifyContent=\"space-between\">\n <Tooltip.Progress>{`${step?.order + 1}/${flow.steps.size}`}</Tooltip.Progress>\n\n <Flex.Row gap={3}>\n <Tooltip.Secondary title={step.secondaryButtonTitle} onClick={handleSecondary} />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Flex.Row>\n </Tooltip>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/Box/index.tsx","../src/shared/tokens/scalarTokens.ts","../src/shared/tokens/semanticColors.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/styleProps.ts","../src/components/Box/stylePropsToCss.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Provider/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useFlow.ts","../src/hooks/useModal.ts","../src/hooks/useFlowHandlers.ts","../src/hooks/useStepHandlers.ts","../src/components/Tour/TourStep.tsx","../src/components/Tour/index.tsx"],"names":["React","clsx","SPACE_UNIT","spaceValue","key","spaceKeys","spaceScale","palette","scalarTokens","__spreadValues","colorVar","colorName","semanticColors","tokens","__spreadProps","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","colorTokens","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","_a","jsx","prefixPart","part","processPart","p","BoxWithRef","ref","_b","as","children","className","__objRest","Component","processedPart","classNameWithPart","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","BaseText","variant","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","Link","Plain","Primary","Secondary","radii","space","colors","jsxs","BaseButton","title","buttonVariantNames","buttonVariantComponents","variantPart","Button","Row","css","Column","Flex","createContext","useState","Global","ThemeProvider","FrigadeContext","Provider","apiKey","config","navigate","themeOverrides","modals","setModals","navigateHandler","url","target","useEffect","useRef","XMarkIcon","Popover","useCallback","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","Image","src","getVideoEmbedSrc","videoUri","_c","Video","videoEmbedSrc","Media","type","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToPopoverProps","contentRect","_d","_e","contentProps","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","lengthOfCurrentSide","Tooltip","anchor","spotlight","contentNode","contentRef","setAlignAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","anchorElementRef","setAnchorElementRef","anchorQuery","anchorRect","anchorRadius","dotPosition","onClick","Frigade","useContext","useFlow","flowId","flow","setFlow","filteredConfig","frigade","handler","updatedFlow","clonedFlow","__async","flowResponse","useModal","isCurrentModal","setIsCurrentModal","newIsCurrentModal","useFlowHandlers","onComplete","onDismiss","lastCompleted","e","useStepHandlers","step","onPrimary","onSecondary","TourStep","handleDismiss","handlePrimary","handleSecondary","Tour"],"mappings":"w2BAAA,UAAYA,OAAW,QACvB,OAAS,QAAAC,OAAY,OCArB,IAAMC,GAAa,KAEbC,GAAcC,GAClB,OAAOA,GAAQ,SAAW,GAAG,EAAcA,IAAMF,KAAeE,EAE5DC,GAAY,CAChB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,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EACP,gBAAiBA,EACjB,YAAaA,EACb,OAAQD,EAAM,QACd,aAAcA,EAAM,MACpB,YAAaA,EAAM,aAEnB,WAAYA,EAAM,aAClB,SAAUA,EAAM,UAChB,WAAYA,EAAM,YAElB,IAAKA,EAAM,MAEX,WAAYA,EAAM,YAElB,OAAQA,EAAM,MACd,UAAWA,EAAM,MACjB,YAAaA,EAAM,MACnB,aAAcA,EAAM,MACpB,WAAYA,EAAM,MAElB,QAASA,EAAM,MACf,WAAYA,EAAM,MAClB,aAAcA,EAAM,MACpB,cAAeA,EAAM,MACrB,YAAaA,EAAM,MAEnB,aAAc,CACZ,SACA,QACA,MACA,aACA,WACA,SACA,WACA,iBACA,gBACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,WAAY,CACV,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,WACA,iBACA,gBACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CACT,OACA,SACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,WACA,iBACA,gBACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,cAAe,CACb,MACA,cACA,SACA,iBACA,UACA,UACA,SACA,eACA,OACF,EAEA,SAAU,CACR,SACA,OACA,eACA,UACA,UACA,SACA,eACA,OACF,EAEA,eAAgB,CACd,SACA,QACA,MACA,aACA,WACA,OACA,QACA,SACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,aAAc,CACZ,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,OACA,QACA,WACA,iBACA,gBACA,cACA,gBACA,eACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CAAC,aAAc,cAAe,UAAW,UAAW,SAAU,eAAgB,OAAO,EAEhG,SAAU,CACR,SACA,WACA,WACA,QACA,SACA,UACA,UACA,SACA,eACA,OACF,EAEA,QAAS,CACP,QAC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,cAAA9J,OAAA,6BAbF,SAASqK,GAAKtK,EAA6C,CAA7C,IAAAQ,EAAAR,EAAE,QAAA2I,EAAQ,WAAAe,CAjB/B,EAiBqBlJ,EAAyBf,EAAAmB,EAAzBJ,EAAyB,CAAvB,SAAQ,eAC7B,GAAM,CAAE,KAAAoI,CAAK,EAAIF,GAAQC,CAAM,EAG/B,GAFAc,EAAgBb,EAAM,CAAE,WAAAc,CAAW,CAAC,EAEhCd,GAAQ,MAAQA,EAAK,YAAc,GACrC,OAAO,KAGTA,EAAK,MAAM,EAEX,IAAMmB,EAAOnB,EAAK,eAAe,EACjC,OAAAmB,GAAA,MAAAA,EAAM,QAEC9J,GAACiK,GAAAxM,EAAA,CAAS,KAAMqM,EAAM,KAAMnB,GAAUnJ,EAAO,CACtD","sourcesContent":["import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { stylePropsToCss } from './stylePropsToCss'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: string | string[] | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => prefixPart(p)).join(' ') : prefixPart(part)\n}\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: string | string[]\n} & React.ComponentPropsWithRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, part, ...props }: BoxProps<T>,\n ref: React.ForwardedRef<T>\n) {\n const Component = as ?? 'div'\n\n const { cssFromProps, unmatchedProps } = stylePropsToCss(props)\n\n const processedPart = processPart(part)\n const classNameWithPart = className || processedPart ? clsx(className, processedPart) : undefined\n\n const cssProp = [{ boxSizing: 'border-box' }, cssFromProps]\n\n return (\n // @ts-ignore: TODO: ref types are yet again complaining\n <Component className={classNameWithPart} css={cssProp} {...unmatchedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef)\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceScale = {\n [K in SpaceKeys[any]]: string\n}\nconst spaceScale = Object.fromEntries(spaceKeys.map((key) => [key, spaceValue(key)])) as SpaceScale\n\nexport const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n inherit: 'inherit',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n\n// Scalar = Tokens with literal values\nexport const scalarTokens = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n\n colors: {\n ...palette,\n },\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n thin: '100',\n extralight: '200',\n light: '300',\n regular: '400',\n medium: '500',\n demibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n radii: {\n md: '10px',\n lg: '20px',\n round: '50%',\n },\n shadows: {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n },\n space: spaceScale,\n}\n","const colorVar = (colorName) => `var(--fr-colors-${colorName})`\n\n// Semantic = Tokens that reference Scalars & contextualize them according to how they're used\nexport const semanticColors = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray500'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","import { scalarTokens } from './scalarTokens'\nimport { semanticColors } from './semanticColors'\n\nexport { scalarTokens, semanticColors }\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...scalarTokens,\n colors: {\n ...scalarTokens.colors,\n ...semanticColors,\n },\n}\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(obj, path = '--fr') {\n const newObj: Record<string, any> = {}\n\n Object.keys(obj).forEach((key) => {\n const currentValue = obj[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst colorTokens: Record<string, unknown> = flattenObject(theme.colors)\n\n/*\n TODO:\n - top / right / bottom / left\n*/\n\nexport const styleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginTop: theme.space,\n marginRight: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n\n padding: theme.space,\n paddingTop: theme.space,\n paddingRight: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n\n alignContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'normal',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignSelf: [\n 'auto',\n 'normal',\n 'center',\n 'start',\n 'end',\n 'self-start',\n 'self-end',\n 'flex-start',\n 'flex-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexDirection: [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexWrap: [\n 'nowrap',\n 'wrap',\n 'wrap-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'left',\n 'right',\n 'normal',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'left',\n 'right',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'legacy right',\n 'legacy left',\n 'legacy center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n boxSizing: ['border-box', 'content-box', 'inherit', 'initial', 'revert', 'revert-layer', 'unset'],\n\n position: [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n display: [\n 'block',\n 'block flex',\n 'block flow',\n 'block flow-root',\n 'block grid',\n 'contents',\n 'flex',\n 'flow-root',\n 'grid',\n 'inherit',\n 'initial',\n 'inline',\n 'inline flex',\n 'inline flow',\n 'inline flow-root',\n 'inline grid',\n 'inline-block',\n 'inline-flex',\n 'inline-grid',\n 'list-item',\n 'none',\n 'revert',\n 'revert-layer',\n 'table',\n 'table-row-group',\n 'table-header-group',\n 'table-footer-group',\n 'table-row',\n 'table-cell',\n 'table-column-group',\n 'table-column',\n 'table-caption',\n 'unset',\n ],\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n","import { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n throw new Error('Invalid entry in styleProps')\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nexport function stylePropsToCss(props: Record<any, any>) {\n const unmatchedProps = Object.assign({}, props)\n const cssFromProps = {}\n\n // Convert shorthand styleProps to full versions\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const matchedShorthand = stylePropShorthandsMap.get(propName)\n if (matchedShorthand != null) {\n matchedShorthand.forEach((propName) => {\n unmatchedProps[propName] = propValue\n })\n\n delete unmatchedProps[propName]\n }\n })\n\n // Convert styleProps to style object\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const styleProp = stylePropsMap.get(propName)\n if (styleProp != null) {\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n // Split space-separated values out and process them individually\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n delete unmatchedProps[propName]\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n delete unmatchedProps[propName]\n }\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","const base = {\n color: 'neutral.foreground',\n fontFamily: 'default',\n margin: 0,\n}\n\nexport const Display1 = {\n ...base,\n fontSize: '5xl',\n fontWeight: 'bold',\n lineHeight: '4xl',\n}\n\nexport const Display2 = {\n ...base,\n fontSize: '4xl',\n fontWeight: 'bold',\n lineHeight: '3xl',\n}\n\nexport const H1 = {\n ...base,\n fontSize: '3xl',\n fontWeight: 'bold',\n lineHeight: '2xl',\n}\n\nexport const H2 = {\n ...base,\n fontSize: '2xl',\n fontWeight: 'bold',\n lineHeight: 'xl',\n}\n\nexport const H3 = {\n ...base,\n fontSize: 'xl',\n fontWeight: 'bold',\n lineHeight: 'lg',\n}\n\nexport const H4 = {\n ...base,\n fontSize: 'lg',\n fontWeight: 'bold',\n lineHeight: 'md',\n}\n\nexport const Body1 = {\n ...base,\n fontSize: 'md',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Body2 = {\n ...base,\n fontSize: 'sm',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Caption = {\n ...base,\n fontSize: 'xs',\n fontWeight: 'regular',\n lineHeight: 'sm',\n}\n","import { Box, BoxProps } from '../Box'\n\nimport * as styles from './Text.styles'\n\ntype TextVariant =\n | 'Display1'\n | 'Display2'\n | 'H1'\n | 'H2'\n | 'H3'\n | 'H4'\n | 'Body1'\n | 'Body2'\n | 'Caption'\n\nexport interface TextProps extends BoxProps {\n variant?: TextVariant\n}\n\nfunction BaseText({ as = 'span', children, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} {...styles[variant]} {...props}>\n {children}\n </Box>\n )\n}\n\nconst textVariantNames: TextVariant[] = [\n 'Display1',\n 'Display2',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'Body1',\n 'Body2',\n 'Caption',\n]\n\nconst textVariantComponents = Object.fromEntries(\n textVariantNames.map((variant) => {\n const asProp = ['H1', 'H2', 'H3', 'H4'].includes(variant)\n ? (variant.toLowerCase() as 'h1' | 'h2' | 'h3' | 'h4')\n : undefined\n const component = (props: TextProps) => (\n <BaseText as={asProp} {...props} variant={variant}>\n {props.children}\n </BaseText>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Text = Object.assign(BaseText, textVariantComponents)\n","export const base = ({ radii, space }) => ({\n borderWidth: 0,\n borderRadius: radii.md,\n padding: `${space[2]} ${space[4]}`,\n})\n\nexport const Primary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.primary.surface,\n color: colors.primary.foreground,\n\n '&:hover': {\n backgroundColor: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Secondary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.secondary.surface,\n color: colors.secondary.foreground,\n\n '&:hover': {\n backgroundColor: colors.secondary.hover.surface,\n },\n },\n]\n\nexport const Link = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.primary.surface,\n\n '&:hover': {\n color: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Plain = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.neutral.foreground,\n },\n]\n","import { Interpolation } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\nimport { Text } from '../Text'\n\nimport * as styles from './Button.styles'\n\n// TODO: Generate this type from buttonVariantNames\ntype ButtonVariant = 'Primary' | 'Secondary' | 'Link' | 'Plain'\n\nexport interface ButtonProps extends BoxProps {\n title?: string\n variant?: ButtonVariant\n}\n\nfunction BaseButton({ as, children, title, variant = 'Primary', ...props }: ButtonProps) {\n return (\n <Box as={as ?? 'button'} css={styles[variant] as Interpolation<any>} {...props}>\n {children}\n {title && (\n <Text.Body2 fontWeight=\"demibold\" color=\"inherit\">\n {title}\n </Text.Body2>\n )}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const variantPart = variant.toLocaleLowerCase()\n\n const component = ({ part, ...props }: ButtonProps) => (\n <BaseButton part={[`button-${variantPart}`, part]} {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { createContext, Dispatch, SetStateAction, useState } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport { createThemeVariables, theme as themeTokens, themeVariables } from '../../shared/theme'\n\ntype NavigateHandler = (url: string, target?: string) => void\n\n// TODO: type theme something like Partial<typeof themeTokens>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n children?: React.ReactNode\n config?: ProviderConfig\n navigate?: NavigateHandler\n theme?: Record<any, any>\n}\n\ninterface ProviderConfig {\n apiUrl?: string\n userId?: string\n}\n\ninterface ProviderContext {\n apiKey: string\n config: ProviderConfig\n modals: string[]\n setModals: Dispatch<SetStateAction<string[]>>\n navigate: NavigateHandler\n}\n\nexport const FrigadeContext = createContext<ProviderContext>({\n apiKey: '',\n config: {},\n modals: [],\n setModals: () => {},\n navigate: () => {},\n})\n\nexport function Provider({ apiKey, children, config = {}, navigate, theme }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n const [modals, setModals] = useState([])\n\n const navigateHandler =\n navigate ??\n ((url, target = '_self') => {\n window.open(url, target)\n })\n\n return (\n <FrigadeContext.Provider\n value={{ apiKey, config, modals, setModals, navigate: navigateHandler }}\n >\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Interpolation } from '@emotion/react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Dot } from './Dot'\nimport { Flex } from '../Flex/Flex'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToPopoverProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n css?: Interpolation<Record<any, any>>\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n className,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToPopoverProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div className={className} css={{ position: 'absolute', zIndex: 9999 }}>\n {spotlight && (\n <Box\n borderRadius={anchorRadius}\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Flex.Column\n backgroundColor=\"neutral.background\"\n borderRadius=\"md\"\n p={5}\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Flex.Column>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = (props: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '12px',\n right: '4px',\n }}\n part=\"tooltip-close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToPopoverProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps.alignOffset = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { Flow, Frigade } from '@frigade/js'\nimport { useContext, useEffect, useRef, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFlow(flowId: string) {\n const [flow, setFlow] = useState<Flow>()\n const { apiKey, config } = useContext(FrigadeContext)\n const filteredConfig = Object.fromEntries(\n Object.entries(config).filter(([k, v]) => ['apiUrl', 'userId'].includes(k) && v != null)\n )\n\n const frigadeRef = useRef(new Frigade(apiKey, filteredConfig))\n const frigade = frigadeRef.current\n\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n const clonedFlow = Object.assign(Object.create(Object.getPrototypeOf(updatedFlow)), updatedFlow)\n\n setFlow(clonedFlow)\n }\n\n useEffect(() => {\n ;(async () => {\n const flowResponse: Flow = await frigade.getFlow(flowId)\n\n setFlow(flowResponse)\n })()\n\n frigade.onStateChange(handler)\n\n return () => {\n frigade.removeStateChangeHandler(handler)\n }\n }, [])\n\n return { flow }\n}\n","import { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useModal(flowId: string) {\n const { modals, setModals } = useContext(FrigadeContext)\n const [isCurrentModal, setIsCurrentModal] = useState(false)\n\n useEffect(() => {\n setModals([...modals, flowId])\n\n return () => setModals(modals.filter((v) => v !== flowId))\n }, [])\n\n useEffect(() => {\n const newIsCurrentModal = modals[0] === flowId\n\n if (newIsCurrentModal !== isCurrentModal) {\n setIsCurrentModal(newIsCurrentModal)\n }\n }, [modals])\n\n return {\n isCurrentModal,\n }\n}\n","import { MouseEvent, useCallback, useEffect, useRef } from 'react'\n\nimport { Flow } from '@frigade/js'\n\nexport type FlowHandler = (flow: Flow, event?: MouseEvent<unknown>) => boolean | void\n\nexport interface StepHandlers {\n onComplete?: FlowHandler\n onDismiss?: FlowHandler\n}\n\nexport function useFlowHandlers(flow: Flow, { onComplete, onDismiss }: StepHandlers = {}) {\n const lastCompleted = useRef(null)\n\n useEffect(() => {\n if (flow == null) return\n\n if (flow.isCompleted && lastCompleted.current === false) {\n onComplete(flow)\n }\n\n lastCompleted.current = flow?.isCompleted\n }, [flow?.isCompleted])\n\n return {\n handleDismiss: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = onDismiss?.(flow, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n await flow.skip()\n },\n [flow]\n ),\n }\n}\n","import { MouseEvent, useCallback, useContext } from 'react'\n\nimport type { FlowStep } from '@frigade/js'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport type StepHandler = (step: FlowStep, event?: MouseEvent<unknown>) => boolean | void\n\nexport interface StepHandlers {\n onPrimary?: StepHandler\n onSecondary?: StepHandler\n}\n\nexport function useStepHandlers(step: FlowStep, { onPrimary, onSecondary }: StepHandlers = {}) {\n const { navigate } = useContext(FrigadeContext)\n\n return {\n handlePrimary: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = onPrimary?.(step, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n await step.complete()\n\n if (step.primaryButtonUri != null) {\n navigate(step.primaryButtonUri, step.primaryButtonUriTarget)\n }\n },\n [step]\n ),\n\n handleSecondary: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = onSecondary?.(step, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n // Should there be a step.skip method?\n await step.complete()\n\n if (step.secondaryButtonUri != null) {\n navigate(step.secondaryButtonUri, step.secondaryButtonUriTarget)\n }\n },\n [step]\n ),\n }\n}\n","import type { Flow, FlowStep } from '@frigade/js'\n\nimport { TourProps } from '.'\nimport { useModal } from '../../hooks/useModal'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { useStepHandlers } from '../../hooks/useStepHandlers'\n\nimport { Flex } from '../Flex/Flex'\nimport { Tooltip } from '../Tooltip'\n\nexport interface TourStepProps extends Omit<TourProps, 'flowId'> {\n step: FlowStep\n flow: Flow\n}\n\nexport function TourStep({\n step,\n flow,\n onDismiss,\n onPrimary,\n onSecondary,\n ...props\n}: TourStepProps) {\n const { isCurrentModal } = useModal(`${flow.id}-${step.id}`)\n\n const { handleDismiss } = useFlowHandlers(flow, {\n onDismiss,\n })\n\n const { handlePrimary, handleSecondary } = useStepHandlers(step, {\n onPrimary,\n onSecondary,\n })\n\n if (!isCurrentModal) return null\n\n return (\n <Tooltip\n key={step.id}\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row alignItems=\"center\" gap={3} justifyContent=\"flex-end\" part=\"tooltip-footer\" pt={4}>\n <Tooltip.Progress>{`${step?.order + 1}/${flow.steps.size}`}</Tooltip.Progress>\n\n <Tooltip.Secondary\n marginLeft=\"auto\"\n title={step.secondaryButtonTitle}\n onClick={handleSecondary}\n />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Tooltip>\n )\n}\n","import type { Flow } from '@frigade/js'\n\nimport { useFlow } from '../../hooks/useFlow'\nimport { TooltipProps } from '../Tooltip'\nimport { TourStep } from './TourStep'\n\nimport { FlowHandler, useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { StepHandler } from '../../hooks/useStepHandlers'\n\nexport interface TourProps extends TooltipProps {\n flowId: string\n onComplete?: FlowHandler\n onDismiss?: FlowHandler\n onPrimary?: StepHandler\n onSecondary?: StepHandler\n}\n\nexport function Tour({ flowId, onComplete, ...props }: TourProps) {\n const { flow } = useFlow(flowId)\n useFlowHandlers(flow, { onComplete })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n step?.start()\n\n return <TourStep step={step} flow={flow} {...props} />\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frigade/react",
3
- "version": "2.0.0-alpha.5",
3
+ "version": "2.0.0-alpha.7",
4
4
  "description": "Build better product onboarding, faster.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",