{"version":3,"sources":["../src/components/Dialog/DialogTitle/useDialogTitle.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useDialogContext } from '../dialogContext';\nimport type { DialogTitleProps, DialogTitleState } from './DialogTitle.types';\n\n/**\n * Create the state required to render DialogTitle.\n *\n * Sets `id` to the dialog's generated title id so that `DialogSurface`\n * can reference it via `aria-labelledby` for accessible naming.\n *\n * @param props - props from this instance of DialogTitle\n * @param ref - reference to root HTMLHeadingElement of DialogTitle\n */\nexport const useDialogTitle = (props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>): DialogTitleState => {\n  const { dialogTitleId } = useDialogContext();\n\n  return {\n    components: { root: 'h2' },\n    root: slot.always(\n      getIntrinsicElementProps('h2', {\n        ref,\n        ...props,\n        // Must match aria-labelledby in DialogSurface for accessible naming\n        id: dialogTitleId,\n      }),\n      { elementType: 'h2' },\n    ),\n  };\n};\n"],"names":["useDialogTitle","props","ref","dialogTitleId","useDialogContext","components","root","slot","always","getIntrinsicElementProps","id","elementType"],"mappings":"AAAA;;;;;+BAgBaA;;;eAAAA;;;gCAbkC;+BACd;AAY1B,MAAMA,iBAAiB,CAACC,OAAyBC;IACtD,MAAM,EAAEC,aAAa,EAAE,GAAGC,IAAAA,+BAAgB;IAE1C,OAAO;QACLC,YAAY;YAAEC,MAAM;QAAK;QACzBA,MAAMC,oBAAI,CAACC,MAAM,CACfC,IAAAA,wCAAwB,EAAC,MAAM;YAC7BP;YACA,GAAGD,KAAK;YACR,oEAAoE;YACpES,IAAIP;QACN,IACA;YAAEQ,aAAa;QAAK;IAExB;AACF"}