Skip to content

Commit

Permalink
[docs] Add support for API pages of unstable components (#6981)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle authored Nov 24, 2022
1 parent 043522f commit 522b138
Show file tree
Hide file tree
Showing 152 changed files with 6,428 additions and 66 deletions.
5 changes: 5 additions & 0 deletions docs/data/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ const pages: MuiPage[] = [
title: 'DateRangePicker',
plan: 'pro',
},
{
pathname: '/x/api/date-pickers/date-range-calendar',
title: 'DateRangeCalendar',
plan: 'pro',
},
{
pathname: '/x/api/date-pickers/date-range-picker-day',
title: 'DateRangePickerDay',
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/data-grid-premium.json
Original file line number Diff line number Diff line change
Expand Up @@ -458,5 +458,5 @@
"forwardsRefTo": "GridRoot",
"filename": "/packages/grid/x-data-grid-premium/src/DataGridPremium/DataGridPremium.tsx",
"demos": "<ul><li><a href=\"/x/react-data-grid/#commercial-version\">DataGridPremium</a></li></ul>",
"packages": ["@mui/x-data-grid-premium"]
"packages": [{ "packageName": "@mui/x-data-grid-premium", "componentName": "DataGridPremium" }]
}
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/data-grid-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -436,5 +436,5 @@
"forwardsRefTo": "GridRoot",
"filename": "/packages/grid/x-data-grid-pro/src/DataGridPro/DataGridPro.tsx",
"demos": "<ul><li><a href=\"/x/react-data-grid/#commercial-version\">DataGridPro</a></li></ul>",
"packages": ["@mui/x-data-grid-pro"]
"packages": [{ "packageName": "@mui/x-data-grid-pro", "componentName": "DataGridPro" }]
}
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/data-grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -380,5 +380,5 @@
"forwardsRefTo": "GridRoot",
"filename": "/packages/grid/x-data-grid/src/DataGrid/DataGrid.tsx",
"demos": "<ul><li><a href=\"/x/react-data-grid/#mit-version\">DataGrid</a></li></ul>",
"packages": ["@mui/x-data-grid"]
"packages": [{ "packageName": "@mui/x-data-grid", "componentName": "DataGrid" }]
}
6 changes: 5 additions & 1 deletion docs/pages/x/api/data-grid/grid-filter-form.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@
"forwardsRefTo": "GridRoot",
"filename": "/packages/grid/x-data-grid/src/components/panel/filterPanel/GridFilterForm.tsx",
"demos": "<ul><li><a href=\"/x/react-data-grid/#mit-version\">DataGrid</a></li>\n<li><a href=\"/x/react-data-grid/#commercial-version\">DataGridPro</a></li>\n<li><a href=\"/x/react-data-grid/#commercial-version\">DataGridPremium</a></li></ul>",
"packages": ["@mui/x-data-grid-premium", "@mui/x-data-grid-pro", "@mui/x-data-grid"]
"packages": [
{ "packageName": "@mui/x-data-grid-premium", "componentName": "GridFilterForm" },
{ "packageName": "@mui/x-data-grid-pro", "componentName": "GridFilterForm" },
{ "packageName": "@mui/x-data-grid", "componentName": "GridFilterForm" }
]
}
6 changes: 5 additions & 1 deletion docs/pages/x/api/data-grid/grid-filter-panel.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@
"forwardsRefTo": "GridRoot",
"filename": "/packages/grid/x-data-grid/src/components/panel/filterPanel/GridFilterPanel.tsx",
"demos": "<ul><li><a href=\"/x/react-data-grid/#mit-version\">DataGrid</a></li>\n<li><a href=\"/x/react-data-grid/#commercial-version\">DataGridPro</a></li>\n<li><a href=\"/x/react-data-grid/#commercial-version\">DataGridPremium</a></li></ul>",
"packages": ["@mui/x-data-grid-premium", "@mui/x-data-grid-pro", "@mui/x-data-grid"]
"packages": [
{ "packageName": "@mui/x-data-grid-premium", "componentName": "GridFilterPanel" },
{ "packageName": "@mui/x-data-grid-pro", "componentName": "GridFilterPanel" },
{ "packageName": "@mui/x-data-grid", "componentName": "GridFilterPanel" }
]
}
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/date-calendar.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,8 @@
},
"filename": "/packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx",
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro", "@mui/x-date-pickers"]
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DateCalendar" },
{ "packageName": "@mui/x-date-pickers", "componentName": "DateCalendar" }
]
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/date-pickers/date-field.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from 'react';
import ApiPage from 'docsx/src/modules/components/ApiPage';
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
import jsonPageContent from './date-field.json';

