{"version":3,"file":"useComponentContextIcons.mjs","names":[],"sources":["../../../src/context/useComponentContextIcons.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { useComponentContext } from './ComponentContext';\nimport * as DEFAULT_ICONS from '../components/Icons/icons';\nimport type { IconSlots } from '../components/Icons/slots';\n\n/**\n * Merges the `icons` override from `ComponentContext` over the SDK's own icons, per slot. Every\n * slot is defined, so callers destructure without fallbacks:\n *\n * ```tsx\n * const { IconFlag } = useComponentContextIcons();\n * ```\n */\nexport const useComponentContextIcons = (): Required<IconSlots> => {\n  const { icons } = useComponentContext();\n\n  // Keyed on `icons` (kept stable by `WithComponents`) so an override swapped at runtime is picked\n  // up. Empty entries are filtered so a slot set to `undefined` keeps the SDK icon.\n  return useMemo(\n    () => ({\n      ...DEFAULT_ICONS,\n      ...Object.fromEntries(Object.entries(icons ?? {}).filter(([, Icon]) => !!Icon)),\n    }),\n    [icons],\n  );\n};\n"],"mappings":";;;;;;;;;;;;AAcA,IAAa,iCAAsD;CACjE,MAAM,EAAE,UAAU,oBAAoB;CAItC,OAAO,eACE;EACL,GAAG;EACH,GAAG,OAAO,YAAY,OAAO,QAAQ,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,IAAI,CAAC;CAChF,IACA,CAAC,KAAK,CACR;AACF"}