trepur_components 2.3.46 → 2.3.48

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,12 +1,12 @@
1
- import { jsx as e, jsxs as p, Fragment as H } from "react/jsx-runtime";
2
- import { createContext as w, forwardRef as d, useState as v, useMemo as C, useContext as c, useRef as k } from "react";
3
- import { HamburgerIcon as M } from "../HamburgerIcon/index.js";
4
- import { faChevronDown as j } from "@fortawesome/fontawesome-free-solid";
1
+ import { jsx as e, jsxs as p, Fragment as w } from "react/jsx-runtime";
2
+ import { createContext as C, forwardRef as d, useState as v, useMemo as k, useContext as m, useRef as M } from "react";
3
+ import { HamburgerIcon as j } from "../HamburgerIcon/index.js";
4
+ import { faChevronDown as D } from "@fortawesome/fontawesome-free-solid";
5
5
  import n from "clsx";
6
- import { Icon as D } from "../Icon/index.js";
7
- import { NavItem as F } from "../NavItem/index.js";
8
- const i = w(null), g = d(({ className: t, children: r, loading: a }, o) => {
9
- const [s, l] = v(!1), m = C(
6
+ import { Icon as F } from "../Icon/index.js";
7
+ import { NavItem as L } from "../NavItem/index.js";
8
+ const c = C(null), g = d(({ className: r, children: t, loading: a }, o) => {
9
+ const [s, l] = v(!1), i = k(
10
10
  () => ({
11
11
  expanded: s,
12
12
  setExpanded: l,
@@ -14,115 +14,115 @@ const i = w(null), g = d(({ className: t, children: r, loading: a }, o) => {
14
14
  }),
15
15
  [s, l, a]
16
16
  );
17
- return /* @__PURE__ */ e(i.Provider, { value: m, children: /* @__PURE__ */ e("div", { className: t, ref: o, children: r }) });
18
- }), N = d(
19
- ({ className: t, children: r }, a) => /* @__PURE__ */ e(
17
+ return /* @__PURE__ */ e(c.Provider, { value: i, children: /* @__PURE__ */ e("div", { className: r, ref: o, children: t }) });
18
+ }), f = d(
19
+ ({ className: r, children: t }, a) => /* @__PURE__ */ e(
20
20
  "div",
21
21
  {
22
22
  ref: a,
23
- className: n("relative h-24 w-full bg-nav-bg px-2 py-2", t),
24
- children: r
23
+ className: n("relative h-24 w-full bg-nav-bg px-2 py-2", r),
24
+ children: t
25
25
  }
26
26
  )
27
- ), f = d(({ className: t, children: r }, a) => {
28
- const { loading: o, setExpanded: s, expanded: l } = c(i) || {};
29
- return /* @__PURE__ */ p("div", { ref: a, className: n("flex h-full lg:hidden", t), children: [
27
+ ), N = d(({ className: r, children: t }, a) => {
28
+ const { loading: o, setExpanded: s, expanded: l } = m(c) || {};
29
+ return /* @__PURE__ */ p("div", { ref: a, className: n("flex h-full lg:hidden", r), children: [
30
30
  !o && /* @__PURE__ */ e("div", { className: "my-auto", children: /* @__PURE__ */ e(
31
- M,
31
+ j,
32
32
  {
33
33
  variant: "ghost",
34
34
  onClick: () => s == null ? void 0 : s(!l),
35
35
  className: "aspect-square"
36
36
  }
37
37
  ) }),
38
- /* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: r })
38
+ /* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: t })
39
39
  ] });
40
- }), u = d(({ className: t, children: r }, a) => /* @__PURE__ */ e(
40
+ }), u = d(({ className: r, children: t }, a) => /* @__PURE__ */ e(
41
41
  "div",
42
42
  {
43
43
  ref: a,
44
44
  className: n(
45
45
  "hidden justify-between lg:flex gap-4 px-4 lg:gap-8 lg:px-20",
46
- t
46
+ r
47
47
  ),
48
- children: r
48
+ children: t
49
49
  }
50
50
  )), x = d(
51
- ({ className: t, children: r }, a) => {
52
- const { expanded: o } = c(i) || {};
51
+ ({ className: r, children: t }, a) => {
52
+ const { expanded: o } = m(c) || {};
53
53
  return o ? /* @__PURE__ */ e(
54
54
  "div",
55
55
  {
56
56
  ref: a,
57
57
  className: n(
58
58
  "h-screen bg-nav-bg px-8 pb-12 pt-2 lg:hidden",
59
- t
59
+ r
60
60
  ),
61
- children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 lg:hidden", children: r })
61
+ children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 lg:hidden", children: t })
62
62
  }
63
- ) : /* @__PURE__ */ e(H, {});
63
+ ) : /* @__PURE__ */ e(w, {});
64
64
  }
65
65
  ), h = d(
66
- ({ className: t, children: r }, a) => {
67
- const { loading: o } = c(i) || {};
68
- return o ? /* @__PURE__ */ e("div", { ref: a, className: n("my-4 lg:flex lg:gap-6", t), children: [...Array(5)].map((s, l) => /* @__PURE__ */ e(F, { loading: !0 }, l)) }) : /* @__PURE__ */ e("div", { ref: a, className: n("my-4 lg:flex lg:gap-6", t), children: r });
66
+ ({ className: r, children: t }, a) => {
67
+ const { loading: o } = m(c) || {};
68
+ return o ? /* @__PURE__ */ e("div", { ref: a, className: n("my-4 lg:flex lg:gap-6", r), children: [...Array(5)].map((s, l) => /* @__PURE__ */ e(L, { loading: !0 }, l)) }) : /* @__PURE__ */ e("div", { ref: a, className: n("my-4 lg:flex lg:gap-6", r), children: t });
69
69
  }
70
- ), b = d(({ className: t, label: r, children: a, active: o = !1 }) => {
71
- const [s, l] = v(!1), m = k(null);
70
+ ), b = d(({ className: r, label: t, children: a, active: o = !1 }, s) => {
71
+ const [l, i] = v(!1), H = M(null);
72
72
  return /* @__PURE__ */ p(
73
73
  "div",
74
74
  {
75
- ref: m,
76
- onMouseEnter: () => l(!0),
77
- onMouseLeave: () => l(!1),
78
- onClick: () => l(!s),
75
+ ref: H ?? s,
76
+ onMouseEnter: () => i(!0),
77
+ onMouseLeave: () => i(!1),
78
+ onClick: () => i(!l),
79
79
  className: n(
80
80
  "relative m-auto py-0 text-nav-text lg:after:block after:scale-x-0 after:border-b-2 after:border-nav-text after:transition-all after:duration-300 after:ease-in-out hover:cursor-pointer hover:after:scale-x-100",
81
81
  {
82
82
  "font-bold": o,
83
83
  "font-light": !o
84
84
  },
85
- t
85
+ r
86
86
  ),
87
87
  children: [
88
88
  /* @__PURE__ */ p("div", { className: "flex justify-center items-center gap-1", children: [
89
- /* @__PURE__ */ e("p", { className: "text-lg", children: r }),
90
- /* @__PURE__ */ e(D, { size: "xs", icon: j })
89
+ /* @__PURE__ */ e("p", { className: "text-lg", children: t }),
90
+ /* @__PURE__ */ e(F, { size: "xs", icon: D })
91
91
  ] }),
92
- s && /* @__PURE__ */ e("div", { className: "rounded-md lg:absolute lg:-left-5 top-7 z-50 w-40 bg-nav-bg", children: /* @__PURE__ */ e("div", { className: "rounded-md grid grid-cols-1 gap-y-2 bg-nav-bg px-1 py-2 w-full", children: a }) })
92
+ l && /* @__PURE__ */ e("div", { className: "rounded-md lg:absolute lg:-left-5 top-7 z-50 w-40 bg-nav-bg", children: /* @__PURE__ */ e("div", { className: "rounded-md grid grid-cols-1 gap-y-2 bg-nav-bg px-1 py-2 w-full", children: a }) })
93
93
  ]
94
94
  }
95
95
  );
96
- }), y = d(({ className: t, src: r, alt: a, ...o }, s) => {
97
- const { loading: l } = c(i) || {};
96
+ }), y = d(({ className: r, src: t, alt: a, ...o }, s) => {
97
+ const { loading: l } = m(c) || {};
98
98
  return l ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className: "h-20 w-20 animate-pulse bg-gray-300" }) }) : /* @__PURE__ */ e(
99
99
  "img",
100
100
  {
101
- className: n("h-20 flex-none", t),
101
+ className: n("h-20 flex-none", r),
102
102
  ref: s,
103
- src: r,
103
+ src: t,
104
104
  alt: a,
105
105
  ...o
106
106
  }
107
107
  );
108
108
  });
109
109
  g.displayName = "Nav";
110
- N.displayName = "Nav.Header";
110
+ f.displayName = "Nav.Header";
111
111
  u.displayName = "Nav.DesktopHeader";
112
- f.displayName = "Nav.MobileHeader";
112
+ N.displayName = "Nav.MobileHeader";
113
113
  y.displayName = "Nav.Logo";
114
114
  h.displayName = "Nav.Section";
115
115
  x.displayName = "Nav.Body";
116
116
  b.displayName = "Nav.Folder";
117
- const q = Object.assign(g, {
118
- Header: N,
117
+ const A = Object.assign(g, {
118
+ Header: f,
119
119
  DesktopHeader: u,
120
- MobileHeader: f,
120
+ MobileHeader: N,
121
121
  Section: h,
122
122
  Logo: y,
123
123
  Body: x,
124
124
  Folder: b
125
125
  });
126
126
  export {
127
- q as Nav
127
+ A as Nav
128
128
  };
@@ -1,11 +1,11 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { forwardRef as r } from "react";
3
3
  import s from "clsx";
4
- import { Icon as a } from "../Icon/index.js";
5
- const i = r(({ children: o, variant: e = "info", inverse: l = !1 }, f) => /* @__PURE__ */ t(
4
+ import { Icon as c } from "../Icon/index.js";
5
+ const i = r(({ children: o, variant: e = "info", inverse: l = !1 }, a) => /* @__PURE__ */ t(
6
6
  "div",
7
7
  {
8
- ref: f,
8
+ ref: a,
9
9
  className: s(
10
10
  "inline-grid grid-flow-col w-auto py-2 px-4 text-base font-semibold rounded-full gap-2",
11
11
  {
@@ -21,12 +21,12 @@ const i = r(({ children: o, variant: e = "info", inverse: l = !1 }, f) => /* @__
21
21
  ),
22
22
  children: o
23
23
  }
24
- )), g = r(({ className: o, ...e }, l) => /* @__PURE__ */ t("p", { className: s("text-base my-auto", o), ref: l, ...e })), d = r(({ icon: o }, e) => /* @__PURE__ */ t(a, { className: "my-auto", size: "md", ref: e, icon: o }));
24
+ )), g = r(({ className: o, ...e }, l) => /* @__PURE__ */ t("p", { className: s("text-base my-auto", o), ref: l, ...e })), f = r(({ icon: o }, e) => /* @__PURE__ */ t(c, { className: "my-auto", size: "sm", ref: e, icon: o }));
25
25
  i.displayName = "Pill";
26
- d.displayName = "Pill.Icon";
26
+ f.displayName = "Pill.Icon";
27
27
  g.displayName = "Chip.Label";
28
28
  const m = Object.assign(i, {
29
- Icon: d,
29
+ Icon: f,
30
30
  Label: g
31
31
  });
32
32
  export {
@@ -1,30 +1,30 @@
1
1
  import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
2
  import { forwardRef as t } from "react";
3
- import l from "clsx";
4
- const o = t(({ id: e, className: m, children: i }, d) => /* @__PURE__ */ n("div", { ref: d, id: e, className: m, children: i })), r = t(
3
+ import o from "clsx";
4
+ const r = t(({ id: e, className: m, children: i }, l) => /* @__PURE__ */ n("div", { ref: l, id: e, className: m, children: i })), s = t(
5
5
  ({ id: e, children: m }, i) => /* @__PURE__ */ n("div", { ref: i, id: e, className: "flex", children: m })
6
- ), s = t(({ className: e, index: m, length: i }) => /* @__PURE__ */ c("div", { className: "hidden sm:block", children: [
6
+ ), a = t(({ className: e, index: m, length: i }, l) => /* @__PURE__ */ c("div", { ref: l, className: "hidden sm:block", children: [
7
7
  /* @__PURE__ */ n(
8
8
  "p",
9
9
  {
10
- className: l("z-10 m-auto mt-12 h-4 w-4 rounded-full", e)
10
+ className: o("z-10 m-auto mt-12 h-4 w-4 rounded-full", e)
11
11
  }
12
12
  ),
13
13
  /* @__PURE__ */ n(
14
14
  "div",
15
15
  {
16
- className: m !== i - 1 ? l("m-auto h-full w-1", e) : "border-r-2 border-transparent"
16
+ className: m !== i - 1 ? o("m-auto h-full w-1", e) : "border-r-2 border-transparent"
17
17
  }
18
18
  )
19
- ] })), a = t(({ children: e }) => /* @__PURE__ */ n("div", { className: "my-2 w-full sm:ml-8", children: e }));
20
- o.displayName = "Timeline";
21
- r.displayName = "Timeline.Item";
22
- s.displayName = "Timeline.Dot";
23
- a.displayName = "Timeline.Content";
24
- const T = Object.assign(o, {
25
- Item: r,
26
- Dot: s,
27
- Content: a
19
+ ] })), d = t(({ children: e }, m) => /* @__PURE__ */ n("div", { ref: m, className: "my-2 w-full sm:ml-8", children: e }));
20
+ r.displayName = "Timeline";
21
+ s.displayName = "Timeline.Item";
22
+ a.displayName = "Timeline.Dot";
23
+ d.displayName = "Timeline.Content";
24
+ const T = Object.assign(r, {
25
+ Item: s,
26
+ Dot: a,
27
+ Content: d
28
28
  });
29
29
  export {
30
30
  T as Timeline
@@ -1,86 +1,83 @@
1
- import { jsx as l, jsxs as T } from "react/jsx-runtime";
2
- import { createContext as f, forwardRef as a, useState as x, useMemo as v, useContext as i, Children as k } from "react";
3
- import r from "clsx";
4
- import { Button as b } from "../Button/index.js";
5
- const p = f(null), N = f(
1
+ import { jsx as r, jsxs as T } from "react/jsx-runtime";
2
+ import { createContext as f, forwardRef as a, useState as v, Children as z, useMemo as N, useContext as i } from "react";
3
+ import l from "clsx";
4
+ import { Button as d } from "../Button/index.js";
5
+ const p = f(null), h = f(
6
6
  null
7
- ), h = a(({ className: n, children: t, activeStop: s = 1 }, e) => {
8
- const [o, u] = x(s), [c, m] = x(0), d = v(
7
+ ), y = a(({ className: n, children: t, activeStop: e = 1 }, s) => {
8
+ var b, x;
9
+ const [o, u] = v(e), c = (x = (b = z.toArray(t)[0]) == null ? void 0 : b.props) == null ? void 0 : x.children.length, m = N(
9
10
  () => ({
10
- totalStops: c ?? 0,
11
- setTotalStops: m,
11
+ totalStops: c,
12
12
  currentStop: o,
13
13
  setCurrentStop: u
14
14
  }),
15
- [o, u, c, m]
15
+ [o, u]
16
16
  );
17
- return /* @__PURE__ */ l(p.Provider, { value: d, children: /* @__PURE__ */ l("div", { ref: e, className: n, children: t }) });
18
- }), y = a(({ className: n, children: t }, s) => {
19
- const { setTotalStops: e } = i(p) || {}, o = k.count(t);
20
- return e == null || e(o), /* @__PURE__ */ l("div", { ref: s, className: r("flex py-4", n), children: t });
21
- }), C = a(({ className: n, children: t }, s) => /* @__PURE__ */ l("div", { ref: s, className: r("", n), children: t })), S = a(({ className: n, stopId: t, children: s }, e) => {
17
+ return /* @__PURE__ */ r(p.Provider, { value: m, children: /* @__PURE__ */ r("div", { ref: s, className: n, children: t }) });
18
+ }), C = a(({ className: n, children: t }, e) => /* @__PURE__ */ r("div", { ref: e, className: l("flex py-4", n), children: t })), S = a(({ className: n, children: t }, e) => /* @__PURE__ */ r("div", { ref: e, className: l("", n), children: t })), g = a(({ className: n, stopId: t, children: e }, s) => {
22
19
  const { currentStop: o = 0 } = i(p) || {};
23
- return /* @__PURE__ */ l(
20
+ return /* @__PURE__ */ r(
24
21
  "div",
25
22
  {
26
- ref: e,
27
- className: r("", n, {
23
+ ref: s,
24
+ className: l("", n, {
28
25
  block: o === t,
29
26
  hidden: o !== t
30
27
  }),
31
- children: s
28
+ children: e
32
29
  }
33
30
  );
34
31
  }), w = a(({ className: n }, t) => {
35
32
  const {
36
- setCurrentStop: s,
37
- currentStop: e = 0,
33
+ setCurrentStop: e,
34
+ currentStop: s = 0,
38
35
  totalStops: o = 0
39
36
  } = i(p) || {};
40
- return /* @__PURE__ */ T("div", { ref: t, className: r("flex justify-between", n), children: [
41
- /* @__PURE__ */ l(
42
- b,
37
+ return /* @__PURE__ */ T("div", { ref: t, className: l("flex justify-between", n), children: [
38
+ /* @__PURE__ */ r(
39
+ d,
43
40
  {
44
- disabled: e === 1,
45
- onClick: () => e > 1 && (s == null ? void 0 : s(e - 1)),
46
- children: /* @__PURE__ */ l(b.Label, { children: "Previous" })
41
+ disabled: s === 1,
42
+ onClick: () => s > 1 && (e == null ? void 0 : e(s - 1)),
43
+ children: /* @__PURE__ */ r(d.Label, { children: "Previous" })
47
44
  }
48
45
  ),
49
- /* @__PURE__ */ l(
50
- b,
46
+ /* @__PURE__ */ r(
47
+ d,
51
48
  {
52
- disabled: e === o,
53
- onClick: () => e < o && (s == null ? void 0 : s(e + 1)),
54
- children: /* @__PURE__ */ l(b.Label, { children: "Next" })
49
+ disabled: s === o,
50
+ onClick: () => s < o && (e == null ? void 0 : e(s + 1)),
51
+ children: /* @__PURE__ */ r(d.Label, { children: "Next" })
55
52
  }
56
53
  )
57
54
  ] });
58
- }), g = a(({ className: n, stopId: t = 0, children: s }, e) => {
55
+ }), j = a(({ className: n, stopId: t = 0, children: e }, s) => {
59
56
  const {
60
57
  currentStop: o = 0,
61
58
  setCurrentStop: u,
62
59
  totalStops: c = 0
63
- } = i(p) || {}, [m] = x(t), d = v(
60
+ } = i(p) || {}, [m] = v(t), b = N(
64
61
  () => ({
65
62
  stopNumber: m
66
63
  }),
67
64
  [m]
68
65
  );
69
- return /* @__PURE__ */ l(N.Provider, { value: d, children: /* @__PURE__ */ T("div", { ref: e, className: r(n, "w-full min-w-[120px]"), children: [
70
- /* @__PURE__ */ l(
66
+ return /* @__PURE__ */ r(h.Provider, { value: b, children: /* @__PURE__ */ T("div", { ref: s, className: l(n, "w-full min-w-[120px]"), children: [
67
+ /* @__PURE__ */ r(
71
68
  "div",
72
69
  {
73
- className: r({
70
+ className: l({
74
71
  "mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-future": t >= o && t < c,
75
72
  "mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-complete": t < o && t < c
76
73
  })
77
74
  }
78
75
  ),
79
- /* @__PURE__ */ l(
76
+ /* @__PURE__ */ r(
80
77
  "p",
81
78
  {
82
79
  onClick: () => u == null ? void 0 : u(t),
83
- className: r(
80
+ className: l(
84
81
  "hover:cursor-pointer z-10 mx-auto h-6 w-6 rounded-full",
85
82
  {
86
83
  "relative z-20 -mt-4 bg-tubestop-station-complete": t < o,
@@ -91,20 +88,20 @@ const p = f(null), N = f(
91
88
  )
92
89
  }
93
90
  ),
94
- s
91
+ e
95
92
  ] }) });
96
- }), j = a(({ className: n, children: t }, s) => {
97
- const { currentStop: e = 0 } = i(p) || {}, { stopNumber: o = 0 } = i(N) || {};
98
- return /* @__PURE__ */ l(
93
+ }), k = a(({ className: n, children: t }, e) => {
94
+ const { currentStop: s = 0 } = i(p) || {}, { stopNumber: o = 0 } = i(h) || {};
95
+ return /* @__PURE__ */ r(
99
96
  "p",
100
97
  {
101
- ref: s,
102
- className: r(
98
+ ref: e,
99
+ className: l(
103
100
  "mt-2 text-center",
104
101
  {
105
- "font-medium text-tubestop-text-complete": o < e,
106
- "font-bold text-tubestop-text-active": e === o,
107
- "font-medium text-tubestop-text-future": o > e
102
+ "font-medium text-tubestop-text-complete": o < s,
103
+ "font-bold text-tubestop-text-active": s === o,
104
+ "font-medium text-tubestop-text-future": o > s
108
105
  },
109
106
  n
110
107
  ),
@@ -112,21 +109,21 @@ const p = f(null), N = f(
112
109
  }
113
110
  );
114
111
  });
115
- h.displayName = "Tubestop";
116
- y.displayName = "Tubestops.Header";
117
- g.displayName = "Tubestops.Stop";
118
- j.displayName = "Tubestops.Text";
112
+ y.displayName = "Tubestop";
113
+ C.displayName = "Tubestops.Header";
114
+ j.displayName = "Tubestops.Stop";
115
+ k.displayName = "Tubestops.Text";
119
116
  w.displayName = "Tubestops.Controls";
120
- C.displayName = "Tubestops.Body";
121
- S.displayName = "Tubestops.Content";
122
- const L = Object.assign(h, {
123
- Header: y,
124
- Stop: g,
125
- Text: j,
117
+ S.displayName = "Tubestops.Body";
118
+ g.displayName = "Tubestops.Content";
119
+ const A = Object.assign(y, {
120
+ Header: C,
121
+ Stop: j,
122
+ Text: k,
126
123
  Controls: w,
127
- Body: C,
128
- Content: S
124
+ Body: S,
125
+ Content: g
129
126
  });
130
127
  export {
131
- L as Tubestops
128
+ A as Tubestops
132
129
  };
@@ -1,3 +1,3 @@
1
- import { default as TrepurComponentsLogo } from './trepurComponentsLogo.svg';
1
+ import { default as TrepurComponentsLogo } from '/trepurComponentsLogo.svg';
2
2
 
3
3
  export { TrepurComponentsLogo };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trepur_components",
3
- "version": "2.3.46",
3
+ "version": "2.3.48",
4
4
  "description": "component lib",
5
5
  "author": "trepur_ttenneb",
6
6
  "private": false,