Add more documentation

This commit is contained in:
Arnaud 2024-09-13 18:39:30 +02:00
parent fe6990e3eb
commit 17401e5f5e
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
17 changed files with 106 additions and 2 deletions

View File

@ -15,6 +15,9 @@ type Props = {
children: ReactNode;
/**
* Apply custom classname.
*/
className?: string;
/**

View File

@ -3,8 +3,15 @@ import "./appBar.css";
import { ReactNode } from "react";
type Props = {
/**
* Event triggered when the menu is expanding, after a click on the
* menu button.
*/
onExpand: () => void;
/**
* React node to add to the right part of the application bar
*/
Right: ReactNode;
};

View File

@ -29,6 +29,9 @@ type Props = {
*/
style?: CustomStyleCSS;
/**
* Apply custom classname.
*/
className?: string;
};

View File

@ -3,8 +3,19 @@ import "./Collapse.css";
import { attributes } from "../utils/attributes";
type Props = {
/**
* Summary always displayed
*/
summary: string;
/**
* Details to show after the component is collapsed
*/
details: string;
/**
* Apply custom classname.
*/
className?: string;
};

View File

@ -39,6 +39,9 @@ type Props = {
*/
placeholder: string;
/**
* List of values to be displayed in the dropdown
*/
options: DropdownOption[];
/**
@ -77,8 +80,6 @@ type Props = {
label: string;
id: string;
Component?: ComponentType<DropdownOption>;
};
export function Dropdown({

View File

@ -3,7 +3,14 @@ import { EmptyPlaceholderIcon } from "./EmptyPlaceholderIcon";
type Props = {
title: string;
message: string;
/**
* If a retry function is passed to the component,
* a button will be displayed and the function will be called when the button
* is clicked.
*/
onRetry?: () => void | Promise<void>;
};

View File

@ -9,10 +9,25 @@ interface CustomStyleCSS extends CSSProperties {
}
type Props = {
/**
* Error code related to the error, example: 400, 500
*/
code: number;
message: string;
title: string;
/**
* If an action function is passed to the component,
* a button will be displayed and the function will be called when the button
* is clicked.
*/
onClick?: () => void | Promise<void>;
/**
* The button label
*/
button?: string;
/**

View File

@ -23,12 +23,18 @@ export type MenuItem =
};
type Props = {
/**
* If true, the menu will be displayed
*/
expanded: boolean;
onClose: () => void;
onOpen?: () => void;
/**
* The menu items to be displayed
*/
items: MenuItem[];
className?: string;

View File

@ -3,6 +3,7 @@ import "./networkIndicator.css";
type Props = {
online: boolean;
text: string;
};

View File

@ -4,9 +4,21 @@ import "./placeholder.css";
type Props = {
title: string;
message: string;
/**
* If a retry function is passed to the component,
* a button will be displayed and the function will be called when the button
* is clicked.
*/
onRetry?: () => void | Promise<void>;
/**
* Icon to be displayed on top of the text
*/
Icon: ReactNode;
className?: string;
};

View File

@ -11,6 +11,7 @@ interface CustomStyleCSS extends CSSProperties {
type Props = {
label: string;
id: string;
/**

View File

@ -5,7 +5,9 @@ import { attributes } from "../utils/attributes";
type Props = {
open: boolean;
onClose: () => void;
children: ReactElement;
};

View File

@ -1,5 +1,6 @@
type Props = {
width?: string;
className?: string;
};

View File

@ -4,11 +4,34 @@ import { attributes } from "../utils/attributes";
import { classnames } from "../utils/classnames";
type StepProps = {
/**
* Step title
*/
title: string;
/**
* Step index
*/
step: number;
/**
* If true, an active css class will be added
*/
isActive: boolean;
/**
* If true, a css class will be added to draw the line between two steps
*/
isLast: boolean;
/**
* If true, a done css class will be added to color the step
*/
isDone: boolean;
/**
* Event triggered when a step number is clicked on
*/
onClick?: (step: number) => void;
};

View File

@ -2,6 +2,7 @@ import { SimpleText } from "../SimpleText/SimpleText";
type Props = {
action: string;
onClick: (data: unknown) => unknown | Promise<unknown>;
};

View File

@ -7,6 +7,11 @@ type Props = {
*/
headers: string[];
/**
* The ReactNode cells in two dimensions array,
* one for the lines
* one for the data representation
*/
cells: ReactNode[][];
className?: string;

View File

@ -7,7 +7,12 @@ type Props = {
label: string;
Icon?: ComponentType;
}[];
onTabChange: (index: number) => void | Promise<void>;
/**
* Current tab selected index
*/
tabIndex: number;
};