feat: init
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
---
|
||||
description: Get started with Twake frontend.
|
||||
---
|
||||
|
||||
# Storybook
|
||||
|
||||
Twake components are available through our Storybook. You can find it here:
|
||||
|
||||
[https://web.twake.app/storybook/index.html](https://web.twake.app/storybook/index.html)
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
description: Not documented yet.
|
||||
---
|
||||
|
||||
# MediumPopupManager
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
description: Not documented yet.
|
||||
---
|
||||
|
||||
# MenuManager
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
description: >-
|
||||
A beautiful, centered, medium modal with all you need to structure its
|
||||
content.
|
||||
---
|
||||
|
||||
# ObjectModal
|
||||
|
||||
#### Usage
|
||||
|
||||
```jsx
|
||||
import ObjectModal from "components/ObjectModal/ObjectModal.js";
|
||||
```
|
||||
|
||||
```jsx
|
||||
<ObjectModal
|
||||
title={<ObjectModalTitle>My awesome title !</ObjectModalTitle>}
|
||||
onClose={() => myComponent.closeSomething()}
|
||||
disabled
|
||||
footer={<Button>Definitly not usefull</Button>}
|
||||
>
|
||||
<FirstChild />
|
||||
<span>Some text</span>
|
||||
</ObjectModal>
|
||||
```
|
||||
|
||||
####
|
||||
|
||||
#### Props
|
||||
|
||||
| **name** | **Description** | **Type** | **Default** |
|
||||
| ------------ | -------------------------------------------------------------- | --------- | ----------- |
|
||||
| **disabled** | Disable scrollbar X axis (need to rename for a better clarity) | Boolean | false |
|
||||
| **footer** | Define a footer component | ReactNode | null |
|
||||
| **onClose** | Add close icon in the component, waiting for a function | Function | null |
|
||||
| **title** | _Define a title component_ | ReactNode | null |
|
||||
|
||||
####
|
||||
|
||||
#### Preview
|
||||
|
||||

|
||||
|
||||
---
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
---
|
||||
description: Icon with sub heading for ObjectModal component. Perfect before a form field.
|
||||
---
|
||||
|
||||
# ObjectModalFormTitle
|
||||
|
||||
#### Usage
|
||||
|
||||
```jsx
|
||||
import ObjectModalFormTitle from 'components/ObjectModal/ObjectModal.js';
|
||||
```
|
||||
|
||||
```jsx
|
||||
<ObjectModalFormTitle
|
||||
name={'Awesome Title!'}
|
||||
icon="star"
|
||||
/>
|
||||
```
|
||||
|
||||
####
|
||||
|
||||
#### Props
|
||||
|
||||
| **name** | **Description** | **Type** | **Default** |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| **className** | Use predefined classes for the title | string | null |
|
||||
| **icon** | Define icon for the title | string | null |
|
||||
| **name** | Define the title name | string | null |
|
||||
| **style** | Define a custom style for the title | object | null |
|
||||
|
||||
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
---
|
||||
description: Section title, perfect after a separator.
|
||||
---
|
||||
|
||||
# ObjectModalSectionTitle
|
||||
|
||||
#### Usage
|
||||
|
||||
```jsx
|
||||
import ObjectModalFormTitle from "components/ObjectModal/ObjectModal.js";
|
||||
```
|
||||
|
||||
```jsx
|
||||
<ObjectModalFormTitle name={"Awesome Title!"} />
|
||||
```
|
||||
|
||||
####
|
||||
|
||||
#### Props
|
||||
|
||||
| **name** | **Description** | **Type** | **Default** |
|
||||
| ------------- | ------------------------------------ | -------- | ----------- |
|
||||
| **className** | Use predefined classes for the title | string | null |
|
||||
| **icon** | Define icon for the title | string | null |
|
||||
| **name** | Define the title name | string | null |
|
||||
| **style** | Define a custom style for the title | object | null |
|
||||
|
||||
####
|
||||
|
||||
#### Preview
|
||||
|
||||

|
||||
|
||||
---
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
---
|
||||
description: Separate your component sections with a simple line.
|
||||
---
|
||||
|
||||
# ObjectModalSeparator
|
||||
|
||||
#### Usage
|
||||
|
||||
```jsx
|
||||
import ObjectModalSeparator from "components/ObjectModal/ObjectModal.js";
|
||||
```
|
||||
|
||||
```jsx
|
||||
<ObjectModalSeparator />
|
||||
```
|
||||
|
||||
####
|
||||
|
||||
#### Props
|
||||
|
||||
| Name | **Description** | **Type** | **Default** |
|
||||
| :--: | :----------------------------: | :------: | :---------: |
|
||||
| | no property for this component | | |
|
||||
|
||||
####
|
||||
|
||||
#### Preview
|
||||
|
||||

|
||||
+34
@@ -0,0 +1,34 @@
|
||||
---
|
||||
description: Main title for the ObjectModal component.
|
||||
---
|
||||
|
||||
# ObjectModalTitle
|
||||
|
||||
#### Usage
|
||||
|
||||
```jsx
|
||||
import ObjectModalTitle from "components/ObjectModal/ObjectModal.js";
|
||||
```
|
||||
|
||||
```jsx
|
||||
<ObjectModalTitle className="my-awesome-class" style={{ marginBottom: 0 }}>
|
||||
My awesome title !
|
||||
</ObjectModalTitle>
|
||||
```
|
||||
|
||||
####
|
||||
|
||||
#### Props
|
||||
|
||||
| **name** | **Description** | **Type** | **Default** |
|
||||
| ------------- | ------------------------------------ | -------- | ----------- |
|
||||
| **className** | Use predefined classes for the title | string | null |
|
||||
| **style** | Define a custom style for the title | object | null |
|
||||
|
||||
####
|
||||
|
||||
#### Preview
|
||||
|
||||

|
||||
|
||||
---
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
description: Create a table
|
||||
---
|
||||
|
||||
# Table
|
||||
|
||||
#### Usage
|
||||
|
||||
```jsx
|
||||
import Table from 'components/Table/Table.js';
|
||||
```
|
||||
|
||||
```jsx
|
||||
<Table />
|
||||
```
|
||||
|
||||
####
|
||||
|
||||
#### Props
|
||||
|
||||
| **name** | **Description** | **Type** | **Default** |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| **columns** | | ReactNode | null |
|
||||
| **onAdd** | If defined a add button appear and clicking on it call this callback. | Function | null |
|
||||
| **addText** | Button content | ReactNode | null |
|
||||
| **onSearch** | Called when search bar is changed. Return a Promise that resolve with a list of users. Argument is \(query: string, maxResult: number\)=>{return new Promise\(...\)} | Function | null |
|
||||
| **onRequestNextPage, onRequestPreviousPage** | \(token: string, maxResult: number\)=>{return new Promise\(...\)} | Function | null |
|
||||
| **rowKey** | \(row\)=>return row.id | Function | null |
|
||||
|
||||
**Functions \(callable on the component from parent\)**
|
||||
|
||||
| **name** | **Description** | **Type** |
|
||||
| :--- | :--- | :--- |
|
||||
| **newElements\(elements\)** | Add new rows at the beginning of the table. | Function |
|
||||
|
||||
**Internal implementation**
|
||||
|
||||
* If no data in table, set loading to true, call onRequestNextPage without offset token.
|
||||
* If next page button is clicked, get last row token, set Table to loading, and requestNextPage.
|
||||
* When recieve result in requestNextPage, set loading to false and update data.
|
||||
* Table must memorize already loaded pages to be faster
|
||||
* Table must detect when request a page and no result is returned in this case disable corresponding button.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
description: Not documented yet?
|
||||
---
|
||||
|
||||
# UserListManager
|
||||
|
||||
Reference in New Issue
Block a user