Skip to content

Commit

Permalink
use TabsContextValue interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeshanTamboli committed Mar 7, 2023
1 parent 7774d78 commit 19ac5fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
5 changes: 1 addition & 4 deletions docs/pages/base/api/use-tabs.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
},
"returnValue": {
"tabsContextValue": {
"type": {
"name": "{\n idPrefix: string | undefined\n value: string | number | false\n onSelected: (e: React.SyntheticEvent, newValue: string | number | false) =&gt void\n orientation?: 'horizontal' | 'vertical'\n direction: 'ltr' | 'rtl' | undefined\n selectionFollowsFocus: boolean | undefined\n}",
"description": "{\n idPrefix: string | undefined\n value: string | number | false\n onSelected: (e: React.SyntheticEvent, newValue: string | number | false) =&gt void\n orientation?: 'horizontal' | 'vertical'\n direction: 'ltr' | 'rtl' | undefined\n selectionFollowsFocus: boolean | undefined\n}"
},
"type": { "name": "TabsContextValue", "description": "TabsContextValue" },
"required": true
}
},
Expand Down
4 changes: 3 additions & 1 deletion docs/translations/api-docs/use-tabs/use-tabs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
"selectionFollowsFocus": "If <code>true</code> the selected tab changes on focus. Otherwise it only\nchanges on activation.",
"value": "The value of the currently selected <code>Tab</code>.\nIf you don't want any selected <code>Tab</code>, you can set this prop to <code>false</code>."
},
"returnValueDescriptions": {}
"returnValueDescriptions": {
"tabsContextValue": "Returns the values to be passed to the tabs context provider."
}
}
14 changes: 6 additions & 8 deletions packages/mui-base/src/useTabs/useTabs.types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { TabsContextValue } from '../TabsUnstyled';

export interface UseTabsParameters {
/**
* The value of the currently selected `Tab`.
Expand Down Expand Up @@ -30,12 +32,8 @@ export interface UseTabsParameters {
}

export interface UseTabsReturnValue {
tabsContextValue: {
idPrefix: string | undefined;
value: string | number | false;
onSelected: (e: React.SyntheticEvent, newValue: string | number | false) => void;
orientation?: 'horizontal' | 'vertical';
direction: 'ltr' | 'rtl' | undefined;
selectionFollowsFocus: boolean | undefined;
};
/**
* Returns the values to be passed to the tabs context provider.
*/
tabsContextValue: TabsContextValue;
}

0 comments on commit 19ac5fd

Please sign in to comment.