Skip to content

Commit

Permalink
refactor: fix md for private hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Nov 9, 2023
1 parent 76ca74e commit 25d4164
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 14 deletions.
8 changes: 5 additions & 3 deletions src/hooks/private/useCheckbox/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# useCheckbox

The `useCheckbox` hook need to generate props for radio group element
The `useCheckbox` hook need to generate props for checkbox control

## Properties

Expand All @@ -22,5 +22,7 @@ The `useCheckbox` hook need to generate props for radio group element

## Result

- checked, radio-input status `boolean`
- inputProps
| Name | Description | Type |
| :--------- | :--------------------------------- | :-----------------------------------------------: |
| checked | Checked state | `boolean` |
| inputProps | Props to pass to the input element | `React.InputHTMLAttributes & React.RefAttributes` |
6 changes: 4 additions & 2 deletions src/hooks/private/useCloseOnTimeout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ The `useCloseOnTimeout` hook invokes callback after given amount of time unless

## Result

- onMouseOver, `React.MouseEventHandler`
- onMouseLeave, `React.MouseEventHandler`
| Name | Description | Type |
| :----------- | :------------------- | :-----------------------: |
| onMouseOver | OnMouseOver handler | `React.MouseEventHandler` |
| onMouseLeave | OnMouseLeave handler | `React.MouseEventHandler` |
8 changes: 5 additions & 3 deletions src/hooks/private/useRadio/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# useRadio

The `useRadio` hook need to generate props for radio group element
The `useRadio` hook need to generate props for radio group control

## Properties

Expand All @@ -21,5 +21,7 @@ The `useRadio` hook need to generate props for radio group element

## Result

- checked, radio-input status `boolean`
- inputProps
| Name | Description | Type |
| :--------- | :--------------------------------- | :-----------------------------------------------: |
| checked | Checked state | `boolean` |
| inputProps | Props to pass to the input element | `React.InputHTMLAttributes & React.RefAttributes` |
8 changes: 5 additions & 3 deletions src/hooks/private/useRadioGroup/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# useRadioGroup

The `useRadioGroup` hook need to generate props for radio group element
The `useRadioGroup` hook need to generate props for radio group control

## Properties

Expand All @@ -18,5 +18,7 @@ The `useRadioGroup` hook need to generate props for radio group element

## Result

- containerProps
- optionsProps
| Name | Description | Type |
| :------------- | :--------------------------------- | :------------------------------------------------------------------------------------------: |
| containerProps | Props to pass to the input element | `{'aria-label'?: string;'aria-labelledby'?: string; role: string; 'aria-disabled': boolean;` |
| optionsProps | Options props | `OptionsProps` |
4 changes: 3 additions & 1 deletion src/hooks/private/useRestoreFocus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ The `useRestoreFocus` hook restore focus

## Result

- onFocus, `(event: React.FocusEvent) => void`
| Name | Description | Type |
| :------ | :--------------- | :---------------------------------: |
| onFocus | OnFocus callback | `(event: React.FocusEvent) => void` |
6 changes: 4 additions & 2 deletions src/hooks/private/useStateWithCallback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ The `useStateWithCallback` hook a wrapper that adds a callback call when the wra

## Result

- state, `any`
- setWithCallback, `(nextValue: T | ((value: T) => T)) => void`
| Name | Description | Type |
| :-------------- | :----------------------------------------- | :-------------------------------------------: |
| state | Target state | `any` |
| setWithCallback | State setter with the transmitted callback | `(nextValue: T or ((value: T) => T)) => void` |

0 comments on commit 25d4164

Please sign in to comment.