trepur_components 2.3.40 → 2.3.41

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,160 +1,151 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { createContext as I, forwardRef as h, useState as S, useMemo as K, useContext as b } from "react";
3
- import { Icon as j } from "../Icon/index.js";
4
- import { faChevronRight as L, faChevronLeft as O, faCircle as T } from "@fortawesome/fontawesome-free-solid";
5
- import m from "clsx";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { createContext as z, forwardRef as m, useState as g, useMemo as I, useContext as x } from "react";
3
+ import { Icon as w } from "../Icon/index.js";
4
+ import { faChevronRight as K, faChevronLeft as L, faCircle as T } from "@fortawesome/fontawesome-free-solid";
5
+ import u from "clsx";
6
6
  import "../../node_modules/keen-slider/keen-slider.min.css.js";
7
7
  import { useKeenSlider as $ } from "../../node_modules/keen-slider/react.js";
8
8
  import { WheelControls as M } from "./utils.js";
9
- const N = I(null), A = h(
9
+ const p = z(null), b = m(
10
10
  ({
11
- breakpoints: o,
11
+ breakpoints: r,
12
12
  children: t,
13
- className: s,
13
+ className: o,
14
14
  loop: e,
15
15
  perView: n,
16
- rubberband: r,
17
- spacing: c,
18
- ...i
19
- }, y) => {
20
- const [f, u] = S(1), [x, a] = S(!1), [C, p] = $(
16
+ rubberband: c,
17
+ spacing: l,
18
+ ...s
19
+ }, f) => {
20
+ const [d, i] = g(0), [C, D] = g(!1), [y, v] = $(
21
21
  {
22
- breakpoints: o,
22
+ breakpoints: r,
23
23
  loop: e,
24
- rubberband: r,
25
- slideChanged(d) {
26
- u(d.track.details.rel);
24
+ rubberband: c,
25
+ slideChanged(h) {
26
+ i(h.track.details.rel);
27
27
  },
28
28
  created() {
29
- a(!0);
29
+ D(!0);
30
30
  },
31
31
  slides: {
32
- spacing: c,
32
+ spacing: l,
33
33
  perView: n
34
34
  }
35
35
  },
36
36
  [M]
37
- ), g = K(
37
+ ), A = I(
38
38
  () => ({
39
- sliderRef: C,
40
- instanceRef: p,
41
- currentSlide: f,
42
- setCurrentSlide: u,
39
+ sliderRef: y,
40
+ instanceRef: v,
41
+ currentSlide: d,
42
+ setCurrentSlide: i,
43
43
  perView: n,
44
- ...i
44
+ ...s
45
45
  }),
46
46
  [
47
+ s,
48
+ y,
49
+ v.current,
50
+ d,
47
51
  i,
48
- C,
49
- p.current,
50
- f,
51
- u,
52
52
  n,
53
- x
53
+ C
54
54
  ]
55
- ), w = (d) => {
56
- var v;
57
- d.key === "Tab" && ((v = p.current) == null || v.next());
55
+ ), P = (h) => {
56
+ var N;
57
+ h.key === "Tab" && ((N = v.current) == null || N.next());
58
58
  };
59
- return /* @__PURE__ */ l(N.Provider, { value: g, children: /* @__PURE__ */ l(
59
+ return /* @__PURE__ */ a(p.Provider, { value: A, children: /* @__PURE__ */ a(
60
60
  "div",
61
61
  {
62
- onKeyDown: w,
63
- className: m("navigation-wrapper w-full", s),
64
- ref: y,
65
- ...i,
62
+ onKeyDown: P,
63
+ className: u("navigation-wrapper w-full", o),
64
+ ref: f,
65
+ ...s,
66
66
  children: t
67
67
  }
68
68
  ) });
69
69
  }
70
- ), D = h(({ children: o, className: t, ...s }, e) => /* @__PURE__ */ l(
70
+ ), k = m(({ children: r, className: t, ...o }, e) => /* @__PURE__ */ a(
71
71
  "div",
72
72
  {
73
73
  ref: e,
74
- className: m(
74
+ className: u(
75
75
  "navigation-wrapper flex w-full justify-between gap-4",
76
76
  t
77
77
  ),
78
- ...s,
79
- children: o
78
+ ...o,
79
+ children: r
80
80
  }
81
- )), P = h(({ className: o, children: t, ...s }) => {
82
- const { sliderRef: e } = b(N) || {};
83
- return /* @__PURE__ */ l(
81
+ )), S = m(({ className: r, children: t, ...o }) => {
82
+ const { sliderRef: e } = x(p) || {};
83
+ return /* @__PURE__ */ a(
84
84
  "div",
85
85
  {
86
86
  ref: e,
87
- className: m("keen-slider w-full pb-4", o),
88
- ...s,
87
+ className: u("keen-slider w-full pb-4", r),
88
+ ...o,
89
89
  children: t
90
90
  }
91
91
  );
92
- }), R = h(({ className: o, rightArrow: t = !1, ...s }, e) => {
93
- const { instanceRef: n } = b(N) || {};
94
- return /* @__PURE__ */ l(
92
+ }), R = m(({ className: r, rightArrow: t = !1, ...o }, e) => {
93
+ const { instanceRef: n } = x(p) || {};
94
+ return /* @__PURE__ */ a(
95
95
  "div",
96
96
  {
97
97
  ref: e,
98
- className: m(
98
+ className: u(
99
99
  "hidden md:block my-auto text-carousel-arrow-default hover:cursor-pointer hover:text-carousel-arrow-hover",
100
- o
100
+ r
101
101
  ),
102
- onClick: (r) => {
103
- var c, i;
104
- t ? r.stopPropagation() !== void 0 || ((c = n.current) == null || c.next()) : r.stopPropagation() !== void 0 || ((i = n.current) == null || i.prev());
102
+ onClick: (c) => {
103
+ var l, s;
104
+ t ? c.stopPropagation() !== void 0 || ((l = n.current) == null || l.next()) : c.stopPropagation() !== void 0 || ((s = n.current) == null || s.prev());
105
105
  },
106
- ...s,
107
- children: /* @__PURE__ */ l(j, { icon: t ? L : O, size: "3x" })
106
+ ...o,
107
+ children: /* @__PURE__ */ a(w, { icon: t ? K : L, size: "3x" })
108
108
  }
109
109
  );
110
- }), z = h(({ className: o, ...t }, s) => {
111
- var y, f, u, x;
112
- const {
113
- instanceRef: e,
114
- loop: n,
115
- currentSlide: r = 1,
116
- perView: c = 1
117
- } = b(N) || {}, i = (x = (u = (f = (y = e == null ? void 0 : e.current) == null ? void 0 : y.track) == null ? void 0 : f.details) == null ? void 0 : u.slides) == null ? void 0 : x.length;
118
- return /* @__PURE__ */ l("div", { className: m("flex justify-center gap-0.5 pt-2", o), children: [...Array(i).keys()].map((a) => {
119
- var g, w, d, v;
120
- const C = ((v = (d = (w = (g = e == null ? void 0 : e.current) == null ? void 0 : g.track) == null ? void 0 : w.details) == null ? void 0 : d.slides) == null ? void 0 : v.length) ?? 1, p = n ? r + c <= C ? a >= r && a < r + c : a >= r || r + c - C - 1 >= a : r === a;
121
- return /* @__PURE__ */ l(
122
- "button",
123
- {
124
- ref: s,
125
- type: "button",
126
- onClick: () => {
127
- var k;
128
- (k = e.current) == null || k.moveToIdx(a);
129
- },
130
- "aria-label": `carousel-button${t.id ? `-${t.id}` : ""}`,
131
- children: /* @__PURE__ */ l(
132
- j,
133
- {
134
- className: m(
135
- "hover:text-carousel-dots-hover",
136
- p ? "text-carousel-dots-active" : "text-carousel-dots-default"
137
- ),
138
- icon: T,
139
- size: "xl"
140
- }
141
- )
110
+ }), j = m(({ className: r, ...t }, o) => {
111
+ var l, s, f, d;
112
+ const { instanceRef: e, currentSlide: n } = x(p) || {}, c = (d = (f = (s = (l = e == null ? void 0 : e.current) == null ? void 0 : l.track) == null ? void 0 : s.details) == null ? void 0 : f.slides) == null ? void 0 : d.length;
113
+ return /* @__PURE__ */ a("div", { className: u("flex justify-center gap-0.5 pt-2", r), children: [...Array(c).keys()].map((i) => /* @__PURE__ */ a(
114
+ "button",
115
+ {
116
+ ref: o,
117
+ type: "button",
118
+ onClick: () => {
119
+ var C;
120
+ (C = e.current) == null || C.moveToIdx(i);
142
121
  },
143
- a
144
- );
145
- }) });
122
+ "aria-label": `carousel-button${t.id ? `-${t.id}` : ""}`,
123
+ children: /* @__PURE__ */ a(
124
+ w,
125
+ {
126
+ className: u(
127
+ "hover:text-carousel-dots-hover",
128
+ n === i ? "text-carousel-dots-active" : "text-carousel-dots-default"
129
+ ),
130
+ icon: T,
131
+ size: "xl"
132
+ }
133
+ )
134
+ },
135
+ i
136
+ )) });
146
137
  });
147
- A.displayName = "Carousel";
148
- D.displayName = "Carousel.Content";
138
+ b.displayName = "Carousel";
139
+ k.displayName = "Carousel.Content";
149
140
  R.displayName = "Carousel.Arrow";
150
- z.displayName = "Carousel.Dots";
151
- P.displayName = "Carousel.Slides";
152
- const Q = Object.assign(A, {
153
- Content: D,
141
+ j.displayName = "Carousel.Dots";
142
+ S.displayName = "Carousel.Slides";
143
+ const J = Object.assign(b, {
144
+ Content: k,
154
145
  Arrow: R,
155
- Dots: z,
156
- Slides: P
146
+ Dots: j,
147
+ Slides: S
157
148
  });
158
149
  export {
159
- Q as Carousel
150
+ J as Carousel
160
151
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trepur_components",
3
- "version": "2.3.40",
3
+ "version": "2.3.41",
4
4
  "description": "component lib",
5
5
  "author": "trepur_ttenneb",
6
6
  "private": false,