trepur_components 2.3.46 → 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,35 +1,35 @@
1
- import { jsx as l, jsxs as f, Fragment as C } from "react/jsx-runtime";
2
- import { createContext as T, forwardRef as o, useMemo as x, useContext as v } from "react";
1
+ import { jsx as i, jsxs as C, Fragment as T } from "react/jsx-runtime";
2
+ import { createContext as x, forwardRef as o, useMemo as v, useContext as N } from "react";
3
3
  import t from "clsx";
4
4
  import "../../node_modules/keen-slider/keen-slider.min.css.js";
5
5
  import { useKeenSlider as a } from "../../node_modules/keen-slider/react.js";
6
- import { breakpointsToRender as N } from "./const.js";
7
- import { WheelControls as S, ThumbnailPlugin as g } from "./utils.js";
8
- const m = T(null), u = o(({ children: i, className: e, ...r }, s) => {
9
- const n = x(
6
+ import { breakpointsToRender as S } from "./const.js";
7
+ import { WheelControls as g, ThumbnailPlugin as w } from "./utils.js";
8
+ const m = x(null), u = o(({ children: r, className: l, ...e }, s) => {
9
+ const n = v(
10
10
  () => ({
11
- ...r
11
+ ...e
12
12
  }),
13
- [r]
13
+ [e]
14
14
  );
15
- return /* @__PURE__ */ l(m.Provider, { value: n, children: /* @__PURE__ */ l(
15
+ return /* @__PURE__ */ i(m.Provider, { value: n, children: /* @__PURE__ */ i(
16
16
  "div",
17
17
  {
18
18
  ref: s,
19
- className: t("navigation-wrapper w-full", e),
20
- ...r,
21
- children: i
19
+ className: t("navigation-wrapper w-full", l),
20
+ ...e,
21
+ children: r
22
22
  }
23
23
  ) });
24
- }), d = o(({ className: i, children: e }) => {
25
- const { rubberband: r, loop: s, ...n } = v(m) || {}, [b, p] = a(
24
+ }), d = o(({ className: r, children: l }, e) => {
25
+ const { rubberband: s, loop: n, ...b } = N(m) || {}, [p, h] = a(
26
26
  {
27
- breakpoints: N,
28
- loop: s,
29
- rubberband: r
27
+ breakpoints: S,
28
+ loop: n,
29
+ rubberband: s
30
30
  },
31
- [S]
32
- ), [h] = a(
31
+ [g]
32
+ ), [f] = a(
33
33
  {
34
34
  initial: 0,
35
35
  slides: {
@@ -37,38 +37,39 @@ const m = T(null), u = o(({ children: i, className: e, ...r }, s) => {
37
37
  spacing: 10
38
38
  }
39
39
  },
40
- [g(p)]
40
+ [w(h)]
41
41
  );
42
- return /* @__PURE__ */ f(C, { children: [
43
- /* @__PURE__ */ l(
42
+ return /* @__PURE__ */ C(T, { children: [
43
+ /* @__PURE__ */ i(
44
44
  "div",
45
45
  {
46
- ref: b,
46
+ ref: p ?? e,
47
47
  className: t(
48
48
  "keen-slider h-96 w-full rounded-t-2xl pb-4",
49
- i
49
+ r
50
50
  ),
51
- ...n,
52
- children: e
51
+ ...b,
52
+ children: l
53
53
  }
54
54
  ),
55
- /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("div", { ref: h, className: "keen-slider thumbnail h-24 w-16", children: e }) })
55
+ /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i("div", { ref: f, className: "keen-slider thumbnail h-24 w-16", children: l }) })
56
56
  ] });
57
- }), c = o(({ src: i, ...e }) => /* @__PURE__ */ l(
57
+ }), c = o(({ src: r, ...l }, e) => /* @__PURE__ */ i(
58
58
  "img",
59
59
  {
60
+ ref: e,
60
61
  className: "keen-slider__slide rounded-t-2xl object-cover",
61
- src: i,
62
- ...e
62
+ src: r,
63
+ ...l
63
64
  }
64
65
  ));
65
66
  u.displayName = "CarouselThumbnail";
66
67
  d.displayName = "CarouselThumbnail.Slides";
67
68
  c.displayName = "CarouselThumbnail.Slide";
68
- const F = Object.assign(u, {
69
+ const K = Object.assign(u, {
69
70
  Slides: d,
70
71
  Slide: c
71
72
  });
72
73
  export {
73
- F as CarouselThumbnail
74
+ K as CarouselThumbnail
74
75
  };
@@ -1,45 +1,47 @@
1
- import { jsx as n, jsxs as w } from "react/jsx-runtime";
2
- import { createContext as f, forwardRef as r, useState as D, useRef as b, useMemo as x, useContext as a } from "react";
3
- import { Button as l } from "../Button/index.js";
4
- import { faChevronDown as y } from "@fortawesome/fontawesome-free-solid";
5
- import { useClickOutside as v } from "./utils.js";
6
- const s = f(null), d = r(({ children: t }) => {
7
- const [o, e] = D(!1), i = b(null), u = x(
1
+ import { jsx as r, jsxs as f } from "react/jsx-runtime";
2
+ import { createContext as D, forwardRef as s, useState as b, useRef as x, useMemo as y, useContext as i } from "react";
3
+ import { Button as d } from "../Button/index.js";
4
+ import { faChevronDown as v } from "@fortawesome/fontawesome-free-solid";
5
+ import { useClickOutside as C } from "./utils.js";
6
+ const a = D(null), c = s(({ children: t }, n) => {
7
+ const [o, e] = b(!1), l = x(null), w = y(
8
8
  () => ({
9
9
  showDropdown: o,
10
10
  setShowDropdown: e
11
11
  }),
12
12
  [o, e]
13
13
  );
14
- return v(i, () => {
14
+ return C(l, () => {
15
15
  e(!1);
16
- }), /* @__PURE__ */ n(s.Provider, { value: u, children: /* @__PURE__ */ n("div", { ref: i, className: "relative inline-block text-left", children: t }) });
17
- }), c = r(({ children: t }) => {
18
- const { showDropdown: o, setShowDropdown: e } = a(s) || {};
19
- return /* @__PURE__ */ w(l, { onClick: () => e == null ? void 0 : e(!o), children: [
16
+ }), /* @__PURE__ */ r(a.Provider, { value: w, children: /* @__PURE__ */ r("div", { ref: l ?? n, className: "relative inline-block text-left", children: t }) });
17
+ }), m = s(({ children: t }, n) => {
18
+ const { showDropdown: o, setShowDropdown: e } = i(a) || {};
19
+ return /* @__PURE__ */ f(d, { ref: n, onClick: () => e == null ? void 0 : e(!o), children: [
20
20
  t,
21
- /* @__PURE__ */ n(l.Icon, { icon: y })
21
+ /* @__PURE__ */ r(d.Icon, { icon: v })
22
22
  ] });
23
- }), m = r(
24
- ({ children: t }) => {
25
- const { showDropdown: o } = a(s) || {};
26
- return o ? /* @__PURE__ */ n(
23
+ }), p = s(
24
+ ({ children: t }, n) => {
25
+ const { showDropdown: o } = i(a) || {};
26
+ return o ? /* @__PURE__ */ r(
27
27
  "div",
28
28
  {
29
+ ref: n,
29
30
  className: "z-50 mt-2 w-48 rounded-lg border-2 bg-primary text-white",
30
31
  role: "menu",
31
32
  "aria-orientation": "vertical",
32
33
  "aria-labelledby": "menu-button",
33
- children: /* @__PURE__ */ n("ul", { className: "py-1 text-sm", children: t })
34
+ children: /* @__PURE__ */ r("ul", { className: "py-1 text-sm", children: t })
34
35
  }
35
- ) : /* @__PURE__ */ n("div", {});
36
+ ) : /* @__PURE__ */ r("div", {});
36
37
  }
37
- ), p = r(
38
- ({ children: t }) => {
39
- const { setShowDropdown: o } = a(s) || {};
40
- return /* @__PURE__ */ n(
38
+ ), u = s(
39
+ ({ children: t }, n) => {
40
+ const { setShowDropdown: o } = i(a) || {};
41
+ return /* @__PURE__ */ r(
41
42
  "li",
42
43
  {
44
+ ref: n,
43
45
  className: "px-4 py-2",
44
46
  onClick: () => {
45
47
  o == null || o(!1);
@@ -52,15 +54,15 @@ const s = f(null), d = r(({ children: t }) => {
52
54
  );
53
55
  }
54
56
  );
55
- d.displayName = "Dropdown";
56
- c.displayName = "Dropdown.Label";
57
- m.displayName = "Dropdown.List";
58
- p.displayName = "Dropdown.Item";
59
- const I = Object.assign(d, {
60
- Label: c,
61
- List: m,
62
- Item: p
57
+ c.displayName = "Dropdown";
58
+ m.displayName = "Dropdown.Label";
59
+ p.displayName = "Dropdown.List";
60
+ u.displayName = "Dropdown.Item";
61
+ const g = Object.assign(c, {
62
+ Label: m,
63
+ List: p,
64
+ Item: u
63
65
  });
64
66
  export {
65
- I as Dropdown
67
+ g as Dropdown
66
68
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { forwardRef as n } from "react";
3
3
  import s from "clsx";
4
- import { Icon as N } from "../Icon/index.js";
4
+ import { Icon as d } from "../Icon/index.js";
5
5
  const l = n(({ className: o, children: e, ...t }, r) => /* @__PURE__ */ a(
6
6
  "div",
7
7
  {
@@ -13,9 +13,10 @@ const l = n(({ className: o, children: e, ...t }, r) => /* @__PURE__ */ a(
13
13
  ...t,
14
14
  children: e
15
15
  }
16
- )), m = n(({ className: o, children: e, href: t, onClick: r, ...p }) => /* @__PURE__ */ a(
16
+ )), m = n(({ className: o, children: e, href: t, onClick: r, ...p }, N) => /* @__PURE__ */ a(
17
17
  "div",
18
18
  {
19
+ ref: N,
19
20
  className: s(
20
21
  "group w-full cursor-pointer py-2 text-center transition-all duration-500",
21
22
  o
@@ -31,16 +32,16 @@ const l = n(({ className: o, children: e, ...t }, r) => /* @__PURE__ */ a(
31
32
  ...t,
32
33
  children: e
33
34
  }
34
- )), c = n(({ icon: o, ...e }) => /* @__PURE__ */ a(N, { icon: o, ...e }));
35
+ )), c = n(({ icon: o, ...e }, t) => /* @__PURE__ */ a(d, { icon: o, ref: t, ...e }));
35
36
  l.displayName = "FooterNav";
36
37
  m.displayName = "FooterNav.Item";
37
38
  c.displayName = "FooterNav.Icon";
38
39
  i.displayName = "FooterNav.Label";
39
- const x = Object.assign(l, {
40
+ const F = Object.assign(l, {
40
41
  Item: m,
41
42
  Label: i,
42
43
  Icon: c
43
44
  });
44
45
  export {
45
- x as FooterNav
46
+ F as FooterNav
46
47
  };
@@ -1,52 +1,53 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { forwardRef as o } from "react";
3
3
  import { Image as N } from "../Image/index.js";
4
- import s from "clsx";
4
+ import r from "clsx";
5
5
  import { Button as f } from "../Button/index.js";
6
- const d = o(({ className: a, children: e, onClick: t, ...r }, I) => /* @__PURE__ */ m(
6
+ const d = o(({ className: a, children: e, onClick: t, ...s }, I) => /* @__PURE__ */ m(
7
7
  "div",
8
8
  {
9
9
  ref: I,
10
- className: s(
10
+ className: r(
11
11
  "grid overflow-hidden rounded-xl bg-white drop-shadow",
12
12
  a
13
13
  ),
14
14
  onClick: t,
15
- ...r,
15
+ ...s,
16
16
  children: e
17
17
  }
18
- )), n = o(({ src: a, ...e }) => /* @__PURE__ */ m("div", { className: "h-64", children: /* @__PURE__ */ m(N, { className: "object-cover", src: a, ...e }) })), i = o(({ children: a, className: e, ...t }, r) => /* @__PURE__ */ m("div", { className: s("p-4 pt-2", e), ref: r, ...t, children: a })), l = o(({ className: a, ...e }, t) => /* @__PURE__ */ m("p", { className: s("text-sm font-bold", a), ref: t, ...e })), p = o(({ className: a, ...e }, t) => /* @__PURE__ */ m("p", { className: s("text-sm font-thin", a), ref: t, ...e })), c = o(({ className: a, ...e }, t) => /* @__PURE__ */ m(
18
+ )), n = o(({ src: a, ...e }, t) => /* @__PURE__ */ m("div", { ref: t, className: "h-64", children: /* @__PURE__ */ m(N, { className: "object-cover", src: a, ...e }) })), l = o(({ children: a, className: e, ...t }, s) => /* @__PURE__ */ m("div", { className: r("p-4 pt-2", e), ref: s, ...t, children: a })), i = o(({ className: a, ...e }, t) => /* @__PURE__ */ m("p", { className: r("text-sm font-bold", a), ref: t, ...e })), p = o(({ className: a, ...e }, t) => /* @__PURE__ */ m("p", { className: r("text-sm font-normal", a), ref: t, ...e })), c = o(({ className: a, ...e }, t) => /* @__PURE__ */ m(
19
19
  "p",
20
20
  {
21
- className: s("line-clamp-5 pt-2 text-md font-normal", a),
21
+ className: r("line-clamp-5 pt-2 text-md font-normal", a),
22
22
  ref: t,
23
23
  ...e
24
24
  }
25
- )), g = o(({ children: a, className: e, ...t }) => /* @__PURE__ */ m(
25
+ )), g = o(({ children: a, className: e, ...t }, s) => /* @__PURE__ */ m(
26
26
  f,
27
27
  {
28
- className: s("mt-4 my-auto w-full justify-center", e),
28
+ ref: s,
29
+ className: r("mt-4 my-auto w-full justify-center", e),
29
30
  ...t,
30
31
  children: a
31
32
  }
32
- )), C = o(({ children: a, className: e, ...t }) => /* @__PURE__ */ m("p", { className: s("pt-4 text-end text-sm", e), ...t, children: a }));
33
+ )), C = o(({ children: a, className: e, ...t }, s) => /* @__PURE__ */ m("p", { ref: s, className: r("pt-4 text-end text-sm", e), ...t, children: a }));
33
34
  d.displayName = "ImageCard";
34
35
  n.displayName = "ImageCard.Image";
35
- l.displayName = "ImageCard.Title";
36
+ i.displayName = "ImageCard.Title";
36
37
  p.displayName = "ImageCard.Subtitle";
37
- i.displayName = "ImageCard.Content";
38
+ l.displayName = "ImageCard.Content";
38
39
  c.displayName = "ImageCard.Text";
39
40
  g.displayName = "ImageCard.Button";
40
41
  C.displayName = "ImageCard.Caption";
41
- const T = Object.assign(d, {
42
+ const h = Object.assign(d, {
42
43
  Image: n,
43
- Content: i,
44
- Title: l,
44
+ Content: l,
45
+ Title: i,
45
46
  Subtitle: p,
46
47
  Text: c,
47
48
  Button: g,
48
49
  Caption: C
49
50
  });
50
51
  export {
51
- T as ImageCard
52
+ h as ImageCard
52
53
  };
@@ -8,7 +8,7 @@ declare const meta: {
8
8
  Label: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
9
9
  required?: boolean | undefined;
10
10
  } & import('react').RefAttributes<HTMLDivElement>>;
11
- Box: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
11
+ Box: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLInputElement> & import('react').RefAttributes<HTMLInputElement>>;
12
12
  Validation: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
13
13
  };
14
14
  args: {
@@ -27,7 +27,7 @@ declare const Input: import('react').ForwardRefExoticComponent<HTMLAttributes<HT
27
27
  Label: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
28
28
  required?: boolean | undefined;
29
29
  } & import('react').RefAttributes<HTMLDivElement>>;
30
- Box: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
30
+ Box: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLInputElement> & import('react').RefAttributes<HTMLInputElement>>;
31
31
  Validation: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
32
32
  };
33
33
  export { Input };
@@ -1,69 +1,70 @@
1
1
  import { jsx as o, jsxs as I } from "react/jsx-runtime";
2
2
  import { createContext as b, forwardRef as a, useMemo as N, useRef as y, useContext as d } from "react";
3
3
  import m from "clsx";
4
- const s = b(null), p = a(({ children: n, errors: e, placeholder: t, ...r }, l) => {
4
+ const s = b(null), p = a(({ children: r, errors: e, placeholder: t, ...n }, l) => {
5
5
  const f = N(
6
6
  () => ({
7
7
  errors: e,
8
8
  placeholder: t,
9
- ...r
9
+ ...n
10
10
  }),
11
- [e, r]
11
+ [e, n]
12
12
  );
13
- return /* @__PURE__ */ o(s.Provider, { value: f, children: /* @__PURE__ */ o("div", { ref: l, children: n }) });
13
+ return /* @__PURE__ */ o(s.Provider, { value: f, children: /* @__PURE__ */ o("div", { ref: l, children: r }) });
14
14
  }), u = a(
15
- ({ children: n, ...e }, t) => {
16
- const r = y(null);
15
+ ({ children: r, ...e }, t) => {
16
+ const n = y(null);
17
17
  return /* @__PURE__ */ o(
18
18
  "div",
19
19
  {
20
20
  className: "mt-4 w-full",
21
21
  onClick: () => {
22
22
  var l;
23
- return (l = r.current) == null ? void 0 : l.focus();
23
+ return (l = n.current) == null ? void 0 : l.focus();
24
24
  },
25
25
  ref: t,
26
26
  ...e,
27
- children: n
27
+ children: r
28
28
  }
29
29
  );
30
30
  }
31
- ), i = a(({ className: n, children: e, required: t = !1 }, r) => /* @__PURE__ */ I(
31
+ ), i = a(({ className: r, children: e, required: t = !1 }, n) => /* @__PURE__ */ I(
32
32
  "div",
33
33
  {
34
- ref: r,
35
- className: m("flex px-1 text-sm font-normal leading-5", n),
34
+ ref: n,
35
+ className: m("flex px-1 text-sm font-normal leading-5", r),
36
36
  children: [
37
37
  /* @__PURE__ */ o("p", { children: e }),
38
38
  t && /* @__PURE__ */ o("p", { className: "text-sm font-normal", children: " *" })
39
39
  ]
40
40
  }
41
41
  )), c = a(
42
- ({ ...n }) => {
43
- const { errors: e, placeholder: t } = d(s) || {};
42
+ ({ ...r }, e) => {
43
+ const { errors: t, placeholder: n } = d(s) || {};
44
44
  return /* @__PURE__ */ o(
45
45
  "input",
46
46
  {
47
- placeholder: t,
47
+ ref: e,
48
+ placeholder: n,
48
49
  className: m(
49
50
  "text-ink text-md w-full rounded-md border border-gray-300 bg-white py-2 pl-4",
50
51
  {
51
- "border-error border-2": e != null
52
+ "border-error border-2": t != null
52
53
  }
53
54
  ),
54
- ...n
55
+ ...r
55
56
  }
56
57
  );
57
58
  }
58
- ), x = a(({ ...n }, e) => {
59
+ ), x = a(({ ...r }, e) => {
59
60
  const { errors: t } = d(s) || {};
60
61
  return /* @__PURE__ */ o(
61
62
  "div",
62
63
  {
63
64
  ref: e,
64
65
  className: "text-md gap-y-2 pl-1 pt-2 font-semibold text-error-default",
65
- ...n,
66
- children: t == null ? void 0 : t.map((r, l) => /* @__PURE__ */ o("p", { children: r }, `error-msg-${l + 1}`))
66
+ ...r,
67
+ children: t == null ? void 0 : t.map((n, l) => /* @__PURE__ */ o("p", { children: n }, `error-msg-${l + 1}`))
67
68
  }
68
69
  );
69
70
  });
@@ -26,6 +26,5 @@ export declare const Ghost: Story;
26
26
  export declare const Basic: Story;
27
27
  export declare const Loading: Story;
28
28
  export declare const Small: Story;
29
- export declare const Medium: Story;
30
29
  export declare const Large: Story;
31
30
  export declare const Download: Story;
@@ -1,6 +1,6 @@
1
- import { jsx as b } from "react/jsx-runtime";
1
+ import { jsx as n } from "react/jsx-runtime";
2
2
  import { forwardRef as a } from "react";
3
- import { Icon as x } from "../Icon/index.js";
3
+ import { Icon as h } from "../Icon/index.js";
4
4
  import c from "clsx";
5
5
  const i = a(
6
6
  ({
@@ -8,15 +8,16 @@ const i = a(
8
8
  children: e,
9
9
  loading: t = !1,
10
10
  variant: r = "primary",
11
- size: n = "sm",
11
+ size: b = "sm",
12
12
  downloadFileName: s,
13
- href: g,
13
+ href: m,
14
14
  target: u,
15
15
  ...p
16
- }) => /* @__PURE__ */ b("div", { className: "inline-block", children: /* @__PURE__ */ b(
16
+ }, x) => /* @__PURE__ */ n(
17
17
  "a",
18
18
  {
19
- href: g,
19
+ ref: x,
20
+ href: m,
20
21
  target: u,
21
22
  ...s && { download: s },
22
23
  className: c(
@@ -29,24 +30,24 @@ const i = a(
29
30
  "border-button-bordered-border text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active": r === "bordered" && !t,
30
31
  "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,
31
32
  "w-40 animate-pulse border-loading bg-loading": t,
32
- "px-12 py-3 text-base font-normal leading-4": n === "sm",
33
- "px-12 py-3 text-lg font-normal leading-8": n === "md",
34
- "px-12 py-4 text-xl font-normal leading-8": n === "lg"
33
+ "px-12 py-3 text-base font-normal leading-4": b === "sm",
34
+ "px-12 py-3 text-lg font-normal leading-8": b === "md",
35
+ "px-12 py-4 text-xl font-normal leading-8": b === "lg"
35
36
  },
36
37
  o
37
38
  ),
38
39
  ...p,
39
40
  children: !t && e
40
41
  }
41
- ) })
42
- ), d = a(({ className: o, ...e }, t) => /* @__PURE__ */ b("p", { className: c("text-md", o), ref: t, ...e })), m = a(({ icon: o }, e) => /* @__PURE__ */ b(x, { size: "md", ref: e, icon: o }));
42
+ )
43
+ ), g = a(({ className: o, ...e }, t) => /* @__PURE__ */ n("p", { className: c("text-md", o), ref: t, ...e })), d = a(({ icon: o }, e) => /* @__PURE__ */ n(h, { size: "lg", ref: e, icon: o }));
43
44
  i.displayName = "Link";
44
- m.displayName = "Link.Icon";
45
- d.displayName = "Link.Label";
46
- const f = Object.assign(i, {
47
- Icon: m,
48
- Label: d
45
+ d.displayName = "Link.Icon";
46
+ g.displayName = "Link.Label";
47
+ const L = Object.assign(i, {
48
+ Icon: d,
49
+ Label: g
49
50
  });
50
51
  export {
51
- f as Link
52
+ L as Link
52
53
  };