import * as react from 'react'; import { ElementType } from 'react'; import { StatusChipProps } from '@availity/mui-chip'; import { SvgIconProps } from '@mui/material'; type Link = { /** Contains a URL or URL Fragment that the hyperlink points to. */ url?: string; /** Specifies where to open the linked URL. */ target?: string; text?: string; }; type NameValuePair = { /** The key of the of the data. */ name: string; /** The value of the data. */ value: string; }; type SpacesImages = { billboard?: string; logo?: string; promotional?: string; promotionalHover?: string; tile?: string; }; type Space = { /** The name of the content or configuration. */ name: string; /** The configuration type. */ type: string; /** Globally unique ID associated with the configuration object. */ id: string; /** The ID used to identify the configuration. */ configurationId: string; /** A list of payerIds for the configuration or content. */ payerIDs?: string[]; /** The images associated with the configuration. */ images?: SpacesImages; /** Metadata for a configuration */ meta?: Record; /** Key-value data for a configuration. */ metadataPairs?: NameValuePair[]; /** The feature box colors associated with the Payer Space. */ colors?: Record; /** Contains URL fragments that point to icons. */ icons?: Record; /** The key-value mapping pairs. */ mapping?: Record; mappingPairs?: NameValuePair[]; /** Whether or not the space is ghosted */ isGhosted?: boolean; link?: Link; /** The description of the configuration. */ description?: string; url?: string; parents?: Space[]; shortName?: string; activeDate?: string; isNew?: boolean; }; type SpacesContextType = { /** Array of spaces to be passed into the Spaces provider. */ spaces?: Map; /** Array of spaces from previous page load. */ previousSpacesMap?: Map; /** Array of spaces organized by configurationId. */ spacesByConfig?: Map; /** Array of spaces organized by configurationId from previous page load. */ previousSpacesByConfigMap?: Map; /** Array of spaces organized by payerId. */ spacesByPayer?: Map; /** Array of spaces organized by payerId from previous page load. */ previousSpacesByPayerMap?: Map; /** Whether or not spaces are loading. */ loading: boolean; /** Errors associated with fetching spaces. */ error?: string; /** Items that live within the spaces component and can access SpacesContext. */ children?: React.ReactNode; }; type SpacesProps = { /** Override the default thanos query. */ query?: string; /** Override the default variables used in the thanos query. Default: { types: [PAYERSPACE] }. * If the spaces provider should contain configurations of a type other than PAYERSPACE, you must override this prop */ variables?: object; /** * Name for the GraphQL operation, used for debugging and monitoring. * * If an operation name exists in the query string, leave this undefined or * ensure it matches what is in the query string. * * If no operation name exists in the query string, it can be defined here. * * Format: `{ValueStream || PayerName}{AbbreviatedAppName}{Description}{Type}` (PascalCase) * @example "OnbPsFavoritesQuery" */ operationName?: string; /** The Client ID obtained from APIConnect. */ clientId?: string; /** Children can be a react child or render prop. */ children?: React.ReactNode | ((props: any | undefined) => React.ReactNode); /** Array of payerIds the Spaces provider should fetch the spaces for. * Any payerIds already included in spaces will not be fetched again. * Note: If a payerId is associated with more than one payer space, the order in which they are returned should not be relied upon. * If a specific payer space is required, you'll need to filter the list that is returned. */ payerIds?: string[]; /** Array of spaceIds the Spaces provider should fetch the spaces for. * Any spaceIds already included in spaces will not be fetched again. */ spaceIds?: string[]; /** Array of spaces to be passed into the Spaces provider. * Useful for if you already have the spaces in your app and don't want the spaces provider to have to fetch them again. */ spaces?: Space[]; }; type UseSpaces = (...ids: string[]) => Space[] | undefined; declare const INITIAL_STATE: { loading: boolean; }; declare const SpacesContext: react.Context; declare const useSpacesContext: () => SpacesContextType; declare const Spaces: ({ query, variables, operationName, clientId, children, payerIds, spaceIds, spaces: spacesFromProps, }: SpacesProps) => React.JSX.Element; declare const useSpaces: UseSpaces; type SpacesLinkVariants = 'card' | 'list' | 'default' | undefined; type SpacesLinkWithSpace = { /** If no spaceId is provided, the first space in the spaces array is used. * Note: This is only to be used when the Spaces provider should only ever contain a single space. */ spaceId?: string; /** Use to directly pass a space to the component rather than have it fetched from the spaces API. * This component does not have to be a child of SpacesProvider. * Note: If you are wanting to take advantage of the sso links you will additionally need to pass the clientId in. */ space: Space; } & SpacesLinkProps; type SpacesLinkWithSpaceId = { /** If no spaceId is provided, the first space in the spaces array is used. * Note: This is only to be used when the Spaces provider should only ever contain a single space. */ spaceId: string; /** Use to directly pass a space to the component rather than have it fetched from the spaces API. * This component does not have to be a child of SpacesProvider. * Note: If you are wanting to take advantage of the sso links you will additionally need to pass the clientId in. */ space?: Space; } & SpacesLinkProps; type SpacesLinkProps = { /** Children can be a react child or render prop. */ children?: React.JSX.Element | ((props: any | undefined) => React.JSX.Element); /** Tag to overwrite the root component rendered. */ tag?: ElementType; /** Tag to overwrite the body component that renders the title, description and data values. * It defaults to CardBody or div depending on the value of the variant prop. */ bodyTag?: ElementType; /** Tag to overwrite the title component. If variant prop is set to "card", defaults to CardTitle. * If variant is set to "list", defaults to ListItemHeading. Overwise, defaults to div. */ titleTag?: ElementType; /** Tag to overwrite the text component. If variant prop is set to "card", defaults to Card Text. * If variant is set to "list", defaults to ListItemText. Otherwise, defaults to div. */ textTag?: ElementType; titleClassName?: string; /** When true, utilizes the Card component for styling. */ card?: boolean; /** When true, renders an @availity/mui-icon next to the title if present on the Space. */ icon?: (props: SvgIconProps) => React.JSX.Element; /** When true, renders the Spaces description beneath the title. */ description?: boolean; /** When passed in, provides predefined styles for the component. * @default 'default' */ variant?: SpacesLinkVariants; /** When true, renders the FavoriteHeart component to the left of the Component. * Note, this does require you to have wrapped your component somewhere in the Favorites Provider. * This also requires the peerDependency @tanstack/react-query. */ favorite?: boolean; /** When true, renders the tyitle, and allow for the description and date info to be added on. * @default true */ body?: boolean; /** When true, renders the activeDate of the space. */ showDate?: boolean; /** When true, renders the name of the space. * @default true */ showName?: boolean; /** When true, renders a "New!" badge if the activeDate is less than 30 days old. */ showNew?: boolean; /** When true, renders the component vertically. */ stacked?: boolean; /** Optionally pass in your own landing state for the component if you are managing the state yourself. */ loading?: boolean; /** Required when space is not provided, or space is provided and space contains an sso link. */ clientId?: string; style?: object; className?: string; /** Allows the description length to be truncated. */ maxDescriptionWidth?: string; /** Additional attributes you may want to tack onto the native-form when submitting a SAML sso. * i.e. spaceId or sourceApplicationId */ linkAttributes?: object; /** Allows the role of the root component to be overwritten. * If variant prop is set to "list", defaults to "listitem". */ role?: string; /** When Analytics props are passed inside the analytics props, they will be passed down to the click item. * For more information on Analytics props see: Autotrack Logged Events */ analytics?: object; customBadgeText?: string; customBadgeColor?: StatusChipProps['color']; /** prefix for ids to prevent duplicates when the same config link is displayed on the page more than once * @default '' */ idPrefix?: string; [key: string]: any; }; declare const SpacesLink: ({ spaceId, space: propSpace, className, children, favorite, icon: FileIcon, showName, showNew, showDate, stacked, body, description: showDescription, tag, bodyTag, titleTag, textTag, titleClassName, variant, loading: propsLoading, clientId: propsClientId, maxDescriptionWidth, style, linkAttributes, role, analytics, customBadgeText, customBadgeColor, idPrefix, ...rest }: SpacesLinkWithSpace | SpacesLinkWithSpaceId) => react.JSX.Element; type SpacesAgreementProps = { spaceId: string; markdown?: boolean; id?: string; }; declare const SpacesAgreement: ({ spaceId, markdown, id: elementId }: SpacesAgreementProps) => react.JSX.Element | null; type SpacesDisclaimerProps = { accent?: boolean; spaceId: string; markdown?: boolean; id?: string; }; declare const SpacesDisclaimer: ({ accent, spaceId, markdown, id: elementId, ...props }: SpacesDisclaimerProps) => react.JSX.Element | null; type SpacesGhostTextProps = { spaceId: string; id?: string; } & React.DetailedHTMLProps, HTMLElement>; declare const SpacesGhostText: ({ spaceId, id, ...props }: SpacesGhostTextProps) => react.JSX.Element | null; type BaseSpacesImageProps = { imageType?: 'url' | 'images.logo' | 'images.tile' | 'images.billboard' | 'images.promotional' | 'images.promotionalHover'; fallback?: string; id?: string; Loader?: ({ id }: { id: string; }) => React.JSX.Element; }; type SpacesImageSpaceId = { spaceId: string; payerId?: string; } & BaseSpacesImageProps; type SpacesImagePayerId = { spaceId?: string; payerId: string; } & BaseSpacesImageProps; type SpacesImageProps = SpacesImageSpaceId | SpacesImagePayerId; declare const SpacesImage: ({ spaceId, payerId, imageType, fallback, Loader, ...props }: SpacesImageProps) => react.JSX.Element | null; export { INITIAL_STATE, type Space, Spaces, SpacesAgreement, type SpacesAgreementProps, SpacesContext, SpacesDisclaimer, type SpacesDisclaimerProps, SpacesGhostText, type SpacesGhostTextProps, SpacesImage, type SpacesImageProps, SpacesLink, useSpaces, useSpacesContext };