@julseb-lib/react 1.0.11 → 1.0.13

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.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 HTMLDivElement
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 {function} [props.setRating] - Function to update the rating value when not in read-only mode.
1786
- * @prop {object} [props.icons] - Icon configuration object with default and checked icon variants.
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 {any} [props.rest] - Additional props spread to the rating container.
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 HTMLDivElement
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 {function} [props.setRating] - Function to update the rating value when not in read-only mode.
1786
- * @prop {object} [props.icons] - Icon configuration object with default and checked icon variants.
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 {any} [props.rest] - Additional props spread to the rating container.
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-2", "rating", className),
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 ? "text-primary-500" : genTextColorHover["primary"],
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: 32,
66369
+ size: iconsSize,
66367
66370
  className: "rating-icon"
66368
66371
  }
66369
66372
  ) : icons?.checked ?? /* @__PURE__ */ jsx318(
66370
66373
  BiSolidStar,
66371
66374
  {
66372
- size: 32,
66375
+ size: iconsSize,
66373
66376
  className: "rating-icon"
66374
66377
  }
66375
66378
  )
@@ -66821,10 +66824,10 @@ var AccordionTitle = ({
66821
66824
  };
66822
66825
 
66823
66826
  // src/lib/components/Accordion/AccordionContent.tsx
66824
- import "react";
66827
+ import { Fragment as Fragment9 } from "react";
66825
66828
  import { jsx as jsx327 } from "react/jsx-runtime";
66826
66829
  var AccordionContent = ({
66827
- element = Text,
66830
+ element,
66828
66831
  ref,
66829
66832
  className,
66830
66833
  variant = "basic",
@@ -66832,7 +66835,7 @@ var AccordionContent = ({
66832
66835
  children,
66833
66836
  ...rest
66834
66837
  }) => {
66835
- const Element = element;
66838
+ const Element = element ?? (typeof children === "string" ? Text : Fragment9);
66836
66839
  return /* @__PURE__ */ jsx327(
66837
66840
  Element,
66838
66841
  {
@@ -67322,12 +67325,12 @@ var Modal = ({
67322
67325
  };
67323
67326
 
67324
67327
  // src/lib/components/DragList/DragList.tsx
67325
- import { useRef as useRef13, useState as useState20, Fragment as Fragment10 } from "react";
67328
+ import { useRef as useRef13, useState as useState20, Fragment as Fragment11 } from "react";
67326
67329
 
67327
67330
  // src/lib/components/DragList/DragListItem.tsx
67328
67331
  import "react";
67329
67332
  import { BiDotsVerticalRounded } from "react-icons/bi";
67330
- import { Fragment as Fragment9, jsx as jsx337, jsxs as jsxs280 } from "react/jsx-runtime";
67333
+ import { Fragment as Fragment10, jsx as jsx337, jsxs as jsxs280 } from "react/jsx-runtime";
67331
67334
  var DragListItem = ({
67332
67335
  className,
67333
67336
  element = "div",
@@ -67376,7 +67379,7 @@ var DragListItem = ({
67376
67379
  "flex flex-col gap-1 grow",
67377
67380
  "drag-list-item-content"
67378
67381
  ),
67379
- children: item ? /* @__PURE__ */ jsxs280(Fragment9, { children: [
67382
+ children: item ? /* @__PURE__ */ jsxs280(Fragment10, { children: [
67380
67383
  typeof item.title === "string" ? /* @__PURE__ */ jsx337(Text, { tag: "h6", className: "drag-list-item-title", children: item.title }) : item.title,
67381
67384
  item.body && (typeof item.body === "string" ? /* @__PURE__ */ jsx337(Text, { className: "drag-list-item-body", children: item.body }) : item.body)
67382
67385
  ] }) : children
@@ -67435,7 +67438,7 @@ var DragList = ({
67435
67438
  className
67436
67439
  ),
67437
67440
  ...rest,
67438
- children: items ? items.map((item, i) => /* @__PURE__ */ jsxs281(Fragment10, { children: [
67441
+ children: items ? items.map((item, i) => /* @__PURE__ */ jsxs281(Fragment11, { children: [
67439
67442
  /* @__PURE__ */ createElement3(
67440
67443
  DragListItem,
67441
67444
  {
@@ -67496,7 +67499,7 @@ var PaginationButton = ({
67496
67499
  };
67497
67500
 
67498
67501
  // src/lib/components/Pagination/Pagination.tsx
67499
- import { Fragment as Fragment11, jsx as jsx340, jsxs as jsxs282 } from "react/jsx-runtime";
67502
+ import { Fragment as Fragment12, jsx as jsx340, jsxs as jsxs282 } from "react/jsx-runtime";
67500
67503
  var Pagination = ({
67501
67504
  className,
67502
67505
  element = "div",
@@ -67534,7 +67537,7 @@ var Pagination = ({
67534
67537
  className
67535
67538
  ),
67536
67539
  ...rest,
67537
- children: totalPages ? /* @__PURE__ */ jsxs282(Fragment11, { children: [
67540
+ children: totalPages ? /* @__PURE__ */ jsxs282(Fragment12, { children: [
67538
67541
  /* @__PURE__ */ jsx340(
67539
67542
  PaginationButton,
67540
67543
  {
@@ -67545,7 +67548,7 @@ var Pagination = ({
67545
67548
  children: icons?.prev ?? /* @__PURE__ */ jsx340(BiLeftArrowAlt, { size: 24 })
67546
67549
  }
67547
67550
  ),
67548
- paginationGroup[0] !== 1 && /* @__PURE__ */ jsxs282(Fragment11, { children: [
67551
+ paginationGroup[0] !== 1 && /* @__PURE__ */ jsxs282(Fragment12, { children: [
67549
67552
  /* @__PURE__ */ jsx340(
67550
67553
  PaginationButton,
67551
67554
  {
@@ -67574,7 +67577,7 @@ var Pagination = ({
67574
67577
  },
67575
67578
  n
67576
67579
  )),
67577
- paginationGroup[paginationGroup.length - 1] !== totalPages && /* @__PURE__ */ jsxs282(Fragment11, { children: [
67580
+ paginationGroup[paginationGroup.length - 1] !== totalPages && /* @__PURE__ */ jsxs282(Fragment12, { children: [
67578
67581
  /* @__PURE__ */ jsx340(
67579
67582
  PaginationButton,
67580
67583
  {
@@ -68204,7 +68207,7 @@ var outlineColor = {
68204
68207
  };
68205
68208
 
68206
68209
  // src/lib/components/Slideshow/Slideshow.tsx
68207
- import { Fragment as Fragment12, jsx as jsx351, jsxs as jsxs286 } from "react/jsx-runtime";
68210
+ import { Fragment as Fragment13, jsx as jsx351, jsxs as jsxs286 } from "react/jsx-runtime";
68208
68211
  var Slideshow = ({
68209
68212
  className,
68210
68213
  element = "div",
@@ -68405,7 +68408,7 @@ var Slideshow = ({
68405
68408
  )
68406
68409
  }
68407
68410
  ),
68408
- !hideControls && totalSlides > 1 && /* @__PURE__ */ jsxs286(Fragment12, { children: [
68411
+ !hideControls && totalSlides > 1 && /* @__PURE__ */ jsxs286(Fragment13, { children: [
68409
68412
  /* @__PURE__ */ jsx351(
68410
68413
  SlideshowButton,
68411
68414
  {
@@ -69401,7 +69404,7 @@ var HeaderSearch = ({ search, handleClose }) => {
69401
69404
  };
69402
69405
 
69403
69406
  // src/lib/components/Header/Header.tsx
69404
- import { Fragment as Fragment13, jsx as jsx366, jsxs as jsxs292 } from "react/jsx-runtime";
69407
+ import { Fragment as Fragment14, jsx as jsx366, jsxs as jsxs292 } from "react/jsx-runtime";
69405
69408
  var Header = ({
69406
69409
  className,
69407
69410
  element = "header",
@@ -69463,7 +69466,7 @@ var Header = ({
69463
69466
  };
69464
69467
  const searchProps = { search, handleClose };
69465
69468
  const navProps = {
69466
- children: /* @__PURE__ */ jsxs292(Fragment13, { children: [
69469
+ children: /* @__PURE__ */ jsxs292(Fragment14, { children: [
69467
69470
  links ? links.map((link) => link) : nav ? nav : children,
69468
69471
  isMobile && /* @__PURE__ */ jsx366(HeaderSearch, { ...searchProps })
69469
69472
  ] }),
@@ -69549,7 +69552,7 @@ var Header = ({
69549
69552
  };
69550
69553
 
69551
69554
  // src/lib/components/Footer/Footer.tsx
69552
- import { Children as Children4, Fragment as Fragment14 } from "react";
69555
+ import { Children as Children4, Fragment as Fragment15 } from "react";
69553
69556
  import { uuid as uuid13 } from "@julseb-lib/utils";
69554
69557
  import { jsx as jsx367, jsxs as jsxs293 } from "react/jsx-runtime";
69555
69558
  var Footer = ({
@@ -69585,7 +69588,7 @@ var Footer = ({
69585
69588
  ...rest,
69586
69589
  children: [
69587
69590
  typeof logo === "string" ? /* @__PURE__ */ jsx367(Text, { children: logo }) : logo,
69588
- /* @__PURE__ */ jsx367("div", { className: "flex items-container gap-2", children: items?.map((item, i) => /* @__PURE__ */ jsxs293(Fragment14, { children: [
69591
+ /* @__PURE__ */ jsx367("div", { className: "flex items-container gap-2", children: items?.map((item, i) => /* @__PURE__ */ jsxs293(Fragment15, { children: [
69589
69592
  item,
69590
69593
  i !== items.length - 1 && !hideLinksSeparator && /* @__PURE__ */ jsx367(
69591
69594
  "span",
@@ -69596,7 +69599,7 @@ var Footer = ({
69596
69599
  children: linksSeparator === "dot" ? "\u2022" : "-"
69597
69600
  }
69598
69601
  )
69599
- ] }, uuid13())) ?? childrenArray.map((child, i) => /* @__PURE__ */ jsxs293(Fragment14, { children: [
69602
+ ] }, uuid13())) ?? childrenArray.map((child, i) => /* @__PURE__ */ jsxs293(Fragment15, { children: [
69600
69603
  child,
69601
69604
  i !== childrenArray.length - 1 && !hideLinksSeparator && (linksSeparator === "dot" ? "\u2022" : "-")
69602
69605
  ] }, uuid13())) })
@@ -69607,7 +69610,7 @@ var Footer = ({
69607
69610
 
69608
69611
  // src/lib/components/Meta/Meta.tsx
69609
69612
  import "react";
69610
- import { Fragment as Fragment15, jsx as jsx368, jsxs as jsxs294 } from "react/jsx-runtime";
69613
+ import { Fragment as Fragment16, jsx as jsx368, jsxs as jsxs294 } from "react/jsx-runtime";
69611
69614
  var Meta = ({
69612
69615
  children,
69613
69616
  title,
@@ -69631,7 +69634,7 @@ var Meta = ({
69631
69634
  appleTouchIcon,
69632
69635
  themeColor
69633
69636
  }) => {
69634
- return /* @__PURE__ */ jsxs294(Fragment15, { children: [
69637
+ return /* @__PURE__ */ jsxs294(Fragment16, { children: [
69635
69638
  /* @__PURE__ */ jsx368("meta", { charSet: "utf-8" }),
69636
69639
  /* @__PURE__ */ jsx368(
69637
69640
  "meta",
@@ -69640,29 +69643,29 @@ var Meta = ({
69640
69643
  content: "width=device-width, initial-scale=1"
69641
69644
  }
69642
69645
  ),
69643
- title && /* @__PURE__ */ jsxs294(Fragment15, { children: [
69646
+ title && /* @__PURE__ */ jsxs294(Fragment16, { children: [
69644
69647
  /* @__PURE__ */ jsx368("title", { children: title }),
69645
69648
  /* @__PURE__ */ jsx368("meta", { property: "og:title", content: title }),
69646
69649
  /* @__PURE__ */ jsx368("meta", { name: "twitter:title", content: title })
69647
69650
  ] }),
69648
- description && /* @__PURE__ */ jsxs294(Fragment15, { children: [
69651
+ description && /* @__PURE__ */ jsxs294(Fragment16, { children: [
69649
69652
  /* @__PURE__ */ jsx368("meta", { name: "description", content: description }),
69650
69653
  /* @__PURE__ */ jsx368("meta", { property: "og:description", content: description }),
69651
69654
  /* @__PURE__ */ jsx368("meta", { name: "twitter:description", content: description })
69652
69655
  ] }),
69653
- siteName && /* @__PURE__ */ jsxs294(Fragment15, { children: [
69656
+ siteName && /* @__PURE__ */ jsxs294(Fragment16, { children: [
69654
69657
  /* @__PURE__ */ jsx368("meta", { name: "application-name", content: siteName }),
69655
69658
  /* @__PURE__ */ jsx368("meta", { property: "og:site_name", content: siteName })
69656
69659
  ] }),
69657
- author && /* @__PURE__ */ jsxs294(Fragment15, { children: [
69660
+ author && /* @__PURE__ */ jsxs294(Fragment16, { children: [
69658
69661
  /* @__PURE__ */ jsx368("meta", { name: "author", content: author }),
69659
69662
  /* @__PURE__ */ jsx368("meta", { name: "twitter:creator", content: author })
69660
69663
  ] }),
69661
- url && /* @__PURE__ */ jsxs294(Fragment15, { children: [
69664
+ url && /* @__PURE__ */ jsxs294(Fragment16, { children: [
69662
69665
  /* @__PURE__ */ jsx368("meta", { property: "og:url", content: url }),
69663
69666
  /* @__PURE__ */ jsx368("meta", { name: "twitter:site", content: url })
69664
69667
  ] }),
69665
- cover && /* @__PURE__ */ jsxs294(Fragment15, { children: [
69668
+ cover && /* @__PURE__ */ jsxs294(Fragment16, { children: [
69666
69669
  /* @__PURE__ */ jsx368("meta", { property: "og:image", content: cover }),
69667
69670
  /* @__PURE__ */ jsx368("meta", { name: "twitter:image", content: cover })
69668
69671
  ] }),
@@ -69686,7 +69689,7 @@ var Meta = ({
69686
69689
 
69687
69690
  // src/lib/components/PageLayout/PageLayout.tsx
69688
69691
  import { isValidElement } from "react";
69689
- import { Fragment as Fragment16, jsx as jsx369, jsxs as jsxs295 } from "react/jsx-runtime";
69692
+ import { Fragment as Fragment17, jsx as jsx369, jsxs as jsxs295 } from "react/jsx-runtime";
69690
69693
  var PageLayout = ({
69691
69694
  children,
69692
69695
  meta,
@@ -69697,7 +69700,7 @@ var PageLayout = ({
69697
69700
  noWrapper,
69698
69701
  noMain
69699
69702
  }) => {
69700
- return /* @__PURE__ */ jsxs295(Fragment16, { children: [
69703
+ return /* @__PURE__ */ jsxs295(Fragment17, { children: [
69701
69704
  meta && /* @__PURE__ */ jsx369(Meta, { ...meta }),
69702
69705
  isValidElement(header) ? header : /* @__PURE__ */ jsx369(Header, { ...header }),
69703
69706
  !noWrapper ? /* @__PURE__ */ jsx369(Wrapper, { ...wrapperProps, children: !noMain ? /* @__PURE__ */ jsx369(Main, { ...mainProps, children }) : children }) : children,