@@ -35,12 +35,6 @@ import { HTabList as InternalTabList } from './tabs-list';
3535 * NOTE: scrolling support? or multiple lines? (probably not for headless but for tailwind / material )
3636 * Add ability to close tabs with an ❌ icon (and keyboard support)
3737
38- * TO DISCUSS
39- - name of the components, e.g. Tabs, Tabs.Trigger, Tabs.Panel
40- - selectedClassname => selectedClass
41- - do we keep all current props (tabId callbacks?)
42- - shorthand for tab: "label" or "tab"?
43- - the TODOs
4438 *
4539 */
4640
@@ -55,7 +49,9 @@ export type TabsProps = PropsOf<'div'> & {
5549 onSelectedTabIdChange$ ?: ( tabId : string ) => void ;
5650 'bind:selectedIndex' ?: Signal < number | undefined > ;
5751 'bind:selectedTabId' ?: Signal < string | undefined > ;
52+ /** @deprecated was for the shorthand API that we decided to no longer support as part of the headless kit */
5853 tabClass ?: PropsOf < 'div' > [ 'class' ] ;
54+ /** @deprecated was for the shorthand API that we decided to no longer support as part of the headless kit */
5955 panelClass ?: PropsOf < 'div' > [ 'class' ] ;
6056
6157 tabListComponent ?: typeof InternalTabList ;
@@ -76,8 +72,6 @@ export type TabInfo = {
7672export const HTabs : FunctionComponent < TabsProps > = ( props ) => {
7773 const {
7874 children,
79- tabClass,
80- panelClass,
8175 tabListComponent : UserTabList ,
8276 tabComponent : UserTab ,
8377 tabPanelComponent : UserTabPanel ,
@@ -134,6 +128,7 @@ export const HTabs: FunctionComponent<TabsProps> = (props) => {
134128 ( matchedTabComponent ?. props as TabProps ) . tabId || matchedTabComponent ?. key ;
135129 const tabId : string = tabIdFromTabMaybe || child . key || `${ panelIndex } ` ;
136130
131+ // This will be removed on v1 release
137132 if ( label ) {
138133 tabComponents . push ( ( < Tab > { label } </ Tab > ) as JSXNode < typeof Tab > ) ;
139134 }
@@ -146,7 +141,6 @@ export const HTabs: FunctionComponent<TabsProps> = (props) => {
146141 child . key = tabId ;
147142 // Add props but don't replace the object
148143 child . props . _tabId = tabId ;
149- child . props . _extraClass = panelClass ;
150144
151145 panelComponents . push ( child ) ;
152146 tabInfoList . push ( {
@@ -175,7 +169,6 @@ export const HTabs: FunctionComponent<TabsProps> = (props) => {
175169 const tabId = tabInfoList [ index ] ?. tabId ;
176170 tab . key = tabId ;
177171 tab . props . tabId = tabId ;
178- tab . props . _extraClass = tabClass ;
179172 if (
180173 tabInfoList [ index ] . panelProps . disabled !== undefined &&
181174 tab . props . disabled === undefined
0 commit comments