({props, tabsRef: ref, collection}: TabsInnerProps)
| 283 | // Renders tabs from a collection that has already been built, so that a component that builds the |
| 284 | // collection itself (e.g. Wizard) doesn't build it again. |
| 285 | export function TabsInner({props, tabsRef: ref, collection}: TabsInnerProps): JSX.Element { |
| 286 | let {orientation = 'horizontal'} = props; |
| 287 | let state = useTabListState({ |
| 288 | ...props, |
| 289 | collection, |
| 290 | children: undefined |
| 291 | }); |
| 292 | let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true}); |
| 293 | let values = useMemo( |
| 294 | () => ({ |
| 295 | orientation, |
| 296 | isFocusWithin: isFocused, |
| 297 | isFocusVisible |
| 298 | }), |
| 299 | [orientation, isFocused, isFocusVisible] |
| 300 | ); |
| 301 | let renderProps = useRenderProps({ |
| 302 | ...props, |
| 303 | defaultClassName: 'react-aria-Tabs', |
| 304 | values |
| 305 | }); |
| 306 | |
| 307 | let DOMProps = filterDOMProps(props, {global: true}); |
| 308 | |
| 309 | return ( |
| 310 | <dom.div |
| 311 | {...mergeProps(DOMProps, renderProps, focusProps)} |
| 312 | ref={ref} |
| 313 | slot={props.slot || undefined} |
| 314 | data-focused={isFocused || undefined} |
| 315 | data-orientation={orientation} |
| 316 | data-focus-visible={isFocusVisible || undefined} |
| 317 | data-disabled={state.isDisabled || undefined}> |
| 318 | <Provider |
| 319 | values={[ |
| 320 | [TabsContext, props], |
| 321 | [TabListStateContext, state] |
| 322 | ]}> |
| 323 | {renderProps.children} |
| 324 | </Provider> |
| 325 | </dom.div> |
| 326 | ); |
| 327 | } |
| 328 | |
| 329 | /** |
| 330 | * A TabList is used within Tabs to group tabs that a user can switch between. The ids of the items |
nothing calls this directly
no test coverage detected