diff --git a/README.md b/README.md index 09e90041..1c1b0704 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,11 @@ For using individual components in an app, refer to the individual component's R Components ready for use: - [`ContractEditor`][contracteditor] +- [`ErrorLogger`][errorlogger] - [`TemplateLibrary`][templatelibrary] - Components still in development: - [`ClauseEditor`][clauseeditor] -- [`ErrorLogger`][errorlogger] - [`ParseResult`][parseresult] - [`TemplateLoadingClauseEditor`][templateloadingclauseeditor] diff --git a/src/ErrorLogger/README.md b/src/ErrorLogger/README.md index e250d7f0..9fa02996 100644 --- a/src/ErrorLogger/README.md +++ b/src/ErrorLogger/README.md @@ -6,14 +6,64 @@ npm install @accordproject/cicero-ui ``` -``` +```js import { ErrorLogger } from '@accordproject/cicero-ui'; +const navigateToClauseError = // Insert your navigation function here. + +const errorsPropsObject = { + ERRORS_HEADER_BACKGROUND (string), + ERRORS_HEADER_BACKGROUND_HOVER (string), + ERRORS_HEADER_EXPAND_ARROW (string), + ERRORS_HEADER_BORDER_TOP (string), + ERRORS_HEADER_SHADOW (string), + ERRORS_DISPLAY_BACKGROUND (string), + ERRORS_DISPLAY_SHADOW (string), + ERROR_BORDER_BOTTOM (string), + ERROR_EXPAND_ARROW (string), + ERROR_FILE (string), + ERROR_FILE_HOVER (string), + ERROR_TYPE (string), + ERROR_FULL_MESSAGE (string), + ERROR_SHORT_MESSAGE (string), +}; + const ErrorContainer = props => ( - + ); ``` ### Props -- `error` : An `array` which contains error objects. +#### Expected to be Provided + +- `errors` : An `array` which contains error objects. + +#### Require Provision + +- `errorsProps` : An optional `object`, see below. +- `errorNav` : An optional `function` which will navigate to the corresponding error. + +### Specifications + +This component is built to have the following dimensions: + +```js +width: '100%'; +``` + +You can style the error component, as well as the individual errors. An object may be passed down this component with the following possible CSS inputs as strings: +- `ERRORS_HEADER_BACKGROUND` +- `ERRORS_HEADER_BACKGROUND_HOVER` +- `ERRORS_HEADER_EXPAND_ARROW` +- `ERRORS_HEADER_BORDER_TOP` +- `ERRORS_HEADER_SHADOW` +- `ERRORS_DISPLAY_BACKGROUND` +- `ERRORS_DISPLAY_SHADOW` +- `ERROR_BORDER_BOTTOM` +- `ERROR_EXPAND_ARROW` +- `ERROR_FILE` +- `ERROR_FILE_HOVER` +- `ERROR_TYPE` +- `ERROR_FULL_MESSAGE` +- `ERROR_SHORT_MESSAGE` \ No newline at end of file