From c0baf1bfce37efdd46cb245817a8202cd1976d7b Mon Sep 17 00:00:00 2001 From: smastrom Date: Sun, 28 Jan 2024 22:53:20 +0100 Subject: [PATCH] fix #16, release v1.5.0 --- README.md | 19 ++++++++++--------- package.json | 2 +- src/Rating.tsx | 10 +++++++--- src/exportedTypes.ts | 2 ++ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 39f9f36..7a70c0c 100644 --- a/README.md +++ b/README.md @@ -270,15 +270,16 @@ function App() { ### :cyclone: Core -| :thinking: | Prop | Description | Type | Default | Required | -| ------------------- | --------------- | -------------------------------------------------------------------------- | ----------------------------------------------- | --------- | ------------------------------- | -| :green_circle: | `value` | An integer from 0 to `items`. It can be a float if `readOnly` is **true**. | number | undefined | :white_check_mark: | -| :large_blue_circle: | `onChange` | Setter or custom function to update the rating. | RatingChange | () => {} | Only if `readOnly` is **false** | -| :large_blue_circle: | `onHoverChange` | Callback to execute while navigating the rating items. | (hoveredValue: number) => void | () => {} | :x: | -| :green_circle: | `items` | Rating items to display. | 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 | 5 | :x: | -| :green_circle: | `readOnly` | Whether to render an accessible image element or not. | boolean | false | :x: | -| :large_blue_circle: | `isDisabled` | Whether to disable the radio group or not. | boolean | false | :x: | -| :large_blue_circle: | `isRequired` | Whether users should be able to set rating to 0 or not. | boolean | false | :x: | +| :thinking: | Prop | Description | Type | Default | Required | +| ------------------- | ---------------- | ------------------------------------------------------------------------------ | ----------------------------------------------- | --------- | ------------------------------- | +| :green_circle: | `value` | An integer from 0 to `items`. It can be a float if `readOnly` is **true**. | number | undefined | :white_check_mark: | +| :large_blue_circle: | `onChange` | Setter or custom function to update the rating. | RatingChange | () => {} | Only if `readOnly` is **false** | +| :large_blue_circle: | `onHoverChange` | Callback to execute while navigating the rating items. | (hoveredValue: number) => void | () => {} | :x: | +| :green_circle: | `items` | Rating items to display. | 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 | 5 | :x: | +| :green_circle: | `readOnly` | Whether to render an accessible image element or not. | boolean | false | :x: | +| :large_blue_circle: | `isDisabled` | Whether to disable the radio group or not. | boolean | false | :x: | +| :large_blue_circle: | `isRequired` | Whether users should be able to set rating to 0 or not. | boolean | false | :x: | +| :green_circle: | `preventDefault` | Whether or not to call `event.preventDefault` on click and Enter/Space select. | `click` \| `keydown` \| `all` \| `none` | `all` | :x: | `ref`, `id`, `className`, `style`, `onBlur`, `onFocus` are also available. diff --git a/package.json b/package.json index 22a6525..e36a839 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@smastrom/react-rating", - "version": "1.4.0", + "version": "1.5.0", "private": false, "keywords": [ "react", diff --git a/src/Rating.tsx b/src/Rating.tsx index a116cd6..488bc29 100644 --- a/src/Rating.tsx +++ b/src/Rating.tsx @@ -56,6 +56,7 @@ export const Rating: typeof RatingComponent = forwardRef