@frigade/react 2.0.0-alpha.4 → 2.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,3 +1,42 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
2
- var ee=Object.defineProperty,Fe=Object.defineProperties;var Ee=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var Z=(e,t,o)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,a=(e,t)=>{for(var o in t||(t={}))te.call(t,o)&&Z(e,o,t[o]);if($)for(var o of $(t))oe.call(t,o)&&Z(e,o,t[o]);return e},u=(e,t)=>Fe(e,Ee(t));var p=(e,t)=>{var o={};for(var r in e)te.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&$)for(var r of $(e))t.indexOf(r)<0&&oe.call(e,r)&&(o[r]=e[r]);return o};var re=(e,t)=>{for(var o in t)ee(e,o,{get:t[o],enumerable:!0})};var k=(e,t,o)=>new Promise((r,n)=>{var l=c=>{try{d(o.next(c))}catch(f){n(f)}},s=c=>{try{d(o.throw(c))}catch(f){n(f)}},d=c=>c.done?r(c.value):Promise.resolve(c.value).then(l,s);d((o=o.apply(e,t)).next())});var _react = require('react'); var de = _interopRequireWildcard(_react); var U = _interopRequireWildcard(_react);var _clsx = require('clsx');var Ae="px",De=e=>typeof e=="number"?`${4*e}${Ae}`:e,He=[-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"],Ve=Object.fromEntries(He.map(e=>[e,De(e)])),We={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",red500:"#c00000"},I={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"},colors:a({},We),fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:"400",demibold:"600",bold:"700"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.1)"},space:Ve};var i=e=>`var(--fr-colors-${e})`,ne={neutral:{background:i("white"),border:i("gray900"),foreground:i("black"),surface:i("gray700"),active:{background:i("white"),border:i("gray900"),foreground:i("black"),surface:i("gray700")},focus:{background:i("white"),border:i("gray900"),foreground:i("black"),surface:i("gray700")},hover:{background:i("white"),border:i("gray900"),foreground:i("black"),surface:i("gray700")}},primary:{background:i("blue500"),border:i("blue500"),foreground:i("white"),surface:i("blue500"),active:{background:i("blue400"),border:i("blue400"),foreground:i("white"),surface:i("blue400")},focus:{background:i("blue500"),border:i("blue500"),foreground:i("white"),surface:i("blue500")},hover:{background:i("blue400"),border:i("blue400"),foreground:i("white"),surface:i("blue400")}},secondary:{background:i("gray900"),border:i("gray900"),foreground:i("black"),surface:i("gray900"),active:{background:i("gray800"),border:i("gray800"),foreground:i("black"),surface:i("gray800")},focus:{background:i("gray900"),border:i("gray900"),foreground:i("black"),surface:i("gray900")},hover:{background:i("gray800"),border:i("gray800"),foreground:i("black"),surface:i("gray800")}}};var j=u(a({},I),{colors:a(a({},I.colors),ne)});function O(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let s=`${t.length?`${t}${o}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,O(d,s,o)):r[s]=d,r},{})}function L(e){return O(e,"--fr","-")}function ie(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=ie(n,`${t}-${r}`):o[r]=`var(${t}-${r})`}),o}var se=L(j),g=ie(j);var z=O(g.colors),ae={color:z,backgroundColor:z,borderColor:z,border:g.borders,borderRadius:g.radii,borderWidth:g.borderWidths,fontFamily:g.fontFamilies,fontSize:g.fontSizes,fontWeight:g.fontWeights,gap:g.space,lineHeight:g.lineHeights,margin:g.space,marginTop:g.space,marginRight:g.space,marginBottom:g.space,marginLeft:g.space,padding:g.space,paddingTop:g.space,paddingRight:g.space,paddingBottom:g.space,paddingLeft:g.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"]},le={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]};function Me(e){if(Array.isArray(e))return new Map(e.map(t=>[t,t]));if(typeof e=="object"&&e!==null)return new Map(Object.entries(e));if(["string","number"].includes(typeof e))return new Map([e,e]);throw new Error("Invalid entry in styleProps")}var $e=new Map(Object.entries(ae).map(([e,t])=>[e,Me(t)])),Ie=new Map(Object.entries(le).map(([e,t])=>[e,new Set(t)]));function pe(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let l=Ie.get(r);l!=null&&(l.forEach(s=>{t[s]=n}),delete t[r])}),Object.entries(t).forEach(([r,n])=>{let l=$e.get(r);if(l!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let s=n.split(" ");o[r]=s.map(d=>{var c;return(c=l.get(d.toString()))!=null?c:d}).join(" "),delete t[r]}else l.has(n.toString())&&(o[r]=l.get(n.toString()),delete t[r])}),{cssFromProps:o,unmatchedProps:t}}var _jsxruntime = require('@emotion/react/jsx-runtime');function ce(e){return e&&`fr-${e}`}function Le(e){return e&&(Array.isArray(e)?e.map(t=>ce(t)).join(" "):ce(e))}function ze(d,s){var c=d,{as:e,children:t,className:o,css:r,part:n}=c,l=p(c,["as","children","className","css","part"]);let f=e!=null?e:"div",{cssFromProps:h,unmatchedProps:y}=pe(l),v=Le(n),B=o||v?_clsx.clsx.call(void 0, o,v):void 0;return _jsxruntime.jsx.call(void 0, f,u(a({className:B,css:[a(a({boxSizing:"border-box"},h),r)]},y),{ref:s,children:t}))}var m=de.forwardRef(ze);var K={};re(K,{Body1:()=>Je,Body2:()=>Qe,Caption:()=>Ye,Display1:()=>Ne,Display2:()=>Ue,H1:()=>_e,H2:()=>Xe,H3:()=>qe,H4:()=>Ge,base:()=>P});var P=({fontFamilies:e})=>({fontFamily:e.default,margin:0}),Ne=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e["5xl"],fontWeight:t.bold,lineHeight:o["4xl"]}],Ue=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e["4xl"],fontWeight:t.bold,lineHeight:o["3xl"]}],_e=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e["3xl"],fontWeight:t.bold,lineHeight:o["2xl"]}],Xe=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e["2xl"],fontWeight:t.bold,lineHeight:o.xl}],qe=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.xl,fontWeight:t.bold,lineHeight:o.lg}],Ge=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.lg,fontWeight:t.bold,lineHeight:o.md}],Je=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.md,fontWeight:t.regular,lineHeight:o.md}],Qe=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.sm,fontWeight:t.regular,lineHeight:o.md}],Ye=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.xs,fontWeight:t.regular,lineHeight:o.sm}];function fe(l){var s=l,{as:e="span",children:t,css:o,variant:r="Body1"}=s,n=p(s,["as","children","css","variant"]);return _jsxruntime.jsx.call(void 0, m,u(a({as:e,css:[K[r],o]},n),{children:t}))}var Ze=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],et=Object.fromEntries(Ze.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>_jsxruntime.jsx.call(void 0, fe,u(a({as:t},r),{variant:e,children:r.children}));return o.displayName=`Text.${e}`,[e,o]})),T= exports.Text =Object.assign(fe,et);var N={};re(N,{Link:()=>rt,Plain:()=>nt,Primary:()=>tt,Secondary:()=>ot,base:()=>F});var F=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),tt=({colors:e})=>[F,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],ot=({colors:e})=>[F,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],rt=({colors:e})=>[F,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],nt=({colors:e})=>[F,{backgroundColor:e.transparent,color:e.neutral.foreground}];function ge(s){var d=s,{as:e,children:t,css:o={},title:r,variant:n="Primary"}=d,l=p(d,["as","children","css","title","variant"]);return _jsxruntime.jsxs.call(void 0, m,u(a({as:e!=null?e:"button",css:[N[n],o]},l),{children:[t,r&&_jsxruntime.jsx.call(void 0, T.Body2,{fontWeight:"demibold",children:r})]}))}var it=["Primary","Secondary","Link","Plain"],st=Object.fromEntries(it.map(e=>{let t=e.toLocaleLowerCase(),o=l=>{var s=l,{part:r}=s,n=p(s,["part"]);return _jsxruntime.jsx.call(void 0, ge,u(a({part:[`button-${t}`,r]},n),{variant:e,children:n.children}))};return o.displayName=`Text.${e}`,[e,o]})),E= exports.Button =Object.assign(ge,st);var lt=U.forwardRef((n,r)=>{var l=n,{children:e,css:t}=l,o=p(l,["children","css"]);return _jsxruntime.jsx.call(void 0, m,u(a({css:[{display:"flex",flexDirection:"row"},t]},o),{ref:r,children:e}))}),pt=U.forwardRef((n,r)=>{var l=n,{children:e,css:t}=l,o=p(l,["children","css"]);return _jsxruntime.jsx.call(void 0, m,u(a({css:[{display:"flex",flexDirection:"column"},t]},o),{ref:r,children:e}))}),R= exports.Flex ={Column:pt,Row:lt};var _react2 = require('@emotion/react');var _=_react.createContext.call(void 0, {apiKey:"",config:{}});function ut({apiKey:e,children:t,config:o={},theme:r}){let n=r?L(r):{};return _jsxruntime.jsxs.call(void 0, _.Provider,{value:{apiKey:e,config:o},children:[_jsxruntime.jsx.call(void 0, _react2.Global,{styles:{":root":a(a({},se),n)}}),_jsxruntime.jsx.call(void 0, _react2.ThemeProvider,{theme:g,children:t})]})}var _solid = require('@heroicons/react/24/solid');var _reactpopover = require('@radix-ui/react-popover'); var w = _interopRequireWildcard(_reactpopover);function he(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=_react.useState.call(void 0, e),[r,n]=_react.useState.call(void 0, null),l=_react.useCallback.call(void 0, s=>{n(s)},[]);return _react.useLayoutEffect.call(void 0, ()=>{r&&o(r.getBoundingClientRect())},[r]),{node:r,rect:t,ref:l}}var yt=_react2.keyframes.call(void 0, {"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function we(r){var n=r,{style:e={},part:t=""}=n,o=p(n,["style","part"]);return _jsxruntime.jsxs.call(void 0, m,u(a({part:`dot-wrapper ${t}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},o),{children:[_jsxruntime.jsx.call(void 0, m,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${yt}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),_jsxruntime.jsx.call(void 0, m,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Be(r){var n=r,{part:e,src:t}=n,o=p(n,["part","src"]);return _jsxruntime.jsx.call(void 0, m,a({as:"img",part:["image",e],src:t},o))}function wt(e){var t,o,r;if(e.includes("youtube"))return`https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return`https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Te(r){var n=r,{part:e,src:t}=n,o=p(n,["part","src"]);let l=wt(t);return _jsxruntime.jsx.call(void 0, m,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:l},o))}function X(r){var n=r,{src:e,type:t}=n,o=p(n,["src","type"]);return _jsxruntime.jsx.call(void 0, t==="video"?Te:Be,a({src:e},o))}function Ce({props:e,alignAttr:t,sideAttr:o}){let r=o!=null?o:"bottom",n={},l=()=>{var f;if(["after","before"].includes(e.align)){if(t=="start")return"before";if(t=="end")return"after"}return(f=e.align)!=null?f:"after"},s="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=s;let c=l();return["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var ve={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Re(e,t){var n,l,s,d,c;let o=Object.fromEntries(ve.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(ve.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0));if(o.align=(n=o.align)!=null?n:"after",o.side=(l=o.side)!=null?l:"bottom",["before","after"].includes(o.align)){let f={after:"end",before:"start"},h=(H,V)=>["top","bottom"].includes(V)?H=="after"?"marginLeft":"marginRight":H=="after"?"marginTop":"marginBottom",y=(s=o.alignOffset)!=null?s:0,v=(d=o.style)!=null?d:{},B=(c=o.side)!=null?c:"bottom",A=o.align;o.style=u(a({},v),{[h(A,B)]:y});let D=["top","bottom"].includes(B)?t.width:t.height;o.alignOffset=(D+y)*-1,o.align=f[A]}return{contentProps:o,rootProps:r}}function x(s){var d=s,{anchor:e,children:t,css:o,spotlight:r=!1,style:n}=d,l=p(d,["anchor","children","css","spotlight","style"]);let{node:c,rect:f,ref:h}=he(),{contentProps:y,rootProps:v}=Re(l,f),[B,A]=_react.useState.call(void 0, y.align),[D,H]=_react.useState.call(void 0, y.side);if(c!==null){let S=c.getAttribute("data-align"),Y=c.getAttribute("data-side");B!==S&&A(S),D!==Y&&H(Y)}let V=_react.useRef.call(void 0, null),[W,ke]=_react.useState.call(void 0, null);if(_react.useEffect.call(void 0, ()=>{let S=document.querySelector(e);S!=null&&(V.current=S,ke(V))},[e]),W==null)return null;let M=W.current.getBoundingClientRect(),Q="0";typeof window!="undefined"&&(Q=window.getComputedStyle(W.current).borderRadius);let Oe=Ce({props:l,alignAttr:B,sideAttr:D});return _jsxruntime.jsxs.call(void 0, w.Root,u(a({defaultOpen:!0},v),{children:[_jsxruntime.jsx.call(void 0, w.Anchor,{virtualRef:W}),_jsxruntime.jsx.call(void 0, w.Portal,{children:_jsxruntime.jsxs.call(void 0, "div",{css:o,children:[r&&_jsxruntime.jsx.call(void 0, m,{borderRadius:Q,part:"tooltip-spotlight",position:"absolute",css:{boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:M.height,left:M.left,top:M.top,width:M.width}}),_jsxruntime.jsx.call(void 0, w.Content,u(a({asChild:!0},y),{ref:h,children:_jsxruntime.jsxs.call(void 0, R.Column,{backgroundColor:"white",borderRadius:"md",p:5,part:"tooltip-content",position:"relative",css:a({boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)",width:"300px"},n),children:[_jsxruntime.jsx.call(void 0, we,{style:Oe}),t]})}))]})})]}))}x.Close=o=>{var r=o,{css:e}=r,t=p(r,["css"]);return _jsxruntime.jsx.call(void 0, w.Close,{"aria-label":"Close",asChild:!0,children:_jsxruntime.jsx.call(void 0, E.Plain,u(a({css:[{top:0,right:0},e],part:"tooltip-close",position:"absolute"},t),{children:_jsxruntime.jsx.call(void 0, _solid.XMarkIcon,{height:"20",fill:"currentColor"})}))})};x.Media=o=>{var r=o,{src:e}=r,t=p(r,["src"]);return e==null?null:_jsxruntime.jsx.call(void 0, X,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e},t))};x.Primary=r=>{var n=r,{onClick:e,title:t}=n,o=p(n,["onClick","title"]);return t==null?null:_jsxruntime.jsx.call(void 0, E.Primary,a({title:t,onClick:e},o))};x.Progress=o=>{var r=o,{children:e}=r,t=p(r,["children"]);return e==null?null:_jsxruntime.jsx.call(void 0, T.Body2,u(a({fontWeight:"demibold",part:"progress"},t),{children:e}))};x.Secondary=r=>{var n=r,{onClick:e,title:t}=n,o=p(n,["onClick","title"]);return t==null?null:_jsxruntime.jsx.call(void 0, E.Secondary,a({title:t,onClick:e},o))};x.Subtitle=o=>{var r=o,{children:e}=r,t=p(r,["children"]);return e==null?null:_jsxruntime.jsx.call(void 0, T.Body2,u(a({part:"subtitle"},t),{children:e}))};x.Title=o=>{var r=o,{children:e}=r,t=p(r,["children"]);return e==null?null:_jsxruntime.jsx.call(void 0, T.Body1,u(a({fontWeight:"bold",mb:1,part:"title"},t),{children:e}))};var _js = require('@frigade/js');function Se(e){let[t,o]=_react.useState.call(void 0, null),{apiKey:r,config:n}=_react.useContext.call(void 0, _);function l(){return k(this,null,function*(){let s=Object.fromEntries(Object.entries(n).filter(([f,h])=>["apiUrl","userId"].includes(f)&&h!=null)),c=yield(yield new (0, _js.Frigade)(r,s)).getFlow(e);o(c)})}return t===null&&l(),{flow:t,fetchFlow:l}}function Ft(o){var r=o,{flowId:e}=r,t=p(r,["flowId"]);var h;let{flow:n,fetchFlow:l}=Se(e);if(n==null||n!=null&&n.isCompleted||n!=null&&n.isSkipped)return null;n.start();let s=n.getCurrentStep();s==null||s.start();function d(){return k(this,null,function*(){yield n.skip(),l()})}function c(){return k(this,null,function*(){yield s.complete(),l()})}let f=c;return _jsxruntime.jsxs.call(void 0, x,u(a({anchor:s.selector,onOpenAutoFocus:y=>y.preventDefault(),onPointerDownOutside:y=>y.preventDefault()},t),{children:[_jsxruntime.jsx.call(void 0, x.Close,{onClick:d}),_jsxruntime.jsx.call(void 0, x.Media,{src:(h=s.videoUri)!=null?h:s.imageUri,type:s.videoUri?"video":"image"}),_jsxruntime.jsx.call(void 0, x.Title,{children:s.title}),_jsxruntime.jsx.call(void 0, x.Subtitle,{children:s.subtitle}),_jsxruntime.jsxs.call(void 0, R.Row,{pt:4,alignItems:"center",justifyContent:"space-between",children:[_jsxruntime.jsx.call(void 0, x.Progress,{children:`${n.getNumberOfCompletedSteps()}/${n.steps.size}`}),_jsxruntime.jsxs.call(void 0, R.Row,{gap:3,children:[_jsxruntime.jsx.call(void 0, x.Secondary,{title:s.secondaryButtonTitle,onClick:f}),_jsxruntime.jsx.call(void 0, x.Primary,{title:s.primaryButtonTitle,onClick:c})]})]})]}))}exports.Box = m; exports.Button = E; exports.Flex = R; exports.Provider = ut; exports.Text = T; exports.Tooltip = x; exports.Tour = Ft;
1
+ 'use strict';
2
+
3
+ var _ = require('react');
4
+ var clsx = require('clsx');
5
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
6
+ var react = require('@emotion/react');
7
+ var solid = require('@heroicons/react/24/solid');
8
+ var h = require('@radix-ui/react-popover');
9
+ var js = require('@frigade/js');
10
+
11
+ function _interopNamespace(e) {
12
+ if (e && e.__esModule) return e;
13
+ var n = Object.create(null);
14
+ if (e) {
15
+ Object.keys(e).forEach(function (k) {
16
+ if (k !== 'default') {
17
+ var d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: function () { return e[k]; }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ var ___namespace = /*#__PURE__*/_interopNamespace(_);
30
+ var h__namespace = /*#__PURE__*/_interopNamespace(h);
31
+
32
+ var Z=Object.defineProperty,Ae=Object.defineProperties;var De=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var Y=(e,t,o)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))ee.call(t,o)&&Y(e,o,t[o]);if($)for(var o of $(t))te.call(t,o)&&Y(e,o,t[o]);return e},l=(e,t)=>Ae(e,De(t));var f=(e,t)=>{var o={};for(var r in e)ee.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&$)for(var r of $(e))t.indexOf(r)<0&&te.call(e,r)&&(o[r]=e[r]);return o};var oe=(e,t)=>{for(var o in t)Z(e,o,{get:t[o],enumerable:!0});};var R=(e,t,o)=>new Promise((r,n)=>{var s=u=>{try{d(o.next(u));}catch(p){n(p);}},c=u=>{try{d(o.throw(u));}catch(p){n(p);}},d=u=>u.done?r(u.value):Promise.resolve(u.value).then(s,c);d((o=o.apply(e,t)).next());});var He="px",Ie=e=>typeof e=="number"?`${4*e}${He}`:e,Ve=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],We=Object.fromEntries(Ve.map(e=>[e,Ie(e)])),$e={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"},j={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"},colors:i({},$e),fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"10px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.1)"},space:We};var a=e=>`var(--fr-colors-${e})`,re={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 L=l(i({},j),{colors:i(i({},j.colors),re)});function k(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let c=`${t.length?`${t}${o}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,k(d,c,o)):r[c]=d,r},{})}function z(e){return k(e,"--fr","-")}function ne(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]=ne(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var ie=z(L),g=ne(L);var K=k(g.colors),se={color:K,backgroundColor:K,borderColor:K,border:g.borders,borderRadius:g.radii,borderWidth:g.borderWidths,fontFamily:g.fontFamilies,fontSize:g.fontSizes,fontWeight:g.fontWeights,gap:g.space,lineHeight:g.lineHeights,margin:g.space,marginTop:g.space,marginRight:g.space,marginBottom:g.space,marginLeft:g.space,padding:g.space,paddingTop:g.space,paddingRight:g.space,paddingBottom:g.space,paddingLeft:g.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"]},ae={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 je(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 Le=new Map(Object.entries(se).map(([e,t])=>[e,je(t)])),ze=new Map(Object.entries(ae).map(([e,t])=>[e,new Set(t)]));function le(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let s=ze.get(r);s!=null&&(s.forEach(c=>{t[c]=n;}),delete t[r]);}),Object.entries(t).forEach(([r,n])=>{let s=Le.get(r);if(s!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let c=n.split(" ");o[r]=c.map(d=>{var u;return (u=s.get(d.toString()))!=null?u:d}).join(" "),delete t[r];}else s.has(n.toString())&&(o[r]=s.get(n.toString()),delete t[r]);}),{cssFromProps:o,unmatchedProps:t}}function ce(e){return e&&`fr-${e}`}function Ne(e){return e&&(Array.isArray(e)?e.map(t=>ce(t)).join(" "):ce(e))}function Ue(c,s){var d=c,{as:e,children:t,className:o,part:r}=d,n=f(d,["as","children","className","part"]);let u=e!=null?e:"div",{cssFromProps:p,unmatchedProps:y}=le(n),P=Ne(r),B=o||P?clsx.clsx(o,P):void 0;return jsxRuntime.jsx(u,l(i({className:B,css:[{boxSizing:"border-box"},p]},y),{ref:s,children:t}))}var m=___namespace.forwardRef(Ue);var N={};oe(N,{Body1:()=>Ze,Body2:()=>et,Caption:()=>tt,Display1:()=>Xe,Display2:()=>qe,H1:()=>Ge,H2:()=>Je,H3:()=>Qe,H4:()=>Ye});var w={color:"neutral.foreground",fontFamily:"default",margin:0},Xe=l(i({},w),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),qe=l(i({},w),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Ge=l(i({},w),{fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"}),Je=l(i({},w),{fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"}),Qe=l(i({},w),{fontSize:"xl",fontWeight:"bold",lineHeight:"lg"}),Ye=l(i({},w),{fontSize:"lg",fontWeight:"bold",lineHeight:"md"}),Ze=l(i({},w),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),et=l(i({},w),{fontSize:"sm",fontWeight:"regular",lineHeight:"md"}),tt=l(i({},w),{fontSize:"xs",fontWeight:"regular",lineHeight:"sm"});function de(n){var s=n,{as:e="span",children:t,variant:o="Body1"}=s,r=f(s,["as","children","variant"]);return jsxRuntime.jsx(m,l(i(i({as:e},N[o]),r),{children:t}))}var ot=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],rt=Object.fromEntries(ot.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsxRuntime.jsx(de,l(i({as:t},r),{variant:e,children:r.children}));return o.displayName=`Text.${e}`,[e,o]})),C=Object.assign(de,rt);var U={};oe(U,{Link:()=>st,Plain:()=>at,Primary:()=>nt,Secondary:()=>it,base:()=>O});var O=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),nt=({colors:e})=>[O,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],it=({colors:e})=>[O,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],st=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],at=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.neutral.foreground}];function ue(s){var c=s,{as:e,children:t,title:o,variant:r="Primary"}=c,n=f(c,["as","children","title","variant"]);return jsxRuntime.jsxs(m,l(i({as:e!=null?e:"button",css:U[r]},n),{children:[t,o&&jsxRuntime.jsx(C.Body2,{fontWeight:"demibold",color:"inherit",children:o})]}))}var lt=["Primary","Secondary","Link","Plain"],ct=Object.fromEntries(lt.map(e=>{let t=e.toLocaleLowerCase(),o=s=>{var c=s,{part:r}=c,n=f(c,["part"]);return jsxRuntime.jsx(ue,l(i({part:[`button-${t}`,r]},n),{variant:e,children:n.children}))};return o.displayName=`Text.${e}`,[e,o]})),F=Object.assign(ue,ct);var dt=___namespace.forwardRef((n,r)=>{var s=n,{children:e,css:t}=s,o=f(s,["children","css"]);return jsxRuntime.jsx(m,l(i({css:[{display:"flex",flexDirection:"row"},t]},o),{ref:r,children:e}))}),ft=___namespace.forwardRef((n,r)=>{var s=n,{children:e,css:t}=s,o=f(s,["children","css"]);return jsxRuntime.jsx(m,l(i({css:[{display:"flex",flexDirection:"column"},t]},o),{ref:r,children:e}))}),E={Column:ft,Row:dt};var M=_.createContext({apiKey:"",config:{},modals:[],setModals:()=>{}});function bt({apiKey:e,children:t,config:o={},theme:r}){let n=r?z(r):{},[s,c]=_.useState([]);return jsxRuntime.jsxs(M.Provider,{value:{apiKey:e,config:o,modals:s,setModals:c},children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i({},ie),n)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:g,children:t})]})}function ye(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=_.useState(e),[r,n]=_.useState(null),s=_.useCallback(c=>{n(c);},[]);return _.useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:s}}var Ct=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Pe(r){var n=r,{style:e={},part:t=""}=n,o=f(n,["style","part"]);return jsxRuntime.jsxs(m,l(i({part:`dot-wrapper ${t}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},o),{children:[jsxRuntime.jsx(m,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Ct}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(m,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function we(r){var n=r,{part:e,src:t}=n,o=f(n,["part","src"]);return jsxRuntime.jsx(m,i({as:"img",part:["image",e],src:t},o))}function Bt(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Ce(r){var n=r,{part:e,src:t}=n,o=f(n,["part","src"]);let s=Bt(t);return jsxRuntime.jsx(m,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:s},o))}function X(r){var n=r,{src:e,type:t}=n,o=f(n,["src","type"]);return jsxRuntime.jsx(t==="video"?Ce:we,i({src:e},o))}function Te({props:e,alignAttr:t,sideAttr:o}){let r=o!=null?o:"bottom",n={},s=()=>{var p;if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return (p=e.align)!=null?p:"after"},c="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=c;let u=s();return ["before","end"].includes(u)?["top","bottom"].includes(r)?n.right=c:n.bottom=c:["after","start"].includes(u)?["top","bottom"].includes(r)?n.left=c:n.top=c:["top","bottom"].includes(r)?n.left=`calc(50% + ${c})`:n.top=`calc(50% + ${c})`,n}var ve={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Be(e,t){var n,s,c,d,u;let o=Object.fromEntries(ve.content.map(p=>[p,e[p]]).filter(p=>p[1]!==void 0)),r=Object.fromEntries(ve.root.map(p=>[p,e[p]]).filter(p=>p[1]!==void 0));if(o.align=(n=o.align)!=null?n:"after",o.side=(s=o.side)!=null?s:"bottom",["before","after"].includes(o.align)){let p={after:"end",before:"start"},y=(H,I)=>["top","bottom"].includes(I)?H=="after"?"marginLeft":"marginRight":H=="after"?"marginTop":"marginBottom",P=(c=o.alignOffset)!=null?c:0,B=(d=o.style)!=null?d:{},v=(u=o.side)!=null?u:"bottom",A=o.align;o.style=l(i({},B),{[y(A,v)]:P});let D=["top","bottom"].includes(v)?t.width:t.height;o.alignOffset=(D+P)*-1,o.align=p[A];}return {contentProps:o,rootProps:r}}function x(c){var d=c,{anchor:e,children:t,className:o,spotlight:r=!1,style:n}=d,s=f(d,["anchor","children","className","spotlight","style"]);let{node:u,rect:p,ref:y}=ye(),{contentProps:P,rootProps:B}=Be(s,p),[v,A]=_.useState(P.align),[D,H]=_.useState(P.side);if(u!==null){let S=u.getAttribute("data-align"),Q=u.getAttribute("data-side");v!==S&&A(S),D!==Q&&H(Q);}let I=_.useRef(null),[V,Ee]=_.useState(null);if(_.useEffect(()=>{let S=document.querySelector(e);S!=null&&(I.current=S,Ee(I));},[e]),V==null)return null;let W=V.current.getBoundingClientRect(),J="0";typeof window!="undefined"&&(J=window.getComputedStyle(V.current).borderRadius);let Me=Te({props:s,alignAttr:v,sideAttr:D});return jsxRuntime.jsxs(h__namespace.Root,l(i({defaultOpen:!0},B),{children:[jsxRuntime.jsx(h__namespace.Anchor,{virtualRef:V}),jsxRuntime.jsx(h__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:o,css:{position:"absolute",zIndex:9999},children:[r&&jsxRuntime.jsx(m,{borderRadius:J,part:"tooltip-spotlight",position:"absolute",css:{boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:W.height,left:W.left,top:W.top,width:W.width}}),jsxRuntime.jsx(h__namespace.Content,l(i({asChild:!0},P),{ref:y,children:jsxRuntime.jsxs(E.Column,{backgroundColor:"neutral.background",borderRadius:"md",p:5,part:"tooltip-content",position:"relative",css:i({boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)",maxWidth:"360px"},n),children:[jsxRuntime.jsx(Pe,{style:Me}),t]})}))]})})]}))}x.Close=e=>jsxRuntime.jsx(h__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(F.Plain,l(i({css:{top:"12px",right:"4px"},part:"tooltip-close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});x.Media=o=>{var r=o,{src:e}=r,t=f(r,["src"]);return e==null?null:jsxRuntime.jsx(X,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e},t))};x.Primary=r=>{var n=r,{onClick:e,title:t}=n,o=f(n,["onClick","title"]);return t==null?null:jsxRuntime.jsx(F.Primary,i({title:t,onClick:e},o))};x.Progress=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,l(i({fontWeight:"demibold",part:"progress"},t),{children:e}))};x.Secondary=r=>{var n=r,{onClick:e,title:t}=n,o=f(n,["onClick","title"]);return t==null?null:jsxRuntime.jsx(F.Secondary,i({title:t,onClick:e},o))};x.Subtitle=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,l(i({part:"subtitle"},t),{children:e}))};x.Title=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body1,l(i({fontWeight:"bold",mb:1,part:"title"},t),{children:e}))};function Se(e){let[t,o]=_.useState(),{apiKey:r,config:n}=_.useContext(M),s=Object.fromEntries(Object.entries(n).filter(([p,y])=>["apiUrl","userId"].includes(p)&&y!=null)),d=_.useRef(new js.Frigade(r,s)).current,u=p=>{if(p.id!==e)return;let y=Object.assign(Object.create(Object.getPrototypeOf(p)),p);o(y);};return _.useEffect(()=>(R(this,null,function*(){let p=yield d.getFlow(e);o(p);}),d.onFlowStateChange(u),()=>{d.removeOnFlowStateChangeHandler(u);}),[]),{flow:t}}function ke(e){let{modals:t,setModals:o}=_.useContext(M),[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 Fe(r){var n=r,{step:e,flow:t}=n,o=f(n,["step","flow"]);var p;let{isCurrentModal:s}=ke(`${t.id}-${e.id}`);if(!s)return null;function c(){return R(this,null,function*(){yield t.skip();})}function d(){return R(this,null,function*(){yield e.complete();})}let u=d;return jsxRuntime.jsxs(x,l(i({anchor:e.selector,onOpenAutoFocus:y=>y.preventDefault(),onPointerDownOutside:y=>y.preventDefault()},o),{children:[jsxRuntime.jsx(x.Close,{onClick:c}),jsxRuntime.jsx(x.Media,{src:(p=e.videoUri)!=null?p:e.imageUri,type:e.videoUri?"video":"image"}),jsxRuntime.jsx(x.Title,{children:e.title}),jsxRuntime.jsx(x.Subtitle,{children:e.subtitle}),jsxRuntime.jsxs(E.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(x.Progress,{children:`${(e==null?void 0:e.order)+1}/${t.steps.size}`}),jsxRuntime.jsx(x.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:u}),jsxRuntime.jsx(x.Primary,{title:e.primaryButtonTitle,onClick:d})]})]}),e.id)}function Wt(o){var r=o,{flowId:e}=r,t=f(r,["flowId"]);let{flow:n}=Se(e);if(n==null||n.isVisible===!1)return null;n.start();let s=n.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(Fe,i({step:s,flow:n},t))}
33
+
34
+ exports.Box = m;
35
+ exports.Button = F;
36
+ exports.Flex = E;
37
+ exports.Provider = bt;
38
+ exports.Text = C;
39
+ exports.Tooltip = x;
40
+ exports.Tour = Wt;
41
+ //# sourceMappingURL=out.js.map
3
42
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Box/index.tsx","../src/shared/tokens/scalarTokens.ts","../src/shared/tokens/semanticColors.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/styleProps.ts","../src/components/Box/stylePropsToCss.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Provider/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useFlow.ts","../src/components/Tour/index.tsx"],"names":["React","clsx","SPACE_UNIT","spaceValue","key","spaceKeys","spaceScale","palette","scalarTokens","__spreadValues","colorVar","colorName","semanticColors","tokens","__spreadProps","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","colorTokens","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","_a","jsx","prefixPart","part","processPart","p","BoxWithRef","ref","_b","as","children","className","css","__objRest","Component","processedPart","classNameWithPart","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","fontFamilies","fontSizes","fontWeights","lineHeights","BaseText","variant","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","Link","Plain","Primary","Secondary","radii","space","colors","jsxs","BaseButton","title","buttonVariantNames","buttonVariantComponents","variantPart","Button","Row","Column","Flex","createContext","Global","ThemeProvider","FrigadeContext","Provider","apiKey","config","themeOverrides","useEffect","useRef","useState","XMarkIcon","Popover","useCallback","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","Image","src","getVideoEmbedSrc","videoUri","_c","Video","videoEmbedSrc","Media","type","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToRadixProps","contentRect","_d","_e","contentProps","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","lengthOfCurrentSide","Tooltip","anchor","spotlight","contentNode","contentRef","setAlignAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","anchorElementRef","setAnchorElementRef","anchorQuery","anchorRect","anchorRadius","dotPosition","onClick","Frigade","useContext","useFlow","flowId","flow","setFlow","fetchFlow","__async","filteredConfig","flowResponse","Tour","step","handleDismiss","handlePrimary","handleSecondary","e"],"mappings":";w2BAAA,UAAYA,OAAW,QACvB,OAAS,QAAAC,OAAY,OCArB,IAAMC,GAAa,KAEbC,GAAcC,GAClB,OAAOA,GAAQ,SAAW,GAAG,EAAcA,IAAMF,KAAeE,EAE5DC,GAAY,CAChB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,MACF,EAOMC,GAAa,OAAO,YAAYD,GAAU,IAAKD,GAAQ,CAACA,EAAKD,GAAWC,CAAG,CAAC,CAAC,CAAC,EAEvEG,GAAU,CACrB,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,SAAU,UACV,SAAU,UACV,SAAU,UACV,YAAa,YAGb,OAAQ,SACV,EAGaC,EAAe,CAC1B,QAAS,CACP,GAAI,WACN,EACA,aAAc,CACZ,EAAG,IACH,GAAI,KACN,EAEA,OAAQC,EAAA,GACHF,IAEL,aAAc,CACZ,QAAS,gCACX,EACA,UAAW,CACT,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,MAAO,OACP,MAAO,OACP,MAAO,OACP,MAAO,MACT,EACA,YAAa,CACX,QAAS,MACT,SAAU,MACV,KAAM,KACR,EACA,eAAgB,CACd,GAAI,QACN,EACA,YAAa,CACX,GAAI,OACJ,GAAI,OACJ,GAAI,OACJ,GAA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G,EAAOrB,CAAG,EAAIoB,GAA0BF,EAAc,GAAGL,KAAQb,GAAK,EAEtEqB,EAAOrB,CAAG,EAAI,OAAOa,KAAQb,IAEjC,CAAC,EAEMqB,CACT,CAEO,IAAMC,GAAiBH,EAAqBV,CAAM,EAE5Cc,EAAQH,GAA0BX,CAAM,EC1BrD,IAAMe,EAAuCb,EAAcY,EAAM,MAAM,EAO1DE,GAAa,CACxB,MAAOD,EACP,gBAAiBA,EACjB,YAAaA,EACb,OAAQD,EAAM,QACd,aAAcA,EAAM,MACpB,YAAaA,EAAM,aAEnB,WAAYA,EAAM,aAClB,SAAUA,EAAM,UAChB,WAAYA,EAAM,YAElB,IAAKA,EAAM,MAEX,WAAYA,EAAM,YAElB,OAAQA,EAAM,MACd,UAAWA,EAAM,MACjB,YAAaA,EAAM,MACnB,aAAcA,EAAM,MACpB,WAAYA,EAAM,MAElB,QAASA,EAAM,MACf,WAAYA,EAAM,MAClB,aAAcA,EAAM,MACpB,cAAeA,EAAM,MACrB,YAAaA,EAAM,MAEnB,aAAc,CACZ,SACA,QACA,MACA,aACA,WACA,SACA,WACA,iBACA,gBACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,WAAY,CACV,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,WACA,iBACA,gBACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CACT,OACA,SACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,WACA,iBACA,gBACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,cAAe,CACb,MACA,cACA,SACA,iBACA,UACA,UACA,SACA,eACA,OACF,EAEA,SAAU,CACR,SACA,OACA,eACA,UACA,UACA,SACA,eACA,OACF,EAEA,eAAgB,CACd,SACA,QACA,MACA,aACA,WACA,OACA,QACA,SACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,aAAc,CACZ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EAAQ,UAAR,CAAkB,MAAO4B,EAAK,qBAAsB,QAASG,EAAiB,EAC/EnJ,EAACoH,EAAQ,QAAR,CAAgB,MAAO4B,EAAK,mBAAoB,QAASE,EAAe,GAC3E,GACF,IACF,CAEJ","sourcesContent":["import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { stylePropsToCss } from './stylePropsToCss'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: string | string[] | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => prefixPart(p)).join(' ') : prefixPart(part)\n}\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: string | string[]\n} & React.ComponentPropsWithRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, 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 return (\n // @ts-ignore: TODO: ref types are yet again complaining\n <Component\n className={classNameWithPart}\n css={[{ boxSizing: 'border-box', ...cssFromProps, ...css }]}\n {...unmatchedProps}\n ref={ref}\n >\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef)\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceScale = {\n [K in SpaceKeys[any]]: string\n}\nconst spaceScale = Object.fromEntries(spaceKeys.map((key) => [key, spaceValue(key)])) as SpaceScale\n\nexport const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n\n// Scalar = Tokens with literal values\nexport const scalarTokens = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n\n colors: {\n ...palette,\n },\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n regular: '400',\n demibold: '600',\n bold: '700',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n radii: {\n md: '8px',\n lg: '20px',\n round: '50%',\n },\n shadows: {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n },\n space: spaceScale,\n}\n","const colorVar = (colorName) => `var(--fr-colors-${colorName})`\n\n// Semantic = Tokens that reference Scalars & contextualize them according to how they're used\nexport const semanticColors = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","import { scalarTokens } from './scalarTokens'\nimport { semanticColors } from './semanticColors'\n\nexport { scalarTokens, semanticColors }\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...scalarTokens,\n colors: {\n ...scalarTokens.colors,\n ...semanticColors,\n },\n}\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(obj, path = '--fr') {\n const newObj: Record<string, any> = {}\n\n Object.keys(obj).forEach((key) => {\n const currentValue = obj[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst colorTokens: Record<string, unknown> = flattenObject(theme.colors)\n\n/*\n TODO:\n - top / right / bottom / left\n*/\n\nexport const styleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginTop: theme.space,\n marginRight: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n\n padding: theme.space,\n paddingTop: theme.space,\n paddingRight: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n\n alignContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'normal',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignSelf: [\n 'auto',\n 'normal',\n 'center',\n 'start',\n 'end',\n 'self-start',\n 'self-end',\n 'flex-start',\n 'flex-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexDirection: [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexWrap: [\n 'nowrap',\n 'wrap',\n 'wrap-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'left',\n 'right',\n 'normal',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'left',\n 'right',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'legacy right',\n 'legacy left',\n 'legacy center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n boxSizing: ['border-box', 'content-box', 'inherit', 'initial', 'revert', 'revert-layer', 'unset'],\n\n position: [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n display: [\n 'block',\n 'block flex',\n 'block flow',\n 'block flow-root',\n 'block grid',\n 'contents',\n 'flex',\n 'flow-root',\n 'grid',\n 'inherit',\n 'initial',\n 'inline',\n 'inline flex',\n 'inline flow',\n 'inline flow-root',\n 'inline grid',\n 'inline-block',\n 'inline-flex',\n 'inline-grid',\n 'list-item',\n 'none',\n 'revert',\n 'revert-layer',\n 'table',\n 'table-row-group',\n 'table-header-group',\n 'table-footer-group',\n 'table-row',\n 'table-cell',\n 'table-column-group',\n 'table-column',\n 'table-caption',\n 'unset',\n ],\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n","import { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n throw new Error('Invalid entry in styleProps')\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nexport function stylePropsToCss(props: Record<any, any>) {\n const unmatchedProps = Object.assign({}, props)\n const cssFromProps = {}\n\n // Convert shorthand styleProps to full versions\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const matchedShorthand = stylePropShorthandsMap.get(propName)\n if (matchedShorthand != null) {\n matchedShorthand.forEach((propName) => {\n unmatchedProps[propName] = propValue\n })\n\n delete unmatchedProps[propName]\n }\n })\n\n // Convert styleProps to style object\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const styleProp = stylePropsMap.get(propName)\n if (styleProp != null) {\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n // Split space-separated values out and process them individually\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n delete unmatchedProps[propName]\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n delete unmatchedProps[propName]\n }\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","export const base = ({ fontFamilies }) => ({\n fontFamily: fontFamilies.default,\n margin: 0,\n})\n\nexport const Display1 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes['5xl'],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights['4xl'],\n },\n]\n\nexport const Display2 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes['4xl'],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights['3xl'],\n },\n]\n\nexport const H1 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes['3xl'],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights['2xl'],\n },\n]\n\nexport const H2 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes['2xl'],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.xl,\n },\n]\n\nexport const H3 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.xl,\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.lg,\n },\n]\n\nexport const H4 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.lg,\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.md,\n },\n]\n\nexport const Body1 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.md,\n fontWeight: fontWeights.regular,\n lineHeight: lineHeights.md,\n },\n]\n\nexport const Body2 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.regular,\n lineHeight: lineHeights.md,\n },\n]\n\nexport const Caption = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.xs,\n fontWeight: fontWeights.regular,\n lineHeight: lineHeights.sm,\n },\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, css, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} css={[styles[variant], css]} {...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 { 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, css = {}, title, variant = 'Primary', ...props }: ButtonProps) {\n return (\n <Box as={as ?? 'button'} css={[styles[variant], css]} {...props}>\n {children}\n {title && <Text.Body2 fontWeight=\"demibold\">{title}</Text.Body2>}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const variantPart = variant.toLocaleLowerCase()\n\n const component = ({ part, ...props }: ButtonProps) => (\n <BaseButton part={[`button-${variantPart}`, part]} {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { createContext } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport { createThemeVariables, theme as themeTokens, themeVariables } from '../../shared/theme'\n\nexport const FrigadeContext = createContext<{ apiKey: string; config: ProviderConfig }>({\n apiKey: '',\n config: {},\n})\n\n// TODO: type theme something like Partial<typeof themeContract>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n children?: React.ReactNode\n config?: ProviderConfig\n theme?: Record<any, any>\n}\n\ninterface ProviderConfig {\n apiUrl?: string\n userId?: string\n}\n\nexport function Provider({ apiKey, children, config = {}, theme }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n\n return (\n <FrigadeContext.Provider value={{ apiKey, config }}>\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Dot } from './Dot'\nimport { Flex } from '../Flex/Flex'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToRadixProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n css,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToRadixProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div css={css}>\n {spotlight && (\n <Box\n borderRadius={anchorRadius}\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Flex.Column\n backgroundColor=\"white\"\n borderRadius=\"md\"\n p={5}\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n width: '300px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Flex.Column>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = ({ css, ...props }: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={[\n {\n top: 0,\n right: 0,\n },\n css,\n ]}\n part=\"tooltip-close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"20\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToRadixProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps['alignOffset'] = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { Frigade, Flow } from '@frigade/js'\nimport { useContext, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFlow(flowId: string) {\n const [flow, setFlow] = useState<Flow>(null)\n const { apiKey, config } = useContext(FrigadeContext)\n\n async function fetchFlow() {\n const filteredConfig = Object.fromEntries(\n Object.entries(config).filter(([k, v]) => ['apiUrl', 'userId'].includes(k) && v != null)\n )\n\n const frigade = await new Frigade(apiKey, filteredConfig)\n\n const flowResponse: Flow = await frigade.getFlow(flowId)\n\n setFlow(flowResponse)\n }\n\n if (flow === null) {\n fetchFlow()\n }\n\n // TEMP: Expose a way to manually refresh the flow.\n // TODO: Automatically update state when something like step.complete() is called\n return { flow, fetchFlow }\n}\n","import { useFlow } from '../../hooks/useFlow'\n\nimport { Flex } from '../Flex/Flex'\nimport { Tooltip, TooltipProps } from '../Tooltip'\n\nexport interface TourProps extends TooltipProps {\n flowId: string\n}\n\nexport function Tour({ flowId, ...props }: TourProps) {\n const { flow, fetchFlow } = useFlow(flowId)\n\n if (flow == null || flow?.isCompleted || flow?.isSkipped) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n\n step?.start()\n\n async function handleDismiss() {\n await flow.skip()\n\n // TEMP: Manually refreshing flow data until useFlow can handle it internally\n fetchFlow()\n }\n\n async function handlePrimary() {\n await step.complete()\n\n // TEMP: Manually refreshing flow data until useFlow can handle it internally\n fetchFlow()\n }\n\n const handleSecondary = handlePrimary\n\n return (\n <Tooltip\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row pt={4} alignItems=\"center\" justifyContent=\"space-between\">\n <Tooltip.Progress>\n {`${flow.getNumberOfCompletedSteps()}/${flow.steps.size}`}\n </Tooltip.Progress>\n\n <Flex.Row gap={3}>\n <Tooltip.Secondary title={step.secondaryButtonTitle} onClick={handleSecondary} />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Flex.Row>\n </Tooltip>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/Box/index.tsx","../src/shared/tokens/scalarTokens.ts","../src/shared/tokens/semanticColors.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/styleProps.ts","../src/components/Box/stylePropsToCss.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Provider/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useFlow.ts","../src/hooks/useModal.ts","../src/components/Tour/TourStep.tsx","../src/components/Tour/index.tsx"],"names":["React","clsx","SPACE_UNIT","spaceValue","key","spaceKeys","spaceScale","palette","scalarTokens","__spreadValues","colorVar","colorName","semanticColors","tokens","__spreadProps","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","colorTokens","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","_a","jsx","prefixPart","part","processPart","p","BoxWithRef","ref","_b","as","children","className","__objRest","Component","processedPart","classNameWithPart","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","BaseText","variant","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","Link","Plain","Primary","Secondary","radii","space","colors","jsxs","BaseButton","title","buttonVariantNames","buttonVariantComponents","variantPart","Button","Row","css","Column","Flex","createContext","useState","Global","ThemeProvider","FrigadeContext","Provider","apiKey","config","themeOverrides","modals","setModals","useEffect","useRef","XMarkIcon","Popover","useCallback","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","Image","src","getVideoEmbedSrc","videoUri","_c","Video","videoEmbedSrc","Media","type","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToPopoverProps","contentRect","_d","_e","contentProps","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","lengthOfCurrentSide","Tooltip","anchor","spotlight","contentNode","contentRef","setAlignAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","anchorElementRef","setAnchorElementRef","anchorQuery","anchorRect","anchorRadius","dotPosition","onClick","Frigade","useContext","useFlow","flowId","flow","setFlow","filteredConfig","frigade","handler","updatedFlow","clonedFlow","__async","flowResponse","useModal","isCurrentModal","setIsCurrentModal","newIsCurrentModal","TourStep","step","handleDismiss","handlePrimary","handleSecondary","e","Tour"],"mappings":"q2BAAA,UAAYA,OAAW,QACvB,OAAS,QAAAC,OAAY,OCArB,IAAMC,GAAa,KAEbC,GAAcC,GAClB,OAAOA,GAAQ,SAAW,GAAG,EAAcA,IAAMF,KAAeE,EAE5DC,GAAY,CAChB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,MACF,EAOMC,GAAa,OAAO,YAAYD,GAAU,IAAKD,GAAQ,CAACA,EAAKD,GAAWC,CAAG,CAAC,CAAC,CAAC,EAEvEG,GAAU,CACrB,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,SAAU,UACV,SAAU,UACV,SAAU,UACV,YAAa,YACb,QAAS,UAGT,OAAQ,SACV,EAGaC,EAAe,CAC1B,QAAS,CACP,GAAI,WACN,EACA,aAAc,CACZ,EAAG,IACH,GAAI,KACN,EAEA,OAAQC,EAAA,GACHF,IAEL,aAAc,C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ACA,QACA,MACA,aACA,WACA,aACA,WACA,WACA,iBACA,gBACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,cAAe,CACb,MACA,cACA,SACA,iBACA,UACA,UACA,SACA,eACA,OACF,EAEA,SAAU,CACR,SACA,OACA,eACA,UACA,UACA,SACA,eACA,OACF,EAEA,eAAgB,CACd,SACA,QACA,MACA,aACA,WACA,OACA,QACA,SACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,aAAc,CACZ,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,OACA,QACA,WACA,iBACA,gBACA,cACA,gBACA,eACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CAAC,aAAc,cAAe,UAAW,UAAW,SAAU,eAAgB,OAAO,EAEhG,SAAU,CACR,SACA,WACA,WACA,QACA,SACA,UACA,UACA,SACA,eACA,OACF,EAEA,QAAS,CACP,QACA,aACA,aACA,kBACA,aACA,WACA,OACA,YACA,OACA,UACA,UACA,SACA,cACA,cACA,mBACA,cACA,eACA,cACA,cACA,YACA,OACA,SACA,eACA,QACA,kBACA,qBACA,qBACA,YACA,aACA,qBACA,eACA,gBACA,OACF,CACF,EAEaG,GAAsB,CACjC,EAAG,CAAC,QAAQ,EACZ,GAAI,CAAC,WAAW,EAChB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,aAAc,aAAa,EAChC,GAAI,CAAC,YAAa,cAAc,EAEhC,EAAG,CAAC,SAAS,EACb,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,eAAe,EACpB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAe,cAAc,EAClC,GAAI,CAAC,aAAc,eAAe,CACpC,ECpPA,SAASC,GAAUC,EAAO,CACxB,GAAI,MAAM,QAAQA,CAAK,EACrB,OAAO,IAAI,I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AAmC,EAAK,SAAS,EAEjC1G,GAACU,EAAK,IAAL,CAAS,WAAW,SAAS,IAAK,EAAG,eAAe,WAAW,KAAK,iBAAiB,GAAI,EACxF,UAAArD,EAACkH,EAAQ,SAAR,CAAkB,aAAGmC,GAAA,YAAAA,EAAM,OAAQ,KAAKd,EAAK,MAAM,OAAO,EAE3DvI,EAACkH,EAAQ,UAAR,CACC,WAAW,OACX,MAAOmC,EAAK,qBACZ,QAASG,EACX,EACAxJ,EAACkH,EAAQ,QAAR,CAAgB,MAAOmC,EAAK,mBAAoB,QAASE,EAAe,GAC3E,KAzBKF,EAAK,EA0BZ,CAEJ,CCpCS,cAAArJ,OAAA,6BAZF,SAAS0J,GAAK3J,EAAiC,CAAjC,IAAAQ,EAAAR,EAAE,QAAAuI,CAVvB,EAUqB/H,EAAaf,EAAAmB,EAAbJ,EAAa,CAAX,WACrB,GAAM,CAAE,KAAAgI,CAAK,EAAIF,GAAQC,CAAM,EAE/B,GAAIC,GAAQ,MAAQA,EAAK,YAAc,GACrC,OAAO,KAGTA,EAAK,MAAM,EAEX,IAAMc,EAAOd,EAAK,eAAe,EACjC,OAAAc,GAAA,MAAAA,EAAM,QAECrJ,GAACoJ,GAAA3L,EAAA,CAAS,KAAM4L,EAAM,KAAMd,GAAU/I,EAAO,CACtD","sourcesContent":["import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { stylePropsToCss } from './stylePropsToCss'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: string | string[] | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => prefixPart(p)).join(' ') : prefixPart(part)\n}\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: string | string[]\n} & React.ComponentPropsWithRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, part, ...props }: BoxProps<T>,\n ref: React.ForwardedRef<T>\n) {\n const Component = as ?? 'div'\n\n const { cssFromProps, unmatchedProps } = stylePropsToCss(props)\n\n const processedPart = processPart(part)\n const classNameWithPart = className || processedPart ? clsx(className, processedPart) : undefined\n\n const cssProp = [{ boxSizing: 'border-box' }, cssFromProps]\n\n return (\n // @ts-ignore: TODO: ref types are yet again complaining\n <Component className={classNameWithPart} css={cssProp} {...unmatchedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef)\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceScale = {\n [K in SpaceKeys[any]]: string\n}\nconst spaceScale = Object.fromEntries(spaceKeys.map((key) => [key, spaceValue(key)])) as SpaceScale\n\nexport const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n inherit: 'inherit',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n\n// Scalar = Tokens with literal values\nexport const scalarTokens = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n\n colors: {\n ...palette,\n },\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n thin: '100',\n extralight: '200',\n light: '300',\n regular: '400',\n medium: '500',\n demibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n radii: {\n md: '10px',\n lg: '20px',\n round: '50%',\n },\n shadows: {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n },\n space: spaceScale,\n}\n","const colorVar = (colorName) => `var(--fr-colors-${colorName})`\n\n// Semantic = Tokens that reference Scalars & contextualize them according to how they're used\nexport const semanticColors = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray500'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","import { scalarTokens } from './scalarTokens'\nimport { semanticColors } from './semanticColors'\n\nexport { scalarTokens, semanticColors }\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...scalarTokens,\n colors: {\n ...scalarTokens.colors,\n ...semanticColors,\n },\n}\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(obj, path = '--fr') {\n const newObj: Record<string, any> = {}\n\n Object.keys(obj).forEach((key) => {\n const currentValue = obj[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst colorTokens: Record<string, unknown> = flattenObject(theme.colors)\n\n/*\n TODO:\n - top / right / bottom / left\n*/\n\nexport const styleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginTop: theme.space,\n marginRight: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n\n padding: theme.space,\n paddingTop: theme.space,\n paddingRight: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n\n alignContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'normal',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignSelf: [\n 'auto',\n 'normal',\n 'center',\n 'start',\n 'end',\n 'self-start',\n 'self-end',\n 'flex-start',\n 'flex-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexDirection: [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexWrap: [\n 'nowrap',\n 'wrap',\n 'wrap-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'left',\n 'right',\n 'normal',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'left',\n 'right',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'legacy right',\n 'legacy left',\n 'legacy center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n boxSizing: ['border-box', 'content-box', 'inherit', 'initial', 'revert', 'revert-layer', 'unset'],\n\n position: [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n display: [\n 'block',\n 'block flex',\n 'block flow',\n 'block flow-root',\n 'block grid',\n 'contents',\n 'flex',\n 'flow-root',\n 'grid',\n 'inherit',\n 'initial',\n 'inline',\n 'inline flex',\n 'inline flow',\n 'inline flow-root',\n 'inline grid',\n 'inline-block',\n 'inline-flex',\n 'inline-grid',\n 'list-item',\n 'none',\n 'revert',\n 'revert-layer',\n 'table',\n 'table-row-group',\n 'table-header-group',\n 'table-footer-group',\n 'table-row',\n 'table-cell',\n 'table-column-group',\n 'table-column',\n 'table-caption',\n 'unset',\n ],\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n","import { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n throw new Error('Invalid entry in styleProps')\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nexport function stylePropsToCss(props: Record<any, any>) {\n const unmatchedProps = Object.assign({}, props)\n const cssFromProps = {}\n\n // Convert shorthand styleProps to full versions\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const matchedShorthand = stylePropShorthandsMap.get(propName)\n if (matchedShorthand != null) {\n matchedShorthand.forEach((propName) => {\n unmatchedProps[propName] = propValue\n })\n\n delete unmatchedProps[propName]\n }\n })\n\n // Convert styleProps to style object\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const styleProp = stylePropsMap.get(propName)\n if (styleProp != null) {\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n // Split space-separated values out and process them individually\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n delete unmatchedProps[propName]\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n delete unmatchedProps[propName]\n }\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","const base = {\n color: 'neutral.foreground',\n fontFamily: 'default',\n margin: 0,\n}\n\nexport const Display1 = {\n ...base,\n fontSize: '5xl',\n fontWeight: 'bold',\n lineHeight: '4xl',\n}\n\nexport const Display2 = {\n ...base,\n fontSize: '4xl',\n fontWeight: 'bold',\n lineHeight: '3xl',\n}\n\nexport const H1 = {\n ...base,\n fontSize: '3xl',\n fontWeight: 'bold',\n lineHeight: '2xl',\n}\n\nexport const H2 = {\n ...base,\n fontSize: '2xl',\n fontWeight: 'bold',\n lineHeight: 'xl',\n}\n\nexport const H3 = {\n ...base,\n fontSize: 'xl',\n fontWeight: 'bold',\n lineHeight: 'lg',\n}\n\nexport const H4 = {\n ...base,\n fontSize: 'lg',\n fontWeight: 'bold',\n lineHeight: 'md',\n}\n\nexport const Body1 = {\n ...base,\n fontSize: 'md',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Body2 = {\n ...base,\n fontSize: 'sm',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Caption = {\n ...base,\n fontSize: 'xs',\n fontWeight: 'regular',\n lineHeight: 'sm',\n}\n","import { Box, BoxProps } from '../Box'\n\nimport * as styles from './Text.styles'\n\ntype TextVariant =\n | 'Display1'\n | 'Display2'\n | 'H1'\n | 'H2'\n | 'H3'\n | 'H4'\n | 'Body1'\n | 'Body2'\n | 'Caption'\n\nexport interface TextProps extends BoxProps {\n variant?: TextVariant\n}\n\nfunction BaseText({ as = 'span', children, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} {...styles[variant]} {...props}>\n {children}\n </Box>\n )\n}\n\nconst textVariantNames: TextVariant[] = [\n 'Display1',\n 'Display2',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'Body1',\n 'Body2',\n 'Caption',\n]\n\nconst textVariantComponents = Object.fromEntries(\n textVariantNames.map((variant) => {\n const asProp = ['H1', 'H2', 'H3', 'H4'].includes(variant)\n ? (variant.toLowerCase() as 'h1' | 'h2' | 'h3' | 'h4')\n : undefined\n const component = (props: TextProps) => (\n <BaseText as={asProp} {...props} variant={variant}>\n {props.children}\n </BaseText>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Text = Object.assign(BaseText, textVariantComponents)\n","export const base = ({ radii, space }) => ({\n borderWidth: 0,\n borderRadius: radii.md,\n padding: `${space[2]} ${space[4]}`,\n})\n\nexport const Primary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.primary.surface,\n color: colors.primary.foreground,\n\n '&:hover': {\n backgroundColor: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Secondary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.secondary.surface,\n color: colors.secondary.foreground,\n\n '&:hover': {\n backgroundColor: colors.secondary.hover.surface,\n },\n },\n]\n\nexport const Link = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.primary.surface,\n\n '&:hover': {\n color: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Plain = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.neutral.foreground,\n },\n]\n","import { Interpolation } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\nimport { Text } from '../Text'\n\nimport * as styles from './Button.styles'\n\n// TODO: Generate this type from buttonVariantNames\ntype ButtonVariant = 'Primary' | 'Secondary' | 'Link' | 'Plain'\n\nexport interface ButtonProps extends BoxProps {\n title?: string\n variant?: ButtonVariant\n}\n\nfunction BaseButton({ as, children, title, variant = 'Primary', ...props }: ButtonProps) {\n return (\n <Box as={as ?? 'button'} css={styles[variant] as Interpolation<any>} {...props}>\n {children}\n {title && (\n <Text.Body2 fontWeight=\"demibold\" color=\"inherit\">\n {title}\n </Text.Body2>\n )}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const variantPart = variant.toLocaleLowerCase()\n\n const component = ({ part, ...props }: ButtonProps) => (\n <BaseButton part={[`button-${variantPart}`, part]} {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { createContext, Dispatch, SetStateAction, useState } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport { createThemeVariables, theme as themeTokens, themeVariables } from '../../shared/theme'\n\n// TODO: type theme something like Partial<typeof themeTokens>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n children?: React.ReactNode\n config?: ProviderConfig\n theme?: Record<any, any>\n}\n\ninterface ProviderConfig {\n apiUrl?: string\n userId?: string\n}\n\ninterface ProviderContext {\n apiKey: string\n config: ProviderConfig\n modals: string[]\n setModals: Dispatch<SetStateAction<string[]>>\n}\n\nexport const FrigadeContext = createContext<ProviderContext>({\n apiKey: '',\n config: {},\n modals: [],\n setModals: () => {},\n})\n\nexport function Provider({ apiKey, children, config = {}, theme }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n const [modals, setModals] = useState([])\n\n return (\n <FrigadeContext.Provider value={{ apiKey, config, modals, setModals }}>\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Interpolation } from '@emotion/react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Dot } from './Dot'\nimport { Flex } from '../Flex/Flex'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToPopoverProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n css?: Interpolation<Record<any, any>>\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n className,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToPopoverProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div className={className} css={{ position: 'absolute', zIndex: 9999 }}>\n {spotlight && (\n <Box\n borderRadius={anchorRadius}\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Flex.Column\n backgroundColor=\"neutral.background\"\n borderRadius=\"md\"\n p={5}\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Flex.Column>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = (props: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '12px',\n right: '4px',\n }}\n part=\"tooltip-close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToPopoverProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps.alignOffset = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { Flow, Frigade } from '@frigade/js'\nimport { useContext, useEffect, useRef, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFlow(flowId: string) {\n const [flow, setFlow] = useState<Flow>()\n const { apiKey, config } = useContext(FrigadeContext)\n const filteredConfig = Object.fromEntries(\n Object.entries(config).filter(([k, v]) => ['apiUrl', 'userId'].includes(k) && v != null)\n )\n\n const frigadeRef = useRef(new Frigade(apiKey, filteredConfig))\n const frigade = frigadeRef.current\n\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n const clonedFlow = Object.assign(Object.create(Object.getPrototypeOf(updatedFlow)), updatedFlow)\n\n setFlow(clonedFlow)\n }\n\n useEffect(() => {\n ;(async () => {\n const flowResponse: Flow = await frigade.getFlow(flowId)\n\n setFlow(flowResponse)\n })()\n\n frigade.onFlowStateChange(handler)\n\n return () => {\n frigade.removeOnFlowStateChangeHandler(handler)\n }\n }, [])\n\n return { flow }\n}\n","import { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useModal(flowId: string) {\n const { modals, setModals } = useContext(FrigadeContext)\n const [isCurrentModal, setIsCurrentModal] = useState(false)\n\n useEffect(() => {\n setModals([...modals, flowId])\n\n return () => setModals(modals.filter((v) => v !== flowId))\n }, [])\n\n useEffect(() => {\n const newIsCurrentModal = modals[0] === flowId\n\n if (newIsCurrentModal !== isCurrentModal) {\n setIsCurrentModal(newIsCurrentModal)\n }\n }, [modals])\n\n return {\n isCurrentModal,\n }\n}\n","import { Flow, FlowStep } from '@frigade/js'\n\nimport { TourProps } from '.'\nimport { useModal } from '../../hooks/useModal'\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({ step, flow, ...props }: TourStepProps) {\n const { isCurrentModal } = useModal(`${flow.id}-${step.id}`)\n\n if (!isCurrentModal) return null\n\n async function handleDismiss() {\n await flow.skip()\n }\n\n async function handlePrimary() {\n await step.complete()\n }\n\n const handleSecondary = handlePrimary\n\n return (\n <Tooltip\n key={step.id}\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row alignItems=\"center\" gap={3} justifyContent=\"flex-end\" part=\"tooltip-footer\" pt={4}>\n <Tooltip.Progress>{`${step?.order + 1}/${flow.steps.size}`}</Tooltip.Progress>\n\n <Tooltip.Secondary\n marginLeft=\"auto\"\n title={step.secondaryButtonTitle}\n onClick={handleSecondary}\n />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Tooltip>\n )\n}\n","import { Flow } from '@frigade/js'\n\nimport { useFlow } from '../../hooks/useFlow'\nimport { TooltipProps } from '../Tooltip'\nimport { TourStep } from './TourStep'\n\nexport interface TourProps extends TooltipProps {\n flowId: string\n}\n\nexport function Tour({ flowId, ...props }: TourProps) {\n const { flow } = useFlow(flowId)\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n step?.start()\n\n return <TourStep step={step} flow={flow} {...props} />\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import { Interpolation } from '@emotion/react';
4
5
  import * as Popover from '@radix-ui/react-popover';
5
6
 
6
7
  type BoxProps<T extends React$1.ElementType = React$1.ElementType> = {
@@ -14,7 +15,7 @@ interface ButtonProps extends BoxProps {
14
15
  title?: string;
15
16
  variant?: ButtonVariant;
16
17
  }
17
- declare function BaseButton({ as, children, css, title, variant, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
18
+ declare function BaseButton({ as, children, title, variant, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
18
19
  declare const Button: typeof BaseButton & {
19
20
  [k: string]: {
20
21
  ({ part, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
@@ -43,7 +44,7 @@ type TextVariant = 'Display1' | 'Display2' | 'H1' | 'H2' | 'H3' | 'H4' | 'Body1'
43
44
  interface TextProps extends BoxProps {
44
45
  variant?: TextVariant;
45
46
  }
46
- declare function BaseText({ as, children, css, variant, ...props }: TextProps): react_jsx_runtime.JSX.Element;
47
+ declare function BaseText({ as, children, variant, ...props }: TextProps): react_jsx_runtime.JSX.Element;
47
48
  declare const Text: typeof BaseText & {
48
49
  [k: string]: {
49
50
  (props: TextProps): react_jsx_runtime.JSX.Element;
@@ -61,12 +62,13 @@ interface MergedRadixPopoverProps extends Pick<Popover.PopoverProps, 'defaultOpe
61
62
  interface TooltipProps extends MergedRadixPopoverProps {
62
63
  align?: Popover.PopoverContentProps['align'] | 'before' | 'after';
63
64
  anchor?: string;
65
+ css?: Interpolation<Record<any, any>>;
64
66
  spotlight?: boolean;
65
67
  style?: React__default.CSSProperties;
66
68
  }
67
- declare function Tooltip({ anchor, children, css, spotlight, style, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
69
+ declare function Tooltip({ anchor, children, className, spotlight, style, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
68
70
  declare namespace Tooltip {
69
- var Close: ({ css, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
71
+ var Close: (props: ButtonProps) => react_jsx_runtime.JSX.Element;
70
72
  var Media: ({ src, ...props }: MediaProps) => react_jsx_runtime.JSX.Element;
71
73
  var Primary: ({ onClick, title, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
72
74
  var Progress: ({ children, ...props }: TextProps) => react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -1,3 +1,15 @@
1
- "use client";
2
- var ee=Object.defineProperty,Fe=Object.defineProperties;var Ee=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var Z=(e,t,o)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,a=(e,t)=>{for(var o in t||(t={}))te.call(t,o)&&Z(e,o,t[o]);if($)for(var o of $(t))oe.call(t,o)&&Z(e,o,t[o]);return e},u=(e,t)=>Fe(e,Ee(t));var p=(e,t)=>{var o={};for(var r in e)te.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&$)for(var r of $(e))t.indexOf(r)<0&&oe.call(e,r)&&(o[r]=e[r]);return o};var re=(e,t)=>{for(var o in t)ee(e,o,{get:t[o],enumerable:!0})};var k=(e,t,o)=>new Promise((r,n)=>{var l=c=>{try{d(o.next(c))}catch(f){n(f)}},s=c=>{try{d(o.throw(c))}catch(f){n(f)}},d=c=>c.done?r(c.value):Promise.resolve(c.value).then(l,s);d((o=o.apply(e,t)).next())});import*as de from"react";import{clsx as je}from"clsx";var Ae="px",De=e=>typeof e=="number"?`${4*e}${Ae}`:e,He=[-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"],Ve=Object.fromEntries(He.map(e=>[e,De(e)])),We={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",red500:"#c00000"},I={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"},colors:a({},We),fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:"400",demibold:"600",bold:"700"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.1)"},space:Ve};var i=e=>`var(--fr-colors-${e})`,ne={neutral:{background:i("white"),border:i("gray900"),foreground:i("black"),surface:i("gray700"),active:{background:i("white"),border:i("gray900"),foreground:i("black"),surface:i("gray700")},focus:{background:i("white"),border:i("gray900"),foreground:i("black"),surface:i("gray700")},hover:{background:i("white"),border:i("gray900"),foreground:i("black"),surface:i("gray700")}},primary:{background:i("blue500"),border:i("blue500"),foreground:i("white"),surface:i("blue500"),active:{background:i("blue400"),border:i("blue400"),foreground:i("white"),surface:i("blue400")},focus:{background:i("blue500"),border:i("blue500"),foreground:i("white"),surface:i("blue500")},hover:{background:i("blue400"),border:i("blue400"),foreground:i("white"),surface:i("blue400")}},secondary:{background:i("gray900"),border:i("gray900"),foreground:i("black"),surface:i("gray900"),active:{background:i("gray800"),border:i("gray800"),foreground:i("black"),surface:i("gray800")},focus:{background:i("gray900"),border:i("gray900"),foreground:i("black"),surface:i("gray900")},hover:{background:i("gray800"),border:i("gray800"),foreground:i("black"),surface:i("gray800")}}};var j=u(a({},I),{colors:a(a({},I.colors),ne)});function O(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let s=`${t.length?`${t}${o}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,O(d,s,o)):r[s]=d,r},{})}function L(e){return O(e,"--fr","-")}function ie(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=ie(n,`${t}-${r}`):o[r]=`var(${t}-${r})`}),o}var se=L(j),g=ie(j);var z=O(g.colors),ae={color:z,backgroundColor:z,borderColor:z,border:g.borders,borderRadius:g.radii,borderWidth:g.borderWidths,fontFamily:g.fontFamilies,fontSize:g.fontSizes,fontWeight:g.fontWeights,gap:g.space,lineHeight:g.lineHeights,margin:g.space,marginTop:g.space,marginRight:g.space,marginBottom:g.space,marginLeft:g.space,padding:g.space,paddingTop:g.space,paddingRight:g.space,paddingBottom:g.space,paddingLeft:g.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"]},le={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]};function Me(e){if(Array.isArray(e))return new Map(e.map(t=>[t,t]));if(typeof e=="object"&&e!==null)return new Map(Object.entries(e));if(["string","number"].includes(typeof e))return new Map([e,e]);throw new Error("Invalid entry in styleProps")}var $e=new Map(Object.entries(ae).map(([e,t])=>[e,Me(t)])),Ie=new Map(Object.entries(le).map(([e,t])=>[e,new Set(t)]));function pe(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let l=Ie.get(r);l!=null&&(l.forEach(s=>{t[s]=n}),delete t[r])}),Object.entries(t).forEach(([r,n])=>{let l=$e.get(r);if(l!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let s=n.split(" ");o[r]=s.map(d=>{var c;return(c=l.get(d.toString()))!=null?c:d}).join(" "),delete t[r]}else l.has(n.toString())&&(o[r]=l.get(n.toString()),delete t[r])}),{cssFromProps:o,unmatchedProps:t}}import{jsx as Ke}from"@emotion/react/jsx-runtime";function ce(e){return e&&`fr-${e}`}function Le(e){return e&&(Array.isArray(e)?e.map(t=>ce(t)).join(" "):ce(e))}function ze(d,s){var c=d,{as:e,children:t,className:o,css:r,part:n}=c,l=p(c,["as","children","className","css","part"]);let f=e!=null?e:"div",{cssFromProps:h,unmatchedProps:y}=pe(l),v=Le(n),B=o||v?je(o,v):void 0;return Ke(f,u(a({className:B,css:[a(a({boxSizing:"border-box"},h),r)]},y),{ref:s,children:t}))}var m=de.forwardRef(ze);var K={};re(K,{Body1:()=>Je,Body2:()=>Qe,Caption:()=>Ye,Display1:()=>Ne,Display2:()=>Ue,H1:()=>_e,H2:()=>Xe,H3:()=>qe,H4:()=>Ge,base:()=>P});var P=({fontFamilies:e})=>({fontFamily:e.default,margin:0}),Ne=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e["5xl"],fontWeight:t.bold,lineHeight:o["4xl"]}],Ue=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e["4xl"],fontWeight:t.bold,lineHeight:o["3xl"]}],_e=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e["3xl"],fontWeight:t.bold,lineHeight:o["2xl"]}],Xe=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e["2xl"],fontWeight:t.bold,lineHeight:o.xl}],qe=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.xl,fontWeight:t.bold,lineHeight:o.lg}],Ge=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.lg,fontWeight:t.bold,lineHeight:o.md}],Je=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.md,fontWeight:t.regular,lineHeight:o.md}],Qe=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.sm,fontWeight:t.regular,lineHeight:o.md}],Ye=({fontSizes:e,fontWeights:t,lineHeights:o})=>[P,{fontSize:e.xs,fontWeight:t.regular,lineHeight:o.sm}];import{jsx as ue}from"@emotion/react/jsx-runtime";function fe(l){var s=l,{as:e="span",children:t,css:o,variant:r="Body1"}=s,n=p(s,["as","children","css","variant"]);return ue(m,u(a({as:e,css:[K[r],o]},n),{children:t}))}var Ze=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],et=Object.fromEntries(Ze.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>ue(fe,u(a({as:t},r),{variant:e,children:r.children}));return o.displayName=`Text.${e}`,[e,o]})),T=Object.assign(fe,et);var N={};re(N,{Link:()=>rt,Plain:()=>nt,Primary:()=>tt,Secondary:()=>ot,base:()=>F});var F=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),tt=({colors:e})=>[F,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],ot=({colors:e})=>[F,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],rt=({colors:e})=>[F,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],nt=({colors:e})=>[F,{backgroundColor:e.transparent,color:e.neutral.foreground}];import{jsx as me,jsxs as at}from"@emotion/react/jsx-runtime";function ge(s){var d=s,{as:e,children:t,css:o={},title:r,variant:n="Primary"}=d,l=p(d,["as","children","css","title","variant"]);return at(m,u(a({as:e!=null?e:"button",css:[N[n],o]},l),{children:[t,r&&me(T.Body2,{fontWeight:"demibold",children:r})]}))}var it=["Primary","Secondary","Link","Plain"],st=Object.fromEntries(it.map(e=>{let t=e.toLocaleLowerCase(),o=l=>{var s=l,{part:r}=s,n=p(s,["part"]);return me(ge,u(a({part:[`button-${t}`,r]},n),{variant:e,children:n.children}))};return o.displayName=`Text.${e}`,[e,o]})),E=Object.assign(ge,st);import*as U from"react";import{jsx as xe}from"@emotion/react/jsx-runtime";var lt=U.forwardRef((n,r)=>{var l=n,{children:e,css:t}=l,o=p(l,["children","css"]);return xe(m,u(a({css:[{display:"flex",flexDirection:"row"},t]},o),{ref:r,children:e}))}),pt=U.forwardRef((n,r)=>{var l=n,{children:e,css:t}=l,o=p(l,["children","css"]);return xe(m,u(a({css:[{display:"flex",flexDirection:"column"},t]},o),{ref:r,children:e}))}),R={Column:pt,Row:lt};import{createContext as ct}from"react";import{Global as dt,ThemeProvider as ft}from"@emotion/react";import{jsx as be,jsxs as gt}from"@emotion/react/jsx-runtime";var _=ct({apiKey:"",config:{}});function ut({apiKey:e,children:t,config:o={},theme:r}){let n=r?L(r):{};return gt(_.Provider,{value:{apiKey:e,config:o},children:[be(dt,{styles:{":root":a(a({},se),n)}}),be(ft,{theme:g,children:t})]})}import{useEffect as Ct,useRef as vt,useState as q}from"react";import{XMarkIcon as Rt}from"@heroicons/react/24/solid";import*as w from"@radix-ui/react-popover";import{useCallback as mt,useLayoutEffect as xt,useState as ye}from"react";function he(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=ye(e),[r,n]=ye(null),l=mt(s=>{n(s)},[]);return xt(()=>{r&&o(r.getBoundingClientRect())},[r]),{node:r,rect:t,ref:l}}import{keyframes as bt}from"@emotion/react";import{jsx as Pe,jsxs as ht}from"@emotion/react/jsx-runtime";var yt=bt({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function we(r){var n=r,{style:e={},part:t=""}=n,o=p(n,["style","part"]);return ht(m,u(a({part:`dot-wrapper ${t}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},o),{children:[Pe(m,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${yt}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),Pe(m,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}import{jsx as Pt}from"@emotion/react/jsx-runtime";function Be(r){var n=r,{part:e,src:t}=n,o=p(n,["part","src"]);return Pt(m,a({as:"img",part:["image",e],src:t},o))}import{jsx as Bt}from"@emotion/react/jsx-runtime";function wt(e){var t,o,r;if(e.includes("youtube"))return`https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return`https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Te(r){var n=r,{part:e,src:t}=n,o=p(n,["part","src"]);let l=wt(t);return Bt(m,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:l},o))}import{jsx as Tt}from"@emotion/react/jsx-runtime";function X(r){var n=r,{src:e,type:t}=n,o=p(n,["src","type"]);return Tt(t==="video"?Te:Be,a({src:e},o))}function Ce({props:e,alignAttr:t,sideAttr:o}){let r=o!=null?o:"bottom",n={},l=()=>{var f;if(["after","before"].includes(e.align)){if(t=="start")return"before";if(t=="end")return"after"}return(f=e.align)!=null?f:"after"},s="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=s;let c=l();return["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var ve={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Re(e,t){var n,l,s,d,c;let o=Object.fromEntries(ve.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(ve.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0));if(o.align=(n=o.align)!=null?n:"after",o.side=(l=o.side)!=null?l:"bottom",["before","after"].includes(o.align)){let f={after:"end",before:"start"},h=(H,V)=>["top","bottom"].includes(V)?H=="after"?"marginLeft":"marginRight":H=="after"?"marginTop":"marginBottom",y=(s=o.alignOffset)!=null?s:0,v=(d=o.style)!=null?d:{},B=(c=o.side)!=null?c:"bottom",A=o.align;o.style=u(a({},v),{[h(A,B)]:y});let D=["top","bottom"].includes(B)?t.width:t.height;o.alignOffset=(D+y)*-1,o.align=f[A]}return{contentProps:o,rootProps:r}}import{jsx as b,jsxs as G}from"@emotion/react/jsx-runtime";function x(s){var d=s,{anchor:e,children:t,css:o,spotlight:r=!1,style:n}=d,l=p(d,["anchor","children","css","spotlight","style"]);let{node:c,rect:f,ref:h}=he(),{contentProps:y,rootProps:v}=Re(l,f),[B,A]=q(y.align),[D,H]=q(y.side);if(c!==null){let S=c.getAttribute("data-align"),Y=c.getAttribute("data-side");B!==S&&A(S),D!==Y&&H(Y)}let V=vt(null),[W,ke]=q(null);if(Ct(()=>{let S=document.querySelector(e);S!=null&&(V.current=S,ke(V))},[e]),W==null)return null;let M=W.current.getBoundingClientRect(),Q="0";typeof window!="undefined"&&(Q=window.getComputedStyle(W.current).borderRadius);let Oe=Ce({props:l,alignAttr:B,sideAttr:D});return G(w.Root,u(a({defaultOpen:!0},v),{children:[b(w.Anchor,{virtualRef:W}),b(w.Portal,{children:G("div",{css:o,children:[r&&b(m,{borderRadius:Q,part:"tooltip-spotlight",position:"absolute",css:{boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:M.height,left:M.left,top:M.top,width:M.width}}),b(w.Content,u(a({asChild:!0},y),{ref:h,children:G(R.Column,{backgroundColor:"white",borderRadius:"md",p:5,part:"tooltip-content",position:"relative",css:a({boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)",width:"300px"},n),children:[b(we,{style:Oe}),t]})}))]})})]}))}x.Close=o=>{var r=o,{css:e}=r,t=p(r,["css"]);return b(w.Close,{"aria-label":"Close",asChild:!0,children:b(E.Plain,u(a({css:[{top:0,right:0},e],part:"tooltip-close",position:"absolute"},t),{children:b(Rt,{height:"20",fill:"currentColor"})}))})};x.Media=o=>{var r=o,{src:e}=r,t=p(r,["src"]);return e==null?null:b(X,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e},t))};x.Primary=r=>{var n=r,{onClick:e,title:t}=n,o=p(n,["onClick","title"]);return t==null?null:b(E.Primary,a({title:t,onClick:e},o))};x.Progress=o=>{var r=o,{children:e}=r,t=p(r,["children"]);return e==null?null:b(T.Body2,u(a({fontWeight:"demibold",part:"progress"},t),{children:e}))};x.Secondary=r=>{var n=r,{onClick:e,title:t}=n,o=p(n,["onClick","title"]);return t==null?null:b(E.Secondary,a({title:t,onClick:e},o))};x.Subtitle=o=>{var r=o,{children:e}=r,t=p(r,["children"]);return e==null?null:b(T.Body2,u(a({part:"subtitle"},t),{children:e}))};x.Title=o=>{var r=o,{children:e}=r,t=p(r,["children"]);return e==null?null:b(T.Body1,u(a({fontWeight:"bold",mb:1,part:"title"},t),{children:e}))};import{Frigade as St}from"@frigade/js";import{useContext as kt,useState as Ot}from"react";function Se(e){let[t,o]=Ot(null),{apiKey:r,config:n}=kt(_);function l(){return k(this,null,function*(){let s=Object.fromEntries(Object.entries(n).filter(([f,h])=>["apiUrl","userId"].includes(f)&&h!=null)),c=yield(yield new St(r,s)).getFlow(e);o(c)})}return t===null&&l(),{flow:t,fetchFlow:l}}import{jsx as C,jsxs as J}from"@emotion/react/jsx-runtime";function Ft(o){var r=o,{flowId:e}=r,t=p(r,["flowId"]);var h;let{flow:n,fetchFlow:l}=Se(e);if(n==null||n!=null&&n.isCompleted||n!=null&&n.isSkipped)return null;n.start();let s=n.getCurrentStep();s==null||s.start();function d(){return k(this,null,function*(){yield n.skip(),l()})}function c(){return k(this,null,function*(){yield s.complete(),l()})}let f=c;return J(x,u(a({anchor:s.selector,onOpenAutoFocus:y=>y.preventDefault(),onPointerDownOutside:y=>y.preventDefault()},t),{children:[C(x.Close,{onClick:d}),C(x.Media,{src:(h=s.videoUri)!=null?h:s.imageUri,type:s.videoUri?"video":"image"}),C(x.Title,{children:s.title}),C(x.Subtitle,{children:s.subtitle}),J(R.Row,{pt:4,alignItems:"center",justifyContent:"space-between",children:[C(x.Progress,{children:`${n.getNumberOfCompletedSteps()}/${n.steps.size}`}),J(R.Row,{gap:3,children:[C(x.Secondary,{title:s.secondaryButtonTitle,onClick:f}),C(x.Primary,{title:s.primaryButtonTitle,onClick:c})]})]})]}))}export{m as Box,E as Button,R as Flex,ut as Provider,T as Text,x as Tooltip,Ft as Tour};
1
+ 'use client';
2
+ import * as _ from 'react';
3
+ import { createContext, useState, useRef, useEffect, useCallback, useLayoutEffect, useContext } from 'react';
4
+ import { clsx } from 'clsx';
5
+ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
6
+ import { keyframes, Global, ThemeProvider } from '@emotion/react';
7
+ import { XMarkIcon } from '@heroicons/react/24/solid';
8
+ import * as h from '@radix-ui/react-popover';
9
+ import { Frigade } from '@frigade/js';
10
+
11
+ var Z=Object.defineProperty,Ae=Object.defineProperties;var De=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var Y=(e,t,o)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))ee.call(t,o)&&Y(e,o,t[o]);if($)for(var o of $(t))te.call(t,o)&&Y(e,o,t[o]);return e},l=(e,t)=>Ae(e,De(t));var f=(e,t)=>{var o={};for(var r in e)ee.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&$)for(var r of $(e))t.indexOf(r)<0&&te.call(e,r)&&(o[r]=e[r]);return o};var oe=(e,t)=>{for(var o in t)Z(e,o,{get:t[o],enumerable:!0});};var R=(e,t,o)=>new Promise((r,n)=>{var s=u=>{try{d(o.next(u));}catch(p){n(p);}},c=u=>{try{d(o.throw(u));}catch(p){n(p);}},d=u=>u.done?r(u.value):Promise.resolve(u.value).then(s,c);d((o=o.apply(e,t)).next());});var He="px",Ie=e=>typeof e=="number"?`${4*e}${He}`:e,Ve=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],We=Object.fromEntries(Ve.map(e=>[e,Ie(e)])),$e={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"},j={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"},colors:i({},$e),fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"10px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.1)"},space:We};var a=e=>`var(--fr-colors-${e})`,re={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 L=l(i({},j),{colors:i(i({},j.colors),re)});function k(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let c=`${t.length?`${t}${o}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,k(d,c,o)):r[c]=d,r},{})}function z(e){return k(e,"--fr","-")}function ne(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]=ne(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var ie=z(L),g=ne(L);var K=k(g.colors),se={color:K,backgroundColor:K,borderColor:K,border:g.borders,borderRadius:g.radii,borderWidth:g.borderWidths,fontFamily:g.fontFamilies,fontSize:g.fontSizes,fontWeight:g.fontWeights,gap:g.space,lineHeight:g.lineHeights,margin:g.space,marginTop:g.space,marginRight:g.space,marginBottom:g.space,marginLeft:g.space,padding:g.space,paddingTop:g.space,paddingRight:g.space,paddingBottom:g.space,paddingLeft:g.space,alignContent:["center","start","end","flex-start","flex-end","normal","baseline","first baseline","last baseline","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","baseline","first baseline","last baseline","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],alignSelf:["auto","normal","center","start","end","self-start","self-end","flex-start","flex-end","baseline","first baseline","last baseline","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],flexDirection:["row","row-reverse","column","column-reverse","inherit","initial","revert","revert-layer","unset"],flexWrap:["nowrap","wrap","wrap-reverse","inherit","initial","revert","revert-layer","unset"],justifyContent:["center","start","end","flex-start","flex-end","left","right","normal","space-between","space-around","space-evenly","stretch","safe center","unsafe center","inherit","initial","revert","revert-layer","unset"],justifyItems:["normal","stretch","center","start","end","flex-start","flex-end","self-start","self-end","left","right","baseline","first baseline","last baseline","safe center","unsafe center","legacy right","legacy left","legacy center","inherit","initial","revert","revert-layer","unset"],boxSizing:["border-box","content-box","inherit","initial","revert","revert-layer","unset"],position:["static","relative","absolute","fixed","sticky","inherit","initial","revert","revert-layer","unset"],display:["block","block flex","block flow","block flow-root","block grid","contents","flex","flow-root","grid","inherit","initial","inline","inline flex","inline flow","inline flow-root","inline grid","inline-block","inline-flex","inline-grid","list-item","none","revert","revert-layer","table","table-row-group","table-header-group","table-footer-group","table-row","table-cell","table-column-group","table-column","table-caption","unset"]},ae={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 je(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 Le=new Map(Object.entries(se).map(([e,t])=>[e,je(t)])),ze=new Map(Object.entries(ae).map(([e,t])=>[e,new Set(t)]));function le(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let s=ze.get(r);s!=null&&(s.forEach(c=>{t[c]=n;}),delete t[r]);}),Object.entries(t).forEach(([r,n])=>{let s=Le.get(r);if(s!=null)if(typeof n=="string"&&n.indexOf(" ")>-1){let c=n.split(" ");o[r]=c.map(d=>{var u;return (u=s.get(d.toString()))!=null?u:d}).join(" "),delete t[r];}else s.has(n.toString())&&(o[r]=s.get(n.toString()),delete t[r]);}),{cssFromProps:o,unmatchedProps:t}}function ce(e){return e&&`fr-${e}`}function Ne(e){return e&&(Array.isArray(e)?e.map(t=>ce(t)).join(" "):ce(e))}function Ue(c,s){var d=c,{as:e,children:t,className:o,part:r}=d,n=f(d,["as","children","className","part"]);let u=e!=null?e:"div",{cssFromProps:p,unmatchedProps:y}=le(n),P=Ne(r),B=o||P?clsx(o,P):void 0;return jsx(u,l(i({className:B,css:[{boxSizing:"border-box"},p]},y),{ref:s,children:t}))}var m=_.forwardRef(Ue);var N={};oe(N,{Body1:()=>Ze,Body2:()=>et,Caption:()=>tt,Display1:()=>Xe,Display2:()=>qe,H1:()=>Ge,H2:()=>Je,H3:()=>Qe,H4:()=>Ye});var w={color:"neutral.foreground",fontFamily:"default",margin:0},Xe=l(i({},w),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),qe=l(i({},w),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Ge=l(i({},w),{fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"}),Je=l(i({},w),{fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"}),Qe=l(i({},w),{fontSize:"xl",fontWeight:"bold",lineHeight:"lg"}),Ye=l(i({},w),{fontSize:"lg",fontWeight:"bold",lineHeight:"md"}),Ze=l(i({},w),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),et=l(i({},w),{fontSize:"sm",fontWeight:"regular",lineHeight:"md"}),tt=l(i({},w),{fontSize:"xs",fontWeight:"regular",lineHeight:"sm"});function de(n){var s=n,{as:e="span",children:t,variant:o="Body1"}=s,r=f(s,["as","children","variant"]);return jsx(m,l(i(i({as:e},N[o]),r),{children:t}))}var ot=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],rt=Object.fromEntries(ot.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsx(de,l(i({as:t},r),{variant:e,children:r.children}));return o.displayName=`Text.${e}`,[e,o]})),C=Object.assign(de,rt);var U={};oe(U,{Link:()=>st,Plain:()=>at,Primary:()=>nt,Secondary:()=>it,base:()=>O});var O=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),nt=({colors:e})=>[O,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],it=({colors:e})=>[O,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],st=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],at=({colors:e})=>[O,{backgroundColor:e.transparent,color:e.neutral.foreground}];function ue(s){var c=s,{as:e,children:t,title:o,variant:r="Primary"}=c,n=f(c,["as","children","title","variant"]);return jsxs(m,l(i({as:e!=null?e:"button",css:U[r]},n),{children:[t,o&&jsx(C.Body2,{fontWeight:"demibold",color:"inherit",children:o})]}))}var lt=["Primary","Secondary","Link","Plain"],ct=Object.fromEntries(lt.map(e=>{let t=e.toLocaleLowerCase(),o=s=>{var c=s,{part:r}=c,n=f(c,["part"]);return jsx(ue,l(i({part:[`button-${t}`,r]},n),{variant:e,children:n.children}))};return o.displayName=`Text.${e}`,[e,o]})),F=Object.assign(ue,ct);var dt=_.forwardRef((n,r)=>{var s=n,{children:e,css:t}=s,o=f(s,["children","css"]);return jsx(m,l(i({css:[{display:"flex",flexDirection:"row"},t]},o),{ref:r,children:e}))}),ft=_.forwardRef((n,r)=>{var s=n,{children:e,css:t}=s,o=f(s,["children","css"]);return jsx(m,l(i({css:[{display:"flex",flexDirection:"column"},t]},o),{ref:r,children:e}))}),E={Column:ft,Row:dt};var M=createContext({apiKey:"",config:{},modals:[],setModals:()=>{}});function bt({apiKey:e,children:t,config:o={},theme:r}){let n=r?z(r):{},[s,c]=useState([]);return jsxs(M.Provider,{value:{apiKey:e,config:o,modals:s,setModals:c},children:[jsx(Global,{styles:{":root":i(i({},ie),n)}}),jsx(ThemeProvider,{theme:g,children:t})]})}function ye(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=useState(e),[r,n]=useState(null),s=useCallback(c=>{n(c);},[]);return useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:s}}var Ct=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Pe(r){var n=r,{style:e={},part:t=""}=n,o=f(n,["style","part"]);return jsxs(m,l(i({part:`dot-wrapper ${t}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},o),{children:[jsx(m,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Ct}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(m,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function we(r){var n=r,{part:e,src:t}=n,o=f(n,["part","src"]);return jsx(m,i({as:"img",part:["image",e],src:t},o))}function Bt(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Ce(r){var n=r,{part:e,src:t}=n,o=f(n,["part","src"]);let s=Bt(t);return jsx(m,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:s},o))}function X(r){var n=r,{src:e,type:t}=n,o=f(n,["src","type"]);return jsx(t==="video"?Ce:we,i({src:e},o))}function Te({props:e,alignAttr:t,sideAttr:o}){let r=o!=null?o:"bottom",n={},s=()=>{var p;if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return (p=e.align)!=null?p:"after"},c="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=c;let u=s();return ["before","end"].includes(u)?["top","bottom"].includes(r)?n.right=c:n.bottom=c:["after","start"].includes(u)?["top","bottom"].includes(r)?n.left=c:n.top=c:["top","bottom"].includes(r)?n.left=`calc(50% + ${c})`:n.top=`calc(50% + ${c})`,n}var ve={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Be(e,t){var n,s,c,d,u;let o=Object.fromEntries(ve.content.map(p=>[p,e[p]]).filter(p=>p[1]!==void 0)),r=Object.fromEntries(ve.root.map(p=>[p,e[p]]).filter(p=>p[1]!==void 0));if(o.align=(n=o.align)!=null?n:"after",o.side=(s=o.side)!=null?s:"bottom",["before","after"].includes(o.align)){let p={after:"end",before:"start"},y=(H,I)=>["top","bottom"].includes(I)?H=="after"?"marginLeft":"marginRight":H=="after"?"marginTop":"marginBottom",P=(c=o.alignOffset)!=null?c:0,B=(d=o.style)!=null?d:{},v=(u=o.side)!=null?u:"bottom",A=o.align;o.style=l(i({},B),{[y(A,v)]:P});let D=["top","bottom"].includes(v)?t.width:t.height;o.alignOffset=(D+P)*-1,o.align=p[A];}return {contentProps:o,rootProps:r}}function x(c){var d=c,{anchor:e,children:t,className:o,spotlight:r=!1,style:n}=d,s=f(d,["anchor","children","className","spotlight","style"]);let{node:u,rect:p,ref:y}=ye(),{contentProps:P,rootProps:B}=Be(s,p),[v,A]=useState(P.align),[D,H]=useState(P.side);if(u!==null){let S=u.getAttribute("data-align"),Q=u.getAttribute("data-side");v!==S&&A(S),D!==Q&&H(Q);}let I=useRef(null),[V,Ee]=useState(null);if(useEffect(()=>{let S=document.querySelector(e);S!=null&&(I.current=S,Ee(I));},[e]),V==null)return null;let W=V.current.getBoundingClientRect(),J="0";typeof window!="undefined"&&(J=window.getComputedStyle(V.current).borderRadius);let Me=Te({props:s,alignAttr:v,sideAttr:D});return jsxs(h.Root,l(i({defaultOpen:!0},B),{children:[jsx(h.Anchor,{virtualRef:V}),jsx(h.Portal,{children:jsxs("div",{className:o,css:{position:"absolute",zIndex:9999},children:[r&&jsx(m,{borderRadius:J,part:"tooltip-spotlight",position:"absolute",css:{boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:W.height,left:W.left,top:W.top,width:W.width}}),jsx(h.Content,l(i({asChild:!0},P),{ref:y,children:jsxs(E.Column,{backgroundColor:"neutral.background",borderRadius:"md",p:5,part:"tooltip-content",position:"relative",css:i({boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.1)",maxWidth:"360px"},n),children:[jsx(Pe,{style:Me}),t]})}))]})})]}))}x.Close=e=>jsx(h.Close,{"aria-label":"Close",asChild:!0,children:jsx(F.Plain,l(i({css:{top:"12px",right:"4px"},part:"tooltip-close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});x.Media=o=>{var r=o,{src:e}=r,t=f(r,["src"]);return e==null?null:jsx(X,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e},t))};x.Primary=r=>{var n=r,{onClick:e,title:t}=n,o=f(n,["onClick","title"]);return t==null?null:jsx(F.Primary,i({title:t,onClick:e},o))};x.Progress=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsx(C.Body2,l(i({fontWeight:"demibold",part:"progress"},t),{children:e}))};x.Secondary=r=>{var n=r,{onClick:e,title:t}=n,o=f(n,["onClick","title"]);return t==null?null:jsx(F.Secondary,i({title:t,onClick:e},o))};x.Subtitle=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsx(C.Body2,l(i({part:"subtitle"},t),{children:e}))};x.Title=o=>{var r=o,{children:e}=r,t=f(r,["children"]);return e==null?null:jsx(C.Body1,l(i({fontWeight:"bold",mb:1,part:"title"},t),{children:e}))};function Se(e){let[t,o]=useState(),{apiKey:r,config:n}=useContext(M),s=Object.fromEntries(Object.entries(n).filter(([p,y])=>["apiUrl","userId"].includes(p)&&y!=null)),d=useRef(new Frigade(r,s)).current,u=p=>{if(p.id!==e)return;let y=Object.assign(Object.create(Object.getPrototypeOf(p)),p);o(y);};return useEffect(()=>(R(this,null,function*(){let p=yield d.getFlow(e);o(p);}),d.onFlowStateChange(u),()=>{d.removeOnFlowStateChangeHandler(u);}),[]),{flow:t}}function ke(e){let{modals:t,setModals:o}=useContext(M),[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 Fe(r){var n=r,{step:e,flow:t}=n,o=f(n,["step","flow"]);var p;let{isCurrentModal:s}=ke(`${t.id}-${e.id}`);if(!s)return null;function c(){return R(this,null,function*(){yield t.skip();})}function d(){return R(this,null,function*(){yield e.complete();})}let u=d;return jsxs(x,l(i({anchor:e.selector,onOpenAutoFocus:y=>y.preventDefault(),onPointerDownOutside:y=>y.preventDefault()},o),{children:[jsx(x.Close,{onClick:c}),jsx(x.Media,{src:(p=e.videoUri)!=null?p:e.imageUri,type:e.videoUri?"video":"image"}),jsx(x.Title,{children:e.title}),jsx(x.Subtitle,{children:e.subtitle}),jsxs(E.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsx(x.Progress,{children:`${(e==null?void 0:e.order)+1}/${t.steps.size}`}),jsx(x.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:u}),jsx(x.Primary,{title:e.primaryButtonTitle,onClick:d})]})]}),e.id)}function Wt(o){var r=o,{flowId:e}=r,t=f(r,["flowId"]);let{flow:n}=Se(e);if(n==null||n.isVisible===!1)return null;n.start();let s=n.getCurrentStep();return s==null||s.start(),jsx(Fe,i({step:s,flow:n},t))}
12
+
13
+ export { m as Box, F as Button, E as Flex, bt as Provider, C as Text, x as Tooltip, Wt as Tour };
14
+ //# sourceMappingURL=out.js.map
3
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Box/index.tsx","../src/shared/tokens/scalarTokens.ts","../src/shared/tokens/semanticColors.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/styleProps.ts","../src/components/Box/stylePropsToCss.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Provider/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useFlow.ts","../src/components/Tour/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { stylePropsToCss } from './stylePropsToCss'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: string | string[] | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => prefixPart(p)).join(' ') : prefixPart(part)\n}\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: string | string[]\n} & React.ComponentPropsWithRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, 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 return (\n // @ts-ignore: TODO: ref types are yet again complaining\n <Component\n className={classNameWithPart}\n css={[{ boxSizing: 'border-box', ...cssFromProps, ...css }]}\n {...unmatchedProps}\n ref={ref}\n >\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef)\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceScale = {\n [K in SpaceKeys[any]]: string\n}\nconst spaceScale = Object.fromEntries(spaceKeys.map((key) => [key, spaceValue(key)])) as SpaceScale\n\nexport const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n\n// Scalar = Tokens with literal values\nexport const scalarTokens = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n\n colors: {\n ...palette,\n },\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n regular: '400',\n demibold: '600',\n bold: '700',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n radii: {\n md: '8px',\n lg: '20px',\n round: '50%',\n },\n shadows: {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n },\n space: spaceScale,\n}\n","const colorVar = (colorName) => `var(--fr-colors-${colorName})`\n\n// Semantic = Tokens that reference Scalars & contextualize them according to how they're used\nexport const semanticColors = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","import { scalarTokens } from './scalarTokens'\nimport { semanticColors } from './semanticColors'\n\nexport { scalarTokens, semanticColors }\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...scalarTokens,\n colors: {\n ...scalarTokens.colors,\n ...semanticColors,\n },\n}\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(obj, path = '--fr') {\n const newObj: Record<string, any> = {}\n\n Object.keys(obj).forEach((key) => {\n const currentValue = obj[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst colorTokens: Record<string, unknown> = flattenObject(theme.colors)\n\n/*\n TODO:\n - top / right / bottom / left\n*/\n\nexport const styleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginTop: theme.space,\n marginRight: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n\n padding: theme.space,\n paddingTop: theme.space,\n paddingRight: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n\n alignContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'normal',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignSelf: [\n 'auto',\n 'normal',\n 'center',\n 'start',\n 'end',\n 'self-start',\n 'self-end',\n 'flex-start',\n 'flex-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexDirection: [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexWrap: [\n 'nowrap',\n 'wrap',\n 'wrap-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'left',\n 'right',\n 'normal',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'left',\n 'right',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'legacy right',\n 'legacy left',\n 'legacy center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n boxSizing: ['border-box', 'content-box', 'inherit', 'initial', 'revert', 'revert-layer', 'unset'],\n\n position: [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n display: [\n 'block',\n 'block flex',\n 'block flow',\n 'block flow-root',\n 'block grid',\n 'contents',\n 'flex',\n 'flow-root',\n 'grid',\n 'inherit',\n 'initial',\n 'inline',\n 'inline flex',\n 'inline flow',\n 'inline flow-root',\n 'inline grid',\n 'inline-block',\n 'inline-flex',\n 'inline-grid',\n 'list-item',\n 'none',\n 'revert',\n 'revert-layer',\n 'table',\n 'table-row-group',\n 'table-header-group',\n 'table-footer-group',\n 'table-row',\n 'table-cell',\n 'table-column-group',\n 'table-column',\n 'table-caption',\n 'unset',\n ],\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n","import { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n throw new Error('Invalid entry in styleProps')\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nexport function stylePropsToCss(props: Record<any, any>) {\n const unmatchedProps = Object.assign({}, props)\n const cssFromProps = {}\n\n // Convert shorthand styleProps to full versions\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const matchedShorthand = stylePropShorthandsMap.get(propName)\n if (matchedShorthand != null) {\n matchedShorthand.forEach((propName) => {\n unmatchedProps[propName] = propValue\n })\n\n delete unmatchedProps[propName]\n }\n })\n\n // Convert styleProps to style object\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const styleProp = stylePropsMap.get(propName)\n if (styleProp != null) {\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n // Split space-separated values out and process them individually\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n delete unmatchedProps[propName]\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n delete unmatchedProps[propName]\n }\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","export const base = ({ fontFamilies }) => ({\n fontFamily: fontFamilies.default,\n margin: 0,\n})\n\nexport const Display1 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes['5xl'],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights['4xl'],\n },\n]\n\nexport const Display2 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes['4xl'],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights['3xl'],\n },\n]\n\nexport const H1 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes['3xl'],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights['2xl'],\n },\n]\n\nexport const H2 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes['2xl'],\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.xl,\n },\n]\n\nexport const H3 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.xl,\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.lg,\n },\n]\n\nexport const H4 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.lg,\n fontWeight: fontWeights.bold,\n lineHeight: lineHeights.md,\n },\n]\n\nexport const Body1 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.md,\n fontWeight: fontWeights.regular,\n lineHeight: lineHeights.md,\n },\n]\n\nexport const Body2 = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.sm,\n fontWeight: fontWeights.regular,\n lineHeight: lineHeights.md,\n },\n]\n\nexport const Caption = ({ fontSizes, fontWeights, lineHeights }) => [\n base,\n {\n fontSize: fontSizes.xs,\n fontWeight: fontWeights.regular,\n lineHeight: lineHeights.sm,\n },\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, css, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} css={[styles[variant], css]} {...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 { 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, css = {}, title, variant = 'Primary', ...props }: ButtonProps) {\n return (\n <Box as={as ?? 'button'} css={[styles[variant], css]} {...props}>\n {children}\n {title && <Text.Body2 fontWeight=\"demibold\">{title}</Text.Body2>}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const variantPart = variant.toLocaleLowerCase()\n\n const component = ({ part, ...props }: ButtonProps) => (\n <BaseButton part={[`button-${variantPart}`, part]} {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { createContext } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport { createThemeVariables, theme as themeTokens, themeVariables } from '../../shared/theme'\n\nexport const FrigadeContext = createContext<{ apiKey: string; config: ProviderConfig }>({\n apiKey: '',\n config: {},\n})\n\n// TODO: type theme something like Partial<typeof themeContract>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n children?: React.ReactNode\n config?: ProviderConfig\n theme?: Record<any, any>\n}\n\ninterface ProviderConfig {\n apiUrl?: string\n userId?: string\n}\n\nexport function Provider({ apiKey, children, config = {}, theme }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n\n return (\n <FrigadeContext.Provider value={{ apiKey, config }}>\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Dot } from './Dot'\nimport { Flex } from '../Flex/Flex'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToRadixProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n css,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToRadixProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div css={css}>\n {spotlight && (\n <Box\n borderRadius={anchorRadius}\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Flex.Column\n backgroundColor=\"white\"\n borderRadius=\"md\"\n p={5}\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n width: '300px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Flex.Column>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = ({ css, ...props }: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={[\n {\n top: 0,\n right: 0,\n },\n css,\n ]}\n part=\"tooltip-close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"20\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToRadixProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps['alignOffset'] = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { Frigade, Flow } from '@frigade/js'\nimport { useContext, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFlow(flowId: string) {\n const [flow, setFlow] = useState<Flow>(null)\n const { apiKey, config } = useContext(FrigadeContext)\n\n async function fetchFlow() {\n const filteredConfig = Object.fromEntries(\n Object.entries(config).filter(([k, v]) => ['apiUrl', 'userId'].includes(k) && v != null)\n )\n\n const frigade = await new Frigade(apiKey, filteredConfig)\n\n const flowResponse: Flow = await frigade.getFlow(flowId)\n\n setFlow(flowResponse)\n }\n\n if (flow === null) {\n fetchFlow()\n }\n\n // TEMP: Expose a way to manually refresh the flow.\n // TODO: Automatically update state when something like step.complete() is called\n return { flow, fetchFlow }\n}\n","import { useFlow } from '../../hooks/useFlow'\n\nimport { Flex } from '../Flex/Flex'\nimport { Tooltip, TooltipProps } from '../Tooltip'\n\nexport interface TourProps extends TooltipProps {\n flowId: string\n}\n\nexport function Tour({ flowId, ...props }: TourProps) {\n const { flow, fetchFlow } = useFlow(flowId)\n\n if (flow == null || flow?.isCompleted || flow?.isSkipped) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n\n step?.start()\n\n async function handleDismiss() {\n await flow.skip()\n\n // TEMP: Manually refreshing flow data until useFlow can handle it internally\n fetchFlow()\n }\n\n async function handlePrimary() {\n await step.complete()\n\n // TEMP: Manually refreshing flow data until useFlow can handle it internally\n fetchFlow()\n }\n\n const handleSecondary = handlePrimary\n\n return (\n <Tooltip\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row pt={4} alignItems=\"center\" justifyContent=\"space-between\">\n <Tooltip.Progress>\n {`${flow.getNumberOfCompletedSteps()}/${flow.steps.size}`}\n </Tooltip.Progress>\n\n <Flex.Row gap={3}>\n <Tooltip.Secondary title={step.secondaryButtonTitle} onClick={handleSecondary} />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Flex.Row>\n </Tooltip>\n )\n}\n"],"mappings":";w2BAAA,UAAYA,OAAW,QACvB,OAAS,QAAAC,OAAY,OCArB,IAAMC,GAAa,KAEbC,GAAcC,GAClB,OAAOA,GAAQ,SAAW,GAAG,EAAcA,IAAMF,KAAeE,EAE5DC,GAAY,CAChB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,MACF,EAOMC,GAAa,OAAO,YAAYD,GAAU,IAAKD,GAAQ,CAACA,EAAKD,GAAWC,CAAG,CAAC,CAAC,CAAC,EAEvEG,GAAU,CACrB,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,SAAU,UACV,SAAU,UACV,SAAU,UACV,YAAa,YAGb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A,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CACT,OACA,SACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,WACA,iBACA,gBACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,cAAe,CACb,MACA,cACA,SACA,iBACA,UACA,UACA,SACA,eACA,OACF,EAEA,SAAU,CACR,SACA,OACA,eACA,UACA,UACA,SACA,eACA,OACF,EAEA,eAAgB,CACd,SACA,QACA,MACA,aACA,WACA,OACA,QACA,SACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,aAAc,CACZ,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,OACA,QACA,WACA,iBACA,gBACA,cACA,gBACA,eACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CAAC,aAAc,cAAe,UAAW,UAAW,SAAU,eAAgB,OAAO,EAEhG,SAAU,CACR,SACA,WACA,WACA,QACA,SACA,UACA,UACA,SACA,eACA,OACF,EAEA,QAAS,CACP,QACA,aACA,aACA,kBACA,aACA,WACA,OACA,YACA,OACA,UACA,UACA,SACA,cACA,cACA,mBACA,cACA,eACA,cACA,cACA,YACA,OACA,SACA,eACA,QACA,kBACA,qBACA,qBACA,YACA,aACA,qBACA,eACA,gBACA,OACF,CACF,EAEaE,GAAsB,CACjC,EAAG,CAAC,QAAQ,EACZ,GAAI,CAAC,WAAW,EAChB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,aAAc,aAAa,EAChC,GAAI,CAAC,YAAa,cAAc,EAEhC,EAAG,CAAC,SAAS,EACb,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,eAAe,EACpB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAe,cAAc,EAClC,GAAI,CAAC,aAAc,eAAe,CACpC,ECpPA,SAASC,GAAUC,EA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,EACb,UAAApB,EAACgB,EAAQ,UAAR,CAAkB,MAAOL,EAAK,qBAAsB,QAASI,EAAiB,EAC/Ef,EAACgB,EAAQ,QAAR,CAAgB,MAAOL,EAAK,mBAAoB,QAASG,EAAe,GAC3E,GACF,IACF,CAEJ","names":["React","clsx","SPACE_UNIT","spaceValue","key","spaceKeys","spaceScale","palette","scalarTokens","__spreadValues","colorVar","colorName","semanticColors","tokens","__spreadProps","__spreadValues","scalarTokens","semanticColors","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","tokens","flattenObject","mapTokensToThemeVariables","obj","path","newObj","key","currentValue","themeVariables","theme","colorTokens","flattenObject","theme","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","styleProps","propName","stylePropShorthandsMap","stylePropShorthands","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","_a","jsx","prefixPart","part","processPart","p","BoxWithRef","_a","ref","_b","as","children","className","css","props","__objRest","Component","cssFromProps","unmatchedProps","stylePropsToCss","processedPart","classNameWithPart","clsx","__spreadProps","__spreadValues","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","fontFamilies","fontSizes","fontWeights","lineHeights","jsx","BaseText","_a","_b","as","children","css","variant","props","__objRest","Box","__spreadProps","__spreadValues","Text_styles_exports","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","__export","Link","Plain","Primary","Secondary","base","radii","space","colors","jsx","jsxs","BaseButton","_a","_b","as","children","css","title","variant","props","__objRest","Box","__spreadProps","__spreadValues","Button_styles_exports","Text","buttonVariantNames","buttonVariantComponents","variantPart","component","part","Button","React","jsx","Row","_a","ref","_b","children","css","props","__objRest","Box","__spreadProps","__spreadValues","Column","Flex","createContext","Global","ThemeProvider","jsx","jsxs","FrigadeContext","createContext","Provider","apiKey","children","config","theme","themeOverrides","createThemeVariables","Global","__spreadValues","themeVariables","ThemeProvider","useEffect","useRef","useState","XMarkIcon","Popover","useCallback","useLayoutEffect","useState","useBoundingClientRect","initialRect","rect","setRect","node","setNode","ref","keyframes","jsx","jsxs","pulse","keyframes","Dot","_a","_b","style","part","props","__objRest","Box","__spreadProps","__spreadValues","jsx","Image","_a","_b","part","src","props","__objRest","Box","__spreadValues","jsx","getVideoEmbedSrc","videoUri","_a","_b","_c","Video","part","src","props","__objRest","videoEmbedSrc","Box","__spreadValues","jsx","Media","_a","_b","src","type","props","__objRest","Video","Image","__spreadValues","getDotPosition","props","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","_a","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToRadixProps","props","contentRect","_a","_b","_c","_d","_e","contentProps","propName","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","currentSide","currentAlign","__spreadProps","__spreadValues","lengthOfCurrentSide","jsx","jsxs","Tooltip","_a","_b","anchor","children","css","spotlight","style","props","__objRest","contentNode","contentRect","contentRef","useBoundingClientRect","contentProps","rootProps","mapTooltipPropsToRadixProps","alignAttr","setAlignAttr","useState","sideAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","useRef","anchorElementRef","setAnchorElementRef","useEffect","anchorQuery","anchorRect","anchorRadius","dotPosition","getDotPosition","__spreadProps","__spreadValues","Box","Flex","Dot","Button","XMarkIcon","src","Media","onClick","title","Text","Frigade","useContext","useState","useFlow","flowId","flow","setFlow","useState","apiKey","config","useContext","FrigadeContext","fetchFlow","__async","filteredConfig","k","v","flowResponse","Frigade","jsx","jsxs","Tour","_a","_b","flowId","props","__objRest","flow","fetchFlow","useFlow","step","handleDismiss","__async","handlePrimary","handleSecondary","Tooltip","__spreadProps","__spreadValues","e","Flex"]}
1
+ {"version":3,"sources":["../src/components/Box/index.tsx","../src/shared/tokens/scalarTokens.ts","../src/shared/tokens/semanticColors.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/styleProps.ts","../src/components/Box/stylePropsToCss.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Provider/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useFlow.ts","../src/hooks/useModal.ts","../src/components/Tour/TourStep.tsx","../src/components/Tour/index.tsx"],"names":["React","clsx","SPACE_UNIT","spaceValue","key","spaceKeys","spaceScale","palette","scalarTokens","__spreadValues","colorVar","colorName","semanticColors","tokens","__spreadProps","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","colorTokens","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","_a","jsx","prefixPart","part","processPart","p","BoxWithRef","ref","_b","as","children","className","__objRest","Component","processedPart","classNameWithPart","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","BaseText","variant","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","Link","Plain","Primary","Secondary","radii","space","colors","jsxs","BaseButton","title","buttonVariantNames","buttonVariantComponents","variantPart","Button","Row","css","Column","Flex","createContext","useState","Global","ThemeProvider","FrigadeContext","Provider","apiKey","config","themeOverrides","modals","setModals","useEffect","useRef","XMarkIcon","Popover","useCallback","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","Image","src","getVideoEmbedSrc","videoUri","_c","Video","videoEmbedSrc","Media","type","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToPopoverProps","contentRect","_d","_e","contentProps","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","lengthOfCurrentSide","Tooltip","anchor","spotlight","contentNode","contentRef","setAlignAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","anchorElementRef","setAnchorElementRef","anchorQuery","anchorRect","anchorRadius","dotPosition","onClick","Frigade","useContext","useFlow","flowId","flow","setFlow","filteredConfig","frigade","handler","updatedFlow","clonedFlow","__async","flowResponse","useModal","isCurrentModal","setIsCurrentModal","newIsCurrentModal","TourStep","step","handleDismiss","handlePrimary","handleSecondary","e","Tour"],"mappings":"q2BAAA,UAAYA,OAAW,QACvB,OAAS,QAAAC,OAAY,OCArB,IAAMC,GAAa,KAEbC,GAAcC,GAClB,OAAOA,GAAQ,SAAW,GAAG,EAAcA,IAAMF,KAAeE,EAE5DC,GAAY,CAChB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IACA,EACA,GACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,MACF,EAOMC,GAAa,OAAO,YAAYD,GAAU,IAAKD,GAAQ,CAACA,EAAKD,GAAWC,CAAG,CAAC,CAAC,CAAC,EAEvEG,GAAU,CACrB,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,MAAO,UACP,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,SAAU,UACV,SAAU,UACV,SAAU,UACV,YAAa,YACb,QAAS,UAGT,OAAQ,SACV,EAGaC,EAAe,CAC1B,QAAS,CACP,GAAI,WACN,EACA,aAAc,CAC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,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CACT,OACA,SACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,WACA,iBACA,gBACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,cAAe,CACb,MACA,cACA,SACA,iBACA,UACA,UACA,SACA,eACA,OACF,EAEA,SAAU,CACR,SACA,OACA,eACA,UACA,UACA,SACA,eACA,OACF,EAEA,eAAgB,CACd,SACA,QACA,MACA,aACA,WACA,OACA,QACA,SACA,gBACA,eACA,eACA,UACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,aAAc,CACZ,SACA,UACA,SACA,QACA,MACA,aACA,WACA,aACA,WACA,OACA,QACA,WACA,iBACA,gBACA,cACA,gBACA,eACA,cACA,gBACA,UACA,UACA,SACA,eACA,OACF,EAEA,UAAW,CAAC,aAAc,cAAe,UAAW,UAAW,SAAU,eAAgB,OAAO,EAEhG,SAAU,CACR,SACA,WACA,WACA,QACA,SACA,UACA,UACA,SACA,eACA,OACF,EAEA,QAAS,CACP,QACA,aACA,aACA,kBACA,aACA,WACA,OACA,YACA,OACA,UACA,UACA,SACA,cACA,cACA,mBACA,cACA,eACA,cACA,cACA,YACA,OACA,SACA,eACA,QACA,kBACA,qBACA,qBACA,YACA,aACA,qBACA,eACA,gBACA,OACF,CACF,EAEaG,GAAsB,CACjC,EAAG,CAAC,QAAQ,EACZ,GAAI,CAAC,WAAW,EAChB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,aAAc,aAAa,EAChC,GAAI,CAAC,YAAa,cAAc,EAEhC,EAAG,CAAC,SAAS,EACb,GAAI,CAAC,YAAY,EACjB,GAAI,CAAC,cAAc,EACnB,GAAI,CAAC,eAAe,EACpB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,cAAe,cAAc,EAClC,GAAI,CAAC,aAAc,eAAe,CACpC,ECpPA,SAASC,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e,SAAAmC,EAAK,MAAM,EAC3BrJ,EAACkH,EAAQ,SAAR,CAAkB,SAAAmC,EAAK,SAAS,EAEjC1G,GAACU,EAAK,IAAL,CAAS,WAAW,SAAS,IAAK,EAAG,eAAe,WAAW,KAAK,iBAAiB,GAAI,EACxF,UAAArD,EAACkH,EAAQ,SAAR,CAAkB,aAAGmC,GAAA,YAAAA,EAAM,OAAQ,KAAKd,EAAK,MAAM,OAAO,EAE3DvI,EAACkH,EAAQ,UAAR,CACC,WAAW,OACX,MAAOmC,EAAK,qBACZ,QAASG,EACX,EACAxJ,EAACkH,EAAQ,QAAR,CAAgB,MAAOmC,EAAK,mBAAoB,QAASE,EAAe,GAC3E,KAzBKF,EAAK,EA0BZ,CAEJ,CCpCS,cAAArJ,OAAA,6BAZF,SAAS0J,GAAK3J,EAAiC,CAAjC,IAAAQ,EAAAR,EAAE,QAAAuI,CAVvB,EAUqB/H,EAAaf,EAAAmB,EAAbJ,EAAa,CAAX,WACrB,GAAM,CAAE,KAAAgI,CAAK,EAAIF,GAAQC,CAAM,EAE/B,GAAIC,GAAQ,MAAQA,EAAK,YAAc,GACrC,OAAO,KAGTA,EAAK,MAAM,EAEX,IAAMc,EAAOd,EAAK,eAAe,EACjC,OAAAc,GAAA,MAAAA,EAAM,QAECrJ,GAACoJ,GAAA3L,EAAA,CAAS,KAAM4L,EAAM,KAAMd,GAAU/I,EAAO,CACtD","sourcesContent":["import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { stylePropsToCss } from './stylePropsToCss'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: string | string[] | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => prefixPart(p)).join(' ') : prefixPart(part)\n}\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: string | string[]\n} & React.ComponentPropsWithRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, part, ...props }: BoxProps<T>,\n ref: React.ForwardedRef<T>\n) {\n const Component = as ?? 'div'\n\n const { cssFromProps, unmatchedProps } = stylePropsToCss(props)\n\n const processedPart = processPart(part)\n const classNameWithPart = className || processedPart ? clsx(className, processedPart) : undefined\n\n const cssProp = [{ boxSizing: 'border-box' }, cssFromProps]\n\n return (\n // @ts-ignore: TODO: ref types are yet again complaining\n <Component className={classNameWithPart} css={cssProp} {...unmatchedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef)\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceScale = {\n [K in SpaceKeys[any]]: string\n}\nconst spaceScale = Object.fromEntries(spaceKeys.map((key) => [key, spaceValue(key)])) as SpaceScale\n\nexport const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n inherit: 'inherit',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n\n// Scalar = Tokens with literal values\nexport const scalarTokens = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n\n colors: {\n ...palette,\n },\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n thin: '100',\n extralight: '200',\n light: '300',\n regular: '400',\n medium: '500',\n demibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n radii: {\n md: '10px',\n lg: '20px',\n round: '50%',\n },\n shadows: {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n },\n space: spaceScale,\n}\n","const colorVar = (colorName) => `var(--fr-colors-${colorName})`\n\n// Semantic = Tokens that reference Scalars & contextualize them according to how they're used\nexport const semanticColors = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray500'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","import { scalarTokens } from './scalarTokens'\nimport { semanticColors } from './semanticColors'\n\nexport { scalarTokens, semanticColors }\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...scalarTokens,\n colors: {\n ...scalarTokens.colors,\n ...semanticColors,\n },\n}\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(obj, path = '--fr') {\n const newObj: Record<string, any> = {}\n\n Object.keys(obj).forEach((key) => {\n const currentValue = obj[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst colorTokens: Record<string, unknown> = flattenObject(theme.colors)\n\n/*\n TODO:\n - top / right / bottom / left\n*/\n\nexport const styleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginTop: theme.space,\n marginRight: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n\n padding: theme.space,\n paddingTop: theme.space,\n paddingRight: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n\n alignContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'normal',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n alignSelf: [\n 'auto',\n 'normal',\n 'center',\n 'start',\n 'end',\n 'self-start',\n 'self-end',\n 'flex-start',\n 'flex-end',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexDirection: [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n flexWrap: [\n 'nowrap',\n 'wrap',\n 'wrap-reverse',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyContent: [\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'left',\n 'right',\n 'normal',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n 'safe center',\n 'unsafe center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n justifyItems: [\n 'normal',\n 'stretch',\n 'center',\n 'start',\n 'end',\n 'flex-start',\n 'flex-end',\n 'self-start',\n 'self-end',\n 'left',\n 'right',\n 'baseline',\n 'first baseline',\n 'last baseline',\n 'safe center',\n 'unsafe center',\n 'legacy right',\n 'legacy left',\n 'legacy center',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n boxSizing: ['border-box', 'content-box', 'inherit', 'initial', 'revert', 'revert-layer', 'unset'],\n\n position: [\n 'static',\n 'relative',\n 'absolute',\n 'fixed',\n 'sticky',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n ],\n\n display: [\n 'block',\n 'block flex',\n 'block flow',\n 'block flow-root',\n 'block grid',\n 'contents',\n 'flex',\n 'flow-root',\n 'grid',\n 'inherit',\n 'initial',\n 'inline',\n 'inline flex',\n 'inline flow',\n 'inline flow-root',\n 'inline grid',\n 'inline-block',\n 'inline-flex',\n 'inline-grid',\n 'list-item',\n 'none',\n 'revert',\n 'revert-layer',\n 'table',\n 'table-row-group',\n 'table-header-group',\n 'table-footer-group',\n 'table-row',\n 'table-cell',\n 'table-column-group',\n 'table-column',\n 'table-caption',\n 'unset',\n ],\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n","import { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n throw new Error('Invalid entry in styleProps')\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nexport function stylePropsToCss(props: Record<any, any>) {\n const unmatchedProps = Object.assign({}, props)\n const cssFromProps = {}\n\n // Convert shorthand styleProps to full versions\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const matchedShorthand = stylePropShorthandsMap.get(propName)\n if (matchedShorthand != null) {\n matchedShorthand.forEach((propName) => {\n unmatchedProps[propName] = propValue\n })\n\n delete unmatchedProps[propName]\n }\n })\n\n // Convert styleProps to style object\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const styleProp = stylePropsMap.get(propName)\n if (styleProp != null) {\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n // Split space-separated values out and process them individually\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n delete unmatchedProps[propName]\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n delete unmatchedProps[propName]\n }\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","const base = {\n color: 'neutral.foreground',\n fontFamily: 'default',\n margin: 0,\n}\n\nexport const Display1 = {\n ...base,\n fontSize: '5xl',\n fontWeight: 'bold',\n lineHeight: '4xl',\n}\n\nexport const Display2 = {\n ...base,\n fontSize: '4xl',\n fontWeight: 'bold',\n lineHeight: '3xl',\n}\n\nexport const H1 = {\n ...base,\n fontSize: '3xl',\n fontWeight: 'bold',\n lineHeight: '2xl',\n}\n\nexport const H2 = {\n ...base,\n fontSize: '2xl',\n fontWeight: 'bold',\n lineHeight: 'xl',\n}\n\nexport const H3 = {\n ...base,\n fontSize: 'xl',\n fontWeight: 'bold',\n lineHeight: 'lg',\n}\n\nexport const H4 = {\n ...base,\n fontSize: 'lg',\n fontWeight: 'bold',\n lineHeight: 'md',\n}\n\nexport const Body1 = {\n ...base,\n fontSize: 'md',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Body2 = {\n ...base,\n fontSize: 'sm',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Caption = {\n ...base,\n fontSize: 'xs',\n fontWeight: 'regular',\n lineHeight: 'sm',\n}\n","import { Box, BoxProps } from '../Box'\n\nimport * as styles from './Text.styles'\n\ntype TextVariant =\n | 'Display1'\n | 'Display2'\n | 'H1'\n | 'H2'\n | 'H3'\n | 'H4'\n | 'Body1'\n | 'Body2'\n | 'Caption'\n\nexport interface TextProps extends BoxProps {\n variant?: TextVariant\n}\n\nfunction BaseText({ as = 'span', children, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} {...styles[variant]} {...props}>\n {children}\n </Box>\n )\n}\n\nconst textVariantNames: TextVariant[] = [\n 'Display1',\n 'Display2',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'Body1',\n 'Body2',\n 'Caption',\n]\n\nconst textVariantComponents = Object.fromEntries(\n textVariantNames.map((variant) => {\n const asProp = ['H1', 'H2', 'H3', 'H4'].includes(variant)\n ? (variant.toLowerCase() as 'h1' | 'h2' | 'h3' | 'h4')\n : undefined\n const component = (props: TextProps) => (\n <BaseText as={asProp} {...props} variant={variant}>\n {props.children}\n </BaseText>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Text = Object.assign(BaseText, textVariantComponents)\n","export const base = ({ radii, space }) => ({\n borderWidth: 0,\n borderRadius: radii.md,\n padding: `${space[2]} ${space[4]}`,\n})\n\nexport const Primary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.primary.surface,\n color: colors.primary.foreground,\n\n '&:hover': {\n backgroundColor: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Secondary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.secondary.surface,\n color: colors.secondary.foreground,\n\n '&:hover': {\n backgroundColor: colors.secondary.hover.surface,\n },\n },\n]\n\nexport const Link = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.primary.surface,\n\n '&:hover': {\n color: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Plain = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.neutral.foreground,\n },\n]\n","import { Interpolation } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\nimport { Text } from '../Text'\n\nimport * as styles from './Button.styles'\n\n// TODO: Generate this type from buttonVariantNames\ntype ButtonVariant = 'Primary' | 'Secondary' | 'Link' | 'Plain'\n\nexport interface ButtonProps extends BoxProps {\n title?: string\n variant?: ButtonVariant\n}\n\nfunction BaseButton({ as, children, title, variant = 'Primary', ...props }: ButtonProps) {\n return (\n <Box as={as ?? 'button'} css={styles[variant] as Interpolation<any>} {...props}>\n {children}\n {title && (\n <Text.Body2 fontWeight=\"demibold\" color=\"inherit\">\n {title}\n </Text.Body2>\n )}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const variantPart = variant.toLocaleLowerCase()\n\n const component = ({ part, ...props }: ButtonProps) => (\n <BaseButton part={[`button-${variantPart}`, part]} {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { createContext, Dispatch, SetStateAction, useState } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport { createThemeVariables, theme as themeTokens, themeVariables } from '../../shared/theme'\n\n// TODO: type theme something like Partial<typeof themeTokens>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n children?: React.ReactNode\n config?: ProviderConfig\n theme?: Record<any, any>\n}\n\ninterface ProviderConfig {\n apiUrl?: string\n userId?: string\n}\n\ninterface ProviderContext {\n apiKey: string\n config: ProviderConfig\n modals: string[]\n setModals: Dispatch<SetStateAction<string[]>>\n}\n\nexport const FrigadeContext = createContext<ProviderContext>({\n apiKey: '',\n config: {},\n modals: [],\n setModals: () => {},\n})\n\nexport function Provider({ apiKey, children, config = {}, theme }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n const [modals, setModals] = useState([])\n\n return (\n <FrigadeContext.Provider value={{ apiKey, config, modals, setModals }}>\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Interpolation } from '@emotion/react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Dot } from './Dot'\nimport { Flex } from '../Flex/Flex'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToPopoverProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n css?: Interpolation<Record<any, any>>\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n className,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToPopoverProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div className={className} css={{ position: 'absolute', zIndex: 9999 }}>\n {spotlight && (\n <Box\n borderRadius={anchorRadius}\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Flex.Column\n backgroundColor=\"neutral.background\"\n borderRadius=\"md\"\n p={5}\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Flex.Column>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = (props: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '12px',\n right: '4px',\n }}\n part=\"tooltip-close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToPopoverProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps.alignOffset = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { Flow, Frigade } from '@frigade/js'\nimport { useContext, useEffect, useRef, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFlow(flowId: string) {\n const [flow, setFlow] = useState<Flow>()\n const { apiKey, config } = useContext(FrigadeContext)\n const filteredConfig = Object.fromEntries(\n Object.entries(config).filter(([k, v]) => ['apiUrl', 'userId'].includes(k) && v != null)\n )\n\n const frigadeRef = useRef(new Frigade(apiKey, filteredConfig))\n const frigade = frigadeRef.current\n\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n const clonedFlow = Object.assign(Object.create(Object.getPrototypeOf(updatedFlow)), updatedFlow)\n\n setFlow(clonedFlow)\n }\n\n useEffect(() => {\n ;(async () => {\n const flowResponse: Flow = await frigade.getFlow(flowId)\n\n setFlow(flowResponse)\n })()\n\n frigade.onFlowStateChange(handler)\n\n return () => {\n frigade.removeOnFlowStateChangeHandler(handler)\n }\n }, [])\n\n return { flow }\n}\n","import { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useModal(flowId: string) {\n const { modals, setModals } = useContext(FrigadeContext)\n const [isCurrentModal, setIsCurrentModal] = useState(false)\n\n useEffect(() => {\n setModals([...modals, flowId])\n\n return () => setModals(modals.filter((v) => v !== flowId))\n }, [])\n\n useEffect(() => {\n const newIsCurrentModal = modals[0] === flowId\n\n if (newIsCurrentModal !== isCurrentModal) {\n setIsCurrentModal(newIsCurrentModal)\n }\n }, [modals])\n\n return {\n isCurrentModal,\n }\n}\n","import { Flow, FlowStep } from '@frigade/js'\n\nimport { TourProps } from '.'\nimport { useModal } from '../../hooks/useModal'\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({ step, flow, ...props }: TourStepProps) {\n const { isCurrentModal } = useModal(`${flow.id}-${step.id}`)\n\n if (!isCurrentModal) return null\n\n async function handleDismiss() {\n await flow.skip()\n }\n\n async function handlePrimary() {\n await step.complete()\n }\n\n const handleSecondary = handlePrimary\n\n return (\n <Tooltip\n key={step.id}\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row alignItems=\"center\" gap={3} justifyContent=\"flex-end\" part=\"tooltip-footer\" pt={4}>\n <Tooltip.Progress>{`${step?.order + 1}/${flow.steps.size}`}</Tooltip.Progress>\n\n <Tooltip.Secondary\n marginLeft=\"auto\"\n title={step.secondaryButtonTitle}\n onClick={handleSecondary}\n />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Tooltip>\n )\n}\n","import { Flow } from '@frigade/js'\n\nimport { useFlow } from '../../hooks/useFlow'\nimport { TooltipProps } from '../Tooltip'\nimport { TourStep } from './TourStep'\n\nexport interface TourProps extends TooltipProps {\n flowId: string\n}\n\nexport function Tour({ flowId, ...props }: TourProps) {\n const { flow } = useFlow(flowId)\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n step?.start()\n\n return <TourStep step={step} flow={flow} {...props} />\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frigade/react",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-alpha.6",
4
4
  "description": "Build better product onboarding, faster.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",