trepur_components 2.3.33 → 2.3.35
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/components/ImageCard/ImageCard.stories.d.ts +1 -1
- package/lib/components/ImageCard/index.d.ts +1 -1
- package/lib/components/ImageCard/index.js +6 -8
- package/lib/components/Nav/index.js +42 -56
- package/lib/components/Pill/Pill.stories.d.ts +4 -0
- package/lib/components/Pill/index.d.ts +1 -0
- package/lib/components/Pill/index.js +25 -21
- package/lib/components/SplitCard/index.js +7 -7
- package/lib/components/Tubestops/index.js +52 -47
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { StoryObj } from '@storybook/react';
|
|
|
3
3
|
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLAnchorElement> & import('react').RefAttributes<HTMLAnchorElement>> & {
|
|
7
7
|
Image: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<import('../Image').ImageProps> & import('../Image').ImageProps & import('react').RefAttributes<HTMLImageElement>>;
|
|
8
8
|
Content: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
9
|
Title: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ImageProps } from '../Image';
|
|
2
2
|
import { HTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const ImageCard: import('react').ForwardRefExoticComponent<HTMLAttributes<
|
|
4
|
+
declare const ImageCard: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLAnchorElement> & import('react').RefAttributes<HTMLAnchorElement>> & {
|
|
5
5
|
Image: import('react').ForwardRefExoticComponent<HTMLAttributes<ImageProps> & ImageProps & import('react').RefAttributes<HTMLImageElement>>;
|
|
6
6
|
Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
7
|
Title: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
3
|
import { Image as p } from "../Image/index.js";
|
|
4
|
-
import
|
|
5
|
-
const d = m(({ className: a, children: e,
|
|
4
|
+
import C from "clsx";
|
|
5
|
+
const d = m(({ className: a, children: e, onClick: r, ...g }, c) => /* @__PURE__ */ t("a", { ref: c, className: "", href: "", onClick: r, ...g, children: /* @__PURE__ */ t(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
|
-
className:
|
|
8
|
+
className: C(
|
|
9
9
|
"grid max-w-96 overflow-hidden rounded-xl bg-white drop-shadow",
|
|
10
10
|
a
|
|
11
11
|
),
|
|
12
|
-
ref: n,
|
|
13
|
-
...r,
|
|
14
12
|
children: e
|
|
15
13
|
}
|
|
16
|
-
)), s = m(({ src: a, ...e }) => /* @__PURE__ */ t("div", { className: "h-64 object-cover", children: /* @__PURE__ */ t(p, { src: a, ...e }) })), o = m(({ children: a, ...e }, r) => /* @__PURE__ */ t("div", { className: "px-2 pb-4 pt-2", ref: r, ...e, children: a })), i = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-lg", ref: e, ...a })), l = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-sm", ref: e, ...a })),
|
|
14
|
+
) })), s = m(({ src: a, ...e }) => /* @__PURE__ */ t("div", { className: "h-64 object-cover", children: /* @__PURE__ */ t(p, { src: a, ...e }) })), o = m(({ children: a, ...e }, r) => /* @__PURE__ */ t("div", { className: "px-2 pb-4 pt-2", ref: r, ...e, children: a })), i = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-lg", ref: e, ...a })), l = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-sm", ref: e, ...a })), n = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-md pt-2", ref: e, ...a }));
|
|
17
15
|
d.displayName = "ImageCard";
|
|
18
16
|
s.displayName = "ImageCard.Image";
|
|
19
17
|
i.displayName = "ImageCard.Title";
|
|
20
18
|
l.displayName = "ImageCard.Subtitle";
|
|
21
19
|
o.displayName = "ImageCard.Content";
|
|
22
|
-
|
|
20
|
+
n.displayName = "ImageCard.Text";
|
|
23
21
|
const b = Object.assign(d, {
|
|
24
22
|
Image: s,
|
|
25
23
|
Content: o,
|
|
26
24
|
Title: i,
|
|
27
25
|
Subtitle: l,
|
|
28
|
-
Text:
|
|
26
|
+
Text: n
|
|
29
27
|
});
|
|
30
28
|
export {
|
|
31
29
|
b as ImageCard
|
|
@@ -1,97 +1,83 @@
|
|
|
1
1
|
import { jsx as e, jsxs as p, Fragment as H } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as w, forwardRef as
|
|
2
|
+
import { createContext as w, forwardRef as d, useState as v, useMemo as C, useContext as c, useRef as k } from "react";
|
|
3
3
|
import { HamburgerIcon as M } from "../HamburgerIcon/index.js";
|
|
4
4
|
import { faChevronDown as j } from "@fortawesome/fontawesome-free-solid";
|
|
5
|
-
import
|
|
5
|
+
import n from "clsx";
|
|
6
6
|
import { Icon as D } from "../Icon/index.js";
|
|
7
7
|
import { NavItem as F } from "../NavItem/index.js";
|
|
8
|
-
const i = w(null),
|
|
9
|
-
const [s,
|
|
8
|
+
const i = w(null), g = d(({ className: t, children: r, loading: a }, o) => {
|
|
9
|
+
const [s, l] = v(!1), m = C(
|
|
10
10
|
() => ({
|
|
11
11
|
expanded: s,
|
|
12
|
-
setExpanded:
|
|
12
|
+
setExpanded: l,
|
|
13
13
|
loading: a
|
|
14
14
|
}),
|
|
15
|
-
[s,
|
|
15
|
+
[s, l, a]
|
|
16
16
|
);
|
|
17
|
-
return /* @__PURE__ */ e(i.Provider, { value:
|
|
18
|
-
}),
|
|
17
|
+
return /* @__PURE__ */ e(i.Provider, { value: m, children: /* @__PURE__ */ e("div", { className: t, ref: o, children: r }) });
|
|
18
|
+
}), N = d(
|
|
19
19
|
({ className: t, children: r }, a) => /* @__PURE__ */ e(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
22
|
ref: a,
|
|
23
|
-
className:
|
|
23
|
+
className: n("relative h-24 w-full bg-nav-bg px-2 py-2", t),
|
|
24
24
|
children: r
|
|
25
25
|
}
|
|
26
26
|
)
|
|
27
|
-
),
|
|
28
|
-
const { loading: o, setExpanded: s, expanded:
|
|
29
|
-
return /* @__PURE__ */ p("div", { ref: a, className:
|
|
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: [
|
|
30
30
|
!o && /* @__PURE__ */ e("div", { className: "my-auto", children: /* @__PURE__ */ e(
|
|
31
31
|
M,
|
|
32
32
|
{
|
|
33
33
|
variant: "ghost",
|
|
34
|
-
onClick: () => s == null ? void 0 : s(!
|
|
34
|
+
onClick: () => s == null ? void 0 : s(!l),
|
|
35
35
|
className: "aspect-square"
|
|
36
36
|
}
|
|
37
37
|
) }),
|
|
38
38
|
/* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: r })
|
|
39
39
|
] });
|
|
40
|
-
}), u =
|
|
40
|
+
}), u = d(({ className: t, children: r }, a) => /* @__PURE__ */ e(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
43
|
ref: a,
|
|
44
|
-
className:
|
|
45
|
-
"hidden justify-between lg:flex
|
|
44
|
+
className: n(
|
|
45
|
+
"hidden justify-between lg:flex gap-4 px-4 lg:gap-8 lg:px-20",
|
|
46
46
|
t
|
|
47
47
|
),
|
|
48
48
|
children: r
|
|
49
49
|
}
|
|
50
|
-
)), x =
|
|
50
|
+
)), x = d(
|
|
51
51
|
({ className: t, children: r }, a) => {
|
|
52
|
-
const { expanded: o } =
|
|
52
|
+
const { expanded: o } = c(i) || {};
|
|
53
53
|
return o ? /* @__PURE__ */ e(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
56
|
ref: a,
|
|
57
|
-
className:
|
|
58
|
-
"h-screen bg-nav-bg px-8 pb-12 pt-2
|
|
57
|
+
className: n(
|
|
58
|
+
"h-screen bg-nav-bg px-8 pb-12 pt-2 lg:hidden",
|
|
59
59
|
t
|
|
60
60
|
),
|
|
61
|
-
children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4
|
|
61
|
+
children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 lg:hidden", children: r })
|
|
62
62
|
}
|
|
63
63
|
) : /* @__PURE__ */ e(H, {});
|
|
64
64
|
}
|
|
65
|
-
), h =
|
|
65
|
+
), h = d(
|
|
66
66
|
({ className: t, children: r }, a) => {
|
|
67
|
-
const { loading: o } =
|
|
68
|
-
return o ? /* @__PURE__ */ e(
|
|
69
|
-
"div",
|
|
70
|
-
{
|
|
71
|
-
ref: a,
|
|
72
|
-
className: d("my-4 md:flex md:gap-4 lg:gap-6", t),
|
|
73
|
-
children: [...Array(5)].map((s, n) => /* @__PURE__ */ e(F, { loading: !0 }, n))
|
|
74
|
-
}
|
|
75
|
-
) : /* @__PURE__ */ e(
|
|
76
|
-
"div",
|
|
77
|
-
{
|
|
78
|
-
ref: a,
|
|
79
|
-
className: d("my-4 md:flex md:gap-4 lg:gap-6", t),
|
|
80
|
-
children: r
|
|
81
|
-
}
|
|
82
|
-
);
|
|
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 });
|
|
83
69
|
}
|
|
84
|
-
), b =
|
|
85
|
-
const [s,
|
|
70
|
+
), b = d(({ className: t, label: r, children: a, active: o = !1 }) => {
|
|
71
|
+
const [s, l] = v(!1), m = k(null);
|
|
86
72
|
return /* @__PURE__ */ p(
|
|
87
73
|
"div",
|
|
88
74
|
{
|
|
89
|
-
ref:
|
|
90
|
-
onMouseEnter: () =>
|
|
91
|
-
onMouseLeave: () =>
|
|
92
|
-
onClick: () =>
|
|
93
|
-
className:
|
|
94
|
-
"relative m-auto py-0 text-nav-text
|
|
75
|
+
ref: m,
|
|
76
|
+
onMouseEnter: () => l(!0),
|
|
77
|
+
onMouseLeave: () => l(!1),
|
|
78
|
+
onClick: () => l(!s),
|
|
79
|
+
className: n(
|
|
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",
|
|
95
81
|
{
|
|
96
82
|
"font-bold": o,
|
|
97
83
|
"font-light": !o
|
|
@@ -103,34 +89,34 @@ const i = w(null), N = l(({ className: t, children: r, loading: a }, o) => {
|
|
|
103
89
|
/* @__PURE__ */ e("p", { className: "text-lg", children: r }),
|
|
104
90
|
/* @__PURE__ */ e(D, { size: "xs", icon: j })
|
|
105
91
|
] }),
|
|
106
|
-
s && /* @__PURE__ */ e("div", { className: "rounded-md
|
|
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 }) })
|
|
107
93
|
]
|
|
108
94
|
}
|
|
109
95
|
);
|
|
110
|
-
}), y =
|
|
111
|
-
const { loading: s } =
|
|
96
|
+
}), y = d(({ className: t, src: r, ...a }, o) => {
|
|
97
|
+
const { loading: s } = c(i) || {};
|
|
112
98
|
return s ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className: "h-20 w-20 animate-pulse bg-gray-300" }) }) : /* @__PURE__ */ e(
|
|
113
99
|
"img",
|
|
114
100
|
{
|
|
115
|
-
className:
|
|
101
|
+
className: n("h-20 flex-none", t),
|
|
116
102
|
ref: o,
|
|
117
103
|
src: r,
|
|
118
104
|
...a
|
|
119
105
|
}
|
|
120
106
|
);
|
|
121
107
|
});
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
g.displayName = "Nav";
|
|
109
|
+
N.displayName = "Nav.Header";
|
|
124
110
|
u.displayName = "Nav.DesktopHeader";
|
|
125
|
-
|
|
111
|
+
f.displayName = "Nav.MobileHeader";
|
|
126
112
|
y.displayName = "Nav.Logo";
|
|
127
113
|
h.displayName = "Nav.Section";
|
|
128
114
|
x.displayName = "Nav.Body";
|
|
129
115
|
b.displayName = "Nav.Folder";
|
|
130
|
-
const q = Object.assign(
|
|
131
|
-
Header:
|
|
116
|
+
const q = Object.assign(g, {
|
|
117
|
+
Header: N,
|
|
132
118
|
DesktopHeader: u,
|
|
133
|
-
MobileHeader:
|
|
119
|
+
MobileHeader: f,
|
|
134
120
|
Section: h,
|
|
135
121
|
Logo: y,
|
|
136
122
|
Body: x,
|
|
@@ -17,6 +17,10 @@ export default meta;
|
|
|
17
17
|
type Story = StoryObj<typeof Pill>;
|
|
18
18
|
export declare const Default: Story;
|
|
19
19
|
export declare const Error: Story;
|
|
20
|
+
export declare const ErrorInverse: Story;
|
|
20
21
|
export declare const Warning: Story;
|
|
22
|
+
export declare const WarningInverse: Story;
|
|
21
23
|
export declare const Success: Story;
|
|
24
|
+
export declare const SuccessInverse: Story;
|
|
22
25
|
export declare const Info: Story;
|
|
26
|
+
export declare const InfoInverse: Story;
|
|
@@ -7,6 +7,7 @@ export type PillVariant = 'warning' | 'error' | 'info' | 'success';
|
|
|
7
7
|
export interface PillProps {
|
|
8
8
|
variant?: PillVariant;
|
|
9
9
|
loading?: boolean;
|
|
10
|
+
inverse?: boolean;
|
|
10
11
|
}
|
|
11
12
|
declare const Pill: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & PillProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
12
13
|
Icon: import('react').ForwardRefExoticComponent<{
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { Icon as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as r } from "react";
|
|
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(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
|
-
ref:
|
|
9
|
-
className:
|
|
10
|
-
"inline-grid grid-flow-col
|
|
8
|
+
ref: f,
|
|
9
|
+
className: s(
|
|
10
|
+
"inline-grid grid-flow-col w-auto py-2 px-4 text-base font-semibold rounded-full gap-2",
|
|
11
11
|
{
|
|
12
|
-
"border-error-default bg-error-light text-error-default": e === "error",
|
|
13
|
-
"border-info-default bg-info-light text-info-default": e === "info",
|
|
14
|
-
"border-success-default bg-success-light text-success-default": e === "success",
|
|
15
|
-
"border-warning-default bg-warning-light text-warning-default": e === "warning"
|
|
12
|
+
"border-error-default bg-error-light text-error-default": e === "error" && !l,
|
|
13
|
+
"border-info-default bg-info-light text-info-default": e === "info" && !l,
|
|
14
|
+
"border-success-default bg-success-light text-success-default": e === "success" && !l,
|
|
15
|
+
"border-warning-default bg-warning-light text-warning-default": e === "warning" && !l,
|
|
16
|
+
"border-error-light bg-error-default text-error-light": e === "error" && l,
|
|
17
|
+
"border-info-light bg-info-default text-info-light": e === "info" && l,
|
|
18
|
+
"border-success-light bg-success-default text-success-light": e === "success" && l,
|
|
19
|
+
"border-warning-light bg-warning-default text-warning-light": e === "warning" && l
|
|
16
20
|
}
|
|
17
21
|
),
|
|
18
|
-
children:
|
|
22
|
+
children: o
|
|
19
23
|
}
|
|
20
|
-
)),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
Icon:
|
|
26
|
-
Label:
|
|
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 }));
|
|
25
|
+
i.displayName = "Pill";
|
|
26
|
+
d.displayName = "Pill.Icon";
|
|
27
|
+
g.displayName = "Chip.Label";
|
|
28
|
+
const m = Object.assign(i, {
|
|
29
|
+
Icon: d,
|
|
30
|
+
Label: g
|
|
27
31
|
});
|
|
28
32
|
export {
|
|
29
|
-
|
|
33
|
+
m as Pill
|
|
30
34
|
};
|
|
@@ -3,7 +3,7 @@ import { createContext as u, forwardRef as o, useMemo as N, useContext as c } fr
|
|
|
3
3
|
import h from "../../utils/matchMedia.js";
|
|
4
4
|
import { Screens as y } from "../../utils/screens.js";
|
|
5
5
|
import d from "clsx";
|
|
6
|
-
const a = u(null),
|
|
6
|
+
const a = u(null), g = o(({ className: r, children: l, swapDesktop: t, swapMobile: e, ...i }, s) => {
|
|
7
7
|
const f = `(min-width: ${y.md})`, m = h(f), S = N(
|
|
8
8
|
() => ({
|
|
9
9
|
swapDesktop: t,
|
|
@@ -21,7 +21,7 @@ const a = u(null), x = o(({ className: r, children: l, swapDesktop: t, swapMobil
|
|
|
21
21
|
children: l
|
|
22
22
|
}
|
|
23
23
|
) });
|
|
24
|
-
}),
|
|
24
|
+
}), x = o(({ className: r, children: l, ...t }, e) => {
|
|
25
25
|
const { swapDesktop: i, swapMobile: s, isMd: p } = c(a) || {};
|
|
26
26
|
return /* @__PURE__ */ n(
|
|
27
27
|
"div",
|
|
@@ -64,18 +64,18 @@ const a = u(null), x = o(({ className: r, children: l, swapDesktop: t, swapMobil
|
|
|
64
64
|
{
|
|
65
65
|
ref: e,
|
|
66
66
|
className: d(
|
|
67
|
-
"items-center
|
|
67
|
+
"items-center font-semibold tracking-wider md:text-4xl lg:text-6xl",
|
|
68
68
|
r
|
|
69
69
|
),
|
|
70
70
|
...t,
|
|
71
71
|
children: l
|
|
72
72
|
}
|
|
73
73
|
)), v = o(({ className: r, children: l, ...t }, e) => /* @__PURE__ */ n("p", { ref: e, className: d("text-lg", r), ...t, children: l }));
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
g.displayName = "SplitCard";
|
|
75
|
+
x.displayName = "SplitCard.LeftContent";
|
|
76
76
|
C.displayName = "SplitCard.RightContent";
|
|
77
|
-
const j = Object.assign(
|
|
78
|
-
LeftContent:
|
|
77
|
+
const j = Object.assign(g, {
|
|
78
|
+
LeftContent: x,
|
|
79
79
|
RightContent: C,
|
|
80
80
|
Title: M,
|
|
81
81
|
Text: v
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import
|
|
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
4
|
import { Button as b } from "../Button/index.js";
|
|
5
|
-
const p =
|
|
5
|
+
const p = f(null), N = f(
|
|
6
6
|
null
|
|
7
|
-
),
|
|
8
|
-
const [o, u] =
|
|
7
|
+
), h = a(({ className: n, children: t, activeStop: s = 1 }, e) => {
|
|
8
|
+
const [o, u] = x(s), [c, m] = x(0), d = v(
|
|
9
9
|
() => ({
|
|
10
|
-
totalStops:
|
|
10
|
+
totalStops: c ?? 0,
|
|
11
11
|
setTotalStops: m,
|
|
12
12
|
currentStop: o,
|
|
13
13
|
setCurrentStop: u
|
|
14
14
|
}),
|
|
15
|
-
[o, u,
|
|
15
|
+
[o, u, c, m]
|
|
16
16
|
);
|
|
17
|
-
return /* @__PURE__ */ l(p.Provider, { value:
|
|
18
|
-
}),
|
|
19
|
-
const { setTotalStops: e } =
|
|
20
|
-
return e == null || e(o), /* @__PURE__ */ l("div", { ref: s, className:
|
|
21
|
-
}),
|
|
22
|
-
const { currentStop: o = 0 } =
|
|
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) => {
|
|
22
|
+
const { currentStop: o = 0 } = i(p) || {};
|
|
23
23
|
return /* @__PURE__ */ l(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
26
|
ref: e,
|
|
27
|
-
className:
|
|
27
|
+
className: r("", n, {
|
|
28
28
|
block: o === t,
|
|
29
29
|
hidden: o !== t
|
|
30
30
|
}),
|
|
31
31
|
children: s
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
|
-
}),
|
|
34
|
+
}), w = a(({ className: n }, t) => {
|
|
35
35
|
const {
|
|
36
36
|
setCurrentStop: s,
|
|
37
37
|
currentStop: e = 0,
|
|
38
38
|
totalStops: o = 0
|
|
39
|
-
} =
|
|
40
|
-
return /* @__PURE__ */
|
|
39
|
+
} = i(p) || {};
|
|
40
|
+
return /* @__PURE__ */ T("div", { ref: t, className: r("flex justify-between", n), children: [
|
|
41
41
|
/* @__PURE__ */ l(
|
|
42
42
|
b,
|
|
43
43
|
{
|
|
@@ -55,46 +55,51 @@ const p = T(null), N = T(
|
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
] });
|
|
58
|
-
}),
|
|
59
|
-
const {
|
|
58
|
+
}), g = a(({ className: n, stopId: t = 0, children: s }, e) => {
|
|
59
|
+
const {
|
|
60
|
+
currentStop: o = 0,
|
|
61
|
+
setCurrentStop: u,
|
|
62
|
+
totalStops: c = 0
|
|
63
|
+
} = i(p) || {}, [m] = x(t), d = v(
|
|
60
64
|
() => ({
|
|
61
|
-
stopNumber:
|
|
65
|
+
stopNumber: m
|
|
62
66
|
}),
|
|
63
|
-
[
|
|
67
|
+
[m]
|
|
64
68
|
);
|
|
65
|
-
return /* @__PURE__ */ l(N.Provider, { value:
|
|
69
|
+
return /* @__PURE__ */ l(N.Provider, { value: d, children: /* @__PURE__ */ T("div", { ref: e, className: r(n, "w-full min-w-[120px]"), children: [
|
|
66
70
|
/* @__PURE__ */ l(
|
|
67
71
|
"div",
|
|
68
72
|
{
|
|
69
|
-
className:
|
|
70
|
-
"mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-future": t >= o && t <
|
|
71
|
-
"mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-complete": t < o && t <
|
|
73
|
+
className: r({
|
|
74
|
+
"mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-future": t >= o && t < c,
|
|
75
|
+
"mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-complete": t < o && t < c
|
|
72
76
|
})
|
|
73
77
|
}
|
|
74
78
|
),
|
|
75
79
|
/* @__PURE__ */ l(
|
|
76
80
|
"p",
|
|
77
81
|
{
|
|
78
|
-
|
|
82
|
+
onClick: () => u == null ? void 0 : u(t),
|
|
83
|
+
className: r(
|
|
84
|
+
"hover:cursor-pointer z-10 mx-auto h-6 w-6 rounded-full",
|
|
79
85
|
{
|
|
80
86
|
"relative z-20 -mt-4 bg-tubestop-station-complete": t < o,
|
|
81
87
|
"relative z-20 -mt-4 bg-tubestop-station-active": o === t,
|
|
82
88
|
"relative z-20 -mt-4 bg-tubestop-station-future": t > o,
|
|
83
|
-
"mt-1": t ===
|
|
84
|
-
}
|
|
85
|
-
"z-10 mx-auto h-6 w-6 rounded-full"
|
|
89
|
+
"mt-1": t === c
|
|
90
|
+
}
|
|
86
91
|
)
|
|
87
92
|
}
|
|
88
93
|
),
|
|
89
94
|
s
|
|
90
95
|
] }) });
|
|
91
|
-
}),
|
|
92
|
-
const { currentStop: e = 0 } =
|
|
96
|
+
}), j = a(({ className: n, children: t }, s) => {
|
|
97
|
+
const { currentStop: e = 0 } = i(p) || {}, { stopNumber: o = 0 } = i(N) || {};
|
|
93
98
|
return /* @__PURE__ */ l(
|
|
94
99
|
"p",
|
|
95
100
|
{
|
|
96
101
|
ref: s,
|
|
97
|
-
className:
|
|
102
|
+
className: r(
|
|
98
103
|
"mt-2 text-center",
|
|
99
104
|
{
|
|
100
105
|
"font-medium text-tubestop-text-complete": o < e,
|
|
@@ -107,20 +112,20 @@ const p = T(null), N = T(
|
|
|
107
112
|
}
|
|
108
113
|
);
|
|
109
114
|
});
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const L = Object.assign(
|
|
118
|
-
Header:
|
|
119
|
-
Stop:
|
|
120
|
-
Text:
|
|
121
|
-
Controls:
|
|
122
|
-
Body:
|
|
123
|
-
Content:
|
|
115
|
+
h.displayName = "Tubestop";
|
|
116
|
+
y.displayName = "Tubestops.Header";
|
|
117
|
+
g.displayName = "Tubestops.Stop";
|
|
118
|
+
j.displayName = "Tubestops.Text";
|
|
119
|
+
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,
|
|
126
|
+
Controls: w,
|
|
127
|
+
Body: C,
|
|
128
|
+
Content: S
|
|
124
129
|
});
|
|
125
130
|
export {
|
|
126
131
|
L as Tubestops
|