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

21
node_modules/react-simple-star-rating/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2021-present awran5
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

155
node_modules/react-simple-star-rating/README.md generated vendored Normal file
View File

@@ -0,0 +1,155 @@
# React Simple Rating
> A simple react component for adding a star rating to your project.
[![NPM](https://img.shields.io/npm/v/react-simple-star-rating.svg)](https://www.npmjs.com/package/react-simple-star-rating) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)![npm bundle size](https://img.shields.io/bundlephobia/min/react-simple-star-rating)![GitHub](https://img.shields.io/github/license/awran5/react-simple-star-rating)
<p align="center">
<img src="./screenshot.gif" alt="screenshot" width="100%" />
</p>
## Install
#### npm
```sh
npm i react-simple-star-rating
```
#### Yarn
```sh
yarn add react-simple-star-rating
```
<br />
## Usage
```jsx
import React, { useState } from 'react'
import { Rating } from 'react-simple-star-rating'
export function MyComponent() {
const [rating, setRating] = useState(0)
// Catch Rating value
const handleRating = (rate: number) => {
setRating(rate)
// other logic
}
// Optinal callback functions
const onPointerEnter = () => console.log('Enter')
const onPointerLeave = () => console.log('Leave')
const onPointerMove = (value: number, index: number) => console.log(value, index)
return (
<div className='App'>
<Rating
onClick={handleRating}
onPointerEnter={onPointerEnter}
onPointerLeave={onPointerLeave}
onPointerMove={onPointerMove}
/* Available Props */
/>
</div>
)
}
```
## Reset Rating Value
```jsx
import React, { useState } from 'react'
import { Rating } from 'react-simple-star-rating'
export function MyComponent() {
const [rating, setRating] = useState(0)
// Catch Rating value
const handleRating = (rate: number) => {
setRating(rate)
}
const handleReset = () => {
// Set the initial value
setRating(0)
}
return (
<div className='App'>
{/* set initial value */}
<Rating onClick={handleRating} initialValue={rating} />
<button onClick={handleReset}>reset</button>
</div>
)
}
```
### Available Props
| Prop | Type | Options | Description | Default |
| -------------------- | ---------------- | -------- | --------------------------------------------------------- | :------------------------: |
| `onClick` | function | Optional | callback with `hover`, `index` and `event` values passed | `-` |
| `onPointerMove` | function | Optional | callback with `hover`, `index` and `event` values passed | `-` |
| `onPointerEnter` | function | Optional | callback with `event` passed | `-` |
| `onPointerLeave` | function | Optional | callback with `event` passed | `-` |
| `initialValue` | number | Optional | Set initial value | `0` |
| `iconsCount` | number | Optional | Number of the icons | `5` |
| `readonly` | boolean | Optional | Readonly mode | `false` |
| `rtl` | boolean | Optional | RTL mode | `false` |
| `transition` | boolean | Optional | Adds a smooth transition effect on mouse hover | `false` |
| `allowFraction` | boolean | Optional | Enable a fractional icon (half icon) | `false` |
| `className` | string | Optional | Applied to the `main` span | `react-simple-star-rating` |
| `style` | CSSProperties | Optional | Inline style applied to the `main` span | `basic style` |
| `size` | number | Optional | SVG Icon width / height in `px` | `25` |
| `SVGstrokeColor` | string | Optional | SVG Icon stroke color | `currentColor` |
| `SVGstorkeWidth` | string \| number | Optional | SVG Icon storke width | `0` |
| `SVGclassName` | string | Optional | SVG Icon css class | `star-svg` |
| `SVGstyle` | CSSProperties | Optional | SVG inline style | `-` |
| `fillIcon` | ReactNode | Optional | Custom fill icon SVG | `null` |
| `fillColor` | string | Optional | Fill icons color | `#f1a545` |
| `fillColorArray` | array | Optional | Array of string to add color range | `[]` |
| `fillStyle` | CSSProperties | Optional | Inline style applied to `filled` icon span | `basic style` |
| `fillClassName` | string | Optional | Applied to the `filled` icon span | `filled-icons` |
| `emptyIcon` | ReactNode | Optional | Custom empty icon SVG | `null` |
| `emptyColor` | string | Optional | Empty icons color | `#cccccc` |
| `emptyStyle` | CSSProperties | Optional | Inline style applied to `empty` icon span | `basic style` |
| `emptyClassName` | string | Optional | Applied to the `empty` icon span | `empty-icons` |
| `customIcons` | array of object | Optional | Add a group of icons | `[]` |
| `allowHover` | boolean | Optional | Enable / Disable hover effect | `true` |
| `disableFillHover` | boolean | Optional | Enable / Disable hover effect on filled stars | `false` |
| `showTooltip` | string | Optional | Show a tooltip with live values | `false` |
| `tooltipDefaultText` | string | Optional | Initial tooltip text if no rating value | `Your Rate` |
| `tooltipArray` | array | Optional | Array of strings to show inside tooltip | `[]` |
| `tooltipClassName` | string | Optional | Tooltip CSS class | `rating-tooltip` |
| `tooltipStyle` | CSSProperties | Optional | Inline style applied to the `tooltip` span | `basic style` |
| `titleSeparator` | string | Optional | Separator word in a title of a rating star `(1 out of 5)` | `out of` |
---
<br />
## BREAKING CHANGES: version [4.1.0](https://github.com/awran5/react-simple-star-rating/compare/v4.0.5...v4.1.0) (2022-10-03)
| old | new | changes |
| --------------- | --------------- | --------- |
| `allowHalfIcon` | `allowFraction` | `Renamed` |
| `fullIcon` | `fillIcon` | `Renamed` |
| `fullStyle` | `fillStyle` | `Renamed` |
| `fullClassName` | `fillClassName` | `Renamed` |
| `ratingValue` | `-` | `Removed` |
## Demos
See all demos and usage examples [in action](https://react-simple-star-rating.vercel.app/).
<br />
[![Edit react-simple-rating-ts](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-simple-rating-ts-fzmpu?fontsize=14&hidenavigation=1&theme=dark)
### License
MIT © [awran5](https://github.com/awran5/)

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 {};

92
node_modules/react-simple-star-rating/package.json generated vendored Normal file
View File

@@ -0,0 +1,92 @@
{
"name": "react-simple-star-rating",
"version": "5.1.7",
"private": false,
"description": "A simple react component for adding a star rating to your project.",
"author": {
"name": "awran5",
"email": "awran5@yahoo.com"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/awran5/react-simple-star-rating.git"
},
"bugs": {
"url": "https://github.com/awran5/react-simple-star-rating/issues"
},
"homepage": "https://github.com/awran5/react-simple-star-rating#readme",
"main": "dist/index.js",
"source": "src/index.tsx",
"engines": {
"node": ">=14"
},
"scripts": {
"clean": "rm -rf dist",
"start:rollup": "rollup -cw --exports auto",
"build": "rollup -c --exports auto",
"log": "auto-changelog -p --template keepachangelog && git add CHANGELOG.md",
"start": "start-storybook -p 6006",
"build-storybook": "build-storybook && vercel --prod"
},
"peerDependencies": {
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
},
"devDependencies": {
"@babel/core": "^7.19.1",
"@rollup/plugin-commonjs": "^23.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
"@storybook/addon-actions": "^6.5.13",
"@storybook/addon-docs": "^6.5.13",
"@storybook/addon-essentials": "^6.5.13",
"@storybook/addon-interactions": "^6.5.13",
"@storybook/addon-links": "^6.5.13",
"@storybook/builder-webpack5": "^6.5.13",
"@storybook/manager-webpack5": "^6.5.13",
"@storybook/preset-create-react-app": "^4.1.2",
"@storybook/react": "^6.5.13",
"@storybook/testing-library": "^0.0.13",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"auto-changelog": "^2.4.0",
"autoprefixer": "^10.4.12",
"babel-loader": "^8.2.5",
"postcss": "^8.4.17",
"prettier": "^2.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.4.0",
"react-scripts": "^5.0.1",
"rollup": "^2.79.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.34.1",
"typescript": "^4.8.3"
},
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"eslintConfig": {
"extends": [
"react-app"
]
},
"keywords": [
"react",
"star rating",
"react component",
"react rating"
],
"tags": [
"react",
"star-rating",
"react-component",
"react-rating"
],
"dependencies": {}
}