export default function Page(props) {
const { descriptions, pageContent } = props;
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
}

Page.getInitialProps = () => {
const req = require.context(
'docsx/translations/api-docs/date-pickers',
false,
/\/date-field(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
35 changes: 35 additions & 0 deletions docs/pages/x/api/date-pickers/date-field.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"props": {
"components": { "type": { "name": "object" }, "default": "{}" },
"componentsProps": { "type": { "name": "object" }, "default": "{}" },
"defaultValue": { "type": { "name": "any" } },
"disableFuture": { "type": { "name": "bool" } },
"disablePast": { "type": { "name": "bool" } },
"format": { "type": { "name": "string" } },
"maxDate": { "type": { "name": "any" } },
"minDate": { "type": { "name": "any" } },
"onChange": { "type": { "name": "func" } },
"onError": { "type": { "name": "func" } },
"onSelectedSectionsChange": { "type": { "name": "func" } },
"readOnly": { "type": { "name": "bool" } },
"selectedSections": {
"type": {
"name": "union",
"description": "'day'<br>&#124;&nbsp;'hours'<br>&#124;&nbsp;'meridiem'<br>&#124;&nbsp;'minutes'<br>&#124;&nbsp;'month'<br>&#124;&nbsp;'seconds'<br>&#124;&nbsp;'year'<br>&#124;&nbsp;number<br>&#124;&nbsp;{ endIndex: number, startIndex: number }"
}
},
"shouldDisableDate": { "type": { "name": "func" } },
"shouldDisableMonth": { "type": { "name": "func" } },
"shouldDisableYear": { "type": { "name": "func" } },
"value": { "type": { "name": "any" } }
},
"slots": { "Input": { "default": "TextField", "type": { "name": "elementType" } } },
"name": "DateField",
"styles": { "classes": [], "globalClasses": {}, "name": "MuiDateField" },
"filename": "/packages/x-date-pickers/src/DateField/DateField.tsx",
"demos": "<ul></ul>",
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "Unstable_DateField" },
{ "packageName": "@mui/x-date-pickers", "componentName": "Unstable_DateField" }
]
}
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,8 @@
"filename": "/packages/x-date-pickers/src/DatePicker/DatePicker.tsx",
"inheritance": null,
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro", "@mui/x-date-pickers"]
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DatePicker" },
{ "packageName": "@mui/x-date-pickers", "componentName": "DatePicker" }
]
}
2 changes: 1 addition & 1 deletion docs/pages/x/api/date-pickers/date-range-calendar.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@
"filename": "/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.tsx",
"inheritance": null,
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro"]
"packages": [{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DateRangeCalendar" }]
}
2 changes: 1 addition & 1 deletion docs/pages/x/api/date-pickers/date-range-picker-day.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
"filename": "/packages/x-date-pickers-pro/src/DateRangePickerDay/DateRangePickerDay.tsx",
"inheritance": null,
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro"]
"packages": [{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DateRangePickerDay" }]
}
2 changes: 1 addition & 1 deletion docs/pages/x/api/date-pickers/date-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@
"filename": "/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePicker.tsx",
"inheritance": null,
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro"]
"packages": [{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DateRangePicker" }]
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/date-pickers/date-time-field.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from 'react';
import ApiPage from 'docsx/src/modules/components/ApiPage';
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
import jsonPageContent from './date-time-field.json';

export default function Page(props) {
const { descriptions, pageContent } = props;
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
}

Page.getInitialProps = () => {
const req = require.context(
'docsx/translations/api-docs/date-pickers',
false,
/\/date-time-field(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
43 changes: 43 additions & 0 deletions docs/pages/x/api/date-pickers/date-time-field.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"props": {
"ampm": { "type": { "name": "bool" }, "default": "`utils.is12HourCycleInCurrentLocale()`" },
"components": { "type": { "name": "object" }, "default": "{}" },
"componentsProps": { "type": { "name": "object" }, "default": "{}" },
"defaultValue": { "type": { "name": "any" } },
"disableFuture": { "type": { "name": "bool" } },
"disableIgnoringDatePartForTimeValidation": { "type": { "name": "bool" } },
"disablePast": { "type": { "name": "bool" } },
"format": { "type": { "name": "string" } },
"maxDate": { "type": { "name": "any" } },
"maxDateTime": { "type": { "name": "any" } },
"maxTime": { "type": { "name": "any" } },
"minDate": { "type": { "name": "any" } },
"minDateTime": { "type": { "name": "any" } },
"minTime": { "type": { "name": "any" } },
"minutesStep": { "type": { "name": "number" }, "default": "1" },
"onChange": { "type": { "name": "func" } },
"onError": { "type": { "name": "func" } },
"onSelectedSectionsChange": { "type": { "name": "func" } },
"readOnly": { "type": { "name": "bool" } },
"selectedSections": {
"type": {
"name": "union",
"description": "'day'<br>&#124;&nbsp;'hours'<br>&#124;&nbsp;'meridiem'<br>&#124;&nbsp;'minutes'<br>&#124;&nbsp;'month'<br>&#124;&nbsp;'seconds'<br>&#124;&nbsp;'year'<br>&#124;&nbsp;number<br>&#124;&nbsp;{ endIndex: number, startIndex: number }"
}
},
"shouldDisableDate": { "type": { "name": "func" } },
"shouldDisableMonth": { "type": { "name": "func" } },
"shouldDisableTime": { "type": { "name": "func" } },
"shouldDisableYear": { "type": { "name": "func" } },
"value": { "type": { "name": "any" } }
},
"slots": { "Input": { "default": "TextField", "type": { "name": "elementType" } } },
"name": "DateTimeField",
"styles": { "classes": [], "globalClasses": {}, "name": "MuiDateTimeField" },
"filename": "/packages/x-date-pickers/src/DateTimeField/DateTimeField.tsx",
"demos": "<ul></ul>",
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "Unstable_DateTimeField" },
{ "packageName": "@mui/x-date-pickers", "componentName": "Unstable_DateTimeField" }
]
}
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/date-time-picker-tabs.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
"styles": { "classes": ["root"], "globalClasses": {}, "name": "MuiDateTimePickerTabs" },
"filename": "/packages/x-date-pickers/src/DateTimePicker/DateTimePickerTabs.tsx",
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro", "@mui/x-date-pickers"]
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DateTimePickerTabs" },
{ "packageName": "@mui/x-date-pickers", "componentName": "DateTimePickerTabs" }
]
}
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/date-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,8 @@
"filename": "/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.tsx",
"inheritance": null,
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro", "@mui/x-date-pickers"]
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DateTimePicker" },
{ "packageName": "@mui/x-date-pickers", "componentName": "DateTimePicker" }
]
}
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/day-calendar-skeleton.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"filename": "/packages/x-date-pickers/src/DayCalendarSkeleton/DayCalendarSkeleton.tsx",
"inheritance": null,
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro", "@mui/x-date-pickers"]
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DayCalendarSkeleton" },
{ "packageName": "@mui/x-date-pickers", "componentName": "DayCalendarSkeleton" }
]
}
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/desktop-date-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,8 @@
"filename": "/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.tsx",
"inheritance": null,
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro", "@mui/x-date-pickers"]
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DesktopDatePicker" },
{ "packageName": "@mui/x-date-pickers", "componentName": "DesktopDatePicker" }
]
}
4 changes: 3 additions & 1 deletion docs/pages/x/api/date-pickers/desktop-date-range-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,7 @@
"filename": "/packages/x-date-pickers-pro/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx",
"inheritance": null,
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro"]
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DesktopDateRangePicker" }
]
}
5 changes: 4 additions & 1 deletion docs/pages/x/api/date-pickers/desktop-date-time-picker.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,8 @@
"filename": "/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx",
"inheritance": null,
"demos": "<ul></ul>",
"packages": ["@mui/x-date-pickers-pro", "@mui/x-date-pickers"]
"packages": [
{ "packageName": "@mui/x-date-pickers-pro", "componentName": "DesktopDateTimePicker" },
{ "packageName": "@mui/x-date-pickers", "componentName": "DesktopDateTimePicker" }
]
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/date-pickers/desktop-next-date-picker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from 'react';
import ApiPage from 'docsx/src/modules/components/ApiPage';
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
import jsonPageContent from './desktop-next-date-picker.json';

export default function Page(props) {
const { descriptions, pageContent } = props;
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
}

Page.getInitialProps = () => {
const req = require.context(
'docsx/translations/api-docs/date-pickers',
false,
/\/desktop-next-date-picker(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
Loading

0 comments on commit 522b138

Please sign in to comment.