@julseb-lib/react 1.0.11 → 1.0.12
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.
- package/dist/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/types/components-props.d.cts +3 -0
- package/dist/types/components-props.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1777,13 +1777,13 @@ declare const Autocomplete: FC$1<ILibAutocomplete>;
|
|
|
1777
1777
|
* icons={{ default: <BiHeart />, checked: <BiSolidHeart /> }}
|
|
1778
1778
|
* />
|
|
1779
1779
|
*
|
|
1780
|
-
* @extends
|
|
1780
|
+
* @extends ILibRating
|
|
1781
1781
|
*
|
|
1782
1782
|
* @prop {string} [props.className] - Additional CSS classes to apply to the rating container.
|
|
1783
1783
|
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the rating container div element.
|
|
1784
1784
|
* @prop {number} [props.rating] - Current rating value (1-5 stars).
|
|
1785
|
-
* @prop {
|
|
1786
|
-
* @prop {
|
|
1785
|
+
* @prop {(rating: number) => void} [props.setRating] - Function to update the rating value when not in read-only mode.
|
|
1786
|
+
* @prop {{ default?: React.ReactNode; checked?: React.ReactNode }} [props.icons] - Icon configuration object with default and checked icon variants.
|
|
1787
1787
|
* @prop {boolean} [props.readOnly] - Whether the rating is in read-only mode (no interaction).
|
|
1788
1788
|
* @prop {string} [props.label] - Label text to display above the rating.
|
|
1789
1789
|
* @prop {string} [props.labelComment] - Additional comment text next to the label.
|
|
@@ -1791,8 +1791,10 @@ declare const Autocomplete: FC$1<ILibAutocomplete>;
|
|
|
1791
1791
|
* @prop {string} [props.helperBottom] - Helper text to display at the bottom of the rating.
|
|
1792
1792
|
* @prop {string} [props.id] - Unique identifier for the rating element.
|
|
1793
1793
|
* @prop {LibValidation} [props.validation] - Validation state and configuration object.
|
|
1794
|
-
* @prop {string} [containerClassName] - Additional CSS classes for the container.
|
|
1795
|
-
* @prop {
|
|
1794
|
+
* @prop {string} [props.containerClassName] - Additional CSS classes for the container.
|
|
1795
|
+
* @prop {number} [props.iconsSize=32] - Size of the rating icons. Default: 32.
|
|
1796
|
+
* @prop {LibColorsHover} [props.accentColor="primary"] - Accent color for the icons. Default: "primary".
|
|
1797
|
+
* @prop {"xs" | "sm" | "md" | "lg" | "xl" | "2xl"} [props.gap="xs"] - Gap between rating icons. Default: "xs".
|
|
1796
1798
|
*
|
|
1797
1799
|
* @returns {JSX.Element} The rendered Rating component.
|
|
1798
1800
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1777,13 +1777,13 @@ declare const Autocomplete: FC$1<ILibAutocomplete>;
|
|
|
1777
1777
|
* icons={{ default: <BiHeart />, checked: <BiSolidHeart /> }}
|
|
1778
1778
|
* />
|
|
1779
1779
|
*
|
|
1780
|
-
* @extends
|
|
1780
|
+
* @extends ILibRating
|
|
1781
1781
|
*
|
|
1782
1782
|
* @prop {string} [props.className] - Additional CSS classes to apply to the rating container.
|
|
1783
1783
|
* @prop {React.Ref<HTMLDivElement>} [props.ref] - Ref to the rating container div element.
|
|
1784
1784
|
* @prop {number} [props.rating] - Current rating value (1-5 stars).
|
|
1785
|
-
* @prop {
|
|
1786
|
-
* @prop {
|
|
1785
|
+
* @prop {(rating: number) => void} [props.setRating] - Function to update the rating value when not in read-only mode.
|
|
1786
|
+
* @prop {{ default?: React.ReactNode; checked?: React.ReactNode }} [props.icons] - Icon configuration object with default and checked icon variants.
|
|
1787
1787
|
* @prop {boolean} [props.readOnly] - Whether the rating is in read-only mode (no interaction).
|
|
1788
1788
|
* @prop {string} [props.label] - Label text to display above the rating.
|
|
1789
1789
|
* @prop {string} [props.labelComment] - Additional comment text next to the label.
|
|
@@ -1791,8 +1791,10 @@ declare const Autocomplete: FC$1<ILibAutocomplete>;
|
|
|
1791
1791
|
* @prop {string} [props.helperBottom] - Helper text to display at the bottom of the rating.
|
|
1792
1792
|
* @prop {string} [props.id] - Unique identifier for the rating element.
|
|
1793
1793
|
* @prop {LibValidation} [props.validation] - Validation state and configuration object.
|
|
1794
|
-
* @prop {string} [containerClassName] - Additional CSS classes for the container.
|
|
1795
|
-
* @prop {
|
|
1794
|
+
* @prop {string} [props.containerClassName] - Additional CSS classes for the container.
|
|
1795
|
+
* @prop {number} [props.iconsSize=32] - Size of the rating icons. Default: 32.
|
|
1796
|
+
* @prop {LibColorsHover} [props.accentColor="primary"] - Accent color for the icons. Default: "primary".
|
|
1797
|
+
* @prop {"xs" | "sm" | "md" | "lg" | "xl" | "2xl"} [props.gap="xs"] - Gap between rating icons. Default: "xs".
|
|
1796
1798
|
*
|
|
1797
1799
|
* @returns {JSX.Element} The rendered Rating component.
|
|
1798
1800
|
*
|
package/dist/index.js
CHANGED
|
@@ -66330,6 +66330,9 @@ var Rating = ({
|
|
|
66330
66330
|
id,
|
|
66331
66331
|
validation,
|
|
66332
66332
|
containerClassName,
|
|
66333
|
+
iconsSize = 32,
|
|
66334
|
+
accentColor = "primary",
|
|
66335
|
+
gap = "xs",
|
|
66333
66336
|
...rest
|
|
66334
66337
|
}) => {
|
|
66335
66338
|
return /* @__PURE__ */ jsx318(
|
|
@@ -66346,7 +66349,7 @@ var Rating = ({
|
|
|
66346
66349
|
{
|
|
66347
66350
|
ref,
|
|
66348
66351
|
id,
|
|
66349
|
-
className: clsx("flex gap
|
|
66352
|
+
className: clsx("flex", genGap[gap], "rating", className),
|
|
66350
66353
|
...rest,
|
|
66351
66354
|
children: generateNumbers(0, 4).map((n) => {
|
|
66352
66355
|
const Element = readOnly ? "span" : "button";
|
|
@@ -66356,20 +66359,20 @@ var Rating = ({
|
|
|
66356
66359
|
onClick: () => !readOnly && setRating(n + 1),
|
|
66357
66360
|
type: "button",
|
|
66358
66361
|
className: clsx(
|
|
66359
|
-
readOnly ?
|
|
66362
|
+
readOnly ? genTextAllColor[accentColor] : genTextColorHover[accentColor],
|
|
66360
66363
|
validation?.status === false ? readOnly ? "text-danger-500" : genTextColorHover["danger"] : validation?.status === true && (readOnly ? "text-success-500" : genTextColorHover["success"]),
|
|
66361
66364
|
"rating-item"
|
|
66362
66365
|
),
|
|
66363
66366
|
children: n >= rating ? icons?.default ?? /* @__PURE__ */ jsx318(
|
|
66364
66367
|
BiStar,
|
|
66365
66368
|
{
|
|
66366
|
-
size:
|
|
66369
|
+
size: iconsSize,
|
|
66367
66370
|
className: "rating-icon"
|
|
66368
66371
|
}
|
|
66369
66372
|
) : icons?.checked ?? /* @__PURE__ */ jsx318(
|
|
66370
66373
|
BiSolidStar,
|
|
66371
66374
|
{
|
|
66372
|
-
size:
|
|
66375
|
+
size: iconsSize,
|
|
66373
66376
|
className: "rating-icon"
|
|
66374
66377
|
}
|
|
66375
66378
|
)
|