trepur_components 2.3.35 → 2.3.37
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/ImageCard/ImageCard.stories.d.ts +3 -0
- package/lib/components/ImageCard/index.d.ts +3 -0
- package/lib/components/ImageCard/index.js +39 -23
- package/lib/components/SplitCard/SplitCard.stories.d.ts +1 -0
- package/lib/components/SplitCard/index.d.ts +1 -0
- package/lib/components/SplitCard/index.js +60 -53
- package/package.json +2 -1
|
@@ -5,6 +5,9 @@ declare const meta: {
|
|
|
5
5
|
title: string;
|
|
6
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>>;
|
|
8
11
|
Content: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
12
|
Title: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
10
13
|
Subtitle: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
@@ -3,6 +3,9 @@ import { HTMLAttributes } from 'react';
|
|
|
3
3
|
|
|
4
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>>;
|
|
6
9
|
Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
10
|
Title: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
8
11
|
Subtitle: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
@@ -1,30 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Image as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as r } from "react";
|
|
3
|
+
import { Image as C } from "../Image/index.js";
|
|
4
|
+
import N from "clsx";
|
|
5
|
+
import { Carousel as s } from "../Carousel/index.js";
|
|
6
|
+
const l = r(({ className: e, children: a, onClick: t, ...p }, I) => /* @__PURE__ */ m(
|
|
7
|
+
"a",
|
|
7
8
|
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
ref: I,
|
|
10
|
+
className: "inline-block h-full",
|
|
11
|
+
href: "",
|
|
12
|
+
onClick: t,
|
|
13
|
+
...p,
|
|
14
|
+
children: /* @__PURE__ */ m(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: N(
|
|
18
|
+
"grid max-w-96 overflow-hidden rounded-xl bg-white drop-shadow",
|
|
19
|
+
e
|
|
20
|
+
),
|
|
21
|
+
children: a
|
|
22
|
+
}
|
|
23
|
+
)
|
|
13
24
|
}
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
l.displayName = "ImageCard
|
|
25
|
+
)), d = r(({ children: e, asCarousel: a = !1, ...t }) => a ? /* @__PURE__ */ m(s, { perView: 1, spacing: 0, className: "h-64", loop: !0, ...t, children: /* @__PURE__ */ m(s.Content, { children: /* @__PURE__ */ m(s.Slides, { children: e }) }) }) : /* @__PURE__ */ m("div", { children: e[0] })), i = r(({ src: e, ...a }) => (
|
|
26
|
+
// <div className="keen-slider__slide h-64">
|
|
27
|
+
/* @__PURE__ */ m("div", { className: "h-64", children: /* @__PURE__ */ m(C, { className: "object-cover", src: e, ...a }) })
|
|
28
|
+
)), o = r(({ children: e, ...a }, t) => /* @__PURE__ */ m("div", { className: "px-2 pb-4 pt-2", ref: t, ...a, children: e })), n = r(({ ...e }, a) => /* @__PURE__ */ m("p", { className: "text-lg", ref: a, ...e })), c = r(({ ...e }, a) => /* @__PURE__ */ m("p", { className: "text-sm", ref: a, ...e })), g = r(({ ...e }, a) => /* @__PURE__ */ m("p", { className: "line-clamp-4 pt-4", ref: a, ...e }));
|
|
29
|
+
l.displayName = "ImageCard";
|
|
30
|
+
i.displayName = "ImageCard.Image";
|
|
31
|
+
d.displayName = "ImageCard.Images";
|
|
32
|
+
n.displayName = "ImageCard.Title";
|
|
33
|
+
c.displayName = "ImageCard.Subtitle";
|
|
19
34
|
o.displayName = "ImageCard.Content";
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
Image:
|
|
35
|
+
g.displayName = "ImageCard.Text";
|
|
36
|
+
const y = Object.assign(l, {
|
|
37
|
+
Image: i,
|
|
38
|
+
Images: d,
|
|
23
39
|
Content: o,
|
|
24
|
-
Title:
|
|
25
|
-
Subtitle:
|
|
26
|
-
Text:
|
|
40
|
+
Title: n,
|
|
41
|
+
Subtitle: c,
|
|
42
|
+
Text: g
|
|
27
43
|
});
|
|
28
44
|
export {
|
|
29
|
-
|
|
45
|
+
y as ImageCard
|
|
30
46
|
};
|
|
@@ -4,6 +4,7 @@ export interface SplitCardContextProps {
|
|
|
4
4
|
swapDesktop?: boolean;
|
|
5
5
|
swapMobile?: boolean;
|
|
6
6
|
isMd?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare const SplitCard: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & SplitCardContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
9
10
|
LeftContent: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,85 +1,92 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as S, forwardRef as n, useMemo as v, useContext as u } from "react";
|
|
3
|
+
import w from "../../utils/matchMedia.js";
|
|
4
4
|
import { Screens as y } from "../../utils/screens.js";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
import o from "clsx";
|
|
6
|
+
const p = S(null), g = n(
|
|
7
|
+
({ className: r, children: a, swapDesktop: t, swapMobile: l, loading: s, ...i }, d) => {
|
|
8
|
+
const C = `(min-width: ${y.md})`, c = w(C), h = v(
|
|
9
|
+
() => ({
|
|
10
|
+
swapDesktop: t,
|
|
11
|
+
swapMobile: l,
|
|
12
|
+
isMd: c,
|
|
13
|
+
loading: s
|
|
14
|
+
}),
|
|
15
|
+
[t, l, c, s]
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ e(p.Provider, { value: h, children: /* @__PURE__ */ e(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
ref: d,
|
|
21
|
+
...i,
|
|
22
|
+
className: o("grid grid-cols-1 md:grid-cols-2", r),
|
|
23
|
+
children: a
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
26
|
+
}
|
|
27
|
+
), f = n(({ className: r, children: a, ...t }, l) => {
|
|
28
|
+
const { swapDesktop: s, swapMobile: i, isMd: d, loading: m } = u(p) || {};
|
|
29
|
+
return m ? /* @__PURE__ */ e("div", { className: "pl-20 px-12 py-12 h-full w-full flex", children: /* @__PURE__ */ e("div", { className: "m-auto h-80 border-4 rounded border-gray-300 animate-pulse gap-4 grid w-full" }) }) : /* @__PURE__ */ e(
|
|
27
30
|
"div",
|
|
28
31
|
{
|
|
29
|
-
ref:
|
|
32
|
+
ref: l,
|
|
30
33
|
...t,
|
|
31
|
-
className:
|
|
34
|
+
className: o(
|
|
32
35
|
"mx-auto flex items-center px-4 py-2 text-center md:p-8 lg:py-12",
|
|
33
36
|
{
|
|
34
|
-
"md:order-last lg:pl-12 lg:pr-20":
|
|
35
|
-
"lg:pl-20 lg:pr-12": !
|
|
36
|
-
"order-last": !
|
|
37
|
+
"md:order-last lg:pl-12 lg:pr-20": s,
|
|
38
|
+
"lg:pl-20 lg:pr-12": !s,
|
|
39
|
+
"order-last": !d && i
|
|
37
40
|
},
|
|
38
41
|
r
|
|
39
42
|
),
|
|
40
|
-
children:
|
|
43
|
+
children: a
|
|
41
44
|
}
|
|
42
45
|
);
|
|
43
|
-
}),
|
|
44
|
-
const { swapDesktop:
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
+
}), x = n(({ className: r, children: a, ...t }, l) => {
|
|
47
|
+
const { swapDesktop: s, swapMobile: i, isMd: d, loading: m } = u(p) || {};
|
|
48
|
+
return m ? /* @__PURE__ */ e("div", { className: "h-full w-full flex", children: /* @__PURE__ */ N("div", { className: "m-auto gap-4 grid w-10/12", children: [
|
|
49
|
+
/* @__PURE__ */ e("div", { className: "mx-auto h-8 bg-gray-300 rounded-full w-40 animate-pulse" }),
|
|
50
|
+
/* @__PURE__ */ e("div", { className: "h-6 bg-gray-300 rounded-full w-full animate-pulse" }),
|
|
51
|
+
/* @__PURE__ */ e("div", { className: "h-6 bg-gray-300 rounded-full w-full animate-pulse" })
|
|
52
|
+
] }) }) : /* @__PURE__ */ e(
|
|
46
53
|
"div",
|
|
47
54
|
{
|
|
48
|
-
ref:
|
|
55
|
+
ref: l,
|
|
49
56
|
...t,
|
|
50
|
-
className:
|
|
57
|
+
className: o(
|
|
51
58
|
"flex h-full items-center px-4 py-2 text-center md:p-8 lg:py-12",
|
|
52
59
|
{
|
|
53
|
-
"md:order-first lg:pl-20 lg:pr-12":
|
|
54
|
-
"lg:pl-12 lg:pr-20": !
|
|
55
|
-
"order-first": !
|
|
60
|
+
"md:order-first lg:pl-20 lg:pr-12": s,
|
|
61
|
+
"lg:pl-12 lg:pr-20": !s,
|
|
62
|
+
"order-first": !d && i
|
|
56
63
|
},
|
|
57
64
|
r
|
|
58
65
|
),
|
|
59
|
-
children:
|
|
66
|
+
children: a
|
|
60
67
|
}
|
|
61
68
|
);
|
|
62
|
-
}),
|
|
69
|
+
}), b = n(({ className: r, children: a, ...t }, l) => /* @__PURE__ */ e(
|
|
63
70
|
"p",
|
|
64
71
|
{
|
|
65
|
-
ref:
|
|
66
|
-
className:
|
|
72
|
+
ref: l,
|
|
73
|
+
className: o(
|
|
67
74
|
"items-center font-semibold tracking-wider md:text-4xl lg:text-6xl",
|
|
68
75
|
r
|
|
69
76
|
),
|
|
70
77
|
...t,
|
|
71
|
-
children:
|
|
78
|
+
children: a
|
|
72
79
|
}
|
|
73
|
-
)),
|
|
80
|
+
)), M = n(({ className: r, children: a, ...t }, l) => /* @__PURE__ */ e("p", { ref: l, className: o("text-lg", r), ...t, children: a }));
|
|
74
81
|
g.displayName = "SplitCard";
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
LeftContent:
|
|
79
|
-
RightContent:
|
|
80
|
-
Title:
|
|
81
|
-
Text:
|
|
82
|
+
f.displayName = "SplitCard.LeftContent";
|
|
83
|
+
x.displayName = "SplitCard.RightContent";
|
|
84
|
+
const z = Object.assign(g, {
|
|
85
|
+
LeftContent: f,
|
|
86
|
+
RightContent: x,
|
|
87
|
+
Title: b,
|
|
88
|
+
Text: M
|
|
82
89
|
});
|
|
83
90
|
export {
|
|
84
|
-
|
|
91
|
+
z as SplitCard
|
|
85
92
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trepur_components",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.37",
|
|
4
4
|
"description": "component lib",
|
|
5
5
|
"author": "trepur_ttenneb",
|
|
6
6
|
"private": false,
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
|
51
51
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
52
52
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
53
|
+
"@tailwindcss/line-clamp": "^0.4.4",
|
|
53
54
|
"class-variance-authority": "^0.7.0",
|
|
54
55
|
"classnames": "^2.5.1",
|
|
55
56
|
"clsx": "^2.1.1",
|