inital commit

This commit is contained in:
2026-01-01 15:25:19 +05:30
commit f0ae49465a
36361 changed files with 4894111 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
import { ReactNode, CSSProperties, MouseEvent, PointerEvent } from 'react';
import { StarIconProps } from './StarIcon';
export interface RatingProps extends StarIconProps {
/** Handles the returned rating value */
onClick?: (value: number, index: number, event?: MouseEvent<HTMLSpanElement>) => void;
/** onPointerMove callback function with `hover`, `index` alongside `event` values passed */
onPointerMove?: (value: number, index: number, event: PointerEvent<HTMLSpanElement>) => void;
/** onPointerEnter callback function */
onPointerEnter?: (event: PointerEvent<HTMLSpanElement>) => void;
/** onPointerLeave callback function */
onPointerLeave?: (event: PointerEvent<HTMLSpanElement>) => void;
/** Set initial value */
initialValue?: number;
/** Number of the icons */
iconsCount?: number;
/** Read only mode */
readonly?: boolean;
/** Add a group of icons */
customIcons?: {
icon: ReactNode;
}[];
/** RTL mode */
rtl?: boolean;
/** Enable a fractional rate (half icon) */
allowFraction?: boolean;
/** Enable / Disable hover effect on empty icons */
allowHover?: boolean;
/** Enable / Disable hover effect on filled icons */
disableFillHover?: boolean;
/** Enable / Disable transition effect on mouse hover */
transition?: boolean;
/** Applied to the `main` span */
className?: string;
/** Inline style applied to the `main` span */
style?: CSSProperties;
/** Custom fill icon SVG */
fillIcon?: ReactNode | null;
/** Filled icons color */
fillColor?: string;
/** Array of string to add color range */
fillColorArray?: string[];
/** Inline style applied to `filled-icons` icon span */
fillStyle?: CSSProperties;
/** Filled icons `span` className */
fillClassName?: string;
/** Custom empty icon SVG */
emptyIcon?: ReactNode | null;
/** Empty icons color */
emptyColor?: string;
/** Inline style applied to `empty-icons` span */
emptyStyle?: CSSProperties;
/** ٌُEmpty icons `span` className */
emptyClassName?: string;
/** Enable / Disable HTML`title` Tag */
allowTitleTag?: boolean;
/** Show a tooltip with live values */
showTooltip?: boolean;
/** Initial tooltip text if there is no rating value */
tooltipDefaultText?: string;
/** Array of strings that will show inside the tooltip */
tooltipArray?: string[];
/** Inline style applied to the `tooltip` span */
tooltipStyle?: CSSProperties;
/** Tooltip CSS className */
tooltipClassName?: string;
/** Separator word in a title of a rating star `(1 out of 5)` */
titleSeparator?: string;
}
export declare function Rating({ onClick, onPointerMove, onPointerEnter, onPointerLeave, initialValue, iconsCount, size, readonly, rtl, customIcons, allowFraction, style, className, transition, allowHover, disableFillHover, fillIcon, fillColor, fillColorArray, fillStyle, fillClassName, emptyIcon, emptyColor, emptyStyle, emptyClassName, allowTitleTag, showTooltip, tooltipDefaultText, tooltipArray, tooltipStyle, tooltipClassName, SVGclassName, titleSeparator, SVGstyle, SVGstorkeWidth, SVGstrokeColor }: RatingProps): JSX.Element;

View File

@@ -0,0 +1,10 @@
import React from 'react';
export interface StarIconProps {
/** Icon width / height in `px` */
size?: number;
SVGstrokeColor?: string;
SVGstorkeWidth?: string | number;
SVGclassName?: string;
SVGstyle?: React.CSSProperties;
}
export declare function StarIcon({ size, SVGstrokeColor, SVGstorkeWidth, SVGclassName, SVGstyle }: StarIconProps): JSX.Element;

View File

@@ -0,0 +1 @@
export * from './components/Rating';

2
node_modules/react-simple-star-rating/dist/index.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,18 @@
type State = {
ratingValue: number | null;
hoverValue: number | null;
hoverIndex: number;
valueIndex: number;
};
type Action = {
type: 'PointerMove';
payload: number | null;
index: number;
} | {
type: 'PointerLeave';
} | {
type: 'MouseClick';
payload: number;
};
export declare function reducer(state: State, action: Action): State;
export {};