{"version":3,"sources":["../src/components/Nav/NavDrawerBody/useNavDrawerBody.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport type { NavDrawerBodyProps, NavDrawerBodyState } from './NavDrawerBody.types';\nimport { useDrawerBody } from '../../Drawer/DrawerBody';\n\n/**\n * Create the state required to render NavDrawerBody.\n *\n * Arrow-key navigation is enabled by default via the native `focusgroup` attribute\n * with the `toolbar` behavior (vertical, wraps at ends). `toolbar` was chosen over\n * `block wrap` alone because the scoped-focusgroup spec requires an explicit\n * `<behavior>` token (see https://open-ui.org/components/scoped-focusgroup.explainer/#supported-behaviors).\n *\n * Since `toolbar` implies `role=\"toolbar\"`, we override the role back to\n * `navigation` to preserve the landmark semantics expected of a nav drawer.\n */\nexport const useNavDrawerBody = (props: NavDrawerBodyProps, ref: React.Ref<HTMLElement>): NavDrawerBodyState => {\n  const state: NavDrawerBodyState = useDrawerBody(props, ref);\n\n  // eslint-disable-next-line react-hooks/immutability\n  state.root.focusgroup = 'toolbar block wrap';\n\n  //  Since `toolbar` implies `role=\"toolbar\"`, we override the role back to\n  // `navigation` to preserve the landmark semantics expected of a nav drawer.\n\n  // eslint-disable-next-line react-hooks/immutability\n  state.root.role = 'navigation';\n\n  return state;\n};\n"],"names":["useNavDrawerBody","props","ref","state","useDrawerBody","root","focusgroup","role"],"mappings":"AAAA;;;;;+BAiBaA;;;eAAAA;;;4BAbiB;AAavB,MAAMA,mBAAmB,CAACC,OAA2BC;IAC1D,MAAMC,QAA4BC,IAAAA,yBAAa,EAACH,OAAOC;IAEvD,oDAAoD;IACpDC,MAAME,IAAI,CAACC,UAAU,GAAG;IAExB,0EAA0E;IAC1E,4EAA4E;IAE5E,oDAAoD;IACpDH,MAAME,IAAI,CAACE,IAAI,GAAG;IAElB,OAAOJ;AACT"}