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.
- package/lib/assets/trepurComponentsLogo.svg +32 -0
- package/lib/components/AlertBar/index.js +3 -3
- package/lib/components/Button/index.js +16 -15
- package/lib/components/Card/index.js +18 -23
- package/lib/components/Carousel/index.js +38 -38
- package/lib/components/CarouselThumbnail/index.js +33 -32
- package/lib/components/Dropdown/index.js +34 -32
- package/lib/components/FooterNav/index.js +6 -5
- package/lib/components/ImageCard/index.js +10 -9
- package/lib/components/Input/Input.stories.d.ts +1 -1
- package/lib/components/Input/index.d.ts +1 -1
- package/lib/components/Input/index.js +20 -19
- package/lib/components/Link/Link.stories.d.ts +0 -1
- package/lib/components/Link/index.js +18 -17
- package/lib/components/Nav/index.js +49 -49
- package/lib/components/Pill/index.js +6 -6
- package/lib/components/Timeline/index.js +14 -14
- package/lib/components/Tubestops/index.js +58 -61
- package/lib/documentation/assets/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,86 +1,83 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as f, forwardRef as a, useState as
|
|
3
|
-
import
|
|
4
|
-
import { Button as
|
|
5
|
-
const p = f(null),
|
|
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
|
-
),
|
|
8
|
-
|
|
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
|
|
11
|
-
setTotalStops: m,
|
|
11
|
+
totalStops: c,
|
|
12
12
|
currentStop: o,
|
|
13
13
|
setCurrentStop: u
|
|
14
14
|
}),
|
|
15
|
-
[o, u
|
|
15
|
+
[o, u]
|
|
16
16
|
);
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
}),
|
|
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__ */
|
|
20
|
+
return /* @__PURE__ */ r(
|
|
24
21
|
"div",
|
|
25
22
|
{
|
|
26
|
-
ref:
|
|
27
|
-
className:
|
|
23
|
+
ref: s,
|
|
24
|
+
className: l("", n, {
|
|
28
25
|
block: o === t,
|
|
29
26
|
hidden: o !== t
|
|
30
27
|
}),
|
|
31
|
-
children:
|
|
28
|
+
children: e
|
|
32
29
|
}
|
|
33
30
|
);
|
|
34
31
|
}), w = a(({ className: n }, t) => {
|
|
35
32
|
const {
|
|
36
|
-
setCurrentStop:
|
|
37
|
-
currentStop:
|
|
33
|
+
setCurrentStop: e,
|
|
34
|
+
currentStop: s = 0,
|
|
38
35
|
totalStops: o = 0
|
|
39
36
|
} = i(p) || {};
|
|
40
|
-
return /* @__PURE__ */ T("div", { ref: t, className:
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
37
|
+
return /* @__PURE__ */ T("div", { ref: t, className: l("flex justify-between", n), children: [
|
|
38
|
+
/* @__PURE__ */ r(
|
|
39
|
+
d,
|
|
43
40
|
{
|
|
44
|
-
disabled:
|
|
45
|
-
onClick: () =>
|
|
46
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
50
|
-
|
|
46
|
+
/* @__PURE__ */ r(
|
|
47
|
+
d,
|
|
51
48
|
{
|
|
52
|
-
disabled:
|
|
53
|
-
onClick: () =>
|
|
54
|
-
children: /* @__PURE__ */
|
|
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
|
-
}),
|
|
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] =
|
|
60
|
+
} = i(p) || {}, [m] = v(t), b = N(
|
|
64
61
|
() => ({
|
|
65
62
|
stopNumber: m
|
|
66
63
|
}),
|
|
67
64
|
[m]
|
|
68
65
|
);
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
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:
|
|
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__ */
|
|
76
|
+
/* @__PURE__ */ r(
|
|
80
77
|
"p",
|
|
81
78
|
{
|
|
82
79
|
onClick: () => u == null ? void 0 : u(t),
|
|
83
|
-
className:
|
|
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
|
-
|
|
91
|
+
e
|
|
95
92
|
] }) });
|
|
96
|
-
}),
|
|
97
|
-
const { currentStop:
|
|
98
|
-
return /* @__PURE__ */
|
|
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:
|
|
102
|
-
className:
|
|
98
|
+
ref: e,
|
|
99
|
+
className: l(
|
|
103
100
|
"mt-2 text-center",
|
|
104
101
|
{
|
|
105
|
-
"font-medium text-tubestop-text-complete": o <
|
|
106
|
-
"font-bold text-tubestop-text-active":
|
|
107
|
-
"font-medium text-tubestop-text-future": o >
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
Header:
|
|
124
|
-
Stop:
|
|
125
|
-
Text:
|
|
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:
|
|
128
|
-
Content:
|
|
124
|
+
Body: S,
|
|
125
|
+
Content: g
|
|
129
126
|
});
|
|
130
127
|
export {
|
|
131
|
-
|
|
128
|
+
A as Tubestops
|
|
132
129
|
};
|