@julseb-lib/react 1.0.10 → 1.0.11

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
@@ -68286,25 +68286,28 @@ var import_utils121 = require("@julseb-lib/utils");
68286
68286
  var import_jsx_runtime351 = require("react/jsx-runtime");
68287
68287
  var SlideshowPagination = ({
68288
68288
  className,
68289
- pagination,
68290
68289
  images,
68291
68290
  active,
68292
68291
  setActive,
68293
- contentLength
68292
+ contentLength,
68293
+ handleClick,
68294
+ position = "outside",
68295
+ hideOnTouch,
68296
+ color = "primary",
68297
+ type = "dots"
68294
68298
  }) => {
68295
68299
  const isTouchScreen = useTouchScreen();
68296
- if (isTouchScreen && pagination?.hideOnTouch || contentLength === 0)
68297
- return null;
68300
+ if (isTouchScreen && hideOnTouch || contentLength === 0) return null;
68298
68301
  return /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
68299
68302
  "div",
68300
68303
  {
68301
68304
  className: clsx(
68302
68305
  "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%]",
68306
+ position === "outside" ? "" : "absolute bottom-1 left-[50%] -translate-x-[50%]",
68304
68307
  "slideshow-controls",
68305
68308
  className
68306
68309
  ),
68307
- children: pagination?.type === "thumbnails" ? images?.map((image, i) => /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
68310
+ children: type === "thumbnails" ? images?.map((image, i) => /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
68308
68311
  "button",
68309
68312
  {
68310
68313
  className: clsx(
@@ -68314,7 +68317,10 @@ var SlideshowPagination = ({
68314
68317
  active === i && "active",
68315
68318
  "slideshow-thumbnail-container"
68316
68319
  ),
68317
- onClick: () => setActive(i),
68320
+ onClick: () => {
68321
+ setActive(i);
68322
+ handleClick(i);
68323
+ },
68318
68324
  children: /* @__PURE__ */ (0, import_jsx_runtime351.jsx)(
68319
68325
  "img",
68320
68326
  {
@@ -68332,20 +68338,21 @@ var SlideshowPagination = ({
68332
68338
  {
68333
68339
  className: clsx(
68334
68340
  "",
68335
- pagination?.type === "dots-outline" ? outlineColor[pagination?.color ?? "primary"] : genBgColor2[pagination?.color ?? "primary"],
68341
+ type === "dots-outline" ? outlineColor[color ?? "primary"] : genBgColor2[color ?? "primary"],
68336
68342
  active === n && "active",
68337
- pagination?.type === "dots" && [
68343
+ type === "dots" && [
68338
68344
  "size-2 rounded-full block"
68339
68345
  ],
68340
- pagination?.type === "dots-outline" && [
68346
+ type === "dots-outline" && [
68341
68347
  "size-2 rounded-full border-1"
68342
68348
  ],
68343
- pagination?.type === "bars" && [
68344
- "grow h-1 rounded-full"
68345
- ],
68349
+ type === "bars" && ["grow h-1 rounded-full"],
68346
68350
  "slideshow-control"
68347
68351
  ),
68348
- onClick: () => setActive(n)
68352
+ onClick: () => {
68353
+ setActive(n);
68354
+ handleClick(n);
68355
+ }
68349
68356
  },
68350
68357
  n
68351
68358
  ))
@@ -68596,17 +68603,16 @@ var Slideshow = ({
68596
68603
  !hidePagination && totalSlides > 1 && /* @__PURE__ */ (0, import_jsx_runtime352.jsx)(
68597
68604
  SlideshowPagination,
68598
68605
  {
68606
+ className: pagination?.className,
68607
+ images: pagination?.images,
68599
68608
  active: currentSlide,
68600
68609
  setActive: setCurrentSlide,
68601
68610
  contentLength: totalSlides,
68602
68611
  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
68612
+ position: pagination?.position,
68613
+ hideOnTouch: pagination?.hideOnTouch,
68614
+ color: pagination?.color,
68615
+ type: pagination?.type
68610
68616
  }
68611
68617
  )
68612
68618
  ]