diff --git a/packages/components/rating/src/Rating.stories.tsx b/packages/components/rating/src/Rating.stories.tsx index 41f1cdec84..f141f80966 100644 --- a/packages/components/rating/src/Rating.stories.tsx +++ b/packages/components/rating/src/Rating.stories.tsx @@ -9,4 +9,8 @@ const meta: Meta = { export default meta -export const Default: StoryFn = _args => +export const Default: StoryFn = _args => ( +
+ +
+) diff --git a/packages/components/rating/src/Rating.styles.ts b/packages/components/rating/src/Rating.styles.ts index 19ba213b67..a66a78885f 100644 --- a/packages/components/rating/src/Rating.styles.ts +++ b/packages/components/rating/src/Rating.styles.ts @@ -1,12 +1,12 @@ import { cx } from 'class-variance-authority' export const ratingStyles = cx( - 'inline-flex', + 'flex', 'peer-[[data-part=input][data-clicked]]:shadow-none peer-focus-visible:u-ring', '[&_[data-part=star]:hover_~_[data-part=star]_>_div]:!w-none' /* 1 */ ) /** * 1. Display the remaining stars as outlined. - * By 'remaining,' we mean the stars located to the right of the cursor + * By 'remaining', we mean the stars located to the right of the cursor */ diff --git a/packages/components/rating/src/Rating.tsx b/packages/components/rating/src/Rating.tsx index ecdd715488..dcff816111 100644 --- a/packages/components/rating/src/Rating.tsx +++ b/packages/components/rating/src/Rating.tsx @@ -30,8 +30,6 @@ export interface RatingProps extends PropsWithChildren(({ value, ...rest }, ref) => { const [ratingValue, setRatingValue] = useState(value) const inputRef = useRef(null) @@ -74,11 +72,17 @@ export const Rating = forwardRef(({ value, ...rest } return ( -
+
(({ value, ...rest /> ))}
- - {ratingValue}
) })