{"version":3,"file":"Callout.cjs","sources":["../../../../src/components/feedback/callout/Callout.tsx"],"sourcesContent":["import { memo } from 'react'\r\n\r\nimport { CalloutContext } from '@components/feedback/callout/context/Callout.context.ts'\r\nimport { CALLOUT_STYLES } from '@components/feedback/callout/styles/Callout.css.ts'\r\nimport CalloutDescription from '@components/feedback/callout/components/callout-description/CalloutDescription.tsx'\r\nimport CalloutIcon from '@components/feedback/callout/components/callout-icon/CalloutIcon.tsx'\r\nimport CalloutTitle from '@components/feedback/callout/components/callout-title/CalloutTitle.tsx'\r\nimport type { CalloutCompound } from '@components/feedback/callout/types'\r\nimport type { CalloutProps } from '@components/feedback/callout/types/Callout.props.ts'\r\nimport { Flex } from '@components/layout/flex'\r\nimport { createIconChildUtils } from '@utils/createIconChildUtils.ts'\r\nimport { cn } from '@utils/cn.ts'\r\n\r\nconst { hasIconChild, extractIconChild } = createIconChildUtils(CalloutIcon)\r\n\r\n/**\r\n * Informational callout with `variant` (info|success|warning|error), an\r\n * optional `icon`, `title`, and `description`. Renders with `role=\"status\"`\r\n * by default; pass `role=\"alert\"` for urgent feedback. Supports compound\r\n * children via `Callout.Icon`, `.Title`, and `.Description` slots.\r\n *\r\n * Compound slots: `Callout.Icon`, `Callout.Title`, `Callout.Description`.\r\n */\r\nconst Callout = memo<CalloutProps>((calloutProps) => {\r\n    const {\r\n        variant = 'info',\r\n        icon,\r\n        title,\r\n        description,\r\n        children,\r\n        className,\r\n        ref,\r\n        ...props\r\n    } = calloutProps\r\n    const role = 'role' in calloutProps ? calloutProps.role : 'status'\r\n\r\n    const showDefaultIcon = !hasIconChild(children)\r\n    const iconChild = extractIconChild(children)\r\n    const remainingChildren = iconChild.remaining\r\n\r\n    return (\r\n        <CalloutContext.Provider value={{ variant }}>\r\n            <Flex\r\n                ref={ref}\r\n                alignItems={'start'}\r\n                gap={'md'}\r\n                className={cn(CALLOUT_STYLES.recipe({ variant }), className)}\r\n                {...props}\r\n                role={role}\r\n            >\r\n                {showDefaultIcon ? (\r\n                    <CalloutIcon icon={icon} />\r\n                ) : (\r\n                    iconChild.node\r\n                )}\r\n                <Flex\r\n                    flexDirection={'column'}\r\n                    alignItems={'start'}\r\n                    gap={'xs'}\r\n                    minWidth={0}\r\n                >\r\n                    {title && <CalloutTitle>{title}</CalloutTitle>}\r\n                    {description && (\r\n                        <CalloutDescription>{description}</CalloutDescription>\r\n                    )}\r\n                    {remainingChildren}\r\n                </Flex>\r\n            </Flex>\r\n        </CalloutContext.Provider>\r\n    )\r\n}) as unknown as CalloutCompound\r\n\r\nCallout.displayName = 'Callout'\r\nCallout.Icon = CalloutIcon\r\nCallout.Title = CalloutTitle\r\nCallout.Description = CalloutDescription\r\n\r\nexport default Callout\r\n"],"names":["hasIconChild","extractIconChild","createIconChildUtils","CalloutIcon","Callout","memo","calloutProps","variant","icon","title","description","children","className","ref","props","role","showDefaultIcon","iconChild","remainingChildren","CalloutContext","jsxs","Flex","cn","CALLOUT_STYLES","jsx","CalloutTitle","CalloutDescription"],"mappings":"kgBAaM,CAAE,aAAAA,EAAc,iBAAAC,GAAqBC,EAAAA,qBAAqBC,CAAW,EAUrEC,EAAUC,EAAAA,KAAoBC,GAAiB,CACjD,KAAM,CACF,QAAAC,EAAU,OACV,KAAAC,EACA,MAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,IAAAC,EACA,GAAGC,CAAA,EACHR,EACES,EAAO,SAAUT,EAAeA,EAAa,KAAO,SAEpDU,EAAkB,CAAChB,EAAaW,CAAQ,EACxCM,EAAYhB,EAAiBU,CAAQ,EACrCO,EAAoBD,EAAU,UAEpC,aACKE,EAAAA,eAAe,SAAf,CAAwB,MAAO,CAAE,QAAAZ,GAC9B,SAAAa,EAAAA,KAACC,EAAA,CACG,IAAAR,EACA,WAAY,QACZ,IAAK,KACL,UAAWS,EAAAA,GAAGC,iBAAe,OAAO,CAAE,QAAAhB,CAAA,CAAS,EAAGK,CAAS,EAC1D,GAAGE,EACJ,KAAAC,EAEC,SAAA,CAAAC,EACGQ,EAAAA,IAACrB,EAAA,CAAY,KAAAK,CAAA,CAAY,EAEzBS,EAAU,KAEdG,EAAAA,KAACC,EAAA,CACG,cAAe,SACf,WAAY,QACZ,IAAK,KACL,SAAU,EAET,SAAA,CAAAZ,GAASe,EAAAA,IAACC,GAAc,SAAAhB,CAAA,CAAM,EAC9BC,GACGc,EAAAA,IAACE,EAAA,CAAoB,SAAAhB,CAAA,CAAY,EAEpCQ,CAAA,CAAA,CAAA,CACL,CAAA,CAAA,EAER,CAER,CAAC,EAEDd,EAAQ,YAAc,UACtBA,EAAQ,KAAOD,EACfC,EAAQ,MAAQqB,EAChBrB,EAAQ,YAAcsB"}