@julseb-lib/react 1.0.10 → 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 CHANGED
@@ -66512,6 +66512,9 @@ var Rating = ({
66512
66512
  id,
66513
66513
  validation,
66514
66514
  containerClassName,
66515
+ iconsSize = 32,
66516
+ accentColor = "primary",
66517
+ gap = "xs",
66515
66518
  ...rest
66516
66519
  }) => {
66517
66520
  return /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
@@ -66528,7 +66531,7 @@ var Rating = ({
66528
66531
  {
66529
66532
  ref,
66530
66533
  id,
66531
- className: clsx("flex gap-2", "rating", className),
66534
+ className: clsx("flex", genGap[gap], "rating", className),
66532
66535
  ...rest,
66533
66536
  children: (0, import_utils82.generateNumbers)(0, 4).map((n) => {
66534
66537
  const Element = readOnly ? "span" : "button";
@@ -66538,20 +66541,20 @@ var Rating = ({
66538
66541
  onClick: () => !readOnly && setRating(n + 1),
66539
66542
  type: "button",
66540
66543
  className: clsx(
66541
- readOnly ? "text-primary-500" : genTextColorHover["primary"],
66544
+ readOnly ? genTextAllColor[accentColor] : genTextColorHover[accentColor],
66542
66545
  validation?.status === false ? readOnly ? "text-danger-500" : genTextColorHover["danger"] : validation?.status === true && (readOnly ? "text-success-500" : genTextColorHover["success"]),
66543
66546
  "rating-item"
66544
66547
  ),
66545
66548
  children: n >= rating ? icons?.default ?? /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
66546
66549
  import_bi15.BiStar,
66547
66550
  {
66548
- size: 32,
66551
+ size: iconsSize,
66549
66552
  className: "rating-icon"
66550
66553
  }
66551
66554
  ) : icons?.checked ?? /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
66552
66555
  import_bi15.BiSolidStar,
66553
66556
  {
66554
- size: 32,
66557
+ size: iconsSize,
66555
66558
  className: "rating-icon"
66556
66559
  }
66557
66560
  )
@@ -68286,25 +68289,28 @@ var import_utils121 = require("@julseb-lib/utils");
68286
68289
  var import_jsx_runtime351 = require("react/jsx-runtime");
68287
68290
  var SlideshowPagination = ({
68288
68291
  className,
68289
- pagination,
68290
68292
  images,
68291
68293
  active,
68292
68294
  setActive,
68293
- contentLength
68295
+ contentLength,
68296
+ handleClick,
68297
+ position = "outside",
68298
+ hideOnTouch,
68299
+ color = "primary",
68300
+ type = "dots"
68294
68301
  }) => {
68295
68302
  const isTouchScreen = useTouchScreen();
68296
- if (isTouchScreen && pagination?.hideOnTouch || contentLength === 0)
68297
- return null;
68303
+ if (isTouchScreen && hideOnTouch || contentLength === 0) return null;
68298
68304
  return /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
68299
68305
  "div",
68300
68306
  {
68301
68307
  className: clsx(
68302
68308
  "flex justify-center gap-2 mx-auto px-2 w-full max-w-[70%]",
68303
- pagination?.position === "outside" ? "" : "absolute bottom-1 left-[50%] -translate-x-[50%]",
68309
+ position === "outside" ? "" : "absolute bottom-1 left-[50%] -translate-x-[50%]",
68304
68310
  "slideshow-controls",
68305
68311
  className
68306
68312
  ),
68307
- children: pagination?.type === "thumbnails" ? images?.map((image, i) => /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
68313
+ children: type === "thumbnails" ? images?.map((image, i) => /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
68308
68314
  "button",
68309
68315
  {
68310
68316
  className: clsx(
@@ -68314,7 +68320,10 @@ var SlideshowPagination = ({
68314
68320
  active === i && "active",
68315
68321
  "slideshow-thumbnail-container"
68316
68322
  ),
68317
- onClick: () => setActive(i),
68323
+ onClick: () => {
68324
+ setActive(i);
68325
+ handleClick(i);
68326
+ },
68318
68327
  children: /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
68319
68328
  "img",
68320
68329
  {
@@ -68332,20 +68341,21 @@ var SlideshowPagination = ({
68332
68341
  {
68333
68342
  className: clsx(
68334
68343
  "",
68335
- pagination?.type === "dots-outline" ? outlineColor[pagination?.color ?? "primary"] : genBgColor2[pagination?.color ?? "primary"],
68344
+ type === "dots-outline" ? outlineColor[color ?? "primary"] : genBgColor2[color ?? "primary"],
68336
68345
  active === n && "active",
68337
- pagination?.type === "dots" && [
68346
+ type === "dots" && [
68338
68347
  "size-2 rounded-full block"
68339
68348
  ],
68340
- pagination?.type === "dots-outline" && [
68349
+ type === "dots-outline" && [
68341
68350
  "size-2 rounded-full border-1"
68342
68351
  ],
68343
- pagination?.type === "bars" && [
68344
- "grow h-1 rounded-full"
68345
- ],
68352
+ type === "bars" && ["grow h-1 rounded-full"],
68346
68353
  "slideshow-control"
68347
68354
  ),
68348
- onClick: () => setActive(n)
68355
+ onClick: () => {
68356
+ setActive(n);
68357
+ handleClick(n);
68358
+ }
68349
68359
  },
68350
68360
  n
68351
68361
  ))
@@ -68596,17 +68606,16 @@ var Slideshow = ({
68596
68606
  !hidePagination && totalSlides > 1 && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
68597
68607
  SlideshowPagination,
68598
68608
  {
68609
+ className: pagination?.className,
68610
+ images: pagination?.images,
68599
68611
  active: currentSlide,
68600
68612
  setActive: setCurrentSlide,
68601
68613
  contentLength: totalSlides,
68602
68614
  handleClick: goToSlide,
68603
- pagination: {
68604
- type: pagination?.type ?? "dots",
68605
- hideOnTouch: pagination?.hideOnTouch ?? false,
68606
- position: pagination?.position ?? "outside",
68607
- color: pagination?.color ?? "primary"
68608
- },
68609
- images
68615
+ position: pagination?.position,
68616
+ hideOnTouch: pagination?.hideOnTouch,
68617
+ color: pagination?.color,
68618
+ type: pagination?.type
68610
68619
  }
68611
68620
  )
68612
68621
  ]