odaptos_design_system 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  interface StarRatingProps {
3
+ value?: number;
3
4
  onClick: (index: number) => void;
5
+ strokeColor?: string;
6
+ fillColor?: string;
4
7
  }
5
- export declare const StarRating: ({ onClick }: StarRatingProps) => React.JSX.Element;
8
+ export declare const StarRating: ({ value, onClick, strokeColor, fillColor, }: StarRatingProps) => React.JSX.Element;
6
9
  export {};
@@ -14375,9 +14375,12 @@ var styles$E = {"star_button":"StarRating-module_star_button__-Ow5-","on":"StarR
14375
14375
  styleInject(css_248z$E);
14376
14376
 
14377
14377
  const StarRating = ({
14378
- onClick
14378
+ value,
14379
+ onClick,
14380
+ strokeColor,
14381
+ fillColor
14379
14382
  }) => {
14380
- const [rating, setRating] = React.useState(0);
14383
+ const [rating, setRating] = React.useState(value ?? 0);
14381
14384
  const [hover, setHover] = React.useState(0);
14382
14385
  return /*#__PURE__*/React__default.createElement("div", {
14383
14386
  className: styles$E.star_rating
@@ -14404,8 +14407,8 @@ const StarRating = ({
14404
14407
  clipPath: "url(#clip0_2837_24714)"
14405
14408
  }, /*#__PURE__*/React__default.createElement("path", {
14406
14409
  d: "M8.48489 0.800092L10.7156 5.21943L15.0089 5.64476C15.1111 5.65325 15.2087 5.69086 15.2902 5.75312C15.3717 5.81538 15.4337 5.89968 15.4688 5.99606C15.5038 6.09244 15.5106 6.19685 15.4881 6.29693C15.4657 6.39701 15.4151 6.48856 15.3422 6.56076L11.8089 10.0628L13.1189 14.8214C13.1457 14.9224 13.1428 15.0289 13.1105 15.1282C13.0782 15.2275 13.0178 15.3154 12.9368 15.3812C12.8557 15.4471 12.7574 15.4881 12.6535 15.4994C12.5497 15.5106 12.4449 15.4917 12.3516 15.4448L7.99889 13.2894L3.65222 15.4421C3.55892 15.489 3.45405 15.508 3.35023 15.4967C3.24641 15.4854 3.14805 15.4444 3.067 15.3786C2.98594 15.3127 2.92563 15.2248 2.89332 15.1255C2.86102 15.0262 2.85809 14.9197 2.88489 14.8188L4.19489 10.0601L0.65889 6.55809C0.586045 6.4859 0.535412 6.39434 0.512986 6.29426C0.490561 6.19418 0.497282 6.08977 0.532354 5.9934C0.567426 5.89702 0.62938 5.81271 0.71088 5.75045C0.792381 5.68819 0.890015 5.65059 0.992223 5.64209L5.28556 5.21676L7.51289 0.800092C7.5587 0.710626 7.62831 0.63554 7.71407 0.583107C7.79982 0.530674 7.89838 0.50293 7.99889 0.50293C8.0994 0.50293 8.19796 0.530674 8.28372 0.583107C8.36947 0.63554 8.43908 0.710626 8.48489 0.800092Z",
14407
- fill: index <= hover || index <= rating ? '#f9dc4d' : 'none',
14408
- stroke: index <= hover || index <= rating ? '#f9dc4d' : '#96989A',
14410
+ fill: index <= hover || index <= rating ? fillColor ?? '#f9dc4d' : 'none',
14411
+ stroke: index <= hover || index <= rating ? strokeColor ?? '#f9dc4d' : '#96989A',
14409
14412
  strokeLinecap: "round",
14410
14413
  strokeLinejoin: "round"
14411
14414
  })), /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("clipPath", {