Skip to content

Commit

Permalink
chore: fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Oct 13, 2023
1 parent b650d25 commit b13bdf8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
20 changes: 10 additions & 10 deletions src/hooks/useListNavigation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ useListNavigation({

## Properties

| Name | Description | Type | Default |
| :-------------- | :---------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------: | :-----: |
| Name | Description | Type | Default |
| :-------------- | :---------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------: | :-----: |
| items | List items. Item can be any object. Also, it can contain `items` property, which represents sub-items | `ItemType[]` | |
| skip | Returns true if the item should not participate in navigation (Called for each item) | `(item: ItemType) => boolean` | |
| pageSize | Items page size, if passed, then navigates by pageSize on PageDown/PageUp | `number` | |
| processHomeKey | Navigate to the start of the list on Home key | `boolean` | `false` |
| processEndKey | Navigate to the end of the list on End key | `boolean` | `false` |
| disabled | Disable navigation | `boolean` | `false` |
| initialValue | Initial active item index | `number` | `-1` |
| anchorRef | HTMLElement reference, the hook will listen keydown event on that element | `RefObject<AnchorType>` | |
| onAnchorKeyDown | Custom keydown handler, if returns false, then the hook won't process keydown | `(activeItemIndex: number, event: KeyboardEvent) => boolean or void` | |
| skip | Returns true if the item should not participate in navigation (Called for each item) | `(item: ItemType) => boolean` | |
| pageSize | Items page size, if passed, then navigates by pageSize on PageDown/PageUp | `number` | |
| processHomeKey | Navigate to the start of the list on Home key | `boolean` | `false` |
| processEndKey | Navigate to the end of the list on End key | `boolean` | `false` |
| disabled | Disable navigation | `boolean` | `false` |
| initialValue | Initial active item index | `number` | `-1` |
| anchorRef | HTMLElement reference, the hook will listen keydown event on that element | `RefObject<AnchorType>` | |
| onAnchorKeyDown | Custom keydown handler, if returns false, then the hook won't process keydown | `(activeItemIndex: number, event: KeyboardEvent) => boolean or void` | |

## Result

Expand Down
32 changes: 16 additions & 16 deletions src/hooks/useSelect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ The `useSelect` hook used to handle items selection in list

## Properties

| Name | Description | Type | Default |
| :----------- | :-------------------------------------------------------: | :--------: | :-----: |
| value | Values that represent selected items | `string[]` | |
| defaultValue | Default values used in case of uncontrolled usage | `string[]` | `[]` |
| Name | Description | Type | Default |
| :----------- | :-------------------------------------------------------- | :--------: | :-----: |
| value | Values that represent selected items | `string[]` | |
| defaultValue | Default values used in case of uncontrolled usage | `string[]` | `[]` |
| multiple | Indicates that multiple items can be selected in the list | `boolean` | `false` |
| onUpdate | Invokes inside of `handleSelection` function | `function` | |
| defaultOpen | Initial value for `open` property | `boolean` | `false` |
| open | Controlled `open` property | `boolean` | |
| onOpenChange | Invokes while `open` property changes | `function` | |
| onUpdate | Invokes inside of `handleSelection` function | `function` | |
| defaultOpen | Initial value for `open` property | `boolean` | `false` |
| open | Controlled `open` property | `boolean` | |
| onOpenChange | Invokes while `open` property changes | `function` | |

## Result

| Name | Description | Type |
| :-------------- | :---------------------------------------------------------: | :--------: |
| value | Values that represent selected items | `string[]` |
| handleSelection | Handles item selection | `function` |
| open | List container visibility state | `boolean` |
| Name | Description | Type |
| :-------------- | :---------------------------------------------------------- | :--------: |
| value | Values that represent selected items | `string[]` |
| handleSelection | Handles item selection | `function` |
| open | List container visibility state | `boolean` |
| setOpen | (deprecated) use toggleOpen. Sets value for `open` property | `function` |
| toggleOpen | Inver the value of `open` | `function` |
| activeIndex | Index of active option | `number` |
| setActiveIndex | Sets value for `activeIndex` property | `function` |
| toggleOpen | Inver the value of `open` | `function` |
| activeIndex | Index of active option | `number` |
| setActiveIndex | Sets value for `activeIndex` property | `function` |
6 changes: 3 additions & 3 deletions src/hooks/useTimeout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `useTimeout` hook executes callback after timeout

## Properties

| Name | Description | Type | Default |
| :------: | :-------------------------------------: | :------------: | :-----: |
| Name | Description | Type | Default |
| :------- | :-------------------------------------- | :------------: | :-----: |
| callback | Callback function after timeout expires | `VoidFunction` | |
| ms | Duration of the timeout in milliseconds | `number` | |
| ms | Duration of the timeout in milliseconds | `number` | |
4 changes: 2 additions & 2 deletions src/hooks/useViewportSize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `useViewportSize` hook calculates the size of the viewport at the resize eve

## Result

| Name | Description | Type |
| :----: | :-------------: | :------: |
| Name | Description | Type |
| :----- | :-------------- | :------: |
| width | Viewport width | `number` |
| height | Viewport height | `number` |

0 comments on commit b13bdf8

Please sign in to comment.