trepur_components 2.3.44 → 2.3.46
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.
|
@@ -5,6 +5,7 @@ export interface CollapsibleContextProps {
|
|
|
5
5
|
loading?: boolean;
|
|
6
6
|
expanded?: boolean;
|
|
7
7
|
setExpanded?: (expanded: boolean) => void;
|
|
8
|
+
expandFully?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare const Collapsible: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & CollapsibleContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
10
11
|
Header: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,88 +1,115 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Image as
|
|
5
|
-
import { faChevronDown as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
()
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { jsx as t, jsxs as H } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as T, forwardRef as o, useState as I, useMemo as S, useContext as c } from "react";
|
|
3
|
+
import { Icon as j } from "../Icon/index.js";
|
|
4
|
+
import { Image as L } from "../Image/index.js";
|
|
5
|
+
import { faChevronDown as k, faChevronUp as q } from "@fortawesome/fontawesome-free-solid";
|
|
6
|
+
import n from "clsx";
|
|
7
|
+
const r = T(null), x = o(
|
|
8
|
+
({ id: e, className: l, children: a, loading: s, expandFully: i = !1, ...m }, g) => {
|
|
9
|
+
const [p, d] = I(!1), w = S(
|
|
10
|
+
() => ({
|
|
11
|
+
loading: s,
|
|
12
|
+
expanded: p,
|
|
13
|
+
setExpanded: d,
|
|
14
|
+
expandFully: i
|
|
15
|
+
}),
|
|
16
|
+
[s, p, d]
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ t(r.Provider, { value: w, children: /* @__PURE__ */ t(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
id: e,
|
|
22
|
+
className: n(
|
|
23
|
+
"w-full rounded-2xl bg-white hover:cursor-pointer",
|
|
24
|
+
l
|
|
25
|
+
),
|
|
26
|
+
ref: g,
|
|
27
|
+
...m,
|
|
28
|
+
children: a
|
|
29
|
+
}
|
|
30
|
+
) });
|
|
31
|
+
}
|
|
32
|
+
), C = o(({ className: e, children: l, ...a }, s) => {
|
|
33
|
+
const { expanded: i, setExpanded: m } = c(r) || {};
|
|
34
|
+
return /* @__PURE__ */ H(
|
|
32
35
|
"div",
|
|
33
36
|
{
|
|
34
|
-
className: "flex h-24 pr-4 sm:pr-8",
|
|
35
|
-
onClick: () =>
|
|
36
|
-
ref:
|
|
37
|
-
...
|
|
37
|
+
className: n("flex h-24 pr-4 sm:pr-8", e),
|
|
38
|
+
onClick: () => m == null ? void 0 : m(!i),
|
|
39
|
+
ref: s,
|
|
40
|
+
...a,
|
|
38
41
|
children: [
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
42
|
+
l,
|
|
43
|
+
/* @__PURE__ */ t("div", { className: "my-auto flex-none", children: /* @__PURE__ */ t(j, { icon: i ? k : q }) })
|
|
41
44
|
]
|
|
42
45
|
}
|
|
43
46
|
);
|
|
44
|
-
}),
|
|
47
|
+
}), b = o(({ children: e, className: l, ...a }, s) => /* @__PURE__ */ t(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: n("mx-4 my-auto grid w-full", l),
|
|
51
|
+
ref: s,
|
|
52
|
+
...a,
|
|
53
|
+
children: e
|
|
54
|
+
}
|
|
55
|
+
)), u = o(({ className: e, src: l, ...a }, s) => /* @__PURE__ */ t("div", { ref: s, className: n("aspect-square flex-none p-4", e), children: /* @__PURE__ */ t(L, { src: l, className: "h-full rounded-2xl", ...a }) })), f = o(({ className: e, ...l }, a) => /* @__PURE__ */ t(
|
|
56
|
+
"p",
|
|
57
|
+
{
|
|
58
|
+
className: n("text-xxs text-light-grey truncate md:text-xs", e),
|
|
59
|
+
ref: a,
|
|
60
|
+
...l
|
|
61
|
+
}
|
|
62
|
+
)), N = o(({ className: e, ...l }, a) => /* @__PURE__ */ t(
|
|
45
63
|
"p",
|
|
46
64
|
{
|
|
47
|
-
className: "text-
|
|
48
|
-
ref:
|
|
49
|
-
...
|
|
65
|
+
className: n("md:text-md truncate text-sm", e),
|
|
66
|
+
ref: a,
|
|
67
|
+
...l
|
|
50
68
|
}
|
|
51
|
-
)),
|
|
52
|
-
|
|
53
|
-
|
|
69
|
+
)), h = o(({ className: e, ...l }, a) => /* @__PURE__ */ t(
|
|
70
|
+
"p",
|
|
71
|
+
{
|
|
72
|
+
className: n("truncate text-xs md:text-sm", e),
|
|
73
|
+
ref: a,
|
|
74
|
+
...l
|
|
75
|
+
}
|
|
76
|
+
)), y = o(({ children: e, className: l, ...a }, s) => {
|
|
77
|
+
const { expanded: i, expandFully: m } = c(r) || {};
|
|
78
|
+
return /* @__PURE__ */ t(
|
|
54
79
|
"div",
|
|
55
80
|
{
|
|
56
|
-
className:
|
|
81
|
+
className: n(
|
|
57
82
|
"w-auto overflow-scroll px-4 transition-max-height duration-300",
|
|
58
83
|
{
|
|
59
|
-
"max-h-32":
|
|
60
|
-
"max-h-
|
|
61
|
-
|
|
84
|
+
"max-h-32": i && !m,
|
|
85
|
+
"max-h-full": i && m,
|
|
86
|
+
"max-h-0": !i
|
|
87
|
+
},
|
|
88
|
+
l
|
|
62
89
|
),
|
|
63
|
-
ref:
|
|
64
|
-
...
|
|
90
|
+
ref: s,
|
|
91
|
+
...a,
|
|
65
92
|
children: e
|
|
66
93
|
}
|
|
67
94
|
);
|
|
68
|
-
}), v =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
95
|
+
}), v = o(({ className: e, ...l }, a) => /* @__PURE__ */ t("p", { className: n("text-xs md:text-sm", e), ref: a, ...l }));
|
|
96
|
+
x.displayName = "Collapsible";
|
|
97
|
+
C.displayName = "Collapsible.Header";
|
|
98
|
+
y.displayName = "Collapsible.Content";
|
|
99
|
+
u.displayName = "Collapsible.Image";
|
|
100
|
+
f.displayName = "Collapsible.Label";
|
|
74
101
|
N.displayName = "Collapsible.Title";
|
|
75
|
-
|
|
76
|
-
|
|
102
|
+
h.displayName = "Collapsible.Subtitle";
|
|
103
|
+
b.displayName = "Collapsible.HeaderContent";
|
|
77
104
|
v.displayName = "Collapsible.Text";
|
|
78
|
-
const U = Object.assign(
|
|
79
|
-
Header:
|
|
80
|
-
HeaderContent:
|
|
81
|
-
Image:
|
|
82
|
-
Label:
|
|
105
|
+
const U = Object.assign(x, {
|
|
106
|
+
Header: C,
|
|
107
|
+
HeaderContent: b,
|
|
108
|
+
Image: u,
|
|
109
|
+
Label: f,
|
|
83
110
|
Title: N,
|
|
84
|
-
Subtitle:
|
|
85
|
-
Content:
|
|
111
|
+
Subtitle: h,
|
|
112
|
+
Content: y,
|
|
86
113
|
Text: v
|
|
87
114
|
});
|
|
88
115
|
export {
|