Skip to content

Commit

Permalink
[@mantine/core] Rating: Improve size type (#5470)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Jan 3, 2024
1 parent 29eb1bd commit 40290c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/@mantine/core/src/components/Rating/Rating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface RatingProps
fractions?: number;

/** Controls component size, `'sm'` by default */
size?: MantineSize;
size?: MantineSize | number | (string & {});

/** Number of controls, `5` by default */
count?: number;
Expand Down Expand Up @@ -278,7 +278,6 @@ export const Rating = factory<RatingFactory>((_props, ref) => {
return (
<RatingItem
key={`${integerValue}-${symbolValue}`}
size={size!}
getSymbolLabel={getSymbolLabel}
emptyIcon={emptySymbol}
fullIcon={fullSymbol}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react';
import { Box, BoxProps, ElementProps, MantineSize, useDirection } from '../../../core';
import { Box, BoxProps, ElementProps, useDirection } from '../../../core';
import { useRatingContext } from '../Rating.context';
import { StarSymbol } from '../StarSymbol/StarSymbol';

export interface RatingItemProps extends BoxProps, ElementProps<'input', 'value' | 'size'> {
size: MantineSize;
getSymbolLabel: ((value: number) => string) | undefined;
emptyIcon?: React.ReactNode | ((value: number) => React.ReactNode);
fullIcon?: React.ReactNode | ((value: number) => React.ReactNode);
Expand All @@ -18,7 +17,6 @@ export interface RatingItemProps extends BoxProps, ElementProps<'input', 'value'
}

export function RatingItem({
size,
getSymbolLabel,
emptyIcon,
fullIcon,
Expand Down

0 comments on commit 40290c7

Please sign in to comment.