Skip to content

Commit

Permalink
API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak committed Mar 15, 2024
1 parent 629044f commit ad79a8d
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/data/base/pagesApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ module.exports = [
title: 'Snackbar',
},
{ pathname: '/base-ui/react-switch/components-api/#switch', title: 'Switch' },
{
pathname: '/base-ui/react-switch/components-api/#switch-thumb',
title: 'SwitchThumb',
},
{ pathname: '/base-ui/react-tabs/components-api/#tab', title: 'Tab' },
{ pathname: '/base-ui/react-tabs/components-api/#tab-panel', title: 'TabPanel' },
{
Expand Down
14 changes: 14 additions & 0 deletions docs/pages/base-ui/api/switch-thumb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"props": {},
"name": "SwitchThumb",
"imports": [
"import { SwitchThumb } from '@mui/base/Switch';",
"import { SwitchThumb } from '@mui/base';"
],
"classes": [],
"muiName": "SwitchThumb",
"filename": "/packages/mui-base/src/Switch/SwitchThumb.tsx",
"inheritance": null,
"demos": "<ul><li><a href=\"/base-ui/react-switch/\">Switch</a></li></ul>",
"cssComponent": false
}
11 changes: 11 additions & 0 deletions docs/pages/base-ui/api/use-switch-style-hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"parameters": {},
"returnValue": {},
"name": "useSwitchStyleHooks",
"filename": "/packages/mui-base/src/Switch/useSwitchStyleHooks.ts",
"imports": [
"import { useSwitchStyleHooks } from '@mui/base/Switch';",
"import { useSwitchStyleHooks } from '@mui/base';"
],
"demos": "<ul></ul>"
}
18 changes: 16 additions & 2 deletions docs/pages/base-ui/react-switch/[docsTab]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AppFrame from 'docs/src/modules/components/AppFrame';
import * as pageProps from 'docs/data/base/components/switch/switch.md?@mui/markdown';
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
import SwitchApiJsonPageContent from '../../api/switch.json';
import SwitchThumbApiJsonPageContent from '../../api/switch-thumb.json';
import useSwitchApiJsonPageContent from '../../api/use-switch.json';

export default function Page(props) {
Expand All @@ -30,6 +31,13 @@ export const getStaticProps = () => {
);
const SwitchApiDescriptions = mapApiPageTranslations(SwitchApiReq);

const SwitchThumbApiReq = require.context(
'docs/translations/api-docs-base/switch-thumb',
false,
/switch-thumb.*.json$/,
);
const SwitchThumbApiDescriptions = mapApiPageTranslations(SwitchThumbApiReq);

const useSwitchApiReq = require.context(
'docs/translations/api-docs/use-switch',
false,
Expand All @@ -39,8 +47,14 @@ export const getStaticProps = () => {

return {
props: {
componentsApiDescriptions: { Switch: SwitchApiDescriptions },
componentsApiPageContents: { Switch: SwitchApiJsonPageContent },
componentsApiDescriptions: {
Switch: SwitchApiDescriptions,
SwitchThumb: SwitchThumbApiDescriptions,
},
componentsApiPageContents: {
Switch: SwitchApiJsonPageContent,
SwitchThumb: SwitchThumbApiJsonPageContent,
},
hooksApiDescriptions: { useSwitch: useSwitchApiDescriptions },
hooksApiPageContents: { useSwitch: useSwitchApiJsonPageContent },
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "componentDescription": "", "propDescriptions": {}, "classDescriptions": {} }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "hookDescription": "", "parametersDescriptions": {}, "returnValueDescriptions": {} }
1 change: 1 addition & 0 deletions docs/translations/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
"/base-ui/react-slider/components-api/#slider": "Slider",
"/base-ui/react-snackbar/components-api/#snackbar": "Snackbar",
"/base-ui/react-switch/components-api/#switch": "Switch",
"/base-ui/react-switch/components-api/#switch-thumb": "SwitchThumb",
"/base-ui/react-tabs/components-api/#tab": "Tab",
"/base-ui/react-tabs/components-api/#tab-panel": "TabPanel",
"/base-ui/react-table-pagination/components-api/#table-pagination": "TablePagination",
Expand Down

0 comments on commit ad79a8d

Please sign in to comment.