From ad79a8dd8d7ff2e216ed74543b9d53e5c5614839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dudak?= Date: Wed, 13 Mar 2024 18:45:25 +0100 Subject: [PATCH] API docs --- docs/data/base/pagesApi.js | 4 ++++ docs/pages/base-ui/api/switch-thumb.json | 14 ++++++++++++++ .../base-ui/api/use-switch-style-hooks.json | 11 +++++++++++ .../base-ui/react-switch/[docsTab]/index.js | 18 ++++++++++++++++-- .../switch-thumb/switch-thumb.json | 1 + .../use-switch-style-hooks.json | 1 + docs/translations/translations.json | 1 + 7 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 docs/pages/base-ui/api/switch-thumb.json create mode 100644 docs/pages/base-ui/api/use-switch-style-hooks.json create mode 100644 docs/translations/api-docs-base/switch-thumb/switch-thumb.json create mode 100644 docs/translations/api-docs/use-switch-style-hooks/use-switch-style-hooks.json diff --git a/docs/data/base/pagesApi.js b/docs/data/base/pagesApi.js index 77a19171a2..456a2dd6ab 100644 --- a/docs/data/base/pagesApi.js +++ b/docs/data/base/pagesApi.js @@ -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' }, { diff --git a/docs/pages/base-ui/api/switch-thumb.json b/docs/pages/base-ui/api/switch-thumb.json new file mode 100644 index 0000000000..136e44f171 --- /dev/null +++ b/docs/pages/base-ui/api/switch-thumb.json @@ -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": "", + "cssComponent": false +} diff --git a/docs/pages/base-ui/api/use-switch-style-hooks.json b/docs/pages/base-ui/api/use-switch-style-hooks.json new file mode 100644 index 0000000000..3a79771d7d --- /dev/null +++ b/docs/pages/base-ui/api/use-switch-style-hooks.json @@ -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": "" +} diff --git a/docs/pages/base-ui/react-switch/[docsTab]/index.js b/docs/pages/base-ui/react-switch/[docsTab]/index.js index 8756fb8249..94d9aa559a 100644 --- a/docs/pages/base-ui/react-switch/[docsTab]/index.js +++ b/docs/pages/base-ui/react-switch/[docsTab]/index.js @@ -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) { @@ -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, @@ -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 }, }, diff --git a/docs/translations/api-docs-base/switch-thumb/switch-thumb.json b/docs/translations/api-docs-base/switch-thumb/switch-thumb.json new file mode 100644 index 0000000000..f93d4cbd8c --- /dev/null +++ b/docs/translations/api-docs-base/switch-thumb/switch-thumb.json @@ -0,0 +1 @@ +{ "componentDescription": "", "propDescriptions": {}, "classDescriptions": {} } diff --git a/docs/translations/api-docs/use-switch-style-hooks/use-switch-style-hooks.json b/docs/translations/api-docs/use-switch-style-hooks/use-switch-style-hooks.json new file mode 100644 index 0000000000..e3eb65c6e4 --- /dev/null +++ b/docs/translations/api-docs/use-switch-style-hooks/use-switch-style-hooks.json @@ -0,0 +1 @@ +{ "hookDescription": "", "parametersDescriptions": {}, "returnValueDescriptions": {} } diff --git a/docs/translations/translations.json b/docs/translations/translations.json index 4f28fe800a..c7ee56a9da 100644 --- a/docs/translations/translations.json +++ b/docs/translations/translations.json @@ -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",