trepur_components 2.3.21 → 2.3.22

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,32 +1,27 @@
1
- import { jsx as s, jsxs as v } from "react/jsx-runtime";
2
- import { createContext as i, forwardRef as m, useMemo as b, useContext as x, Children as I } from "react";
3
- const f = i(null), B = i(null), N = m(({ children: e, ...r }, t) => {
4
- const a = b(
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(
5
5
  () => ({
6
6
  allLinks: e
7
7
  }),
8
8
  [e]
9
9
  );
10
- return /* @__PURE__ */ s(f.Provider, { value: a, children: /* @__PURE__ */ s("ul", { ref: t, className: "flex gap-2", ...r, children: e }) });
11
- }), L = m(({ children: e, ...r }, t) => {
12
- const { allLinks: a } = x(f) || {}, n = I.toArray(a), c = n.findIndex(
13
- (o) => {
14
- var l, u, p, d;
15
- return ((p = (u = (l = o == null ? void 0 : o.props) == null ? void 0 : l.children) == null ? void 0 : u.props) == null ? void 0 : p.children) === ((d = e == null ? void 0 : e.props) == null ? void 0 : d.children);
16
- }
17
- ) === n.length - 1, C = b(
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(
18
13
  () => ({
19
14
  isLast: c
20
15
  }),
21
16
  [e]
22
17
  );
23
- return /* @__PURE__ */ s(B.Provider, { value: C, children: /* @__PURE__ */ v("li", { ref: t, className: "flex items-center gap-2", ...r, children: [
18
+ return /* @__PURE__ */ s(i.Provider, { value: f, children: /* @__PURE__ */ B("li", { ref: t, className: "flex items-center gap-2", ...r, children: [
24
19
  e,
25
20
  !c && /* @__PURE__ */ s("p", { children: "/" })
26
21
  ] }) });
27
- }), y = m(({ children: e, href: r, ...t }, a) => {
28
- const { isLast: n } = x(B) || {};
29
- return n ? /* @__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(
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(
30
25
  "a",
31
26
  {
32
27
  ref: a,
@@ -37,13 +32,13 @@ const f = i(null), B = i(null), N = m(({ children: e, ...r }, t) => {
37
32
  }
38
33
  ) });
39
34
  });
40
- N.displayName = "Breadcrumbs";
41
- L.displayName = "Breadcrumbs.Item";
42
- y.displayName = "Breadcrumbs.Label";
43
- const P = Object.assign(N, {
44
- Item: L,
45
- Label: y
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
46
41
  });
47
42
  export {
48
- P as Breadcrumbs
43
+ v as Breadcrumbs
49
44
  };
@@ -1,95 +1,115 @@
1
- import { jsx as e, jsxs as n, Fragment as y } from "react/jsx-runtime";
2
- import { createContext as H, forwardRef as r, useState as c, useMemo as C, useContext as m, useRef as k } from "react";
1
+ import { jsx as a, jsxs as i, Fragment as y } from "react/jsx-runtime";
2
+ import { createContext as H, forwardRef as r, useState as m, useMemo as C, useContext as p, useRef as k } from "react";
3
3
  import { HamburgerIcon as w } from "../HamburgerIcon/index.js";
4
4
  import { faChevronDown as M } from "@fortawesome/fontawesome-free-solid";
5
- import l from "clsx";
5
+ import n from "clsx";
6
6
  import { Icon as j } from "../Icon/index.js";
7
- const i = H(null), p = r(({ children: a }, s) => {
8
- const [t, o] = c(!1), d = C(
7
+ const c = H(null), v = r(({ className: s, children: t }, e) => {
8
+ const [o, d] = m(!1), l = C(
9
9
  () => ({
10
- expanded: t,
11
- setExpanded: o
10
+ expanded: o,
11
+ setExpanded: d
12
12
  }),
13
- [t, o]
13
+ [o, d]
14
14
  );
15
- return /* @__PURE__ */ e(i.Provider, { value: d, children: /* @__PURE__ */ e("div", { children: a }) });
16
- }), v = r(
17
- ({ children: a }, s) => /* @__PURE__ */ e(
15
+ return /* @__PURE__ */ a(c.Provider, { value: l, children: /* @__PURE__ */ a("div", { className: s, ref: e, children: t }) });
16
+ }), N = r(
17
+ ({ className: s, children: t }, e) => /* @__PURE__ */ a(
18
18
  "div",
19
19
  {
20
- ref: s,
21
- className: l("relative h-24 w-full bg-nav-bg px-2 py-2"),
22
- children: a
20
+ ref: e,
21
+ className: n("relative h-24 w-full bg-nav-bg px-2 py-2", s),
22
+ children: t
23
23
  }
24
24
  )
25
- ), N = r(({ children: a }, s) => {
26
- const { setExpanded: t, expanded: o } = m(i) || {};
27
- return /* @__PURE__ */ n("div", { ref: s, className: "flex h-full md:hidden", children: [
28
- /* @__PURE__ */ e("div", { className: "my-auto", children: /* @__PURE__ */ e(
25
+ ), g = r(({ className: s, children: t }, e) => {
26
+ const { setExpanded: o, expanded: d } = p(c) || {};
27
+ return /* @__PURE__ */ i("div", { ref: e, className: n("flex h-full md:hidden", s), children: [
28
+ /* @__PURE__ */ a("div", { className: "my-auto", children: /* @__PURE__ */ a(
29
29
  w,
30
30
  {
31
31
  variant: "ghost",
32
- onClick: () => t == null ? void 0 : t(!o),
32
+ onClick: () => o == null ? void 0 : o(!d),
33
33
  className: "aspect-square"
34
34
  }
35
35
  ) }),
36
- /* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: a })
36
+ /* @__PURE__ */ a("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: t })
37
37
  ] });
38
- }), g = r(({ children: a }, s) => /* @__PURE__ */ e(
38
+ }), f = r(({ className: s, children: t }, e) => /* @__PURE__ */ a(
39
39
  "div",
40
40
  {
41
- ref: s,
42
- className: "hidden justify-between md:flex md:gap-4 md:px-4 lg:gap-8 lg:px-20",
43
- children: a
41
+ ref: e,
42
+ className: n(
43
+ "hidden justify-between md:flex md:gap-4 md:px-4 lg:gap-8 lg:px-20",
44
+ s
45
+ ),
46
+ children: t
44
47
  }
45
- )), f = r(
46
- ({ children: a }, s) => {
47
- const { expanded: t } = m(i) || {};
48
- return t ? /* @__PURE__ */ e("div", { className: "h-screen bg-nav-bg px-8 pb-12 pt-2 md:hidden", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 md:hidden", children: a }) }) : /* @__PURE__ */ e(y, {});
48
+ )), u = r(
49
+ ({ className: s, children: t }, e) => {
50
+ const { expanded: o } = p(c) || {};
51
+ return o ? /* @__PURE__ */ a(
52
+ "div",
53
+ {
54
+ ref: e,
55
+ className: n(
56
+ "h-screen bg-nav-bg px-8 pb-12 pt-2 md:hidden",
57
+ s
58
+ ),
59
+ children: /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-4 md:hidden", children: t })
60
+ }
61
+ ) : /* @__PURE__ */ a(y, {});
49
62
  }
50
- ), u = r(
51
- ({ children: a }, s) => /* @__PURE__ */ e("div", { ref: s, className: "my-4 md:flex md:gap-4 lg:gap-8", children: a })
52
- ), x = r(({ label: a, children: s, active: t = !1 }) => {
53
- const [o, d] = c(!1), b = k(null);
54
- return /* @__PURE__ */ n(
63
+ ), x = r(
64
+ ({ className: s, children: t }, e) => /* @__PURE__ */ a(
65
+ "div",
66
+ {
67
+ ref: e,
68
+ className: n("my-4 md:flex md:gap-4 lg:gap-8", s),
69
+ children: t
70
+ }
71
+ )
72
+ ), h = r(({ label: s, children: t, active: e = !1 }) => {
73
+ const [o, d] = m(!1), l = k(null);
74
+ return /* @__PURE__ */ i(
55
75
  "div",
56
76
  {
57
- ref: b,
77
+ ref: l,
58
78
  onClick: () => d(!0),
59
79
  onMouseLeave: () => d(!1),
60
- className: l(
80
+ className: n(
61
81
  "relative m-auto text-xl tracking-wider text-nav-text hover:cursor-pointer",
62
82
  {
63
- "font-bold": t,
64
- "font-normal": !t
83
+ "font-bold": e,
84
+ "font-normal": !e
65
85
  }
66
86
  ),
67
87
  children: [
68
- /* @__PURE__ */ n("div", { className: "flex items-center gap-px ", children: [
69
- /* @__PURE__ */ e("p", { children: a }),
70
- /* @__PURE__ */ e(j, { icon: M })
88
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-px ", children: [
89
+ /* @__PURE__ */ a("p", { children: s }),
90
+ /* @__PURE__ */ a(j, { icon: M })
71
91
  ] }),
72
- o && /* @__PURE__ */ e("div", { className: "absolute -left-5 top-7 z-50 w-40 bg-nav-bg", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-y-2 bg-nav-bg px-4 py-4", children: s }) })
92
+ o && /* @__PURE__ */ a("div", { className: "absolute -left-5 top-7 z-50 w-40 bg-nav-bg", children: /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-y-2 bg-nav-bg px-4 py-4", children: t }) })
73
93
  ]
74
94
  }
75
95
  );
76
- }), h = r(({ className: a, src: s, ...t }, o) => /* @__PURE__ */ e("img", { className: l("h-20", a), ref: o, src: s, ...t }));
77
- p.displayName = "Nav";
78
- v.displayName = "Nav.Header";
79
- g.displayName = "Nav.DesktopHeader";
80
- N.displayName = "Nav.MobileHeader";
81
- h.displayName = "Nav.Logo";
82
- u.displayName = "Nav.Section";
83
- f.displayName = "Nav.Body";
84
- x.displayName = "Nav.Folder";
85
- const R = Object.assign(p, {
86
- Header: v,
87
- DesktopHeader: g,
88
- MobileHeader: N,
89
- Section: u,
90
- Logo: h,
91
- Body: f,
92
- Folder: x
96
+ }), b = r(({ className: s, src: t, ...e }, o) => /* @__PURE__ */ a("img", { className: n("h-20", s), ref: o, src: t, ...e }));
97
+ v.displayName = "Nav";
98
+ N.displayName = "Nav.Header";
99
+ f.displayName = "Nav.DesktopHeader";
100
+ g.displayName = "Nav.MobileHeader";
101
+ b.displayName = "Nav.Logo";
102
+ x.displayName = "Nav.Section";
103
+ u.displayName = "Nav.Body";
104
+ h.displayName = "Nav.Folder";
105
+ const R = Object.assign(v, {
106
+ Header: N,
107
+ DesktopHeader: f,
108
+ MobileHeader: g,
109
+ Section: x,
110
+ Logo: b,
111
+ Body: u,
112
+ Folder: h
93
113
  });
94
114
  export {
95
115
  R as Nav
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trepur_components",
3
- "version": "2.3.21",
3
+ "version": "2.3.22",
4
4
  "description": "component lib",
5
5
  "author": "trepur_ttenneb",
6
6
  "private": false,