@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260903094942 → 0.8.1-dev.20260905065929

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.
@@ -1,7 +1,5 @@
1
1
  "use client";
2
2
 
3
- "use client";
4
-
5
3
  // src/components/Slider.tsx
6
4
  import React, { useState, useEffect, Children, cloneElement } from "react";
7
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -20,7 +18,8 @@ var Slider = ({
20
18
  dotInactiveClassName = "bg-gray-600",
21
19
  gap,
22
20
  pillStyle = "cumulative",
23
- progressPosition = "bottom"
21
+ progressPosition = "bottom",
22
+ scrollByColumns = false
24
23
  }) => {
25
24
  const [currentSlide, setCurrentSlide] = useState(0);
26
25
  const [transition, setTransition] = useState(true);
@@ -53,7 +52,8 @@ var Slider = ({
53
52
  return () => clearInterval(timer);
54
53
  }, [autoplay, autoplay_speed, currentSlide, isPlaying]);
55
54
  const totalSlides = Children.count(children);
56
- const maxSlide = totalSlides - slidesToShowState;
55
+ const maxSlide = Math.max(0, totalSlides - slidesToShowState);
56
+ const step = scrollByColumns ? typeof slidesToShowState === "number" && slidesToShowState > 0 ? Math.floor(slidesToShowState) : 1 : 1;
57
57
  const nextSlide = () => {
58
58
  if (currentSlide >= maxSlide) {
59
59
  if (infinite_scroll) {
@@ -62,7 +62,8 @@ var Slider = ({
62
62
  }
63
63
  } else {
64
64
  setTransition(true);
65
- setCurrentSlide(currentSlide + 1);
65
+ const nextIndex = currentSlide + step;
66
+ setCurrentSlide(nextIndex > maxSlide ? maxSlide : nextIndex);
66
67
  }
67
68
  };
68
69
  const prevSlide = () => {
@@ -73,7 +74,8 @@ var Slider = ({
73
74
  }
74
75
  } else {
75
76
  setTransition(true);
76
- setCurrentSlide(currentSlide - 1);
77
+ const prevIndex = currentSlide - step;
78
+ setCurrentSlide(prevIndex < 0 ? 0 : prevIndex);
77
79
  }
78
80
  };
79
81
  const goToSlide = (index) => {
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
 
3
+ "use client";
4
+
3
5
  // src/components/Slider.tsx
4
6
  import React, { useState, useEffect, Children, cloneElement } from "react";
5
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -18,7 +20,8 @@ var Slider = ({
18
20
  dotInactiveClassName = "bg-gray-600",
19
21
  gap,
20
22
  pillStyle = "cumulative",
21
- progressPosition = "bottom"
23
+ progressPosition = "bottom",
24
+ scrollByColumns = false
22
25
  }) => {
23
26
  const [currentSlide, setCurrentSlide] = useState(0);
24
27
  const [transition, setTransition] = useState(true);
@@ -51,7 +54,8 @@ var Slider = ({
51
54
  return () => clearInterval(timer);
52
55
  }, [autoplay, autoplay_speed, currentSlide, isPlaying]);
53
56
  const totalSlides = Children.count(children);
54
- const maxSlide = totalSlides - slidesToShowState;
57
+ const maxSlide = Math.max(0, totalSlides - slidesToShowState);
58
+ const step = scrollByColumns ? typeof slidesToShowState === "number" && slidesToShowState > 0 ? Math.floor(slidesToShowState) : 1 : 1;
55
59
  const nextSlide = () => {
56
60
  if (currentSlide >= maxSlide) {
57
61
  if (infinite_scroll) {
@@ -60,7 +64,8 @@ var Slider = ({
60
64
  }
61
65
  } else {
62
66
  setTransition(true);
63
- setCurrentSlide(currentSlide + 1);
67
+ const nextIndex = currentSlide + step;
68
+ setCurrentSlide(nextIndex > maxSlide ? maxSlide : nextIndex);
64
69
  }
65
70
  };
66
71
  const prevSlide = () => {
@@ -71,7 +76,8 @@ var Slider = ({
71
76
  }
72
77
  } else {
73
78
  setTransition(true);
74
- setCurrentSlide(currentSlide - 1);
79
+ const prevIndex = currentSlide - step;
80
+ setCurrentSlide(prevIndex < 0 ? 0 : prevIndex);
75
81
  }
76
82
  };
77
83
  const goToSlide = (index) => {
package/dist/index.js CHANGED
@@ -5856,7 +5856,8 @@ var init_Slider = __esm({
5856
5856
  dotInactiveClassName = "bg-gray-600",
5857
5857
  gap,
5858
5858
  pillStyle = "cumulative",
5859
- progressPosition = "bottom"
5859
+ progressPosition = "bottom",
5860
+ scrollByColumns = false
5860
5861
  }) => {
5861
5862
  const [currentSlide, setCurrentSlide] = (0, import_react60.useState)(0);
5862
5863
  const [transition, setTransition] = (0, import_react60.useState)(true);
@@ -5889,7 +5890,8 @@ var init_Slider = __esm({
5889
5890
  return () => clearInterval(timer);
5890
5891
  }, [autoplay, autoplay_speed, currentSlide, isPlaying]);
5891
5892
  const totalSlides = import_react60.Children.count(children);
5892
- const maxSlide = totalSlides - slidesToShowState;
5893
+ const maxSlide = Math.max(0, totalSlides - slidesToShowState);
5894
+ const step = scrollByColumns ? typeof slidesToShowState === "number" && slidesToShowState > 0 ? Math.floor(slidesToShowState) : 1 : 1;
5893
5895
  const nextSlide = () => {
5894
5896
  if (currentSlide >= maxSlide) {
5895
5897
  if (infinite_scroll) {
@@ -5898,7 +5900,8 @@ var init_Slider = __esm({
5898
5900
  }
5899
5901
  } else {
5900
5902
  setTransition(true);
5901
- setCurrentSlide(currentSlide + 1);
5903
+ const nextIndex = currentSlide + step;
5904
+ setCurrentSlide(nextIndex > maxSlide ? maxSlide : nextIndex);
5902
5905
  }
5903
5906
  };
5904
5907
  const prevSlide = () => {
@@ -5909,7 +5912,8 @@ var init_Slider = __esm({
5909
5912
  }
5910
5913
  } else {
5911
5914
  setTransition(true);
5912
- setCurrentSlide(currentSlide - 1);
5915
+ const prevIndex = currentSlide - step;
5916
+ setCurrentSlide(prevIndex < 0 ? 0 : prevIndex);
5913
5917
  }
5914
5918
  };
5915
5919
  const goToSlide = (index) => {
package/dist/index.mjs CHANGED
@@ -2349,7 +2349,7 @@ var Pagination = dynamic13(() => import("./Pagination-CQKMBXXJ.mjs"), { ssr: tru
2349
2349
  var DataBindingControls = dynamic13(() => import("./DataBindingControls-UUDERFAD.mjs"), {
2350
2350
  ssr: true
2351
2351
  });
2352
- var Slider = dynamic13(() => import("./Slider-554BKC7N.mjs"), {
2352
+ var Slider = dynamic13(() => import("./Slider-ZA2GRRGS.mjs"), {
2353
2353
  ssr: false
2354
2354
  });
2355
2355
  function toCamelCase(str) {
package/dist/server.js CHANGED
@@ -5854,7 +5854,8 @@ var init_Slider = __esm({
5854
5854
  dotInactiveClassName = "bg-gray-600",
5855
5855
  gap,
5856
5856
  pillStyle = "cumulative",
5857
- progressPosition = "bottom"
5857
+ progressPosition = "bottom",
5858
+ scrollByColumns = false
5858
5859
  }) => {
5859
5860
  const [currentSlide, setCurrentSlide] = (0, import_react60.useState)(0);
5860
5861
  const [transition, setTransition] = (0, import_react60.useState)(true);
@@ -5887,7 +5888,8 @@ var init_Slider = __esm({
5887
5888
  return () => clearInterval(timer);
5888
5889
  }, [autoplay, autoplay_speed, currentSlide, isPlaying]);
5889
5890
  const totalSlides = import_react60.Children.count(children);
5890
- const maxSlide = totalSlides - slidesToShowState;
5891
+ const maxSlide = Math.max(0, totalSlides - slidesToShowState);
5892
+ const step = scrollByColumns ? typeof slidesToShowState === "number" && slidesToShowState > 0 ? Math.floor(slidesToShowState) : 1 : 1;
5891
5893
  const nextSlide = () => {
5892
5894
  if (currentSlide >= maxSlide) {
5893
5895
  if (infinite_scroll) {
@@ -5896,7 +5898,8 @@ var init_Slider = __esm({
5896
5898
  }
5897
5899
  } else {
5898
5900
  setTransition(true);
5899
- setCurrentSlide(currentSlide + 1);
5901
+ const nextIndex = currentSlide + step;
5902
+ setCurrentSlide(nextIndex > maxSlide ? maxSlide : nextIndex);
5900
5903
  }
5901
5904
  };
5902
5905
  const prevSlide = () => {
@@ -5907,7 +5910,8 @@ var init_Slider = __esm({
5907
5910
  }
5908
5911
  } else {
5909
5912
  setTransition(true);
5910
- setCurrentSlide(currentSlide - 1);
5913
+ const prevIndex = currentSlide - step;
5914
+ setCurrentSlide(prevIndex < 0 ? 0 : prevIndex);
5911
5915
  }
5912
5916
  };
5913
5917
  const goToSlide = (index) => {
package/dist/server.mjs CHANGED
@@ -2317,7 +2317,7 @@ var Pagination = dynamic13(() => import("./Pagination-M3VZKKXY.mjs"), { ssr: tru
2317
2317
  var DataBindingControls = dynamic13(() => import("./DataBindingControls-WC3HBVVQ.mjs"), {
2318
2318
  ssr: true
2319
2319
  });
2320
- var Slider = dynamic13(() => import("./Slider-PEIVH6A5.mjs"), {
2320
+ var Slider = dynamic13(() => import("./Slider-6GJY6M4D.mjs"), {
2321
2321
  ssr: false
2322
2322
  });
2323
2323
  function toCamelCase(str) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clyrex-digital/clyrex-controls-dev",
3
- "version": "0.8.1-dev.20260903094942",
3
+ "version": "0.8.1-dev.20260905065929",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",