Skip to content

Commit d30ccd0

Browse files
committed
docs
1 parent 0134e18 commit d30ccd0

18 files changed

Lines changed: 492 additions & 16 deletions

File tree

docs/data/material/components/chips/chips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
productId: material-ui
33
title: React Chip component
4-
components: Chip
4+
components: Chip, ChipButton, ChipLink, ChipDelete
55
githubLabel: 'scope: chip'
66
materialDesign: https://m2.material.io/components/chips
77
githubSource: packages/mui-material/src/Chip

docs/data/material/pagesApi.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export default [
2626
{ pathname: '/material-ui/api/card-media' },
2727
{ pathname: '/material-ui/api/checkbox' },
2828
{ pathname: '/material-ui/api/chip' },
29+
{ pathname: '/material-ui/api/chip-button' },
30+
{ pathname: '/material-ui/api/chip-delete' },
31+
{ pathname: '/material-ui/api/chip-link' },
2932
{ pathname: '/material-ui/api/circular-progress' },
3033
{ pathname: '/material-ui/api/click-away-listener' },
3134
{ pathname: '/material-ui/api/collapse' },

docs/pages/material-ui/api/button.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
},
3030
"default": "'center'"
3131
},
32-
"nativeButton": { "type": { "name": "bool" } },
3332
"size": {
3433
"type": {
3534
"name": "union",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from 'react';
2+
import ApiPage from 'docs/src/modules/components/ApiPage';
3+
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
4+
import jsonPageContent from './chip-button.json';
5+
6+
export default function Page(props) {
7+
const { descriptions } = props;
8+
return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />;
9+
}
10+
11+
export async function getStaticProps() {
12+
const req = require.context(
13+
'docs/translations/api-docs/chip-button',
14+
false,
15+
/\.\/chip-button.*\.json$/,
16+
);
17+
const descriptions = mapApiPageTranslations(req);
18+
19+
return { props: { descriptions } };
20+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"props": {
3+
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
4+
"component": { "type": { "name": "custom", "description": "element type" } },
5+
"disabled": { "type": { "name": "bool" }, "default": "false" },
6+
"focusableWhenDisabled": { "type": { "name": "bool" }, "default": "true" },
7+
"nativeButton": { "type": { "name": "bool" } },
8+
"sx": {
9+
"type": {
10+
"name": "union",
11+
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
12+
},
13+
"additionalInfo": { "sx": true }
14+
}
15+
},
16+
"name": "ChipButton",
17+
"imports": [
18+
"import ChipButton from '@mui/material/ChipButton';",
19+
"import { ChipButton } from '@mui/material';"
20+
],
21+
"classes": [
22+
{
23+
"key": "disabled",
24+
"className": "Mui-disabled",
25+
"description": "State class applied to the root element if `disabled={true}`.",
26+
"isGlobal": true
27+
},
28+
{
29+
"key": "root",
30+
"className": "MuiChipButton-root",
31+
"description": "Styles applied to the root element.",
32+
"isGlobal": false
33+
}
34+
],
35+
"spread": true,
36+
"themeDefaultProps": null,
37+
"muiName": "MuiChipButton",
38+
"filename": "/packages/mui-material/src/ChipButton/ChipButton.tsx",
39+
"inheritance": null,
40+
"demos": "<ul><li><a href=\"/material-ui/react-chip/\">Chip</a></li></ul>",
41+
"cssComponent": false
42+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from 'react';
2+
import ApiPage from 'docs/src/modules/components/ApiPage';
3+
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
4+
import jsonPageContent from './chip-delete.json';
5+
6+
export default function Page(props) {
7+
const { descriptions } = props;
8+
return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />;
9+
}
10+
11+
export async function getStaticProps() {
12+
const req = require.context(
13+
'docs/translations/api-docs/chip-delete',
14+
false,
15+
/\.\/chip-delete.*\.json$/,
16+
);
17+
const descriptions = mapApiPageTranslations(req);
18+
19+
return { props: { descriptions } };
20+
}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"props": {
3+
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
4+
"component": { "type": { "name": "custom", "description": "element type" } },
5+
"disabled": { "type": { "name": "bool" }, "default": "false" },
6+
"focusableWhenDisabled": { "type": { "name": "bool" }, "default": "true" },
7+
"icon": { "type": { "name": "element" } },
8+
"label": { "type": { "name": "string" }, "default": "'Remove'" },
9+
"nativeButton": { "type": { "name": "bool" } },
10+
"sx": {
11+
"type": {
12+
"name": "union",
13+
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
14+
},
15+
"additionalInfo": { "sx": true }
16+
}
17+
},
18+
"name": "ChipDelete",
19+
"imports": [
20+
"import ChipDelete from '@mui/material/ChipDelete';",
21+
"import { ChipDelete } from '@mui/material';"
22+
],
23+
"classes": [
24+
{
25+
"key": "colorDefault",
26+
"className": "MuiChipDelete-colorDefault",
27+
"description": "Styles applied to the root element if `color=\"default\"`.",
28+
"isGlobal": false
29+
},
30+
{
31+
"key": "colorError",
32+
"className": "MuiChipDelete-colorError",
33+
"description": "Styles applied to the root element if `color=\"error\"`.",
34+
"isGlobal": false
35+
},
36+
{
37+
"key": "colorInfo",
38+
"className": "MuiChipDelete-colorInfo",
39+
"description": "Styles applied to the root element if `color=\"info\"`.",
40+
"isGlobal": false
41+
},
42+
{
43+
"key": "colorPrimary",
44+
"className": "MuiChipDelete-colorPrimary",
45+
"description": "Styles applied to the root element if `color=\"primary\"`.",
46+
"isGlobal": false
47+
},
48+
{
49+
"key": "colorSecondary",
50+
"className": "MuiChipDelete-colorSecondary",
51+
"description": "Styles applied to the root element if `color=\"secondary\"`.",
52+
"isGlobal": false
53+
},
54+
{
55+
"key": "colorSuccess",
56+
"className": "MuiChipDelete-colorSuccess",
57+
"description": "Styles applied to the root element if `color=\"success\"`.",
58+
"isGlobal": false
59+
},
60+
{
61+
"key": "colorWarning",
62+
"className": "MuiChipDelete-colorWarning",
63+
"description": "Styles applied to the root element if `color=\"warning\"`.",
64+
"isGlobal": false
65+
},
66+
{
67+
"key": "disabled",
68+
"className": "Mui-disabled",
69+
"description": "State class applied to the root element if `disabled={true}`.",
70+
"isGlobal": true
71+
},
72+
{
73+
"key": "filled",
74+
"className": "MuiChipDelete-filled",
75+
"description": "Styles applied to the root element if `variant=\"filled\"`.",
76+
"isGlobal": false
77+
},
78+
{
79+
"key": "focusVisible",
80+
"className": "Mui-focusVisible",
81+
"description": "State class applied when the delete button is keyboard-focused.",
82+
"isGlobal": true
83+
},
84+
{
85+
"key": "outlined",
86+
"className": "MuiChipDelete-outlined",
87+
"description": "Styles applied to the root element if `variant=\"outlined\"`.",
88+
"isGlobal": false
89+
},
90+
{
91+
"key": "root",
92+
"className": "MuiChipDelete-root",
93+
"description": "Styles applied to the root element.",
94+
"isGlobal": false
95+
},
96+
{
97+
"key": "sizeMedium",
98+
"className": "MuiChipDelete-sizeMedium",
99+
"description": "Styles applied to the root element if `size=\"medium\"`.",
100+
"isGlobal": false
101+
},
102+
{
103+
"key": "sizeSmall",
104+
"className": "MuiChipDelete-sizeSmall",
105+
"description": "Styles applied to the root element if `size=\"small\"`.",
106+
"isGlobal": false
107+
}
108+
],
109+
"spread": true,
110+
"themeDefaultProps": null,
111+
"muiName": "MuiChipDelete",
112+
"filename": "/packages/mui-material/src/ChipDelete/ChipDelete.tsx",
113+
"inheritance": null,
114+
"demos": "<ul><li><a href=\"/material-ui/react-chip/\">Chip</a></li></ul>",
115+
"cssComponent": false
116+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from 'react';
2+
import ApiPage from 'docs/src/modules/components/ApiPage';
3+
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
4+
import jsonPageContent from './chip-link.json';
5+
6+
export default function Page(props) {
7+
const { descriptions } = props;
8+
return <ApiPage descriptions={descriptions} pageContent={jsonPageContent} />;
9+
}
10+
11+
export async function getStaticProps() {
12+
const req = require.context(
13+
'docs/translations/api-docs/chip-link',
14+
false,
15+
/\.\/chip-link.*\.json$/,
16+
);
17+
const descriptions = mapApiPageTranslations(req);
18+
19+
return { props: { descriptions } };
20+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"props": {
3+
"href": { "type": { "name": "string" }, "required": true },
4+
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
5+
"sx": {
6+
"type": {
7+
"name": "union",
8+
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
9+
},
10+
"additionalInfo": { "sx": true }
11+
}
12+
},
13+
"name": "ChipLink",
14+
"imports": [
15+
"import ChipLink from '@mui/material/ChipLink';",
16+
"import { ChipLink } from '@mui/material';"
17+
],
18+
"classes": [
19+
{
20+
"key": "root",
21+
"className": "MuiChipLink-root",
22+
"description": "Styles applied to the root element.",
23+
"isGlobal": false
24+
}
25+
],
26+
"spread": true,
27+
"themeDefaultProps": null,
28+
"muiName": "MuiChipLink",
29+
"filename": "/packages/mui-material/src/ChipLink/ChipLink.tsx",
30+
"inheritance": null,
31+
"demos": "<ul><li><a href=\"/material-ui/react-chip/\">Chip</a></li></ul>",
32+
"cssComponent": false
33+
}

docs/pages/material-ui/api/chip.json

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
{
22
"props": {
3-
"avatar": { "type": { "name": "element" } },
3+
"action": { "type": { "name": "element" } },
4+
"avatar": {
5+
"type": { "name": "element" },
6+
"deprecated": true,
7+
"deprecationInfo": "Use <code>startAdornment</code> instead. Ignored when <code>startAdornment</code> is present."
8+
},
49
"children": { "type": { "name": "custom", "description": "unsupportedProp" } },
510
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
6-
"clickable": { "type": { "name": "bool" } },
11+
"clickable": {
12+
"type": { "name": "bool" },
13+
"deprecated": true,
14+
"deprecationInfo": "Use <code>action={&lt;ChipButton onClick={...} /&gt;}</code> instead. Ignored when <code>action</code> is present."
15+
},
716
"color": {
817
"type": {
918
"name": "union",
@@ -12,31 +21,53 @@
1221
"default": "'default'"
1322
},
1423
"component": { "type": { "name": "elementType" } },
15-
"deleteIcon": { "type": { "name": "element" } },
24+
"deleteIcon": {
25+
"type": { "name": "element" },
26+
"deprecated": true,
27+
"deprecationInfo": "Use <code>endAdornment={&lt;ChipDelete /&gt;}</code> instead. Ignored when <code>endAdornment</code> is present."
28+
},
1629
"disabled": { "type": { "name": "bool" }, "default": "false" },
17-
"icon": { "type": { "name": "element" } },
30+
"endAdornment": { "type": { "name": "node" } },
31+
"icon": {
32+
"type": { "name": "element" },
33+
"deprecated": true,
34+
"deprecationInfo": "Use <code>startAdornment</code> instead. Ignored when <code>startAdornment</code> is present."
35+
},
1836
"label": { "type": { "name": "node" } },
1937
"nativeButton": { "type": { "name": "bool" } },
20-
"onDelete": { "type": { "name": "func" } },
38+
"onDelete": {
39+
"type": { "name": "func" },
40+
"deprecated": true,
41+
"deprecationInfo": "Use <code>endAdornment={&lt;ChipDelete onClick={...} /&gt;}</code> instead. Ignored when <code>endAdornment</code> is present."
42+
},
2143
"size": {
2244
"type": {
2345
"name": "union",
2446
"description": "'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;string"
2547
},
2648
"default": "'medium'"
2749
},
28-
"skipFocusWhenDisabled": { "type": { "name": "bool" }, "default": "false" },
50+
"skipFocusWhenDisabled": {
51+
"type": { "name": "bool" },
52+
"default": "false",
53+
"deprecated": true,
54+
"deprecationInfo": "Use <code>focusableWhenDisabled</code> on the action element instead."
55+
},
2956
"slotProps": {
3057
"type": {
3158
"name": "shape",
32-
"description": "{ label?: func<br>&#124;&nbsp;object, root?: func<br>&#124;&nbsp;object }"
59+
"description": "{ endAdornment?: func<br>&#124;&nbsp;object, label?: func<br>&#124;&nbsp;object, root?: func<br>&#124;&nbsp;object, startAdornment?: func<br>&#124;&nbsp;object }"
3360
},
3461
"default": "{}"
3562
},
3663
"slots": {
37-
"type": { "name": "shape", "description": "{ label?: elementType, root?: elementType }" },
64+
"type": {
65+
"name": "shape",
66+
"description": "{ endAdornment?: elementType, label?: elementType, root?: elementType, startAdornment?: elementType }"
67+
},
3868
"default": "{}"
3969
},
70+
"startAdornment": { "type": { "name": "node" } },
4071
"sx": {
4172
"type": {
4273
"name": "union",
@@ -66,9 +97,27 @@
6697
"description": "The component that renders the label.",
6798
"default": "span",
6899
"class": "MuiChip-label"
100+
},
101+
{
102+
"name": "startAdornment",
103+
"description": "The component that renders the start adornment wrapper.",
104+
"default": "span",
105+
"class": "MuiChip-startAdornment"
106+
},
107+
{
108+
"name": "endAdornment",
109+
"description": "The component that renders the end adornment wrapper.",
110+
"default": "span",
111+
"class": "MuiChip-endAdornment"
69112
}
70113
],
71114
"classes": [
115+
{
116+
"key": "actionable",
117+
"className": "MuiChip-actionable",
118+
"description": "Styles applied to the root element when `action` is provided.",
119+
"isGlobal": false
120+
},
72121
{
73122
"key": "avatar",
74123
"className": "MuiChip-avatar",

0 commit comments

Comments
 (0)