{"version":3,"names":["createContext","useContext","NOOP","NOOP_TABS_LIST_CONTEXT","activateOnFocus","highlightedTabIndex","registerTabResizeObserverElement","onTabActivation","setHighlightedTabIndex","tabsListElement","present","TabsListContext","useTabsListContext","context","Error"],"sources":["tabs-list-context.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\nimport type {\n\tTabsRootChangeEventDetails,\n\tTabsTabValue,\n} from \"./tabs-root-context.ts\";\n\n/**\n * Context published by `<Tabs.List>`. Child tabs consume this for composite-\n * focus coordination + the `activateOnFocus` hook on focus transitions.\n */\nexport interface TabsListContextValue {\n\t/** Whether focusing a tab should activate it. */\n\tactivateOnFocus: Accessor<boolean>;\n\t/** Index of the highlighted (roving-focus) tab. `-1` if none. */\n\thighlightedTabIndex: Accessor<number>;\n\t/** Tab elements register here so the indicator can observe size changes. */\n\tregisterTabResizeObserverElement: (element: HTMLElement) => () => void;\n\t/**\n\t * Child tabs call this when they're activated by click or focus — dispatches\n\t * through the root's `onValueChange` channel.\n\t */\n\tonTabActivation: (\n\t\tnewValue: TabsTabValue,\n\t\teventDetails: TabsRootChangeEventDetails,\n\t) => void;\n\t/** Setter for the highlighted tab index (used by child tabs on focus). */\n\tsetHighlightedTabIndex: (index: number) => void;\n\t/** The `<Tabs.List>` element itself (for indicator measurements). */\n\ttabsListElement: Accessor<HTMLElement | null>;\n\t/** Marker — `true` when a real `<Tabs.List>` provided this context. */\n\treadonly present: boolean;\n}\n\nconst NOOP = (): void => {};\n\nexport const NOOP_TABS_LIST_CONTEXT: TabsListContextValue = {\n\tactivateOnFocus: () => false,\n\thighlightedTabIndex: () => -1,\n\tregisterTabResizeObserverElement: () => () => {},\n\tonTabActivation: NOOP,\n\tsetHighlightedTabIndex: NOOP,\n\ttabsListElement: () => null,\n\tpresent: false,\n};\n\nexport const TabsListContext = createContext<TabsListContextValue>(\n\tNOOP_TABS_LIST_CONTEXT,\n);\n\n/**\n * Read the `<Tabs.List>` context. Throws when no list ancestor is present —\n * every tab / indicator requires a list.\n */\nexport function useTabsListContext(): TabsListContextValue {\n\tconst context = useContext(TabsListContext);\n\tif (!context.present) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: TabsListContext is missing. Tabs parts must be placed within <Tabs.List>.\",\n\t\t);\n\t}\n\treturn context;\n}\n"],"mappings":"AAAA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;;AAMnE;AACA;AACA;AACA;;AAwBA,MAAMC,IAAI,GAAGA,CAAA,KAAY,CAAC,CAAC;AAE3B,OAAO,MAAMC,sBAA4C,GAAG;EAC3DC,eAAe,EAAEA,CAAA,KAAM,KAAK;EAC5BC,mBAAmB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC7BC,gCAAgC,EAAEA,CAAA,KAAM,MAAM,CAAC,CAAC;EAChDC,eAAe,EAAEL,IAAI;EACrBM,sBAAsB,EAAEN,IAAI;EAC5BO,eAAe,EAAEA,CAAA,KAAM,IAAI;EAC3BC,OAAO,EAAE;AACV,CAAC;AAED,OAAO,MAAMC,eAAe,GAAGX,aAAa,CAC3CG,sBACD,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,SAASS,kBAAkBA,CAAA,EAAyB;EAC1D,MAAMC,OAAO,GAAGZ,UAAU,CAACU,eAAe,CAAC;EAC3C,IAAI,CAACE,OAAO,CAACH,OAAO,EAAE;IACrB,MAAM,IAAII,KAAK,CACd,oFACD,CAAC;EACF;EACA,OAAOD,OAAO;AACf","ignoreList":[]}