-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e14cf39
commit 9400e99
Showing
39 changed files
with
1,723 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
productId: base-ui | ||
title: React Accordion components | ||
components: AccordionRoot, AccordionSection, AccordionHeading, AccordionTrigger, AccordionPanel | ||
hooks: useAccordionRoot | ||
githubLabel: 'component: accordion' | ||
waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/accordion/ | ||
packageName: '@base_ui/react' | ||
--- | ||
|
||
# Accordion | ||
|
||
<p class="description">Accordion is a stacked set of interactive headings that each reveal an associated section of content.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"props": { | ||
"className": { "type": { "name": "union", "description": "func<br>| string" } }, | ||
"render": { "type": { "name": "union", "description": "element<br>| func" } } | ||
}, | ||
"name": "AccordionHeading", | ||
"imports": [ | ||
"import * as Accordion from '@base_ui/react/Accordion';\nconst AccordionHeading = Accordion.Heading;" | ||
], | ||
"classes": [], | ||
"spread": true, | ||
"themeDefaultProps": true, | ||
"muiName": "AccordionHeading", | ||
"forwardsRefTo": "HTMLHeadingElement", | ||
"filename": "/packages/mui-base/src/Accordion/Heading/AccordionHeading.tsx", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/base-ui/react-accordion/\">Accordion</a></li></ul>", | ||
"cssComponent": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"props": { | ||
"className": { "type": { "name": "union", "description": "func<br>| string" } }, | ||
"htmlHidden": { | ||
"type": { "name": "enum", "description": "'hidden'<br>| 'until-found'" }, | ||
"default": "'hidden'" | ||
}, | ||
"render": { "type": { "name": "union", "description": "element<br>| func" } } | ||
}, | ||
"name": "AccordionPanel", | ||
"imports": [ | ||
"import * as Accordion from '@base_ui/react/Accordion';\nconst AccordionPanel = Accordion.Panel;" | ||
], | ||
"classes": [], | ||
"spread": true, | ||
"themeDefaultProps": true, | ||
"muiName": "AccordionPanel", | ||
"forwardsRefTo": "HTMLDivElement", | ||
"filename": "/packages/mui-base/src/Accordion/Panel/AccordionPanel.tsx", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/base-ui/react-accordion/\">Accordion</a></li></ul>", | ||
"cssComponent": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"props": { | ||
"animated": { "type": { "name": "bool" }, "default": "true" }, | ||
"className": { "type": { "name": "union", "description": "func<br>| string" } }, | ||
"defaultValue": { | ||
"type": { "name": "arrayOf", "description": "Array<number<br>| string>" }, | ||
"default": "0" | ||
}, | ||
"disabled": { "type": { "name": "bool" }, "default": "false" }, | ||
"onOpenChange": { "type": { "name": "func" } }, | ||
"render": { "type": { "name": "union", "description": "element<br>| func" } }, | ||
"value": { | ||
"type": { "name": "arrayOf", "description": "Array<number<br>| string>" } | ||
} | ||
}, | ||
"name": "AccordionRoot", | ||
"imports": [ | ||
"import * as Accordion from '@base_ui/react/Accordion';\nconst AccordionRoot = Accordion.Root;" | ||
], | ||
"classes": [], | ||
"spread": true, | ||
"themeDefaultProps": true, | ||
"muiName": "AccordionRoot", | ||
"forwardsRefTo": "HTMLDivElement", | ||
"filename": "/packages/mui-base/src/Accordion/Root/AccordionRoot.tsx", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/base-ui/react-accordion/\">Accordion</a></li></ul>", | ||
"cssComponent": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"props": { | ||
"className": { "type": { "name": "union", "description": "func<br>| string" } }, | ||
"disabled": { "type": { "name": "bool" }, "default": "false" }, | ||
"onOpenChange": { "type": { "name": "func" } }, | ||
"render": { "type": { "name": "union", "description": "element<br>| func" } } | ||
}, | ||
"name": "AccordionSection", | ||
"imports": [ | ||
"import * as Accordion from '@base_ui/react/Accordion';\nconst AccordionSection = Accordion.Section;" | ||
], | ||
"classes": [], | ||
"spread": true, | ||
"themeDefaultProps": true, | ||
"muiName": "AccordionSection", | ||
"forwardsRefTo": "HTMLDivElement", | ||
"filename": "/packages/mui-base/src/Accordion/Section/AccordionSection.tsx", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/base-ui/react-accordion/\">Accordion</a></li></ul>", | ||
"cssComponent": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"props": { | ||
"className": { "type": { "name": "union", "description": "func<br>| string" } }, | ||
"render": { "type": { "name": "union", "description": "element<br>| func" } } | ||
}, | ||
"name": "AccordionTrigger", | ||
"imports": [ | ||
"import * as Accordion from '@base_ui/react/Accordion';\nconst AccordionTrigger = Accordion.Trigger;" | ||
], | ||
"classes": [], | ||
"spread": true, | ||
"themeDefaultProps": true, | ||
"muiName": "AccordionTrigger", | ||
"forwardsRefTo": "HTMLButtonElement", | ||
"filename": "/packages/mui-base/src/Accordion/Trigger/AccordionTrigger.tsx", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/base-ui/react-accordion/\">Accordion</a></li></ul>", | ||
"cssComponent": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"parameters": {}, | ||
"returnValue": {}, | ||
"name": "useAccordionRoot", | ||
"filename": "/packages/mui-base/src/Accordion/Root/useAccordionRoot.ts", | ||
"imports": ["import { useAccordionRoot } from '@base_ui/react/Accordion';"], | ||
"demos": "<ul><li><a href=\"/base-ui/react-accordion/#hook\">Accordion</a></li></ul>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocsV2'; | ||
import AppFrame from 'docs/src/modules/components/AppFrame'; | ||
import * as pageProps from 'docs-base/data/base/components/accordion/accordion.md?@mui/markdown'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import AccordionHeadingApiJsonPageContent from '../../api/accordion-heading.json'; | ||
import AccordionPanelApiJsonPageContent from '../../api/accordion-panel.json'; | ||
import AccordionRootApiJsonPageContent from '../../api/accordion-root.json'; | ||
import AccordionSectionApiJsonPageContent from '../../api/accordion-section.json'; | ||
import AccordionTriggerApiJsonPageContent from '../../api/accordion-trigger.json'; | ||
import useAccordionRootApiJsonPageContent from '../../api/use-accordion-root.json'; | ||
|
||
export default function Page(props) { | ||
const { userLanguage, ...other } = props; | ||
return <MarkdownDocs {...pageProps} {...other} />; | ||
} | ||
|
||
Page.getLayout = (page) => { | ||
return <AppFrame>{page}</AppFrame>; | ||
}; | ||
|
||
export const getStaticPaths = () => { | ||
return { | ||
paths: [{ params: { docsTab: 'components-api' } }, { params: { docsTab: 'hooks-api' } }], | ||
fallback: false, // can also be true or 'blocking' | ||
}; | ||
}; | ||
|
||
export const getStaticProps = () => { | ||
const AccordionHeadingApiReq = require.context( | ||
'docs-base/translations/api-docs/accordion-heading', | ||
false, | ||
/\.\/accordion-heading.*.json$/, | ||
); | ||
const AccordionHeadingApiDescriptions = mapApiPageTranslations(AccordionHeadingApiReq); | ||
|
||
const AccordionPanelApiReq = require.context( | ||
'docs-base/translations/api-docs/accordion-panel', | ||
false, | ||
/\.\/accordion-panel.*.json$/, | ||
); | ||
const AccordionPanelApiDescriptions = mapApiPageTranslations(AccordionPanelApiReq); | ||
|
||
const AccordionRootApiReq = require.context( | ||
'docs-base/translations/api-docs/accordion-root', | ||
false, | ||
/\.\/accordion-root.*.json$/, | ||
); | ||
const AccordionRootApiDescriptions = mapApiPageTranslations(AccordionRootApiReq); | ||
|
||
const AccordionSectionApiReq = require.context( | ||
'docs-base/translations/api-docs/accordion-section', | ||
false, | ||
/\.\/accordion-section.*.json$/, | ||
); | ||
const AccordionSectionApiDescriptions = mapApiPageTranslations(AccordionSectionApiReq); | ||
|
||
const AccordionTriggerApiReq = require.context( | ||
'docs-base/translations/api-docs/accordion-trigger', | ||
false, | ||
/\.\/accordion-trigger.*.json$/, | ||
); | ||
const AccordionTriggerApiDescriptions = mapApiPageTranslations(AccordionTriggerApiReq); | ||
|
||
const useAccordionRootApiReq = require.context( | ||
'docs-base/translations/api-docs/use-accordion-root', | ||
false, | ||
/\.\/use-accordion-root.*.json$/, | ||
); | ||
const useAccordionRootApiDescriptions = mapApiPageTranslations(useAccordionRootApiReq); | ||
|
||
return { | ||
props: { | ||
componentsApiDescriptions: { | ||
AccordionHeading: AccordionHeadingApiDescriptions, | ||
AccordionPanel: AccordionPanelApiDescriptions, | ||
AccordionRoot: AccordionRootApiDescriptions, | ||
AccordionSection: AccordionSectionApiDescriptions, | ||
AccordionTrigger: AccordionTriggerApiDescriptions, | ||
}, | ||
componentsApiPageContents: { | ||
AccordionHeading: AccordionHeadingApiJsonPageContent, | ||
AccordionPanel: AccordionPanelApiJsonPageContent, | ||
AccordionRoot: AccordionRootApiJsonPageContent, | ||
AccordionSection: AccordionSectionApiJsonPageContent, | ||
AccordionTrigger: AccordionTriggerApiJsonPageContent, | ||
}, | ||
hooksApiDescriptions: { useAccordionRoot: useAccordionRootApiDescriptions }, | ||
hooksApiPageContents: { useAccordionRoot: useAccordionRootApiJsonPageContent }, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocsV2'; | ||
import AppFrame from 'docs/src/modules/components/AppFrame'; | ||
import * as pageProps from 'docs-base/data/base/components/accordion/accordion.md?@mui/markdown'; | ||
|
||
export default function Page(props) { | ||
const { userLanguage, ...other } = props; | ||
return <MarkdownDocs {...pageProps} {...other} />; | ||
} | ||
|
||
Page.getLayout = (page) => { | ||
return <AppFrame>{page}</AppFrame>; | ||
}; |
Oops, something went wrong.