Skip to content
This repository was archived by the owner on Nov 16, 2022. It is now read-only.

Commit 8265051

Browse files
committed
[APIs] Added API pages for all of components.
1 parent e8c4841 commit 8265051

File tree

21 files changed

+221
-13
lines changed

21 files changed

+221
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"license": "MIT",
3131
"dependencies": {
3232
"@craco/craco": "^5.6.4",
33-
"@material-docs/core": "^0.4.7",
33+
"@material-docs/core": "^0.4.9",
3434
"@material-docs/react-components-docs-extension": "^0.2.0",
3535
"@material-ui/core": "^4.11.0",
3636
"@material-ui/icons": "^4.9.1",

src/Documentation.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ import ReactComponentApiPageDemo
6868
from "./pages/Extensions/ReactComponentsDocsExtension/Components/ReactComponentApiPageDemo";
6969
import CodeDemo from "./pages/Components/CodeDemo";
7070
import TablesDemo from "./pages/Components/TablesDemo";
71+
import LangProviderAPI from "./pages/APIs/LangProviderAPI";
72+
import LocaleAPI from "./pages/APIs/LocaleAPI";
73+
import LandingAPI from "./pages/APIs/LandingAPI";
74+
import LinkAPI from "./pages/APIs/LinkAPI";
7175

7276

7377
export default function Documentation() {
@@ -153,7 +157,11 @@ export default function Documentation() {
153157
<H6API/>
154158
<HeaderAPI/>
155159
<AutoDocsMenuAPI/>
160+
<LocaleAPI/>
161+
<LandingAPI/>
162+
<LinkAPI/>
156163
<PagesGroup name={"System components"}>
164+
<LangProviderAPI/>
157165
<LanguageSelectorAPI/>
158166
<SearchFieldAPI/>
159167
<TagableAPI/>

src/components/ApiPage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export default function ApiPage(props, ref) {
5050
<ReactComponentApiPage
5151
name={name}
5252
searchDescription={locale.searchDescription}
53+
searchLabel={name + " API"}
5354
searchTags={searchTags}
5455
>
5556
<ReactComponentApiPageSummary>

src/locale/EN.json

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,11 @@
182182
"noTag": "If true and name prop is defined - header with name will not generate tag for content tab.",
183183
"paperContainer": "If true - demo content will be wrapped in Paper component.",
184184
"actions": "Array of additional actions. The actions will be displayed in the dropdown menu when you click the ExpandMore icon button.",
185-
"p": "Padding of demo block in theme.spacing units.",
186-
"m": "Margin of demo block in theme.spacing units.",
185+
"p": "Padding of demo block in _theme.spacing_ units.",
186+
"m": "Margin of demo block in _theme.spacing_ units.",
187+
"theme": "Code highlighting and background styling type.",
188+
"themeLight": "Code highlighting and background styling type when global theme in light mode.",
189+
"themeDark": "Code highlighting and background styling type when global theme in dark mode.",
187190
"children": "Children of an element. Will be placed in demo block."
188191
},
189192
"css": {
@@ -206,6 +209,8 @@
206209
"props": {
207210
"language": "Language name for code highlighter.",
208211
"theme": "Code highlighting and background styling type.",
212+
"themeLight": "Code highlighting and background styling type when global theme in light mode.",
213+
"themeDark": "Code highlighting and background styling type when global theme in dark mode.",
209214
"children": "Code to display in code highlighter."
210215
},
211216
"css": {
@@ -225,10 +230,67 @@
225230
"name": "Name of the group. Will be displayed on button in menu.",
226231
"getData": "Callback, provided to get group data without context usage.",
227232
"order": "As lower order as higher will be displayed menu item.",
233+
"defaultExpanded": "If true, menu group will be expanded on startup.",
234+
"children": "Children of an element."
235+
},
236+
"css": {}
237+
},
238+
"LandingAPI": {
239+
"searchDescription": "Landing - react component, designed to provide documentation with free style landing page.",
240+
"searchTags": {
241+
"page": "page",
242+
"landing": "landing",
243+
"container": "container"
244+
},
245+
"props": {
228246
"children": "Children of an element."
229247
},
230248
"css": {}
231249
},
250+
"LangProviderAPI": {
251+
"searchDescription": "LangProvider - react component, designed to provide children with locale lang settings.",
252+
"searchTags": {
253+
"page": "page",
254+
"lang": "lang",
255+
"provider": "provider",
256+
"locale": "locale",
257+
"container": "container"
258+
},
259+
"props": {
260+
"lang": "lang extension, will be merged with main lang. To main lang will be added fields from provider lang if in main lang they are not defined.",
261+
"children": "Children of an element."
262+
},
263+
"css": {}
264+
},
265+
"LocaleAPI": {
266+
"searchDescription": "Locale - react component, designed to provide user with flexible locale access.",
267+
"searchTags": {
268+
"locale": "locale",
269+
"lang": "lang"
270+
},
271+
"props": {
272+
"path": "Path to the data in the Lang.locale. Exampele: \"hello/darkness/my\".",
273+
"children": "Children of an element. Will be displayed by default if can not load data from Lang."
274+
},
275+
"css": {}
276+
},
277+
"LinkAPI": {
278+
"searchDescription": "Link - react component, designed to create links to outside resource or inner docs page.",
279+
"searchTags": {
280+
"link": "link",
281+
"page": "page",
282+
"href": "href",
283+
"redirect": "redirect"
284+
},
285+
"props": {
286+
"page": "Page route. Can be passed as string or as array of routes.",
287+
"href": "Link to external resource.",
288+
"children": "Children of an element. Will be displayed by default if can not load data from Lang."
289+
},
290+
"css": {
291+
"root": "Styles applied to the root element."
292+
}
293+
},
232294
"ImageAPI": {
233295
"searchDescription": "Image - react component, designed to show images. Image component uses lazy load technology.",
234296
"searchTags": {
@@ -242,8 +304,10 @@
242304
},
243305
"props": {
244306
"src": "Source link. Used to define image path.",
307+
"placeholderSrc": "Src of low quality image, which will be displayed while main image is loading.",
245308
"alt": "Alternative text. Will be displayed if image can not load.",
246309
"fullWidth": "If true - image will be 100 percent wide.",
310+
"frame": "If true, image will be placed inside decorative border frame.",
247311
"children": "Elements, which will appear in image caption."
248312
},
249313
"css": {
@@ -288,6 +352,8 @@
288352
"collapsedHeight": "Height of the component when it is collapsed.",
289353
"actions": "Array of additional actions. The actions will be displayed in the dropdown menu when you click the ExpandMore icon button.",
290354
"theme": "Code highlighting and background styling type.",
355+
"themeLight": "Code highlighting and background styling type when global theme in light mode.",
356+
"themeDark": "Code highlighting and background styling type when global theme in dark mode.",
291357
"language": "Language name for code highlighter.",
292358
"children": "Code to display in code highlighter. This code will appear in the Code block if component is expanded."
293359
},
@@ -699,6 +765,8 @@
699765
"name": "Name of the docs. Needs for metadata. Will be displayed in app header. Also you can find this name near version label in side menu drawer.",
700766
"version": "Version of the docs. Needs for metadata.",
701767
"logo": "A path to the logo image, will be displayed in drawer near name and version.",
768+
"onNameClick": "Callback, designed to handle click on docs name in drawer badge.",
769+
"onVersionClick": "Callback, designed to handle click on docs version in drawer badge.",
702770
"children": "Children of an element. Normally DocsMenu and DocsPages."
703771
},
704772
"forwardRef": true,

src/pages/APIs/BoldAPI/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function BoldAPI() {
2222
localeName={"BoldAPI"}
2323
importCode={importCode}
2424
properties={[
25-
{name: "chidlren", type: "node", default: "", description: locale.props.children},
25+
{name: "children", type: "node", default: "", description: locale.props.children},
2626
]}
2727
css={[
2828
{name: "root", global: "MatDocs-root", description: locale.css.root},

src/pages/APIs/CodeAPI/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export default function CodeAPI() {
2222
importCode={importCode}
2323
properties={[
2424
{name: "language", type: "string", default: "\"javascript\"", description: locale.props.language},
25-
{name: "theme", type: "\"light\" | \"dark\" | \"darcula\"", default: "\"light\"", description: locale.props.theme},
25+
{name: "theme", type: "\"light\" | \"dark\" | \"darcula\"", default: "", description: locale.props.theme},
26+
{name: "themeLight", type: "\"light\" | \"dark\" | \"darcula\"", default: "\"light\"", description: locale.props.themeLight},
27+
{name: "themeDark", type: "\"light\" | \"dark\" | \"darcula\"", default: "\"dark\"", description: locale.props.themeDark},
2628
{name: "children", type: "string", default: "", description: locale.props.children},
2729
]}
2830
css={[

src/pages/APIs/DemoWithCodeAPI/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export default function DemoWithCodeAPI() {
3232
{name: "p", type: "number", default: "0", description: locale.props.p},
3333
{name: "m", type: "number", default: "0", description: locale.props.m},
3434
{name: "children", type: "node", default: "", description: locale.props.children},
35+
{name: "theme", type: "\"light\" | \"dark\" | \"darcula\"", default: "", description: locale.props.theme},
36+
{name: "themeLight", type: "\"light\" | \"dark\" | \"darcula\"", default: "\"light\"", description: locale.props.themeLight},
37+
{name: "themeDark", type: "\"light\" | \"dark\" | \"darcula\"", default: "\"dark\"", description: locale.props.themeDark},
3538
]}
3639
css={[
3740
{name: "root", global: "MatDoc-root", description: locale.css.root},

src/pages/APIs/DocsLayoutAPI/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export default function DocsLayoutAPI() {
4040
{name: "name", type: "string", default: "", description: locale.props.name},
4141
{name: "version", type: "string", default: "", description: locale.props.version},
4242
{name: "logo", type: "string", default: "", description: locale.props.logo},
43+
{name: "onNameClick", type: "function(event: Event): void", default: "", description: locale.props.logo},
44+
{name: "onVersionClick", type: "function(event: Event): void", default: "", description: locale.props.logo},
4345
{name: "children", type: "node", default: "", description: locale.props.children},
4446
]}
4547
css={[

src/pages/APIs/ExpansionCodeAPI/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export default function ExpansionCodeAPI() {
2626
{name: "noTag", type: "boolean", default: "false", description: locale.props.noTag},
2727
{name: "collapsedHeight", type: "number | string", default: "100px", description: locale.props.collapsedHeight},
2828
{name: "actions", type: "DemoCodeAction[]", default: "", description: locale.props.actions},
29-
{name: "theme", type: "\"light\" | \"dark\" | \"darcula\"", default: "\"light\"", description: locale.props.theme},
29+
{name: "theme", type: "\"light\" | \"dark\" | \"darcula\"", default: "", description: locale.props.theme},
30+
{name: "themeLight", type: "\"light\" | \"dark\" | \"darcula\"", default: "\"light\"", description: locale.props.themeLight},
31+
{name: "themeDark", type: "\"light\" | \"dark\" | \"darcula\"", default: "\"dark\"", description: locale.props.themeDark},
3032
{name: "language", type: "string", default: "\"javascript\"", description: locale.props.language},
3133
{name: "children", type: "node", default: "", description: locale.props.children},
3234
]}

src/pages/APIs/ImageAPI/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ export default function ImageAPI() {
2323
importCode={importCode}
2424
properties={[
2525
{name: "src", type: "string", default: "", description: locale.props.src},
26+
{name: "placeholderSrc", type: "string", default: "", description: locale.props.placeholderSrc},
2627
{name: "alt", type: "string", default: "", description: locale.props.alt},
2728
{name: "fullWidth", type: "boolean", default: "false", description: locale.props.fullWidth},
29+
{name: "frame", type: "boolean", default: "false", description: locale.props.frame},
2830
{name: "children", type: "node", default: "", description: locale.props.children},
2931
]}
3032
css={[

0 commit comments

Comments
 (0)