forked from HospitalRun/components
-
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.
feat(label): added label component to library
- Loading branch information
Showing
22 changed files
with
259 additions
and
50 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,8 @@ | ||
# `Badge` (component) | ||
|
||
Badges can provide contextual clues to the user by differentiating color and styling | ||
from the surrounding content. | ||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|color|`'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'light' | 'dark'`|-||Defines the color of the badge. Defaults to primary.| |
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,18 +1,16 @@ | ||
# `BarGraph` (component) | ||
|
||
A customizable Bar Graph component built on chart.js | ||
|
||
## Props | ||
|
||
| property | propType | required | default | description | | ||
| -------------- | ----------- | -------- | ------- | ---------------------------------------------------------------------- | | ||
| datasets | `Dataset[]` | yes | | the datasets for the graph | | ||
| height | `string` | - | | The height of the graph | | ||
| horizontal | `boolean` | - | | Determines if the bar graph should be displayed in a horizontal manner | | ||
| stacked | `boolean` | - | | Determines if the bar graph should be displayed as a stacked bar graph | | ||
| title | `string` | - | | the title of the graph for the legend | | ||
| titleFontColor | `string` | - | | the color for the title | | ||
| titleFontSize | `number` | - | | the font size for the title | | ||
| width | `string` | - | | The width of the graph | | ||
| xAxes | `Axis[]` | yes | | the list of x axis information | | ||
| yAxes | `Axis[]` | yes | | the list of y axis information | | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|datasets|`Dataset[]`|yes||the datasets for the graph| | ||
|height|`string`|-||The height of the graph| | ||
|horizontal|`boolean`|-||Determines if the bar graph should be displayed in a horizontal manner| | ||
|stacked|`boolean`|-||Determines if the bar graph should be displayed as a stacked bar graph| | ||
|title|`string`|-||the title of the graph for the legend| | ||
|titleFontColor|`string`|-||the color for the title| | ||
|titleFontSize|`number`|-||the font size for the title| | ||
|width|`string`|-||The width of the graph| | ||
|xAxes|`Axis[]`|yes||the list of x axis information| | ||
|yAxes|`Axis[]`|yes||the list of y axis information| |
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,14 @@ | ||
# `Button` (component) | ||
|
||
Buttons are used to initiate an action. | ||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|block|`boolean`|-||Determines whether or not the button should be a block button or not. By default false| | ||
|color|`'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'light' | 'dark'`|-||Defines the button variant. By default is primary| | ||
|disabled|`boolean`|-||Determines whether or not the button should be disabled or not. By default is false.| | ||
|icon|`IconType`|-||The icon to display| | ||
|iconLocation|`'left' | 'right'`|-||Determines whether or not the icon should display on the left side or right side of the button. By default is left| | ||
|onClick|`(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void`|-||Handles the on click event for a button| | ||
|outlined|`boolean`|-||Determines if the button should be outlined and not filled. By defaut is false| | ||
|size|`'small' | 'large'`|-||Determines whether or not the button should be a small or large button. By default is undefined.| |
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,14 @@ | ||
# `Checkbox` (component) | ||
|
||
Checkbox is used to mark if something is true or not. Often times is used in a group where | ||
multiple things can be true at one time. | ||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|disabled|`boolean`|-||Determines if the checkbox should be disabled or not. By default false| | ||
|id|`string`|-||The id for the checkbox| | ||
|inline|`boolean`|-||Determines if the checkbox should render inline or not. By default false.| | ||
|label|`string`|yes||The label to render next to the checkbox| | ||
|labelSide|`'right' | 'left'`|-||| | ||
|name|`string`|-||Gives the checkbox a name| | ||
|onChange|`(event: React.ChangeEvent<HTMLInputElement>) => void`|-||The onChange listener| |
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,7 @@ | ||
# `Icon` (component) | ||
|
||
Icons provide contextual clues to users to make it easier to recognize functionality | ||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|icon|`IconType`|yes||The type of icon to display| |
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,7 @@ | ||
# `Label` (component) | ||
|
||
Labels are used to display textnpm | ||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|text|`string`|yes||Text to display in label| |
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,18 +1,16 @@ | ||
# `LineGraph` (component) | ||
|
||
A customizable Line Graph component built on chart.js | ||
|
||
## Props | ||
|
||
| property | propType | required | default | description | | ||
| -------------- | ----------- | -------- | ------- | ------------------------------------------------------------------------------------------------- | | ||
| datasets | `Dataset[]` | yes | | the datasets for the graph | | ||
| fill | `boolean` | - | | Determines if the area under the line should be filled with the background color from the dataset | | ||
| height | `string` | - | | The height of the graph | | ||
| stacked | `boolean` | - | | Determines if the the Line Graphs should be displayed in a stacked manner | | ||
| title | `string` | - | | the title of the graph for the legend | | ||
| titleFontColor | `string` | - | | the color for the title | | ||
| titleFontSize | `number` | - | | the font size for the title | | ||
| width | `string` | - | | The width of the graph | | ||
| xAxes | `Axis[]` | yes | | the list of x axis information | | ||
| yAxes | `Axis[]` | yes | | the list of y axis information | | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|datasets|`Dataset[]`|yes||the datasets for the graph| | ||
|fill|`boolean`|-||Determines if the area under the line should be filled with the background color from the dataset| | ||
|height|`string`|-||The height of the graph| | ||
|stacked|`boolean`|-||Determines if the the Line Graphs should be displayed in a stacked manner| | ||
|title|`string`|-||the title of the graph for the legend| | ||
|titleFontColor|`string`|-||the color for the title| | ||
|titleFontSize|`number`|-||the font size for the title| | ||
|width|`string`|-||The width of the graph| | ||
|xAxes|`Axis[]`|yes||the list of x axis information| | ||
|yAxes|`Axis[]`|yes||the list of y axis information| |
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,22 @@ | ||
# `Navbar` (component) | ||
|
||
Used to redirect users to the main topics. | ||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|bg|`string`|-||Determines the navbar background color| | ||
|brand|`Brand`|yes||Determines the hospital/clinic name to be shown at the navbar| | ||
|buttonColor|`'primary' | ||
| 'secondary' | ||
| 'success' | ||
| 'warning' | ||
| 'danger' | ||
| 'info' | ||
| 'light' | ||
| 'dark'`|-||Defines the button variant. By default is primary| | ||
|navLinks|`NavLink[]`|yes||Determines the links names, theirs onClick methods and paths. It has children array which contain links to be used on a dropdown.| | ||
|onSeachButtonClick|`(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void`|yes||Handles the on click search button event| | ||
|onSearchTextBoxChange|`( | ||
event: React.FormEvent<ReplaceProps<'input', BsPrefixProps<'input'> & FormControlProps>>, | ||
) => void`|yes||Handles the on change search form event| | ||
|variant|`'light' | 'dark'`|-||Determines the letters color. It should be combined with the background color (bg)| |
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,15 +1,13 @@ | ||
# `PieGraph` (component) | ||
|
||
A customizable Pie Graph component built on chart.js | ||
|
||
## Props | ||
|
||
| property | propType | required | default | description | | ||
| -------------- | ----------- | -------- | ------- | --------------------------------------------------------------- | | ||
| datasets | `Dataset[]` | yes | | the datasets for the graph | | ||
| doughnut | `boolean` | - | | Determines if the pie graph should be displayed with a doughnut | | ||
| height | `string` | - | | The height of the graph | | ||
| title | `string` | - | | the title of the graph for the legend | | ||
| titleFontColor | `string` | - | | the color for the title | | ||
| titleFontSize | `number` | - | | the font size for the title | | ||
| width | `string` | - | | The width of the graph | | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|datasets|`Dataset[]`|yes||the datasets for the graph| | ||
|doughnut|`boolean`|-||Determines if the pie graph should be displayed with a doughnut| | ||
|height|`string`|-||The height of the graph| | ||
|title|`string`|-||the title of the graph for the legend| | ||
|titleFontColor|`string`|-||the color for the title| | ||
|titleFontSize|`number`|-||the font size for the title| | ||
|width|`string`|-||The width of the graph| |
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,8 @@ | ||
# `Pill` (component) | ||
|
||
Pills can provide contextual clues to the user by differentiating color and styling | ||
from the surrounding content. | ||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|color|`'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'light' | 'dark'`|-||Defines the color of the pill. Defaults to primary.| |
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,16 @@ | ||
# `Radio` (component) | ||
|
||
|
||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|checked|`boolean`|-||When checked is true, the Radio button is selected.| | ||
|disabled|`boolean`|-||When disabled, the Radio cannot be clicked or changed by the user. Default is false.| | ||
|feedback|`string | ReactNode`|-||Message to display when the Radio is invalid.| | ||
|id|`string`|-||Necessary to link the label with the input.| | ||
|inline|`boolean`|-||When inline, Radio elements are stacked horizontally instead of vertically. Default is false.| | ||
|isInvalid|`boolean`|-||Determines whether the Radio should be rendered as invalid or not. Default is false.| | ||
|label|`string | ReactNode`|-||Label to display next to the Radio.| | ||
|name|`string`|-||Name to group Radios together. Two Radios with the same name can't be checked at the same time.| | ||
|onChange|`(event: React.ChangeEvent<HTMLInputElement>) => void`|-||Listener will be called when the Radio is checked.| | ||
|value|`string`|-||Value associated with the Radio.| |
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,12 @@ | ||
# `Select` (component) | ||
|
||
|
||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|disabled|`boolean`|-||Determines whether the Select should be disabled. False by default.| | ||
|isInvalid|`boolean`|-||Determines whether the Select should be invalid. False by default.| | ||
|multiple|`boolean`|-||When multiple is true, the user can select multiple options. Otherwise, one option only. False by default.| | ||
|onChange|`(event: React.FormEvent<FormControl & FormControlProps>) => void`|-||Handles the onChange event for the Select.| | ||
|size|`'small' | 'large'`|-||Determines whether to render a small or large TextField. By default, it is undefined.| | ||
|value|`string`|-||Selected value in the| |
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,10 @@ | ||
# `Switch` (component) | ||
|
||
Switches are used to choose if something is true or false | ||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|disabled|`boolean`|-||Determines if the switch should be disabled or not. By default false| | ||
|id|`string`|yes||The id for the switch element| | ||
|label|`string`|yes||The label to render next to the switch| | ||
|onChange|`(event: React.ChangeEvent<HTMLInputElement>) => void`|-||The onChange listener| |
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,13 @@ | ||
# `TextField` (component) | ||
|
||
A customizable text field component. It's a wrapper component built upon react's form controls. | ||
## Props | ||
| property | propType | required | default | description | | ||
|----------|----------|----------|---------|-------------| | ||
|disabled|`boolean`|-||Determines whether the TextField should be disabled or not. By default, it is false.| | ||
|isInvalid|`boolean`|-||Determines whether the TextField should be rendered as invalid or not. By default, it is false.| | ||
|name|`string | ''`|-||The name of the text field| | ||
|onChange|`(event: React.KeyboardEvent<HTMLTextAreaElement>) => void`|-||Handles the onChange event for the TextField| | ||
|rows|`number`|-||The number of rows to render| | ||
|size|`'small' | 'large'`|-||Determines whether to render a small or large TextField. By default, it is undefined.| | ||
|value|`string | ''`|-||The value of the text field| |
Oops, something went wrong.