@startupjs-ui/rating 0.1.12 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.mdx +12 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.1.16](https://github.com/startupjs/startupjs-ui/compare/v0.1.15...v0.1.16) (2026-02-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @startupjs-ui/rating
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.1.13](https://github.com/startupjs/startupjs-ui/compare/v0.1.12...v0.1.13) (2026-02-03)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @startupjs-ui/rating
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.1.12](https://github.com/startupjs/startupjs-ui/compare/v0.1.11...v0.1.12) (2026-01-21)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @startupjs-ui/rating
|
package/README.mdx
CHANGED
|
@@ -4,7 +4,7 @@ import { Sandbox } from '@startupjs-ui/docs'
|
|
|
4
4
|
|
|
5
5
|
# Rating
|
|
6
6
|
|
|
7
|
-
Rating
|
|
7
|
+
Rating displays a five-star rating and lets users select a value by tapping on stars.
|
|
8
8
|
|
|
9
9
|
```js
|
|
10
10
|
import { Rating } from 'startupjs-ui'
|
|
@@ -12,7 +12,7 @@ import { Rating } from 'startupjs-ui'
|
|
|
12
12
|
|
|
13
13
|
## Simple example
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The `value` prop sets the current rating. It is rounded to the nearest integer when displayed as stars.
|
|
16
16
|
|
|
17
17
|
```jsx example
|
|
18
18
|
return (
|
|
@@ -22,6 +22,8 @@ return (
|
|
|
22
22
|
|
|
23
23
|
## Controlled
|
|
24
24
|
|
|
25
|
+
Use `value` and `onChange` together to create a controlled rating input.
|
|
26
|
+
|
|
25
27
|
```jsx example
|
|
26
28
|
const [rated, setRated] = useState(0)
|
|
27
29
|
return (
|
|
@@ -34,7 +36,7 @@ return (
|
|
|
34
36
|
|
|
35
37
|
## Read only
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
Set `readonly` to `true` to prevent user interaction and display the rating in a compact view with a single star and the numeric value.
|
|
38
40
|
|
|
39
41
|
```jsx example
|
|
40
42
|
return(
|
|
@@ -42,6 +44,13 @@ return(
|
|
|
42
44
|
)
|
|
43
45
|
```
|
|
44
46
|
|
|
47
|
+
## Props
|
|
48
|
+
|
|
49
|
+
- **value** -- the current rating value (default `0`)
|
|
50
|
+
- **onChange** -- called with the new value when the user taps a star
|
|
51
|
+
- **readonly** -- disables interaction and shows a compact numeric display (default `false`)
|
|
52
|
+
- **style** -- custom styles for the root container
|
|
53
|
+
|
|
45
54
|
## Sandbox
|
|
46
55
|
|
|
47
56
|
<Sandbox
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/rating",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@startupjs-ui/core": "^0.1.11",
|
|
12
|
-
"@startupjs-ui/div": "^0.1.
|
|
13
|
-
"@startupjs-ui/icon": "^0.1.
|
|
14
|
-
"@startupjs-ui/span": "^0.1.
|
|
12
|
+
"@startupjs-ui/div": "^0.1.16",
|
|
13
|
+
"@startupjs-ui/icon": "^0.1.16",
|
|
14
|
+
"@startupjs-ui/span": "^0.1.16"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "*",
|
|
18
18
|
"react-native": "*",
|
|
19
19
|
"startupjs": "*"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "9943aa3566d5d80f5b404473906eb3c0611f9ee5"
|
|
22
22
|
}
|