@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.js CHANGED
@@ -68111,25 +68111,28 @@ import { generateNumbers as generateNumbers2 } from "@julseb-lib/utils";
68111
68111
  import { jsx as jsx350 } from "react/jsx-runtime";
68112
68112
  var SlideshowPagination = ({
68113
68113
  className,
68114
- pagination,
68115
68114
  images,
68116
68115
  active,
68117
68116
  setActive,
68118
- contentLength
68117
+ contentLength,
68118
+ handleClick,
68119
+ position = "outside",
68120
+ hideOnTouch,
68121
+ color = "primary",
68122
+ type = "dots"
68119
68123
  }) => {
68120
68124
  const isTouchScreen = useTouchScreen();
68121
- if (isTouchScreen && pagination?.hideOnTouch || contentLength === 0)
68122
- return null;
68125
+ if (isTouchScreen && hideOnTouch || contentLength === 0) return null;
68123
68126
  return /* @__PURE__ */ jsx350(
68124
68127
  "div",
68125
68128
  {
68126
68129
  className: clsx(
68127
68130
  "flex justify-center gap-2 mx-auto px-2 w-full max-w-[70%]",
68128
- pagination?.position === "outside" ? "" : "absolute bottom-1 left-[50%] -translate-x-[50%]",
68131
+ position === "outside" ? "" : "absolute bottom-1 left-[50%] -translate-x-[50%]",
68129
68132
  "slideshow-controls",
68130
68133
  className
68131
68134
  ),
68132
- children: pagination?.type === "thumbnails" ? images?.map((image, i) => /* @__PURE__ */ jsx350(
68135
+ children: type === "thumbnails" ? images?.map((image, i) => /* @__PURE__ */ jsx350(
68133
68136
  "button",
68134
68137
  {
68135
68138
  className: clsx(
@@ -68139,7 +68142,10 @@ var SlideshowPagination = ({
68139
68142
  active === i && "active",
68140
68143
  "slideshow-thumbnail-container"
68141
68144
  ),
68142
- onClick: () => setActive(i),
68145
+ onClick: () => {
68146
+ setActive(i);
68147
+ handleClick(i);
68148
+ },
68143
68149
  children: /* @__PURE__ */ jsx350(
68144
68150
  "img",
68145
68151
  {
@@ -68157,20 +68163,21 @@ var SlideshowPagination = ({
68157
68163
  {
68158
68164
  className: clsx(
68159
68165
  "",
68160
- pagination?.type === "dots-outline" ? outlineColor[pagination?.color ?? "primary"] : genBgColor2[pagination?.color ?? "primary"],
68166
+ type === "dots-outline" ? outlineColor[color ?? "primary"] : genBgColor2[color ?? "primary"],
68161
68167
  active === n && "active",
68162
- pagination?.type === "dots" && [
68168
+ type === "dots" && [
68163
68169
  "size-2 rounded-full block"
68164
68170
  ],
68165
- pagination?.type === "dots-outline" && [
68171
+ type === "dots-outline" && [
68166
68172
  "size-2 rounded-full border-1"
68167
68173
  ],
68168
- pagination?.type === "bars" && [
68169
- "grow h-1 rounded-full"
68170
- ],
68174
+ type === "bars" && ["grow h-1 rounded-full"],
68171
68175
  "slideshow-control"
68172
68176
  ),
68173
- onClick: () => setActive(n)
68177
+ onClick: () => {
68178
+ setActive(n);
68179
+ handleClick(n);
68180
+ }
68174
68181
  },
68175
68182
  n
68176
68183
  ))
@@ -68421,17 +68428,16 @@ var Slideshow = ({
68421
68428
  !hidePagination && totalSlides > 1 && /* @__PURE__ */ jsx351(
68422
68429
  SlideshowPagination,
68423
68430
  {
68431
+ className: pagination?.className,
68432
+ images: pagination?.images,
68424
68433
  active: currentSlide,
68425
68434
  setActive: setCurrentSlide,
68426
68435
  contentLength: totalSlides,
68427
68436
  handleClick: goToSlide,
68428
- pagination: {
68429
- type: pagination?.type ?? "dots",
68430
- hideOnTouch: pagination?.hideOnTouch ?? false,
68431
- position: pagination?.position ?? "outside",
68432
- color: pagination?.color ?? "primary"
68433
- },
68434
- images
68437
+ position: pagination?.position,
68438
+ hideOnTouch: pagination?.hideOnTouch,
68439
+ color: pagination?.color,
68440
+ type: pagination?.type
68435
68441
  }
68436
68442
  )
68437
68443
  ]