import React, { ComponentProps } from 'react'; import { Typo } from '../../foundation'; export type RatingStar = 'full' | 'half' | 'empty'; type BaseProps = { score: number; }; type RatingWithScoreType = BaseProps & { count?: number; type?: 'full_rate' | 'single_rate'; size?: 'small' | 'medium' | 'large'; showCount?: boolean; scoreFont?: ComponentProps['type']; countColor?: ComponentProps['color']; countFont?: ComponentProps['type']; }; export type RatingWithActionType = BaseProps & { type: 'action_rate'; onPressStar: (index: number) => void; }; type Props = RatingWithScoreType | RatingWithActionType; /** * # Rating * - 별점 또는 점수와 개수를 표시하는 컴포넌트 * * ## Props * * ### `score` * - 별점 점수. 0 ~ 5 사이의 값 ex) 3.5 * - action_rate 타입일 경우, 초기 별 상태를 결정하는 값 * * * ### `count` * - 개수 ex) 리뷰 개수 * - count값을 전달하지 않았을 경우, showCount가 false가 아니라면 0으로 표시됨 * * * ### `type` * - 별점 표시 유형 (기본값: `full_rate`) * - `full_rate`: 별 다섯개 표시 * - `single_rate`: 별 하나만 표시 * - `action_rate`: 별을 눌러서 점수를 선택할 수 있는 상호작용 가능 * * * ### `size` * - 별 크기와 폰트 크기가 변경됨 (기본값: `small`) * - `small` | `medium` | `large` * - action_rate 타입일 경우, 36 고정 사이즈 * * * ### `showCount` * - 리뷰 개수 표시 여부 (기본값: `true`) * * * ### `scoreFont` * - 점수 폰트 타입 (기본값: `body_14_semibold`) * - size에 따라 default 값이 변경됨 * - `small`: `body_14_semibold` * - `medium`: `body_18_semibold` * - `large`: `headline_24_bold` * * * ### `countFont` * - 개수 폰트 타입 (기본값: `body_12_regular`) * - size에 따라 default 값이 변경됨 * - `small`: `body_12_regular` * - `medium`: `body_16_regular` * - `large`: `body_16_regular` * * * ### `countColor` * - 개수 색상 (기본값: `text_primary`) * * * ### `onPressStar` * - action_rate 타입에서 사용, 별을 눌렀을 때 호출되는 콜백 * - 선택한 별의 점수가 인자로 전달됨 * * * ## 예시 * * @example * ```tsx * // action_rate 타입 * { * setScore(value); * }} * /> * * // full_rate 타입 * * * * // single_rate 타입 * * * ``` */ export declare function Rating(props: Props): React.JSX.Element; export {};