trepur_components 2.3.34 → 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.
@@ -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<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>> & {
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<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>> & {
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 c from "clsx";
5
- const d = m(({ className: a, children: e, ...r }, n) => /* @__PURE__ */ t(
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: c(
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 })), g = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-md pt-2", 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
- g.displayName = "ImageCard.Text";
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: g
26
+ Text: n
29
27
  });
30
28
  export {
31
29
  b as ImageCard
@@ -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 o } from "react/jsx-runtime";
2
- import { forwardRef as t } from "react";
3
- import i from "clsx";
4
- import { Icon as c } from "../Icon/index.js";
5
- const s = t(({ children: r, variant: e = "info" }, l) => /* @__PURE__ */ o(
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: l,
9
- className: i(
10
- "inline-grid grid-flow-col items-center gap-1 rounded-full border px-2 py-0.5",
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: r
22
+ children: o
19
23
  }
20
- )), n = t(({ className: r, ...e }, l) => /* @__PURE__ */ o("p", { className: i("text-xs", r), ref: l, ...e })), a = t(({ icon: r }, e) => /* @__PURE__ */ o(c, { size: "xs", ref: e, icon: r }));
21
- s.displayName = "Pill";
22
- a.displayName = "Pill.Icon";
23
- n.displayName = "Chip.Label";
24
- const u = Object.assign(s, {
25
- Icon: a,
26
- Label: n
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
- u as Pill
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), x = o(({ className: r, children: l, swapDesktop: t, swapMobile: e, ...i }, s) => {
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
- }), g = o(({ className: r, children: l, ...t }, e) => {
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 text-6xl font-semibold tracking-wider md:text-4xl lg:text-6xl",
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
- x.displayName = "SplitCard";
75
- g.displayName = "SplitCard.LeftContent";
74
+ g.displayName = "SplitCard";
75
+ x.displayName = "SplitCard.LeftContent";
76
76
  C.displayName = "SplitCard.RightContent";
77
- const j = Object.assign(x, {
78
- LeftContent: g,
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 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";
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 = T(null), N = T(
5
+ const p = f(null), N = f(
6
6
  null
7
- ), v = r(({ className: n, children: t, activeStop: s = 1 }, e) => {
8
- const [o, u] = d(s), [i, m] = d(0), j = f(
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: i ?? 0,
10
+ totalStops: c ?? 0,
11
11
  setTotalStops: m,
12
12
  currentStop: o,
13
13
  setCurrentStop: u
14
14
  }),
15
- [o, u, i, m]
15
+ [o, u, c, m]
16
16
  );
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) || {};
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: a("", n, {
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
- }), C = r(({ className: n }, t) => {
34
+ }), w = a(({ className: n }, t) => {
35
35
  const {
36
36
  setCurrentStop: s,
37
37
  currentStop: e = 0,
38
38
  totalStops: o = 0
39
- } = c(p) || {};
40
- return /* @__PURE__ */ x("div", { ref: t, className: a("flex justify-between", n), children: [
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
- }), 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(
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: i
65
+ stopNumber: m
62
66
  }),
63
- [i]
67
+ [m]
64
68
  );
65
- return /* @__PURE__ */ l(N.Provider, { value: m, children: /* @__PURE__ */ x("div", { ref: e, className: a(n, "w-full min-w-[120px]"), children: [
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: 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
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
- className: a(
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 === u
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
- }), g = r(({ className: n, children: t }, s) => {
92
- const { currentStop: e = 0 } = c(p) || {}, { stopNumber: o = 0 } = c(N) || {};
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: a(
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
- 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
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trepur_components",
3
- "version": "2.3.34",
3
+ "version": "2.3.35",
4
4
  "description": "component lib",
5
5
  "author": "trepur_ttenneb",
6
6
  "private": false,