@frigade/react 2.0.0-alpha.27 → 2.0.0-alpha.28
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 +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Dialog/index.tsx","../src/components/Box/index.tsx","../src/components/Box/styleProps.ts","../src/shared/tokens/borders.ts","../src/shared/tokens/palette.ts","../src/shared/tokens/radii.ts","../src/shared/tokens/semantic.ts","../src/shared/tokens/shadows.ts","../src/shared/tokens/space.ts","../src/shared/tokens/typography.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/stylePropsToCss.ts","../src/shared/sanitize.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Card/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/hooks/useFlow.ts","../src/components/Provider/index.tsx","../src/hooks/useFlowHandlers.ts","../src/hooks/useStepHandlers.ts","../src/components/Announcement/index.tsx","../src/components/Banner/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useModal.ts","../src/components/Tour/TourStep.tsx","../src/components/Tour/index.tsx","../src/hooks/useFrigade.ts"],"names":["RadixDialog","XMarkIcon","React","clsx","kcp","borders","palette","radii","colorVar","colorName","semantic","shadows","SPACE_UNIT","spaceValue","key","spaceKeys","space","typography","tokens","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","filteredCSSProperties","prop","_","char","defaultCSSProperties","colorTokens","themedStyleProps","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","stylePropsToCss","props","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","DOMPurify","getWindow","JSDOM","sanitize","dirty","jsx","prefixPart","part","processPart","p","BoxWithRef","as","children","className","css","ref","Component","processedPart","classNameWithPart","cssProp","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","BaseText","variant","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","Link","Plain","Primary","Secondary","colors","jsxs","BaseButton","title","variantPart","buttonVariantNames","buttonVariantComponents","Button","Row","Column","Flex","Card","Image","src","getVideoEmbedSrc","videoUri","_a","_b","_c","Video","videoEmbedSrc","Media","type","Dialog","e","onClick","current","total","dots","i","useContext","useEffect","useState","createContext","useRef","Global","ThemeProvider","Frigade","FrigadeContext","Provider","navigate","themeOverrides","modals","setModals","frigade","navigateHandler","url","target","useFlow","flowId","config","flow","setFlow","setRandomString","handler","updatedFlow","flowInstance","useCallback","useFlowHandlers","onComplete","onDismiss","lastCompleted","useStepHandlers","step","onPrimary","onSecondary","Announcement","variables","handleDismiss","handlePrimary","handleSecondary","Banner","Popover","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToPopoverProps","contentRect","contentProps","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","lengthOfCurrentSide","Tooltip","anchor","spotlight","contentNode","contentRef","setAlignAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","anchorElementRef","setAnchorElementRef","anchorQuery","anchorRect","anchorRadius","dotPosition","useModal","isCurrentModal","setIsCur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roicons/react/24/solid'\n\nimport { Box, type BoxProps } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Card } from '../Card'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\n\nimport { theme } from '../../shared/theme'\n\nexport interface DialogProps extends BoxProps {}\n\n// TODO: Add any RadixDialog props we want to support here\nexport function Dialog({ children, ...props }: DialogProps) {\n return (\n <RadixDialog.Root defaultOpen={true} modal={true}>\n <RadixDialog.Portal>\n <RadixDialog.Overlay\n style={{ background: 'rgb(0 0 0 / 0.5)', position: 'fixed', inset: 0 }}\n />\n <RadixDialog.Content\n asChild\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n >\n <Card\n boxShadow=\"md\"\n css={{\n left: '50%',\n maxWidth: 430,\n top: '50%',\n transform: 'translate(-50%, -50%)',\n }}\n p={8}\n position=\"fixed\"\n textAlign=\"center\"\n {...props}\n >\n {children}\n </Card>\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n )\n}\n\nDialog.Close = (props: ButtonProps) => {\n return (\n <RadixDialog.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '4px',\n right: '-4px',\n }}\n part=\"close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </RadixDialog.Close>\n )\n}\n\nDialog.Subtitle = ({ children, ...props }: TextProps) => {\n return (\n <RadixDialog.Description asChild>\n <Text.Body2 part=\"subtitle\" mb={5} {...props}>\n {children}\n </Text.Body2>\n </RadixDialog.Description>\n )\n}\n\nDialog.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return <Media borderRadius=\"md\" src={src} {...props} />\n}\n\nDialog.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nDialog.ProgressDots = ({ current, total }: { current: number; total: number }) => {\n const dots = [...Array(total)].map((_, i) => {\n return (\n <circle\n key={i}\n r={4}\n cx={4 + 16 * i}\n cy=\"4px\"\n fill={current === i ? theme.colors.blue500 : theme.colors.blue800}\n />\n )\n })\n return (\n <Box\n as=\"svg\"\n width={16 * total - 8}\n height=\"8px\"\n viewBox={`0 0 ${16 * total - 8} 8`}\n margin=\"5 auto\"\n >\n {dots}\n </Box>\n )\n}\n\nDialog.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nDialog.Title = ({ children, ...props }: TextProps) => {\n return (\n <RadixDialog.Title asChild>\n <Text.H3 mb={1} part=\"title\" {...props}>\n {children}\n </Text.H3>\n </RadixDialog.Title>\n )\n}\n","import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { type StyleProps } from './styleProps'\nimport { stylePropsToCss } from './stylePropsToCss'\nimport { sanitize } from '../../shared/sanitize'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: Part | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => processPart(p)).join(' ') : prefixPart(part)\n}\n\ntype Part = string | Part[]\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: Part\n} & StyleProps &\n React.ComponentPropsWithoutRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, css, part, ...props }: BoxProps<T>,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const Component = as ?? 'div'\n\n const { cssFromProps, unmatchedProps } = stylePropsToCss(props)\n\n const processedPart = processPart(part)\n const classNameWithPart = className || processedPart ? clsx(className, processedPart) : undefined\n const cssProp = [{ boxSizing: 'border-box' }, cssFromProps, css]\n\n if (typeof children === 'string') {\n return (\n <Component\n className={classNameWithPart}\n css={cssProp}\n {...unmatchedProps}\n ref={ref}\n dangerouslySetInnerHTML={sanitize(children)}\n />\n )\n }\n\n return (\n <Component className={classNameWithPart} css={cssProp} {...unmatchedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef) as <\n T extends React.ElementType = React.ElementType\n>(\n props: BoxProps<T>\n) => React.ReactElement\n","import kcp from 'known-css-properties'\nimport type { CSSProperties } from 'react'\n\nimport { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\nconst filteredCSSProperties = kcp.all\n .filter((prop) => prop.indexOf('-') != 0)\n .map((prop) => [prop.replace(/-([a-z])/g, (_, char) => char.toUpperCase()), null])\n\nconst defaultCSSProperties = Object.fromEntries(filteredCSSProperties)\n\n// SEE: https://stackoverflow.com/a/47058976\ntype PathsToStringProps<T> = T extends string\n ? []\n : {\n [K in Extract<keyof T, string>]: [K, ...PathsToStringProps<T[K]>]\n }[Extract<keyof T, string>]\n\ntype Join<T extends string[], D extends string> = T extends []\n ? never\n : T extends [infer F]\n ? F\n : T extends [infer F, ...infer R]\n ? F extends string\n ? `${F}${D}${Join<Extract<R, string[]>, D>}`\n : never\n : string\n\ntype ColorName = Join<PathsToStringProps<typeof theme.colors>, '.'>\n\nconst colorTokens = flattenObject(theme.colors) as Record<ColorName, string>\n\nconst themedStyleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n boxShadow: theme.shadows,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n marginRight: theme.space,\n marginTop: theme.space,\n\n padding: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n paddingRight: theme.space,\n paddingTop: theme.space,\n} as const\n\nexport const styleProps = {\n ...defaultCSSProperties,\n ...themedStyleProps,\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n\ntype ThemedStyleProps = {\n [K in keyof typeof themedStyleProps]: keyof (typeof themedStyleProps)[K]\n}\n\ntype FilteredCSSProps = Omit<\n {\n [key in keyof CSSProperties]: CSSProperties[key]\n },\n | `-${string}`\n | `Moz${string}`\n | `ms${string}`\n | `Webkit${string}`\n | `Khtml${string}`\n | `O${string}`\n>\n\nexport type ThemedStyleProp<K extends keyof ThemedStyleProps> = ThemedStyleProps[K] | (string & {})\n\nexport interface StyleProps extends FilteredCSSProps {\n backgroundColor?: ThemedStyleProp<'backgroundColor'>\n border?: ThemedStyleProp<'border'>\n borderColor?: ThemedStyleProp<'borderColor'>\n borderRadius?: ThemedStyleProp<'borderRadius'>\n borderWidth?: ThemedStyleProp<'borderWidth'>\n boxShadow?: ThemedStyleProp<'boxShadow'>\n color?: ThemedStyleProp<'color'>\n fontFamily?: ThemedStyleProp<'fontFamily'>\n fontSize?: ThemedStyleProp<'fontSize'>\n fontWeight?: ThemedStyleProp<'fontWeight'>\n gap?: ThemedStyleProp<'gap'>\n lineHeight?: ThemedStyleProp<'lineHeight'>\n margin?: ThemedStyleProp<'margin'>\n marginBottom?: ThemedStyleProp<'marginBottom'>\n marginLeft?: ThemedStyleProp<'marginLeft'>\n marginRight?: ThemedStyleProp<'marginRight'>\n marginTop?: ThemedStyleProp<'marginTop'>\n padding?: ThemedStyleProp<'padding'>\n paddingBottom?: ThemedStyleProp<'paddingBottom'>\n paddingLeft?: ThemedStyleProp<'paddingLeft'>\n paddingRight?: ThemedStyleProp<'paddingRight'>\n paddingTop?: ThemedStyleProp<'paddingTop'>\n}\n","export const borders = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n}\n","export const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n inherit: 'inherit',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n","export const radii = {\n md: '10px',\n lg: '20px',\n round: '50%',\n}\n","const colorVar = (colorName: string) => `var(--fr-colors-${colorName})`\n\nexport const semantic = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray500'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","export const shadows = {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n}\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceTokens = {\n [K in SpaceKeys[any]]: string\n}\nexport const space = Object.fromEntries(\n spaceKeys.map((key) => [key, spaceValue(key)])\n) as SpaceTokens\n","export const typography = {\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n thin: '100',\n extralight: '200',\n light: '300',\n regular: '400',\n medium: '500',\n demibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n}\n","import { borders } from './borders'\nimport { palette } from './palette'\nimport { radii } from './radii'\nimport { semantic } from './semantic'\nimport { shadows } from './shadows'\nimport { space } from './space'\nimport { typography } from './typography'\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...borders,\n\n colors: {\n ...palette,\n ...semantic,\n },\n\n ...typography,\n\n radii,\n shadows,\n space,\n}\n\nexport type Tokens = typeof tokens\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens, Tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\nexport type Theme = Partial<Tokens>\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens: Theme) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(tokens: Tokens, path = '--fr'): Theme {\n const newObj: Theme = {}\n\n Object.keys(tokens).forEach((key) => {\n const currentValue = tokens[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { styleProps, stylePropShorthands } from './styleProps'\n\nfunction prepValue(value: any) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n return new Map()\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nexport function stylePropsToCss(props: Record<any, any>) {\n const unmatchedProps = Object.assign({}, props)\n const cssFromProps = {}\n\n // Convert shorthand styleProps to full versions\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const matchedShorthand = stylePropShorthandsMap.get(propName)\n if (matchedShorthand != null) {\n matchedShorthand.forEach((propName) => {\n unmatchedProps[propName] = propValue\n })\n\n delete unmatchedProps[propName]\n }\n })\n\n // Convert styleProps to style object\n Object.entries(unmatchedProps).forEach(([propName, propValue]) => {\n const styleProp = stylePropsMap.get(propName)\n if (styleProp != null) {\n // Split space-separated values out and process them individually\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n // Replace known token values (e.g. lineHeight=\"xl\")\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n\n // Pass value through, we trust TypeScript to catch invalid values, right?\n } else {\n cssFromProps[propName] = propValue\n }\n\n delete unmatchedProps[propName]\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","import DOMPurify from 'dompurify'\n\nfunction getWindow() {\n if (typeof window === 'undefined') {\n // NOTE: JSDOM is required inline because it has import side effects that depend on node\n const { JSDOM } = require('jsdom')\n return new JSDOM('<!DOCTYPE html>').window\n }\n\n return window\n}\n\nexport function sanitize(dirty?: string) {\n if (!dirty) {\n return { __html: '' }\n }\n\n return {\n __html: DOMPurify(getWindow()).sanitize(dirty, {\n ALLOWED_TAGS: [\n 'b',\n 'i',\n 'a',\n 'span',\n 'div',\n 'p',\n 'pre',\n 'u',\n 'br',\n 'img',\n 'code',\n 'li',\n 'ul',\n 'table',\n 'tbody',\n 'thead',\n 'tr',\n 'td',\n 'th',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'video',\n ],\n ALLOWED_ATTR: [\n 'style',\n 'class',\n 'target',\n 'id',\n 'href',\n 'alt',\n 'src',\n 'controls',\n 'autoplay',\n 'loop',\n 'muted',\n ],\n }),\n }\n}\n","const base = {\n color: 'neutral.foreground',\n fontFamily: 'default',\n margin: '0',\n}\n\nexport const Display1 = {\n ...base,\n fontSize: '5xl',\n fontWeight: 'bold',\n lineHeight: '4xl',\n}\n\nexport const Display2 = {\n ...base,\n fontSize: '4xl',\n fontWeight: 'bold',\n lineHeight: '3xl',\n}\n\nexport const H1 = {\n ...base,\n fontSize: '3xl',\n fontWeight: 'bold',\n lineHeight: '2xl',\n}\n\nexport const H2 = {\n ...base,\n fontSize: '2xl',\n fontWeight: 'bold',\n lineHeight: 'xl',\n}\n\nexport const H3 = {\n ...base,\n fontSize: 'xl',\n fontWeight: 'bold',\n lineHeight: 'lg',\n}\n\nexport const H4 = {\n ...base,\n fontSize: 'lg',\n fontWeight: 'bold',\n lineHeight: 'md',\n}\n\nexport const Body1 = {\n ...base,\n fontSize: 'md',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Body2 = {\n ...base,\n fontSize: 'sm',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Caption = {\n ...base,\n fontSize: 'xs',\n fontWeight: 'regular',\n lineHeight: 'sm',\n}\n","import { Box, BoxProps } from '../Box'\n\nimport * as styles from './Text.styles'\n\ntype TextVariant =\n | 'Display1'\n | 'Display2'\n | 'H1'\n | 'H2'\n | 'H3'\n | 'H4'\n | 'Body1'\n | 'Body2'\n | 'Caption'\n\nexport interface TextProps extends BoxProps {\n variant?: TextVariant\n}\n\nfunction BaseText({ as = 'span', children, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} {...styles[variant]} {...props}>\n {children}\n </Box>\n )\n}\n\nconst textVariantNames: TextVariant[] = [\n 'Display1',\n 'Display2',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'Body1',\n 'Body2',\n 'Caption',\n]\n\nconst textVariantComponents = Object.fromEntries(\n textVariantNames.map((variant) => {\n const asProp = ['H1', 'H2', 'H3', 'H4'].includes(variant)\n ? (variant.toLowerCase() as 'h1' | 'h2' | 'h3' | 'h4')\n : undefined\n const component = (props: TextProps) => (\n <BaseText as={asProp} {...props} variant={variant}>\n {props.children}\n </BaseText>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Text = Object.assign(BaseText, textVariantComponents)\n","export const base = ({ radii, space }) => ({\n borderWidth: 0,\n borderRadius: radii.md,\n padding: `${space[2]} ${space[4]}`,\n})\n\nexport const Primary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.primary.surface,\n color: colors.primary.foreground,\n\n '&:hover': {\n backgroundColor: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Secondary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.secondary.surface,\n color: colors.secondary.foreground,\n\n '&:hover': {\n backgroundColor: colors.secondary.hover.surface,\n },\n },\n]\n\nexport const Link = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.primary.surface,\n\n '&:hover': {\n color: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Plain = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.neutral.foreground,\n },\n]\n","import { Interpolation } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\nimport { Text } from '../Text'\n\nimport * as styles from './Button.styles'\n\n// TODO: Generate this type from buttonVariantNames\ntype ButtonVariant = 'Primary' | 'Secondary' | 'Link' | 'Plain'\n\nexport interface ButtonProps extends BoxProps {\n title?: string\n variant?: ButtonVariant\n}\n\nfunction BaseButton({ as, children, part, title, variant = 'Primary', ...props }: ButtonProps) {\n const variantPart = variant.toLocaleLowerCase()\n\n return (\n <Box\n as={as ?? 'button'}\n css={styles[variant] as Interpolation<any>}\n part={[`button-${variantPart}`, part]}\n {...props}\n >\n {children}\n {title && (\n <Text.Body2 fontWeight=\"demibold\" color=\"inherit\">\n {title}\n </Text.Body2>\n )}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const component = (props: ButtonProps) => {\n return (\n <BaseButton {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n }\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\n\nimport { type BoxProps } from '../Box'\nimport { Flex } from '../Flex/Flex'\n\nexport const Card = React.forwardRef(({ as, children, ...props }: BoxProps, ref) => {\n const Component = as ?? Flex.Column\n return (\n <Component backgroundColor=\"neutral.background\" borderRadius=\"md\" p={5} {...props} ref={ref}>\n {children}\n </Component>\n )\n})\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type?: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","import { Flow } from '@frigade/js'\nimport { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport interface FlowConfig {\n variables?: Record<string, any>\n}\n\nexport function useFlow(flowId: string, config?: FlowConfig) {\n const [flow, setFlow] = useState<Flow>()\n const [_, setRandomString] = useState<string>('')\n const { frigade } = useContext(FrigadeContext)\n\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n if (config?.variables) {\n updatedFlow.applyVariables(config.variables)\n }\n\n setFlow(updatedFlow)\n setRandomString(Math.random().toString())\n }\n\n useEffect(() => {\n ;(async () => {\n const flowInstance: Flow = await frigade.getFlow(flowId)\n if (config?.variables) {\n flowInstance.applyVariables(config.variables)\n }\n\n setFlow(flowInstance)\n })()\n\n frigade.onStateChange(handler)\n\n return () => {\n frigade.removeStateChangeHandler(handler)\n }\n }, [])\n\n return { flow }\n}\n","import { createContext, Dispatch, SetStateAction, useRef, useState } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport {\n createThemeVariables,\n theme as themeTokens,\n type Theme,\n themeVariables,\n} from '../../shared/theme'\nimport { Frigade } from '@frigade/js'\n\ntype NavigateHandler = (url: string, target?: string) => void\n\n// TODO: type theme something like Partial<typeof themeTokens>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n apiUrl?: string\n children?: React.ReactNode\n navigate?: NavigateHandler\n theme?: Theme\n userId?: string\n groupId?: string\n}\n\ninterface ProviderContext extends Omit<ProviderProps, 'children' | 'theme'> {\n modals: string[]\n setModals: Dispatch<SetStateAction<string[]>>\n frigade?: Frigade\n}\n\nexport const FrigadeContext = createContext<ProviderContext>({\n apiKey: '',\n modals: [],\n setModals: () => {},\n navigate: () => {},\n})\n\nexport function Provider({ children, navigate, theme, ...props }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n const [modals, setModals] = useState([])\n const frigade = useRef(\n new Frigade(props.apiKey, {\n apiKey: props.apiKey,\n apiUrl: props.apiUrl,\n userId: props.userId,\n groupId: props.groupId,\n })\n )\n\n const navigateHandler =\n navigate ??\n ((url, target = '_self') => {\n window.open(url, target)\n })\n\n return (\n <FrigadeContext.Provider\n value={{\n modals,\n setModals,\n navigate: navigateHandler,\n ...props,\n frigade: frigade.current,\n }}\n >\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import { MouseEvent, useCallback, useEffect, useRef } from 'react'\n\nimport { Flow } from '@frigade/js'\n\nexport type FlowHandler = (\n flow: Flow,\n event?: MouseEvent<unknown>\n) => Promise<boolean | void> | (boolean | void)\n\nexport interface StepHandlers {\n onComplete?: FlowHandler\n onDismiss?: FlowHandler\n}\n\nexport function useFlowHandlers(flow: Flow, { onComplete, onDismiss }: StepHandlers = {}) {\n const lastCompleted = useRef(null)\n\n useEffect(() => {\n if (flow == null) return\n\n if (flow.isCompleted && lastCompleted.current === false) {\n ;(async () => {\n await onComplete?.(flow)\n })()\n }\n\n lastCompleted.current = flow?.isCompleted\n }, [flow?.isCompleted])\n\n return {\n handleDismiss: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = await onDismiss?.(flow, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n await flow.skip()\n },\n [flow]\n ),\n }\n}\n","import { MouseEvent, useCallback, useContext } from 'react'\n\nimport type { FlowStep } from '@frigade/js'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport type StepHandler = (\n step: FlowStep,\n event?: MouseEvent<unknown>\n) => Promise<boolean | void> | (boolean | void)\n\nexport interface StepHandlers {\n onPrimary?: StepHandler\n onSecondary?: StepHandler\n}\n\nexport function useStepHandlers(step: FlowStep, { onPrimary, onSecondary }: StepHandlers = {}) {\n const { navigate } = useContext(FrigadeContext)\n\n return {\n handlePrimary: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = await onPrimary?.(step, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n await step.complete()\n\n if (step.primaryButtonUri != null) {\n navigate(step.primaryButtonUri, step.primaryButtonUriTarget)\n }\n },\n [step]\n ),\n\n handleSecondary: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = await onSecondary?.(step, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n // Should there be a step.skip method?\n await step.complete()\n\n if (step.secondaryButtonUri != null) {\n navigate(step.secondaryButtonUri, step.secondaryButtonUriTarget)\n }\n },\n [step]\n ),\n }\n}\n","import { Dialog, type DialogProps } from '../Dialog'\nimport { Flex } from '../Flex/Flex'\nimport { type FlowComponentProps } from '../../shared/types'\nimport { useFlow } from '../../hooks/useFlow'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { useStepHandlers } from '@/hooks/useStepHandlers'\n\nexport interface AnncouncementProps extends DialogProps, FlowComponentProps {}\n\nexport function Announcement({\n flowId,\n onComplete,\n onDismiss,\n onPrimary,\n onSecondary,\n variables,\n}: AnncouncementProps) {\n const { flow } = useFlow(flowId, {\n variables,\n })\n const step = flow?.getCurrentStep()\n\n const { handleDismiss } = useFlowHandlers(flow, {\n onComplete,\n onDismiss,\n })\n\n const { handlePrimary, handleSecondary } = useStepHandlers(step, {\n onPrimary,\n onSecondary,\n })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n step?.start()\n\n return (\n <Dialog>\n <Dialog.Close onClick={handleDismiss} />\n\n <Dialog.Title>{step.title}</Dialog.Title>\n <Dialog.Subtitle>{step.subtitle}</Dialog.Subtitle>\n\n <Dialog.Media\n src={step.imageUri}\n css={{ aspectRatio: '1.5', objectFit: 'cover', width: '100%' }}\n />\n\n <Dialog.ProgressDots\n current={flow.getNumberOfCompletedSteps()}\n total={flow.getNumberOfAvailableSteps()}\n />\n\n <Flex.Row\n css={{\n '& > button': {\n flexGrow: 1,\n },\n }}\n gap={3}\n >\n <Dialog.Secondary title=\"Secondary\" onClick={handleSecondary} />\n <Dialog.Primary title=\"Primary\" onClick={handlePrimary} />\n </Flex.Row>\n </Dialog>\n )\n}\n","import { type BoxProps } from '@/components/Box'\nimport { Button } from '@/components/Button'\nimport { Card } from '@/components/Card'\nimport { Flex } from '@/components/Flex/Flex'\nimport { Text } from '@/components/Text'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\n\nimport { useFlow } from '@/hooks/useFlow'\nimport { useFlowHandlers } from '@/hooks/useFlowHandlers'\nimport { useStepHandlers } from '@/hooks/useStepHandlers'\n\nimport type { FlowComponentProps } from '@/shared/types'\n\ninterface BannerProps extends BoxProps, FlowComponentProps {}\n\nexport function Banner({\n flowId,\n onComplete,\n onDismiss,\n onPrimary,\n onSecondary,\n ...props\n}: BannerProps) {\n const { flow } = useFlow(flowId)\n const step = flow?.getCurrentStep()\n\n const { handleDismiss } = useFlowHandlers(flow, { onComplete, onDismiss })\n const { handlePrimary, handleSecondary } = useStepHandlers(step, { onPrimary, onSecondary })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n step?.start()\n\n return (\n <Card as={Flex.Row} border=\"md\" borderColor=\"gray900\" justifyContent=\"space-between\" {...props}>\n <Flex.Row gap={3}>\n <img src={step.imageUri} style={{ height: 40, width: 40, alignSelf: 'center' }} />\n <Flex.Column>\n <Text.H4 mb={1}>{step.title}</Text.H4>\n <Text.Body2>{step.subtitle}</Text.Body2>\n </Flex.Column>\n </Flex.Row>\n\n <Flex.Row alignItems=\"center\" gap={3}>\n <Button.Secondary title={step.secondaryButtonTitle} onClick={handleSecondary} />\n <Button.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n <Button.Plain part=\"banner-close\" onClick={handleDismiss}>\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Flex.Row>\n </Card>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Card } from '../Card'\nimport { Dot } from './Dot'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToPopoverProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n className,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToPopoverProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div\n className={className}\n css={{ bottom: 0, left: 0, position: 'absolute', right: 0, top: 0, zIndex: 9999 }}\n >\n {spotlight && (\n <Box\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n borderRadius: anchorRadius,\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Card\n boxShadow=\"md\"\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Card>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = (props: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '12px',\n right: '4px',\n }}\n part=\"close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToPopoverProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps.alignOffset = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useModal(flowId: string) {\n const { modals, setModals } = useContext(FrigadeContext)\n const [isCurrentModal, setIsCurrentModal] = useState(false)\n\n useEffect(() => {\n setModals([...modals, flowId])\n\n return () => setModals(modals.filter((v) => v !== flowId))\n }, [])\n\n useEffect(() => {\n const newIsCurrentModal = modals[0] === flowId\n\n if (newIsCurrentModal !== isCurrentModal) {\n setIsCurrentModal(newIsCurrentModal)\n }\n }, [modals])\n\n return {\n isCurrentModal,\n }\n}\n","import type { Flow, FlowStep } from '@frigade/js'\n\nimport { TourProps } from '.'\nimport { useModal } from '../../hooks/useModal'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { useStepHandlers } from '../../hooks/useStepHandlers'\n\nimport { Flex } from '../Flex/Flex'\nimport { Tooltip } from '../Tooltip'\n\nexport interface TourStepProps extends Omit<TourProps, 'flowId'> {\n step: FlowStep\n flow: Flow\n}\n\nexport function TourStep({\n step,\n flow,\n onDismiss,\n onPrimary,\n onSecondary,\n ...props\n}: TourStepProps) {\n const { isCurrentModal } = useModal(`${flow.id}-${step.id}`)\n\n const { handleDismiss } = useFlowHandlers(flow, {\n onDismiss,\n })\n\n const { handlePrimary, handleSecondary } = useStepHandlers(step, {\n onPrimary,\n onSecondary,\n })\n\n if (!isCurrentModal) {\n return null\n }\n\n return (\n <Tooltip\n key={step.id}\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row alignItems=\"center\" gap={3} justifyContent=\"flex-end\" part=\"tooltip-footer\" pt={4}>\n <Tooltip.Progress>{`${\n flow.getNumberOfCompletedSteps() + 1\n }/${flow.getNumberOfAvailableSteps()}`}</Tooltip.Progress>\n\n <Tooltip.Secondary\n marginLeft=\"auto\"\n title={step.secondaryButtonTitle}\n onClick={handleSecondary}\n />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Tooltip>\n )\n}\n","import { type FlowComponentProps } from '../../shared/types'\nimport { type TooltipProps } from '../Tooltip'\nimport { TourStep } from './TourStep'\nimport { useFlow } from '../../hooks/useFlow'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\n\nexport interface TourProps extends TooltipProps, FlowComponentProps {}\n\nexport function Tour({ flowId, onComplete, variables, ...props }: TourProps) {\n const { flow } = useFlow(flowId, {\n variables,\n })\n useFlowHandlers(flow, { onComplete })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n step?.start()\n\n return <TourStep step={step} flow={flow} {...props} />\n}\n","import { useContext } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFrigade() {\n const { frigade } = useContext(FrigadeContext)\n\n return { frigade }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Dialog/index.tsx","../src/components/Box/index.tsx","../src/components/Box/styleProps.ts","../src/shared/tokens/borders.ts","../src/shared/tokens/palette.ts","../src/shared/tokens/radii.ts","../src/shared/tokens/semantic.ts","../src/shared/tokens/shadows.ts","../src/shared/tokens/space.ts","../src/shared/tokens/typography.ts","../src/shared/tokens/index.ts","../src/shared/flattenObject.ts","../src/shared/theme/index.ts","../src/components/Box/stylePropsToCss.ts","../src/shared/sanitize.ts","../src/components/Text/Text.styles.ts","../src/components/Text/index.tsx","../src/components/Button/Button.styles.ts","../src/components/Button/index.tsx","../src/components/Card/index.tsx","../src/components/Flex/Flex.tsx","../src/components/Media/Image.tsx","../src/components/Media/Video.tsx","../src/components/Media/Media.tsx","../src/hooks/useFlow.ts","../src/components/Provider/index.tsx","../src/hooks/useFlowHandlers.ts","../src/hooks/useStepHandlers.ts","../src/components/Announcement/index.tsx","../src/components/Banner/index.tsx","../src/components/Tooltip/index.tsx","../src/hooks/useBoundingClientRect.ts","../src/components/Tooltip/Dot.tsx","../src/components/Tooltip/getDotPosition.ts","../src/components/Tooltip/mapTooltipPropsToPopoverProps.ts","../src/hooks/useModal.ts","../src/components/Tour/TourStep.tsx","../src/components/Tour/index.tsx","../src/hooks/useFrigade.ts"],"names":["RadixDialog","XMarkIcon","React","clsx","kcp","borders","palette","radii","colorVar","colorName","semantic","shadows","SPACE_UNIT","spaceValue","key","spaceKeys","space","typography","tokens","flattenObject","obj","path","separator","acc","k","currentPath","currentValue","createThemeVariables","mapTokensToThemeVariables","newObj","themeVariables","theme","omittedCSSProperties","filteredCSSProperties","prop","_","char","defaultCSSProperties","colorTokens","themedStyleProps","styleProps","stylePropShorthands","prepValue","value","v","stylePropsMap","propName","stylePropShorthandsMap","shorthand","targetProps","preservedProps","elementsWithPreservedProps","stylePropsToCss","props","element","unmatchedProps","cssFromProps","propValue","matchedShorthand","styleProp","splitPropValues","clippedPropName","DOMPurify","getWindow","JSDOM","sanitize","dirty","jsx","prefixPart","part","processPart","p","BoxWithRef","as","children","className","css","ref","Component","processedPart","classNameWithPart","cssProp","Box","Text_styles_exports","__export","Body1","Body2","Caption","Display1","Display2","H1","H2","H3","H4","base","BaseText","variant","textVariantNames","textVariantComponents","asProp","component","Text","Button_styles_exports","Link","Plain","Primary","Secondary","colors","jsxs","BaseButton","title","variantPart","buttonVariantNames","buttonVariantComponents","Button","Row","Column","Flex","Card","Image","src","getVideoEmbedSrc","videoUri","_a","_b","_c","Video","videoEmbedSrc","Media","type","Dialog","e","onClick","current","total","dots","i","useContext","useEffect","useState","createContext","useRef","Global","ThemeProvider","Frigade","FrigadeContext","Provider","navigate","themeOverrides","modals","setModals","frigade","navigateHandler","url","target","useFlow","flowId","config","flow","setFlow","setRandomString","handler","updatedFlow","flowInstance","useCallback","useFlowHandlers","onComplete","onDismiss","lastCompleted","useStepHandlers","step","onPrimary","onSecondary","Announcement","variables","handleDismiss","handlePrimary","handleSecondary","Banner","Popover","useLayoutEffect","useBoundingClientRect","initialRect","rect","setRect","node","setNode","keyframes","pulse","Dot","style","getDotPosition","alignAttr","sideAttr","currentSide","dotProps","getCurrentAlign","dotOffset","oppositeSides","currentAlign","RADIX_PROPS","mapTooltipPropsToPopoverProps","contentRect","contentProps","propEntry","rootProps","mapToOriginalAlignValues","mapAlignOffsetToMargin","align","side","originalOffset","originalStyleProp","lengthOfCurrentSide","Tooltip","anchor","spotlight","contentNode","contentRef","setAlignAttr","setSideAttr","currentAlignAttr","currentSideAttr","anchorRef","anchorElementRef","setAnchorElementRef","anchorQuery","anchorRect","anchorRadius","dotPosition","useModal","isCurrentModal","setIsCurrentModal","newIsCurrentModal","TourStep","Tour","useFrigade"],"mappings":"2VAAA,UAAYA,MAAiB,yBAC7B,OAAS,aAAAC,OAAiB,4BCD1B,UAAYC,OAAW,QACvB,OAAS,QAAAC,OAAY,OCDrB,OAAOC,OAAS,uBCAT,IAAMC,GAAU,CACrB,QAAS,CACP,GAAI,WACN,EACA,aAAc,CACZ,EAAG,IACH,GAAI,KACN,CACF,ECRO,IAAMC,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,ECxBO,IAAMC,GAAQ,CACnB,GAAI,OACJ,GAAI,OACJ,MAAO,KACT,ECJA,IAAMC,EAAYC,GAAsB,mBAAmBA,KAE9CC,GAAW,CACtB,QAAS,CACP,WAAYF,EAAS,OAAO,EAC5B,OAAQA,EAAS,SAAS,EAC1B,WAAYA,EAAS,OAAO,EAC5B,QAASA,EAAS,SAAS,EAE3B,OAAQ,CACN,WAAYA,EAAS,OAAO,EAC5B,OAAQA,EAAS,SAAS,EAC1B,WAAYA,EAAS,OAAO,EAC5B,QAASA,EAAS,SAAS,CAC7B,EACA,MAAO,CACL,WAAYA,EAAS,OAAO,EAC5B,OAAQA,EAAS,SAAS,EAC1B,WAAYA,EAAS,OAAO,EAC5B,QAASA,EAAS,SAAS,CAC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,EAAK,qBACZ,QAASO,EACX,EACA9G,EAACkJ,EAAQ,QAAR,CAAgB,MAAO3C,EAAK,mBAAoB,QAASM,EAAe,GAC3E,IA3BKN,EAAK,EA4BZ,EAjCO,IAmCX,CC/CS,cAAAvG,OAAA,6BAfF,SAASuK,GAAK,CAAE,OAAA9E,EAAQ,WAAAU,EAAY,UAAAQ,EAAW,GAAGzH,CAAM,EAAc,CAC3E,GAAM,CAAE,KAAAyG,CAAK,EAAIH,EAAQC,EAAQ,CAC/B,UAAAkB,CACF,CAAC,EAGD,GAFAT,EAAgBP,EAAM,CAAE,WAAAQ,CAAW,CAAC,EAEhCR,GAAQ,MAAQA,EAAK,YAAc,GACrC,OAAO,KAGTA,EAAK,MAAM,EAEX,IAAMY,EAAOZ,EAAK,eAAe,EACjC,OAAAY,GAAA,MAAAA,EAAM,QAECvG,GAACsK,GAAA,CAAS,KAAM/D,EAAM,KAAMZ,EAAO,GAAGzG,EAAO,CACtD,CCxBA,OAAS,cAAAoF,OAAkB,QAIpB,SAASkG,IAAa,CAC3B,GAAM,CAAE,QAAApF,CAAQ,EAAId,GAAWQ,CAAc,EAE7C,MAAO,CAAE,QAAAM,CAAQ,CACnB","sourcesContent":["import * as RadixDialog from '@radix-ui/react-dialog'\nimport { XMarkIcon } from '@heroicons/react/24/solid'\n\nimport { Box, type BoxProps } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Card } from '../Card'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\n\nimport { theme } from '../../shared/theme'\n\nexport interface DialogProps extends BoxProps {}\n\n// TODO: Add any RadixDialog props we want to support here\nexport function Dialog({ children, ...props }: DialogProps) {\n return (\n <RadixDialog.Root defaultOpen={true} modal={true}>\n <RadixDialog.Portal>\n <RadixDialog.Overlay\n style={{ background: 'rgb(0 0 0 / 0.5)', position: 'fixed', inset: 0 }}\n />\n <RadixDialog.Content\n asChild\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n >\n <Card\n boxShadow=\"md\"\n css={{\n left: '50%',\n maxWidth: 430,\n top: '50%',\n transform: 'translate(-50%, -50%)',\n }}\n p={8}\n position=\"fixed\"\n textAlign=\"center\"\n {...props}\n >\n {children}\n </Card>\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n )\n}\n\nDialog.Close = (props: ButtonProps) => {\n return (\n <RadixDialog.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '4px',\n right: '-4px',\n }}\n part=\"close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </RadixDialog.Close>\n )\n}\n\nDialog.Subtitle = ({ children, ...props }: TextProps) => {\n return (\n <RadixDialog.Description asChild>\n <Text.Body2 part=\"subtitle\" mb={5} {...props}>\n {children}\n </Text.Body2>\n </RadixDialog.Description>\n )\n}\n\nDialog.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return <Media borderRadius=\"md\" src={src} {...props} />\n}\n\nDialog.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nDialog.ProgressDots = ({ current, total }: { current: number; total: number }) => {\n const dots = [...Array(total)].map((_, i) => {\n return (\n <circle\n key={i}\n r={4}\n cx={4 + 16 * i}\n cy=\"4px\"\n fill={current === i ? theme.colors.blue500 : theme.colors.blue800}\n />\n )\n })\n return (\n <Box\n as=\"svg\"\n width={16 * total - 8}\n height=\"8px\"\n viewBox={`0 0 ${16 * total - 8} 8`}\n margin=\"5 auto\"\n >\n {dots}\n </Box>\n )\n}\n\nDialog.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nDialog.Title = ({ children, ...props }: TextProps) => {\n return (\n <RadixDialog.Title asChild>\n <Text.H3 mb={1} part=\"title\" {...props}>\n {children}\n </Text.H3>\n </RadixDialog.Title>\n )\n}\n","import * as React from 'react'\nimport { clsx } from 'clsx'\n\nimport { type StyleProps } from './styleProps'\nimport { stylePropsToCss } from './stylePropsToCss'\nimport { sanitize } from '../../shared/sanitize'\n\nfunction prefixPart(part: string | undefined) {\n return part ? `fr-${part}` : part\n}\n\nfunction processPart(part: Part | undefined) {\n if (!part) return part\n\n return Array.isArray(part) ? part.map((p) => processPart(p)).join(' ') : prefixPart(part)\n}\n\ntype Part = string | Part[]\n\nexport type BoxProps<T extends React.ElementType = React.ElementType> = {\n as?: T\n part?: Part\n} & StyleProps &\n React.ComponentPropsWithoutRef<T>\n\nfunction BoxWithRef<T extends React.ElementType = React.ElementType>(\n { as, children, className, css, part, ...props }: BoxProps<T>,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const Component = as ?? 'div'\n\n const { cssFromProps, unmatchedProps } = stylePropsToCss(props, Component)\n\n const processedPart = processPart(part)\n const classNameWithPart = className || processedPart ? clsx(className, processedPart) : undefined\n const cssProp = [{ boxSizing: 'border-box' }, cssFromProps, css]\n\n if (typeof children === 'string') {\n return (\n <Component\n className={classNameWithPart}\n css={cssProp}\n {...unmatchedProps}\n ref={ref}\n dangerouslySetInnerHTML={sanitize(children)}\n />\n )\n }\n\n return (\n <Component className={classNameWithPart} css={cssProp} {...unmatchedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Box = React.forwardRef(BoxWithRef) as <\n T extends React.ElementType = React.ElementType\n>(\n props: BoxProps<T>\n) => React.ReactElement\n","import kcp from 'known-css-properties'\nimport type { CSSProperties } from 'react'\n\nimport { theme } from '../../shared/theme'\nimport { flattenObject } from '../../shared/flattenObject'\n\n// Don't use these as CSS props, pass them through to HTML\nconst omittedCSSProperties = new Set([\n 'alt', // Mozilla doesn't have this listed as a valid CSS property ¯\\_(ツ)_/¯\n 'size', // Only applies to @page, not used for styling components. Breaks <input>\n 'src', // Only applies to @font-face, not used for styling components. Breaks <img>, <video>, et al\n])\n\nconst filteredCSSProperties = kcp.all\n .filter((prop) => prop.indexOf('-') != 0 && !omittedCSSProperties.has(prop))\n .map((prop) => [prop.replace(/-([a-z])/g, (_, char) => char.toUpperCase()), null])\n\nconst defaultCSSProperties = Object.fromEntries(filteredCSSProperties)\n\n// Recursive type for flattened color names\n// SEE: https://stackoverflow.com/a/47058976\ntype PathsToStringProps<T> = T extends string\n ? []\n : {\n [K in Extract<keyof T, string>]: [K, ...PathsToStringProps<T[K]>]\n }[Extract<keyof T, string>]\n\ntype Join<T extends string[], D extends string> = T extends []\n ? never\n : T extends [infer F]\n ? F\n : T extends [infer F, ...infer R]\n ? F extends string\n ? `${F}${D}${Join<Extract<R, string[]>, D>}`\n : never\n : string\n\ntype ColorName = Join<PathsToStringProps<typeof theme.colors>, '.'>\n\nconst colorTokens = flattenObject(theme.colors) as Record<ColorName, string>\n\nconst themedStyleProps = {\n color: colorTokens,\n backgroundColor: colorTokens,\n borderColor: colorTokens,\n\n border: theme.borders,\n borderRadius: theme.radii,\n borderWidth: theme.borderWidths,\n boxShadow: theme.shadows,\n\n fontFamily: theme.fontFamilies,\n fontSize: theme.fontSizes,\n fontWeight: theme.fontWeights,\n\n gap: theme.space,\n\n lineHeight: theme.lineHeights,\n\n margin: theme.space,\n marginBottom: theme.space,\n marginLeft: theme.space,\n marginRight: theme.space,\n marginTop: theme.space,\n\n padding: theme.space,\n paddingBottom: theme.space,\n paddingLeft: theme.space,\n paddingRight: theme.space,\n paddingTop: theme.space,\n} as const\n\nexport const styleProps = {\n ...defaultCSSProperties,\n ...themedStyleProps,\n}\n\nexport const stylePropShorthands = {\n m: ['margin'],\n mt: ['marginTop'],\n mr: ['marginRight'],\n mb: ['marginBottom'],\n ml: ['marginLeft'],\n mx: ['marginLeft', 'marginRight'],\n my: ['marginTop', 'marginBottom'],\n\n p: ['padding'],\n pt: ['paddingTop'],\n pr: ['paddingRight'],\n pb: ['paddingBottom'],\n pl: ['paddingLeft'],\n px: ['paddingLeft', 'paddingRight'],\n py: ['paddingTop', 'paddingBottom'],\n}\n\ntype ThemedStyleProps = {\n [K in keyof typeof themedStyleProps]: keyof (typeof themedStyleProps)[K]\n}\n\ntype FilteredCSSProps = Omit<\n {\n [key in keyof CSSProperties]: CSSProperties[key]\n },\n | `-${string}`\n | `Moz${string}`\n | `ms${string}`\n | `Webkit${string}`\n | `Khtml${string}`\n | `O${string}`\n>\n\nexport type ThemedStyleProp<K extends keyof ThemedStyleProps> = ThemedStyleProps[K] | (string & {})\n\nexport interface StyleProps extends FilteredCSSProps {\n backgroundColor?: ThemedStyleProp<'backgroundColor'>\n border?: ThemedStyleProp<'border'>\n borderColor?: ThemedStyleProp<'borderColor'>\n borderRadius?: ThemedStyleProp<'borderRadius'>\n borderWidth?: ThemedStyleProp<'borderWidth'>\n boxShadow?: ThemedStyleProp<'boxShadow'>\n color?: ThemedStyleProp<'color'>\n fontFamily?: ThemedStyleProp<'fontFamily'>\n fontSize?: ThemedStyleProp<'fontSize'>\n fontWeight?: ThemedStyleProp<'fontWeight'>\n gap?: ThemedStyleProp<'gap'>\n lineHeight?: ThemedStyleProp<'lineHeight'>\n margin?: ThemedStyleProp<'margin'>\n marginBottom?: ThemedStyleProp<'marginBottom'>\n marginLeft?: ThemedStyleProp<'marginLeft'>\n marginRight?: ThemedStyleProp<'marginRight'>\n marginTop?: ThemedStyleProp<'marginTop'>\n padding?: ThemedStyleProp<'padding'>\n paddingBottom?: ThemedStyleProp<'paddingBottom'>\n paddingLeft?: ThemedStyleProp<'paddingLeft'>\n paddingRight?: ThemedStyleProp<'paddingRight'>\n paddingTop?: ThemedStyleProp<'paddingTop'>\n}\n","export const borders = {\n borders: {\n md: '1px solid',\n },\n borderWidths: {\n 0: '0',\n md: '1px',\n },\n}\n","export const palette = {\n black: '#000000',\n gray100: '#14161A',\n gray200: '#181B20',\n gray300: '#1F2329',\n gray400: '#2E343D',\n gray500: '#4C5766',\n gray600: '#5A6472',\n gray700: '#C5CBD3',\n gray800: '#E2E5E9',\n gray900: '#F1F2F4',\n white: '#ffffff',\n blue400: '#015AC6',\n blue500: '#0171F8',\n blue800: '#DBECFF',\n blue900: '#F5F9FF',\n green400: '#009E37',\n green500: '#00D149',\n green800: '#DBFFE8',\n transparent: '#FFFFFF00',\n inherit: 'inherit',\n\n // This color isn't in the Design System yet, but it's used in old components\n red500: '#c00000',\n}\n","export const radii = {\n md: '10px',\n lg: '20px',\n round: '50%',\n}\n","const colorVar = (colorName: string) => `var(--fr-colors-${colorName})`\n\nexport const semantic = {\n neutral: {\n background: colorVar('white'),\n border: colorVar('gray500'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n\n active: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n focus: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n hover: {\n background: colorVar('white'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray700'),\n },\n },\n\n primary: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n\n active: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n focus: {\n background: colorVar('blue500'),\n border: colorVar('blue500'),\n foreground: colorVar('white'),\n surface: colorVar('blue500'),\n },\n hover: {\n background: colorVar('blue400'),\n border: colorVar('blue400'),\n foreground: colorVar('white'),\n surface: colorVar('blue400'),\n },\n },\n\n secondary: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n\n active: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n focus: {\n background: colorVar('gray900'),\n border: colorVar('gray900'),\n foreground: colorVar('black'),\n surface: colorVar('gray900'),\n },\n hover: {\n background: colorVar('gray800'),\n border: colorVar('gray800'),\n foreground: colorVar('black'),\n surface: colorVar('gray800'),\n },\n },\n}\n","export const shadows = {\n md: '0px 4px 20px rgba(0, 0, 0, 0.1)',\n}\n","const SPACE_VALUE = 4\nconst SPACE_UNIT = 'px'\n\nconst spaceValue = (key: SpaceKeys[any]) =>\n typeof key === 'number' ? `${SPACE_VALUE * key}${SPACE_UNIT}` : key\n\nconst spaceKeys = [\n -20,\n -19,\n -18,\n -17,\n -16,\n -15,\n -14,\n -13,\n -12,\n -11,\n -10,\n -9,\n -8,\n -7,\n -6,\n -5,\n -4,\n -3,\n -2,\n -1,\n -0.5,\n 0,\n 0.5,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n 'auto',\n] as const\n\ntype SpaceKeys = typeof spaceKeys\n\ntype SpaceTokens = {\n [K in SpaceKeys[any]]: string\n}\nexport const space = Object.fromEntries(\n spaceKeys.map((key) => [key, spaceValue(key)])\n) as SpaceTokens\n","export const typography = {\n fontFamilies: {\n default: 'TT Interphases Pro, sans-serif',\n },\n fontSizes: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '18px',\n xl: '20px',\n '2xl': '24px',\n '3xl': '30px',\n '4xl': '36px',\n '5xl': '48px',\n },\n fontWeights: {\n thin: '100',\n extralight: '200',\n light: '300',\n regular: '400',\n medium: '500',\n demibold: '600',\n bold: '700',\n extrabold: '800',\n black: '900',\n },\n letterSpacings: {\n md: '0.02em',\n },\n lineHeights: {\n xs: '18px',\n sm: '22px',\n md: '24px',\n lg: '26px',\n xl: '30px',\n '2xl': '38px',\n '3xl': '46px',\n '4xl': '60px',\n },\n}\n","import { borders } from './borders'\nimport { palette } from './palette'\nimport { radii } from './radii'\nimport { semantic } from './semantic'\nimport { shadows } from './shadows'\nimport { space } from './space'\nimport { typography } from './typography'\n\n// Package up everything everywhere all at once for convenience\nexport const tokens = {\n ...borders,\n\n colors: {\n ...palette,\n ...semantic,\n },\n\n ...typography,\n\n radii,\n shadows,\n space,\n}\n\nexport type Tokens = typeof tokens\n","export function flattenObject(obj: Record<any, any>, path = '', separator = '.') {\n return Object.keys(obj).reduce((acc, k) => {\n const prefix = path.length ? `${path}${separator}` : ''\n const currentPath = `${prefix}${k}`\n const currentValue = obj[k]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n Object.assign(acc, flattenObject(currentValue, currentPath, separator))\n } else {\n acc[currentPath] = currentValue\n }\n\n return acc\n }, {})\n}\n","import { tokens, Tokens } from '../tokens'\nimport { flattenObject } from '../flattenObject'\n\nexport type Theme = Partial<Tokens>\n\n// Transform tokens to a flat list of CSS variables and values to inject into the page\n// IN: { colors: { black: '#000' } }, OUT: { '--fr-colors-black': '#000' }\nexport function createThemeVariables(tokens: Theme) {\n return flattenObject(tokens, '--fr', '-')\n}\n\n// Swap token values out and replace them with the CSS variables we defined\n// IN: { colors: { black: '#000' } }, OUT: { colors: { black: 'var(--fr-colors-black)' } }\nfunction mapTokensToThemeVariables(tokens: Tokens, path = '--fr'): Theme {\n const newObj: Theme = {}\n\n Object.keys(tokens).forEach((key) => {\n const currentValue = tokens[key]\n\n if (typeof currentValue === 'object' && currentValue !== null && !Array.isArray(currentValue)) {\n newObj[key] = mapTokensToThemeVariables(currentValue, `${path}-${key}`)\n } else {\n newObj[key] = `var(${path}-${key})`\n }\n })\n\n return newObj\n}\n\nexport const themeVariables = createThemeVariables(tokens)\n\nexport const theme = mapTokensToThemeVariables(tokens)\n","import { styleProps, stylePropShorthands } from './styleProps'\n\n/*\nPrefix these props to allow for usage in CSS & HTML:\n color\n - HTML: obsolete\n\n background\n - HTML: obsolete\n\n border\n - HTML: obsolete\n\n content\n - HTML: only used in <meta>, not relevant to components\n\n translate\n - used by both. Prefix _translate to force pass-through to HTML?\n\n\n height\n width\n - HTML: used by <canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video>\n - Can automatically send these to both HTML and CSS for those elements and allow manual prefixing just in case (like if you want to set HTML width to something different that CSS width)\n\n*/\n\nfunction prepValue(value: any) {\n if (Array.isArray(value)) {\n return new Map(value.map((v) => [v, v]))\n } else if (typeof value === 'object' && value !== null) {\n return new Map(Object.entries(value))\n } else if (['string', 'number'].includes(typeof value)) {\n return new Map([value, value])\n }\n\n return new Map()\n}\n\nconst stylePropsMap = new Map(\n Object.entries(styleProps).map(([propName, value]) => {\n return [propName, prepValue(value)]\n })\n)\n\nconst stylePropShorthandsMap = new Map(\n Object.entries(stylePropShorthands).map(([shorthand, targetProps]) => {\n return [shorthand, new Set(targetProps)]\n })\n)\n\nconst preservedProps = new Set(['height', 'width'])\n\nconst elementsWithPreservedProps = new Set([\n 'canvas',\n 'embed',\n 'iframe',\n 'img',\n 'input',\n 'object',\n 'video',\n])\n\nexport function stylePropsToCss(props: Record<any, any>, element: React.ElementType = 'div') {\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\n if (styleProp != null) {\n // Split space-separated values out and process them individually\n if (typeof propValue === 'string' && propValue.indexOf(' ') > -1) {\n const splitPropValues = propValue.split(' ')\n\n cssFromProps[propName] = splitPropValues\n .map((v) => styleProp.get(v.toString()) ?? v)\n .join(' ')\n\n // Replace known token values (e.g. lineHeight=\"xl\")\n } else if (styleProp.has(propValue.toString())) {\n cssFromProps[propName] = styleProp.get(propValue.toString())\n\n // Pass value through, we trust TypeScript to catch invalid values, right?\n } else {\n cssFromProps[propName] = propValue\n }\n\n // Don't delete the special props that get passed through to certain tags by default\n if (\n typeof element !== 'string' ||\n !elementsWithPreservedProps.has(element) ||\n !preservedProps.has(propName)\n ) {\n delete unmatchedProps[propName]\n }\n }\n })\n\n // Remove prefix from prefixed style props and pass them through\n Object.keys(unmatchedProps).forEach((propName) => {\n const clippedPropName = propName.substring(1)\n\n if (propName.indexOf('_') === 0 && stylePropsMap.has(clippedPropName)) {\n unmatchedProps[clippedPropName] = unmatchedProps[propName]\n\n delete unmatchedProps[propName]\n }\n })\n\n return { cssFromProps, unmatchedProps }\n}\n","import DOMPurify from 'dompurify'\n\nfunction getWindow() {\n if (typeof window === 'undefined') {\n // NOTE: JSDOM is required inline because it has import side effects that depend on node\n const { JSDOM } = require('jsdom')\n return new JSDOM('<!DOCTYPE html>').window\n }\n\n return window\n}\n\nexport function sanitize(dirty?: string) {\n if (!dirty) {\n return { __html: '' }\n }\n\n return {\n __html: DOMPurify(getWindow()).sanitize(dirty, {\n ALLOWED_TAGS: [\n 'b',\n 'i',\n 'a',\n 'span',\n 'div',\n 'p',\n 'pre',\n 'u',\n 'br',\n 'img',\n 'code',\n 'li',\n 'ul',\n 'table',\n 'tbody',\n 'thead',\n 'tr',\n 'td',\n 'th',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'video',\n ],\n ALLOWED_ATTR: [\n 'style',\n 'class',\n 'target',\n 'id',\n 'href',\n 'alt',\n 'src',\n 'controls',\n 'autoplay',\n 'loop',\n 'muted',\n ],\n }),\n }\n}\n","const base = {\n color: 'neutral.foreground',\n fontFamily: 'default',\n margin: '0',\n}\n\nexport const Display1 = {\n ...base,\n fontSize: '5xl',\n fontWeight: 'bold',\n lineHeight: '4xl',\n}\n\nexport const Display2 = {\n ...base,\n fontSize: '4xl',\n fontWeight: 'bold',\n lineHeight: '3xl',\n}\n\nexport const H1 = {\n ...base,\n fontSize: '3xl',\n fontWeight: 'bold',\n lineHeight: '2xl',\n}\n\nexport const H2 = {\n ...base,\n fontSize: '2xl',\n fontWeight: 'bold',\n lineHeight: 'xl',\n}\n\nexport const H3 = {\n ...base,\n fontSize: 'xl',\n fontWeight: 'bold',\n lineHeight: 'lg',\n}\n\nexport const H4 = {\n ...base,\n fontSize: 'lg',\n fontWeight: 'bold',\n lineHeight: 'md',\n}\n\nexport const Body1 = {\n ...base,\n fontSize: 'md',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Body2 = {\n ...base,\n fontSize: 'sm',\n fontWeight: 'regular',\n lineHeight: 'md',\n}\n\nexport const Caption = {\n ...base,\n fontSize: 'xs',\n fontWeight: 'regular',\n lineHeight: 'sm',\n}\n","import { Box, BoxProps } from '../Box'\n\nimport * as styles from './Text.styles'\n\ntype TextVariant =\n | 'Display1'\n | 'Display2'\n | 'H1'\n | 'H2'\n | 'H3'\n | 'H4'\n | 'Body1'\n | 'Body2'\n | 'Caption'\n\nexport interface TextProps extends BoxProps {\n variant?: TextVariant\n}\n\nfunction BaseText({ as = 'span', children, variant = 'Body1', ...props }: TextProps) {\n return (\n <Box as={as} {...styles[variant]} {...props}>\n {children}\n </Box>\n )\n}\n\nconst textVariantNames: TextVariant[] = [\n 'Display1',\n 'Display2',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'Body1',\n 'Body2',\n 'Caption',\n]\n\nconst textVariantComponents = Object.fromEntries(\n textVariantNames.map((variant) => {\n const asProp = ['H1', 'H2', 'H3', 'H4'].includes(variant)\n ? (variant.toLowerCase() as 'h1' | 'h2' | 'h3' | 'h4')\n : undefined\n const component = (props: TextProps) => (\n <BaseText as={asProp} {...props} variant={variant}>\n {props.children}\n </BaseText>\n )\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Text = Object.assign(BaseText, textVariantComponents)\n","export const base = ({ radii, space }) => ({\n borderWidth: 0,\n borderRadius: radii.md,\n padding: `${space[2]} ${space[4]}`,\n})\n\nexport const Primary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.primary.surface,\n color: colors.primary.foreground,\n\n '&:hover': {\n backgroundColor: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Secondary = ({ colors }) => [\n base,\n {\n backgroundColor: colors.secondary.surface,\n color: colors.secondary.foreground,\n\n '&:hover': {\n backgroundColor: colors.secondary.hover.surface,\n },\n },\n]\n\nexport const Link = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.primary.surface,\n\n '&:hover': {\n color: colors.primary.hover.surface,\n },\n },\n]\n\nexport const Plain = ({ colors }) => [\n base,\n {\n backgroundColor: colors.transparent,\n color: colors.neutral.foreground,\n },\n]\n","import { Interpolation } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\nimport { Text } from '../Text'\n\nimport * as styles from './Button.styles'\n\n// TODO: Generate this type from buttonVariantNames\ntype ButtonVariant = 'Primary' | 'Secondary' | 'Link' | 'Plain'\n\nexport interface ButtonProps extends BoxProps {\n title?: string\n variant?: ButtonVariant\n}\n\nfunction BaseButton({ as, children, part, title, variant = 'Primary', ...props }: ButtonProps) {\n const variantPart = variant.toLocaleLowerCase()\n\n return (\n <Box\n as={as ?? 'button'}\n css={styles[variant] as Interpolation<any>}\n part={[`button-${variantPart}`, part]}\n {...props}\n >\n {children}\n {title && (\n <Text.Body2 fontWeight=\"demibold\" color=\"inherit\">\n {title}\n </Text.Body2>\n )}\n </Box>\n )\n}\n\nconst buttonVariantNames: ButtonVariant[] = ['Primary', 'Secondary', 'Link', 'Plain']\n\nconst buttonVariantComponents = Object.fromEntries(\n buttonVariantNames.map((variant) => {\n const component = (props: ButtonProps) => {\n return (\n <BaseButton {...props} variant={variant}>\n {props.children}\n </BaseButton>\n )\n }\n\n component.displayName = `Text.${variant}`\n\n return [variant, component]\n })\n)\n\nexport const Button = Object.assign(BaseButton, buttonVariantComponents)\n","import * as React from 'react'\n\nimport { type BoxProps } from '../Box'\nimport { Flex } from '../Flex/Flex'\n\nexport const Card = React.forwardRef(({ as, children, ...props }: BoxProps, ref) => {\n const Component = as ?? Flex.Column\n return (\n <Component backgroundColor=\"neutral.background\" borderRadius=\"md\" p={5} {...props} ref={ref}>\n {children}\n </Component>\n )\n})\n","import * as React from 'react'\nimport { Box, BoxProps } from '../Box'\n\nconst Row = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'row' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nconst Column = React.forwardRef(({ children, css, ...props }: BoxProps, ref) => {\n return (\n <Box css={[{ display: 'flex', flexDirection: 'column' }, css]} {...props} ref={ref}>\n {children}\n </Box>\n )\n})\n\nexport const Flex = {\n Column,\n Row,\n}\n","import { Box, BoxProps } from '../Box'\n\nexport interface ImageProps extends BoxProps {\n src: string\n}\n\nexport function Image({ part, src, ...props }: ImageProps) {\n return <Box as=\"img\" part={['image', part]} src={src} {...props} />\n}\n","import { Box, BoxProps } from '../Box'\n\nfunction getVideoEmbedSrc(videoUri: string) {\n if (videoUri.includes('youtube')) {\n const videoId = videoUri.split('v=')[1]?.split('&')[0]\n\n return `https://www.youtube.com/embed/${videoId}`\n } else if (videoUri.includes('vimeo')) {\n const videoId = videoUri.split('vimeo.com/')[1]?.split('&')[0]\n\n return `https://player.vimeo.com/video/${videoId}`\n } else if (videoUri.includes('wistia')) {\n const videoId = videoUri.split('wistia.com/medias/')[1]?.split('&')[0]\n\n return `https://fast.wistia.net/embed/iframe/${videoId}`\n }\n\n throw new Error('Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).')\n}\n\nexport interface VideoProps extends BoxProps {\n src: string\n}\n\nexport function Video({ part, src, ...props }: VideoProps) {\n const videoEmbedSrc = getVideoEmbedSrc(src)\n\n // TODO: Add play button overtop?\n return (\n <Box\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n as=\"iframe\"\n backgroundColor=\"gray100\"\n borderWidth={0}\n part={['video', part]}\n src={videoEmbedSrc}\n {...props}\n ></Box>\n )\n}\n","import { Image } from './Image'\nimport { Video } from './Video'\nimport { BoxProps } from '../Box'\n\nexport interface MediaProps extends BoxProps {\n src: string\n type?: 'image' | 'video'\n}\n\nexport function Media({ src, type, ...props }: MediaProps) {\n const Component = type === 'video' ? Video : Image\n\n return <Component src={src} {...props} />\n}\n","import { Flow } from '@frigade/js'\nimport { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport interface FlowConfig {\n variables?: Record<string, any>\n}\n\nexport function useFlow(flowId: string, config?: FlowConfig) {\n const [flow, setFlow] = useState<Flow>()\n const [_, setRandomString] = useState<string>('')\n const { frigade } = useContext(FrigadeContext)\n\n const handler = (updatedFlow: Flow) => {\n if (updatedFlow.id !== flowId) {\n return\n }\n\n if (config?.variables) {\n updatedFlow.applyVariables(config.variables)\n }\n\n setFlow(updatedFlow)\n setRandomString(Math.random().toString())\n }\n\n useEffect(() => {\n ;(async () => {\n const flowInstance: Flow = await frigade.getFlow(flowId)\n if (config?.variables) {\n flowInstance.applyVariables(config.variables)\n }\n\n setFlow(flowInstance)\n })()\n\n frigade.onStateChange(handler)\n\n return () => {\n frigade.removeStateChangeHandler(handler)\n }\n }, [])\n\n return { flow }\n}\n","import { createContext, Dispatch, SetStateAction, useRef, useState } from 'react'\nimport { Global, ThemeProvider } from '@emotion/react'\n\nimport {\n createThemeVariables,\n theme as themeTokens,\n type Theme,\n themeVariables,\n} from '../../shared/theme'\nimport { Frigade } from '@frigade/js'\n\ntype NavigateHandler = (url: string, target?: string) => void\n\n// TODO: type theme something like Partial<typeof themeTokens>, but allow any value for those keys\nexport interface ProviderProps {\n apiKey: string\n apiUrl?: string\n children?: React.ReactNode\n navigate?: NavigateHandler\n theme?: Theme\n userId?: string\n groupId?: string\n}\n\ninterface ProviderContext extends Omit<ProviderProps, 'children' | 'theme'> {\n modals: string[]\n setModals: Dispatch<SetStateAction<string[]>>\n frigade?: Frigade\n}\n\nexport const FrigadeContext = createContext<ProviderContext>({\n apiKey: '',\n modals: [],\n setModals: () => {},\n navigate: () => {},\n})\n\nexport function Provider({ children, navigate, theme, ...props }: ProviderProps) {\n const themeOverrides = theme ? createThemeVariables(theme) : {}\n const [modals, setModals] = useState([])\n const frigade = useRef(\n new Frigade(props.apiKey, {\n apiKey: props.apiKey,\n apiUrl: props.apiUrl,\n userId: props.userId,\n groupId: props.groupId,\n })\n )\n\n const navigateHandler =\n navigate ??\n ((url, target = '_self') => {\n window.open(url, target)\n })\n\n return (\n <FrigadeContext.Provider\n value={{\n modals,\n setModals,\n navigate: navigateHandler,\n ...props,\n frigade: frigade.current,\n }}\n >\n <Global styles={{ ':root': { ...themeVariables, ...themeOverrides } }} />\n <ThemeProvider theme={themeTokens}>{children}</ThemeProvider>\n </FrigadeContext.Provider>\n )\n}\n","import { MouseEvent, useCallback, useEffect, useRef } from 'react'\n\nimport { Flow } from '@frigade/js'\n\nexport type FlowHandler = (\n flow: Flow,\n event?: MouseEvent<unknown>\n) => Promise<boolean | void> | (boolean | void)\n\nexport interface StepHandlers {\n onComplete?: FlowHandler\n onDismiss?: FlowHandler\n}\n\nexport function useFlowHandlers(flow: Flow, { onComplete, onDismiss }: StepHandlers = {}) {\n const lastCompleted = useRef(null)\n\n useEffect(() => {\n if (flow == null) return\n\n if (flow.isCompleted && lastCompleted.current === false) {\n ;(async () => {\n await onComplete?.(flow)\n })()\n }\n\n lastCompleted.current = flow?.isCompleted\n }, [flow?.isCompleted])\n\n return {\n handleDismiss: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = await onDismiss?.(flow, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n await flow.skip()\n },\n [flow]\n ),\n }\n}\n","import { MouseEvent, useCallback, useContext } from 'react'\n\nimport type { FlowStep } from '@frigade/js'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport type StepHandler = (\n step: FlowStep,\n event?: MouseEvent<unknown>\n) => Promise<boolean | void> | (boolean | void)\n\nexport interface StepHandlers {\n onPrimary?: StepHandler\n onSecondary?: StepHandler\n}\n\nexport function useStepHandlers(step: FlowStep, { onPrimary, onSecondary }: StepHandlers = {}) {\n const { navigate } = useContext(FrigadeContext)\n\n return {\n handlePrimary: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = await onPrimary?.(step, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n await step.complete()\n\n if (step.primaryButtonUri != null) {\n navigate(step.primaryButtonUri, step.primaryButtonUriTarget)\n }\n },\n [step]\n ),\n\n handleSecondary: useCallback(\n async (e: MouseEvent<unknown>) => {\n const continueDefault = await onSecondary?.(step, e)\n\n if (continueDefault === false) {\n e.preventDefault()\n return false\n }\n\n // Should there be a step.skip method?\n await step.complete()\n\n if (step.secondaryButtonUri != null) {\n navigate(step.secondaryButtonUri, step.secondaryButtonUriTarget)\n }\n },\n [step]\n ),\n }\n}\n","import { Dialog, type DialogProps } from '../Dialog'\nimport { Flex } from '../Flex/Flex'\nimport { type FlowComponentProps } from '../../shared/types'\nimport { useFlow } from '../../hooks/useFlow'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { useStepHandlers } from '@/hooks/useStepHandlers'\n\nexport interface AnncouncementProps extends DialogProps, FlowComponentProps {}\n\nexport function Announcement({\n flowId,\n onComplete,\n onDismiss,\n onPrimary,\n onSecondary,\n variables,\n}: AnncouncementProps) {\n const { flow } = useFlow(flowId, {\n variables,\n })\n const step = flow?.getCurrentStep()\n\n const { handleDismiss } = useFlowHandlers(flow, {\n onComplete,\n onDismiss,\n })\n\n const { handlePrimary, handleSecondary } = useStepHandlers(step, {\n onPrimary,\n onSecondary,\n })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n step?.start()\n\n return (\n <Dialog>\n <Dialog.Close onClick={handleDismiss} />\n\n <Dialog.Title>{step.title}</Dialog.Title>\n <Dialog.Subtitle>{step.subtitle}</Dialog.Subtitle>\n\n <Dialog.Media\n src={step.imageUri}\n css={{ aspectRatio: '1.5', objectFit: 'cover', width: '100%' }}\n />\n\n <Dialog.ProgressDots\n current={flow.getNumberOfCompletedSteps()}\n total={flow.getNumberOfAvailableSteps()}\n />\n\n <Flex.Row\n css={{\n '& > button': {\n flexGrow: 1,\n },\n }}\n gap={3}\n >\n <Dialog.Secondary title=\"Secondary\" onClick={handleSecondary} />\n <Dialog.Primary title=\"Primary\" onClick={handlePrimary} />\n </Flex.Row>\n </Dialog>\n )\n}\n","import { type BoxProps } from '@/components/Box'\nimport { Button } from '@/components/Button'\nimport { Card } from '@/components/Card'\nimport { Flex } from '@/components/Flex/Flex'\nimport { Text } from '@/components/Text'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\n\nimport { useFlow } from '@/hooks/useFlow'\nimport { useFlowHandlers } from '@/hooks/useFlowHandlers'\nimport { useStepHandlers } from '@/hooks/useStepHandlers'\n\nimport type { FlowComponentProps } from '@/shared/types'\n\ninterface BannerProps extends BoxProps, FlowComponentProps {}\n\nexport function Banner({\n flowId,\n onComplete,\n onDismiss,\n onPrimary,\n onSecondary,\n ...props\n}: BannerProps) {\n const { flow } = useFlow(flowId)\n const step = flow?.getCurrentStep()\n\n const { handleDismiss } = useFlowHandlers(flow, { onComplete, onDismiss })\n const { handlePrimary, handleSecondary } = useStepHandlers(step, { onPrimary, onSecondary })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n step?.start()\n\n return (\n <Card as={Flex.Row} border=\"md\" borderColor=\"gray900\" justifyContent=\"space-between\" {...props}>\n <Flex.Row gap={3}>\n <img src={step.imageUri} style={{ height: 40, width: 40, alignSelf: 'center' }} />\n <Flex.Column>\n <Text.H4 mb={1}>{step.title}</Text.H4>\n <Text.Body2>{step.subtitle}</Text.Body2>\n </Flex.Column>\n </Flex.Row>\n\n <Flex.Row alignItems=\"center\" gap={3}>\n <Button.Secondary title={step.secondaryButtonTitle} onClick={handleSecondary} />\n <Button.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n <Button.Plain part=\"banner-close\" onClick={handleDismiss}>\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Flex.Row>\n </Card>\n )\n}\n","import React, { useEffect, useRef, useState } from 'react'\n\nimport { XMarkIcon } from '@heroicons/react/24/solid'\nimport * as Popover from '@radix-ui/react-popover'\n\nimport { useBoundingClientRect } from '../../hooks/useBoundingClientRect'\nimport { Box } from '../Box'\nimport { Button, ButtonProps } from '../Button'\nimport { Card } from '../Card'\nimport { Dot } from './Dot'\nimport { Media, MediaProps } from '../Media'\nimport { Text, TextProps } from '../Text'\nimport { getDotPosition } from './getDotPosition'\nimport { mapTooltipPropsToPopoverProps } from './mapTooltipPropsToPopoverProps'\n\ninterface MergedRadixPopoverProps\n extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>,\n Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {}\nexport interface TooltipProps extends MergedRadixPopoverProps {\n align?: Popover.PopoverContentProps['align'] | 'before' | 'after'\n anchor?: string\n spotlight?: boolean\n style?: React.CSSProperties\n}\n\nexport function Tooltip({\n anchor,\n children,\n className,\n spotlight = false,\n style,\n ...props\n}: TooltipProps) {\n const { node: contentNode, rect: contentRect, ref: contentRef } = useBoundingClientRect()\n const { contentProps, rootProps } = mapTooltipPropsToPopoverProps(props, contentRect)\n\n const [alignAttr, setAlignAttr] = useState(contentProps.align)\n const [sideAttr, setSideAttr] = useState(contentProps.side)\n\n // Radix will update data attrs to let us know if Popover.Content has collided\n if (contentNode !== null) {\n const currentAlignAttr = contentNode.getAttribute('data-align')\n const currentSideAttr = contentNode.getAttribute('data-side')\n\n if (alignAttr !== currentAlignAttr) {\n setAlignAttr(currentAlignAttr)\n }\n\n if (sideAttr !== currentSideAttr) {\n setSideAttr(currentSideAttr)\n }\n }\n\n const anchorRef = useRef(null)\n const [anchorElementRef, setAnchorElementRef] = useState(null)\n\n useEffect(() => {\n const anchorQuery = document.querySelector(anchor)\n\n if (anchorQuery != null) {\n anchorRef.current = anchorQuery\n setAnchorElementRef(anchorRef)\n }\n }, [anchor])\n\n if (anchorElementRef == null) return null\n\n const anchorRect = anchorElementRef.current.getBoundingClientRect()\n\n let anchorRadius = '0'\n if (typeof window !== 'undefined') {\n anchorRadius = window.getComputedStyle(anchorElementRef.current).borderRadius\n }\n\n const dotPosition = getDotPosition({ props, alignAttr, sideAttr })\n\n return (\n <Popover.Root defaultOpen={true} {...rootProps}>\n <Popover.Anchor virtualRef={anchorElementRef} />\n <Popover.Portal>\n <div\n className={className}\n css={{ bottom: 0, left: 0, position: 'absolute', right: 0, top: 0, zIndex: 9999 }}\n >\n {spotlight && (\n <Box\n part=\"tooltip-spotlight\"\n position=\"absolute\"\n css={{\n borderRadius: anchorRadius,\n boxShadow: '0 0 0 2000px rgb(0 0 0 / 0.5)',\n height: anchorRect.height,\n left: anchorRect.left,\n top: anchorRect.top,\n width: anchorRect.width,\n }}\n />\n )}\n <Popover.Content asChild {...contentProps} ref={contentRef}>\n <Card\n boxShadow=\"md\"\n part=\"tooltip-content\"\n position=\"relative\"\n css={{\n maxWidth: '360px',\n ...style,\n }}\n >\n <Dot style={dotPosition} />\n\n {children}\n </Card>\n </Popover.Content>\n </div>\n </Popover.Portal>\n </Popover.Root>\n )\n}\n\nTooltip.Close = (props: ButtonProps) => {\n return (\n <Popover.Close aria-label=\"Close\" asChild>\n <Button.Plain\n css={{\n top: '12px',\n right: '4px',\n }}\n part=\"close\"\n position=\"absolute\"\n {...props}\n >\n <XMarkIcon height=\"24\" fill=\"currentColor\" />\n </Button.Plain>\n </Popover.Close>\n )\n}\n\nTooltip.Media = ({ src, ...props }: MediaProps) => {\n if (src == null) return null\n\n return (\n <Media\n borderRadius=\"md md 0 0\"\n borderWidth=\"0\"\n css={{\n aspectRatio: '2',\n }}\n margin=\"-5 -5 5\"\n src={src}\n {...props}\n />\n )\n}\n\nTooltip.Primary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Primary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Progress = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 fontWeight=\"demibold\" part=\"progress\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Secondary = ({ onClick, title, ...props }: ButtonProps) => {\n if (title == null) return null\n\n return <Button.Secondary title={title} onClick={onClick} {...props} />\n}\n\nTooltip.Subtitle = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body2 part=\"subtitle\" {...props}>\n {children}\n </Text.Body2>\n )\n}\n\nTooltip.Title = ({ children, ...props }: TextProps) => {\n if (children == null) return null\n\n return (\n <Text.Body1 fontWeight=\"bold\" mb={1} part=\"title\" {...props}>\n {children}\n </Text.Body1>\n )\n}\n","import { useCallback, useLayoutEffect, useState } from 'react'\n\nexport function useBoundingClientRect() {\n const initialRect =\n 'DOMRect' in globalThis\n ? new DOMRect()\n : {\n height: 0,\n width: 0,\n x: 0,\n y: 0,\n bottom: 0,\n top: 0,\n right: 0,\n left: 0,\n toJSON: () => {},\n }\n const [rect, setRect] = useState(initialRect)\n const [node, setNode] = useState(null)\n\n const ref = useCallback((node: HTMLElement) => {\n setNode(node)\n }, [])\n\n useLayoutEffect(() => {\n if (!node) return\n\n setRect(node.getBoundingClientRect())\n }, [node])\n\n return {\n node,\n rect,\n ref,\n }\n}\n","import { keyframes } from '@emotion/react'\nimport { Box, BoxProps } from '../Box'\n\nconst pulse = keyframes({\n '0%': {\n opacity: 0.5,\n transform: 'scale(0.5)',\n },\n '50%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n '100%': {\n opacity: 0,\n transform: 'scale(1)',\n },\n})\n\nexport interface DotProps extends BoxProps {}\n\nexport function Dot({ style = {}, part = '', ...props }: DotProps) {\n return (\n <Box\n part={`dot-wrapper ${part}`}\n style={{\n height: '48px',\n position: 'absolute',\n width: '48px',\n ...style,\n }}\n {...props}\n >\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot-pulse\"\n css={{\n animation: `2s ease-out infinite ${pulse}`,\n borderRadius: '24px',\n height: '48px',\n left: 0,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center center',\n width: '48px',\n }}\n />\n <Box\n backgroundColor=\"primary.surface\"\n part=\"dot\"\n style={{\n borderRadius: '12px',\n height: '24px',\n left: '12px',\n position: 'absolute',\n top: '12px',\n width: '24px',\n }}\n />\n </Box>\n )\n}\n","export function getDotPosition({ props, alignAttr, sideAttr }) {\n const currentSide = sideAttr ?? 'bottom'\n const dotProps = {}\n\n // Radix's collision system isn't aware of our custom before|after align\n const getCurrentAlign = () => {\n if (['after', 'before'].includes(props.align)) {\n if (alignAttr == 'start') {\n return 'before'\n } else if (alignAttr == 'end') {\n return 'after'\n }\n }\n\n return props.align ?? 'after'\n }\n\n const dotOffset = '-24px'\n\n const oppositeSides = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }\n\n /* \n Rules:\n - Dot is opposite to side prop (e.g. side=left -> dot=right)\n - align=before|end -> Dot goes to highest extent (right/bottom) of align-axis\n - align=after|start -> Dot goes to lowest extent (left/top) of align-axis\n - align=center -> Dot goes to the center\n */\n\n dotProps[oppositeSides[currentSide]] = dotOffset\n\n const currentAlign = getCurrentAlign()\n\n if (['before', 'end'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['right'] = dotOffset\n } else {\n dotProps['bottom'] = dotOffset\n }\n } else if (['after', 'start'].includes(currentAlign)) {\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = dotOffset\n } else {\n dotProps['top'] = dotOffset\n }\n } else {\n // The only option left is align=center\n if (['top', 'bottom'].includes(currentSide)) {\n dotProps['left'] = `calc(50% + ${dotOffset})`\n } else {\n dotProps['top'] = `calc(50% + ${dotOffset})`\n }\n }\n\n return dotProps\n}\n","import { TooltipProps } from '.'\n\nconst RADIX_PROPS = {\n content: [\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'forceMount',\n 'hideWhenDetached',\n 'onCloseAutoFocus',\n 'onEscapeKeyDown',\n 'onFocusOutside',\n 'onInteractOutside',\n 'onOpenAutoFocus',\n 'onPointerDownOutside',\n 'side',\n 'sideOffset',\n 'sticky',\n ],\n root: ['defaultOpen', 'modal', 'onOpenChange', 'open'],\n}\n\nexport function mapTooltipPropsToPopoverProps(props: TooltipProps, contentRect: DOMRect) {\n const contentProps = Object.fromEntries(\n RADIX_PROPS.content\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n const rootProps = Object.fromEntries(\n RADIX_PROPS.root\n .map((propName) => [propName, props[propName]])\n .filter((propEntry) => propEntry[1] !== undefined)\n )\n\n // Default to align=after, side=bottom\n contentProps.align = contentProps.align ?? 'after'\n contentProps.side = contentProps.side ?? 'bottom'\n\n /*\n Here we're extending Popover.Content's align prop to accept 'before' and\n 'after' in addition to its existing values.\n\n TL;DR:\n 1. Use existing alignOffset prop to push Content to be before/after the\n corresponding edge of the element it's attached to.\n 2. Add a CSS margin to patch alignOffset back onto Content, as Popover\n has a bug that prevents alignOffset from extending past the edge of\n its Trigger/Anchor.\n\n SEE: https://github.com/radix-ui/primitives/issues/2457\n */\n if (['before', 'after'].includes(contentProps.align)) {\n const mapToOriginalAlignValues = {\n after: 'end',\n before: 'start',\n }\n\n const mapAlignOffsetToMargin = (align, side) => {\n /*\n Translate alignOffset to CSS margin based on align and side props:\n bottom || top\n after: marginLeft\n before: marginRight\n left || right\n after: marginTop\n before: marginBottom\n */\n if (['top', 'bottom'].includes(side)) {\n if (align == 'after') {\n return 'marginLeft'\n } else {\n return 'marginRight'\n }\n } else {\n if (align == 'after') {\n return 'marginTop'\n } else {\n return 'marginBottom'\n }\n }\n }\n\n const originalOffset = contentProps.alignOffset ?? 0\n const originalStyleProp = contentProps.style ?? {}\n const currentSide = contentProps.side ?? 'bottom'\n const currentAlign = contentProps.align\n\n // Copy alignOffset value to CSS margin\n contentProps['style'] = {\n ...originalStyleProp,\n [mapAlignOffsetToMargin(currentAlign, currentSide)]: originalOffset,\n }\n\n const lengthOfCurrentSide = ['top', 'bottom'].includes(currentSide)\n ? contentRect.width\n : contentRect.height\n\n // Change alignOffset to be at the end of the positioned side\n contentProps.alignOffset = (lengthOfCurrentSide + originalOffset) * -1\n\n // Flip align prop back to valid Radix option, or default to 'after'\n contentProps['align'] = mapToOriginalAlignValues[currentAlign]\n }\n\n return {\n contentProps,\n rootProps,\n }\n}\n","import { useContext, useEffect, useState } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useModal(flowId: string) {\n const { modals, setModals } = useContext(FrigadeContext)\n const [isCurrentModal, setIsCurrentModal] = useState(false)\n\n useEffect(() => {\n setModals([...modals, flowId])\n\n return () => setModals(modals.filter((v) => v !== flowId))\n }, [])\n\n useEffect(() => {\n const newIsCurrentModal = modals[0] === flowId\n\n if (newIsCurrentModal !== isCurrentModal) {\n setIsCurrentModal(newIsCurrentModal)\n }\n }, [modals])\n\n return {\n isCurrentModal,\n }\n}\n","import type { Flow, FlowStep } from '@frigade/js'\n\nimport { TourProps } from '.'\nimport { useModal } from '../../hooks/useModal'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\nimport { useStepHandlers } from '../../hooks/useStepHandlers'\n\nimport { Flex } from '../Flex/Flex'\nimport { Tooltip } from '../Tooltip'\n\nexport interface TourStepProps extends Omit<TourProps, 'flowId'> {\n step: FlowStep\n flow: Flow\n}\n\nexport function TourStep({\n step,\n flow,\n onDismiss,\n onPrimary,\n onSecondary,\n ...props\n}: TourStepProps) {\n const { isCurrentModal } = useModal(`${flow.id}-${step.id}`)\n\n const { handleDismiss } = useFlowHandlers(flow, {\n onDismiss,\n })\n\n const { handlePrimary, handleSecondary } = useStepHandlers(step, {\n onPrimary,\n onSecondary,\n })\n\n if (!isCurrentModal) {\n return null\n }\n\n return (\n <Tooltip\n key={step.id}\n anchor={step.selector as string}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n {...props}\n >\n <Tooltip.Close onClick={handleDismiss} />\n\n <Tooltip.Media\n src={step.videoUri ?? step.imageUri}\n type={step.videoUri ? 'video' : 'image'}\n />\n\n <Tooltip.Title>{step.title}</Tooltip.Title>\n <Tooltip.Subtitle>{step.subtitle}</Tooltip.Subtitle>\n\n <Flex.Row alignItems=\"center\" gap={3} justifyContent=\"flex-end\" part=\"tooltip-footer\" pt={4}>\n <Tooltip.Progress>{`${\n flow.getNumberOfCompletedSteps() + 1\n }/${flow.getNumberOfAvailableSteps()}`}</Tooltip.Progress>\n\n <Tooltip.Secondary\n marginLeft=\"auto\"\n title={step.secondaryButtonTitle}\n onClick={handleSecondary}\n />\n <Tooltip.Primary title={step.primaryButtonTitle} onClick={handlePrimary} />\n </Flex.Row>\n </Tooltip>\n )\n}\n","import { type FlowComponentProps } from '../../shared/types'\nimport { type TooltipProps } from '../Tooltip'\nimport { TourStep } from './TourStep'\nimport { useFlow } from '../../hooks/useFlow'\nimport { useFlowHandlers } from '../../hooks/useFlowHandlers'\n\nexport interface TourProps extends TooltipProps, FlowComponentProps {}\n\nexport function Tour({ flowId, onComplete, variables, ...props }: TourProps) {\n const { flow } = useFlow(flowId, {\n variables,\n })\n useFlowHandlers(flow, { onComplete })\n\n if (flow == null || flow.isVisible === false) {\n return null\n }\n\n flow.start()\n\n const step = flow.getCurrentStep()\n step?.start()\n\n return <TourStep step={step} flow={flow} {...props} />\n}\n","import { useContext } from 'react'\n\nimport { FrigadeContext } from '../components/Provider'\n\nexport function useFrigade() {\n const { frigade } = useContext(FrigadeContext)\n\n return { frigade }\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -4,15 +4,15 @@ import { XMarkIcon } from '@heroicons/react/24/solid';
|
|
|
4
4
|
import * as N from 'react';
|
|
5
5
|
import { createContext, useState, useRef, useContext, useEffect, useCallback, useLayoutEffect } from 'react';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import Xe from 'known-css-properties';
|
|
8
|
+
import rt from 'dompurify';
|
|
9
9
|
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
10
10
|
import { keyframes, Global, ThemeProvider } from '@emotion/react';
|
|
11
11
|
import { Frigade } from '@frigade/js';
|
|
12
12
|
import * as S from '@radix-ui/react-popover';
|
|
13
13
|
|
|
14
|
-
var Ke=Object.defineProperty;var je=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var te=(e,t)=>{for(var o in t)Ke(e,o,{get:t[o],enumerable:!0});};var oe={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var re={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"};var ne={md:"10px",lg:"20px",round:"50%"};var s=e=>`var(--fr-colors-${e})`,ie={neutral:{background:s("white"),border:s("gray500"),foreground:s("black"),surface:s("gray700"),active:{background:s("white"),border:s("gray900"),foreground:s("black"),surface:s("gray700")},focus:{background:s("white"),border:s("gray900"),foreground:s("black"),surface:s("gray700")},hover:{background:s("white"),border:s("gray900"),foreground:s("black"),surface:s("gray700")}},primary:{background:s("blue500"),border:s("blue500"),foreground:s("white"),surface:s("blue500"),active:{background:s("blue400"),border:s("blue400"),foreground:s("white"),surface:s("blue400")},focus:{background:s("blue500"),border:s("blue500"),foreground:s("white"),surface:s("blue500")},hover:{background:s("blue400"),border:s("blue400"),foreground:s("white"),surface:s("blue400")}},secondary:{background:s("gray900"),border:s("gray900"),foreground:s("black"),surface:s("gray900"),active:{background:s("gray800"),border:s("gray800"),foreground:s("black"),surface:s("gray800")},focus:{background:s("gray900"),border:s("gray900"),foreground:s("black"),surface:s("gray900")},hover:{background:s("gray800"),border:s("gray800"),foreground:s("black"),surface:s("gray800")}}};var se={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ue="px",_e=e=>typeof e=="number"?`${4*e}${Ue}`:e,Ne=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],ae=Object.fromEntries(Ne.map(e=>[e,_e(e)]));var le={fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var z={...oe,colors:{...re,...ie},...le,radii:ne,shadows:se,space:ae};function A(e,t="",o="."){return Object.keys(e).reduce((r,n)=>{let i=`${t.length?`${t}${o}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,A(l,i,o)):r[i]=l,r},{})}function K(e){return A(e,"--fr","-")}function pe(e,t="--fr"){let o={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?o[r]=pe(n,`${t}-${r}`):o[r]=`var(${t}-${r})`;}),o}var de=K(z),p=pe(z);var Xe=Je.all.filter(e=>e.indexOf("-")!=0).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),Ge=Object.fromEntries(Xe),j=A(p.colors),qe={color:j,backgroundColor:j,borderColor:j,border:p.borders,borderRadius:p.radii,borderWidth:p.borderWidths,boxShadow:p.shadows,fontFamily:p.fontFamilies,fontSize:p.fontSizes,fontWeight:p.fontWeights,gap:p.space,lineHeight:p.lineHeights,margin:p.space,marginBottom:p.space,marginLeft:p.space,marginRight:p.space,marginTop:p.space,padding:p.space,paddingBottom:p.space,paddingLeft:p.space,paddingRight:p.space,paddingTop:p.space},ce={...Ge,...qe},ue={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]};function Ye(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):["string","number"].includes(typeof e)?new Map([e,e]):new Map}var Qe=new Map(Object.entries(ce).map(([e,t])=>[e,Ye(t)])),Ze=new Map(Object.entries(ue).map(([e,t])=>[e,new Set(t)]));function me(e){let t=Object.assign({},e),o={};return Object.entries(t).forEach(([r,n])=>{let a=Ze.get(r);a!=null&&(a.forEach(i=>{t[i]=n;}),delete t[r]);}),Object.entries(t).forEach(([r,n])=>{let a=Qe.get(r);if(a!=null){if(typeof n=="string"&&n.indexOf(" ")>-1){let i=n.split(" ");o[r]=i.map(l=>a.get(l.toString())??l).join(" ");}else a.has(n.toString())?o[r]=a.get(n.toString()):o[r]=n;delete t[r];}}),{cssFromProps:o,unmatchedProps:t}}function tt(){if(typeof window>"u"){let{JSDOM:e}=je("jsdom");return new e("<!DOCTYPE html>").window}return window}function fe(e){return e?{__html:et(tt()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function rt(e){return e&&`fr-${e}`}function ye(e){return e&&(Array.isArray(e)?e.map(t=>ye(t)).join(" "):rt(e))}function nt({as:e,children:t,className:o,css:r,part:n,...a},i){let l=e??"div",{cssFromProps:d,unmatchedProps:u}=me(a),f=ye(n),R=o||f?clsx(o,f):void 0,M=[{boxSizing:"border-box"},d,r];return typeof t=="string"?jsx(l,{className:R,css:M,...u,ref:i,dangerouslySetInnerHTML:fe(t)}):jsx(l,{className:R,css:M,...u,ref:i,children:t})}var c=N.forwardRef(nt);var U={};te(U,{Body1:()=>ct,Body2:()=>ut,Caption:()=>mt,Display1:()=>it,Display2:()=>st,H1:()=>at,H2:()=>lt,H3:()=>pt,H4:()=>dt});var C={color:"neutral.foreground",fontFamily:"default",margin:"0"},it={...C,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},st={...C,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},at={...C,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},lt={...C,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},pt={...C,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},dt={...C,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},ct={...C,fontSize:"md",fontWeight:"regular",lineHeight:"md"},ut={...C,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},mt={...C,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function Pe({as:e="span",children:t,variant:o="Body1",...r}){return jsx(c,{as:e,...U[o],...r,children:t})}var ft=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],gt=Object.fromEntries(ft.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>jsx(Pe,{as:t,...r,variant:e,children:r.children});return o.displayName=`Text.${e}`,[e,o]})),h=Object.assign(Pe,gt);var _={};te(_,{Link:()=>Pt,Plain:()=>ht,Primary:()=>xt,Secondary:()=>yt,base:()=>$});var $=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),xt=({colors:e})=>[$,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],yt=({colors:e})=>[$,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],Pt=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],ht=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.neutral.foreground}];function be({as:e,children:t,part:o,title:r,variant:n="Primary",...a}){let i=n.toLocaleLowerCase();return jsxs(c,{as:e??"button",css:_[n],part:[`button-${i}`,o],...a,children:[t,r&&jsx(h.Body2,{fontWeight:"demibold",color:"inherit",children:r})]})}var bt=["Primary","Secondary","Link","Plain"],Tt=Object.fromEntries(bt.map(e=>{let t=o=>jsx(be,{...o,variant:e,children:o.children});return t.displayName=`Text.${e}`,[e,t]})),b=Object.assign(be,Tt);var Ct=N.forwardRef(({children:e,css:t,...o},r)=>jsx(c,{css:[{display:"flex",flexDirection:"row"},t],...o,ref:r,children:e})),Bt=N.forwardRef(({children:e,css:t,...o},r)=>jsx(c,{css:[{display:"flex",flexDirection:"column"},t],...o,ref:r,children:e})),T={Column:Bt,Row:Ct};var v=N.forwardRef(({as:e,children:t,...o},r)=>{let n=e??T.Column;return jsx(n,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...o,ref:r,children:t})});function Be({part:e,src:t,...o}){return jsx(c,{as:"img",part:["image",e],src:t,...o})}function vt(e){var t,o,r;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function we({part:e,src:t,...o}){let r=vt(t);return jsx(c,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:r,...o})}function W({src:e,type:t,...o}){return jsx(t==="video"?we:Be,{src:e,...o})}function x({children:e,...t}){return jsx(y.Root,{defaultOpen:!0,modal:!0,children:jsxs(y.Portal,{children:[jsx(y.Overlay,{style:{background:"rgb(0 0 0 / 0.5)",position:"fixed",inset:0}}),jsx(y.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsx(v,{boxShadow:"md",css:{left:"50%",maxWidth:430,top:"50%",transform:"translate(-50%, -50%)"},p:8,position:"fixed",textAlign:"center",...t,children:e})})]})})}x.Close=e=>jsx(y.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{css:{top:"4px",right:"-4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});x.Subtitle=({children:e,...t})=>jsx(y.Description,{asChild:!0,children:jsx(h.Body2,{part:"subtitle",mb:5,...t,children:e})});x.Media=({src:e,...t})=>e==null?null:jsx(W,{borderRadius:"md",src:e,...t});x.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Primary,{title:t,onClick:e,...o});x.ProgressDots=({current:e,total:t})=>{let o=[...Array(t)].map((r,n)=>jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?p.colors.blue500:p.colors.blue800},n));return jsx(c,{as:"svg",width:16*t-8,height:"8px",viewBox:`0 0 ${16*t-8} 8`,margin:"5 auto",children:o})};x.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Secondary,{title:t,onClick:e,...o});x.Title=({children:e,...t})=>jsx(y.Title,{asChild:!0,children:jsx(h.H3,{mb:1,part:"title",...t,children:e})});var B=createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function It({children:e,navigate:t,theme:o,...r}){let n=o?K(o):{},[a,i]=useState([]),l=useRef(new Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId})),d=t??((u,f="_self")=>{window.open(u,f);});return jsxs(B.Provider,{value:{modals:a,setModals:i,navigate:d,...r,frigade:l.current},children:[jsx(Global,{styles:{":root":{...de,...n}}}),jsx(ThemeProvider,{theme:p,children:e})]})}function F(e,t){let[o,r]=useState(),[n,a]=useState(""),{frigade:i}=useContext(B),l=d=>{d.id===e&&(t!=null&&t.variables&&d.applyVariables(t.variables),r(d),a(Math.random().toString()));};return useEffect(()=>((async()=>{let d=await i.getFlow(e);t!=null&&t.variables&&d.applyVariables(t.variables),r(d);})(),i.onStateChange(l),()=>{i.removeStateChangeHandler(l);}),[]),{flow:o}}function w(e,{onComplete:t,onDismiss:o}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&(async()=>await(t==null?void 0:t(e)))(),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function k(e,{onPrimary:t,onSecondary:o}={}){let{navigate:r}=useContext(B);return {handlePrimary:useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:useCallback(async n=>{if(await(o==null?void 0:o(e,n))===!1)return n.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function Nt({flowId:e,onComplete:t,onDismiss:o,onPrimary:r,onSecondary:n,variables:a}){let{flow:i}=F(e,{variables:a}),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:d}=w(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:f}=k(l,{onPrimary:r,onSecondary:n});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxs(x,{children:[jsx(x.Close,{onClick:d}),jsx(x.Title,{children:l.title}),jsx(x.Subtitle,{children:l.subtitle}),jsx(x.Media,{src:l.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(x.ProgressDots,{current:i.getNumberOfCompletedSteps(),total:i.getNumberOfAvailableSteps()}),jsxs(T.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsx(x.Secondary,{title:"Secondary",onClick:f}),jsx(x.Primary,{title:"Primary",onClick:u})]})]}))}function Xt({flowId:e,onComplete:t,onDismiss:o,onPrimary:r,onSecondary:n,...a}){let{flow:i}=F(e),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:d}=w(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:f}=k(l,{onPrimary:r,onSecondary:n});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxs(v,{as:T.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...a,children:[jsxs(T.Row,{gap:3,children:[jsx("img",{src:l.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(T.Column,{children:[jsx(h.H4,{mb:1,children:l.title}),jsx(h.Body2,{children:l.subtitle})]})]}),jsxs(T.Row,{alignItems:"center",gap:3,children:[jsx(b.Secondary,{title:l.secondaryButtonTitle,onClick:f}),jsx(b.Primary,{title:l.primaryButtonTitle,onClick:u}),jsx(b.Plain,{part:"banner-close",onClick:d,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function J(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=useState(e),[r,n]=useState(null),a=useCallback(i=>{n(i);},[]);return useLayoutEffect(()=>{r&&o(r.getBoundingClientRect());},[r]),{node:r,rect:t,ref:a}}var Qt=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function He({style:e={},part:t="",...o}){return jsxs(c,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsx(c,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Qt}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(c,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Me({props:e,alignAttr:t,sideAttr:o}){let r=o??"bottom",n={},a=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},i="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=i;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(r)?n.right=i:n.bottom=i:["after","start"].includes(d)?["top","bottom"].includes(r)?n.left=i:n.top=i:["top","bottom"].includes(r)?n.left=`calc(50% + ${i})`:n.top=`calc(50% + ${i})`,n}var Ee={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Ae(e,t){let o=Object.fromEntries(Ee.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r=Object.fromEntries(Ee.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let n={after:"end",before:"start"},a=(R,M)=>["top","bottom"].includes(M)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",i=o.alignOffset??0,l=o.style??{},d=o.side??"bottom",u=o.align;o.style={...l,[a(u,d)]:i};let f=["top","bottom"].includes(d)?t.width:t.height;o.alignOffset=(f+i)*-1,o.align=n[u];}return {contentProps:o,rootProps:r}}function m({anchor:e,children:t,className:o,spotlight:r=!1,style:n,...a}){let{node:i,rect:l,ref:d}=J(),{contentProps:u,rootProps:f}=Ae(a,l),[R,M]=useState(u.align),[Y,Ve]=useState(u.side);if(i!==null){let E=i.getAttribute("data-align"),ee=i.getAttribute("data-side");R!==E&&M(E),Y!==ee&&Ve(ee);}let Q=useRef(null),[I,Le]=useState(null);if(useEffect(()=>{let E=document.querySelector(e);E!=null&&(Q.current=E,Le(Q));},[e]),I==null)return null;let V=I.current.getBoundingClientRect(),Z="0";typeof window<"u"&&(Z=window.getComputedStyle(I.current).borderRadius);let ze=Me({props:a,alignAttr:R,sideAttr:Y});return jsxs(S.Root,{defaultOpen:!0,...f,children:[jsx(S.Anchor,{virtualRef:I}),jsx(S.Portal,{children:jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[r&&jsx(c,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:Z,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:V.height,left:V.left,top:V.top,width:V.width}}),jsx(S.Content,{asChild:!0,...u,ref:d,children:jsxs(v,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...n},children:[jsx(He,{style:ze}),t]})})]})})]})}m.Close=e=>jsx(S.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});m.Media=({src:e,...t})=>e==null?null:jsx(W,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});m.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Primary,{title:t,onClick:e,...o});m.Progress=({children:e,...t})=>e==null?null:jsx(h.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});m.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Secondary,{title:t,onClick:e,...o});m.Subtitle=({children:e,...t})=>e==null?null:jsx(h.Body2,{part:"subtitle",...t,children:e});m.Title=({children:e,...t})=>e==null?null:jsx(h.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function q(e){let{modals:t,setModals:o}=useContext(B),[r,n]=useState(!1);return useEffect(()=>(o([...t,e]),()=>o(t.filter(a=>a!==e))),[]),useEffect(()=>{let a=t[0]===e;a!==r&&n(a);},[t]),{isCurrentModal:r}}function Ie({step:e,flow:t,onDismiss:o,onPrimary:r,onSecondary:n,...a}){let{isCurrentModal:i}=q(`${t.id}-${e.id}`),{handleDismiss:l}=w(t,{onDismiss:o}),{handlePrimary:d,handleSecondary:u}=k(e,{onPrimary:r,onSecondary:n});return i?jsxs(m,{anchor:e.selector,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),...a,children:[jsx(m.Close,{onClick:l}),jsx(m.Media,{src:e.videoUri??e.imageUri,type:e.videoUri?"video":"image"}),jsx(m.Title,{children:e.title}),jsx(m.Subtitle,{children:e.subtitle}),jsxs(T.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsx(m.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsx(m.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:u}),jsx(m.Primary,{title:e.primaryButtonTitle,onClick:d})]})]},e.id):null}function io({flowId:e,onComplete:t,variables:o,...r}){let{flow:n}=F(e,{variables:o});if(w(n,{onComplete:t}),n==null||n.isVisible===!1)return null;n.start();let a=n.getCurrentStep();return a==null||a.start(),jsx(Ie,{step:a,flow:n,...r})}function lo(){let{frigade:e}=useContext(B);return {frigade:e}}
|
|
14
|
+
var je=Object.defineProperty;var _e=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var te=(e,t)=>{for(var o in t)je(e,o,{get:t[o],enumerable:!0});};var oe={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var re={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"};var ne={md:"10px",lg:"20px",round:"50%"};var a=e=>`var(--fr-colors-${e})`,ie={neutral:{background:a("white"),border:a("gray500"),foreground:a("black"),surface:a("gray700"),active:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},focus:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},hover:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")}},primary:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500"),active:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")},focus:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500")},hover:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")}},secondary:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900"),active:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")},focus:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900")},hover:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")}}};var se={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ue="px",Ne=e=>typeof e=="number"?`${4*e}${Ue}`:e,Je=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],ae=Object.fromEntries(Je.map(e=>[e,Ne(e)]));var le={fontFamilies:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var z={...oe,colors:{...re,...ie},...le,radii:ne,shadows:se,space:ae};function A(e,t="",o="."){return Object.keys(e).reduce((n,r)=>{let i=`${t.length?`${t}${o}`:""}${r}`,l=e[r];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(n,A(l,i,o)):n[i]=l,n},{})}function K(e){return A(e,"--fr","-")}function pe(e,t="--fr"){let o={};return Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)?o[n]=pe(r,`${t}-${n}`):o[n]=`var(${t}-${n})`;}),o}var de=K(z),d=pe(z);var Ge=new Set(["alt","size","src"]),qe=Xe.all.filter(e=>e.indexOf("-")!=0&&!Ge.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),Ye=Object.fromEntries(qe),j=A(d.colors),Qe={color:j,backgroundColor:j,borderColor:j,border:d.borders,borderRadius:d.radii,borderWidth:d.borderWidths,boxShadow:d.shadows,fontFamily:d.fontFamilies,fontSize:d.fontSizes,fontWeight:d.fontWeights,gap:d.space,lineHeight:d.lineHeights,margin:d.space,marginBottom:d.space,marginLeft:d.space,marginRight:d.space,marginTop:d.space,padding:d.space,paddingBottom:d.space,paddingLeft:d.space,paddingRight:d.space,paddingTop:d.space},ce={...Ye,...Qe},ue={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]};function Ze(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):["string","number"].includes(typeof e)?new Map([e,e]):new Map}var me=new Map(Object.entries(ce).map(([e,t])=>[e,Ze(t)])),et=new Map(Object.entries(ue).map(([e,t])=>[e,new Set(t)])),tt=new Set(["height","width"]),ot=new Set(["canvas","embed","iframe","img","input","object","video"]);function fe(e,t="div"){let o=Object.assign({},e),n={};return Object.entries(o).forEach(([r,s])=>{let i=et.get(r);i!=null&&(i.forEach(l=>{o[l]=s;}),delete o[r]);}),Object.entries(o).forEach(([r,s])=>{let i=me.get(r);if(i!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let l=s.split(" ");n[r]=l.map(p=>i.get(p.toString())??p).join(" ");}else i.has(s.toString())?n[r]=i.get(s.toString()):n[r]=s;(typeof t!="string"||!ot.has(t)||!tt.has(r))&&delete o[r];}}),Object.keys(o).forEach(r=>{let s=r.substring(1);r.indexOf("_")===0&&me.has(s)&&(o[s]=o[r],delete o[r]);}),{cssFromProps:n,unmatchedProps:o}}function nt(){if(typeof window>"u"){let{JSDOM:e}=_e("jsdom");return new e("<!DOCTYPE html>").window}return window}function ge(e){return e?{__html:rt(nt()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function st(e){return e&&`fr-${e}`}function he(e){return e&&(Array.isArray(e)?e.map(t=>he(t)).join(" "):st(e))}function at({as:e,children:t,className:o,css:n,part:r,...s},i){let l=e??"div",{cssFromProps:p,unmatchedProps:u}=fe(s,l),f=he(r),R=o||f?clsx(o,f):void 0,M=[{boxSizing:"border-box"},p,n];return typeof t=="string"?jsx(l,{className:R,css:M,...u,ref:i,dangerouslySetInnerHTML:ge(t)}):jsx(l,{className:R,css:M,...u,ref:i,children:t})}var c=N.forwardRef(at);var _={};te(_,{Body1:()=>ft,Body2:()=>gt,Caption:()=>xt,Display1:()=>lt,Display2:()=>pt,H1:()=>dt,H2:()=>ct,H3:()=>ut,H4:()=>mt});var C={color:"neutral.foreground",fontFamily:"default",margin:"0"},lt={...C,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},pt={...C,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},dt={...C,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},ct={...C,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},ut={...C,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},mt={...C,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},ft={...C,fontSize:"md",fontWeight:"regular",lineHeight:"md"},gt={...C,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},xt={...C,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function Pe({as:e="span",children:t,variant:o="Body1",...n}){return jsx(c,{as:e,..._[o],...n,children:t})}var yt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ht=Object.fromEntries(yt.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=n=>jsx(Pe,{as:t,...n,variant:e,children:n.children});return o.displayName=`Text.${e}`,[e,o]})),P=Object.assign(Pe,ht);var U={};te(U,{Link:()=>Tt,Plain:()=>St,Primary:()=>Pt,Secondary:()=>bt,base:()=>$});var $=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),Pt=({colors:e})=>[$,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],bt=({colors:e})=>[$,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],Tt=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],St=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.neutral.foreground}];function Te({as:e,children:t,part:o,title:n,variant:r="Primary",...s}){let i=r.toLocaleLowerCase();return jsxs(c,{as:e??"button",css:U[r],part:[`button-${i}`,o],...s,children:[t,n&&jsx(P.Body2,{fontWeight:"demibold",color:"inherit",children:n})]})}var Ct=["Primary","Secondary","Link","Plain"],wt=Object.fromEntries(Ct.map(e=>{let t=o=>jsx(Te,{...o,variant:e,children:o.children});return t.displayName=`Text.${e}`,[e,t]})),b=Object.assign(Te,wt);var Rt=N.forwardRef(({children:e,css:t,...o},n)=>jsx(c,{css:[{display:"flex",flexDirection:"row"},t],...o,ref:n,children:e})),vt=N.forwardRef(({children:e,css:t,...o},n)=>jsx(c,{css:[{display:"flex",flexDirection:"column"},t],...o,ref:n,children:e})),T={Column:vt,Row:Rt};var v=N.forwardRef(({as:e,children:t,...o},n)=>{let r=e??T.Column;return jsx(r,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...o,ref:n,children:t})});function Be({part:e,src:t,...o}){return jsx(c,{as:"img",part:["image",e],src:t,...o})}function Dt(e){var t,o,n;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/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Re({part:e,src:t,...o}){let n=Dt(t);return jsx(c,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:n,...o})}function W({src:e,type:t,...o}){return jsx(t==="video"?Re:Be,{src:e,...o})}function x({children:e,...t}){return jsx(y.Root,{defaultOpen:!0,modal:!0,children:jsxs(y.Portal,{children:[jsx(y.Overlay,{style:{background:"rgb(0 0 0 / 0.5)",position:"fixed",inset:0}}),jsx(y.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsx(v,{boxShadow:"md",css:{left:"50%",maxWidth:430,top:"50%",transform:"translate(-50%, -50%)"},p:8,position:"fixed",textAlign:"center",...t,children:e})})]})})}x.Close=e=>jsx(y.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{css:{top:"4px",right:"-4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});x.Subtitle=({children:e,...t})=>jsx(y.Description,{asChild:!0,children:jsx(P.Body2,{part:"subtitle",mb:5,...t,children:e})});x.Media=({src:e,...t})=>e==null?null:jsx(W,{borderRadius:"md",src:e,...t});x.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Primary,{title:t,onClick:e,...o});x.ProgressDots=({current:e,total:t})=>{let o=[...Array(t)].map((n,r)=>jsx("circle",{r:4,cx:4+16*r,cy:"4px",fill:e===r?d.colors.blue500:d.colors.blue800},r));return jsx(c,{as:"svg",width:16*t-8,height:"8px",viewBox:`0 0 ${16*t-8} 8`,margin:"5 auto",children:o})};x.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Secondary,{title:t,onClick:e,...o});x.Title=({children:e,...t})=>jsx(y.Title,{asChild:!0,children:jsx(P.H3,{mb:1,part:"title",...t,children:e})});var w=createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function zt({children:e,navigate:t,theme:o,...n}){let r=o?K(o):{},[s,i]=useState([]),l=useRef(new Frigade(n.apiKey,{apiKey:n.apiKey,apiUrl:n.apiUrl,userId:n.userId,groupId:n.groupId})),p=t??((u,f="_self")=>{window.open(u,f);});return jsxs(w.Provider,{value:{modals:s,setModals:i,navigate:p,...n,frigade:l.current},children:[jsx(Global,{styles:{":root":{...de,...r}}}),jsx(ThemeProvider,{theme:d,children:e})]})}function F(e,t){let[o,n]=useState(),[r,s]=useState(""),{frigade:i}=useContext(w),l=p=>{p.id===e&&(t!=null&&t.variables&&p.applyVariables(t.variables),n(p),s(Math.random().toString()));};return useEffect(()=>((async()=>{let p=await i.getFlow(e);t!=null&&t.variables&&p.applyVariables(t.variables),n(p);})(),i.onStateChange(l),()=>{i.removeStateChangeHandler(l);}),[]),{flow:o}}function B(e,{onComplete:t,onDismiss:o}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&(async()=>await(t==null?void 0:t(e)))(),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.skip();},[e])}}function k(e,{onPrimary:t,onSecondary:o}={}){let{navigate:n}=useContext(w);return {handlePrimary:useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function Gt({flowId:e,onComplete:t,onDismiss:o,onPrimary:n,onSecondary:r,variables:s}){let{flow:i}=F(e,{variables:s}),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:p}=B(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:f}=k(l,{onPrimary:n,onSecondary:r});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxs(x,{children:[jsx(x.Close,{onClick:p}),jsx(x.Title,{children:l.title}),jsx(x.Subtitle,{children:l.subtitle}),jsx(x.Media,{src:l.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(x.ProgressDots,{current:i.getNumberOfCompletedSteps(),total:i.getNumberOfAvailableSteps()}),jsxs(T.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsx(x.Secondary,{title:"Secondary",onClick:f}),jsx(x.Primary,{title:"Primary",onClick:u})]})]}))}function Yt({flowId:e,onComplete:t,onDismiss:o,onPrimary:n,onSecondary:r,...s}){let{flow:i}=F(e),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:p}=B(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:f}=k(l,{onPrimary:n,onSecondary:r});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxs(v,{as:T.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...s,children:[jsxs(T.Row,{gap:3,children:[jsx("img",{src:l.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(T.Column,{children:[jsx(P.H4,{mb:1,children:l.title}),jsx(P.Body2,{children:l.subtitle})]})]}),jsxs(T.Row,{alignItems:"center",gap:3,children:[jsx(b.Secondary,{title:l.secondaryButtonTitle,onClick:f}),jsx(b.Primary,{title:l.primaryButtonTitle,onClick:u}),jsx(b.Plain,{part:"banner-close",onClick:p,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function J(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=useState(e),[n,r]=useState(null),s=useCallback(i=>{r(i);},[]);return useLayoutEffect(()=>{n&&o(n.getBoundingClientRect());},[n]),{node:n,rect:t,ref:s}}var to=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Me({style:e={},part:t="",...o}){return jsxs(c,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsx(c,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${to}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(c,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Ee({props:e,alignAttr:t,sideAttr:o}){let n=o??"bottom",r={},s=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},i="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};r[l[n]]=i;let p=s();return ["before","end"].includes(p)?["top","bottom"].includes(n)?r.right=i:r.bottom=i:["after","start"].includes(p)?["top","bottom"].includes(n)?r.left=i:r.top=i:["top","bottom"].includes(n)?r.left=`calc(50% + ${i})`:r.top=`calc(50% + ${i})`,r}var Ae={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function $e(e,t){let o=Object.fromEntries(Ae.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n=Object.fromEntries(Ae.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let r={after:"end",before:"start"},s=(R,M)=>["top","bottom"].includes(M)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",i=o.alignOffset??0,l=o.style??{},p=o.side??"bottom",u=o.align;o.style={...l,[s(u,p)]:i};let f=["top","bottom"].includes(p)?t.width:t.height;o.alignOffset=(f+i)*-1,o.align=r[u];}return {contentProps:o,rootProps:n}}function m({anchor:e,children:t,className:o,spotlight:n=!1,style:r,...s}){let{node:i,rect:l,ref:p}=J(),{contentProps:u,rootProps:f}=$e(s,l),[R,M]=useState(u.align),[Y,Le]=useState(u.side);if(i!==null){let E=i.getAttribute("data-align"),ee=i.getAttribute("data-side");R!==E&&M(E),Y!==ee&&Le(ee);}let Q=useRef(null),[I,ze]=useState(null);if(useEffect(()=>{let E=document.querySelector(e);E!=null&&(Q.current=E,ze(Q));},[e]),I==null)return null;let V=I.current.getBoundingClientRect(),Z="0";typeof window<"u"&&(Z=window.getComputedStyle(I.current).borderRadius);let Ke=Ee({props:s,alignAttr:R,sideAttr:Y});return jsxs(S.Root,{defaultOpen:!0,...f,children:[jsx(S.Anchor,{virtualRef:I}),jsx(S.Portal,{children:jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[n&&jsx(c,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:Z,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:V.height,left:V.left,top:V.top,width:V.width}}),jsx(S.Content,{asChild:!0,...u,ref:p,children:jsxs(v,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...r},children:[jsx(Me,{style:Ke}),t]})})]})})]})}m.Close=e=>jsx(S.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});m.Media=({src:e,...t})=>e==null?null:jsx(W,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});m.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Primary,{title:t,onClick:e,...o});m.Progress=({children:e,...t})=>e==null?null:jsx(P.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});m.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Secondary,{title:t,onClick:e,...o});m.Subtitle=({children:e,...t})=>e==null?null:jsx(P.Body2,{part:"subtitle",...t,children:e});m.Title=({children:e,...t})=>e==null?null:jsx(P.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function q(e){let{modals:t,setModals:o}=useContext(w),[n,r]=useState(!1);return useEffect(()=>(o([...t,e]),()=>o(t.filter(s=>s!==e))),[]),useEffect(()=>{let s=t[0]===e;s!==n&&r(s);},[t]),{isCurrentModal:n}}function Ve({step:e,flow:t,onDismiss:o,onPrimary:n,onSecondary:r,...s}){let{isCurrentModal:i}=q(`${t.id}-${e.id}`),{handleDismiss:l}=B(t,{onDismiss:o}),{handlePrimary:p,handleSecondary:u}=k(e,{onPrimary:n,onSecondary:r});return i?jsxs(m,{anchor:e.selector,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),...s,children:[jsx(m.Close,{onClick:l}),jsx(m.Media,{src:e.videoUri??e.imageUri,type:e.videoUri?"video":"image"}),jsx(m.Title,{children:e.title}),jsx(m.Subtitle,{children:e.subtitle}),jsxs(T.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsx(m.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsx(m.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:u}),jsx(m.Primary,{title:e.primaryButtonTitle,onClick:p})]})]},e.id):null}function lo({flowId:e,onComplete:t,variables:o,...n}){let{flow:r}=F(e,{variables:o});if(B(r,{onComplete:t}),r==null||r.isVisible===!1)return null;r.start();let s=r.getCurrentStep();return s==null||s.start(),jsx(Ve,{step:s,flow:r,...n})}function uo(){let{frigade:e}=useContext(w);return {frigade:e}}
|
|
15
15
|
|
|
16
|
-
export {
|
|
16
|
+
export { Gt as Announcement, Yt as Banner, c as Box, b as Button, v as Card, T as Flex, zt as Provider, P as Text, m as Tooltip, lo as Tour, J as useBoundingClientRect, F as useFlow, B as useFlowHandlers, uo as useFrigade, q as useModal, k as useStepHandlers };
|
|
17
17
|
//# sourceMappingURL=out.js.map
|
|
18
18
|
//# sourceMappingURL=index.js.map
|