) => {
+ const ref = React.useRef(null)
+ const { tabPanelProps } = useTabPanel(props, state, ref)
+
+ return (
+
+ {state.selectedItem?.props.children}
+
+ )
+}
+
+export { TabPanel }
diff --git a/packages/actify/src/components/Tabs/Tabs.tsx b/packages/actify/src/components/Tabs/Tabs.tsx
index 2d1f69a..d28757f 100644
--- a/packages/actify/src/components/Tabs/Tabs.tsx
+++ b/packages/actify/src/components/Tabs/Tabs.tsx
@@ -1,14 +1,25 @@
'use client'
+import {
+ AriaTabListProps,
+ mergeProps,
+ useFocusRing,
+ useTabList
+} from 'react-aria'
import React, { useEffect, useState } from 'react'
-import { mergeProps, useFocusRing, useTabList, useTabPanel } from 'react-aria'
+import { TabListProps, useTabListState } from 'react-stately'
import { Tab } from './Tab'
+import { TabPanel } from './TabPanel'
import clsx from 'clsx'
import styles from './tabs.module.css'
-import { useTabListState } from 'react-stately'
-export function Tabs(props: any) {
+interface TabsProps extends AriaTabListProps, TabListProps {
+ style?: React.CSSProperties
+ className?: string
+}
+
+const Tabs = (props: TabsProps) => {
const state = useTabListState(props)
const ref = React.useRef(null)
const { tabListProps } = useTabList(props, state, ref)
@@ -54,13 +65,6 @@ export function Tabs(props: any) {
)
}
-function TabPanel({ state, ...props }: any) {
- const ref = React.useRef(null)
- const { tabPanelProps } = useTabPanel(props, state, ref)
+Tabs.displayName = 'Actify.Tabs'
- return (
-
- {state.selectedItem?.props.children}
-
- )
-}
+export { Tabs }