From a8bb8394e0809390ed0f429440fe8dbab80ed678 Mon Sep 17 00:00:00 2001 From: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:44:48 +0100 Subject: [PATCH] [code-infra] Add options to docs-api generation to support X code structure (#40111) Signed-off-by: Matheus Wichman Signed-off-by: Olivier Tassinari Co-authored-by: Olivier Tassinari Co-authored-by: Matheus Wichman --- docs/pages/joy-ui/api/accordion-details.js | 2 +- docs/pages/joy-ui/api/accordion-group.js | 2 +- docs/pages/joy-ui/api/accordion-summary.js | 2 +- docs/pages/joy-ui/api/accordion.js | 2 +- docs/pages/joy-ui/api/alert.js | 2 +- docs/pages/joy-ui/api/aspect-ratio.js | 2 +- docs/pages/joy-ui/api/autocomplete-listbox.js | 2 +- docs/pages/joy-ui/api/autocomplete-option.js | 2 +- docs/pages/joy-ui/api/autocomplete.js | 2 +- docs/pages/joy-ui/api/avatar-group.js | 2 +- docs/pages/joy-ui/api/avatar.js | 2 +- docs/pages/joy-ui/api/badge.js | 2 +- docs/pages/joy-ui/api/box.js | 2 +- docs/pages/joy-ui/api/breadcrumbs.js | 2 +- docs/pages/joy-ui/api/button-group.js | 2 +- docs/pages/joy-ui/api/button.js | 2 +- docs/pages/joy-ui/api/card-actions.js | 2 +- docs/pages/joy-ui/api/card-content.js | 2 +- docs/pages/joy-ui/api/card-cover.js | 2 +- docs/pages/joy-ui/api/card-overflow.js | 2 +- docs/pages/joy-ui/api/card.js | 2 +- docs/pages/joy-ui/api/checkbox.js | 6 +- docs/pages/joy-ui/api/chip-delete.js | 2 +- docs/pages/joy-ui/api/chip.js | 2 +- docs/pages/joy-ui/api/circular-progress.js | 2 +- docs/pages/joy-ui/api/css-baseline.js | 2 +- docs/pages/joy-ui/api/dialog-actions.js | 2 +- docs/pages/joy-ui/api/dialog-content.js | 2 +- docs/pages/joy-ui/api/dialog-title.js | 2 +- docs/pages/joy-ui/api/divider.js | 6 +- docs/pages/joy-ui/api/drawer.js | 2 +- docs/pages/joy-ui/api/form-control.js | 2 +- docs/pages/joy-ui/api/form-helper-text.js | 2 +- docs/pages/joy-ui/api/form-label.js | 2 +- docs/pages/joy-ui/api/grid.js | 2 +- docs/pages/joy-ui/api/icon-button.js | 2 +- docs/pages/joy-ui/api/input.js | 2 +- docs/pages/joy-ui/api/input.json | 7 +- docs/pages/joy-ui/api/linear-progress.js | 2 +- docs/pages/joy-ui/api/link.js | 2 +- docs/pages/joy-ui/api/list-divider.js | 2 +- docs/pages/joy-ui/api/list-item-button.js | 2 +- docs/pages/joy-ui/api/list-item-content.js | 2 +- docs/pages/joy-ui/api/list-item-decorator.js | 2 +- docs/pages/joy-ui/api/list-item.js | 2 +- docs/pages/joy-ui/api/list-subheader.js | 2 +- docs/pages/joy-ui/api/list.js | 2 +- docs/pages/joy-ui/api/menu-button.js | 2 +- docs/pages/joy-ui/api/menu-item.js | 2 +- docs/pages/joy-ui/api/menu-list.js | 2 +- docs/pages/joy-ui/api/menu.js | 2 +- docs/pages/joy-ui/api/modal-close.js | 2 +- docs/pages/joy-ui/api/modal-dialog.js | 2 +- docs/pages/joy-ui/api/modal-overflow.js | 2 +- docs/pages/joy-ui/api/modal.js | 2 +- docs/pages/joy-ui/api/option.js | 2 +- docs/pages/joy-ui/api/option.json | 4 +- docs/pages/joy-ui/api/radio-group.js | 2 +- docs/pages/joy-ui/api/radio.js | 2 +- docs/pages/joy-ui/api/scoped-css-baseline.js | 2 +- docs/pages/joy-ui/api/select.js | 2 +- docs/pages/joy-ui/api/select.json | 13 +- docs/pages/joy-ui/api/sheet.js | 2 +- docs/pages/joy-ui/api/skeleton.js | 6 +- docs/pages/joy-ui/api/slider.js | 2 +- docs/pages/joy-ui/api/snackbar.js | 6 +- docs/pages/joy-ui/api/stack.js | 2 +- docs/pages/joy-ui/api/step-button.js | 2 +- docs/pages/joy-ui/api/step-indicator.js | 2 +- docs/pages/joy-ui/api/step.js | 2 +- docs/pages/joy-ui/api/stepper.js | 6 +- docs/pages/joy-ui/api/svg-icon.js | 6 +- docs/pages/joy-ui/api/switch.js | 2 +- docs/pages/joy-ui/api/tab-list.js | 6 +- docs/pages/joy-ui/api/tab-panel.js | 2 +- docs/pages/joy-ui/api/tab.js | 2 +- docs/pages/joy-ui/api/table.js | 2 +- docs/pages/joy-ui/api/tabs.js | 2 +- docs/pages/joy-ui/api/textarea.js | 6 +- docs/pages/joy-ui/api/textarea.json | 10 +- docs/pages/joy-ui/api/toggle-button-group.js | 2 +- docs/pages/joy-ui/api/tooltip.js | 6 +- docs/pages/joy-ui/api/typography.js | 2 +- .../material-ui/api/accordion-actions.js | 2 +- .../material-ui/api/accordion-details.js | 2 +- .../material-ui/api/accordion-summary.js | 2 +- docs/pages/material-ui/api/accordion.js | 6 +- docs/pages/material-ui/api/alert-title.js | 2 +- docs/pages/material-ui/api/alert.js | 2 +- docs/pages/material-ui/api/app-bar.js | 2 +- docs/pages/material-ui/api/autocomplete.js | 2 +- docs/pages/material-ui/api/avatar-group.js | 2 +- docs/pages/material-ui/api/avatar.js | 2 +- docs/pages/material-ui/api/backdrop.js | 2 +- docs/pages/material-ui/api/badge.js | 2 +- .../api/bottom-navigation-action.js | 2 +- .../material-ui/api/bottom-navigation.js | 2 +- docs/pages/material-ui/api/box.js | 2 +- docs/pages/material-ui/api/breadcrumbs.js | 2 +- docs/pages/material-ui/api/button-base.js | 2 +- docs/pages/material-ui/api/button-group.js | 2 +- docs/pages/material-ui/api/button.js | 2 +- .../pages/material-ui/api/card-action-area.js | 2 +- docs/pages/material-ui/api/card-actions.js | 2 +- docs/pages/material-ui/api/card-content.js | 2 +- docs/pages/material-ui/api/card-header.js | 2 +- docs/pages/material-ui/api/card-media.js | 6 +- docs/pages/material-ui/api/card.js | 2 +- docs/pages/material-ui/api/checkbox.js | 2 +- docs/pages/material-ui/api/chip.js | 2 +- .../material-ui/api/circular-progress.js | 2 +- docs/pages/material-ui/api/collapse.js | 2 +- docs/pages/material-ui/api/container.js | 6 +- docs/pages/material-ui/api/css-baseline.js | 2 +- docs/pages/material-ui/api/dialog-actions.js | 2 +- .../material-ui/api/dialog-content-text.js | 2 +- docs/pages/material-ui/api/dialog-content.js | 2 +- docs/pages/material-ui/api/dialog-title.js | 2 +- docs/pages/material-ui/api/dialog.js | 2 +- docs/pages/material-ui/api/divider.js | 2 +- docs/pages/material-ui/api/drawer.js | 2 +- docs/pages/material-ui/api/fab.js | 2 +- docs/pages/material-ui/api/fade.js | 2 +- docs/pages/material-ui/api/filled-input.js | 2 +- .../material-ui/api/form-control-label.js | 2 +- docs/pages/material-ui/api/form-control.js | 2 +- docs/pages/material-ui/api/form-group.js | 6 +- .../pages/material-ui/api/form-helper-text.js | 2 +- docs/pages/material-ui/api/form-label.js | 6 +- docs/pages/material-ui/api/global-styles.js | 2 +- docs/pages/material-ui/api/grid.js | 2 +- docs/pages/material-ui/api/grow.js | 2 +- docs/pages/material-ui/api/hidden.js | 2 +- docs/pages/material-ui/api/icon-button.js | 2 +- docs/pages/material-ui/api/icon.js | 2 +- .../material-ui/api/image-list-item-bar.js | 2 +- docs/pages/material-ui/api/image-list-item.js | 2 +- docs/pages/material-ui/api/image-list.js | 6 +- docs/pages/material-ui/api/input-adornment.js | 2 +- docs/pages/material-ui/api/input-base.js | 6 +- docs/pages/material-ui/api/input-label.js | 2 +- docs/pages/material-ui/api/input.js | 2 +- docs/pages/material-ui/api/linear-progress.js | 2 +- docs/pages/material-ui/api/link.js | 2 +- .../pages/material-ui/api/list-item-avatar.js | 2 +- .../pages/material-ui/api/list-item-button.js | 2 +- docs/pages/material-ui/api/list-item-icon.js | 2 +- .../api/list-item-secondary-action.js | 2 +- docs/pages/material-ui/api/list-item-text.js | 2 +- docs/pages/material-ui/api/list-item.js | 6 +- docs/pages/material-ui/api/list-subheader.js | 2 +- docs/pages/material-ui/api/list.js | 2 +- docs/pages/material-ui/api/loading-button.js | 2 +- docs/pages/material-ui/api/masonry.js | 2 +- docs/pages/material-ui/api/menu-item.js | 6 +- docs/pages/material-ui/api/menu-list.js | 6 +- docs/pages/material-ui/api/menu.js | 2 +- docs/pages/material-ui/api/mobile-stepper.js | 2 +- docs/pages/material-ui/api/modal.js | 2 +- docs/pages/material-ui/api/native-select.js | 2 +- docs/pages/material-ui/api/outlined-input.js | 2 +- docs/pages/material-ui/api/pagination-item.js | 2 +- docs/pages/material-ui/api/pagination.js | 6 +- docs/pages/material-ui/api/paper.js | 2 +- docs/pages/material-ui/api/popover.js | 2 +- docs/pages/material-ui/api/popper.js | 2 +- docs/pages/material-ui/api/radio-group.js | 2 +- docs/pages/material-ui/api/radio.js | 2 +- docs/pages/material-ui/api/rating.js | 2 +- .../material-ui/api/scoped-css-baseline.js | 2 +- docs/pages/material-ui/api/select.js | 2 +- docs/pages/material-ui/api/skeleton.js | 2 +- docs/pages/material-ui/api/slide.js | 2 +- docs/pages/material-ui/api/slider.js | 2 +- .../pages/material-ui/api/snackbar-content.js | 2 +- docs/pages/material-ui/api/snackbar.js | 2 +- .../material-ui/api/speed-dial-action.js | 2 +- docs/pages/material-ui/api/speed-dial-icon.js | 2 +- docs/pages/material-ui/api/speed-dial.js | 6 +- docs/pages/material-ui/api/stack.js | 2 +- docs/pages/material-ui/api/step-button.js | 2 +- docs/pages/material-ui/api/step-connector.js | 2 +- docs/pages/material-ui/api/step-content.js | 2 +- docs/pages/material-ui/api/step-icon.js | 6 +- docs/pages/material-ui/api/step-label.js | 6 +- docs/pages/material-ui/api/step.js | 2 +- docs/pages/material-ui/api/stepper.js | 2 +- docs/pages/material-ui/api/svg-icon.js | 2 +- .../pages/material-ui/api/swipeable-drawer.js | 2 +- docs/pages/material-ui/api/switch.js | 2 +- docs/pages/material-ui/api/tab-context.js | 2 +- docs/pages/material-ui/api/tab-list.js | 2 +- docs/pages/material-ui/api/tab-panel.js | 6 +- .../material-ui/api/tab-scroll-button.js | 2 +- docs/pages/material-ui/api/tab.js | 2 +- docs/pages/material-ui/api/table-body.js | 6 +- docs/pages/material-ui/api/table-cell.js | 6 +- docs/pages/material-ui/api/table-container.js | 2 +- docs/pages/material-ui/api/table-footer.js | 2 +- docs/pages/material-ui/api/table-head.js | 6 +- .../pages/material-ui/api/table-pagination.js | 2 +- docs/pages/material-ui/api/table-row.js | 6 +- .../pages/material-ui/api/table-sort-label.js | 2 +- docs/pages/material-ui/api/table.js | 2 +- docs/pages/material-ui/api/tabs.js | 2 +- docs/pages/material-ui/api/text-field.js | 6 +- .../material-ui/api/timeline-connector.js | 2 +- .../pages/material-ui/api/timeline-content.js | 2 +- docs/pages/material-ui/api/timeline-dot.js | 2 +- docs/pages/material-ui/api/timeline-item.js | 2 +- .../api/timeline-opposite-content.js | 2 +- .../material-ui/api/timeline-separator.js | 2 +- docs/pages/material-ui/api/timeline.js | 2 +- .../material-ui/api/toggle-button-group.js | 2 +- docs/pages/material-ui/api/toggle-button.js | 2 +- docs/pages/material-ui/api/toolbar.js | 2 +- docs/pages/material-ui/api/tooltip.js | 2 +- docs/pages/material-ui/api/typography.js | 6 +- docs/pages/material-ui/api/zoom.js | 2 +- docs/pages/system/api/box.js | 2 +- docs/pages/system/api/container.js | 6 +- docs/pages/system/api/grid.js | 2 +- docs/pages/system/api/stack.js | 2 +- .../ApiPage/list/PropertiesList.tsx | 3 + .../ApiPage/sections/PropertiesSection.js | 9 ++ .../ApiPage/table/PropertiesTable.tsx | 7 + .../dropdown-menu/dropdown-menu.json | 9 -- .../number-input-unstyled.json | 19 --- .../drawer-content/drawer-content.json | 90 ----------- .../baseUi/projectSettings.ts | 3 + .../joyUi/projectSettings.ts | 1 + .../materialUi/projectSettings.ts | 1 + .../muiSystem/projectSettings.ts | 1 + .../ApiBuilders/ComponentApiBuilder.ts | 153 +++++++----------- .../ApiBuilders/HookApiBuilder.ts | 51 +----- packages/api-docs-builder/ProjectSettings.ts | 28 ++++ packages/api-docs-builder/buildApi.ts | 49 ++++-- packages/api-docs-builder/buildApiUtils.ts | 9 ++ .../utils/createDescribeableProp.ts | 15 +- .../utils/defaultPropsHandler.ts | 4 +- .../utils/findPagesMarkdown.ts | 5 +- .../utils/generateApiTranslation.ts | 52 ++++++ .../utils/generatePropDescription.ts | 18 +++ 243 files changed, 616 insertions(+), 507 deletions(-) delete mode 100644 docs/translations/api-docs-base/dropdown-menu/dropdown-menu.json delete mode 100644 docs/translations/api-docs-base/number-input-unstyled/number-input-unstyled.json delete mode 100644 docs/translations/api-docs-joy/drawer-content/drawer-content.json create mode 100644 packages/api-docs-builder/utils/generateApiTranslation.ts diff --git a/docs/pages/joy-ui/api/accordion-details.js b/docs/pages/joy-ui/api/accordion-details.js index be64ab46426276..708f39a7ccfafe 100644 --- a/docs/pages/joy-ui/api/accordion-details.js +++ b/docs/pages/joy-ui/api/accordion-details.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/accordion-details', false, - /accordion-details.*.json$/, + /\.\/accordion-details.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/accordion-group.js b/docs/pages/joy-ui/api/accordion-group.js index 703a209e15fe94..c405ade6fe9247 100644 --- a/docs/pages/joy-ui/api/accordion-group.js +++ b/docs/pages/joy-ui/api/accordion-group.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/accordion-group', false, - /accordion-group.*.json$/, + /\.\/accordion-group.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/accordion-summary.js b/docs/pages/joy-ui/api/accordion-summary.js index 66d258e963ac61..b9ee5fe3cb7e57 100644 --- a/docs/pages/joy-ui/api/accordion-summary.js +++ b/docs/pages/joy-ui/api/accordion-summary.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/accordion-summary', false, - /accordion-summary.*.json$/, + /\.\/accordion-summary.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/accordion.js b/docs/pages/joy-ui/api/accordion.js index 328b015d547d10..df4f8a8699b8c1 100644 --- a/docs/pages/joy-ui/api/accordion.js +++ b/docs/pages/joy-ui/api/accordion.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/accordion', false, - /accordion.*.json$/, + /\.\/accordion.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/alert.js b/docs/pages/joy-ui/api/alert.js index 1beef9603135c9..5ef04072406375 100644 --- a/docs/pages/joy-ui/api/alert.js +++ b/docs/pages/joy-ui/api/alert.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/alert', false, /alert.*.json$/); + const req = require.context('docs/translations/api-docs-joy/alert', false, /\.\/alert.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/aspect-ratio.js b/docs/pages/joy-ui/api/aspect-ratio.js index ff99079a85af64..48b3e48b0a119e 100644 --- a/docs/pages/joy-ui/api/aspect-ratio.js +++ b/docs/pages/joy-ui/api/aspect-ratio.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/aspect-ratio', false, - /aspect-ratio.*.json$/, + /\.\/aspect-ratio.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/autocomplete-listbox.js b/docs/pages/joy-ui/api/autocomplete-listbox.js index e79dc1da495467..3b033199618665 100644 --- a/docs/pages/joy-ui/api/autocomplete-listbox.js +++ b/docs/pages/joy-ui/api/autocomplete-listbox.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/autocomplete-listbox', false, - /autocomplete-listbox.*.json$/, + /\.\/autocomplete-listbox.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/autocomplete-option.js b/docs/pages/joy-ui/api/autocomplete-option.js index 8304139be937e1..00548e5df20b8d 100644 --- a/docs/pages/joy-ui/api/autocomplete-option.js +++ b/docs/pages/joy-ui/api/autocomplete-option.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/autocomplete-option', false, - /autocomplete-option.*.json$/, + /\.\/autocomplete-option.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/autocomplete.js b/docs/pages/joy-ui/api/autocomplete.js index e860d625a4952d..a88ecbd54f4c63 100644 --- a/docs/pages/joy-ui/api/autocomplete.js +++ b/docs/pages/joy-ui/api/autocomplete.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/autocomplete', false, - /autocomplete.*.json$/, + /\.\/autocomplete.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/avatar-group.js b/docs/pages/joy-ui/api/avatar-group.js index c5ccfec00272ea..efc7c2615ae065 100644 --- a/docs/pages/joy-ui/api/avatar-group.js +++ b/docs/pages/joy-ui/api/avatar-group.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/avatar-group', false, - /avatar-group.*.json$/, + /\.\/avatar-group.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/avatar.js b/docs/pages/joy-ui/api/avatar.js index 57a3395ab0730a..f56b42f5636044 100644 --- a/docs/pages/joy-ui/api/avatar.js +++ b/docs/pages/joy-ui/api/avatar.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/avatar', false, /avatar.*.json$/); + const req = require.context('docs/translations/api-docs-joy/avatar', false, /\.\/avatar.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/badge.js b/docs/pages/joy-ui/api/badge.js index 934d17137e217d..f0bc587eb44f8b 100644 --- a/docs/pages/joy-ui/api/badge.js +++ b/docs/pages/joy-ui/api/badge.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/badge', false, /badge.*.json$/); + const req = require.context('docs/translations/api-docs-joy/badge', false, /\.\/badge.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/box.js b/docs/pages/joy-ui/api/box.js index 63f2b94b3b0f7e..de22c574d59f28 100644 --- a/docs/pages/joy-ui/api/box.js +++ b/docs/pages/joy-ui/api/box.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/box', false, /box.*.json$/); + const req = require.context('docs/translations/api-docs-joy/box', false, /\.\/box.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/breadcrumbs.js b/docs/pages/joy-ui/api/breadcrumbs.js index afb0cff96967f1..d35755c5722cf7 100644 --- a/docs/pages/joy-ui/api/breadcrumbs.js +++ b/docs/pages/joy-ui/api/breadcrumbs.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/breadcrumbs', false, - /breadcrumbs.*.json$/, + /\.\/breadcrumbs.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/button-group.js b/docs/pages/joy-ui/api/button-group.js index 23d1ecfe06ab15..7922dc669c0b34 100644 --- a/docs/pages/joy-ui/api/button-group.js +++ b/docs/pages/joy-ui/api/button-group.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/button-group', false, - /button-group.*.json$/, + /\.\/button-group.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/button.js b/docs/pages/joy-ui/api/button.js index 2921080c103f66..a63237b7b41270 100644 --- a/docs/pages/joy-ui/api/button.js +++ b/docs/pages/joy-ui/api/button.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/button', false, /button.*.json$/); + const req = require.context('docs/translations/api-docs-joy/button', false, /\.\/button.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/card-actions.js b/docs/pages/joy-ui/api/card-actions.js index 92a39d6291c3d8..02fd02ec462288 100644 --- a/docs/pages/joy-ui/api/card-actions.js +++ b/docs/pages/joy-ui/api/card-actions.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/card-actions', false, - /card-actions.*.json$/, + /\.\/card-actions.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/card-content.js b/docs/pages/joy-ui/api/card-content.js index 9ed9f2faacfc3f..c6ba3f8a4bc2e2 100644 --- a/docs/pages/joy-ui/api/card-content.js +++ b/docs/pages/joy-ui/api/card-content.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/card-content', false, - /card-content.*.json$/, + /\.\/card-content.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/card-cover.js b/docs/pages/joy-ui/api/card-cover.js index 0236dc8169b6f1..139aa8bf269947 100644 --- a/docs/pages/joy-ui/api/card-cover.js +++ b/docs/pages/joy-ui/api/card-cover.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/card-cover', false, - /card-cover.*.json$/, + /\.\/card-cover.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/card-overflow.js b/docs/pages/joy-ui/api/card-overflow.js index 2b57750faa905a..92306d7e8494eb 100644 --- a/docs/pages/joy-ui/api/card-overflow.js +++ b/docs/pages/joy-ui/api/card-overflow.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/card-overflow', false, - /card-overflow.*.json$/, + /\.\/card-overflow.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/card.js b/docs/pages/joy-ui/api/card.js index 5da0e773bb2a6d..d666f4940dae2a 100644 --- a/docs/pages/joy-ui/api/card.js +++ b/docs/pages/joy-ui/api/card.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/card', false, /card.*.json$/); + const req = require.context('docs/translations/api-docs-joy/card', false, /\.\/card.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/checkbox.js b/docs/pages/joy-ui/api/checkbox.js index 0df2f4c56de0b7..8e2ba8873f696a 100644 --- a/docs/pages/joy-ui/api/checkbox.js +++ b/docs/pages/joy-ui/api/checkbox.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/checkbox', false, /checkbox.*.json$/); + const req = require.context( + 'docs/translations/api-docs-joy/checkbox', + false, + /\.\/checkbox.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/chip-delete.js b/docs/pages/joy-ui/api/chip-delete.js index 39698b8886be15..508e66d78a7b55 100644 --- a/docs/pages/joy-ui/api/chip-delete.js +++ b/docs/pages/joy-ui/api/chip-delete.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/chip-delete', false, - /chip-delete.*.json$/, + /\.\/chip-delete.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/chip.js b/docs/pages/joy-ui/api/chip.js index becc5c4656a95b..e264c69e4509a5 100644 --- a/docs/pages/joy-ui/api/chip.js +++ b/docs/pages/joy-ui/api/chip.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/chip', false, /chip.*.json$/); + const req = require.context('docs/translations/api-docs-joy/chip', false, /\.\/chip.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/circular-progress.js b/docs/pages/joy-ui/api/circular-progress.js index 99973fb75b7d20..feac4b351e3fdc 100644 --- a/docs/pages/joy-ui/api/circular-progress.js +++ b/docs/pages/joy-ui/api/circular-progress.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/circular-progress', false, - /circular-progress.*.json$/, + /\.\/circular-progress.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/css-baseline.js b/docs/pages/joy-ui/api/css-baseline.js index 6fe78ac3fb9d43..d375bbb575ac03 100644 --- a/docs/pages/joy-ui/api/css-baseline.js +++ b/docs/pages/joy-ui/api/css-baseline.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/css-baseline', false, - /css-baseline.*.json$/, + /\.\/css-baseline.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/dialog-actions.js b/docs/pages/joy-ui/api/dialog-actions.js index f52d8867d4ab9f..10901b33ce38af 100644 --- a/docs/pages/joy-ui/api/dialog-actions.js +++ b/docs/pages/joy-ui/api/dialog-actions.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/dialog-actions', false, - /dialog-actions.*.json$/, + /\.\/dialog-actions.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/dialog-content.js b/docs/pages/joy-ui/api/dialog-content.js index fd6ee6f24cdb4e..43da9d52ce80bb 100644 --- a/docs/pages/joy-ui/api/dialog-content.js +++ b/docs/pages/joy-ui/api/dialog-content.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/dialog-content', false, - /dialog-content.*.json$/, + /\.\/dialog-content.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/dialog-title.js b/docs/pages/joy-ui/api/dialog-title.js index 7ad832c7f61815..ea4f5ecbb2f845 100644 --- a/docs/pages/joy-ui/api/dialog-title.js +++ b/docs/pages/joy-ui/api/dialog-title.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/dialog-title', false, - /dialog-title.*.json$/, + /\.\/dialog-title.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/divider.js b/docs/pages/joy-ui/api/divider.js index 018e205ed7d7ea..0eb73a25609875 100644 --- a/docs/pages/joy-ui/api/divider.js +++ b/docs/pages/joy-ui/api/divider.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/divider', false, /divider.*.json$/); + const req = require.context( + 'docs/translations/api-docs-joy/divider', + false, + /\.\/divider.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/drawer.js b/docs/pages/joy-ui/api/drawer.js index 6b3204d9cb678d..f5fb379409fce3 100644 --- a/docs/pages/joy-ui/api/drawer.js +++ b/docs/pages/joy-ui/api/drawer.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/drawer', false, /drawer.*.json$/); + const req = require.context('docs/translations/api-docs-joy/drawer', false, /\.\/drawer.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/form-control.js b/docs/pages/joy-ui/api/form-control.js index fe1436d9acbf30..743ee0048ecf18 100644 --- a/docs/pages/joy-ui/api/form-control.js +++ b/docs/pages/joy-ui/api/form-control.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/form-control', false, - /form-control.*.json$/, + /\.\/form-control.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/form-helper-text.js b/docs/pages/joy-ui/api/form-helper-text.js index bb9f7d5ef3010c..19ead9d723ccef 100644 --- a/docs/pages/joy-ui/api/form-helper-text.js +++ b/docs/pages/joy-ui/api/form-helper-text.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/form-helper-text', false, - /form-helper-text.*.json$/, + /\.\/form-helper-text.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/form-label.js b/docs/pages/joy-ui/api/form-label.js index a17441b6360311..598b75d6e69390 100644 --- a/docs/pages/joy-ui/api/form-label.js +++ b/docs/pages/joy-ui/api/form-label.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/form-label', false, - /form-label.*.json$/, + /\.\/form-label.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/grid.js b/docs/pages/joy-ui/api/grid.js index 747b93a8ccba0e..022175a258140f 100644 --- a/docs/pages/joy-ui/api/grid.js +++ b/docs/pages/joy-ui/api/grid.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/grid', false, /grid.*.json$/); + const req = require.context('docs/translations/api-docs-joy/grid', false, /\.\/grid.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/icon-button.js b/docs/pages/joy-ui/api/icon-button.js index b74a97145df7bb..914488209d0497 100644 --- a/docs/pages/joy-ui/api/icon-button.js +++ b/docs/pages/joy-ui/api/icon-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/icon-button', false, - /icon-button.*.json$/, + /\.\/icon-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/input.js b/docs/pages/joy-ui/api/input.js index 5148e848df28b1..4f59deddae07b7 100644 --- a/docs/pages/joy-ui/api/input.js +++ b/docs/pages/joy-ui/api/input.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/input', false, /input.*.json$/); + const req = require.context('docs/translations/api-docs-joy/input', false, /\.\/input.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/input.json b/docs/pages/joy-ui/api/input.json index 8b467c3f914bf9..647087f91ec5a1 100644 --- a/docs/pages/joy-ui/api/input.json +++ b/docs/pages/joy-ui/api/input.json @@ -6,16 +6,18 @@ "name": "union", "description": "'danger'
| 'neutral'
| 'primary'
| 'success'
| 'warning'
| string" }, + "default": "'neutral'", "additionalInfo": { "joy-color": true } }, "endDecorator": { "type": { "name": "node" } }, - "error": { "type": { "name": "bool" } }, - "fullWidth": { "type": { "name": "bool" } }, + "error": { "type": { "name": "bool" }, "default": "false" }, + "fullWidth": { "type": { "name": "bool" }, "default": "false" }, "size": { "type": { "name": "union", "description": "'sm'
| 'md'
| 'lg'
| string" }, + "default": "'md'", "additionalInfo": { "joy-size": true } }, "startDecorator": { "type": { "name": "node" } }, @@ -31,6 +33,7 @@ "name": "union", "description": "'outlined'
| 'plain'
| 'soft'
| 'solid'
| string" }, + "default": "'outlined'", "additionalInfo": { "joy-variant": true } } }, diff --git a/docs/pages/joy-ui/api/linear-progress.js b/docs/pages/joy-ui/api/linear-progress.js index 913b381ac10b9d..2656ed5c3c1014 100644 --- a/docs/pages/joy-ui/api/linear-progress.js +++ b/docs/pages/joy-ui/api/linear-progress.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/linear-progress', false, - /linear-progress.*.json$/, + /\.\/linear-progress.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/link.js b/docs/pages/joy-ui/api/link.js index cefc7a511cf31a..b6ca4fd8315191 100644 --- a/docs/pages/joy-ui/api/link.js +++ b/docs/pages/joy-ui/api/link.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/link', false, /link.*.json$/); + const req = require.context('docs/translations/api-docs-joy/link', false, /\.\/link.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/list-divider.js b/docs/pages/joy-ui/api/list-divider.js index 7368cf339d4cb5..73d984a77b242a 100644 --- a/docs/pages/joy-ui/api/list-divider.js +++ b/docs/pages/joy-ui/api/list-divider.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/list-divider', false, - /list-divider.*.json$/, + /\.\/list-divider.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/list-item-button.js b/docs/pages/joy-ui/api/list-item-button.js index e89eeff96e040a..b0d07c8eb815bc 100644 --- a/docs/pages/joy-ui/api/list-item-button.js +++ b/docs/pages/joy-ui/api/list-item-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/list-item-button', false, - /list-item-button.*.json$/, + /\.\/list-item-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/list-item-content.js b/docs/pages/joy-ui/api/list-item-content.js index 46a470fbd462f6..c760f66a170c2c 100644 --- a/docs/pages/joy-ui/api/list-item-content.js +++ b/docs/pages/joy-ui/api/list-item-content.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/list-item-content', false, - /list-item-content.*.json$/, + /\.\/list-item-content.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/list-item-decorator.js b/docs/pages/joy-ui/api/list-item-decorator.js index 34d3416aeb72fa..54558675f64c4a 100644 --- a/docs/pages/joy-ui/api/list-item-decorator.js +++ b/docs/pages/joy-ui/api/list-item-decorator.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/list-item-decorator', false, - /list-item-decorator.*.json$/, + /\.\/list-item-decorator.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/list-item.js b/docs/pages/joy-ui/api/list-item.js index 795326d3b784e8..e9abe9bc12bbce 100644 --- a/docs/pages/joy-ui/api/list-item.js +++ b/docs/pages/joy-ui/api/list-item.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/list-item', false, - /list-item.*.json$/, + /\.\/list-item.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/list-subheader.js b/docs/pages/joy-ui/api/list-subheader.js index 40c4ae82a46e44..2adb185afe88ef 100644 --- a/docs/pages/joy-ui/api/list-subheader.js +++ b/docs/pages/joy-ui/api/list-subheader.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/list-subheader', false, - /list-subheader.*.json$/, + /\.\/list-subheader.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/list.js b/docs/pages/joy-ui/api/list.js index eb6d30911256fa..90b641ad87bcb3 100644 --- a/docs/pages/joy-ui/api/list.js +++ b/docs/pages/joy-ui/api/list.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/list', false, /list.*.json$/); + const req = require.context('docs/translations/api-docs-joy/list', false, /\.\/list.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/menu-button.js b/docs/pages/joy-ui/api/menu-button.js index bed751cbe61eb5..f145fbadc5abad 100644 --- a/docs/pages/joy-ui/api/menu-button.js +++ b/docs/pages/joy-ui/api/menu-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/menu-button', false, - /menu-button.*.json$/, + /\.\/menu-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/menu-item.js b/docs/pages/joy-ui/api/menu-item.js index 7c25eabddc7a9d..2346df64e596d4 100644 --- a/docs/pages/joy-ui/api/menu-item.js +++ b/docs/pages/joy-ui/api/menu-item.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/menu-item', false, - /menu-item.*.json$/, + /\.\/menu-item.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/menu-list.js b/docs/pages/joy-ui/api/menu-list.js index 328df9707e3920..e9600d4e7f1df1 100644 --- a/docs/pages/joy-ui/api/menu-list.js +++ b/docs/pages/joy-ui/api/menu-list.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/menu-list', false, - /menu-list.*.json$/, + /\.\/menu-list.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/menu.js b/docs/pages/joy-ui/api/menu.js index 9d8852e164459a..e2da1425483459 100644 --- a/docs/pages/joy-ui/api/menu.js +++ b/docs/pages/joy-ui/api/menu.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/menu', false, /menu.*.json$/); + const req = require.context('docs/translations/api-docs-joy/menu', false, /\.\/menu.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/modal-close.js b/docs/pages/joy-ui/api/modal-close.js index 2e1f20037a8b9b..5832d61bfdb374 100644 --- a/docs/pages/joy-ui/api/modal-close.js +++ b/docs/pages/joy-ui/api/modal-close.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/modal-close', false, - /modal-close.*.json$/, + /\.\/modal-close.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/modal-dialog.js b/docs/pages/joy-ui/api/modal-dialog.js index 7a075af2d745a4..82d52b3abbc4fd 100644 --- a/docs/pages/joy-ui/api/modal-dialog.js +++ b/docs/pages/joy-ui/api/modal-dialog.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/modal-dialog', false, - /modal-dialog.*.json$/, + /\.\/modal-dialog.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/modal-overflow.js b/docs/pages/joy-ui/api/modal-overflow.js index 05d8f4ee7ca5e4..e1dedb4a09df3a 100644 --- a/docs/pages/joy-ui/api/modal-overflow.js +++ b/docs/pages/joy-ui/api/modal-overflow.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/modal-overflow', false, - /modal-overflow.*.json$/, + /\.\/modal-overflow.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/modal.js b/docs/pages/joy-ui/api/modal.js index ef6790a308f66d..1060ae4e2bd91c 100644 --- a/docs/pages/joy-ui/api/modal.js +++ b/docs/pages/joy-ui/api/modal.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/modal', false, /modal.*.json$/); + const req = require.context('docs/translations/api-docs-joy/modal', false, /\.\/modal.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/option.js b/docs/pages/joy-ui/api/option.js index 5e0ef1712e7508..31f18d011a98cd 100644 --- a/docs/pages/joy-ui/api/option.js +++ b/docs/pages/joy-ui/api/option.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/option', false, /option.*.json$/); + const req = require.context('docs/translations/api-docs-joy/option', false, /\.\/option.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/option.json b/docs/pages/joy-ui/api/option.json index 74a33963fb3cb9..8e22355095d24a 100644 --- a/docs/pages/joy-ui/api/option.json +++ b/docs/pages/joy-ui/api/option.json @@ -7,9 +7,10 @@ "name": "union", "description": "'danger'
| 'neutral'
| 'primary'
| 'success'
| 'warning'
| string" }, + "default": "'neutral'", "additionalInfo": { "joy-color": true } }, - "disabled": { "type": { "name": "bool" } }, + "disabled": { "type": { "name": "bool" }, "default": "false" }, "label": { "type": { "name": "union", "description": "element
| string" } }, "sx": { "type": { @@ -23,6 +24,7 @@ "name": "union", "description": "'outlined'
| 'plain'
| 'soft'
| 'solid'
| string" }, + "default": "'plain'", "additionalInfo": { "joy-variant": true } } }, diff --git a/docs/pages/joy-ui/api/radio-group.js b/docs/pages/joy-ui/api/radio-group.js index d06674a93711c6..4d9f1de7538934 100644 --- a/docs/pages/joy-ui/api/radio-group.js +++ b/docs/pages/joy-ui/api/radio-group.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/radio-group', false, - /radio-group.*.json$/, + /\.\/radio-group.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/radio.js b/docs/pages/joy-ui/api/radio.js index 3aa10955c27845..ebe4d0f9698bdd 100644 --- a/docs/pages/joy-ui/api/radio.js +++ b/docs/pages/joy-ui/api/radio.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/radio', false, /radio.*.json$/); + const req = require.context('docs/translations/api-docs-joy/radio', false, /\.\/radio.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/scoped-css-baseline.js b/docs/pages/joy-ui/api/scoped-css-baseline.js index 169d8079db865d..5f31ec87938908 100644 --- a/docs/pages/joy-ui/api/scoped-css-baseline.js +++ b/docs/pages/joy-ui/api/scoped-css-baseline.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/scoped-css-baseline', false, - /scoped-css-baseline.*.json$/, + /\.\/scoped-css-baseline.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/select.js b/docs/pages/joy-ui/api/select.js index 2aee4a53ac36ce..0f6db7ac41ed14 100644 --- a/docs/pages/joy-ui/api/select.js +++ b/docs/pages/joy-ui/api/select.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/select', false, /select.*.json$/); + const req = require.context('docs/translations/api-docs-joy/select', false, /\.\/select.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/select.json b/docs/pages/joy-ui/api/select.json index 08089b351e4cc8..9ce6f97f23e235 100644 --- a/docs/pages/joy-ui/api/select.json +++ b/docs/pages/joy-ui/api/select.json @@ -6,23 +6,24 @@ "description": "func
| { current?: { focusVisible: func } }" } }, - "autoFocus": { "type": { "name": "bool" } }, + "autoFocus": { "type": { "name": "bool" }, "default": "false" }, "color": { "type": { "name": "union", "description": "'danger'
| 'neutral'
| 'primary'
| 'success'
| 'warning'
| string" }, + "default": "'neutral'", "additionalInfo": { "joy-color": true } }, "component": { "type": { "name": "elementType" } }, - "defaultListboxOpen": { "type": { "name": "bool" } }, + "defaultListboxOpen": { "type": { "name": "bool" }, "default": "false" }, "defaultValue": { "type": { "name": "any" } }, - "disabled": { "type": { "name": "bool" } }, + "disabled": { "type": { "name": "bool" }, "default": "false" }, "endDecorator": { "type": { "name": "node" } }, "getSerializedValue": { "type": { "name": "func" } }, "indicator": { "type": { "name": "node" } }, "listboxId": { "type": { "name": "string" } }, - "listboxOpen": { "type": { "name": "bool" } }, + "listboxOpen": { "type": { "name": "bool" }, "default": "undefined" }, "multiple": { "type": { "name": "bool" } }, "name": { "type": { "name": "string" } }, "onChange": { "type": { "name": "func" } }, @@ -30,7 +31,7 @@ "onListboxOpenChange": { "type": { "name": "func" } }, "placeholder": { "type": { "name": "node" } }, "renderValue": { "type": { "name": "func" } }, - "required": { "type": { "name": "bool" } }, + "required": { "type": { "name": "bool" }, "default": "false" }, "size": { "type": { "name": "union", @@ -43,6 +44,7 @@ "name": "shape", "description": "{ button?: elementType, endDecorator?: elementType, indicator?: elementType, listbox?: elementType, root?: elementType, startDecorator?: elementType }" }, + "default": "{}", "additionalInfo": { "slotsApi": true } }, "startDecorator": { "type": { "name": "node" } }, @@ -59,6 +61,7 @@ "name": "union", "description": "'outlined'
| 'plain'
| 'soft'
| 'solid'
| string" }, + "default": "'outlined'", "additionalInfo": { "joy-variant": true } } }, diff --git a/docs/pages/joy-ui/api/sheet.js b/docs/pages/joy-ui/api/sheet.js index 01e2356cf17d4e..61af2d2362a748 100644 --- a/docs/pages/joy-ui/api/sheet.js +++ b/docs/pages/joy-ui/api/sheet.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/sheet', false, /sheet.*.json$/); + const req = require.context('docs/translations/api-docs-joy/sheet', false, /\.\/sheet.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/skeleton.js b/docs/pages/joy-ui/api/skeleton.js index d9dd6fb5e0e29d..355cd9e52fc2d8 100644 --- a/docs/pages/joy-ui/api/skeleton.js +++ b/docs/pages/joy-ui/api/skeleton.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/skeleton', false, /skeleton.*.json$/); + const req = require.context( + 'docs/translations/api-docs-joy/skeleton', + false, + /\.\/skeleton.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/slider.js b/docs/pages/joy-ui/api/slider.js index 8b09d18829b5fa..66cb9ea629a8e2 100644 --- a/docs/pages/joy-ui/api/slider.js +++ b/docs/pages/joy-ui/api/slider.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/slider', false, /slider.*.json$/); + const req = require.context('docs/translations/api-docs-joy/slider', false, /\.\/slider.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/snackbar.js b/docs/pages/joy-ui/api/snackbar.js index 025d0c4d798970..7d6d61a350d1c5 100644 --- a/docs/pages/joy-ui/api/snackbar.js +++ b/docs/pages/joy-ui/api/snackbar.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/snackbar', false, /snackbar.*.json$/); + const req = require.context( + 'docs/translations/api-docs-joy/snackbar', + false, + /\.\/snackbar.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/stack.js b/docs/pages/joy-ui/api/stack.js index fb0d64b8ba91a4..44ee7dca3bdd96 100644 --- a/docs/pages/joy-ui/api/stack.js +++ b/docs/pages/joy-ui/api/stack.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/stack', false, /stack.*.json$/); + const req = require.context('docs/translations/api-docs-joy/stack', false, /\.\/stack.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/step-button.js b/docs/pages/joy-ui/api/step-button.js index 8c8bdc04ad2134..29e49d7964102a 100644 --- a/docs/pages/joy-ui/api/step-button.js +++ b/docs/pages/joy-ui/api/step-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/step-button', false, - /step-button.*.json$/, + /\.\/step-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/step-indicator.js b/docs/pages/joy-ui/api/step-indicator.js index 066bdc23276264..2cf917bd9ebb18 100644 --- a/docs/pages/joy-ui/api/step-indicator.js +++ b/docs/pages/joy-ui/api/step-indicator.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/step-indicator', false, - /step-indicator.*.json$/, + /\.\/step-indicator.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/step.js b/docs/pages/joy-ui/api/step.js index 951d1b6a725473..68ec47b8519c88 100644 --- a/docs/pages/joy-ui/api/step.js +++ b/docs/pages/joy-ui/api/step.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/step', false, /step.*.json$/); + const req = require.context('docs/translations/api-docs-joy/step', false, /\.\/step.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/stepper.js b/docs/pages/joy-ui/api/stepper.js index a9c917ce4ab330..718872f62dfce6 100644 --- a/docs/pages/joy-ui/api/stepper.js +++ b/docs/pages/joy-ui/api/stepper.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/stepper', false, /stepper.*.json$/); + const req = require.context( + 'docs/translations/api-docs-joy/stepper', + false, + /\.\/stepper.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/svg-icon.js b/docs/pages/joy-ui/api/svg-icon.js index 5587325c7a8351..4f314a093b3821 100644 --- a/docs/pages/joy-ui/api/svg-icon.js +++ b/docs/pages/joy-ui/api/svg-icon.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/svg-icon', false, /svg-icon.*.json$/); + const req = require.context( + 'docs/translations/api-docs-joy/svg-icon', + false, + /\.\/svg-icon.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/switch.js b/docs/pages/joy-ui/api/switch.js index 251a53ea2dde37..fc769a058144a8 100644 --- a/docs/pages/joy-ui/api/switch.js +++ b/docs/pages/joy-ui/api/switch.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/switch', false, /switch.*.json$/); + const req = require.context('docs/translations/api-docs-joy/switch', false, /\.\/switch.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/tab-list.js b/docs/pages/joy-ui/api/tab-list.js index 05c1990d59aca3..0ddb09b314dff4 100644 --- a/docs/pages/joy-ui/api/tab-list.js +++ b/docs/pages/joy-ui/api/tab-list.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/tab-list', false, /tab-list.*.json$/); + const req = require.context( + 'docs/translations/api-docs-joy/tab-list', + false, + /\.\/tab-list.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/tab-panel.js b/docs/pages/joy-ui/api/tab-panel.js index a3ad5d3d2b35d0..1e5a18fee976c6 100644 --- a/docs/pages/joy-ui/api/tab-panel.js +++ b/docs/pages/joy-ui/api/tab-panel.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/tab-panel', false, - /tab-panel.*.json$/, + /\.\/tab-panel.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/tab.js b/docs/pages/joy-ui/api/tab.js index 946f0bad09c092..e54297471d7456 100644 --- a/docs/pages/joy-ui/api/tab.js +++ b/docs/pages/joy-ui/api/tab.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/tab', false, /tab.*.json$/); + const req = require.context('docs/translations/api-docs-joy/tab', false, /\.\/tab.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/table.js b/docs/pages/joy-ui/api/table.js index f72830a7e92af2..5724eedaf053c2 100644 --- a/docs/pages/joy-ui/api/table.js +++ b/docs/pages/joy-ui/api/table.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/table', false, /table.*.json$/); + const req = require.context('docs/translations/api-docs-joy/table', false, /\.\/table.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/tabs.js b/docs/pages/joy-ui/api/tabs.js index 88c7dbafee813f..aef2ec7ea41d84 100644 --- a/docs/pages/joy-ui/api/tabs.js +++ b/docs/pages/joy-ui/api/tabs.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/tabs', false, /tabs.*.json$/); + const req = require.context('docs/translations/api-docs-joy/tabs', false, /\.\/tabs.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/textarea.js b/docs/pages/joy-ui/api/textarea.js index 4acc6adc593e90..c06359829e79bd 100644 --- a/docs/pages/joy-ui/api/textarea.js +++ b/docs/pages/joy-ui/api/textarea.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/textarea', false, /textarea.*.json$/); + const req = require.context( + 'docs/translations/api-docs-joy/textarea', + false, + /\.\/textarea.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/textarea.json b/docs/pages/joy-ui/api/textarea.json index 4f599c79def98f..cec0301b8887bb 100644 --- a/docs/pages/joy-ui/api/textarea.json +++ b/docs/pages/joy-ui/api/textarea.json @@ -5,17 +5,22 @@ "name": "union", "description": "'danger'
| 'neutral'
| 'primary'
| 'success'
| 'warning'
| string" }, + "default": "'neutral'", "additionalInfo": { "joy-color": true } }, "endDecorator": { "type": { "name": "node" } }, - "error": { "type": { "name": "bool" } }, + "error": { "type": { "name": "bool" }, "default": "false" }, "maxRows": { "type": { "name": "union", "description": "number
| string" } }, - "minRows": { "type": { "name": "union", "description": "number
| string" } }, + "minRows": { + "type": { "name": "union", "description": "number
| string" }, + "default": "1" + }, "size": { "type": { "name": "union", "description": "'sm'
| 'md'
| 'lg'
| string" }, + "default": "'md'", "additionalInfo": { "joy-size": true } }, "startDecorator": { "type": { "name": "node" } }, @@ -31,6 +36,7 @@ "name": "union", "description": "'outlined'
| 'plain'
| 'soft'
| 'solid'
| string" }, + "default": "'outlined'", "additionalInfo": { "joy-variant": true } } }, diff --git a/docs/pages/joy-ui/api/toggle-button-group.js b/docs/pages/joy-ui/api/toggle-button-group.js index 610191991d8850..21d3f75a52f0e2 100644 --- a/docs/pages/joy-ui/api/toggle-button-group.js +++ b/docs/pages/joy-ui/api/toggle-button-group.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/toggle-button-group', false, - /toggle-button-group.*.json$/, + /\.\/toggle-button-group.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/joy-ui/api/tooltip.js b/docs/pages/joy-ui/api/tooltip.js index 50d17684416fb8..28ed606c703822 100644 --- a/docs/pages/joy-ui/api/tooltip.js +++ b/docs/pages/joy-ui/api/tooltip.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs-joy/tooltip', false, /tooltip.*.json$/); + const req = require.context( + 'docs/translations/api-docs-joy/tooltip', + false, + /\.\/tooltip.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/joy-ui/api/typography.js b/docs/pages/joy-ui/api/typography.js index d159b1190f218d..30b8b905bc1dda 100644 --- a/docs/pages/joy-ui/api/typography.js +++ b/docs/pages/joy-ui/api/typography.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs-joy/typography', false, - /typography.*.json$/, + /\.\/typography.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/accordion-actions.js b/docs/pages/material-ui/api/accordion-actions.js index 13a77185c60034..daa77e98bf1612 100644 --- a/docs/pages/material-ui/api/accordion-actions.js +++ b/docs/pages/material-ui/api/accordion-actions.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/accordion-actions', false, - /accordion-actions.*.json$/, + /\.\/accordion-actions.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/accordion-details.js b/docs/pages/material-ui/api/accordion-details.js index 45a6e6c1a1dd27..96bafdd62f2cc9 100644 --- a/docs/pages/material-ui/api/accordion-details.js +++ b/docs/pages/material-ui/api/accordion-details.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/accordion-details', false, - /accordion-details.*.json$/, + /\.\/accordion-details.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/accordion-summary.js b/docs/pages/material-ui/api/accordion-summary.js index 6a839d5299092b..de567814596092 100644 --- a/docs/pages/material-ui/api/accordion-summary.js +++ b/docs/pages/material-ui/api/accordion-summary.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/accordion-summary', false, - /accordion-summary.*.json$/, + /\.\/accordion-summary.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/accordion.js b/docs/pages/material-ui/api/accordion.js index e7c7493341e74e..72eca9a56f97fc 100644 --- a/docs/pages/material-ui/api/accordion.js +++ b/docs/pages/material-ui/api/accordion.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/accordion', false, /accordion.*.json$/); + const req = require.context( + 'docs/translations/api-docs/accordion', + false, + /\.\/accordion.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/alert-title.js b/docs/pages/material-ui/api/alert-title.js index 4f2857a425a848..920586724e9ed7 100644 --- a/docs/pages/material-ui/api/alert-title.js +++ b/docs/pages/material-ui/api/alert-title.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/alert-title', false, - /alert-title.*.json$/, + /\.\/alert-title.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/alert.js b/docs/pages/material-ui/api/alert.js index f676f9ab4475f1..6e8c685a11348c 100644 --- a/docs/pages/material-ui/api/alert.js +++ b/docs/pages/material-ui/api/alert.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/alert', false, /alert.*.json$/); + const req = require.context('docs/translations/api-docs/alert', false, /\.\/alert.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/app-bar.js b/docs/pages/material-ui/api/app-bar.js index 8561ec72d598ca..e8ea6b7ef9d93d 100644 --- a/docs/pages/material-ui/api/app-bar.js +++ b/docs/pages/material-ui/api/app-bar.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/app-bar', false, /app-bar.*.json$/); + const req = require.context('docs/translations/api-docs/app-bar', false, /\.\/app-bar.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/autocomplete.js b/docs/pages/material-ui/api/autocomplete.js index ea7bc74e15919f..677e037ca48031 100644 --- a/docs/pages/material-ui/api/autocomplete.js +++ b/docs/pages/material-ui/api/autocomplete.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/autocomplete', false, - /autocomplete.*.json$/, + /\.\/autocomplete.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/avatar-group.js b/docs/pages/material-ui/api/avatar-group.js index b1e7dd07841f4d..3b396d7a6747a1 100644 --- a/docs/pages/material-ui/api/avatar-group.js +++ b/docs/pages/material-ui/api/avatar-group.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/avatar-group', false, - /avatar-group.*.json$/, + /\.\/avatar-group.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/avatar.js b/docs/pages/material-ui/api/avatar.js index ff34aacf10fd9a..2e1624ac534909 100644 --- a/docs/pages/material-ui/api/avatar.js +++ b/docs/pages/material-ui/api/avatar.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/avatar', false, /avatar.*.json$/); + const req = require.context('docs/translations/api-docs/avatar', false, /\.\/avatar.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/backdrop.js b/docs/pages/material-ui/api/backdrop.js index baf12c7816e927..b50c0688dbeb55 100644 --- a/docs/pages/material-ui/api/backdrop.js +++ b/docs/pages/material-ui/api/backdrop.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/backdrop', false, /backdrop.*.json$/); + const req = require.context('docs/translations/api-docs/backdrop', false, /\.\/backdrop.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/badge.js b/docs/pages/material-ui/api/badge.js index 18d7387490b512..4e724bf443e326 100644 --- a/docs/pages/material-ui/api/badge.js +++ b/docs/pages/material-ui/api/badge.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/badge', false, /badge.*.json$/); + const req = require.context('docs/translations/api-docs/badge', false, /\.\/badge.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/bottom-navigation-action.js b/docs/pages/material-ui/api/bottom-navigation-action.js index ab6be65e640c4b..a5701c57e895ea 100644 --- a/docs/pages/material-ui/api/bottom-navigation-action.js +++ b/docs/pages/material-ui/api/bottom-navigation-action.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/bottom-navigation-action', false, - /bottom-navigation-action.*.json$/, + /\.\/bottom-navigation-action.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/bottom-navigation.js b/docs/pages/material-ui/api/bottom-navigation.js index 7f3a08fc9be03b..f0fcd5be82c6f4 100644 --- a/docs/pages/material-ui/api/bottom-navigation.js +++ b/docs/pages/material-ui/api/bottom-navigation.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/bottom-navigation', false, - /bottom-navigation.*.json$/, + /\.\/bottom-navigation.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/box.js b/docs/pages/material-ui/api/box.js index 75bdf6fcffccf1..476c932ffc5819 100644 --- a/docs/pages/material-ui/api/box.js +++ b/docs/pages/material-ui/api/box.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/box', false, /box.*.json$/); + const req = require.context('docs/translations/api-docs/box', false, /\.\/box.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/breadcrumbs.js b/docs/pages/material-ui/api/breadcrumbs.js index 4fe89696f281ae..bea76e277dbc72 100644 --- a/docs/pages/material-ui/api/breadcrumbs.js +++ b/docs/pages/material-ui/api/breadcrumbs.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/breadcrumbs', false, - /breadcrumbs.*.json$/, + /\.\/breadcrumbs.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/button-base.js b/docs/pages/material-ui/api/button-base.js index 7009686d56d9a6..4b0b45a150a9ec 100644 --- a/docs/pages/material-ui/api/button-base.js +++ b/docs/pages/material-ui/api/button-base.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/button-base', false, - /button-base.*.json$/, + /\.\/button-base.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/button-group.js b/docs/pages/material-ui/api/button-group.js index 299fc115987c7d..6d686a978294fd 100644 --- a/docs/pages/material-ui/api/button-group.js +++ b/docs/pages/material-ui/api/button-group.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/button-group', false, - /button-group.*.json$/, + /\.\/button-group.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/button.js b/docs/pages/material-ui/api/button.js index 66ad9f22ef0c47..981d250098dcbd 100644 --- a/docs/pages/material-ui/api/button.js +++ b/docs/pages/material-ui/api/button.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/button', false, /button.*.json$/); + const req = require.context('docs/translations/api-docs/button', false, /\.\/button.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/card-action-area.js b/docs/pages/material-ui/api/card-action-area.js index 2d5d48421a9fe8..2f33db55f3952c 100644 --- a/docs/pages/material-ui/api/card-action-area.js +++ b/docs/pages/material-ui/api/card-action-area.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/card-action-area', false, - /card-action-area.*.json$/, + /\.\/card-action-area.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/card-actions.js b/docs/pages/material-ui/api/card-actions.js index 5ddab04b03f55d..9f83ba2ed6e126 100644 --- a/docs/pages/material-ui/api/card-actions.js +++ b/docs/pages/material-ui/api/card-actions.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/card-actions', false, - /card-actions.*.json$/, + /\.\/card-actions.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/card-content.js b/docs/pages/material-ui/api/card-content.js index f8529aba2bbde4..8bc71044bb7a1c 100644 --- a/docs/pages/material-ui/api/card-content.js +++ b/docs/pages/material-ui/api/card-content.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/card-content', false, - /card-content.*.json$/, + /\.\/card-content.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/card-header.js b/docs/pages/material-ui/api/card-header.js index 30f53f92e8afb4..d4b52a74306c54 100644 --- a/docs/pages/material-ui/api/card-header.js +++ b/docs/pages/material-ui/api/card-header.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/card-header', false, - /card-header.*.json$/, + /\.\/card-header.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/card-media.js b/docs/pages/material-ui/api/card-media.js index 44b47d5b087acd..8a2dad7d96aa60 100644 --- a/docs/pages/material-ui/api/card-media.js +++ b/docs/pages/material-ui/api/card-media.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/card-media', false, /card-media.*.json$/); + const req = require.context( + 'docs/translations/api-docs/card-media', + false, + /\.\/card-media.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/card.js b/docs/pages/material-ui/api/card.js index 91bcc50d89eac4..bc2b79bd79d501 100644 --- a/docs/pages/material-ui/api/card.js +++ b/docs/pages/material-ui/api/card.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/card', false, /card.*.json$/); + const req = require.context('docs/translations/api-docs/card', false, /\.\/card.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/checkbox.js b/docs/pages/material-ui/api/checkbox.js index 90a006ee745260..8ef7ae91394939 100644 --- a/docs/pages/material-ui/api/checkbox.js +++ b/docs/pages/material-ui/api/checkbox.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/checkbox', false, /checkbox.*.json$/); + const req = require.context('docs/translations/api-docs/checkbox', false, /\.\/checkbox.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/chip.js b/docs/pages/material-ui/api/chip.js index dce59e6ca9c489..51e6136ac11552 100644 --- a/docs/pages/material-ui/api/chip.js +++ b/docs/pages/material-ui/api/chip.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/chip', false, /chip.*.json$/); + const req = require.context('docs/translations/api-docs/chip', false, /\.\/chip.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/circular-progress.js b/docs/pages/material-ui/api/circular-progress.js index 3c1f447e891e4d..a3332e6912c459 100644 --- a/docs/pages/material-ui/api/circular-progress.js +++ b/docs/pages/material-ui/api/circular-progress.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/circular-progress', false, - /circular-progress.*.json$/, + /\.\/circular-progress.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/collapse.js b/docs/pages/material-ui/api/collapse.js index 0f082f387e96ba..6c71a92b3e4bf3 100644 --- a/docs/pages/material-ui/api/collapse.js +++ b/docs/pages/material-ui/api/collapse.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/collapse', false, /collapse.*.json$/); + const req = require.context('docs/translations/api-docs/collapse', false, /\.\/collapse.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/container.js b/docs/pages/material-ui/api/container.js index 93a80589d308f5..bb6b55f6601af5 100644 --- a/docs/pages/material-ui/api/container.js +++ b/docs/pages/material-ui/api/container.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/container', false, /container.*.json$/); + const req = require.context( + 'docs/translations/api-docs/container', + false, + /\.\/container.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/css-baseline.js b/docs/pages/material-ui/api/css-baseline.js index 6bb60d8ee9f04c..65165dae53fca7 100644 --- a/docs/pages/material-ui/api/css-baseline.js +++ b/docs/pages/material-ui/api/css-baseline.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/css-baseline', false, - /css-baseline.*.json$/, + /\.\/css-baseline.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/dialog-actions.js b/docs/pages/material-ui/api/dialog-actions.js index e8496d951c3a47..d82a668745b059 100644 --- a/docs/pages/material-ui/api/dialog-actions.js +++ b/docs/pages/material-ui/api/dialog-actions.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/dialog-actions', false, - /dialog-actions.*.json$/, + /\.\/dialog-actions.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/dialog-content-text.js b/docs/pages/material-ui/api/dialog-content-text.js index ad681a675de8aa..74c81709d4f5ff 100644 --- a/docs/pages/material-ui/api/dialog-content-text.js +++ b/docs/pages/material-ui/api/dialog-content-text.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/dialog-content-text', false, - /dialog-content-text.*.json$/, + /\.\/dialog-content-text.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/dialog-content.js b/docs/pages/material-ui/api/dialog-content.js index 8d5c951eb5ded3..df4ed11984163b 100644 --- a/docs/pages/material-ui/api/dialog-content.js +++ b/docs/pages/material-ui/api/dialog-content.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/dialog-content', false, - /dialog-content.*.json$/, + /\.\/dialog-content.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/dialog-title.js b/docs/pages/material-ui/api/dialog-title.js index c2c903c68af88f..b4968de23ea606 100644 --- a/docs/pages/material-ui/api/dialog-title.js +++ b/docs/pages/material-ui/api/dialog-title.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/dialog-title', false, - /dialog-title.*.json$/, + /\.\/dialog-title.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/dialog.js b/docs/pages/material-ui/api/dialog.js index a6778ff8d9522a..7c47570b42f35b 100644 --- a/docs/pages/material-ui/api/dialog.js +++ b/docs/pages/material-ui/api/dialog.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/dialog', false, /dialog.*.json$/); + const req = require.context('docs/translations/api-docs/dialog', false, /\.\/dialog.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/divider.js b/docs/pages/material-ui/api/divider.js index 72044e9d17d343..efc22c3db47ea6 100644 --- a/docs/pages/material-ui/api/divider.js +++ b/docs/pages/material-ui/api/divider.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/divider', false, /divider.*.json$/); + const req = require.context('docs/translations/api-docs/divider', false, /\.\/divider.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/drawer.js b/docs/pages/material-ui/api/drawer.js index 9d101af9bb255f..f7eb620e50ca56 100644 --- a/docs/pages/material-ui/api/drawer.js +++ b/docs/pages/material-ui/api/drawer.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/drawer', false, /drawer.*.json$/); + const req = require.context('docs/translations/api-docs/drawer', false, /\.\/drawer.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/fab.js b/docs/pages/material-ui/api/fab.js index 87c27f69a4af94..01e75d02c36ed5 100644 --- a/docs/pages/material-ui/api/fab.js +++ b/docs/pages/material-ui/api/fab.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/fab', false, /fab.*.json$/); + const req = require.context('docs/translations/api-docs/fab', false, /\.\/fab.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/fade.js b/docs/pages/material-ui/api/fade.js index 432e7f2dba55f8..a5ee08308f3b34 100644 --- a/docs/pages/material-ui/api/fade.js +++ b/docs/pages/material-ui/api/fade.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/fade', false, /fade.*.json$/); + const req = require.context('docs/translations/api-docs/fade', false, /\.\/fade.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/filled-input.js b/docs/pages/material-ui/api/filled-input.js index 60a02594773f1e..4425826e1ab794 100644 --- a/docs/pages/material-ui/api/filled-input.js +++ b/docs/pages/material-ui/api/filled-input.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/filled-input', false, - /filled-input.*.json$/, + /\.\/filled-input.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/form-control-label.js b/docs/pages/material-ui/api/form-control-label.js index 1e6dd123900dc4..eeb7980a7b11bb 100644 --- a/docs/pages/material-ui/api/form-control-label.js +++ b/docs/pages/material-ui/api/form-control-label.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/form-control-label', false, - /form-control-label.*.json$/, + /\.\/form-control-label.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/form-control.js b/docs/pages/material-ui/api/form-control.js index 380d4f46e73625..4b2275fb71b2e4 100644 --- a/docs/pages/material-ui/api/form-control.js +++ b/docs/pages/material-ui/api/form-control.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/form-control', false, - /form-control.*.json$/, + /\.\/form-control.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/form-group.js b/docs/pages/material-ui/api/form-group.js index 566fe3c5a58228..0534842365927f 100644 --- a/docs/pages/material-ui/api/form-group.js +++ b/docs/pages/material-ui/api/form-group.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/form-group', false, /form-group.*.json$/); + const req = require.context( + 'docs/translations/api-docs/form-group', + false, + /\.\/form-group.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/form-helper-text.js b/docs/pages/material-ui/api/form-helper-text.js index f90e49d2cff7d3..6b37d4bca2e6dd 100644 --- a/docs/pages/material-ui/api/form-helper-text.js +++ b/docs/pages/material-ui/api/form-helper-text.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/form-helper-text', false, - /form-helper-text.*.json$/, + /\.\/form-helper-text.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/form-label.js b/docs/pages/material-ui/api/form-label.js index 029a4b5d721a95..c3362eae2bd619 100644 --- a/docs/pages/material-ui/api/form-label.js +++ b/docs/pages/material-ui/api/form-label.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/form-label', false, /form-label.*.json$/); + const req = require.context( + 'docs/translations/api-docs/form-label', + false, + /\.\/form-label.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/global-styles.js b/docs/pages/material-ui/api/global-styles.js index 6bdec72a6ca6ca..ed5b23cd24ce68 100644 --- a/docs/pages/material-ui/api/global-styles.js +++ b/docs/pages/material-ui/api/global-styles.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/global-styles', false, - /global-styles.*.json$/, + /\.\/global-styles.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/grid.js b/docs/pages/material-ui/api/grid.js index 1296f5b5bebc49..b365259b168867 100644 --- a/docs/pages/material-ui/api/grid.js +++ b/docs/pages/material-ui/api/grid.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/grid', false, /grid.*.json$/); + const req = require.context('docs/translations/api-docs/grid', false, /\.\/grid.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/grow.js b/docs/pages/material-ui/api/grow.js index 1df51b550b946d..af2a1b4ac33229 100644 --- a/docs/pages/material-ui/api/grow.js +++ b/docs/pages/material-ui/api/grow.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/grow', false, /grow.*.json$/); + const req = require.context('docs/translations/api-docs/grow', false, /\.\/grow.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/hidden.js b/docs/pages/material-ui/api/hidden.js index f04b85a8271521..d9d52da34aba5a 100644 --- a/docs/pages/material-ui/api/hidden.js +++ b/docs/pages/material-ui/api/hidden.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/hidden', false, /hidden.*.json$/); + const req = require.context('docs/translations/api-docs/hidden', false, /\.\/hidden.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/icon-button.js b/docs/pages/material-ui/api/icon-button.js index 8d880c94791f40..011b3a5db7d38a 100644 --- a/docs/pages/material-ui/api/icon-button.js +++ b/docs/pages/material-ui/api/icon-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/icon-button', false, - /icon-button.*.json$/, + /\.\/icon-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/icon.js b/docs/pages/material-ui/api/icon.js index be7ffef1ccf73e..cde493441e312e 100644 --- a/docs/pages/material-ui/api/icon.js +++ b/docs/pages/material-ui/api/icon.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/icon', false, /icon.*.json$/); + const req = require.context('docs/translations/api-docs/icon', false, /\.\/icon.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/image-list-item-bar.js b/docs/pages/material-ui/api/image-list-item-bar.js index 5211ac3a86feab..5d8e6b2baebbe2 100644 --- a/docs/pages/material-ui/api/image-list-item-bar.js +++ b/docs/pages/material-ui/api/image-list-item-bar.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/image-list-item-bar', false, - /image-list-item-bar.*.json$/, + /\.\/image-list-item-bar.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/image-list-item.js b/docs/pages/material-ui/api/image-list-item.js index 673fbd583080d8..fef46c9ad261a3 100644 --- a/docs/pages/material-ui/api/image-list-item.js +++ b/docs/pages/material-ui/api/image-list-item.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/image-list-item', false, - /image-list-item.*.json$/, + /\.\/image-list-item.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/image-list.js b/docs/pages/material-ui/api/image-list.js index a73f16c7ca19e3..36d209f2e2a56e 100644 --- a/docs/pages/material-ui/api/image-list.js +++ b/docs/pages/material-ui/api/image-list.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/image-list', false, /image-list.*.json$/); + const req = require.context( + 'docs/translations/api-docs/image-list', + false, + /\.\/image-list.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/input-adornment.js b/docs/pages/material-ui/api/input-adornment.js index 993bcbc2de6bce..cccf601bd1ae45 100644 --- a/docs/pages/material-ui/api/input-adornment.js +++ b/docs/pages/material-ui/api/input-adornment.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/input-adornment', false, - /input-adornment.*.json$/, + /\.\/input-adornment.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/input-base.js b/docs/pages/material-ui/api/input-base.js index 88dd5eb750bb20..f132a568328587 100644 --- a/docs/pages/material-ui/api/input-base.js +++ b/docs/pages/material-ui/api/input-base.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/input-base', false, /input-base.*.json$/); + const req = require.context( + 'docs/translations/api-docs/input-base', + false, + /\.\/input-base.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/input-label.js b/docs/pages/material-ui/api/input-label.js index 7cb3db0b533243..b9bc0d9c21294d 100644 --- a/docs/pages/material-ui/api/input-label.js +++ b/docs/pages/material-ui/api/input-label.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/input-label', false, - /input-label.*.json$/, + /\.\/input-label.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/input.js b/docs/pages/material-ui/api/input.js index e23210a40a1e98..e87049b94546bd 100644 --- a/docs/pages/material-ui/api/input.js +++ b/docs/pages/material-ui/api/input.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/input', false, /input.*.json$/); + const req = require.context('docs/translations/api-docs/input', false, /\.\/input.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/linear-progress.js b/docs/pages/material-ui/api/linear-progress.js index 9a53abc65ef7bf..4b9a5b47b182bb 100644 --- a/docs/pages/material-ui/api/linear-progress.js +++ b/docs/pages/material-ui/api/linear-progress.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/linear-progress', false, - /linear-progress.*.json$/, + /\.\/linear-progress.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/link.js b/docs/pages/material-ui/api/link.js index 169cf91892fca4..4ef035e36316e1 100644 --- a/docs/pages/material-ui/api/link.js +++ b/docs/pages/material-ui/api/link.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/link', false, /link.*.json$/); + const req = require.context('docs/translations/api-docs/link', false, /\.\/link.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/list-item-avatar.js b/docs/pages/material-ui/api/list-item-avatar.js index 3f10617d024366..3332447547cef2 100644 --- a/docs/pages/material-ui/api/list-item-avatar.js +++ b/docs/pages/material-ui/api/list-item-avatar.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/list-item-avatar', false, - /list-item-avatar.*.json$/, + /\.\/list-item-avatar.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/list-item-button.js b/docs/pages/material-ui/api/list-item-button.js index a9307d09e55004..c343b32638b4f2 100644 --- a/docs/pages/material-ui/api/list-item-button.js +++ b/docs/pages/material-ui/api/list-item-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/list-item-button', false, - /list-item-button.*.json$/, + /\.\/list-item-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/list-item-icon.js b/docs/pages/material-ui/api/list-item-icon.js index 76077b18848509..ac46706167c5c3 100644 --- a/docs/pages/material-ui/api/list-item-icon.js +++ b/docs/pages/material-ui/api/list-item-icon.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/list-item-icon', false, - /list-item-icon.*.json$/, + /\.\/list-item-icon.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/list-item-secondary-action.js b/docs/pages/material-ui/api/list-item-secondary-action.js index 2a5cc7fbb9114c..ad37eb33473977 100644 --- a/docs/pages/material-ui/api/list-item-secondary-action.js +++ b/docs/pages/material-ui/api/list-item-secondary-action.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/list-item-secondary-action', false, - /list-item-secondary-action.*.json$/, + /\.\/list-item-secondary-action.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/list-item-text.js b/docs/pages/material-ui/api/list-item-text.js index 639bf182724fcc..3088bcd762f13b 100644 --- a/docs/pages/material-ui/api/list-item-text.js +++ b/docs/pages/material-ui/api/list-item-text.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/list-item-text', false, - /list-item-text.*.json$/, + /\.\/list-item-text.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/list-item.js b/docs/pages/material-ui/api/list-item.js index 4fc2f704505775..b2ee97b906cf79 100644 --- a/docs/pages/material-ui/api/list-item.js +++ b/docs/pages/material-ui/api/list-item.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/list-item', false, /list-item.*.json$/); + const req = require.context( + 'docs/translations/api-docs/list-item', + false, + /\.\/list-item.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/list-subheader.js b/docs/pages/material-ui/api/list-subheader.js index 76f688f634b7b4..df8673c2c8bc89 100644 --- a/docs/pages/material-ui/api/list-subheader.js +++ b/docs/pages/material-ui/api/list-subheader.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/list-subheader', false, - /list-subheader.*.json$/, + /\.\/list-subheader.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/list.js b/docs/pages/material-ui/api/list.js index f9e574b5dd8fee..6e86f49cb95db4 100644 --- a/docs/pages/material-ui/api/list.js +++ b/docs/pages/material-ui/api/list.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/list', false, /list.*.json$/); + const req = require.context('docs/translations/api-docs/list', false, /\.\/list.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/loading-button.js b/docs/pages/material-ui/api/loading-button.js index 3269e76e297553..cab581691ab572 100644 --- a/docs/pages/material-ui/api/loading-button.js +++ b/docs/pages/material-ui/api/loading-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/loading-button', false, - /loading-button.*.json$/, + /\.\/loading-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/masonry.js b/docs/pages/material-ui/api/masonry.js index 6fb94801e7b9ea..88aa9c6cbd15e8 100644 --- a/docs/pages/material-ui/api/masonry.js +++ b/docs/pages/material-ui/api/masonry.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/masonry', false, /masonry.*.json$/); + const req = require.context('docs/translations/api-docs/masonry', false, /\.\/masonry.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/menu-item.js b/docs/pages/material-ui/api/menu-item.js index 0ade9979d879a0..408feeacd0cf5f 100644 --- a/docs/pages/material-ui/api/menu-item.js +++ b/docs/pages/material-ui/api/menu-item.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/menu-item', false, /menu-item.*.json$/); + const req = require.context( + 'docs/translations/api-docs/menu-item', + false, + /\.\/menu-item.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/menu-list.js b/docs/pages/material-ui/api/menu-list.js index 98269ca9d3408e..bd86cfba032053 100644 --- a/docs/pages/material-ui/api/menu-list.js +++ b/docs/pages/material-ui/api/menu-list.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/menu-list', false, /menu-list.*.json$/); + const req = require.context( + 'docs/translations/api-docs/menu-list', + false, + /\.\/menu-list.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/menu.js b/docs/pages/material-ui/api/menu.js index 7ed6ff1f4cf692..cde0ff43839724 100644 --- a/docs/pages/material-ui/api/menu.js +++ b/docs/pages/material-ui/api/menu.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/menu', false, /menu.*.json$/); + const req = require.context('docs/translations/api-docs/menu', false, /\.\/menu.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/mobile-stepper.js b/docs/pages/material-ui/api/mobile-stepper.js index 01bed42f214cc9..c5179204b5e108 100644 --- a/docs/pages/material-ui/api/mobile-stepper.js +++ b/docs/pages/material-ui/api/mobile-stepper.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/mobile-stepper', false, - /mobile-stepper.*.json$/, + /\.\/mobile-stepper.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/modal.js b/docs/pages/material-ui/api/modal.js index d3c0a292b31b49..0289a7900feb48 100644 --- a/docs/pages/material-ui/api/modal.js +++ b/docs/pages/material-ui/api/modal.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/modal', false, /modal.*.json$/); + const req = require.context('docs/translations/api-docs/modal', false, /\.\/modal.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/native-select.js b/docs/pages/material-ui/api/native-select.js index 604a6d7c171740..25999ca3a99a65 100644 --- a/docs/pages/material-ui/api/native-select.js +++ b/docs/pages/material-ui/api/native-select.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/native-select', false, - /native-select.*.json$/, + /\.\/native-select.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/outlined-input.js b/docs/pages/material-ui/api/outlined-input.js index 3386ca24b906da..823e33c8dfb232 100644 --- a/docs/pages/material-ui/api/outlined-input.js +++ b/docs/pages/material-ui/api/outlined-input.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/outlined-input', false, - /outlined-input.*.json$/, + /\.\/outlined-input.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/pagination-item.js b/docs/pages/material-ui/api/pagination-item.js index 9bb2f1c0aa96eb..b5b40fe4228cd3 100644 --- a/docs/pages/material-ui/api/pagination-item.js +++ b/docs/pages/material-ui/api/pagination-item.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/pagination-item', false, - /pagination-item.*.json$/, + /\.\/pagination-item.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/pagination.js b/docs/pages/material-ui/api/pagination.js index a7282b3205e749..a2c779fc9dd9c4 100644 --- a/docs/pages/material-ui/api/pagination.js +++ b/docs/pages/material-ui/api/pagination.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/pagination', false, /pagination.*.json$/); + const req = require.context( + 'docs/translations/api-docs/pagination', + false, + /\.\/pagination.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/paper.js b/docs/pages/material-ui/api/paper.js index 2878477b12da74..9abf6097e6e6bb 100644 --- a/docs/pages/material-ui/api/paper.js +++ b/docs/pages/material-ui/api/paper.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/paper', false, /paper.*.json$/); + const req = require.context('docs/translations/api-docs/paper', false, /\.\/paper.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/popover.js b/docs/pages/material-ui/api/popover.js index 63e6c5e91b1102..65e3ca1b8ac693 100644 --- a/docs/pages/material-ui/api/popover.js +++ b/docs/pages/material-ui/api/popover.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/popover', false, /popover.*.json$/); + const req = require.context('docs/translations/api-docs/popover', false, /\.\/popover.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/popper.js b/docs/pages/material-ui/api/popper.js index 9bc6080274a4ed..7c17e56eb1e9d2 100644 --- a/docs/pages/material-ui/api/popper.js +++ b/docs/pages/material-ui/api/popper.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/popper', false, /popper.*.json$/); + const req = require.context('docs/translations/api-docs/popper', false, /\.\/popper.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/radio-group.js b/docs/pages/material-ui/api/radio-group.js index 3a7599262211b2..48e679cf801a02 100644 --- a/docs/pages/material-ui/api/radio-group.js +++ b/docs/pages/material-ui/api/radio-group.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/radio-group', false, - /radio-group.*.json$/, + /\.\/radio-group.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/radio.js b/docs/pages/material-ui/api/radio.js index f0280245c1d835..e8157153213760 100644 --- a/docs/pages/material-ui/api/radio.js +++ b/docs/pages/material-ui/api/radio.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/radio', false, /radio.*.json$/); + const req = require.context('docs/translations/api-docs/radio', false, /\.\/radio.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/rating.js b/docs/pages/material-ui/api/rating.js index 3b54bbdd3490c1..c2dafdaf72b9ad 100644 --- a/docs/pages/material-ui/api/rating.js +++ b/docs/pages/material-ui/api/rating.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/rating', false, /rating.*.json$/); + const req = require.context('docs/translations/api-docs/rating', false, /\.\/rating.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/scoped-css-baseline.js b/docs/pages/material-ui/api/scoped-css-baseline.js index 4cbb0177db7fc6..b8e4bde42c8210 100644 --- a/docs/pages/material-ui/api/scoped-css-baseline.js +++ b/docs/pages/material-ui/api/scoped-css-baseline.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/scoped-css-baseline', false, - /scoped-css-baseline.*.json$/, + /\.\/scoped-css-baseline.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/select.js b/docs/pages/material-ui/api/select.js index 42e65d0af26441..13691fa6c2e8db 100644 --- a/docs/pages/material-ui/api/select.js +++ b/docs/pages/material-ui/api/select.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/select', false, /select.*.json$/); + const req = require.context('docs/translations/api-docs/select', false, /\.\/select.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/skeleton.js b/docs/pages/material-ui/api/skeleton.js index fb52430c6430f0..f092dc21ec75d7 100644 --- a/docs/pages/material-ui/api/skeleton.js +++ b/docs/pages/material-ui/api/skeleton.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/skeleton', false, /skeleton.*.json$/); + const req = require.context('docs/translations/api-docs/skeleton', false, /\.\/skeleton.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/slide.js b/docs/pages/material-ui/api/slide.js index 1308dc23f43410..9d6f3eb24153ab 100644 --- a/docs/pages/material-ui/api/slide.js +++ b/docs/pages/material-ui/api/slide.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/slide', false, /slide.*.json$/); + const req = require.context('docs/translations/api-docs/slide', false, /\.\/slide.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/slider.js b/docs/pages/material-ui/api/slider.js index 768c767c931f60..623fba7265ed44 100644 --- a/docs/pages/material-ui/api/slider.js +++ b/docs/pages/material-ui/api/slider.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/slider', false, /slider.*.json$/); + const req = require.context('docs/translations/api-docs/slider', false, /\.\/slider.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/snackbar-content.js b/docs/pages/material-ui/api/snackbar-content.js index 13a17ab78660a8..ce230e77f06a16 100644 --- a/docs/pages/material-ui/api/snackbar-content.js +++ b/docs/pages/material-ui/api/snackbar-content.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/snackbar-content', false, - /snackbar-content.*.json$/, + /\.\/snackbar-content.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/snackbar.js b/docs/pages/material-ui/api/snackbar.js index bb2bdd8f5ef3c5..9654372f4bef68 100644 --- a/docs/pages/material-ui/api/snackbar.js +++ b/docs/pages/material-ui/api/snackbar.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/snackbar', false, /snackbar.*.json$/); + const req = require.context('docs/translations/api-docs/snackbar', false, /\.\/snackbar.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/speed-dial-action.js b/docs/pages/material-ui/api/speed-dial-action.js index bf366ee0e297b6..9527cbb8accaef 100644 --- a/docs/pages/material-ui/api/speed-dial-action.js +++ b/docs/pages/material-ui/api/speed-dial-action.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/speed-dial-action', false, - /speed-dial-action.*.json$/, + /\.\/speed-dial-action.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/speed-dial-icon.js b/docs/pages/material-ui/api/speed-dial-icon.js index 8e5990357a5ce5..95bbf71c602191 100644 --- a/docs/pages/material-ui/api/speed-dial-icon.js +++ b/docs/pages/material-ui/api/speed-dial-icon.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/speed-dial-icon', false, - /speed-dial-icon.*.json$/, + /\.\/speed-dial-icon.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/speed-dial.js b/docs/pages/material-ui/api/speed-dial.js index 5fc513d50aa52c..b65229e638ed18 100644 --- a/docs/pages/material-ui/api/speed-dial.js +++ b/docs/pages/material-ui/api/speed-dial.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/speed-dial', false, /speed-dial.*.json$/); + const req = require.context( + 'docs/translations/api-docs/speed-dial', + false, + /\.\/speed-dial.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/stack.js b/docs/pages/material-ui/api/stack.js index 9544e37c5e9ad1..0aa54fe96304e0 100644 --- a/docs/pages/material-ui/api/stack.js +++ b/docs/pages/material-ui/api/stack.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/stack', false, /stack.*.json$/); + const req = require.context('docs/translations/api-docs/stack', false, /\.\/stack.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/step-button.js b/docs/pages/material-ui/api/step-button.js index 6b31dd5f831881..eb7ca453f6e423 100644 --- a/docs/pages/material-ui/api/step-button.js +++ b/docs/pages/material-ui/api/step-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/step-button', false, - /step-button.*.json$/, + /\.\/step-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/step-connector.js b/docs/pages/material-ui/api/step-connector.js index 45facf4e996839..d2b6904e580374 100644 --- a/docs/pages/material-ui/api/step-connector.js +++ b/docs/pages/material-ui/api/step-connector.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/step-connector', false, - /step-connector.*.json$/, + /\.\/step-connector.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/step-content.js b/docs/pages/material-ui/api/step-content.js index a463bef47de7a3..7771265ddb4326 100644 --- a/docs/pages/material-ui/api/step-content.js +++ b/docs/pages/material-ui/api/step-content.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/step-content', false, - /step-content.*.json$/, + /\.\/step-content.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/step-icon.js b/docs/pages/material-ui/api/step-icon.js index ea3a730f8bb5d1..5ab5c473fb0725 100644 --- a/docs/pages/material-ui/api/step-icon.js +++ b/docs/pages/material-ui/api/step-icon.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/step-icon', false, /step-icon.*.json$/); + const req = require.context( + 'docs/translations/api-docs/step-icon', + false, + /\.\/step-icon.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/step-label.js b/docs/pages/material-ui/api/step-label.js index b9fee317f42de2..808f6e72fae203 100644 --- a/docs/pages/material-ui/api/step-label.js +++ b/docs/pages/material-ui/api/step-label.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/step-label', false, /step-label.*.json$/); + const req = require.context( + 'docs/translations/api-docs/step-label', + false, + /\.\/step-label.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/step.js b/docs/pages/material-ui/api/step.js index 92bdaa5be69963..aea91ceb86df6e 100644 --- a/docs/pages/material-ui/api/step.js +++ b/docs/pages/material-ui/api/step.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/step', false, /step.*.json$/); + const req = require.context('docs/translations/api-docs/step', false, /\.\/step.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/stepper.js b/docs/pages/material-ui/api/stepper.js index d8864a890c452c..e440aca7a04e11 100644 --- a/docs/pages/material-ui/api/stepper.js +++ b/docs/pages/material-ui/api/stepper.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/stepper', false, /stepper.*.json$/); + const req = require.context('docs/translations/api-docs/stepper', false, /\.\/stepper.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/svg-icon.js b/docs/pages/material-ui/api/svg-icon.js index 6353473c58fe18..837ae3a971c96c 100644 --- a/docs/pages/material-ui/api/svg-icon.js +++ b/docs/pages/material-ui/api/svg-icon.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/svg-icon', false, /svg-icon.*.json$/); + const req = require.context('docs/translations/api-docs/svg-icon', false, /\.\/svg-icon.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/swipeable-drawer.js b/docs/pages/material-ui/api/swipeable-drawer.js index 99e68e82869ce1..05025876692483 100644 --- a/docs/pages/material-ui/api/swipeable-drawer.js +++ b/docs/pages/material-ui/api/swipeable-drawer.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/swipeable-drawer', false, - /swipeable-drawer.*.json$/, + /\.\/swipeable-drawer.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/switch.js b/docs/pages/material-ui/api/switch.js index 6038ed77d88509..fd40f75f9067a1 100644 --- a/docs/pages/material-ui/api/switch.js +++ b/docs/pages/material-ui/api/switch.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/switch', false, /switch.*.json$/); + const req = require.context('docs/translations/api-docs/switch', false, /\.\/switch.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/tab-context.js b/docs/pages/material-ui/api/tab-context.js index 6804bbf50e0f4a..5b8a7313c89c4b 100644 --- a/docs/pages/material-ui/api/tab-context.js +++ b/docs/pages/material-ui/api/tab-context.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/tab-context', false, - /tab-context.*.json$/, + /\.\/tab-context.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/tab-list.js b/docs/pages/material-ui/api/tab-list.js index 922412b7c1ed55..aee0b773f572d6 100644 --- a/docs/pages/material-ui/api/tab-list.js +++ b/docs/pages/material-ui/api/tab-list.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/tab-list', false, /tab-list.*.json$/); + const req = require.context('docs/translations/api-docs/tab-list', false, /\.\/tab-list.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/tab-panel.js b/docs/pages/material-ui/api/tab-panel.js index f7a6710df28eb8..9804020cb8b4b5 100644 --- a/docs/pages/material-ui/api/tab-panel.js +++ b/docs/pages/material-ui/api/tab-panel.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/tab-panel', false, /tab-panel.*.json$/); + const req = require.context( + 'docs/translations/api-docs/tab-panel', + false, + /\.\/tab-panel.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/tab-scroll-button.js b/docs/pages/material-ui/api/tab-scroll-button.js index 783de4c58b0f5b..8270de8dd37faa 100644 --- a/docs/pages/material-ui/api/tab-scroll-button.js +++ b/docs/pages/material-ui/api/tab-scroll-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/tab-scroll-button', false, - /tab-scroll-button.*.json$/, + /\.\/tab-scroll-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/tab.js b/docs/pages/material-ui/api/tab.js index 9a39374793fe55..60c10405d50cda 100644 --- a/docs/pages/material-ui/api/tab.js +++ b/docs/pages/material-ui/api/tab.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/tab', false, /tab.*.json$/); + const req = require.context('docs/translations/api-docs/tab', false, /\.\/tab.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/table-body.js b/docs/pages/material-ui/api/table-body.js index 902358e8c62fea..c1520d8efb66d9 100644 --- a/docs/pages/material-ui/api/table-body.js +++ b/docs/pages/material-ui/api/table-body.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/table-body', false, /table-body.*.json$/); + const req = require.context( + 'docs/translations/api-docs/table-body', + false, + /\.\/table-body.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/table-cell.js b/docs/pages/material-ui/api/table-cell.js index 31bfb70e735a57..2241984f35740f 100644 --- a/docs/pages/material-ui/api/table-cell.js +++ b/docs/pages/material-ui/api/table-cell.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/table-cell', false, /table-cell.*.json$/); + const req = require.context( + 'docs/translations/api-docs/table-cell', + false, + /\.\/table-cell.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/table-container.js b/docs/pages/material-ui/api/table-container.js index cf9838abf1150c..0ee6a230877611 100644 --- a/docs/pages/material-ui/api/table-container.js +++ b/docs/pages/material-ui/api/table-container.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/table-container', false, - /table-container.*.json$/, + /\.\/table-container.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/table-footer.js b/docs/pages/material-ui/api/table-footer.js index 9a912d4a8a51fd..e7b0059f05657c 100644 --- a/docs/pages/material-ui/api/table-footer.js +++ b/docs/pages/material-ui/api/table-footer.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/table-footer', false, - /table-footer.*.json$/, + /\.\/table-footer.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/table-head.js b/docs/pages/material-ui/api/table-head.js index 50950a49074336..b2a093710f0cde 100644 --- a/docs/pages/material-ui/api/table-head.js +++ b/docs/pages/material-ui/api/table-head.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/table-head', false, /table-head.*.json$/); + const req = require.context( + 'docs/translations/api-docs/table-head', + false, + /\.\/table-head.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/table-pagination.js b/docs/pages/material-ui/api/table-pagination.js index 6c8dcdb450eec1..4bbfab99da478f 100644 --- a/docs/pages/material-ui/api/table-pagination.js +++ b/docs/pages/material-ui/api/table-pagination.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/table-pagination', false, - /table-pagination.*.json$/, + /\.\/table-pagination.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/table-row.js b/docs/pages/material-ui/api/table-row.js index bade79be756f9d..56b840dbaf1481 100644 --- a/docs/pages/material-ui/api/table-row.js +++ b/docs/pages/material-ui/api/table-row.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/table-row', false, /table-row.*.json$/); + const req = require.context( + 'docs/translations/api-docs/table-row', + false, + /\.\/table-row.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/table-sort-label.js b/docs/pages/material-ui/api/table-sort-label.js index 82cfebad2dabe1..b6fab15c9dac10 100644 --- a/docs/pages/material-ui/api/table-sort-label.js +++ b/docs/pages/material-ui/api/table-sort-label.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/table-sort-label', false, - /table-sort-label.*.json$/, + /\.\/table-sort-label.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/table.js b/docs/pages/material-ui/api/table.js index eac919239c9b5d..7dcf206732148f 100644 --- a/docs/pages/material-ui/api/table.js +++ b/docs/pages/material-ui/api/table.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/table', false, /table.*.json$/); + const req = require.context('docs/translations/api-docs/table', false, /\.\/table.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/tabs.js b/docs/pages/material-ui/api/tabs.js index 89fb45a9a0359a..fd3323b67a628f 100644 --- a/docs/pages/material-ui/api/tabs.js +++ b/docs/pages/material-ui/api/tabs.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/tabs', false, /tabs.*.json$/); + const req = require.context('docs/translations/api-docs/tabs', false, /\.\/tabs.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/text-field.js b/docs/pages/material-ui/api/text-field.js index 94cd80d46ff015..86384a6ca4cc50 100644 --- a/docs/pages/material-ui/api/text-field.js +++ b/docs/pages/material-ui/api/text-field.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/text-field', false, /text-field.*.json$/); + const req = require.context( + 'docs/translations/api-docs/text-field', + false, + /\.\/text-field.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/timeline-connector.js b/docs/pages/material-ui/api/timeline-connector.js index b2f58bf7606987..428972247c1860 100644 --- a/docs/pages/material-ui/api/timeline-connector.js +++ b/docs/pages/material-ui/api/timeline-connector.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/timeline-connector', false, - /timeline-connector.*.json$/, + /\.\/timeline-connector.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/timeline-content.js b/docs/pages/material-ui/api/timeline-content.js index 28d775509a00a3..4bf383a50a1cce 100644 --- a/docs/pages/material-ui/api/timeline-content.js +++ b/docs/pages/material-ui/api/timeline-content.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/timeline-content', false, - /timeline-content.*.json$/, + /\.\/timeline-content.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/timeline-dot.js b/docs/pages/material-ui/api/timeline-dot.js index 5672ff09b3a4dc..1c4efe2cbeb774 100644 --- a/docs/pages/material-ui/api/timeline-dot.js +++ b/docs/pages/material-ui/api/timeline-dot.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/timeline-dot', false, - /timeline-dot.*.json$/, + /\.\/timeline-dot.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/timeline-item.js b/docs/pages/material-ui/api/timeline-item.js index f7ee08585799a3..5bb82d995dc184 100644 --- a/docs/pages/material-ui/api/timeline-item.js +++ b/docs/pages/material-ui/api/timeline-item.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/timeline-item', false, - /timeline-item.*.json$/, + /\.\/timeline-item.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/timeline-opposite-content.js b/docs/pages/material-ui/api/timeline-opposite-content.js index f9962535c9431b..729b180a2b4857 100644 --- a/docs/pages/material-ui/api/timeline-opposite-content.js +++ b/docs/pages/material-ui/api/timeline-opposite-content.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/timeline-opposite-content', false, - /timeline-opposite-content.*.json$/, + /\.\/timeline-opposite-content.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/timeline-separator.js b/docs/pages/material-ui/api/timeline-separator.js index 4077fa61c8348f..c9acabb04fdf3b 100644 --- a/docs/pages/material-ui/api/timeline-separator.js +++ b/docs/pages/material-ui/api/timeline-separator.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/timeline-separator', false, - /timeline-separator.*.json$/, + /\.\/timeline-separator.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/timeline.js b/docs/pages/material-ui/api/timeline.js index 5e725e38e82186..a18e06a980f95b 100644 --- a/docs/pages/material-ui/api/timeline.js +++ b/docs/pages/material-ui/api/timeline.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/timeline', false, /timeline.*.json$/); + const req = require.context('docs/translations/api-docs/timeline', false, /\.\/timeline.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/toggle-button-group.js b/docs/pages/material-ui/api/toggle-button-group.js index 3131cde4860f2f..216a14a348147b 100644 --- a/docs/pages/material-ui/api/toggle-button-group.js +++ b/docs/pages/material-ui/api/toggle-button-group.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/toggle-button-group', false, - /toggle-button-group.*.json$/, + /\.\/toggle-button-group.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/toggle-button.js b/docs/pages/material-ui/api/toggle-button.js index bc1b38b54cb61e..efc14eba5bb525 100644 --- a/docs/pages/material-ui/api/toggle-button.js +++ b/docs/pages/material-ui/api/toggle-button.js @@ -12,7 +12,7 @@ Page.getInitialProps = () => { const req = require.context( 'docs/translations/api-docs/toggle-button', false, - /toggle-button.*.json$/, + /\.\/toggle-button.*.json$/, ); const descriptions = mapApiPageTranslations(req); diff --git a/docs/pages/material-ui/api/toolbar.js b/docs/pages/material-ui/api/toolbar.js index 277f4e2982bfda..7913d980dcb64c 100644 --- a/docs/pages/material-ui/api/toolbar.js +++ b/docs/pages/material-ui/api/toolbar.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/toolbar', false, /toolbar.*.json$/); + const req = require.context('docs/translations/api-docs/toolbar', false, /\.\/toolbar.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/tooltip.js b/docs/pages/material-ui/api/tooltip.js index 83ec1312d014c9..ed5791b04d72fc 100644 --- a/docs/pages/material-ui/api/tooltip.js +++ b/docs/pages/material-ui/api/tooltip.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/tooltip', false, /tooltip.*.json$/); + const req = require.context('docs/translations/api-docs/tooltip', false, /\.\/tooltip.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/typography.js b/docs/pages/material-ui/api/typography.js index 5b2785af0f9655..368ee85523089a 100644 --- a/docs/pages/material-ui/api/typography.js +++ b/docs/pages/material-ui/api/typography.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/typography', false, /typography.*.json$/); + const req = require.context( + 'docs/translations/api-docs/typography', + false, + /\.\/typography.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/material-ui/api/zoom.js b/docs/pages/material-ui/api/zoom.js index f9f68dadacc48f..781f9eceadbebf 100644 --- a/docs/pages/material-ui/api/zoom.js +++ b/docs/pages/material-ui/api/zoom.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/zoom', false, /zoom.*.json$/); + const req = require.context('docs/translations/api-docs/zoom', false, /\.\/zoom.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/system/api/box.js b/docs/pages/system/api/box.js index 75bdf6fcffccf1..476c932ffc5819 100644 --- a/docs/pages/system/api/box.js +++ b/docs/pages/system/api/box.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/box', false, /box.*.json$/); + const req = require.context('docs/translations/api-docs/box', false, /\.\/box.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/system/api/container.js b/docs/pages/system/api/container.js index 93a80589d308f5..bb6b55f6601af5 100644 --- a/docs/pages/system/api/container.js +++ b/docs/pages/system/api/container.js @@ -9,7 +9,11 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/container', false, /container.*.json$/); + const req = require.context( + 'docs/translations/api-docs/container', + false, + /\.\/container.*.json$/, + ); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/system/api/grid.js b/docs/pages/system/api/grid.js index 1296f5b5bebc49..b365259b168867 100644 --- a/docs/pages/system/api/grid.js +++ b/docs/pages/system/api/grid.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/grid', false, /grid.*.json$/); + const req = require.context('docs/translations/api-docs/grid', false, /\.\/grid.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/pages/system/api/stack.js b/docs/pages/system/api/stack.js index 9544e37c5e9ad1..0aa54fe96304e0 100644 --- a/docs/pages/system/api/stack.js +++ b/docs/pages/system/api/stack.js @@ -9,7 +9,7 @@ export default function Page(props) { } Page.getInitialProps = () => { - const req = require.context('docs/translations/api-docs/stack', false, /stack.*.json$/); + const req = require.context('docs/translations/api-docs/stack', false, /\.\/stack.*.json$/); const descriptions = mapApiPageTranslations(req); return { diff --git a/docs/src/modules/components/ApiPage/list/PropertiesList.tsx b/docs/src/modules/components/ApiPage/list/PropertiesList.tsx index 934640aa20a671..1007811297473c 100644 --- a/docs/src/modules/components/ApiPage/list/PropertiesList.tsx +++ b/docs/src/modules/components/ApiPage/list/PropertiesList.tsx @@ -122,6 +122,7 @@ export function getHash({ export interface PropDescriptionParams { componentName: string; propName: string; + seeMoreDescription?: string; description?: string; requiresRef?: string; isOptional?: boolean; @@ -152,6 +153,7 @@ export default function PropertiesList(props: PropertiesListProps) { const { componentName, propName, + seeMoreDescription, description, requiresRef, isOptional, @@ -177,6 +179,7 @@ export default function PropertiesList(props: PropertiesListProps) { displayOption={displayOption} > {description && } + {seeMoreDescription &&

} {requiresRef && ( propData.additionalInfo?.[key]); + const seeMoreDescription = + propDescription?.seeMoreText && + propData.seeMoreLink && + propDescription.seeMoreText.replace( + '{{link}}', + `${propData.seeMoreLink.text}`, + ); + const signature = propData.signature?.type; const signatureArgs = propData.signature?.describedArgs?.map((argName) => ({ argName, @@ -89,6 +97,7 @@ export default function PropertiesSection(props) { return { componentName, propName, + seeMoreDescription, description: propDescription?.description, requiresRef: propDescription?.requiresRef, isOptional, diff --git a/docs/src/modules/components/ApiPage/table/PropertiesTable.tsx b/docs/src/modules/components/ApiPage/table/PropertiesTable.tsx index 88e11d4a2d7021..678b260040d87d 100644 --- a/docs/src/modules/components/ApiPage/table/PropertiesTable.tsx +++ b/docs/src/modules/components/ApiPage/table/PropertiesTable.tsx @@ -183,6 +183,7 @@ export default function PropertiesTable(props: PropertiesTableProps) { componentName, propName, description, + seeMoreDescription, requiresRef, isOptional, isRequired, @@ -223,6 +224,12 @@ export default function PropertiesTable(props: PropertiesTableProps) { {description && } + {seeMoreDescription && ( +

+ )} {requiresRef && ( true, the menu is initially open.", - "onOpenChange": "Callback fired when the component requests to be opened or closed.", - "open": "Allows to control whether the menu is open. This is a controlled counterpart of defaultOpen." - }, - "classDescriptions": {} -} diff --git a/docs/translations/api-docs-base/number-input-unstyled/number-input-unstyled.json b/docs/translations/api-docs-base/number-input-unstyled/number-input-unstyled.json deleted file mode 100644 index 4d8c3b82671253..00000000000000 --- a/docs/translations/api-docs-base/number-input-unstyled/number-input-unstyled.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "componentDescription": "", - "propDescriptions": { - "component": "The component used for the root node. Either a string to use a HTML element or a component.", - "defaultValue": "The default value. Use when the component is not controlled.", - "disabled": "If true, the component is disabled. The prop defaults to the value (false) inherited from the parent FormControl component.", - "error": "If true, the input will indicate an error by setting the aria-invalid attribute on the input and the Mui-error class on the root element.", - "id": "The id of the input element.", - "max": "The maximum value.", - "min": "The minimum value.", - "onValueChange": "Callback fired after the value is clamped and changes. Called with undefined when the value is unset.", - "required": "If true, the input element is required. The prop defaults to the value (false) inherited from the parent FormControl component.", - "slotProps": "The props used for each slot inside the NumberInput.", - "slots": "The components used for each slot inside the InputBase. Either a string to use a HTML element or a component. See Slots API below for more details.", - "step": "The amount that the value changes on each increment or decrement.", - "value": "The current value. Use when the component is controlled." - }, - "classDescriptions": {} -} diff --git a/docs/translations/api-docs-joy/drawer-content/drawer-content.json b/docs/translations/api-docs-joy/drawer-content/drawer-content.json deleted file mode 100644 index cb483760fe1411..00000000000000 --- a/docs/translations/api-docs-joy/drawer-content/drawer-content.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "componentDescription": "", - "propDescriptions": { - "children": { "description": "The content of the component." }, - "color": { - "description": "The color of the component. It supports those theme colors that make sense for this component." - }, - "component": { - "description": "The component used for the root node. Either a string to use a HTML element or a component." - }, - "size": { "description": "The size of the component." }, - "slotProps": { "description": "The props used for each slot inside." }, - "slots": { "description": "The components used for each slot inside." }, - "sx": { - "description": "The system prop that allows defining system overrides as well as additional CSS styles." - }, - "variant": { - "description": "The global variant to use." - } - }, - "classDescriptions": { - "root": { "description": "Class name applied to the root element." }, - "colorPrimary": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "color=\"primary\"" - }, - "colorNeutral": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "color=\"neutral\"" - }, - "colorDanger": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "color=\"danger\"" - }, - "colorSuccess": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "color=\"success\"" - }, - "colorWarning": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "color=\"warning\"" - }, - "colorContext": { - "description": "Class name applied to {{nodeName}} when {{conditions}}.", - "nodeName": "the root element", - "conditions": "color inversion is triggered" - }, - "variantPlain": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "variant=\"plain\"" - }, - "variantOutlined": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "variant=\"outlined\"" - }, - "variantSoft": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "variant=\"soft\"" - }, - "variantSolid": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "variant=\"solid\"" - }, - "sizeSm": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "size=\"sm\"" - }, - "sizeMd": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "size=\"md\"" - }, - "sizeLg": { - "description": "Class name applied to {{nodeName}} if {{conditions}}.", - "nodeName": "the root element", - "conditions": "size=\"lg\"" - } - }, - "slotDescriptions": { "root": "The component that renders the root." } -} diff --git a/packages/api-docs-builder-core/baseUi/projectSettings.ts b/packages/api-docs-builder-core/baseUi/projectSettings.ts index c09e1c25b862a2..fbd920463f73e9 100644 --- a/packages/api-docs-builder-core/baseUi/projectSettings.ts +++ b/packages/api-docs-builder-core/baseUi/projectSettings.ts @@ -34,4 +34,7 @@ export const projectSettings: ProjectSettings = { return source; }, + skipAnnotatingComponentDefinition: true, + generateJsonFileOnly: true, + translationPagesDirectory: 'docs/translations/api-docs-base', }; diff --git a/packages/api-docs-builder-core/joyUi/projectSettings.ts b/packages/api-docs-builder-core/joyUi/projectSettings.ts index d781c07e49742d..4a52e4a70e4a6c 100644 --- a/packages/api-docs-builder-core/joyUi/projectSettings.ts +++ b/packages/api-docs-builder-core/joyUi/projectSettings.ts @@ -26,4 +26,5 @@ export const projectSettings: ProjectSettings = { null ); }, + translationPagesDirectory: 'docs/translations/api-docs-joy', }; diff --git a/packages/api-docs-builder-core/materialUi/projectSettings.ts b/packages/api-docs-builder-core/materialUi/projectSettings.ts index d5188e953e034f..7f29376f5aeda0 100644 --- a/packages/api-docs-builder-core/materialUi/projectSettings.ts +++ b/packages/api-docs-builder-core/materialUi/projectSettings.ts @@ -26,4 +26,5 @@ export const projectSettings: ProjectSettings = { skipComponent(filename: string) { return filename.match(/(ThemeProvider|CssVarsProvider|Grid2)/) !== null; }, + translationPagesDirectory: 'docs/translations/api-docs', }; diff --git a/packages/api-docs-builder-core/muiSystem/projectSettings.ts b/packages/api-docs-builder-core/muiSystem/projectSettings.ts index e797f5ab2c2155..77c5f8041fa473 100644 --- a/packages/api-docs-builder-core/muiSystem/projectSettings.ts +++ b/packages/api-docs-builder-core/muiSystem/projectSettings.ts @@ -21,4 +21,5 @@ export const projectSettings: ProjectSettings = { skipComponent(filename) { return filename.match(/(ThemeProvider|CssVarsProvider|GlobalStyles)/) !== null; }, + translationPagesDirectory: 'docs/translations/api-docs', }; diff --git a/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts b/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts index 5e5bfb689a5326..f588a10031b1fd 100644 --- a/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts +++ b/packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts @@ -1,4 +1,4 @@ -import { mkdirSync, readFileSync, writeFileSync } from 'fs'; +import { readFileSync, writeFileSync } from 'fs'; import path from 'path'; import * as astTypes from 'ast-types'; import * as babel from '@babel/core'; @@ -12,16 +12,18 @@ import { defaultHandlers, parse as docgenParse, ReactDocgenApi } from 'react-doc import { renderMarkdown } from '@mui/markdown'; import { ComponentClassDefinition } from '@mui-internal/docs-utilities'; import { ProjectSettings } from '../ProjectSettings'; -import { ComponentInfo, writePrettifiedFile } from '../buildApiUtils'; +import { ComponentInfo, toGitHubPath, writePrettifiedFile } from '../buildApiUtils'; import muiDefaultPropsHandler from '../utils/defaultPropsHandler'; import parseTest from '../utils/parseTest'; import generatePropTypeDescription, { getChained } from '../utils/generatePropTypeDescription'; import createDescribeableProp, { + CreateDescribeablePropSettings, DescribeablePropDescriptor, } from '../utils/createDescribeableProp'; import generatePropDescription from '../utils/generatePropDescription'; import { TypeScriptProject } from '../utils/createTypeScriptProject'; import parseSlotsAndClasses, { Slot } from '../utils/parseSlotsAndClasses'; +import generateApiTranslations from '../utils/generateApiTranslation'; export type AdditionalPropsInfo = { cssApi?: boolean; @@ -32,6 +34,8 @@ export type AdditionalPropsInfo = { 'joy-variant'?: boolean; }; +export type SeeMore = { description: string; link: { text: string; url: string } }; + export interface ReactApi extends ReactDocgenApi { demos: ReturnType; EOL: string; @@ -67,6 +71,7 @@ export interface ReactApi extends ReactDocgenApi { deprecationInfo: string | undefined; signature: undefined | { type: string; describedArgs?: string[]; returned?: string }; additionalInfo?: AdditionalPropsInfo; + seeMoreLink?: SeeMore['link']; }>; /** * Different ways to import components @@ -80,11 +85,16 @@ export interface ReactApi extends ReactDocgenApi { requiresRef?: boolean; deprecated?: string; typeDescriptions?: { [t: string]: string }; + seeMoreText?: string; }; }; classDescriptions: { [key: string]: { description: string; conditions?: string } }; slotDescriptions?: { [key: string]: string }; }; + /** + * The folder used to store the API translation. + */ + apiDocsTranslationFolder?: string; } const cssComponents = ['Box', 'Grid', 'Typography', 'Stack']; @@ -148,11 +158,6 @@ async function annotateComponentDefinition(api: ReactApi) { let end = null; traverse(typesAST, { ExportDefaultDeclaration(babelPath) { - if (api.filename.includes('mui-base')) { - // Base UI does not use default exports. - return; - } - /** * export default function Menu() {} */ @@ -206,10 +211,6 @@ async function annotateComponentDefinition(api: ReactApi) { }, ExportNamedDeclaration(babelPath) { - if (!api.filename.includes('mui-base')) { - return; - } - let node: babel.Node = babelPath.node; if (node.declaration == null) { @@ -351,59 +352,9 @@ function extractClassConditions(descriptions: any) { return classConditions; } -/** - * @param filepath - absolute path - * @example toGitHubPath('/home/user/material-ui/packages/Accordion') === '/packages/Accordion' - * @example toGitHubPath('C:\\Development\material-ui\packages\Accordion') === '/packages/Accordion' - */ -export function toGitHubPath(filepath: string): string { - return `/${path.relative(process.cwd(), filepath).replace(/\\/g, '/')}`; -} - -const generateApiTranslations = ( - outputDirectory: string, - reactApi: ReactApi, - languages: string[], -) => { - const componentName = reactApi.name; - const apiDocsTranslationPath = path.resolve(outputDirectory, kebabCase(componentName)); - function resolveApiDocsTranslationsComponentLanguagePath( - language: (typeof languages)[0], - ): string { - const languageSuffix = language === 'en' ? '' : `-${language}`; - - return path.join(apiDocsTranslationPath, `${kebabCase(componentName)}${languageSuffix}.json`); - } - - mkdirSync(apiDocsTranslationPath, { - mode: 0o777, - recursive: true, - }); - - writePrettifiedFile( - resolveApiDocsTranslationsComponentLanguagePath('en'), - JSON.stringify(reactApi.translations), - ); - - languages.forEach((language) => { - if (language !== 'en') { - try { - writePrettifiedFile( - resolveApiDocsTranslationsComponentLanguagePath(language), - JSON.stringify(reactApi.translations), - undefined, - { flag: 'wx' }, - ); - } catch (error) { - // File exists - } - } - }); -}; - const generateApiPage = ( apiPagesDirectory: string, - translationPagesDirectory: string, + importTranslationPagesDirectory: string, reactApi: ReactApi, onlyJsonFile: boolean = false, ) => { @@ -467,9 +418,9 @@ const generateApiPage = ( Page.getInitialProps = () => { const req = require.context( - '${translationPagesDirectory}/${kebabCase(reactApi.name)}', + '${importTranslationPagesDirectory}/${kebabCase(reactApi.name)}', false, - /${kebabCase(reactApi.name)}.*.json$/, + /\\.\\/${kebabCase(reactApi.name)}.*.json$/, ); const descriptions = mapApiPageTranslations(req); @@ -483,7 +434,7 @@ const generateApiPage = ( } }; -const attachTranslations = (reactApi: ReactApi) => { +const attachTranslations = (reactApi: ReactApi, settings?: CreateDescribeablePropSettings) => { const translations: ReactApi['translations'] = { componentDescription: reactApi.description, propDescriptions: {}, @@ -492,12 +443,12 @@ const attachTranslations = (reactApi: ReactApi) => { Object.entries(reactApi.props!).forEach(([propName, propDescriptor]) => { let prop: DescribeablePropDescriptor | null; try { - prop = createDescribeableProp(propDescriptor, propName); + prop = createDescribeableProp(propDescriptor, propName, settings); } catch (error) { prop = null; } if (prop) { - const { deprecated, jsDocText, signatureArgs, signatureReturn, requiresRef } = + const { deprecated, seeMore, jsDocText, signatureArgs, signatureReturn, requiresRef } = generatePropDescription(prop, propName); // description = renderMarkdownInline(`${description}`); @@ -511,6 +462,7 @@ const attachTranslations = (reactApi: ReactApi) => { requiresRef: requiresRef || undefined, deprecated: renderMarkdown(deprecated) || undefined, typeDescriptions: Object.keys(typeDescriptions).length > 0 ? typeDescriptions : undefined, + seeMoreText: seeMore?.description, }; } }); @@ -538,14 +490,14 @@ const attachTranslations = (reactApi: ReactApi) => { reactApi.translations = translations; }; -const attachPropsTable = (reactApi: ReactApi) => { +const attachPropsTable = (reactApi: ReactApi, settings?: CreateDescribeablePropSettings) => { const propErrors: Array<[propName: string, error: Error]> = []; type Pair = [string, ReactApi['propsTable'][string]]; const componentProps: ReactApi['propsTable'] = _.fromPairs( Object.entries(reactApi.props!).map(([propName, propDescriptor]): Pair => { let prop: DescribeablePropDescriptor | null; try { - prop = createDescribeableProp(propDescriptor, propName); + prop = createDescribeableProp(propDescriptor, propName, settings); } catch (error) { propErrors.push([`[${reactApi.name}] \`${propName}\``, error as Error]); prop = null; @@ -561,6 +513,7 @@ const attachPropsTable = (reactApi: ReactApi) => { signature: signatureType, signatureArgs, signatureReturn, + seeMore, } = generatePropDescription(prop, propName); const propTypeDescription = generatePropTypeDescription(propDescriptor.type); const chainedPropType = getChained(prop.type); @@ -621,6 +574,7 @@ const attachPropsTable = (reactApi: ReactApi) => { signature, additionalInfo: Object.keys(additionalPropsInfo).length === 0 ? undefined : additionalPropsInfo, + seeMoreLink: seeMore?.link, }, ]; }), @@ -647,7 +601,7 @@ const attachPropsTable = (reactApi: ReactApi) => { * @param filename The filename where its defined (to infer the package) * @returns an array of import command */ -const getComponentImports = (name: string, filename: string) => { +const defaultGetComponentImports = (name: string, filename: string) => { const githubPath = toGitHubPath(filename); const rootImportPath = githubPath.replace( /\/packages\/mui(?:-(.+?))?\/src\/.*/, @@ -757,6 +711,8 @@ export default async function generateComponentApi( if (annotatedDescriptionMatch !== null) { reactApi.description = reactApi.description.slice(0, annotatedDescriptionMatch.index).trim(); } + + const { getComponentImports = defaultGetComponentImports } = projectSettings; reactApi.filename = filename; reactApi.name = componentInfo.name; reactApi.imports = getComponentImports(componentInfo.name, filename); @@ -772,12 +728,19 @@ export default async function generateComponentApi( ); } - const testInfo = await parseTest(filename); - // no Object.assign to visually check for collisions - reactApi.forwardsRefTo = testInfo.forwardsRefTo; - reactApi.spread = testInfo.spread ?? spread; - reactApi.themeDefaultProps = testInfo.themeDefaultProps; - reactApi.inheritance = componentInfo.getInheritance(testInfo.inheritComponent); + try { + const testInfo = await parseTest(reactApi.filename); + // no Object.assign to visually check for collisions + reactApi.forwardsRefTo = testInfo.forwardsRefTo; + reactApi.spread = testInfo.spread ?? spread; + reactApi.themeDefaultProps = testInfo.themeDefaultProps; + reactApi.inheritance = componentInfo.getInheritance(testInfo.inheritComponent); + } catch (e) { + if (project.name.includes('grid')) { + // TODO: Use `describeConformance` for the DataGrid components + reactApi.forwardsRefTo = 'GridRoot'; + } + } const { slots, classes } = parseSlotsAndClasses({ project, @@ -788,26 +751,19 @@ export default async function generateComponentApi( reactApi.slots = slots; reactApi.classes = classes; - attachPropsTable(reactApi); - attachTranslations(reactApi); + attachPropsTable(reactApi, projectSettings.propsSettings); + attachTranslations(reactApi, projectSettings.propsSettings); // eslint-disable-next-line no-console console.log('Built API docs for', reactApi.apiPathname); - const normalizedApiPathname = reactApi.apiPathname.replace(/\\/g, '/'); - const normalizedFilename = reactApi.filename.replace(/\\/g, '/'); - if (!componentInfo.skipApiGeneration) { - // Generate pages, json and translations - let translationPagesDirectory = 'docs/translations/api-docs'; - if (normalizedApiPathname.startsWith('/joy-ui') && normalizedFilename.includes('mui-joy/src')) { - translationPagesDirectory = 'docs/translations/api-docs-joy'; - } else if ( - normalizedApiPathname.startsWith('/base') && - normalizedFilename.includes('mui-base/src') - ) { - translationPagesDirectory = 'docs/translations/api-docs-base'; - } + const { + skipAnnotatingComponentDefinition, + translationPagesDirectory, + importTranslationPagesDirectory, + generateJsonFileOnly, + } = projectSettings; generateApiTranslations( path.join(process.cwd(), translationPagesDirectory), @@ -816,16 +772,21 @@ export default async function generateComponentApi( ); // Once we have the tabs API in all projects, we can make this default - const generateOnlyJsonFile = normalizedApiPathname.startsWith('/base'); generateApiPage( componentInfo.apiPagesDirectory, - translationPagesDirectory, + importTranslationPagesDirectory ?? translationPagesDirectory, reactApi, - generateOnlyJsonFile, + generateJsonFileOnly, ); - // Add comment about demo & api links (including inherited component) to the component file - await annotateComponentDefinition(reactApi); + if ( + typeof skipAnnotatingComponentDefinition === 'function' + ? !skipAnnotatingComponentDefinition(reactApi.filename) + : !skipAnnotatingComponentDefinition + ) { + // Add comment about demo & api links (including inherited component) to the component file + await annotateComponentDefinition(reactApi); + } } return reactApi; diff --git a/packages/api-docs-builder/ApiBuilders/HookApiBuilder.ts b/packages/api-docs-builder/ApiBuilders/HookApiBuilder.ts index 926bab15562334..d1552a9535bb74 100644 --- a/packages/api-docs-builder/ApiBuilders/HookApiBuilder.ts +++ b/packages/api-docs-builder/ApiBuilders/HookApiBuilder.ts @@ -1,4 +1,4 @@ -import { mkdirSync, readFileSync, writeFileSync } from 'fs'; +import { readFileSync, writeFileSync } from 'fs'; import path from 'path'; import * as ts from 'typescript'; import * as astTypes from 'ast-types'; @@ -10,15 +10,17 @@ import kebabCase from 'lodash/kebabCase'; import upperFirst from 'lodash/upperFirst'; import { renderMarkdown } from '@mui/markdown'; import { ProjectSettings } from '../ProjectSettings'; -import { toGitHubPath, computeApiDescription } from './ComponentApiBuilder'; +import { computeApiDescription } from './ComponentApiBuilder'; import { getSymbolDescription, getSymbolJSDocTags, HookInfo, stringifySymbol, + toGitHubPath, writePrettifiedFile, } from '../buildApiUtils'; import { TypeScriptProject } from '../utils/createTypeScriptProject'; +import generateApiTranslations from '../utils/generateApiTranslation'; interface ParsedProperty { name: string; @@ -86,6 +88,10 @@ export interface ReactApi extends ReactDocgenApi { }; }; }; + /** + * The folder used to store the API translation. + */ + apiDocsTranslationFolder?: string; } /** @@ -430,47 +436,6 @@ const generateApiJson = (outputDirectory: string, reactApi: ReactApi) => { ); }; -const generateApiTranslations = ( - outputDirectory: string, - reactApi: ReactApi, - languages: string[], -) => { - const hookName = reactApi.name; - const apiDocsTranslationPath = path.resolve(outputDirectory, kebabCase(hookName)); - function resolveApiDocsTranslationsComponentLanguagePath( - language: (typeof languages)[0], - ): string { - const languageSuffix = language === 'en' ? '' : `-${language}`; - - return path.join(apiDocsTranslationPath, `${kebabCase(hookName)}${languageSuffix}.json`); - } - - mkdirSync(apiDocsTranslationPath, { - mode: 0o777, - recursive: true, - }); - - writePrettifiedFile( - resolveApiDocsTranslationsComponentLanguagePath('en'), - JSON.stringify(reactApi.translations), - ); - - languages.forEach((language) => { - if (language !== 'en') { - try { - writePrettifiedFile( - resolveApiDocsTranslationsComponentLanguagePath(language), - JSON.stringify(reactApi.translations), - undefined, - { flag: 'wx' }, - ); - } catch (error) { - // File exists - } - } - }); -}; - const extractInfoFromType = (typeName: string, project: TypeScriptProject): ParsedProperty[] => { // Generate the params let result: ParsedProperty[] = []; diff --git a/packages/api-docs-builder/ProjectSettings.ts b/packages/api-docs-builder/ProjectSettings.ts index 7549bcacda25a6..6efdc931642efc 100644 --- a/packages/api-docs-builder/ProjectSettings.ts +++ b/packages/api-docs-builder/ProjectSettings.ts @@ -1,5 +1,6 @@ import { ComponentInfo, HookInfo } from './buildApiUtils'; import { CreateTypeScriptProjectOptions } from './utils/createTypeScriptProject'; +import { CreateDescribeablePropSettings } from './utils/createDescribeableProp'; import { ReactApi as ComponentReactApi } from './ApiBuilders/ComponentApiBuilder'; import { ReactApi as HookReactApi } from './ApiBuilders/HookApiBuilder'; @@ -36,4 +37,31 @@ export interface ProjectSettings { * Fuction called to detemine whether to skip the generation of a particular component's API docs */ skipComponent: (filename: string) => boolean; + /** + * Determine is the component definition should be updated. + */ + skipAnnotatingComponentDefinition?: boolean | ((filename: string) => boolean); + /** + * The path to the translation directory. + */ + translationPagesDirectory: string; + /** + * The path to import the translation directory. + * @default the `translationPagesDirectory` alue + */ + importTranslationPagesDirectory?: string; + /** + * Returns an array of import commands used for the API page header. + */ + getComponentImports?: (name: string, filename: string) => string[]; + /** + * Settings to configure props definition tests. + */ + propsSettings?: CreateDescribeablePropSettings; + /** + * If `true`, the script does not generate JS page file. + * Once we have the API tabs in all projects, we can make this `true` by default. + * @default false + */ + generateJsonFileOnly?: boolean; } diff --git a/packages/api-docs-builder/buildApi.ts b/packages/api-docs-builder/buildApi.ts index 155f43fcd80942..b1ff5c5869c409 100644 --- a/packages/api-docs-builder/buildApi.ts +++ b/packages/api-docs-builder/buildApi.ts @@ -1,7 +1,6 @@ import { mkdirSync } from 'fs'; import path from 'path'; import * as fse from 'fs-extra'; -import kebabCase from 'lodash/kebabCase'; import findComponents from './utils/findComponents'; import findHooks from './utils/findHooks'; import { writePrettifiedFile } from './buildApiUtils'; @@ -16,27 +15,42 @@ import { } from './utils/createTypeScriptProject'; import { ProjectSettings } from './ProjectSettings'; -const apiDocsTranslationsDirectory = path.resolve('docs', 'translations', 'api-docs'); - async function removeOutdatedApiDocsTranslations( components: readonly ComponentReactApi[], + apiDocsTranslationsDirectories: string[], ): Promise { const componentDirectories = new Set(); - const files = await fse.readdir(apiDocsTranslationsDirectory); + const projectFiles = await Promise.all( + apiDocsTranslationsDirectories.map(async (directory) => ({ + directory: path.resolve(directory), + files: await fse.readdir(directory), + })), + ); + await Promise.all( - files.map(async (filename) => { - const filepath = path.join(apiDocsTranslationsDirectory, filename); - const stats = await fse.stat(filepath); - if (stats.isDirectory()) { - componentDirectories.add(filepath); - } + projectFiles.map(async ({ directory, files }) => { + await Promise.all( + files.map(async (filename) => { + const filepath = path.join(directory, filename); + const stats = await fse.stat(filepath); + if (stats.isDirectory()) { + componentDirectories.add(filepath); + } + }), + ); }), ); const currentComponentDirectories = new Set( - components.map((component) => { - return path.resolve(apiDocsTranslationsDirectory, kebabCase(component.name)); - }), + components + .map((component) => { + if (component.apiDocsTranslationFolder) { + return path.resolve(component.apiDocsTranslationFolder); + } + console.warn(`Component ${component.name} did not generate an API translation file.`); + return null; + }) + .filter((filename): filename is string => filename !== null), ); const outdatedComponentDirectories = new Set(componentDirectories); @@ -61,7 +75,7 @@ export async function buildApi(projectsSettings: ProjectSettings[], grep: RegExp const buildTypeScriptProject = createTypeScriptProjectBuilder(allTypeScriptProjects); - let allBuilds: Array> = []; + let allBuilds: Array> = []; for (let i = 0; i < projectsSettings.length; i += 1) { const setting = projectsSettings[i]; // eslint-disable-next-line no-await-in-loop @@ -74,13 +88,16 @@ export async function buildApi(projectsSettings: ProjectSettings[], grep: RegExp if (grep === null) { const componentApis = allBuilds .filter((build): build is PromiseFulfilledResult => { - return build.status === 'fulfilled' && build.value !== null; + return build.status === 'fulfilled' && build.value !== null && !Array.isArray(build.value); }) .map((build) => { return build.value; }); - await removeOutdatedApiDocsTranslations(componentApis); + const apiTranslationFolders = projectsSettings.map( + (setting) => setting.translationPagesDirectory, + ); + await removeOutdatedApiDocsTranslations(componentApis, apiTranslationFolders); } } diff --git a/packages/api-docs-builder/buildApiUtils.ts b/packages/api-docs-builder/buildApiUtils.ts index f82e487bee19f7..1d84b0d94ecd58 100644 --- a/packages/api-docs-builder/buildApiUtils.ts +++ b/packages/api-docs-builder/buildApiUtils.ts @@ -224,3 +224,12 @@ export function stringifySymbol(symbol: ts.Symbol, project: TypeScriptProject) { return formatType(rawType); } + +/** + * @param filepath - absolute path + * @example toGitHubPath('/home/user/material-ui/packages/Accordion') === '/packages/Accordion' + * @example toGitHubPath('C:\\Development\\material-ui\\packages\\Accordion') === '/packages/Accordion' + */ +export function toGitHubPath(filepath: string): string { + return `/${path.relative(process.cwd(), filepath).replace(/\\/g, '/')}`; +} diff --git a/packages/api-docs-builder/utils/createDescribeableProp.ts b/packages/api-docs-builder/utils/createDescribeableProp.ts index 5710e76391a70d..0612c0ec742760 100644 --- a/packages/api-docs-builder/utils/createDescribeableProp.ts +++ b/packages/api-docs-builder/utils/createDescribeableProp.ts @@ -8,6 +8,13 @@ export interface DescribeablePropDescriptor { type: PropTypeDescriptor; } +export type CreateDescribeablePropSettings = { + /** + * Names of props that do not check if the annotations equal runtime default. + */ + propsWithoutDefaultVerification?: string[]; +}; + /** * Returns `null` if the prop should be ignored. * Throws if it is invalid. @@ -17,9 +24,12 @@ export interface DescribeablePropDescriptor { export default function createDescribeableProp( prop: PropDescriptor, propName: string, + settings: CreateDescribeablePropSettings = {}, ): DescribeablePropDescriptor | null { const { defaultValue, jsdocDefaultValue, description, required, type } = prop; + const { propsWithoutDefaultVerification = [] } = settings; + const renderedDefaultValue = defaultValue?.value.replace(/\r?\n/g, ''); const renderDefaultValue = Boolean( renderedDefaultValue && @@ -60,7 +70,10 @@ export default function createDescribeableProp( `JSDoc @default annotation not found. Add \`@default ${defaultValue.value}\` to the JSDoc of this prop.`, ); } - } else if (jsdocDefaultValue !== undefined) { + } else if ( + jsdocDefaultValue !== undefined && + !propsWithoutDefaultVerification.includes(propName) + ) { // `defaultValue` can't be undefined or we would've thrown earlier. if (jsdocDefaultValue.value !== defaultValue!.value) { throw new Error( diff --git a/packages/api-docs-builder/utils/defaultPropsHandler.ts b/packages/api-docs-builder/utils/defaultPropsHandler.ts index 77b8942afab34e..9b49c019f1af88 100644 --- a/packages/api-docs-builder/utils/defaultPropsHandler.ts +++ b/packages/api-docs-builder/utils/defaultPropsHandler.ts @@ -165,9 +165,7 @@ function getExplicitPropsDeclaration( const defaultPropsHandler: Handler = (documentation, componentDefinition, importer) => { const props = getExplicitPropsDeclaration(componentDefinition, importer); - if (props !== undefined) { - getDefaultValuesFromProps(props.get('properties'), documentation, importer); - } + getDefaultValuesFromProps(props?.get('properties') ?? [], documentation, importer); }; export default defaultPropsHandler; diff --git a/packages/api-docs-builder/utils/findPagesMarkdown.ts b/packages/api-docs-builder/utils/findPagesMarkdown.ts index 78a0815b615d21..58510771ba765c 100644 --- a/packages/api-docs-builder/utils/findPagesMarkdown.ts +++ b/packages/api-docs-builder/utils/findPagesMarkdown.ts @@ -34,7 +34,10 @@ export default function findPagesMarkdown( .replace('.md', ''); // Remove the last pathname segment. - pathname = pathname.split('/').slice(0, 4).join('/'); + pathname = pathname + .split('/') + .slice(0, pathname.split('/').length - 1) + .join('/'); pagesMarkdown.push({ // Relative location of the markdown file in the file system. diff --git a/packages/api-docs-builder/utils/generateApiTranslation.ts b/packages/api-docs-builder/utils/generateApiTranslation.ts new file mode 100644 index 00000000000000..116c5f08cf0f29 --- /dev/null +++ b/packages/api-docs-builder/utils/generateApiTranslation.ts @@ -0,0 +1,52 @@ +import { mkdirSync } from 'fs'; +import path from 'path'; +import kebabCase from 'lodash/kebabCase'; +import { writePrettifiedFile } from '../buildApiUtils'; + +interface MinimalReactAPI { + name: string; + apiDocsTranslationFolder?: string; + translations: object; +} + +export default function generateApiTranslations( + outputDirectory: string, + reactApi: ReactApi, + languages: string[], +) { + const definitionName = reactApi.name; + const apiDocsTranslationPath = path.resolve(outputDirectory, kebabCase(definitionName)); + function resolveApiDocsTranslationsComponentLanguagePath( + language: (typeof languages)[0], + ): string { + const languageSuffix = language === 'en' ? '' : `-${language}`; + + return path.join(apiDocsTranslationPath, `${kebabCase(definitionName)}${languageSuffix}.json`); + } + + mkdirSync(apiDocsTranslationPath, { + mode: 0o777, + recursive: true, + }); + reactApi.apiDocsTranslationFolder = apiDocsTranslationPath; + + writePrettifiedFile( + resolveApiDocsTranslationsComponentLanguagePath('en'), + JSON.stringify(reactApi.translations), + ); + + languages.forEach((language) => { + if (language !== 'en') { + try { + writePrettifiedFile( + resolveApiDocsTranslationsComponentLanguagePath(language), + JSON.stringify(reactApi.translations), + undefined, + { flag: 'wx' }, + ); + } catch (error) { + // File exists + } + } + }); +} diff --git a/packages/api-docs-builder/utils/generatePropDescription.ts b/packages/api-docs-builder/utils/generatePropDescription.ts index 5110ac3680d1c2..29a6f33010cb58 100644 --- a/packages/api-docs-builder/utils/generatePropDescription.ts +++ b/packages/api-docs-builder/utils/generatePropDescription.ts @@ -7,6 +7,7 @@ import { } from './generatePropTypeDescription'; import { DescribeablePropDescriptor } from './createDescribeableProp'; import escapeCell from './escapeCell'; +import { SeeMore } from '../ApiBuilders/ComponentApiBuilder'; function resolveType(type: NonNullable): string { if (type.type === 'AllLiteral') { @@ -76,6 +77,7 @@ export default function generatePropDescription( propName: string, ): { deprecated: string; + seeMore?: SeeMore; jsDocText: string; signature?: string; signatureArgs?: { name: string; description: string }[]; @@ -93,6 +95,21 @@ export default function generatePropDescription( } } + const seeTag = annotation.tags.find((tag) => tag.title === 'see'); + let seeMore; + if (seeTag && seeTag.description) { + const params = seeTag.description.match(/{@link ([^|| ]*)[|| ]([^}]*)}/); + if (params?.length === 3) { + seeMore = { + description: seeTag.description.replace(/{@link ([^|| ]*)[|| ]([^}]*)}/, '{{link}}'), + link: { + url: params[1], + text: params[2], + }, + }; + } + } + const jsDocText = escapeCell(annotation.description); // Split up the parsed tags into 'arguments' and 'returns' parsed objects. If there's no @@ -153,6 +170,7 @@ export default function generatePropDescription( return { deprecated, + seeMore, jsDocText, signature, signatureArgs,