trepur_components 2.3.38 → 2.3.39

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.
Binary file
@@ -1,4 +1,4 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as l } from "react/jsx-runtime";
2
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";
@@ -8,25 +8,25 @@ import { useKeenSlider as $ } from "../../node_modules/keen-slider/react.js";
8
8
  import { WheelControls as M } from "./utils.js";
9
9
  const N = I(null), A = h(
10
10
  ({
11
- breakpoints: s,
11
+ breakpoints: o,
12
12
  children: t,
13
- className: a,
13
+ className: s,
14
14
  loop: e,
15
15
  perView: n,
16
16
  rubberband: r,
17
17
  spacing: c,
18
18
  ...i
19
19
  }, y) => {
20
- const [f, u] = S(1), [x, l] = S(!1), [C, p] = $(
20
+ const [f, u] = S(1), [x, a] = S(!1), [C, p] = $(
21
21
  {
22
- breakpoints: s,
22
+ breakpoints: o,
23
23
  loop: e,
24
24
  rubberband: r,
25
25
  slideChanged(d) {
26
26
  u(d.track.details.rel);
27
27
  },
28
28
  created() {
29
- l(!0);
29
+ a(!0);
30
30
  },
31
31
  slides: {
32
32
  spacing: c,
@@ -56,18 +56,18 @@ const N = I(null), A = h(
56
56
  var v;
57
57
  d.key === "Tab" && ((v = p.current) == null || v.next());
58
58
  };
59
- return /* @__PURE__ */ o(N.Provider, { value: g, children: /* @__PURE__ */ o(
59
+ return /* @__PURE__ */ l(N.Provider, { value: g, children: /* @__PURE__ */ l(
60
60
  "div",
61
61
  {
62
62
  onKeyDown: w,
63
- className: m("navigation-wrapper w-full", a),
63
+ className: m("navigation-wrapper w-full", s),
64
64
  ref: y,
65
65
  ...i,
66
66
  children: t
67
67
  }
68
68
  ) });
69
69
  }
70
- ), D = h(({ children: s, className: t, ...a }, e) => /* @__PURE__ */ o(
70
+ ), D = h(({ children: o, className: t, ...s }, e) => /* @__PURE__ */ l(
71
71
  "div",
72
72
  {
73
73
  ref: e,
@@ -75,39 +75,39 @@ const N = I(null), A = h(
75
75
  "navigation-wrapper flex w-full justify-between gap-4",
76
76
  t
77
77
  ),
78
- ...a,
79
- children: s
78
+ ...s,
79
+ children: o
80
80
  }
81
- )), P = h(({ className: s, children: t, ...a }) => {
81
+ )), P = h(({ className: o, children: t, ...s }) => {
82
82
  const { sliderRef: e } = b(N) || {};
83
- return /* @__PURE__ */ o(
83
+ return /* @__PURE__ */ l(
84
84
  "div",
85
85
  {
86
86
  ref: e,
87
- className: m("keen-slider w-full pb-4", s),
88
- ...a,
87
+ className: m("keen-slider w-full pb-4", o),
88
+ ...s,
89
89
  children: t
90
90
  }
91
91
  );
92
- }), R = h(({ className: s, rightArrow: t = !1, ...a }, e) => {
92
+ }), R = h(({ className: o, rightArrow: t = !1, ...s }, e) => {
93
93
  const { instanceRef: n } = b(N) || {};
94
- return /* @__PURE__ */ o(
94
+ return /* @__PURE__ */ l(
95
95
  "div",
96
96
  {
97
97
  ref: e,
98
98
  className: m(
99
99
  "hidden md:block my-auto text-carousel-arrow-default hover:cursor-pointer hover:text-carousel-arrow-hover",
100
- s
100
+ o
101
101
  ),
102
102
  onClick: (r) => {
103
103
  var c, i;
104
104
  t ? r.stopPropagation() !== void 0 || ((c = n.current) == null || c.next()) : r.stopPropagation() !== void 0 || ((i = n.current) == null || i.prev());
105
105
  },
106
- ...a,
107
- children: /* @__PURE__ */ o("a", { children: /* @__PURE__ */ o(j, { icon: t ? L : O, size: "3x" }) })
106
+ ...s,
107
+ children: /* @__PURE__ */ l(j, { icon: t ? L : O, size: "3x" })
108
108
  }
109
109
  );
110
- }), z = h(({ className: s, ...t }, a) => {
110
+ }), z = h(({ className: o, ...t }, s) => {
111
111
  var y, f, u, x;
112
112
  const {
113
113
  instanceRef: e,
@@ -115,20 +115,20 @@ const N = I(null), A = h(
115
115
  currentSlide: r = 1,
116
116
  perView: c = 1
117
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) => {
118
+ return /* @__PURE__ */ l("div", { className: m("flex justify-center gap-0.5 pt-2", o), children: [...Array(i).keys()].map((a) => {
119
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
- return /* @__PURE__ */ o(
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 ? a >= r && a < r + c : a >= r || r + c - C - 1 >= a : r === a;
121
+ return /* @__PURE__ */ l(
122
122
  "button",
123
123
  {
124
- ref: a,
124
+ ref: s,
125
125
  type: "button",
126
126
  onClick: () => {
127
127
  var k;
128
- (k = e.current) == null || k.moveToIdx(l);
128
+ (k = e.current) == null || k.moveToIdx(a);
129
129
  },
130
130
  "aria-label": `carousel-button${t.id ? `-${t.id}` : ""}`,
131
- children: /* @__PURE__ */ o(
131
+ children: /* @__PURE__ */ l(
132
132
  j,
133
133
  {
134
134
  className: m(
@@ -140,7 +140,7 @@ const N = I(null), A = h(
140
140
  }
141
141
  )
142
142
  },
143
- l
143
+ a
144
144
  );
145
145
  }) });
146
146
  });
@@ -3,11 +3,8 @@ 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
- Images: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
9
- asCarousel?: boolean | undefined;
10
- } & import('react').RefAttributes<HTMLDivElement>>;
11
8
  Content: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
12
9
  Title: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
13
10
  Subtitle: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
@@ -1,11 +1,8 @@
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
- Images: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
7
- asCarousel?: boolean | undefined;
8
- } & import('react').RefAttributes<HTMLDivElement>>;
9
6
  Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
10
7
  Title: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
11
8
  Subtitle: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
@@ -1,47 +1,30 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { forwardRef as t } from "react";
3
- import { Image as I } from "../Image/index.js";
4
- import N from "clsx";
5
- import { Carousel as s } from "../Carousel/index.js";
6
- const d = t(({ className: e, children: a, onClick: r, ...p }, C) => (
7
- // <a
8
- // ref={ref}
9
- // className="inline-block h-full"
10
- // href=""
11
- // onClick={onClick}
12
- // {...props}
13
- // >
14
- /* @__PURE__ */ m(
15
- "div",
16
- {
17
- ref: C,
18
- className: N(
19
- "grid max-w-96 overflow-hidden rounded-xl bg-white drop-shadow",
20
- e
21
- ),
22
- ...p,
23
- children: a
24
- }
25
- )
26
- )), o = t(({ children: e, asCarousel: a = !1, ...r }) => a ? /* @__PURE__ */ m(s, { perView: 1, spacing: 0, className: "h-64", loop: !0, ...r, children: /* @__PURE__ */ m(s.Content, { children: /* @__PURE__ */ m(s.Slides, { children: e }) }) }) : /* @__PURE__ */ m("div", { children: e[0] })), i = t(({ src: e, ...a }) => (
27
- // <div className="keen-slider__slide h-64">
28
- /* @__PURE__ */ m("div", { className: "h-64", children: /* @__PURE__ */ m(I, { className: "object-cover", src: e, ...a }) })
29
- )), l = t(({ children: e, ...a }, r) => /* @__PURE__ */ m("div", { className: "px-2 pb-4 pt-2", ref: r, ...a, children: e })), n = t(({ ...e }, a) => /* @__PURE__ */ m("p", { className: "text-lg", ref: a, ...e })), g = t(({ ...e }, a) => /* @__PURE__ */ m("p", { className: "text-sm", ref: a, ...e })), c = t(({ ...e }, a) => /* @__PURE__ */ m("p", { className: "line-clamp-4 pt-4", ref: a, ...e }));
30
- d.displayName = "ImageCard";
31
- i.displayName = "ImageCard.Image";
32
- o.displayName = "ImageCard.Images";
33
- n.displayName = "ImageCard.Title";
34
- g.displayName = "ImageCard.Subtitle";
35
- l.displayName = "ImageCard.Content";
36
- c.displayName = "ImageCard.Text";
37
- const y = Object.assign(d, {
38
- Image: i,
39
- Images: o,
40
- Content: l,
41
- Title: n,
42
- Subtitle: g,
43
- Text: c
3
+ import { Image as p } from "../Image/index.js";
4
+ import C from "clsx";
5
+ const s = t(({ className: a, children: e, onClick: r, ...c }, g) => /* @__PURE__ */ m("a", { ref: g, className: "", href: "", onClick: r, ...c, children: /* @__PURE__ */ m(
6
+ "div",
7
+ {
8
+ className: C(
9
+ "grid max-w-96 overflow-hidden rounded-xl bg-white drop-shadow",
10
+ a
11
+ ),
12
+ children: e
13
+ }
14
+ ) })), d = t(({ src: a, ...e }) => /* @__PURE__ */ m("div", { className: "h-64", children: /* @__PURE__ */ m(p, { className: "object-cover", src: a, ...e }) })), o = t(({ children: a, ...e }, r) => /* @__PURE__ */ m("div", { className: "px-2 pb-4 pt-2", ref: r, ...e, children: a })), l = t(({ ...a }, e) => /* @__PURE__ */ m("p", { className: "text-lg", ref: e, ...a })), i = t(({ ...a }, e) => /* @__PURE__ */ m("p", { className: "text-sm", ref: e, ...a })), n = t(({ ...a }, e) => /* @__PURE__ */ m("p", { className: "line-clamp-4 pt-4", ref: e, ...a }));
15
+ s.displayName = "ImageCard";
16
+ d.displayName = "ImageCard.Image";
17
+ l.displayName = "ImageCard.Title";
18
+ i.displayName = "ImageCard.Subtitle";
19
+ o.displayName = "ImageCard.Content";
20
+ n.displayName = "ImageCard.Text";
21
+ const b = Object.assign(s, {
22
+ Image: d,
23
+ Content: o,
24
+ Title: l,
25
+ Subtitle: i,
26
+ Text: n
44
27
  });
45
28
  export {
46
- y as ImageCard
29
+ b as ImageCard
47
30
  };
@@ -28,3 +28,4 @@ export declare const Loading: Story;
28
28
  export declare const Small: Story;
29
29
  export declare const Medium: Story;
30
30
  export declare const Large: Story;
31
+ export declare const Download: Story;
@@ -6,6 +6,7 @@ export interface LinkProps {
6
6
  href?: string;
7
7
  target?: string;
8
8
  size?: 'sm' | 'md' | 'lg';
9
+ downloadFileName?: string;
9
10
  }
10
11
  declare const Link: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLAnchorElement> & LinkProps & import('react').RefAttributes<HTMLAnchorElement>> & {
11
12
  Icon: import('react').ForwardRefExoticComponent<{
@@ -1,23 +1,25 @@
1
1
  import { jsx as b } from "react/jsx-runtime";
2
2
  import { forwardRef as a } from "react";
3
- import { Icon as p } from "../Icon/index.js";
4
- import s from "clsx";
5
- const c = a(
3
+ import { Icon as x } from "../Icon/index.js";
4
+ import c from "clsx";
5
+ const i = a(
6
6
  ({
7
- className: e,
8
- children: o,
7
+ className: o,
8
+ children: e,
9
9
  loading: t = !1,
10
10
  variant: r = "primary",
11
11
  size: n = "sm",
12
- href: m,
13
- target: g,
14
- ...u
12
+ downloadFileName: s,
13
+ href: g,
14
+ target: u,
15
+ ...p
15
16
  }) => /* @__PURE__ */ b("div", { className: "inline-block", children: /* @__PURE__ */ b(
16
17
  "a",
17
18
  {
18
- href: m,
19
- target: g,
20
- className: s(
19
+ href: g,
20
+ target: u,
21
+ ...s && { download: s },
22
+ className: c(
21
23
  "flex items-center gap-3 rounded border text-center",
22
24
  {
23
25
  "duration-200": !t,
@@ -31,20 +33,20 @@ const c = a(
31
33
  "px-12 py-3 text-lg font-normal leading-8": n === "md",
32
34
  "px-12 py-4 text-xl font-normal leading-8": n === "lg"
33
35
  },
34
- e
36
+ o
35
37
  ),
36
- ...u,
37
- children: !t && o
38
+ ...p,
39
+ children: !t && e
38
40
  }
39
41
  ) })
40
- ), i = a(({ className: e, ...o }, t) => /* @__PURE__ */ b("p", { className: s("text-md", e), ref: t, ...o })), d = a(({ icon: e }, o) => /* @__PURE__ */ b(p, { size: "md", ref: o, icon: e }));
41
- c.displayName = "Link";
42
- d.displayName = "Link.Icon";
43
- i.displayName = "Link.Label";
44
- const v = Object.assign(c, {
45
- Icon: d,
46
- Label: i
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 }));
43
+ 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
47
49
  });
48
50
  export {
49
- v as Link
51
+ f as Link
50
52
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trepur_components",
3
- "version": "2.3.38",
3
+ "version": "2.3.39",
4
4
  "description": "component lib",
5
5
  "author": "trepur_ttenneb",
6
6
  "private": false,