Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create initial docusaurus site * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * add props table * add version dropdown to navbar * fix prop table render * fix code examples * add component api to TOC * bump react * fix sidebar positions * fix props table parsing * fix some components not being processed by react docgen * delete old www * rename www2 to www * cleanup and styles * fix images in examples, cleanup * fix build * fix * point rb to local src dir * address feedback * wip * update deps * tweak colors
- Loading branch information
Showing
455 changed files
with
10,645 additions
and
18,092 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
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,20 @@ | ||
node_modules/ | ||
public/ | ||
.cache/ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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,25 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. |
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,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
{ | ||
"label": "Components", | ||
"position": 4 | ||
} |
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,101 @@ | ||
--- | ||
title: Accordion | ||
description: Build vertically collapsing accordions in combination with the Collapse component | ||
--- | ||
|
||
import Basic from '!!raw-loader!../examples/Accordion/Basic'; | ||
import AllCollapse from '!!raw-loader!../examples/Accordion/AllCollapse'; | ||
import Flush from '!!raw-loader!../examples/Accordion/Flush'; | ||
import AlwaysOpen from '!!raw-loader!../examples/Accordion/AlwaysOpen'; | ||
import CustomToggle from '!!raw-loader!../examples/Accordion/CustomToggle.js'; | ||
import ContextAwareToggle from '!!raw-loader!../examples/Accordion/ContextAwareToggle.js'; | ||
|
||
## Examples | ||
|
||
Click the accordions below to expand/collapse the accordion content. | ||
|
||
### Basic Example | ||
|
||
<CodeBlock language="jsx" live> | ||
{Basic} | ||
</CodeBlock> | ||
|
||
### Fully Collapsed State | ||
|
||
If you want your `Accordion` to start in a fully-collapsed state, then simply don't pass in a `defaultActiveKey` prop to `Accordion`. | ||
|
||
<CodeBlock language="jsx" live> | ||
{AllCollapse} | ||
</CodeBlock> | ||
|
||
### Flush | ||
|
||
Add `flush` to remove the default background-color, some borders, and some rounded corners to render accordions edge-to-edge with their parent container. | ||
|
||
<CodeBlock language="jsx" live> | ||
{Flush} | ||
</CodeBlock> | ||
|
||
### Always open | ||
|
||
You can make accordion items stay open when another item is opened by using the `alwaysOpen` prop. If you're looking to | ||
control the component, you must use an array of strings for `activeKey` or `defaultActiveKey`. | ||
|
||
<CodeBlock language="jsx" live> | ||
{AlwaysOpen} | ||
</CodeBlock> | ||
|
||
## Custom Accordions | ||
|
||
You can still create card-based accordions like those in Bootstrap 4. You can hook | ||
into the Accordion toggle functionality via `useAccordionButton` to make custom | ||
toggle components. | ||
|
||
### Custom Toggle | ||
|
||
<CodeBlock language="jsx" live noInline> | ||
{CustomToggle} | ||
</CodeBlock> | ||
|
||
### Custom Toggle with Expansion Awareness | ||
|
||
You may wish to have different styles for the toggle if it's associated section is expanded, | ||
this can be achieved with a custom toggle that is context aware and also takes advantage of the `useAccordionButton` hook. | ||
|
||
<CodeBlock language="jsx" live noInline> | ||
{ContextAwareToggle} | ||
</CodeBlock> | ||
|
||
## API | ||
|
||
### Accordion | ||
|
||
<PropsTable name="Accordion" /> | ||
|
||
### AccordionItem | ||
|
||
<PropsTable name="AccordionItem" /> | ||
|
||
### AccordionHeader | ||
|
||
<PropsTable name="AccordionHeader" /> | ||
|
||
### AccordionBody | ||
|
||
<PropsTable name="AccordionBody" /> | ||
|
||
### AccordionButton | ||
|
||
<PropsTable name="AccordionButton" /> | ||
|
||
### AccordionCollapse | ||
|
||
<PropsTable name="AccordionCollapse" /> | ||
|
||
### useAccordionButton | ||
|
||
```jsx | ||
import { useAccordionButton } from 'react-bootstrap/AccordionButton'; | ||
|
||
const decoratedOnClick = useAccordionButton(eventKey, onClick); | ||
``` |
Oops, something went wrong.