trepur_components 2.3.40 → 2.3.42

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.
@@ -4,9 +4,11 @@ import { StoryObj } from '@storybook/react';
4
4
  declare const meta: {
5
5
  title: string;
6
6
  component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLUListElement> & import('.').BreadcrumbsContextProps & import('react').RefAttributes<HTMLUListElement>> & {
7
- Item: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLLIElement> & import('react').RefAttributes<HTMLLIElement>>;
7
+ Item: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLLIElement> & {
8
+ children?: any;
9
+ } & import('react').RefAttributes<HTMLLIElement>>;
8
10
  Label: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLAnchorElement> & {
9
- href: string;
11
+ href?: string | undefined;
10
12
  } & import('react').RefAttributes<HTMLAnchorElement>>;
11
13
  };
12
14
  args: {
@@ -7,9 +7,11 @@ export interface BreadcrumbsItemContextProps {
7
7
  isLast?: boolean;
8
8
  }
9
9
  declare const Breadcrumbs: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & BreadcrumbsContextProps & import('react').RefAttributes<HTMLUListElement>> & {
10
- Item: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & import('react').RefAttributes<HTMLLIElement>>;
10
+ Item: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLLIElement> & {
11
+ children?: any;
12
+ } & import('react').RefAttributes<HTMLLIElement>>;
11
13
  Label: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLAnchorElement> & {
12
- href: string;
14
+ href?: string | undefined;
13
15
  } & import('react').RefAttributes<HTMLAnchorElement>>;
14
16
  };
15
17
  export { Breadcrumbs };
@@ -1,27 +1,28 @@
1
- import { jsx as s, jsxs as B } from "react/jsx-runtime";
2
- import { createContext as l, forwardRef as n, useMemo as m, useContext as d, Children as N } from "react";
3
- const u = l(null), i = l(null), p = n(({ children: e, ...r }, t) => {
4
- const a = m(
1
+ import { jsx as s, jsxs as L } from "react/jsx-runtime";
2
+ import { createContext as u, forwardRef as n, useMemo as d, useContext as i, Children as C } from "react";
3
+ const b = u(null), x = u(null), f = n(({ children: e, ...r }, t) => {
4
+ const a = d(
5
5
  () => ({
6
6
  allLinks: e
7
7
  }),
8
8
  [e]
9
9
  );
10
- return /* @__PURE__ */ s(u.Provider, { value: a, children: /* @__PURE__ */ s("ul", { ref: t, className: "flex gap-2", ...r, children: e }) });
11
- }), b = n(({ children: e, ...r }, t) => {
12
- const { allLinks: a } = d(u) || {}, c = 0 === N.toArray(a).length - 1, f = m(
10
+ return /* @__PURE__ */ s(b.Provider, { value: a, children: /* @__PURE__ */ s("ul", { ref: t, className: "flex gap-2", ...r, children: e }) });
11
+ }), B = n(({ children: e, ...r }, t) => {
12
+ var c, m, p;
13
+ const { allLinks: a } = i(b) || {}, o = C.toArray(a), l = ((c = e == null ? void 0 : e.props) == null ? void 0 : c.children) === ((p = (m = o[o.length - 1]) == null ? void 0 : m.props) == null ? void 0 : p.children.props.children), y = d(
13
14
  () => ({
14
- isLast: c
15
+ isLast: l
15
16
  }),
16
17
  [e]
17
18
  );
18
- return /* @__PURE__ */ s(i.Provider, { value: f, children: /* @__PURE__ */ B("li", { ref: t, className: "flex items-center gap-2", ...r, children: [
19
+ return /* @__PURE__ */ s(x.Provider, { value: y, children: /* @__PURE__ */ L("li", { ref: t, className: "flex items-center gap-2", ...r, children: [
19
20
  e,
20
- !c && /* @__PURE__ */ s("p", { children: "/" })
21
+ !l && /* @__PURE__ */ s("p", { children: "/" })
21
22
  ] }) });
22
- }), x = n(({ children: e, href: r, ...t }, a) => {
23
- const { isLast: o } = d(i) || {};
24
- return o ? /* @__PURE__ */ s("p", { className: "px-1 py-1 font-bold underline underline-offset-4", children: e }) : /* @__PURE__ */ s("p", { className: "px-1 py-1", children: /* @__PURE__ */ s(
23
+ }), N = n(({ children: e, href: r, ...t }, a) => {
24
+ const { isLast: o } = i(x) || {};
25
+ return o ? /* @__PURE__ */ s("p", { className: "px-1 py-1 font-bold underline underline-offset-4", children: e }) : r ? /* @__PURE__ */ s("p", { className: "px-1 py-1", children: /* @__PURE__ */ s(
25
26
  "a",
26
27
  {
27
28
  ref: a,
@@ -30,15 +31,15 @@ const u = l(null), i = l(null), p = n(({ children: e, ...r }, t) => {
30
31
  ...t,
31
32
  children: e
32
33
  }
33
- ) });
34
+ ) }) : /* @__PURE__ */ s("p", { className: "px-1 py-1", children: e });
34
35
  });
35
- p.displayName = "Breadcrumbs";
36
- b.displayName = "Breadcrumbs.Item";
37
- x.displayName = "Breadcrumbs.Label";
38
- const v = Object.assign(p, {
39
- Item: b,
40
- Label: x
36
+ f.displayName = "Breadcrumbs";
37
+ B.displayName = "Breadcrumbs.Item";
38
+ N.displayName = "Breadcrumbs.Label";
39
+ const I = Object.assign(f, {
40
+ Item: B,
41
+ Label: N
41
42
  });
42
43
  export {
43
- v as Breadcrumbs
44
+ I as Breadcrumbs
44
45
  };
@@ -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.42",
4
4
  "description": "component lib",
5
5
  "author": "trepur_ttenneb",
6
6
  "private": false,