trepur_components 2.3.28 → 2.3.30
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/Button/Button.stories.d.ts +2 -2
- package/lib/components/Button/index.d.ts +2 -2
- package/lib/components/Button/index.js +33 -32
- package/lib/components/Carousel/index.js +17 -17
- package/lib/components/ImageCard/index.js +5 -5
- package/lib/components/Link/Link.stories.d.ts +30 -0
- package/lib/components/Link/index.d.ts +16 -0
- package/lib/components/Tubestops/Tubestops.stories.d.ts +6 -1
- package/lib/components/Tubestops/index.d.ts +8 -1
- package/lib/components/Tubestops/index.js +92 -42
- package/lib/documentation/components/ThemeColours.d.ts +20 -0
- package/lib/styles/themes/local.css +7 -7
- package/lib/styles/themes/penrithmrt.css +6 -6
- package/lib/tailwind/colors.ts +1 -2
- package/package.json +1 -1
- /package/lib/components/Stars/{Star.stories.d.ts → Stars.stories.d.ts} +0 -0
|
@@ -3,7 +3,7 @@ import { Button } from './';
|
|
|
3
3
|
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: import('react').ForwardRefExoticComponent<
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLButtonElement> & import('./').ButtonProps & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
7
7
|
Icon: import('react').ForwardRefExoticComponent<{
|
|
8
8
|
icon: any;
|
|
9
9
|
} & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -23,7 +23,7 @@ export declare const Bordered: Story;
|
|
|
23
23
|
export declare const Ghost: Story;
|
|
24
24
|
export declare const Basic: Story;
|
|
25
25
|
export declare const Loading: Story;
|
|
26
|
-
export declare const Link: Story;
|
|
27
26
|
export declare const Small: Story;
|
|
28
27
|
export declare const Medium: Story;
|
|
29
28
|
export declare const Large: Story;
|
|
29
|
+
export declare const Disabled: Story;
|
|
@@ -4,12 +4,12 @@ export interface ButtonProps {
|
|
|
4
4
|
variant?: 'primary' | 'secondary' | 'ghost' | 'bordered' | 'basic';
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
loading?: boolean;
|
|
7
|
-
type?: 'button' | '
|
|
7
|
+
type?: 'button' | 'submit';
|
|
8
8
|
href?: string;
|
|
9
9
|
target?: string;
|
|
10
10
|
size?: 'sm' | 'md' | 'lg';
|
|
11
11
|
}
|
|
12
|
-
declare const Button: import('react').ForwardRefExoticComponent<
|
|
12
|
+
declare const Button: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & ButtonProps & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
13
13
|
Icon: import('react').ForwardRefExoticComponent<{
|
|
14
14
|
icon: any;
|
|
15
15
|
} & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as s } from "react";
|
|
3
|
+
import { Icon as p } from "../Icon/index.js";
|
|
4
|
+
import c from "clsx";
|
|
5
|
+
const u = s(
|
|
6
6
|
({
|
|
7
7
|
className: o,
|
|
8
8
|
children: e,
|
|
9
9
|
loading: t = !1,
|
|
10
|
-
variant:
|
|
11
|
-
type:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}) => /* @__PURE__ */
|
|
16
|
-
|
|
10
|
+
variant: r = "primary",
|
|
11
|
+
type: g = "button",
|
|
12
|
+
disabled: b,
|
|
13
|
+
size: n = "md",
|
|
14
|
+
...i
|
|
15
|
+
}) => /* @__PURE__ */ a(
|
|
16
|
+
"button",
|
|
17
17
|
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className:
|
|
18
|
+
"aria-disabled": b,
|
|
19
|
+
disabled: t || b,
|
|
20
|
+
type: g,
|
|
21
|
+
className: c(
|
|
22
22
|
"flex items-center gap-3 rounded border text-center",
|
|
23
23
|
{
|
|
24
24
|
"duration-200": !t,
|
|
25
|
-
"border-button-primary-border bg-button-primary-bg text-button-primary-text hover:bg-button-primary-hover active:bg-button-primary-active":
|
|
26
|
-
"border-button-secondary-border bg-button-secondary-bg text-button-secondary-text hover:bg-button-secondary-hover active:bg-button-secondary-active":
|
|
27
|
-
"border-button-ghost-border bg-button-ghost-bg text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active":
|
|
28
|
-
"border-button-bordered-border text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active":
|
|
29
|
-
"border-button-basic-border bg-button-basic-bg text-button-basic-text hover:bg-button-basic-hover active:bg-button-basic-active":
|
|
25
|
+
"border-button-primary-border bg-button-primary-bg text-button-primary-text hover:bg-button-primary-hover active:bg-button-primary-active": r === "primary" && !t && !b,
|
|
26
|
+
"border-button-secondary-border bg-button-secondary-bg text-button-secondary-text hover:bg-button-secondary-hover active:bg-button-secondary-active": r === "secondary" && !t,
|
|
27
|
+
"border-button-ghost-border bg-button-ghost-bg text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active": r === "ghost" && !t,
|
|
28
|
+
"border-button-bordered-border text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active": r === "bordered" && !t,
|
|
29
|
+
"border-button-basic-border bg-button-basic-bg text-button-basic-text hover:bg-button-basic-hover active:bg-button-basic-active": r === "basic" && !t,
|
|
30
30
|
"w-40 animate-pulse border-loading bg-loading": t,
|
|
31
|
-
"px-12 py-3 text-base font-normal leading-4":
|
|
32
|
-
"px-12 py-3 text-lg font-normal leading-8":
|
|
33
|
-
"px-12 py-4 text-xl font-normal leading-8":
|
|
31
|
+
"px-12 py-3 text-base font-normal leading-4": n === "sm",
|
|
32
|
+
"px-12 py-3 text-lg font-normal leading-8": n === "md",
|
|
33
|
+
"px-12 py-4 text-xl font-normal leading-8": n === "lg"
|
|
34
34
|
},
|
|
35
35
|
o
|
|
36
36
|
),
|
|
37
|
+
...i,
|
|
37
38
|
children: !t && e
|
|
38
39
|
}
|
|
39
40
|
)
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
Icon:
|
|
46
|
-
Label:
|
|
41
|
+
), d = s(({ className: o, ...e }, t) => /* @__PURE__ */ a("p", { className: c("text-md", o), ref: t, ...e })), m = s(({ icon: o }, e) => /* @__PURE__ */ a(p, { size: "md", ref: e, icon: o }));
|
|
42
|
+
u.displayName = "Button";
|
|
43
|
+
m.displayName = "Button.Icon";
|
|
44
|
+
d.displayName = "Button.Label";
|
|
45
|
+
const v = Object.assign(u, {
|
|
46
|
+
Icon: m,
|
|
47
|
+
Label: d
|
|
47
48
|
});
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
+
v as Button
|
|
50
51
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as I, forwardRef as h, useState as
|
|
2
|
+
import { createContext as I, forwardRef as h, useState as S, useMemo as K, useContext as b } from "react";
|
|
3
3
|
import { Icon as j } from "../Icon/index.js";
|
|
4
4
|
import { faChevronRight as L, faChevronLeft as O, faCircle as T } from "@fortawesome/fontawesome-free-solid";
|
|
5
5
|
import m from "clsx";
|
|
6
6
|
import "../../node_modules/keen-slider/keen-slider.min.css.js";
|
|
7
7
|
import { useKeenSlider as $ } from "../../node_modules/keen-slider/react.js";
|
|
8
8
|
import { WheelControls as M } from "./utils.js";
|
|
9
|
-
const
|
|
9
|
+
const N = I(null), A = h(
|
|
10
10
|
({
|
|
11
11
|
breakpoints: s,
|
|
12
12
|
children: t,
|
|
@@ -17,7 +17,7 @@ const g = I(null), A = h(
|
|
|
17
17
|
spacing: c,
|
|
18
18
|
...i
|
|
19
19
|
}, y) => {
|
|
20
|
-
const [f, u] =
|
|
20
|
+
const [f, u] = S(1), [x, l] = S(!1), [C, p] = $(
|
|
21
21
|
{
|
|
22
22
|
breakpoints: s,
|
|
23
23
|
loop: e,
|
|
@@ -34,7 +34,7 @@ const g = I(null), A = h(
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
[M]
|
|
37
|
-
),
|
|
37
|
+
), g = K(
|
|
38
38
|
() => ({
|
|
39
39
|
sliderRef: C,
|
|
40
40
|
instanceRef: p,
|
|
@@ -52,14 +52,14 @@ const g = I(null), A = h(
|
|
|
52
52
|
n,
|
|
53
53
|
x
|
|
54
54
|
]
|
|
55
|
-
),
|
|
55
|
+
), w = (d) => {
|
|
56
56
|
var v;
|
|
57
57
|
d.key === "Tab" && ((v = p.current) == null || v.next());
|
|
58
58
|
};
|
|
59
|
-
return /* @__PURE__ */ o(
|
|
59
|
+
return /* @__PURE__ */ o(N.Provider, { value: g, children: /* @__PURE__ */ o(
|
|
60
60
|
"div",
|
|
61
61
|
{
|
|
62
|
-
onKeyDown:
|
|
62
|
+
onKeyDown: w,
|
|
63
63
|
className: m("navigation-wrapper w-full", a),
|
|
64
64
|
ref: y,
|
|
65
65
|
...i,
|
|
@@ -79,7 +79,7 @@ const g = I(null), A = h(
|
|
|
79
79
|
children: s
|
|
80
80
|
}
|
|
81
81
|
)), P = h(({ className: s, children: t, ...a }) => {
|
|
82
|
-
const { sliderRef: e } = b(
|
|
82
|
+
const { sliderRef: e } = b(N) || {};
|
|
83
83
|
return /* @__PURE__ */ o(
|
|
84
84
|
"div",
|
|
85
85
|
{
|
|
@@ -90,13 +90,13 @@ const g = I(null), A = h(
|
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
}), R = h(({ className: s, rightArrow: t = !1, ...a }, e) => {
|
|
93
|
-
const { instanceRef: n } = b(
|
|
93
|
+
const { instanceRef: n } = b(N) || {};
|
|
94
94
|
return /* @__PURE__ */ o(
|
|
95
95
|
"div",
|
|
96
96
|
{
|
|
97
97
|
ref: e,
|
|
98
98
|
className: m(
|
|
99
|
-
"my-auto text-carousel-arrow-default hover:cursor-pointer hover:text-carousel-arrow-hover",
|
|
99
|
+
"hidden md:block my-auto text-carousel-arrow-default hover:cursor-pointer hover:text-carousel-arrow-hover",
|
|
100
100
|
s
|
|
101
101
|
),
|
|
102
102
|
onClick: (r) => {
|
|
@@ -114,18 +114,18 @@ const g = I(null), A = h(
|
|
|
114
114
|
loop: n,
|
|
115
115
|
currentSlide: r = 1,
|
|
116
116
|
perView: c = 1
|
|
117
|
-
} = b(
|
|
118
|
-
return /* @__PURE__ */ o("div", { className: m("flex justify-center", s), children: [...Array(i).keys()].map((l) => {
|
|
119
|
-
var
|
|
120
|
-
const C = ((v = (d = (
|
|
117
|
+
} = b(N) || {}, i = (x = (u = (f = (y = e == null ? void 0 : e.current) == null ? void 0 : y.track) == null ? void 0 : f.details) == null ? void 0 : u.slides) == null ? void 0 : x.length;
|
|
118
|
+
return /* @__PURE__ */ o("div", { className: m("flex justify-center gap-0.5 pt-2", s), children: [...Array(i).keys()].map((l) => {
|
|
119
|
+
var g, w, d, v;
|
|
120
|
+
const C = ((v = (d = (w = (g = e == null ? void 0 : e.current) == null ? void 0 : g.track) == null ? void 0 : w.details) == null ? void 0 : d.slides) == null ? void 0 : v.length) ?? 1, p = n ? r + c <= C ? l >= r && l < r + c : l >= r || r + c - C - 1 >= l : r === l;
|
|
121
121
|
return /* @__PURE__ */ o(
|
|
122
122
|
"button",
|
|
123
123
|
{
|
|
124
124
|
ref: a,
|
|
125
125
|
type: "button",
|
|
126
126
|
onClick: () => {
|
|
127
|
-
var
|
|
128
|
-
(
|
|
127
|
+
var k;
|
|
128
|
+
(k = e.current) == null || k.moveToIdx(l);
|
|
129
129
|
},
|
|
130
130
|
"aria-label": `carousel-button${t.id ? `-${t.id}` : ""}`,
|
|
131
131
|
children: /* @__PURE__ */ o(
|
|
@@ -136,7 +136,7 @@ const g = I(null), A = h(
|
|
|
136
136
|
p ? "text-carousel-dots-active" : "text-carousel-dots-default"
|
|
137
137
|
),
|
|
138
138
|
icon: T,
|
|
139
|
-
size: "
|
|
139
|
+
size: "xl"
|
|
140
140
|
}
|
|
141
141
|
)
|
|
142
142
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
|
4
|
+
import c from "clsx";
|
|
5
5
|
const d = m(({ className: a, children: e, ...r }, n) => /* @__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
|
),
|
|
@@ -13,14 +13,14 @@ const d = m(({ className: a, children: e, ...r }, n) => /* @__PURE__ */ t(
|
|
|
13
13
|
...r,
|
|
14
14
|
children: e
|
|
15
15
|
}
|
|
16
|
-
)), s = m(({ src: a, ...e }) => /* @__PURE__ */ t("div", { className: "h-64", 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 })), g = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-md pt-2", ref: e, ...a }));
|
|
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 })), g = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-md pt-2", ref: e, ...a }));
|
|
17
17
|
d.displayName = "ImageCard";
|
|
18
18
|
s.displayName = "ImageCard.Image";
|
|
19
19
|
i.displayName = "ImageCard.Title";
|
|
20
20
|
l.displayName = "ImageCard.Subtitle";
|
|
21
21
|
o.displayName = "ImageCard.Content";
|
|
22
22
|
g.displayName = "ImageCard.Text";
|
|
23
|
-
const
|
|
23
|
+
const b = Object.assign(d, {
|
|
24
24
|
Image: s,
|
|
25
25
|
Content: o,
|
|
26
26
|
Title: i,
|
|
@@ -28,5 +28,5 @@ const f = Object.assign(d, {
|
|
|
28
28
|
Text: g
|
|
29
29
|
});
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
b as ImageCard
|
|
32
32
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Link } from '.';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLAnchorElement> & import('.').LinkProps & import('react').RefAttributes<HTMLAnchorElement>> & {
|
|
7
|
+
Icon: import('react').ForwardRefExoticComponent<{
|
|
8
|
+
icon: any;
|
|
9
|
+
} & import('react').RefAttributes<SVGSVGElement>>;
|
|
10
|
+
Label: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
11
|
+
};
|
|
12
|
+
args: {
|
|
13
|
+
variant: "primary";
|
|
14
|
+
href: string;
|
|
15
|
+
target: string;
|
|
16
|
+
children: import("react/jsx-runtime").JSX.Element[];
|
|
17
|
+
onClick: import('@storybook/addon-actions').HandlerFunction;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof Link>;
|
|
22
|
+
export declare const Default: Story;
|
|
23
|
+
export declare const Secondary: Story;
|
|
24
|
+
export declare const Bordered: Story;
|
|
25
|
+
export declare const Ghost: Story;
|
|
26
|
+
export declare const Basic: Story;
|
|
27
|
+
export declare const Loading: Story;
|
|
28
|
+
export declare const Small: Story;
|
|
29
|
+
export declare const Medium: Story;
|
|
30
|
+
export declare const Large: Story;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface LinkProps {
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'bordered' | 'basic';
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
href?: string;
|
|
7
|
+
target?: string;
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
}
|
|
10
|
+
declare const Link: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLAnchorElement> & LinkProps & import('react').RefAttributes<HTMLAnchorElement>> & {
|
|
11
|
+
Icon: import('react').ForwardRefExoticComponent<{
|
|
12
|
+
icon: any;
|
|
13
|
+
} & import('react').RefAttributes<SVGSVGElement>>;
|
|
14
|
+
Label: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
15
|
+
};
|
|
16
|
+
export { Link };
|
|
@@ -4,13 +4,18 @@ import { StoryObj } from '@storybook/react';
|
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
6
|
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('.').TubestopsContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
7
|
+
Header: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
8
|
Stop: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
8
9
|
stopId: number;
|
|
9
10
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
11
|
Text: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
12
|
+
Controls: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Body: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Content: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
15
|
+
stopId: number;
|
|
16
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
17
|
};
|
|
12
18
|
args: {
|
|
13
|
-
activeStop: number;
|
|
14
19
|
children: import("react/jsx-runtime").JSX.Element[];
|
|
15
20
|
};
|
|
16
21
|
};
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface TubestopsContextProps {
|
|
4
|
-
|
|
4
|
+
totalStops?: number;
|
|
5
|
+
setTotalStops?: (stop: number) => void;
|
|
5
6
|
activeStop?: number;
|
|
6
7
|
currentStop?: number;
|
|
7
8
|
setCurrentStop?: (stop: number) => void;
|
|
8
9
|
}
|
|
9
10
|
declare const Tubestops: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & TubestopsContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
11
|
+
Header: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
12
|
Stop: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
11
13
|
stopId: number;
|
|
12
14
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
15
|
Text: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
16
|
+
Controls: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
|
+
Body: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
|
+
Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
19
|
+
stopId: number;
|
|
20
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
21
|
};
|
|
15
22
|
export { Tubestops };
|
|
@@ -1,63 +1,105 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { jsx as l, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as T, forwardRef as r, useState as d, useMemo as f, useContext as c, Children as z } from "react";
|
|
3
|
+
import a from "clsx";
|
|
4
|
+
import { Button as b } from "../Button/index.js";
|
|
5
|
+
const p = T(null), N = T(
|
|
5
6
|
null
|
|
6
|
-
),
|
|
7
|
-
const [
|
|
7
|
+
), v = r(({ className: n, children: t, activeStop: s = 1 }, e) => {
|
|
8
|
+
const [o, u] = d(s), [i, m] = d(0), j = f(
|
|
8
9
|
() => ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
totalStops: i ?? 0,
|
|
11
|
+
setTotalStops: m,
|
|
12
|
+
currentStop: o,
|
|
13
|
+
setCurrentStop: u
|
|
12
14
|
}),
|
|
13
|
-
[
|
|
15
|
+
[o, u, i, m]
|
|
14
16
|
);
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
}),
|
|
17
|
-
const {
|
|
17
|
+
return /* @__PURE__ */ l(p.Provider, { value: j, children: /* @__PURE__ */ l("div", { ref: e, className: n, children: t }) });
|
|
18
|
+
}), S = r(({ className: n, children: t }, s) => {
|
|
19
|
+
const { setTotalStops: e } = c(p) || {}, o = z.count(t);
|
|
20
|
+
return e == null || e(o), /* @__PURE__ */ l("div", { ref: s, className: a("flex py-4", n), children: t });
|
|
21
|
+
}), h = r(({ className: n, children: t }, s) => /* @__PURE__ */ l("div", { ref: s, className: a("", n), children: t })), y = r(({ className: n, stopId: t, children: s }, e) => {
|
|
22
|
+
const { currentStop: o = 0 } = c(p) || {};
|
|
23
|
+
return /* @__PURE__ */ l(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
ref: e,
|
|
27
|
+
className: a("", n, {
|
|
28
|
+
block: o === t,
|
|
29
|
+
hidden: o !== t
|
|
30
|
+
}),
|
|
31
|
+
children: s
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}), C = r(({ className: n }, t) => {
|
|
35
|
+
const {
|
|
36
|
+
setCurrentStop: s,
|
|
37
|
+
currentStop: e = 0,
|
|
38
|
+
totalStops: o = 0
|
|
39
|
+
} = c(p) || {};
|
|
40
|
+
return /* @__PURE__ */ x("div", { ref: t, className: a("flex justify-between", n), children: [
|
|
41
|
+
/* @__PURE__ */ l(
|
|
42
|
+
b,
|
|
43
|
+
{
|
|
44
|
+
disabled: e === 1,
|
|
45
|
+
onClick: () => e > 1 && (s == null ? void 0 : s(e - 1)),
|
|
46
|
+
children: /* @__PURE__ */ l(b.Label, { children: "Previous" })
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ l(
|
|
50
|
+
b,
|
|
51
|
+
{
|
|
52
|
+
disabled: e === o,
|
|
53
|
+
onClick: () => e < o && (s == null ? void 0 : s(e + 1)),
|
|
54
|
+
children: /* @__PURE__ */ l(b.Label, { children: "Next" })
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] });
|
|
58
|
+
}), w = r(({ className: n, stopId: t = 0, children: s }, e) => {
|
|
59
|
+
const { currentStop: o = 0, totalStops: u = 0 } = c(p) || {}, [i] = d(t), m = f(
|
|
18
60
|
() => ({
|
|
19
|
-
stopNumber:
|
|
61
|
+
stopNumber: i
|
|
20
62
|
}),
|
|
21
|
-
[
|
|
63
|
+
[i]
|
|
22
64
|
);
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ l(N.Provider, { value: m, children: /* @__PURE__ */ x("div", { ref: e, className: a(n, "w-full min-w-[120px]"), children: [
|
|
66
|
+
/* @__PURE__ */ l(
|
|
25
67
|
"div",
|
|
26
68
|
{
|
|
27
|
-
className:
|
|
28
|
-
"mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-future": t >=
|
|
29
|
-
"mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-complete": t <
|
|
69
|
+
className: a({
|
|
70
|
+
"mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-future": t >= o && t < u,
|
|
71
|
+
"mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-complete": t < o && t < u
|
|
30
72
|
})
|
|
31
73
|
}
|
|
32
74
|
),
|
|
33
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ l(
|
|
34
76
|
"p",
|
|
35
77
|
{
|
|
36
|
-
className:
|
|
78
|
+
className: a(
|
|
37
79
|
{
|
|
38
|
-
"relative z-20 -mt-4 bg-tubestop-station-complete": t <
|
|
39
|
-
"relative z-20 -mt-4 bg-tubestop-station-active":
|
|
40
|
-
"relative z-20 -mt-4 bg-tubestop-station-future": t >
|
|
41
|
-
"mt-1": t ===
|
|
80
|
+
"relative z-20 -mt-4 bg-tubestop-station-complete": t < o,
|
|
81
|
+
"relative z-20 -mt-4 bg-tubestop-station-active": o === t,
|
|
82
|
+
"relative z-20 -mt-4 bg-tubestop-station-future": t > o,
|
|
83
|
+
"mt-1": t === u
|
|
42
84
|
},
|
|
43
85
|
"z-10 mx-auto h-6 w-6 rounded-full"
|
|
44
86
|
)
|
|
45
87
|
}
|
|
46
88
|
),
|
|
47
|
-
|
|
89
|
+
s
|
|
48
90
|
] }) });
|
|
49
|
-
}),
|
|
50
|
-
const { currentStop:
|
|
51
|
-
return /* @__PURE__ */
|
|
91
|
+
}), g = r(({ className: n, children: t }, s) => {
|
|
92
|
+
const { currentStop: e = 0 } = c(p) || {}, { stopNumber: o = 0 } = c(N) || {};
|
|
93
|
+
return /* @__PURE__ */ l(
|
|
52
94
|
"p",
|
|
53
95
|
{
|
|
54
|
-
ref:
|
|
55
|
-
className:
|
|
96
|
+
ref: s,
|
|
97
|
+
className: a(
|
|
56
98
|
"mt-2 text-center",
|
|
57
99
|
{
|
|
58
|
-
"font-medium text-tubestop-text-complete":
|
|
59
|
-
"font-bold text-tubestop-text-active":
|
|
60
|
-
"font-medium text-tubestop-text-future":
|
|
100
|
+
"font-medium text-tubestop-text-complete": o < e,
|
|
101
|
+
"font-bold text-tubestop-text-active": e === o,
|
|
102
|
+
"font-medium text-tubestop-text-future": o > e
|
|
61
103
|
},
|
|
62
104
|
n
|
|
63
105
|
),
|
|
@@ -65,13 +107,21 @@ const i = b(null), v = b(
|
|
|
65
107
|
}
|
|
66
108
|
);
|
|
67
109
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
110
|
+
v.displayName = "Tubestop";
|
|
111
|
+
S.displayName = "Tubestops.Header";
|
|
112
|
+
w.displayName = "Tubestops.Stop";
|
|
113
|
+
g.displayName = "Tubestops.Text";
|
|
114
|
+
C.displayName = "Tubestops.Controls";
|
|
115
|
+
h.displayName = "Tubestops.Body";
|
|
116
|
+
y.displayName = "Tubestops.Content";
|
|
117
|
+
const L = Object.assign(v, {
|
|
118
|
+
Header: S,
|
|
119
|
+
Stop: w,
|
|
120
|
+
Text: g,
|
|
121
|
+
Controls: C,
|
|
122
|
+
Body: h,
|
|
123
|
+
Content: y
|
|
74
124
|
});
|
|
75
125
|
export {
|
|
76
|
-
|
|
126
|
+
L as Tubestops
|
|
77
127
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
interface PaletteContextProps {
|
|
4
|
+
prefix?: string;
|
|
5
|
+
record: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
interface PaletteGroupProps {
|
|
8
|
+
config: Record<string, Record<string, string>>;
|
|
9
|
+
}
|
|
10
|
+
interface SwatchContextProps {
|
|
11
|
+
swatchId: string;
|
|
12
|
+
swatch: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const Palette: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & PaletteContextProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const PaletteGroup: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement> & PaletteContextProps & import('react').RefAttributes<HTMLDivElement> & PaletteGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const Swatch: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & SwatchContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
17
|
+
Canvas: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
|
+
Label: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -71,6 +71,13 @@ body {
|
|
|
71
71
|
--color-button-bordered-text: #000000;
|
|
72
72
|
--color-button-bordered-hover: #5f5f5f;
|
|
73
73
|
|
|
74
|
+
/* Carousel */
|
|
75
|
+
--color-carousel-dots-active: #1a1dd9;
|
|
76
|
+
--color-carousel-dots-default: #2c2525;
|
|
77
|
+
--color-carousel-dots-hover: #1a1dd9;
|
|
78
|
+
--color-carousel-arrow-default: #31a3dd;
|
|
79
|
+
--color-carousel-arrow-hover: #ae127a;
|
|
80
|
+
|
|
74
81
|
/* Footer */
|
|
75
82
|
--color-footer-bg: #1b54c6;
|
|
76
83
|
--color-footer-text: #ffffff;
|
|
@@ -88,13 +95,6 @@ body {
|
|
|
88
95
|
--color-tubestop-text-complete: #c9c8c8;
|
|
89
96
|
--color-tubestop-text-future: #5b5b5b;
|
|
90
97
|
|
|
91
|
-
/* Carousel */
|
|
92
|
-
--color-carousel-dots-active: #1a1dd9;
|
|
93
|
-
--color-carousel-dots-default: #2c2525;
|
|
94
|
-
--color-carousel-dots-hover: #1a1dd9;
|
|
95
|
-
--color-carousel-arrow-default: #31a3dd;
|
|
96
|
-
--color-carousel-arrow-hover: #ae127a;
|
|
97
|
-
|
|
98
98
|
/* Nav */
|
|
99
99
|
--color-nav: #ae127a;
|
|
100
100
|
}
|
|
@@ -48,12 +48,12 @@ body.theme-penrithmrt {
|
|
|
48
48
|
--color-button-basic-hover: #cecece;
|
|
49
49
|
|
|
50
50
|
/* Carousel */
|
|
51
|
-
--color-carousel-arrow-default:
|
|
52
|
-
--color-carousel-arrow-hover:
|
|
53
|
-
--color-carousel-dots-default:
|
|
54
|
-
--color-carousel-dots-active:
|
|
55
|
-
--color-carousel-dots-hover:
|
|
56
|
-
|
|
51
|
+
--color-carousel-arrow-default: #3c2f71;
|
|
52
|
+
--color-carousel-arrow-hover: #e94439;
|
|
53
|
+
--color-carousel-dots-default: #3c2f71;
|
|
54
|
+
--color-carousel-dots-active: #e94439;
|
|
55
|
+
--color-carousel-dots-hover: #e94439;
|
|
56
|
+
|
|
57
57
|
/* Footer */
|
|
58
58
|
--color-footer-bg: #1b54c6;
|
|
59
59
|
--color-footer-text: #ffffff;
|
package/lib/tailwind/colors.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable sort-keys */
|
|
2
1
|
export default {
|
|
3
2
|
primary: 'var(--color-primary)',
|
|
4
3
|
secondary: 'var(--color-secondary)',
|
|
@@ -75,7 +74,7 @@ export default {
|
|
|
75
74
|
hover: 'var(--color-carousel-arrow-hover)'
|
|
76
75
|
},
|
|
77
76
|
dots: {
|
|
78
|
-
default: 'var(--color-carousel-dots-
|
|
77
|
+
default: 'var(--color-carousel-dots-default)',
|
|
79
78
|
active: 'var(--color-carousel-dots-active)',
|
|
80
79
|
hover: 'var(--color-carousel-dots-hover)'
|
|
81
80
|
}
|
package/package.json
CHANGED
|
File without changes
|