UNPKG

@yamada-ui/rating

Version:

Yamada UI rating component

1 lines 1.58 kB
{"version":3,"sources":["../src/rating-context.ts"],"sourcesContent":["import type { CSSUIObject, RequiredPropGetter } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport type { Dict, Merge } from \"@yamada-ui/utils\"\nimport type { Dispatch, ReactNode, SetStateAction } from \"react\"\nimport type { GroupProps, InputProps, ItemProps } from \"./use-rating\"\nimport { createContext } from \"@yamada-ui/utils\"\n\ninterface RatingContext {\n id: string\n name: string\n decimal: number\n emptyIcon: ((value: number) => ReactNode) | ReactNode | undefined\n filledIcon: ((value: number) => ReactNode) | ReactNode | undefined\n highlightSelectedOnly: boolean\n hoveredValue: number\n outside: boolean\n resolvedValue: number\n roundedValue: number\n setHoveredValue: Dispatch<SetStateAction<number>>\n setValue: Dispatch<SetStateAction<number>>\n styles: { [key: string]: CSSUIObject | undefined }\n value: number\n formControlProps: Dict\n getGroupProps: RequiredPropGetter<\n Merge<MotionProps, { value: number }>,\n MotionProps\n >\n groupProps: GroupProps | undefined\n inputProps: InputProps | undefined\n itemProps: ItemProps | undefined\n}\n\nexport const [RatingProvider, useRatingContext] = createContext<RatingContext>({\n name: \"RatingContext\",\n errorMessage: `useRatingContext returned is 'undefined'. Seems you forgot to wrap the components in \"<Rating />\"`,\n})\n"],"mappings":";;;AAKA,SAAS,qBAAqB;AA2BvB,IAAM,CAAC,gBAAgB,gBAAgB,IAAI,cAA6B;AAAA,EAC7E,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;","names":[]}