@frigade/react 2.0.0-alpha.26 → 2.0.0-alpha.27
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 +21 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +878 -83
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as
|
|
2
|
+
import * as y from '@radix-ui/react-dialog';
|
|
3
3
|
import { XMarkIcon } from '@heroicons/react/24/solid';
|
|
4
4
|
import * as N from 'react';
|
|
5
5
|
import { createContext, useState, useRef, useContext, useEffect, useCallback, useLayoutEffect } from 'react';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
|
-
import Je from '
|
|
7
|
+
import Je from 'known-css-properties';
|
|
8
|
+
import et from 'dompurify';
|
|
8
9
|
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
9
10
|
import { keyframes, Global, ThemeProvider } from '@emotion/react';
|
|
10
11
|
import { Frigade } from '@frigade/js';
|
|
11
|
-
import * as
|
|
12
|
+
import * as S from '@radix-ui/react-popover';
|
|
12
13
|
|
|
13
|
-
var je=Object.defineProperty;var Ue=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var te=(e,t)=>{for(var o in t)je(e,o,{get:t[o],enumerable:!0});};var oe={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var re={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"};var ne={md:"10px",lg:"20px",round:"50%"};var a=e=>`var(--fr-colors-${e})`,ie={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 ae={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var _e="px",Ke=e=>typeof e=="number"?`${4*e}${_e}`:e,Ne=[-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"],se=Object.fromEntries(Ne.map(e=>[e,Ke(e)]));var le={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"}};var z={...oe,colors:{...re,...ie},...le,radii:ne,shadows:ae,space:se};function E(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let i=`${t.length?`${t}${o}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,E(l,i,o)):r[i]=l,r},{})}function j(e){return E(e,"--fr","-")}function pe(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]=pe(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var ce=j(z),p=pe(z);var U=E(p.colors),de={color:U,backgroundColor:U,borderColor:U,border:p.borders,borderRadius:p.radii,borderWidth:p.borderWidths,boxShadow:p.shadows,fontFamily:p.fontFamilies,fontSize:p.fontSizes,fontWeight:p.fontWeights,gap:p.space,lineHeight:p.lineHeights,margin:p.space,marginTop:p.space,marginRight:p.space,marginBottom:p.space,marginLeft:p.space,padding:p.space,paddingTop:p.space,paddingRight:p.space,paddingBottom:p.space,paddingLeft:p.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"],textAlign:["center","end","start","right","left","justify","inherit","initial","revert","revert-layer","unset"]},ue={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 Xe(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 Ge=new Map(Object.entries(de).map(([e,t])=>[e,Xe(t)])),qe=new Map(Object.entries(ue).map(([e,t])=>[e,new Set(t)]));function fe(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let s=qe.get(r);s!=null&&(s.forEach(i=>{t[i]=n;}),delete t[r]);}),Object.entries(t).forEach(([r,n])=>{let s=Ge.get(r);if(s!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let i=n.split(" ");o[r]=i.map(l=>s.get(l.toString())??l).join(" "),delete t[r];}else s.has(n.toString())&&(o[r]=s.get(n.toString()),delete t[r]);}),{cssFromProps:o,unmatchedProps:t}}function Ye(){if(typeof window>"u"){let{JSDOM:e}=Ue("jsdom");return new e("<!DOCTYPE html>").window}return window}function me(e){return e?{__html:Je(Ye()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function ge(e){return e&&`fr-${e}`}function Ze(e){return e&&(Array.isArray(e)?e.map(t=>ge(t)).join(" "):ge(e))}function et({as:e,children:t,className:o,css:r,part:n,...s},i){let l=e??"div",{cssFromProps:c,unmatchedProps:u}=fe(s),m=Ze(n),S=o||m?clsx(o,m):void 0,M=[{boxSizing:"border-box"},c,r];return typeof t=="string"?jsx(l,{className:S,css:M,...u,ref:i,dangerouslySetInnerHTML:me(t)}):jsx(l,{className:S,css:M,...u,ref:i,children:t})}var d=N.forwardRef(et);var _={};te(_,{Body1:()=>st,Body2:()=>lt,Caption:()=>pt,Display1:()=>tt,Display2:()=>ot,H1:()=>rt,H2:()=>nt,H3:()=>it,H4:()=>at});var v={color:"neutral.foreground",fontFamily:"default",margin:0},tt={...v,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},ot={...v,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},rt={...v,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},nt={...v,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},it={...v,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},at={...v,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},st={...v,fontSize:"md",fontWeight:"regular",lineHeight:"md"},lt={...v,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},pt={...v,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function ye({as:e="span",children:t,variant:o="Body1",...r}){return jsx(d,{as:e,..._[o],...r,children:t})}var ct=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],dt=Object.fromEntries(ct.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsx(ye,{as:t,...r,variant:e,children:r.children});return o.displayName=`Text.${e}`,[e,o]})),h=Object.assign(ye,dt);var K={};te(K,{Link:()=>mt,Plain:()=>gt,Primary:()=>ut,Secondary:()=>ft,base:()=>I});var I=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),ut=({colors:e})=>[I,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],ft=({colors:e})=>[I,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],mt=({colors:e})=>[I,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],gt=({colors:e})=>[I,{backgroundColor:e.transparent,color:e.neutral.foreground}];function Pe({as:e,children:t,title:o,variant:r="Primary",...n}){return jsxs(d,{as:e??"button",css:K[r],...n,children:[t,o&&jsx(h.Body2,{fontWeight:"demibold",color:"inherit",children:o})]})}var xt=["Primary","Secondary","Link","Plain"],bt=Object.fromEntries(xt.map(e=>{let t=e.toLocaleLowerCase(),o=({part:r,...n})=>jsx(Pe,{part:[`button-${t}`,r],...n,variant:e,children:n.children});return o.displayName=`Text.${e}`,[e,o]})),P=Object.assign(Pe,bt);var ht=N.forwardRef(({children:e,css:t,...o},r)=>jsx(d,{css:[{display:"flex",flexDirection:"row"},t],...o,ref:r,children:e})),Pt=N.forwardRef(({children:e,css:t,...o},r)=>jsx(d,{css:[{display:"flex",flexDirection:"column"},t],...o,ref:r,children:e})),C={Column:Pt,Row:ht};var R=N.forwardRef(({as:e,children:t,...o},r)=>{let n=e??C.Column;return jsx(n,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...o,ref:r,children:t})});function Te({part:e,src:t,...o}){return jsx(d,{as:"img",part:["image",e],src:t,...o})}function vt(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 Be({part:e,src:t,...o}){let r=vt(t);return jsx(d,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:r,...o})}function V({src:e,type:t,...o}){return jsx(t==="video"?Be:Te,{src:e,...o})}function x({children:e,...t}){return jsx(b.Root,{defaultOpen:!0,modal:!0,children:jsxs(b.Portal,{children:[jsx(b.Overlay,{style:{background:"rgb(0 0 0 / 0.5)",position:"fixed",inset:0}}),jsx(b.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsx(R,{boxShadow:"md",css:{left:"50%",maxWidth:430,top:"50%",transform:"translate(-50%, -50%)"},p:8,position:"fixed",textAlign:"center",...t,children:e})})]})})}x.Close=e=>jsx(b.Close,{"aria-label":"Close",asChild:!0,children:jsx(P.Plain,{css:{top:"4px",right:"-4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});x.Subtitle=({children:e,...t})=>jsx(b.Description,{asChild:!0,children:jsx(h.Body2,{part:"subtitle",mb:5,...t,children:e})});x.Media=({src:e,...t})=>e==null?null:jsx(V,{borderRadius:"md",src:e,...t});x.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(P.Primary,{title:t,onClick:e,...o});x.ProgressDots=({current:e,total:t})=>{let o=[...Array(t)].map((r,n)=>jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?p.colors.blue500:p.colors.blue800},n));return jsx(d,{as:"svg",width:16*t-8,height:"8px",viewBox:`0 0 ${16*t-8} 8`,margin:"5 auto",children:o})};x.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(P.Secondary,{title:t,onClick:e,...o});x.Title=({children:e,...t})=>jsx(b.Title,{asChild:!0,children:jsx(h.H3,{mb:1,part:"title",...t,children:e})});var T=createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function At({children:e,navigate:t,theme:o,...r}){let n=o?j(o):{},[s,i]=useState([]),l=useRef(new Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId})),c=t??((u,m="_self")=>{window.open(u,m);});return jsxs(T.Provider,{value:{modals:s,setModals:i,navigate:c,...r,frigade:l.current},children:[jsx(Global,{styles:{":root":{...ce,...n}}}),jsx(ThemeProvider,{theme:p,children:e})]})}function F(e,t){let[o,r]=useState(),[n,s]=useState(""),{frigade:i}=useContext(T),l=c=>{c.id===e&&(t!=null&&t.variables&&c.applyVariables(t.variables),r(c),s(Math.random().toString()));};return useEffect(()=>((async()=>{let c=await i.getFlow(e);t!=null&&t.variables&&c.applyVariables(t.variables),r(c);})(),i.onStateChange(l),()=>{i.removeStateChangeHandler(l);}),[]),{flow:o}}function B(e,{onComplete:t,onDismiss:o}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&(async()=>await(t==null?void 0:t(e)))(),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function k(e,{onPrimary:t,onSecondary:o}={}){let{navigate:r}=useContext(T);return {handlePrimary:useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function jt({flowId:e,onComplete:t,onDismiss:o,onPrimary:r,onSecondary:n,variables:s}){let{flow:i}=F(e,{variables:s}),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:c}=B(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:m}=k(l,{onPrimary:r,onSecondary:n});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxs(x,{children:[jsx(x.Close,{onClick:c}),jsx(x.Title,{children:l.title}),jsx(x.Subtitle,{children:l.subtitle}),jsx(x.Media,{src:l.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(x.ProgressDots,{current:i.getNumberOfCompletedSteps(),total:i.getNumberOfAvailableSteps()}),jsxs(C.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsx(x.Secondary,{title:"Secondary",onClick:m}),jsx(x.Primary,{title:"Primary",onClick:u})]})]}))}function _t({flowId:e,onComplete:t,onDismiss:o,onPrimary:r,onSecondary:n,...s}){let{flow:i}=F(e),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:c}=B(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:m}=k(l,{onPrimary:r,onSecondary:n});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxs(R,{as:C.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...s,children:[jsxs(C.Row,{gap:3,children:[jsx("img",{src:l.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(C.Column,{children:[jsx(h.H4,{mb:1,children:l.title}),jsx(h.Body2,{children:l.subtitle})]})]}),jsxs(C.Row,{alignItems:"center",gap:3,children:[jsx(P.Secondary,{title:l.secondaryButtonTitle,onClick:m}),jsx(P.Primary,{title:l.primaryButtonTitle,onClick:u}),jsx(P.Plain,{part:"banner-close",onClick:c,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function X(){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(i=>{n(i);},[]);return useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:s}}var Gt=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function He({style:e={},part:t="",...o}){return jsxs(d,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsx(d,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Gt}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(d,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Me({props:e,alignAttr:t,sideAttr:o}){let r=o??"bottom",n={},s=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},i="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=i;let c=s();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=i:n.bottom=i:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=i:n.top=i:["top","bottom"].includes(r)?n.left=`calc(50% + ${i})`:n.top=`calc(50% + ${i})`,n}var Ae={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Ee(e,t){let o=Object.fromEntries(Ae.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r=Object.fromEntries(Ae.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let n={after:"end",before:"start"},s=(S,M)=>["top","bottom"].includes(M)?S=="after"?"marginLeft":"marginRight":S=="after"?"marginTop":"marginBottom",i=o.alignOffset??0,l=o.style??{},c=o.side??"bottom",u=o.align;o.style={...l,[s(u,c)]:i};let m=["top","bottom"].includes(c)?t.width:t.height;o.alignOffset=(m+i)*-1,o.align=n[u];}return {contentProps:o,rootProps:r}}function f({anchor:e,children:t,className:o,spotlight:r=!1,style:n,...s}){let{node:i,rect:l,ref:c}=X(),{contentProps:u,rootProps:m}=Ee(s,l),[S,M]=useState(u.align),[Y,$e]=useState(u.side);if(i!==null){let A=i.getAttribute("data-align"),ee=i.getAttribute("data-side");S!==A&&M(A),Y!==ee&&$e(ee);}let Q=useRef(null),[W,Le]=useState(null);if(useEffect(()=>{let A=document.querySelector(e);A!=null&&(Q.current=A,Le(Q));},[e]),W==null)return null;let $=W.current.getBoundingClientRect(),Z="0";typeof window<"u"&&(Z=window.getComputedStyle(W.current).borderRadius);let ze=Me({props:s,alignAttr:S,sideAttr:Y});return jsxs(w.Root,{defaultOpen:!0,...m,children:[jsx(w.Anchor,{virtualRef:W}),jsx(w.Portal,{children:jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[r&&jsx(d,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:Z,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:$.height,left:$.left,top:$.top,width:$.width}}),jsx(w.Content,{asChild:!0,...u,ref:c,children:jsxs(R,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...n},children:[jsx(He,{style:ze}),t]})})]})})]})}f.Close=e=>jsx(w.Close,{"aria-label":"Close",asChild:!0,children:jsx(P.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});f.Media=({src:e,...t})=>e==null?null:jsx(V,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});f.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(P.Primary,{title:t,onClick:e,...o});f.Progress=({children:e,...t})=>e==null?null:jsx(h.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});f.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(P.Secondary,{title:t,onClick:e,...o});f.Subtitle=({children:e,...t})=>e==null?null:jsx(h.Body2,{part:"subtitle",...t,children:e});f.Title=({children:e,...t})=>e==null?null:jsx(h.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function J(e){let{modals:t,setModals:o}=useContext(T),[r,n]=useState(!1);return useEffect(()=>(o([...t,e]),()=>o(t.filter(s=>s!==e))),[]),useEffect(()=>{let s=t[0]===e;s!==r&&n(s);},[t]),{isCurrentModal:r}}function We({step:e,flow:t,onDismiss:o,onPrimary:r,onSecondary:n,...s}){let{isCurrentModal:i}=J(`${t.id}-${e.id}`),{handleDismiss:l}=B(t,{onDismiss:o}),{handlePrimary:c,handleSecondary:u}=k(e,{onPrimary:r,onSecondary:n});return i?jsxs(f,{anchor:e.selector,onOpenAutoFocus:m=>m.preventDefault(),onPointerDownOutside:m=>m.preventDefault(),...s,children:[jsx(f.Close,{onClick:l}),jsx(f.Media,{src:e.videoUri??e.imageUri,type:e.videoUri?"video":"image"}),jsx(f.Title,{children:e.title}),jsx(f.Subtitle,{children:e.subtitle}),jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsx(f.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsx(f.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:u}),jsx(f.Primary,{title:e.primaryButtonTitle,onClick:c})]})]},e.id):null}function to({flowId:e,onComplete:t,variables:o,...r}){let{flow:n}=F(e,{variables:o});if(B(n,{onComplete:t}),n==null||n.isVisible===!1)return null;n.start();let s=n.getCurrentStep();return s==null||s.start(),jsx(We,{step:s,flow:n,...r})}function no(){let{frigade:e}=useContext(T);return {frigade:e}}
|
|
14
|
+
var Ke=Object.defineProperty;var je=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var te=(e,t)=>{for(var o in t)Ke(e,o,{get:t[o],enumerable:!0});};var oe={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var re={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"};var ne={md:"10px",lg:"20px",round:"50%"};var s=e=>`var(--fr-colors-${e})`,ie={neutral:{background:s("white"),border:s("gray500"),foreground:s("black"),surface:s("gray700"),active:{background:s("white"),border:s("gray900"),foreground:s("black"),surface:s("gray700")},focus:{background:s("white"),border:s("gray900"),foreground:s("black"),surface:s("gray700")},hover:{background:s("white"),border:s("gray900"),foreground:s("black"),surface:s("gray700")}},primary:{background:s("blue500"),border:s("blue500"),foreground:s("white"),surface:s("blue500"),active:{background:s("blue400"),border:s("blue400"),foreground:s("white"),surface:s("blue400")},focus:{background:s("blue500"),border:s("blue500"),foreground:s("white"),surface:s("blue500")},hover:{background:s("blue400"),border:s("blue400"),foreground:s("white"),surface:s("blue400")}},secondary:{background:s("gray900"),border:s("gray900"),foreground:s("black"),surface:s("gray900"),active:{background:s("gray800"),border:s("gray800"),foreground:s("black"),surface:s("gray800")},focus:{background:s("gray900"),border:s("gray900"),foreground:s("black"),surface:s("gray900")},hover:{background:s("gray800"),border:s("gray800"),foreground:s("black"),surface:s("gray800")}}};var se={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ue="px",_e=e=>typeof e=="number"?`${4*e}${Ue}`:e,Ne=[-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"],ae=Object.fromEntries(Ne.map(e=>[e,_e(e)]));var le={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"}};var z={...oe,colors:{...re,...ie},...le,radii:ne,shadows:se,space:ae};function A(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let i=`${t.length?`${t}${o}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,A(l,i,o)):r[i]=l,r},{})}function K(e){return A(e,"--fr","-")}function pe(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]=pe(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var de=K(z),p=pe(z);var Xe=Je.all.filter(e=>e.indexOf("-")!=0).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),Ge=Object.fromEntries(Xe),j=A(p.colors),qe={color:j,backgroundColor:j,borderColor:j,border:p.borders,borderRadius:p.radii,borderWidth:p.borderWidths,boxShadow:p.shadows,fontFamily:p.fontFamilies,fontSize:p.fontSizes,fontWeight:p.fontWeights,gap:p.space,lineHeight:p.lineHeights,margin:p.space,marginBottom:p.space,marginLeft:p.space,marginRight:p.space,marginTop:p.space,padding:p.space,paddingBottom:p.space,paddingLeft:p.space,paddingRight:p.space,paddingTop:p.space},ce={...Ge,...qe},ue={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 Ye(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):["string","number"].includes(typeof e)?new Map([e,e]):new Map}var Qe=new Map(Object.entries(ce).map(([e,t])=>[e,Ye(t)])),Ze=new Map(Object.entries(ue).map(([e,t])=>[e,new Set(t)]));function me(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let a=Ze.get(r);a!=null&&(a.forEach(i=>{t[i]=n;}),delete t[r]);}),Object.entries(t).forEach(([r,n])=>{let a=Qe.get(r);if(a!=null){if(typeof n=="string"&&n.indexOf(" ")>-1){let i=n.split(" ");o[r]=i.map(l=>a.get(l.toString())??l).join(" ");}else a.has(n.toString())?o[r]=a.get(n.toString()):o[r]=n;delete t[r];}}),{cssFromProps:o,unmatchedProps:t}}function tt(){if(typeof window>"u"){let{JSDOM:e}=je("jsdom");return new e("<!DOCTYPE html>").window}return window}function fe(e){return e?{__html:et(tt()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function rt(e){return e&&`fr-${e}`}function ye(e){return e&&(Array.isArray(e)?e.map(t=>ye(t)).join(" "):rt(e))}function nt({as:e,children:t,className:o,css:r,part:n,...a},i){let l=e??"div",{cssFromProps:d,unmatchedProps:u}=me(a),f=ye(n),R=o||f?clsx(o,f):void 0,M=[{boxSizing:"border-box"},d,r];return typeof t=="string"?jsx(l,{className:R,css:M,...u,ref:i,dangerouslySetInnerHTML:fe(t)}):jsx(l,{className:R,css:M,...u,ref:i,children:t})}var c=N.forwardRef(nt);var U={};te(U,{Body1:()=>ct,Body2:()=>ut,Caption:()=>mt,Display1:()=>it,Display2:()=>st,H1:()=>at,H2:()=>lt,H3:()=>pt,H4:()=>dt});var C={color:"neutral.foreground",fontFamily:"default",margin:"0"},it={...C,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},st={...C,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},at={...C,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},lt={...C,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},pt={...C,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},dt={...C,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},ct={...C,fontSize:"md",fontWeight:"regular",lineHeight:"md"},ut={...C,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},mt={...C,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function Pe({as:e="span",children:t,variant:o="Body1",...r}){return jsx(c,{as:e,...U[o],...r,children:t})}var ft=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],gt=Object.fromEntries(ft.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsx(Pe,{as:t,...r,variant:e,children:r.children});return o.displayName=`Text.${e}`,[e,o]})),h=Object.assign(Pe,gt);var _={};te(_,{Link:()=>Pt,Plain:()=>ht,Primary:()=>xt,Secondary:()=>yt,base:()=>$});var $=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),xt=({colors:e})=>[$,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],yt=({colors:e})=>[$,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],Pt=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],ht=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.neutral.foreground}];function be({as:e,children:t,part:o,title:r,variant:n="Primary",...a}){let i=n.toLocaleLowerCase();return jsxs(c,{as:e??"button",css:_[n],part:[`button-${i}`,o],...a,children:[t,r&&jsx(h.Body2,{fontWeight:"demibold",color:"inherit",children:r})]})}var bt=["Primary","Secondary","Link","Plain"],Tt=Object.fromEntries(bt.map(e=>{let t=o=>jsx(be,{...o,variant:e,children:o.children});return t.displayName=`Text.${e}`,[e,t]})),b=Object.assign(be,Tt);var Ct=N.forwardRef(({children:e,css:t,...o},r)=>jsx(c,{css:[{display:"flex",flexDirection:"row"},t],...o,ref:r,children:e})),Bt=N.forwardRef(({children:e,css:t,...o},r)=>jsx(c,{css:[{display:"flex",flexDirection:"column"},t],...o,ref:r,children:e})),T={Column:Bt,Row:Ct};var v=N.forwardRef(({as:e,children:t,...o},r)=>{let n=e??T.Column;return jsx(n,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...o,ref:r,children:t})});function Be({part:e,src:t,...o}){return jsx(c,{as:"img",part:["image",e],src:t,...o})}function vt(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({part:e,src:t,...o}){let r=vt(t);return jsx(c,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:r,...o})}function W({src:e,type:t,...o}){return jsx(t==="video"?we:Be,{src:e,...o})}function x({children:e,...t}){return jsx(y.Root,{defaultOpen:!0,modal:!0,children:jsxs(y.Portal,{children:[jsx(y.Overlay,{style:{background:"rgb(0 0 0 / 0.5)",position:"fixed",inset:0}}),jsx(y.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsx(v,{boxShadow:"md",css:{left:"50%",maxWidth:430,top:"50%",transform:"translate(-50%, -50%)"},p:8,position:"fixed",textAlign:"center",...t,children:e})})]})})}x.Close=e=>jsx(y.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{css:{top:"4px",right:"-4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});x.Subtitle=({children:e,...t})=>jsx(y.Description,{asChild:!0,children:jsx(h.Body2,{part:"subtitle",mb:5,...t,children:e})});x.Media=({src:e,...t})=>e==null?null:jsx(W,{borderRadius:"md",src:e,...t});x.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Primary,{title:t,onClick:e,...o});x.ProgressDots=({current:e,total:t})=>{let o=[...Array(t)].map((r,n)=>jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?p.colors.blue500:p.colors.blue800},n));return jsx(c,{as:"svg",width:16*t-8,height:"8px",viewBox:`0 0 ${16*t-8} 8`,margin:"5 auto",children:o})};x.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Secondary,{title:t,onClick:e,...o});x.Title=({children:e,...t})=>jsx(y.Title,{asChild:!0,children:jsx(h.H3,{mb:1,part:"title",...t,children:e})});var B=createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function It({children:e,navigate:t,theme:o,...r}){let n=o?K(o):{},[a,i]=useState([]),l=useRef(new Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId})),d=t??((u,f="_self")=>{window.open(u,f);});return jsxs(B.Provider,{value:{modals:a,setModals:i,navigate:d,...r,frigade:l.current},children:[jsx(Global,{styles:{":root":{...de,...n}}}),jsx(ThemeProvider,{theme:p,children:e})]})}function F(e,t){let[o,r]=useState(),[n,a]=useState(""),{frigade:i}=useContext(B),l=d=>{d.id===e&&(t!=null&&t.variables&&d.applyVariables(t.variables),r(d),a(Math.random().toString()));};return useEffect(()=>((async()=>{let d=await i.getFlow(e);t!=null&&t.variables&&d.applyVariables(t.variables),r(d);})(),i.onStateChange(l),()=>{i.removeStateChangeHandler(l);}),[]),{flow:o}}function w(e,{onComplete:t,onDismiss:o}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&(async()=>await(t==null?void 0:t(e)))(),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function k(e,{onPrimary:t,onSecondary:o}={}){let{navigate:r}=useContext(B);return {handlePrimary:useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function Nt({flowId:e,onComplete:t,onDismiss:o,onPrimary:r,onSecondary:n,variables:a}){let{flow:i}=F(e,{variables:a}),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:d}=w(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:f}=k(l,{onPrimary:r,onSecondary:n});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxs(x,{children:[jsx(x.Close,{onClick:d}),jsx(x.Title,{children:l.title}),jsx(x.Subtitle,{children:l.subtitle}),jsx(x.Media,{src:l.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(x.ProgressDots,{current:i.getNumberOfCompletedSteps(),total:i.getNumberOfAvailableSteps()}),jsxs(T.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsx(x.Secondary,{title:"Secondary",onClick:f}),jsx(x.Primary,{title:"Primary",onClick:u})]})]}))}function Xt({flowId:e,onComplete:t,onDismiss:o,onPrimary:r,onSecondary:n,...a}){let{flow:i}=F(e),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:d}=w(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:f}=k(l,{onPrimary:r,onSecondary:n});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxs(v,{as:T.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...a,children:[jsxs(T.Row,{gap:3,children:[jsx("img",{src:l.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(T.Column,{children:[jsx(h.H4,{mb:1,children:l.title}),jsx(h.Body2,{children:l.subtitle})]})]}),jsxs(T.Row,{alignItems:"center",gap:3,children:[jsx(b.Secondary,{title:l.secondaryButtonTitle,onClick:f}),jsx(b.Primary,{title:l.primaryButtonTitle,onClick:u}),jsx(b.Plain,{part:"banner-close",onClick:d,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function J(){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),a=useCallback(i=>{n(i);},[]);return useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:a}}var Qt=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function He({style:e={},part:t="",...o}){return jsxs(c,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsx(c,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Qt}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(c,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Me({props:e,alignAttr:t,sideAttr:o}){let r=o??"bottom",n={},a=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},i="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=i;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(r)?n.right=i:n.bottom=i:["after","start"].includes(d)?["top","bottom"].includes(r)?n.left=i:n.top=i:["top","bottom"].includes(r)?n.left=`calc(50% + ${i})`:n.top=`calc(50% + ${i})`,n}var Ee={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Ae(e,t){let o=Object.fromEntries(Ee.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r=Object.fromEntries(Ee.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let n={after:"end",before:"start"},a=(R,M)=>["top","bottom"].includes(M)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",i=o.alignOffset??0,l=o.style??{},d=o.side??"bottom",u=o.align;o.style={...l,[a(u,d)]:i};let f=["top","bottom"].includes(d)?t.width:t.height;o.alignOffset=(f+i)*-1,o.align=n[u];}return {contentProps:o,rootProps:r}}function m({anchor:e,children:t,className:o,spotlight:r=!1,style:n,...a}){let{node:i,rect:l,ref:d}=J(),{contentProps:u,rootProps:f}=Ae(a,l),[R,M]=useState(u.align),[Y,Ve]=useState(u.side);if(i!==null){let E=i.getAttribute("data-align"),ee=i.getAttribute("data-side");R!==E&&M(E),Y!==ee&&Ve(ee);}let Q=useRef(null),[I,Le]=useState(null);if(useEffect(()=>{let E=document.querySelector(e);E!=null&&(Q.current=E,Le(Q));},[e]),I==null)return null;let V=I.current.getBoundingClientRect(),Z="0";typeof window<"u"&&(Z=window.getComputedStyle(I.current).borderRadius);let ze=Me({props:a,alignAttr:R,sideAttr:Y});return jsxs(S.Root,{defaultOpen:!0,...f,children:[jsx(S.Anchor,{virtualRef:I}),jsx(S.Portal,{children:jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[r&&jsx(c,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:Z,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:V.height,left:V.left,top:V.top,width:V.width}}),jsx(S.Content,{asChild:!0,...u,ref:d,children:jsxs(v,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...n},children:[jsx(He,{style:ze}),t]})})]})})]})}m.Close=e=>jsx(S.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});m.Media=({src:e,...t})=>e==null?null:jsx(W,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});m.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Primary,{title:t,onClick:e,...o});m.Progress=({children:e,...t})=>e==null?null:jsx(h.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});m.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Secondary,{title:t,onClick:e,...o});m.Subtitle=({children:e,...t})=>e==null?null:jsx(h.Body2,{part:"subtitle",...t,children:e});m.Title=({children:e,...t})=>e==null?null:jsx(h.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function q(e){let{modals:t,setModals:o}=useContext(B),[r,n]=useState(!1);return useEffect(()=>(o([...t,e]),()=>o(t.filter(a=>a!==e))),[]),useEffect(()=>{let a=t[0]===e;a!==r&&n(a);},[t]),{isCurrentModal:r}}function Ie({step:e,flow:t,onDismiss:o,onPrimary:r,onSecondary:n,...a}){let{isCurrentModal:i}=q(`${t.id}-${e.id}`),{handleDismiss:l}=w(t,{onDismiss:o}),{handlePrimary:d,handleSecondary:u}=k(e,{onPrimary:r,onSecondary:n});return i?jsxs(m,{anchor:e.selector,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),...a,children:[jsx(m.Close,{onClick:l}),jsx(m.Media,{src:e.videoUri??e.imageUri,type:e.videoUri?"video":"image"}),jsx(m.Title,{children:e.title}),jsx(m.Subtitle,{children:e.subtitle}),jsxs(T.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsx(m.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsx(m.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:u}),jsx(m.Primary,{title:e.primaryButtonTitle,onClick:d})]})]},e.id):null}function io({flowId:e,onComplete:t,variables:o,...r}){let{flow:n}=F(e,{variables:o});if(w(n,{onComplete:t}),n==null||n.isVisible===!1)return null;n.start();let a=n.getCurrentStep();return a==null||a.start(),jsx(Ie,{step:a,flow:n,...r})}function lo(){let{frigade:e}=useContext(B);return {frigade:e}}
|
|
14
15
|
|
|
15
|
-
export {
|
|
16
|
+
export { Nt as Announcement, Xt as Banner, c as Box, b as Button, v as Card, T as Flex, It as Provider, h as Text, m as Tooltip, io as Tour, J as useBoundingClientRect, F as useFlow, w as useFlowHandlers, lo as useFrigade, q as useModal, k as useStepHandlers };
|
|
16
17
|
//# sourceMappingURL=out.js.map
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Dialog/index.tsx","../src/components/Box/index.tsx","../src/shared/tokens/borders.ts","../src/shared/tokens/palette.ts","../src/shared/tokens/radii.ts","../src/shared/tokens/semantic.ts","../src/shared/tokens/shadows.ts","../src/shared/tokens/space.ts","../src/shared/tokens/typography.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/shared/sanitize.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/Card/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/hooks/useFlow.ts","../src/components/Provider/index.tsx","../src/hooks/useFlowHandlers.ts","../src/hooks/useStepHandlers.ts","../src/components/Announcement/index.tsx","../src/components/Banner/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useModal.ts","../src/components/Tour/TourStep.tsx","../src/components/Tour/index.tsx","../src/hooks/useFrigade.ts"],"names":["RadixDialog","XMarkIcon","React","clsx","borders","palette","radii","colorVar","colorName","semantic","shadows","SPACE_UNIT","spaceValue","key","spaceKeys","space","typography","tokens","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","DOMPurify","getWindow","JSDOM","sanitize","dirty","jsx","prefixPart","part","processPart","p","BoxWithRef","as","children","className","css","ref","Component","processedPart","classNameWithPart","cssProp","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","colors","jsxs","BaseButton","title","buttonVariantNames","buttonVariantComponents","variantPart","Button","Row","Column","Flex","Card","Image","src","getVideoEmbedSrc","videoUri","_a","_b","_c","Video","videoEmbedSrc","Media","type","Dialog","e","onClick","current","total","dots","_","i","useContext","useEffect","useState","createContext","useRef","Global","ThemeProvider","Frigade","FrigadeContext","Provider","navigate","themeOverrides","modals","setModals","frigade","navigateHandler","url","target","useFlow","flowId","config","flow","setFlow","setRandomString","handler","updatedFlow","flowInstance","useCallback","useFlowHandlers","onComplete","onDismiss","lastCompleted","useStepHandlers","step","onPrimary","onSecondary","Announcement","variables","handleDismiss","handlePrimary","handleSecondary","Banner","Popover","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToPopoverProps","contentRect","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","useModal","isCurrentModal","setIsCurrentModal","newIsCurrentModal","TourStep","Tour","useFrigade"],"mappings":"2VAAA,UAAYA,MAAiB,yBAC7B,OAAS,aAAAC,OAAiB,4BCD1B,UAAYC,OAAW,QACvB,OAAS,QAAAC,OAAY,OCDd,IAAMC,GAAU,CACrB,QAAS,CACP,GAAI,WACN,EACA,aAAc,CACZ,EAAG,IACH,GAAI,KACN,CACF,ECRO,IAAMC,GAAU,CACrB,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QA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DE,GAAa,CACxB,MAAOD,EACP,gBAAiBA,EACjB,YAAaA,EACb,OAAQD,EAAM,QACd,aAAcA,EAAM,MACpB,YAAaA,EAAM,aACnB,UAAWA,EAAM,QAEjB,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,U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3E,GAAM,CAAE,KAAAwG,CAAK,EAAIH,EAAQC,EAAQ,CAC/B,UAAAkB,CACF,CAAC,EAGD,GAFAT,EAAgBP,EAAM,CAAE,WAAAQ,CAAW,CAAC,EAEhCR,GAAQ,MAAQA,EAAK,YAAc,GACrC,OAAO,KAGTA,EAAK,MAAM,EAEX,IAAMY,EAAOZ,EAAK,eAAe,EACjC,OAAAY,GAAA,MAAAA,EAAM,QAECxG,GAACuK,GAAA,CAAS,KAAM/D,EAAM,KAAMZ,EAAO,GAAGxG,EAAO,CACtD,CCxBA,OAAS,cAAAmF,OAAkB,QAIpB,SAASkG,IAAa,CAC3B,GAAM,CAAE,QAAApF,CAAQ,EAAId,GAAWQ,CAAc,EAE7C,MAAO,CAAE,QAAAM,CAAQ,CACnB","sourcesContent":["import * as RadixDialog from '@radix-ui/react-dialog'\nimport { XMarkIcon } from '@heroicons/react/24/solid'\n\nimport { Box, type BoxProps } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Card } from '../Card'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\n\nimport { theme } from '../../shared/theme'\n\nexport interface DialogProps extends BoxProps {}\n\n// TODO: Add any RadixDialog props we want to support here\nexport function Dialog({ children, ...props }: DialogProps) {\n return (\n <RadixDialog.Root defaultOpen={true} modal={true}>\n <RadixDialog.Portal>\n <RadixDialog.Overlay\n style={{ background: 'rgb(0 0 0 / 0.5)', position: 'fixed', inset: 0 }}\n />\n <RadixDialog.Content\n asChild\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n >\n <Card\n boxShadow=\"md\"\n css={{\n left: '50%',\n maxWidth: 430,\n top: '50%',\n transform: 'translate(-50%, -50%)',\n }}\n p={8}\n position=\"fixed\"\n textAlign=\"center\"\n {...props}\n >\n {children}\n </Card>\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n )\n}\n\nDialog.Close = (props: ButtonProps) => {\n return (\n <RadixDialog.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '4px',\n right: '-4px',\n }}\n part=\"close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </RadixDialog.Close>\n )\n}\n\nDialog.Subtitle = ({ children, ...props }: TextProps) => {\n return (\n <RadixDialog.Description asChild>\n <Text.Body2 part=\"subtitle\" mb={5} {...props}>\n {children}\n </Text.Body2>\n </RadixDialog.Description>\n )\n}\n\nDialog.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return <Media borderRadius=\"md\" src={src} {...props} />\n}\n\nDialog.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nDialog.ProgressDots = ({ current, total }: { current: number; total: number }) => {\n const dots = [...Array(total)].map((_, i) => {\n return (\n <circle\n key={i}\n r={4}\n cx={4 + 16 * i}\n cy=\"4px\"\n fill={current === i ? theme.colors.blue500 : theme.colors.blue800}\n />\n )\n })\n return (\n <Box\n as=\"svg\"\n width={16 * total - 8}\n height=\"8px\"\n viewBox={`0 0 ${16 * total - 8} 8`}\n margin=\"5 auto\"\n >\n {dots}\n </Box>\n )\n}\n\nDialog.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nDialog.Title = ({ children, ...props }: TextProps) => {\n return (\n <RadixDialog.Title asChild>\n <Text.H3 mb={1} part=\"title\" {...props}>\n {children}\n </Text.H3>\n </RadixDialog.Title>\n )\n}\n","import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { stylePropsToCss } from './stylePropsToCss'\nimport { sanitize } from '../../shared/sanitize'\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, css, 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, css]\n\n if (typeof children === 'string') {\n return (\n <Component\n className={classNameWithPart}\n css={cssProp}\n {...unmatchedProps}\n ref={ref}\n dangerouslySetInnerHTML={sanitize(children)}\n />\n )\n }\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","export const borders = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n}\n","export 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","export const radii = {\n md: '10px',\n lg: '20px',\n round: '50%',\n}\n","const colorVar = (colorName: string) => `var(--fr-colors-${colorName})`\n\nexport const semantic = {\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","export const shadows = {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n}\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 SpaceTokens = {\n [K in SpaceKeys[any]]: string\n}\nexport const space = Object.fromEntries(\n spaceKeys.map((key) => [key, spaceValue(key)])\n) as SpaceTokens\n","export const typography = {\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}\n","import { borders } from './borders'\nimport { palette } from './palette'\nimport { radii } from './radii'\nimport { semantic } from './semantic'\nimport { shadows } from './shadows'\nimport { space } from './space'\nimport { typography } from './typography'\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...borders,\n\n colors: {\n ...palette,\n ...semantic,\n },\n\n ...typography,\n\n radii,\n shadows,\n space,\n}\n\nexport type Tokens = typeof tokens\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, Tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\nexport type Theme = Partial<Tokens>\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: Theme) {\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(tokens: Tokens, path = '--fr'): Theme {\n const newObj: Theme = {}\n\n Object.keys(tokens).forEach((key) => {\n const currentValue = tokens[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 boxShadow: theme.shadows,\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 textAlign: [\n 'center',\n 'end',\n 'start',\n 'right',\n 'left',\n 'justify',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\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","import DOMPurify from 'dompurify'\n\nfunction getWindow() {\n if (typeof window === 'undefined') {\n // NOTE: JSDOM is required inline because it has import side effects that depend on node\n const { JSDOM } = require('jsdom')\n return new JSDOM('<!DOCTYPE html>').window\n }\n\n return window\n}\n\nexport function sanitize(dirty?: string) {\n if (!dirty) {\n return { __html: '' }\n }\n\n return {\n __html: DOMPurify(getWindow()).sanitize(dirty, {\n ALLOWED_TAGS: [\n 'b',\n 'i',\n 'a',\n 'span',\n 'div',\n 'p',\n 'pre',\n 'u',\n 'br',\n 'img',\n 'code',\n 'li',\n 'ul',\n 'table',\n 'tbody',\n 'thead',\n 'tr',\n 'td',\n 'th',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'video',\n ],\n ALLOWED_ATTR: [\n 'style',\n 'class',\n 'target',\n 'id',\n 'href',\n 'alt',\n 'src',\n 'controls',\n 'autoplay',\n 'loop',\n 'muted',\n ],\n }),\n }\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'\n\nimport type { BoxProps } from '../Box'\nimport { Flex } from '../Flex/Flex'\n\nexport const Card = React.forwardRef(({ as, children, ...props }: BoxProps, ref) => {\n const Component = as ?? Flex.Column\n return (\n <Component backgroundColor=\"neutral.background\" borderRadius=\"md\" p={5} {...props} ref={ref}>\n {children}\n </Component>\n )\n})\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 { 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","import { Flow } from '@frigade/js'\nimport { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport interface FlowConfig {\n variables?: Record<string, any>\n}\n\nexport function useFlow(flowId: string, config?: FlowConfig) {\n const [flow, setFlow] = useState<Flow>()\n const [_, setRandomString] = useState<string>('')\n const { frigade } = useContext(FrigadeContext)\n\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n if (config?.variables) {\n updatedFlow.applyVariables(config.variables)\n }\n\n setFlow(updatedFlow)\n setRandomString(Math.random().toString())\n }\n\n useEffect(() => {\n ;(async () => {\n const flowInstance: Flow = await frigade.getFlow(flowId)\n if (config?.variables) {\n flowInstance.applyVariables(config.variables)\n }\n\n setFlow(flowInstance)\n })()\n\n frigade.onStateChange(handler)\n\n return () => {\n frigade.removeStateChangeHandler(handler)\n }\n }, [])\n\n return { flow }\n}\n","import { createContext, Dispatch, SetStateAction, useRef, useState } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport {\n createThemeVariables,\n theme as themeTokens,\n type Theme,\n themeVariables,\n} from '../../shared/theme'\nimport { Frigade } from '@frigade/js'\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 apiUrl?: string\n children?: React.ReactNode\n navigate?: NavigateHandler\n theme?: Theme\n userId?: string\n groupId?: string\n}\n\ninterface ProviderContext extends Omit<ProviderProps, 'children' | 'theme'> {\n modals: string[]\n setModals: Dispatch<SetStateAction<string[]>>\n frigade?: Frigade\n}\n\nexport const FrigadeContext = createContext<ProviderContext>({\n apiKey: '',\n modals: [],\n setModals: () => {},\n navigate: () => {},\n})\n\nexport function Provider({ children, navigate, theme, ...props }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n const [modals, setModals] = useState([])\n const frigade = useRef(\n new Frigade(props.apiKey, {\n apiKey: props.apiKey,\n apiUrl: props.apiUrl,\n userId: props.userId,\n groupId: props.groupId,\n })\n )\n\n const navigateHandler =\n navigate ??\n ((url, target = '_self') => {\n window.open(url, target)\n })\n\n return (\n <FrigadeContext.Provider\n value={{\n modals,\n setModals,\n navigate: navigateHandler,\n ...props,\n frigade: frigade.current,\n }}\n >\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import { MouseEvent, useCallback, useEffect, useRef } from 'react'\n\nimport { Flow } from '@frigade/js'\n\nexport type FlowHandler = (\n flow: Flow,\n event?: MouseEvent<unknown>\n) => Promise<boolean | void> | (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 ;(async () => {\n await onComplete?.(flow)\n })()\n }\n\n lastCompleted.current = flow?.isCompleted\n }, [flow?.isCompleted])\n\n return {\n handleDismiss: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = await 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 = (\n step: FlowStep,\n event?: MouseEvent<unknown>\n) => Promise<boolean | void> | (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 = await 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 = await 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 { Dialog, type DialogProps } from '../Dialog'\nimport { Flex } from '../Flex/Flex'\nimport { type FlowComponentProps } from '../../shared/types'\nimport { useFlow } from '../../hooks/useFlow'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { useStepHandlers } from '@/hooks/useStepHandlers'\n\nexport interface AnncouncementProps extends DialogProps, FlowComponentProps {}\n\nexport function Announcement({\n flowId,\n onComplete,\n onDismiss,\n onPrimary,\n onSecondary,\n variables,\n}: AnncouncementProps) {\n const { flow } = useFlow(flowId, {\n variables,\n })\n const step = flow?.getCurrentStep()\n\n const { handleDismiss } = useFlowHandlers(flow, {\n onComplete,\n onDismiss,\n })\n\n const { handlePrimary, handleSecondary } = useStepHandlers(step, {\n onPrimary,\n onSecondary,\n })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n step?.start()\n\n return (\n <Dialog>\n <Dialog.Close onClick={handleDismiss} />\n\n <Dialog.Title>{step.title}</Dialog.Title>\n <Dialog.Subtitle>{step.subtitle}</Dialog.Subtitle>\n\n <Dialog.Media\n src={step.imageUri}\n css={{ aspectRatio: '1.5', objectFit: 'cover', width: '100%' }}\n />\n\n <Dialog.ProgressDots\n current={flow.getNumberOfCompletedSteps()}\n total={flow.getNumberOfAvailableSteps()}\n />\n\n <Flex.Row\n css={{\n '& > button': {\n flexGrow: 1,\n },\n }}\n gap={3}\n >\n <Dialog.Secondary title=\"Secondary\" onClick={handleSecondary} />\n <Dialog.Primary title=\"Primary\" onClick={handlePrimary} />\n </Flex.Row>\n </Dialog>\n )\n}\n","import { type BoxProps } from '@/components/Box'\nimport { Button } from '@/components/Button'\nimport { Card } from '@/components/Card'\nimport { Flex } from '@/components/Flex/Flex'\nimport { Text } from '@/components/Text'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\n\nimport { useFlow } from '@/hooks/useFlow'\nimport { useFlowHandlers } from '@/hooks/useFlowHandlers'\nimport { useStepHandlers } from '@/hooks/useStepHandlers'\n\nimport type { FlowComponentProps } from '@/shared/types'\n\ninterface BannerProps extends BoxProps, FlowComponentProps {}\n\nexport function Banner({\n flowId,\n onComplete,\n onDismiss,\n onPrimary,\n onSecondary,\n ...props\n}: BannerProps) {\n const { flow } = useFlow(flowId)\n const step = flow?.getCurrentStep()\n\n const { handleDismiss } = useFlowHandlers(flow, { onComplete, onDismiss })\n const { handlePrimary, handleSecondary } = useStepHandlers(step, { onPrimary, onSecondary })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n step?.start()\n\n return (\n <Card as={Flex.Row} border=\"md\" borderColor=\"gray900\" justifyContent=\"space-between\" {...props}>\n <Flex.Row gap={3}>\n <img src={step.imageUri} style={{ height: 40, width: 40, alignSelf: 'center' }} />\n <Flex.Column>\n <Text.H4 mb={1}>{step.title}</Text.H4>\n <Text.Body2>{step.subtitle}</Text.Body2>\n </Flex.Column>\n </Flex.Row>\n\n <Flex.Row alignItems=\"center\" gap={3}>\n <Button.Secondary title={step.secondaryButtonTitle} onClick={handleSecondary} />\n <Button.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n <Button.Plain part=\"banner-close\" onClick={handleDismiss}>\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Flex.Row>\n </Card>\n )\n}\n","import React, { useEffect, useRef, useState } from '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 { Card } from '../Card'\nimport { Dot } from './Dot'\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 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\n className={className}\n css={{ bottom: 0, left: 0, position: 'absolute', right: 0, top: 0, zIndex: 9999 }}\n >\n {spotlight && (\n <Box\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n borderRadius: anchorRadius,\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 <Card\n boxShadow=\"md\"\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Card>\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=\"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","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 { 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 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>{`${\n flow.getNumberOfCompletedSteps() + 1\n }/${flow.getNumberOfAvailableSteps()}`}</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 FlowComponentProps } from '../../shared/types'\nimport { type TooltipProps } from '../Tooltip'\nimport { TourStep } from './TourStep'\nimport { useFlow } from '../../hooks/useFlow'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\n\nexport interface TourProps extends TooltipProps, FlowComponentProps {}\n\nexport function Tour({ flowId, onComplete, variables, ...props }: TourProps) {\n const { flow } = useFlow(flowId, {\n variables,\n })\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","import { useContext } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFrigade() {\n const { frigade } = useContext(FrigadeContext)\n\n return { frigade }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Dialog/index.tsx","../src/components/Box/index.tsx","../src/components/Box/styleProps.ts","../src/shared/tokens/borders.ts","../src/shared/tokens/palette.ts","../src/shared/tokens/radii.ts","../src/shared/tokens/semantic.ts","../src/shared/tokens/shadows.ts","../src/shared/tokens/space.ts","../src/shared/tokens/typography.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/stylePropsToCss.ts","../src/shared/sanitize.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/Card/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/hooks/useFlow.ts","../src/components/Provider/index.tsx","../src/hooks/useFlowHandlers.ts","../src/hooks/useStepHandlers.ts","../src/components/Announcement/index.tsx","../src/components/Banner/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useModal.ts","../src/components/Tour/TourStep.tsx","../src/components/Tour/index.tsx","../src/hooks/useFrigade.ts"],"names":["RadixDialog","XMarkIcon","React","clsx","kcp","borders","palette","radii","colorVar","colorName","semantic","shadows","SPACE_UNIT","spaceValue","key","spaceKeys","space","typography","tokens","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","filteredCSSProperties","prop","_","char","defaultCSSProperties","colorTokens","themedStyleProps","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","DOMPurify","getWindow","JSDOM","sanitize","dirty","jsx","prefixPart","part","processPart","p","BoxWithRef","as","children","className","css","ref","Component","processedPart","classNameWithPart","cssProp","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","colors","jsxs","BaseButton","title","variantPart","buttonVariantNames","buttonVariantComponents","Button","Row","Column","Flex","Card","Image","src","getVideoEmbedSrc","videoUri","_a","_b","_c","Video","videoEmbedSrc","Media","type","Dialog","e","onClick","current","total","dots","i","useContext","useEffect","useState","createContext","useRef","Global","ThemeProvider","Frigade","FrigadeContext","Provider","navigate","themeOverrides","modals","setModals","frigade","navigateHandler","url","target","useFlow","flowId","config","flow","setFlow","setRandomString","handler","updatedFlow","flowInstance","useCallback","useFlowHandlers","onComplete","onDismiss","lastCompleted","useStepHandlers","step","onPrimary","onSecondary","Announcement","variables","handleDismiss","handlePrimary","handleSecondary","Banner","Popover","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToPopoverProps","contentRect","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","useModal","isCurrentModal","setIsCurrentModal","newIsCurrentModal","TourStep","Tour","useFrigade"],"mappings":"2VAAA,UAAYA,MAAiB,yBAC7B,OAAS,aAAAC,OAAiB,4BCD1B,UAAYC,OAAW,QACvB,OAAS,QAAAC,OAAY,OCDrB,OAAOC,OAAS,uBCAT,IAAMC,GAAU,CACrB,QAAS,CACP,GAAI,WACN,EACA,aAAc,CACZ,EAAG,IACH,GAAI,KACN,CACF,ECRO,IAA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,iBAAiB,GAAI,EACxF,UAAAlD,EAACkJ,EAAQ,SAAR,CAAkB,YACjBvD,EAAK,0BAA0B,EAAI,KACjCA,EAAK,0BAA0B,IAAI,EAEvC3F,EAACkJ,EAAQ,UAAR,CACC,WAAW,OACX,MAAO3C,EAAK,qBACZ,QAASO,EACX,EACA9G,EAACkJ,EAAQ,QAAR,CAAgB,MAAO3C,EAAK,mBAAoB,QAASM,EAAe,GAC3E,IA3BKN,EAAK,EA4BZ,EAjCO,IAmCX,CC/CS,cAAAvG,OAAA,6BAfF,SAASuK,GAAK,CAAE,OAAA9E,EAAQ,WAAAU,EAAY,UAAAQ,EAAW,GAAGvH,CAAM,EAAc,CAC3E,GAAM,CAAE,KAAAuG,CAAK,EAAIH,EAAQC,EAAQ,CAC/B,UAAAkB,CACF,CAAC,EAGD,GAFAT,EAAgBP,EAAM,CAAE,WAAAQ,CAAW,CAAC,EAEhCR,GAAQ,MAAQA,EAAK,YAAc,GACrC,OAAO,KAGTA,EAAK,MAAM,EAEX,IAAMY,EAAOZ,EAAK,eAAe,EACjC,OAAAY,GAAA,MAAAA,EAAM,QAECvG,GAACsK,GAAA,CAAS,KAAM/D,EAAM,KAAMZ,EAAO,GAAGvG,EAAO,CACtD,CCxBA,OAAS,cAAAkF,OAAkB,QAIpB,SAASkG,IAAa,CAC3B,GAAM,CAAE,QAAApF,CAAQ,EAAId,GAAWQ,CAAc,EAE7C,MAAO,CAAE,QAAAM,CAAQ,CACnB","sourcesContent":["import * as RadixDialog from '@radix-ui/react-dialog'\nimport { XMarkIcon } from '@heroicons/react/24/solid'\n\nimport { Box, type BoxProps } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Card } from '../Card'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\n\nimport { theme } from '../../shared/theme'\n\nexport interface DialogProps extends BoxProps {}\n\n// TODO: Add any RadixDialog props we want to support here\nexport function Dialog({ children, ...props }: DialogProps) {\n return (\n <RadixDialog.Root defaultOpen={true} modal={true}>\n <RadixDialog.Portal>\n <RadixDialog.Overlay\n style={{ background: 'rgb(0 0 0 / 0.5)', position: 'fixed', inset: 0 }}\n />\n <RadixDialog.Content\n asChild\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n >\n <Card\n boxShadow=\"md\"\n css={{\n left: '50%',\n maxWidth: 430,\n top: '50%',\n transform: 'translate(-50%, -50%)',\n }}\n p={8}\n position=\"fixed\"\n textAlign=\"center\"\n {...props}\n >\n {children}\n </Card>\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n )\n}\n\nDialog.Close = (props: ButtonProps) => {\n return (\n <RadixDialog.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '4px',\n right: '-4px',\n }}\n part=\"close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </RadixDialog.Close>\n )\n}\n\nDialog.Subtitle = ({ children, ...props }: TextProps) => {\n return (\n <RadixDialog.Description asChild>\n <Text.Body2 part=\"subtitle\" mb={5} {...props}>\n {children}\n </Text.Body2>\n </RadixDialog.Description>\n )\n}\n\nDialog.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return <Media borderRadius=\"md\" src={src} {...props} />\n}\n\nDialog.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nDialog.ProgressDots = ({ current, total }: { current: number; total: number }) => {\n const dots = [...Array(total)].map((_, i) => {\n return (\n <circle\n key={i}\n r={4}\n cx={4 + 16 * i}\n cy=\"4px\"\n fill={current === i ? theme.colors.blue500 : theme.colors.blue800}\n />\n )\n })\n return (\n <Box\n as=\"svg\"\n width={16 * total - 8}\n height=\"8px\"\n viewBox={`0 0 ${16 * total - 8} 8`}\n margin=\"5 auto\"\n >\n {dots}\n </Box>\n )\n}\n\nDialog.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nDialog.Title = ({ children, ...props }: TextProps) => {\n return (\n <RadixDialog.Title asChild>\n <Text.H3 mb={1} part=\"title\" {...props}>\n {children}\n </Text.H3>\n </RadixDialog.Title>\n )\n}\n","import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { type StyleProps } from './styleProps'\nimport { stylePropsToCss } from './stylePropsToCss'\nimport { sanitize } from '../../shared/sanitize'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: Part | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => processPart(p)).join(' ') : prefixPart(part)\n}\n\ntype Part = string | Part[]\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: Part\n} & StyleProps &\n React.ComponentPropsWithoutRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, css, part, ...props }: BoxProps<T>,\n ref: React.ForwardedRef<HTMLDivElement>\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 const cssProp = [{ boxSizing: 'border-box' }, cssFromProps, css]\n\n if (typeof children === 'string') {\n return (\n <Component\n className={classNameWithPart}\n css={cssProp}\n {...unmatchedProps}\n ref={ref}\n dangerouslySetInnerHTML={sanitize(children)}\n />\n )\n }\n\n return (\n <Component className={classNameWithPart} css={cssProp} {...unmatchedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef) as <\n T extends React.ElementType = React.ElementType\n>(\n props: BoxProps<T>\n) => React.ReactElement\n","import kcp from 'known-css-properties'\nimport type { CSSProperties } from 'react'\n\nimport { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst filteredCSSProperties = kcp.all\n .filter((prop) => prop.indexOf('-') != 0)\n .map((prop) => [prop.replace(/-([a-z])/g, (_, char) => char.toUpperCase()), null])\n\nconst defaultCSSProperties = Object.fromEntries(filteredCSSProperties)\n\n// SEE: https://stackoverflow.com/a/47058976\ntype PathsToStringProps<T> = T extends string\n ? []\n : {\n [K in Extract<keyof T, string>]: [K, ...PathsToStringProps<T[K]>]\n }[Extract<keyof T, string>]\n\ntype Join<T extends string[], D extends string> = T extends []\n ? never\n : T extends [infer F]\n ? F\n : T extends [infer F, ...infer R]\n ? F extends string\n ? `${F}${D}${Join<Extract<R, string[]>, D>}`\n : never\n : string\n\ntype ColorName = Join<PathsToStringProps<typeof theme.colors>, '.'>\n\nconst colorTokens = flattenObject(theme.colors) as Record<ColorName, string>\n\nconst themedStyleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n boxShadow: theme.shadows,\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 marginBottom: theme.space,\n marginLeft: theme.space,\n marginRight: theme.space,\n marginTop: theme.space,\n\n padding: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n paddingRight: theme.space,\n paddingTop: theme.space,\n} as const\n\nexport const styleProps = {\n ...defaultCSSProperties,\n ...themedStyleProps,\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\ntype ThemedStyleProps = {\n [K in keyof typeof themedStyleProps]: keyof (typeof themedStyleProps)[K]\n}\n\ntype FilteredCSSProps = Omit<\n {\n [key in keyof CSSProperties]: CSSProperties[key]\n },\n | `-${string}`\n | `Moz${string}`\n | `ms${string}`\n | `Webkit${string}`\n | `Khtml${string}`\n | `O${string}`\n>\n\nexport type ThemedStyleProp<K extends keyof ThemedStyleProps> = ThemedStyleProps[K] | (string & {})\n\nexport interface StyleProps extends FilteredCSSProps {\n backgroundColor?: ThemedStyleProp<'backgroundColor'>\n border?: ThemedStyleProp<'border'>\n borderColor?: ThemedStyleProp<'borderColor'>\n borderRadius?: ThemedStyleProp<'borderRadius'>\n borderWidth?: ThemedStyleProp<'borderWidth'>\n boxShadow?: ThemedStyleProp<'boxShadow'>\n color?: ThemedStyleProp<'color'>\n fontFamily?: ThemedStyleProp<'fontFamily'>\n fontSize?: ThemedStyleProp<'fontSize'>\n fontWeight?: ThemedStyleProp<'fontWeight'>\n gap?: ThemedStyleProp<'gap'>\n lineHeight?: ThemedStyleProp<'lineHeight'>\n margin?: ThemedStyleProp<'margin'>\n marginBottom?: ThemedStyleProp<'marginBottom'>\n marginLeft?: ThemedStyleProp<'marginLeft'>\n marginRight?: ThemedStyleProp<'marginRight'>\n marginTop?: ThemedStyleProp<'marginTop'>\n padding?: ThemedStyleProp<'padding'>\n paddingBottom?: ThemedStyleProp<'paddingBottom'>\n paddingLeft?: ThemedStyleProp<'paddingLeft'>\n paddingRight?: ThemedStyleProp<'paddingRight'>\n paddingTop?: ThemedStyleProp<'paddingTop'>\n}\n","export const borders = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n}\n","export 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","export const radii = {\n md: '10px',\n lg: '20px',\n round: '50%',\n}\n","const colorVar = (colorName: string) => `var(--fr-colors-${colorName})`\n\nexport const semantic = {\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","export const shadows = {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n}\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 SpaceTokens = {\n [K in SpaceKeys[any]]: string\n}\nexport const space = Object.fromEntries(\n spaceKeys.map((key) => [key, spaceValue(key)])\n) as SpaceTokens\n","export const typography = {\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}\n","import { borders } from './borders'\nimport { palette } from './palette'\nimport { radii } from './radii'\nimport { semantic } from './semantic'\nimport { shadows } from './shadows'\nimport { space } from './space'\nimport { typography } from './typography'\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...borders,\n\n colors: {\n ...palette,\n ...semantic,\n },\n\n ...typography,\n\n radii,\n shadows,\n space,\n}\n\nexport type Tokens = typeof tokens\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, Tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\nexport type Theme = Partial<Tokens>\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: Theme) {\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(tokens: Tokens, path = '--fr'): Theme {\n const newObj: Theme = {}\n\n Object.keys(tokens).forEach((key) => {\n const currentValue = tokens[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 { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value: any) {\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 return new Map()\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 // Split space-separated values out and process them individually\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n // Replace known token values (e.g. lineHeight=\"xl\")\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n\n // Pass value through, we trust TypeScript to catch invalid values, right?\n } else {\n cssFromProps[propName] = propValue\n }\n\n delete unmatchedProps[propName]\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","import DOMPurify from 'dompurify'\n\nfunction getWindow() {\n if (typeof window === 'undefined') {\n // NOTE: JSDOM is required inline because it has import side effects that depend on node\n const { JSDOM } = require('jsdom')\n return new JSDOM('<!DOCTYPE html>').window\n }\n\n return window\n}\n\nexport function sanitize(dirty?: string) {\n if (!dirty) {\n return { __html: '' }\n }\n\n return {\n __html: DOMPurify(getWindow()).sanitize(dirty, {\n ALLOWED_TAGS: [\n 'b',\n 'i',\n 'a',\n 'span',\n 'div',\n 'p',\n 'pre',\n 'u',\n 'br',\n 'img',\n 'code',\n 'li',\n 'ul',\n 'table',\n 'tbody',\n 'thead',\n 'tr',\n 'td',\n 'th',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'video',\n ],\n ALLOWED_ATTR: [\n 'style',\n 'class',\n 'target',\n 'id',\n 'href',\n 'alt',\n 'src',\n 'controls',\n 'autoplay',\n 'loop',\n 'muted',\n ],\n }),\n }\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, part, title, variant = 'Primary', ...props }: ButtonProps) {\n const variantPart = variant.toLocaleLowerCase()\n\n return (\n <Box\n as={as ?? 'button'}\n css={styles[variant] as Interpolation<any>}\n part={[`button-${variantPart}`, part]}\n {...props}\n >\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 component = (props: ButtonProps) => {\n return (\n <BaseButton {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\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'\n\nimport { type BoxProps } from '../Box'\nimport { Flex } from '../Flex/Flex'\n\nexport const Card = React.forwardRef(({ as, children, ...props }: BoxProps, ref) => {\n const Component = as ?? Flex.Column\n return (\n <Component backgroundColor=\"neutral.background\" borderRadius=\"md\" p={5} {...props} ref={ref}>\n {children}\n </Component>\n )\n})\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 { 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","import { Flow } from '@frigade/js'\nimport { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport interface FlowConfig {\n variables?: Record<string, any>\n}\n\nexport function useFlow(flowId: string, config?: FlowConfig) {\n const [flow, setFlow] = useState<Flow>()\n const [_, setRandomString] = useState<string>('')\n const { frigade } = useContext(FrigadeContext)\n\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n if (config?.variables) {\n updatedFlow.applyVariables(config.variables)\n }\n\n setFlow(updatedFlow)\n setRandomString(Math.random().toString())\n }\n\n useEffect(() => {\n ;(async () => {\n const flowInstance: Flow = await frigade.getFlow(flowId)\n if (config?.variables) {\n flowInstance.applyVariables(config.variables)\n }\n\n setFlow(flowInstance)\n })()\n\n frigade.onStateChange(handler)\n\n return () => {\n frigade.removeStateChangeHandler(handler)\n }\n }, [])\n\n return { flow }\n}\n","import { createContext, Dispatch, SetStateAction, useRef, useState } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport {\n createThemeVariables,\n theme as themeTokens,\n type Theme,\n themeVariables,\n} from '../../shared/theme'\nimport { Frigade } from '@frigade/js'\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 apiUrl?: string\n children?: React.ReactNode\n navigate?: NavigateHandler\n theme?: Theme\n userId?: string\n groupId?: string\n}\n\ninterface ProviderContext extends Omit<ProviderProps, 'children' | 'theme'> {\n modals: string[]\n setModals: Dispatch<SetStateAction<string[]>>\n frigade?: Frigade\n}\n\nexport const FrigadeContext = createContext<ProviderContext>({\n apiKey: '',\n modals: [],\n setModals: () => {},\n navigate: () => {},\n})\n\nexport function Provider({ children, navigate, theme, ...props }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n const [modals, setModals] = useState([])\n const frigade = useRef(\n new Frigade(props.apiKey, {\n apiKey: props.apiKey,\n apiUrl: props.apiUrl,\n userId: props.userId,\n groupId: props.groupId,\n })\n )\n\n const navigateHandler =\n navigate ??\n ((url, target = '_self') => {\n window.open(url, target)\n })\n\n return (\n <FrigadeContext.Provider\n value={{\n modals,\n setModals,\n navigate: navigateHandler,\n ...props,\n frigade: frigade.current,\n }}\n >\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import { MouseEvent, useCallback, useEffect, useRef } from 'react'\n\nimport { Flow } from '@frigade/js'\n\nexport type FlowHandler = (\n flow: Flow,\n event?: MouseEvent<unknown>\n) => Promise<boolean | void> | (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 ;(async () => {\n await onComplete?.(flow)\n })()\n }\n\n lastCompleted.current = flow?.isCompleted\n }, [flow?.isCompleted])\n\n return {\n handleDismiss: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = await 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 = (\n step: FlowStep,\n event?: MouseEvent<unknown>\n) => Promise<boolean | void> | (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 = await 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 = await 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 { Dialog, type DialogProps } from '../Dialog'\nimport { Flex } from '../Flex/Flex'\nimport { type FlowComponentProps } from '../../shared/types'\nimport { useFlow } from '../../hooks/useFlow'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { useStepHandlers } from '@/hooks/useStepHandlers'\n\nexport interface AnncouncementProps extends DialogProps, FlowComponentProps {}\n\nexport function Announcement({\n flowId,\n onComplete,\n onDismiss,\n onPrimary,\n onSecondary,\n variables,\n}: AnncouncementProps) {\n const { flow } = useFlow(flowId, {\n variables,\n })\n const step = flow?.getCurrentStep()\n\n const { handleDismiss } = useFlowHandlers(flow, {\n onComplete,\n onDismiss,\n })\n\n const { handlePrimary, handleSecondary } = useStepHandlers(step, {\n onPrimary,\n onSecondary,\n })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n step?.start()\n\n return (\n <Dialog>\n <Dialog.Close onClick={handleDismiss} />\n\n <Dialog.Title>{step.title}</Dialog.Title>\n <Dialog.Subtitle>{step.subtitle}</Dialog.Subtitle>\n\n <Dialog.Media\n src={step.imageUri}\n css={{ aspectRatio: '1.5', objectFit: 'cover', width: '100%' }}\n />\n\n <Dialog.ProgressDots\n current={flow.getNumberOfCompletedSteps()}\n total={flow.getNumberOfAvailableSteps()}\n />\n\n <Flex.Row\n css={{\n '& > button': {\n flexGrow: 1,\n },\n }}\n gap={3}\n >\n <Dialog.Secondary title=\"Secondary\" onClick={handleSecondary} />\n <Dialog.Primary title=\"Primary\" onClick={handlePrimary} />\n </Flex.Row>\n </Dialog>\n )\n}\n","import { type BoxProps } from '@/components/Box'\nimport { Button } from '@/components/Button'\nimport { Card } from '@/components/Card'\nimport { Flex } from '@/components/Flex/Flex'\nimport { Text } from '@/components/Text'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\n\nimport { useFlow } from '@/hooks/useFlow'\nimport { useFlowHandlers } from '@/hooks/useFlowHandlers'\nimport { useStepHandlers } from '@/hooks/useStepHandlers'\n\nimport type { FlowComponentProps } from '@/shared/types'\n\ninterface BannerProps extends BoxProps, FlowComponentProps {}\n\nexport function Banner({\n flowId,\n onComplete,\n onDismiss,\n onPrimary,\n onSecondary,\n ...props\n}: BannerProps) {\n const { flow } = useFlow(flowId)\n const step = flow?.getCurrentStep()\n\n const { handleDismiss } = useFlowHandlers(flow, { onComplete, onDismiss })\n const { handlePrimary, handleSecondary } = useStepHandlers(step, { onPrimary, onSecondary })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n step?.start()\n\n return (\n <Card as={Flex.Row} border=\"md\" borderColor=\"gray900\" justifyContent=\"space-between\" {...props}>\n <Flex.Row gap={3}>\n <img src={step.imageUri} style={{ height: 40, width: 40, alignSelf: 'center' }} />\n <Flex.Column>\n <Text.H4 mb={1}>{step.title}</Text.H4>\n <Text.Body2>{step.subtitle}</Text.Body2>\n </Flex.Column>\n </Flex.Row>\n\n <Flex.Row alignItems=\"center\" gap={3}>\n <Button.Secondary title={step.secondaryButtonTitle} onClick={handleSecondary} />\n <Button.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n <Button.Plain part=\"banner-close\" onClick={handleDismiss}>\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Flex.Row>\n </Card>\n )\n}\n","import React, { useEffect, useRef, useState } from '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 { Card } from '../Card'\nimport { Dot } from './Dot'\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 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\n className={className}\n css={{ bottom: 0, left: 0, position: 'absolute', right: 0, top: 0, zIndex: 9999 }}\n >\n {spotlight && (\n <Box\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n borderRadius: anchorRadius,\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 <Card\n boxShadow=\"md\"\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Card>\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=\"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","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 { 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 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) {\n return null\n }\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>{`${\n flow.getNumberOfCompletedSteps() + 1\n }/${flow.getNumberOfAvailableSteps()}`}</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 FlowComponentProps } from '../../shared/types'\nimport { type TooltipProps } from '../Tooltip'\nimport { TourStep } from './TourStep'\nimport { useFlow } from '../../hooks/useFlow'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\n\nexport interface TourProps extends TooltipProps, FlowComponentProps {}\n\nexport function Tour({ flowId, onComplete, variables, ...props }: TourProps) {\n const { flow } = useFlow(flowId, {\n variables,\n })\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","import { useContext } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFrigade() {\n const { frigade } = useContext(FrigadeContext)\n\n return { frigade }\n}\n"]}
|