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.
- package/lib/assets/sample.jpg +0 -0
- package/lib/components/Carousel/index.js +28 -28
- package/lib/components/ImageCard/ImageCard.stories.d.ts +1 -4
- package/lib/components/ImageCard/index.d.ts +1 -4
- package/lib/components/ImageCard/index.js +25 -42
- package/lib/components/Link/Link.stories.d.ts +1 -0
- package/lib/components/Link/index.d.ts +1 -0
- package/lib/components/Link/index.js +24 -22
- package/package.json +1 -1
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
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:
|
|
11
|
+
breakpoints: o,
|
|
12
12
|
children: t,
|
|
13
|
-
className:
|
|
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,
|
|
20
|
+
const [f, u] = S(1), [x, a] = S(!1), [C, p] = $(
|
|
21
21
|
{
|
|
22
|
-
breakpoints:
|
|
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
|
-
|
|
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__ */
|
|
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",
|
|
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:
|
|
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
|
-
...
|
|
79
|
-
children:
|
|
78
|
+
...s,
|
|
79
|
+
children: o
|
|
80
80
|
}
|
|
81
|
-
)), P = h(({ className:
|
|
81
|
+
)), P = h(({ className: o, children: t, ...s }) => {
|
|
82
82
|
const { sliderRef: e } = b(N) || {};
|
|
83
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ l(
|
|
84
84
|
"div",
|
|
85
85
|
{
|
|
86
86
|
ref: e,
|
|
87
|
-
className: m("keen-slider w-full pb-4",
|
|
88
|
-
...
|
|
87
|
+
className: m("keen-slider w-full pb-4", o),
|
|
88
|
+
...s,
|
|
89
89
|
children: t
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
|
-
}), R = h(({ className:
|
|
92
|
+
}), R = h(({ className: o, rightArrow: t = !1, ...s }, e) => {
|
|
93
93
|
const { instanceRef: n } = b(N) || {};
|
|
94
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
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
|
-
...
|
|
107
|
-
children: /* @__PURE__ */
|
|
106
|
+
...s,
|
|
107
|
+
children: /* @__PURE__ */ l(j, { icon: t ? L : O, size: "3x" })
|
|
108
108
|
}
|
|
109
109
|
);
|
|
110
|
-
}), z = h(({ className:
|
|
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__ */
|
|
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 ?
|
|
121
|
-
return /* @__PURE__ */
|
|
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:
|
|
124
|
+
ref: s,
|
|
125
125
|
type: "button",
|
|
126
126
|
onClick: () => {
|
|
127
127
|
var k;
|
|
128
|
-
(k = e.current) == null || k.moveToIdx(
|
|
128
|
+
(k = e.current) == null || k.moveToIdx(a);
|
|
129
129
|
},
|
|
130
130
|
"aria-label": `carousel-button${t.id ? `-${t.id}` : ""}`,
|
|
131
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
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<
|
|
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<
|
|
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
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
29
|
+
b as ImageCard
|
|
47
30
|
};
|
|
@@ -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
|
|
4
|
-
import
|
|
5
|
-
const
|
|
3
|
+
import { Icon as x } from "../Icon/index.js";
|
|
4
|
+
import c from "clsx";
|
|
5
|
+
const i = a(
|
|
6
6
|
({
|
|
7
|
-
className:
|
|
8
|
-
children:
|
|
7
|
+
className: o,
|
|
8
|
+
children: e,
|
|
9
9
|
loading: t = !1,
|
|
10
10
|
variant: r = "primary",
|
|
11
11
|
size: n = "sm",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
19
|
-
target:
|
|
20
|
-
|
|
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
|
-
|
|
36
|
+
o
|
|
35
37
|
),
|
|
36
|
-
...
|
|
37
|
-
children: !t &&
|
|
38
|
+
...p,
|
|
39
|
+
children: !t && e
|
|
38
40
|
}
|
|
39
41
|
) })
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
Icon:
|
|
46
|
-
Label:
|
|
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
|
-
|
|
51
|
+
f as Link
|
|
50
52
|
};
|