Skip to content

Commit

Permalink
[docs-infra] Mark unstable components with a chip in the nav drawer (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak authored Aug 29, 2023
1 parent 2ae2e79 commit a392609
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/data/base/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const pages: readonly MuiPage[] = [
{ pathname: '/base-ui/react-button', title: 'Button' },
{ pathname: '/base-ui/react-checkbox', title: 'Checkbox', planned: true },
{ pathname: '/base-ui/react-input', title: 'Input' },
{ pathname: '/base-ui/react-number-input', title: 'Number Input' },
{ pathname: '/base-ui/react-number-input', title: 'Number Input', unstable: true },
{ pathname: '/base-ui/react-radio-button', title: 'Radio Button', planned: true },
{ pathname: '/base-ui/react-rating', title: 'Rating', planned: true },
{ pathname: '/base-ui/react-select', title: 'Select' },
Expand Down
4 changes: 4 additions & 0 deletions docs/src/MuiPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export interface MuiPage {
* @default false
*/
planned?: boolean;
/**
* Indicates if the component/hook is not stable yet.
*/
unstable?: boolean;
}

export interface OrderedMuiPage extends MuiPage {
Expand Down
2 changes: 2 additions & 0 deletions docs/src/modules/components/AppNavDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ function reduceChildRoutes(context) {
legacy={page.legacy}
newFeature={page.newFeature}
planned={page.planned}
unstable={page.unstable}
plan={page.plan}
icon={page.icon}
subheader={subheader}
Expand Down Expand Up @@ -291,6 +292,7 @@ function reduceChildRoutes(context) {
legacy={page.legacy}
newFeature={page.newFeature}
planned={page.planned}
unstable={page.unstable}
plan={page.plan}
icon={page.icon}
subheader={Boolean(page.subheader)}
Expand Down
3 changes: 3 additions & 0 deletions docs/src/modules/components/AppNavDrawerItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export default function AppNavDrawerItem(props) {
legacy,
newFeature,
planned,
unstable,
linkProps,
onClick,
initiallyExpanded = false,
Expand Down Expand Up @@ -328,6 +329,7 @@ export default function AppNavDrawerItem(props) {
{legacy && <Chip label="Legacy" sx={sxChip('warning')} />}
{newFeature && <Chip label="New" sx={sxChip('success')} />}
{planned && <Chip label="Planned" sx={sxChip('grey')} />}
{unstable && <Chip label="Preview" sx={sxChip('primary')} />}
</Item>
{expandable ? (
<Collapse in={open} timeout="auto" unmountOnExit>
Expand Down Expand Up @@ -356,4 +358,5 @@ AppNavDrawerItem.propTypes = {
subheader: PropTypes.bool.isRequired,
title: PropTypes.string.isRequired,
topLevel: PropTypes.bool,
unstable: PropTypes.bool,
};

0 comments on commit a392609

Please sign in to comment.