trepur_components 2.3.47 → 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,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.47",
3
+ "version": "2.3.48",
4
4
  "description": "component lib",
5
5
  "author": "trepur_ttenneb",
6
6
  "private": false,