UNPKG

@drivy/cobalt

Version:

Opinionated design system for Drivy's projects.

23 lines (22 loc) 980 B
import React from "react"; import { IconProps } from "../Icon"; export type RatingIconsPropsType = { className?: string; max?: 5 | 10; value: number; size?: IconProps["size"] | 48; editable?: boolean; disabled?: boolean; onChange?: (newValue: number) => void; icon?: JSX.Element | JSX.Element[]; }; export type RatingIconPropsType = { icon: JSX.Element; status?: "full" | "half" | "empty"; size?: RatingIconsPropsType["size"]; }; export declare const defaultRatingIcon: React.JSX.Element; export declare function roundHalf(num: number): number; export declare function computeItemStatus(ratingValue: number, itemValue: number, icon: RatingIconsPropsType["icon"]): RatingIconPropsType["status"]; export declare const RatingIcon: ({ icon, status, size, }: RatingIconPropsType) => React.JSX.Element; export declare const RatingIcons: ({ className, max, value, size, editable, onChange, icon, }: RatingIconsPropsType) => React.JSX.Element;