-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(FDS-347): [DOCS] - Add docs for new components P1 (#273)
Co-authored-by: Manu Ramirez <manu.ramirez@espressive.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
d887236
commit 9f06ae1
Showing
12 changed files
with
258 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
title: ActionStack | ||
propTable: ActionStack.js | ||
status: 'ALPHA' | ||
--- | ||
|
||
# Public API | ||
|
||
WARNING! This is an alpha release so we can try to get this code in and working to kick the tires. | ||
|
||
## `actions` | ||
|
||
This is an array of objects used to tell ActionStack what to display. The `label` prop is the text for clickable element. The `onClick` prop is the click handler. | ||
|
||
```jsx | ||
--- | ||
title: ActionStack with Actions | ||
--- | ||
<ActionStack | ||
actions={[ | ||
{ | ||
"label": "Action 1", | ||
onClick: console.log | ||
}, | ||
{ | ||
"label": "Action 2", | ||
onClick: console.log | ||
}, | ||
{ | ||
"label": "Action 3", | ||
onClick: console.log | ||
}, | ||
{ | ||
"label": "Action 4", | ||
onClick: console.log | ||
}, | ||
]} | ||
/> | ||
``` | ||
|
||
## `dropdownIndex` | ||
|
||
A number specifying the index at which `actions` start to appear as dropdown items. The following example would render actions 1 and 2 as buttons and actions 4 and 4 as a dropdown items. | ||
|
||
```jsx | ||
--- | ||
title: ActionStack with dropdownIndex | ||
--- | ||
<ActionStack | ||
actions={[ | ||
{ | ||
"label": "Action 1", | ||
onClick: console.log | ||
}, | ||
{ | ||
"label": "Action 2", | ||
onClick: console.log | ||
}, | ||
{ | ||
"label": "Action 3", | ||
onClick: console.log | ||
}, | ||
{ | ||
"label": "Action 4", | ||
onClick: console.log | ||
}, | ||
]} | ||
dropdownIndex={2} | ||
/> | ||
``` |
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
File renamed without changes.
File renamed without changes.
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,56 @@ | ||
--- | ||
title: List | ||
propTable: List.js | ||
status: 'ALPHA' | ||
--- | ||
|
||
# Public API | ||
|
||
WARNING! This is an alpha release so we can try to get this code in and working to kick the tires. | ||
|
||
## `data` | ||
|
||
This is an array of objects used to tell List what to display. | ||
|
||
```jsx | ||
--- | ||
title: List that displays an avatar, name and description | ||
--- | ||
<List | ||
data={[ | ||
{ | ||
pre: ( | ||
<img | ||
alt='avatar' | ||
className='ui avatar image' | ||
src='https://i.pravatar.cc/150?img=1' | ||
/> | ||
), | ||
label: 'Jack Wilshere', | ||
description: 'Central Attacking Midfielder', | ||
}, | ||
{ | ||
pre: ( | ||
<img | ||
alt='avatar' | ||
className='ui avatar image' | ||
src='https://i.pravatar.cc/150?img=2' | ||
/> | ||
), | ||
label: 'Carlos Vela', | ||
// description: 'Central Forward', | ||
}, | ||
{ | ||
pre: ( | ||
<img | ||
alt='avatar' | ||
className='ui avatar image' | ||
src='https://i.pravatar.cc/150?img=3' | ||
/> | ||
), | ||
label: 'Hector Bellerin', | ||
description: 'Right Back', | ||
}, | ||
]} | ||
/> | ||
``` |
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,51 @@ | ||
--- | ||
title: Pagination | ||
propTable: Pagination.js | ||
status: 'ALPHA' | ||
--- | ||
|
||
# Public API | ||
|
||
WARNING! This is an alpha release so we can try to get this code in and working to kick the tires. | ||
|
||
## Loading | ||
|
||
When defining no props, the component does not blow up. This is also a | ||
potential state the component might be in during loading. Any interactive | ||
elements should be disabled. | ||
|
||
```jsx | ||
--- | ||
title: Pagination in a loading state | ||
--- | ||
<Pagination /> | ||
``` | ||
|
||
## totalRecordCount | ||
|
||
A number that specifies the length of the data. | ||
|
||
### Empty | ||
|
||
After loading data and passing props to our component, it is possible that data has a length of 0. In such cases, the component still have disabled input | ||
but the user will see additional indication that there are no records to display. | ||
|
||
```jsx | ||
--- | ||
title: Pagination with dropdownIndex | ||
--- | ||
<Pagination totalRecordCount={0} /> | ||
``` | ||
|
||
### With data but no state | ||
|
||
When we have a `totalRecordCount` greater than 1, Pagination values are displayed. Nothing is broken and it presents correctly. | ||
|
||
```jsx | ||
--- | ||
title: With data but no state | ||
--- | ||
<Pagination totalRecordCount={65} /> | ||
``` | ||
|
||
> Use the `usePaginationState` hook to provide this component with state. |
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,49 @@ | ||
--- | ||
title: Tabs | ||
propTable: Tabs.js | ||
status: 'ALPHA' | ||
--- | ||
|
||
# Public API | ||
|
||
WARNING! This is an alpha release so we can try to get this code in and working to kick the tires. | ||
|
||
## `tabs` | ||
|
||
An array of objects used to tell Tabs what to display. | ||
|
||
```jsx | ||
--- | ||
title: Tabs with 3 panels | ||
--- | ||
<Tabs | ||
tabs={[ | ||
{ | ||
label: 'Panel A', | ||
content: ( | ||
<> | ||
<h3>I am a panel</h3> | ||
<p>Hey there friend!</p> | ||
</> | ||
), | ||
}, | ||
{ | ||
label: 'Panel B', | ||
content: <p>I am a new panel.</p>, | ||
}, | ||
{ | ||
label: 'Panel C', | ||
content: ( | ||
<> | ||
<h3>A Third Panel</h3> | ||
<p> | ||
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Molestias | ||
voluptatum illum voluptatibus autem esse eaque totam hic placeat | ||
dignissimos nisi. | ||
</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