({props, tabsRef: ref, collection}: TabsInnerProps)
| 280 | } |
| 281 | |
| 282 | function TabsInner({props, tabsRef: ref, collection}: TabsInnerProps) { |
| 283 | let {orientation = 'horizontal'} = props; |
| 284 | let state = useTabListState({ |
| 285 | ...props, |
| 286 | collection, |
| 287 | children: undefined |
| 288 | }); |
| 289 | let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true}); |
| 290 | let values = useMemo( |
| 291 | () => ({ |
| 292 | orientation, |
| 293 | isFocusWithin: isFocused, |
| 294 | isFocusVisible |
| 295 | }), |
| 296 | [orientation, isFocused, isFocusVisible] |
| 297 | ); |
| 298 | let renderProps = useRenderProps({ |
| 299 | ...props, |
| 300 | defaultClassName: 'react-aria-Tabs', |
| 301 | values |
| 302 | }); |
| 303 | |
| 304 | let DOMProps = filterDOMProps(props, {global: true}); |
| 305 | |
| 306 | return ( |
| 307 | <dom.div |
| 308 | {...mergeProps(DOMProps, renderProps, focusProps)} |
| 309 | ref={ref} |
| 310 | slot={props.slot || undefined} |
| 311 | data-focused={isFocused || undefined} |
| 312 | data-orientation={orientation} |
| 313 | data-focus-visible={isFocusVisible || undefined} |
| 314 | data-disabled={state.isDisabled || undefined}> |
| 315 | <Provider |
| 316 | values={[ |
| 317 | [TabsContext, props], |
| 318 | [TabListStateContext, state] |
| 319 | ]}> |
| 320 | {renderProps.children} |
| 321 | </Provider> |
| 322 | </dom.div> |
| 323 | ); |
| 324 | } |
| 325 | |
| 326 | /** |
| 327 | * 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